query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
78b56fa3b206beabff1a5a2beb7c116c
Merge route into the global application state TODO: refactor reducers into separate file
[ { "docid": "a8bccaa29e167667596b717042c4837e", "score": "0.56711113", "text": "function routeReducer(state = routeInitialState, action) {\n switch (action.type) {\n /* istanbul ignore next */\n case LOCATION_CHANGE:\n return state.merge({\n locationBeforeTransitions: action.payload,\n });\n default:\n return state;\n }\n}", "title": "" } ]
[ { "docid": "ab1be96dd74fa8cf793c6e787887f53e", "score": "0.60368526", "text": "changeRouteStore(newRoute, action) {\n let route = this.getRoute(newRoute);\n if(route) {\n if(route.reducer) {\n this.routeStoreReducer = route.reducer\n } else if(route.reducers && Object.keys(route.reducers).length >0) {\n this.routeStoreReducer = combineReducers(route.reducers)\n }\n if(this.routeStoreReducer) {\n return this.routeStoreReducer({}, action)\n }\n }\n return {};\n }", "title": "" }, { "docid": "1fc1af0605c0d710b6410cdc209ed9c2", "score": "0.6021305", "text": "function routeReducer(state = routeInitialState, action) {\n switch (action.type) {\n /* istanbul ignore next */\n case LOCATION_CHANGE:\n return state.merge({\n location: action.payload,\n });\n default:\n return state;\n }\n}", "title": "" }, { "docid": "1a5f6ed93932a5152a62b8bf0a8fd10d", "score": "0.59970754", "text": "includeRoutes(){\n new mainModules(this.app).initAPIs();\n new socketEvents(this.socket).socketConfig();\n }", "title": "" }, { "docid": "6d759f9b4ada46222e98d46c00677579", "score": "0.5994214", "text": "function routeReducer(state = routeInitialState, action) {\n switch (action.type) {\n /* istanbul ignore next */\n case LOCATION_CHANGE: return state\n .merge({ location: action.payload });\n default: return state;\n }\n}", "title": "" }, { "docid": "a78d0cd14794dbd260c629ee91a386a8", "score": "0.59852546", "text": "[ActionTypes.MODIFY_ROUTE](state, action) {\n if (!state.next) {\n return state;\n }\n const { payload } = action;\n return {\n ...state,\n next: {\n ...state.next,\n exit: !!payload.exit\n }\n };\n }", "title": "" }, { "docid": "cbf5b13076d957beafa928ace14a42fe", "score": "0.5970215", "text": "function routeReducer(state = {}, action) {\n switch (action.type) {\n default:\n return state;\n }\n}", "title": "" }, { "docid": "98b3325c3dc6f558be37c7ae87f3d884", "score": "0.59385186", "text": "[ActionTypes.ROUTE_TO](state, action) {\n const { payload, meta } = action;\n\n return {\n ...state,\n previous: (!payload.replace && state.current) || state.previous,\n current: {\n ...meta.assign,\n _routeId: meta._routeId,\n routeKey: meta.routeKey,\n location: meta.location,\n url: meta.url,\n state: undefinedAsNull(payload.state),\n replace: !!payload.replace\n },\n next: null,\n origin: state.origin || meta.location.origin\n };\n }", "title": "" }, { "docid": "a314d5ea5ed870d466c5f83cda134054", "score": "0.5915868", "text": "loadRoutes () {\n this.app._router = null\n\n this.app.use(bodyParser.json())\n this.app.use(bodyParser.urlencoded({\n extended: true\n }))\n\n const loadFolder = (path, current) => {\n const routes = fs.readdirSync(resolve(__dirname, path))\n routes.forEach(route => {\n if (fs.lstatSync(resolve(__dirname, path, route)).isDirectory()) return loadFolder(path + '/' + route, current + (route + '/'))\n if (!route.endsWith('.js')) return\n delete require.cache[require.resolve(resolve(__dirname, path, route))]\n const routeFile = require(resolve(__dirname, path, route))\n if (!routeFile) return\n\n const routeName = route.replace(/index/gi, '').split('.')[0]\n const router = Express.Router()\n routeFile.bind(this)(router)\n this.app.use(`/${current}${routeName}`, router)\n })\n }\n loadFolder('./routes', '')\n }", "title": "" }, { "docid": "09fa04ca4fc23ea997a7b38e46fc45f7", "score": "0.5887231", "text": "initializeRoutes() {\n console.log(\"Initializing routes...\");\n this.app.post(\"/admin/register\", this.registerURL);\n this.app.get(\"/admin/list\", this.listAll);\n this.app.put(\"/admin/update\", this.updateURL);\n this.app.delete(\"/admin/delete/:id\", this.deleteURL);\n this.app.get(\"/ip\", this.triggerWebhooks);\n \n //This is an extra method implemented for testing the trigger sent through /ip/ route\n this.app.post(\"/testing\", this.testTrigger);\n }", "title": "" }, { "docid": "df1fa5bbfbd7326d50a84e70471a79a8", "score": "0.5857917", "text": "load() {\n\t\t// load routes and route spcific middleware\n\t\tlet rootRouter = Express.Router();\n\t\tthis.app.routes.root.route(rootRouter);\n\t\tthis.app.server.use(this.app.routes.root.baseRoute, rootRouter);\n\n\t\t// load routes and route spcific middleware\n\t\tlet inventoryRouter = Express.Router();\n\t\tthis.app.middleware.routeDataInventory.route(inventoryRouter);\n\t\tthis.app.routes.inventory.route(inventoryRouter);\n\t\tthis.app.server.use(this.app.routes.inventory.baseRoute, inventoryRouter);\n\n\t\t// load routes and route spcific middleware\n\t\tlet notificationRouter = Express.Router();\n\t\tthis.app.middleware.routeDataNotification.route(notificationRouter);\n\t\tthis.app.routes.notification.route(notificationRouter);\n\t\tthis.app.server.use(this.app.routes.notification.baseRoute, notificationRouter);\n\n\t\t// load routes and route spcific middleware\n\t\tlet orderRouter = Express.Router();\n\t\tthis.app.middleware.routeDataOrder.route(orderRouter);\n\t\tthis.app.routes.order.route(orderRouter);\n\t\tthis.app.server.use(this.app.routes.order.baseRoute, orderRouter);\n\t}", "title": "" }, { "docid": "d9a24b2fbbe9e7046ed4222cf490567a", "score": "0.5810786", "text": "initRoutes() {\n this.app.use(generalRouter); // Import the general router.\n }", "title": "" }, { "docid": "c6ef87802769d59c3e4f4401ad6d709e", "score": "0.580058", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { location: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "c6ef87802769d59c3e4f4401ad6d709e", "score": "0.580058", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { location: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "c6ef87802769d59c3e4f4401ad6d709e", "score": "0.580058", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { location: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "c6ef87802769d59c3e4f4401ad6d709e", "score": "0.580058", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { location: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "c250602feb68534e847994415a4fbbdc", "score": "0.57670575", "text": "function App() {\n const { location } = useContext(__RouterContext);\n\n const [appFirstStart, setAppFirstStart] = useState(true);\n const [loc1, setLoc1] = useState(location.state);\n const [loc2, setLoc2] = useState(loc1);\n\n\n\n const updateState = function(){\n // update route direction\n // redux function()\n\n setLoc1(location.state);\n setLoc2(loc1);\n }\n\n const enterState = function(){\n // console.log('fire enter state');\n if(location.pathname === '/'){\n setLoc1(0);\n }\n if(location.pathname === '/web-development'){\n setLoc1(1);\n }\n if(location.pathname === '/photography-design'){\n setLoc1(2);\n }\n if(location.pathname === '/security'){\n setLoc1(3);\n }\n }\n\n // fires every time route gets updated\n React.useMemo(()=>{\n !appFirstStart && updateState();\n // console.log('next loc: ', loc1)\n // console.log('prev loc: ', loc2)\n\n //eslint-disable-next-line\n }, [location]);\n\n\n // fires once on page load\n React.useMemo(()=>{\n enterState();\n //eslint-disable-next-line\n }, []);\n\n const updateFirstStart = () => {\n setAppFirstStart(false);\n }\n\n\n\n \n\n\n return (\n <Provider store={store}>\n \n <Navbar loc1={loc1} loc2={loc2} />\n\n \n \n <WrappedRoutes \n updateState={updateState} \n updateFirstStart={updateFirstStart} \n appFirstStart={appFirstStart} \n loc1={loc1} \n loc2={loc2} \n location={location} \n />\n \n {/* <Footer /> */}\n\n </Provider>\n );\n}", "title": "" }, { "docid": "a8173baa0ded67813b8219d2e548ac01", "score": "0.5756089", "text": "function routeReducer(state = routeInitialState, action) {\n switch (action.type) {\n case LOCATION_CHANGE:\n return state.merge({\n locationBeforeTransitions: action.payload,\n });\n default:\n return state;\n }\n}", "title": "" }, { "docid": "1ae0012e0b4312379efd5dd0b71ee931", "score": "0.57471997", "text": "updateAppRoute () {\n // It the app is tin the search mode but the only place name is\n // empty then switch to the default `place` mode\n if (this.$store.getters.mode === constants.modes.search && this.places[0].placeName === '') {\n this.setViewMode(constants.modes.place)\n }\n\n // const filledPlaces = this.getFilledPlaces()\n // if (filledPlaces.length > 1) {\n // this.setViewMode(constants.modes.directions)\n // } else if (filledPlaces.length === 0) {\n // this.setViewMode(constants.modes.place)\n // }\n const appMode = new AppMode(this.$store.getters.mode)\n const route = appMode.getRoute(this.places)\n this.$store.commit('cleanMap', this.$store.getters.appRouteData.places.length === 0)\n this.$router.push(route)\n }", "title": "" }, { "docid": "4cb4f22e55e985bdc539a1ce2544ee2d", "score": "0.57127017", "text": "onRouteMount(route){\r\n console.log(\"onRouteMount\");\r\n const match = route.match;\r\n let newTracks;\r\n let newMode;\r\n let newTitle;\r\n let currentMatch = match? match:this.state.route;\r\n switch(currentMatch.path){\r\n case \"/\" :\r\n return this.onHomeRoute(route,currentMatch);\r\n case \"/\"+constants.FAVORITE_MODE :\r\n return this.onFavoriteRoute(route,currentMatch);\r\n case \"/\"+constants.PLAYLIST_MODE+\"/:playlistName\" :\r\n return this.onPlaylistRoute(route,currentMatch);\r\n case \"/\"+constants.FOLDER_MODE+\"/*\" :\r\n return this.onFolderRoute(route,currentMatch);\r\n case \"/\"+constants.FOLDER_MODE+\"/\" :\r\n case \"/\"+constants.FOLDER_MODE :\r\n return this.onFolderRoute(route);\r\n case \"/\"+constants.SEARCH_MODE+\"/:searchKeyword\" :\r\n return this.onSearchRoute(route,currentMatch);\r\n case \"/\"+constants.ARTIST_MODE+\"/:artistName\" :\r\n return this.onArtistRoute(route,currentMatch);\r\n case \"/\"+constants.ALBUM_MODE+\"/:albumName\" :\r\n return this.onAlbumRoute(route,currentMatch);\r\n case \"/\"+constants.GENRE_MODE+\"/:genreName\" :\r\n return this.onGenreRoute(route,currentMatch);\r\n case \"/download/\" :\r\n case \"/download\" :\r\n return this.onDownloadRoute(route,currentMatch);\r\n default:\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "13f580e6cc1fbb29481b01963bf95001", "score": "0.568856", "text": "resolveRoutes() {\n let router;\n router = express.Router();\n //Add each one of these?\n indexRoute.route.create(router);\n scheduleRoute.route.create(router);\n taskRoute.route.create(router);\n gpioRoute.route.create(router);\n this.express.use(router);\n }", "title": "" }, { "docid": "80b72c9b07013a203263f91f2fd60654", "score": "0.56844985", "text": "function routerReducer() {\n\t var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\t\n\t var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t type = _ref.type,\n\t payload = _ref.payload;\n\t\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\t\n\t return state;\n\t}", "title": "" }, { "docid": "80b72c9b07013a203263f91f2fd60654", "score": "0.56844985", "text": "function routerReducer() {\n\t var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\t\n\t var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t type = _ref.type,\n\t payload = _ref.payload;\n\t\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\t\n\t return state;\n\t}", "title": "" }, { "docid": "07147eac2a883fc8cd1cdd475eb94f28", "score": "0.5630873", "text": "initRouting () {\n this.app.get('/', (req, res) => {\n res.sendFile('index.html', { root: this.config.server.public })\n })\n\n this.app.get('/*', (req, res) => {\n var path = req.params[0];\n if (path.indexOf('.') >= 0) {\n res.sendFile(path, { root: this.config.server.public })\n } else {\n res.sendFile('index.html', { root: this.config.server.public })\n }\n })\n\n this.app.post('/api', (req, res) => {\n this.requestHandler.queueRequest(req, res)\n })\n }", "title": "" }, { "docid": "7a34c95ef3372bec26d8ad63ef430f3a", "score": "0.5630124", "text": "function routerReducer() {\n\t var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];\n\t\n\t var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t var type = _ref.type;\n\t var payload = _ref.payload;\n\t\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\t\n\t return state;\n\t}", "title": "" }, { "docid": "7a34c95ef3372bec26d8ad63ef430f3a", "score": "0.5630124", "text": "function routerReducer() {\n\t var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];\n\t\n\t var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t var type = _ref.type;\n\t var payload = _ref.payload;\n\t\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\t\n\t return state;\n\t}", "title": "" }, { "docid": "7a34c95ef3372bec26d8ad63ef430f3a", "score": "0.5630124", "text": "function routerReducer() {\n\t var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];\n\t\n\t var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t var type = _ref.type;\n\t var payload = _ref.payload;\n\t\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\t\n\t return state;\n\t}", "title": "" }, { "docid": "ce8a5c8d666f3565f31008528991c9af", "score": "0.56186175", "text": "function init_routes() {\n var testAPIRouter = require(\"./api/routes/testAPIRouter\");\n var weatherDataRouter = require(\"./api/routes/weatherDataRouter\");\n var powerPredictionsRouter = require(\"./api/routes/powerPredictionsRouter\");\n var cloudCoverageDataRouter = require(\"./api/routes/cloudCoverageDataRouter\");\n //var cloudDataRouter = require(\"./api/routes/cloudDataRouter\");\n //var legacyCloudCoverageRouter = require(\"./api/routes/legacyCloudCoverageRouter\");\n //var legacyCloudMotionRouter = require(\"./api/routes/legacyCloudMotionRouter\");\n\n viewer = route();\n app.use(\"/cloudtrackinglivestream\", viewer);\n app.use(\"/weatherData\", weatherDataRouter);\n app.use(\"/powerPredictions\", powerPredictionsRouter);\n app.use(\"/cloudCoverageData\", cloudCoverageDataRouter);\n\n //app.use(\"/cloudData\", cloudDataRouter);\n //app.use(\"/cloudCoverage\", legacyCloudCoverageRouter);\n //app.use(\"/cloudMotion\", legacyCloudMotionRouter);\n}", "title": "" }, { "docid": "eff34f85e87744abdfc41d35e1351d9c", "score": "0.55942225", "text": "function routeReducer (state = routeInitialState, action) {\n switch (action.type) {\n /* istanbul ignore next */\n case LOCATION_CHANGE:\n return state.merge({\n locationBeforeTransitions: action.payload,\n })\n\n default:\n return state\n }\n}", "title": "" }, { "docid": "04876bff2a1c7187c4fcc1771fcf0564", "score": "0.55659306", "text": "function routerReducer() {\n\t var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];\n\n\t var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t var type = _ref.type;\n\t var payload = _ref.payload;\n\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\n\t return state;\n\t}", "title": "" }, { "docid": "04876bff2a1c7187c4fcc1771fcf0564", "score": "0.55659306", "text": "function routerReducer() {\n\t var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];\n\n\t var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t var type = _ref.type;\n\t var payload = _ref.payload;\n\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\n\t return state;\n\t}", "title": "" }, { "docid": "04876bff2a1c7187c4fcc1771fcf0564", "score": "0.55659306", "text": "function routerReducer() {\n\t var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];\n\n\t var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t var type = _ref.type;\n\t var payload = _ref.payload;\n\n\t if (type === LOCATION_CHANGE) {\n\t return _extends({}, state, { locationBeforeTransitions: payload });\n\t }\n\n\t return state;\n\t}", "title": "" }, { "docid": "02764a106582d22776e132f2e61633df", "score": "0.5562708", "text": "initialize () {\n this.app.routes = this.app.config.get('routes')\n .map(route => lib.Util.buildRoute(this.app, route))\n .filter(route => !!route)\n }", "title": "" }, { "docid": "334181dc7f8996fd80dd7efa89388e1e", "score": "0.5558229", "text": "getCustomRoutes(){// actual routes will be loaded asynchronously during .prepare()\nreturn{redirects:[],rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},headers:[]};}", "title": "" }, { "docid": "7b3533ddfdf76f3daf0dd818b436c737", "score": "0.55542666", "text": "_route(props) {\n\n let matchedPage = null\n let matchedRouteParams = [];\n\n const pathArray = props.splitWindowPath;\n\n this.state.routes.forEach(function(value, key) {\n\n let matchTest = this._matchPath(value.get('path'), pathArray);\n\n if (matchTest.matched) {\n\n let routeParams = matchTest.routeParams;\n\n // Extract common paths from URL\n if (value.has('extractPaths') && value.get('extractPaths')) {\n if (pathArray.length >= 7)\n routeParams['dialect_path'] = decodeURI('/' + pathArray.slice(1, 7).join('/'));\n\n if (pathArray.length >= 6)\n routeParams['language_path'] = decodeURI('/' + pathArray.slice(1, 6).join('/'));\n\n if (pathArray.length >= 5)\n routeParams['language_family_path'] = decodeURI('/' + pathArray.slice(1, 5).join('/'));\n }\n\n matchedPage = value;\n matchedRouteParams = routeParams;\n\n // Break out of forEach\n return false;\n }\n }.bind(this));\n\n // Match found\n if (matchedPage !== null) {\n\n // Redirect if required\n if (matchedPage.has('redirects')) {\n matchedPage.get('redirects').forEach(function(value, key) {\n\n if (value.get('condition')({props: props})) {\n props.replaceWindowPath(value.get('target')({props: props}));\n return false;\n }\n }.bind(this));\n }\n\n // Switch themes based on route params\n if (matchedRouteParams.hasOwnProperty('theme')) {\n if (props.properties.theme.id != matchedRouteParams.theme) {\n props.changeTheme(matchedRouteParams.theme);\n }\n }\n else {\n props.changeTheme('default');\n }\n\n this.setState({\n matchedPage: matchedPage,\n matchedRouteParams: matchedRouteParams\n });\n }\n }", "title": "" }, { "docid": "7e7462c26f7af1fbe99c5696a9c39e2e", "score": "0.5529857", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "7e7462c26f7af1fbe99c5696a9c39e2e", "score": "0.5529857", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "7e7462c26f7af1fbe99c5696a9c39e2e", "score": "0.5529857", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "7e7462c26f7af1fbe99c5696a9c39e2e", "score": "0.5529857", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "7e7462c26f7af1fbe99c5696a9c39e2e", "score": "0.5529857", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "7e7462c26f7af1fbe99c5696a9c39e2e", "score": "0.5529857", "text": "function routerReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n type = _ref.type,\n payload = _ref.payload;\n\n if (type === LOCATION_CHANGE) {\n return _extends({}, state, { locationBeforeTransitions: payload });\n }\n\n return state;\n}", "title": "" }, { "docid": "67296bd49c53d99fb45b92ca0f9cdfaa", "score": "0.5493872", "text": "function configRouter(router) {\n var _router$map;\n\n // normal routes\n router.map((_router$map = {\n\n '/': {\n component: _NavPage2.default,\n name: 'Welcome'\n }\n }, (0, _defineProperty3.default)(_router$map, '/', {\n component: _NavPage2.default,\n name: 'welcome'\n }), (0, _defineProperty3.default)(_router$map, '/dashboard', {\n component: {\n name: 'Dashboard',\n template: '<div><router-view></router-view></div>',\n changeTabTitle: false,\n logHooksToConsole: true,\n watchMode: true,\n data: function data() {\n return {\n pageTitle: 'Dashboard'\n\n };\n }\n },\n canReuse: true,\n name: 'Dashboard',\n subRoutes: {\n '/': {\n component: _NavPage2.default,\n name: 'welcome'\n },\n '/home': {\n component: _NavPage2.default,\n name: 'Home'\n },\n '/pos': {\n // component: function (resolve) {\n // loadjs([Pos], resolve)\n // },\n component: _Checkout2.default,\n name: 'Pos'\n },\n\n '/customers': {\n component: _Customers2.default,\n name: 'Customers'\n },\n '/inventory/calculator': {\n component: _Inventorycalculator2.default,\n name: 'InventoryCalculator'\n },\n\n '/profile': {\n component: _Profile2.default,\n name: 'Profile',\n subRoutes: {\n '/projects': {\n component: _Projector2.default,\n name: 'Projects'\n },\n '/communications': {\n component: _Communications2.default,\n name: 'Communications'\n },\n '/singleConversation': {\n component: _SingleConversation2.default,\n name: 'SingleConversation'\n },\n '/calendar': {\n component: _Calendar2.default,\n name: 'Calendar'\n },\n '/settings': {\n component: _Settings2.default,\n name: 'Settings'\n }\n }\n },\n '/customer/new': {\n component: _New2.default,\n name: 'CustomerNew'\n },\n '/employees': {\n component: _Employees2.default,\n name: 'Employees'\n },\n '/employee/new': {\n component: _Inventory2.default,\n name: 'EmployeeNew'\n },\n '/employee': {\n component: _Employees2.default,\n name: 'EmployeeDirectory'\n },\n '/inventory': {\n component: _Inventory2.default,\n name: 'Inventory'\n },\n '/ui': {\n component: _UiUxPage2.default,\n name: 'UiUx'\n },\n '/ui/buttons': {\n component: _UiUxButtons2.default,\n name: 'UiUxButtons'\n },\n '/ui/charts': {\n component: _UiUxCharts2.default,\n name: 'UiUxCharts'\n },\n\n '/help-desk': {\n component: _TicketsIt2.default,\n name: 'help-desk'\n },\n\n '/super-admin': {\n component: _FrozenNodeAdmin2.default,\n name: 'super-admin'\n }\n } }), _router$map));\n\n // redirect\n // dashboard sub route close\n //dashboard close\n\n // '*': {\n // component: require('./components/not-found.vue')\n // },\n router.redirect({\n '/info': '/'\n });\n\n // global before\n // 3 options:\n // 1. return a boolean\n // 2. return a Promise that resolves to a boolean\n // 3. call transition.next() or transition.abort()\n // router.beforeEach((transition) => {\n // //console.log('Bang from beforeEach transition')\n // if (transition.to.path === '/dashboard') {\n // router.app.authenticating = true\n // setTimeout(() => {\n // router.app.authenticating = false\n // alert('this route is forbidden by a global before hook')\n // transition.abort()\n // }, 3000)\n // } else {\n // transition.next()\n // }\n // })\n}", "title": "" }, { "docid": "a31f08e3623ae41446518edd62d540ff", "score": "0.549346", "text": "async function main() {\n // Prime the store with server-initialized state.\n // the state is determined during SSR and inlined in the page markup.\n if (window.__INITIAL_STATE__ && app.$store) {\n app.$store.replaceState(window.__INITIAL_STATE__)\n }\n\n await routerReady(app.$router)\n\n // Add router hook for handling prepare.\n // Doing it after initial route is resolved so that we don't double-fetch\n // the data that we already have. Using router.beforeResolve() so that all\n // async components are resolved.\n app.$router.beforeResolve((to, from, next) => {\n const matched = app.$router.getMatchedComponents(to)\n const prevMatched = app.$router.getMatchedComponents(from)\n let diffed = false\n const activated = matched.filter((c, i) => {\n if (diffed) return diffed\n diffed = prevMatched[i] !== c\n return diffed\n })\n const prepareHooks = activated.map(c => c.prepare).filter(_ => _)\n if (prepareHooks.length > 0) {\n return next()\n }\n\n Promise.all(\n prepareHooks.map(hook => hook({ store: app.$store, route: to }))\n )\n .then(() => {\n next()\n })\n .catch(next)\n })\n\n // Since in dev mode it's not SSR\n // So we run `prepare` on client-side\n if (process.env.NODE_ENV === 'development') {\n await prepareComponents(app.$router.getMatchedComponents(), {\n url: app.$router.currentRoute.path,\n route: app.$router.route,\n store: app.$store\n })\n }\n\n // Actually mount to DOM\n app.$mount('#app')\n}", "title": "" }, { "docid": "2a346383b0031ef6a5a9af894399ee15", "score": "0.5484793", "text": "_prepareForGlobalsMode() {\n // Create subclass of Router for this Application instance.\n // This is to ensure that someone reopening `App.Router` does not\n // tamper with the default `Router`.\n this.Router = (this.Router || _routing.Router).extend();\n\n this._buildDeprecatedInstance();\n }", "title": "" }, { "docid": "504ee7bfbcbb31ad86435c4b93ed9bb0", "score": "0.5482757", "text": "function mountRoutes() {\n // remove previous added routes.\n for (let i = addedLayers.length; i--;) {\n const layer = addedLayers[i]\n const index = stack.indexOf(layer)\n if (~index) {\n stack.splice(index, 1)\n anchor = index\n }\n }\n // empty saved layers.\n addedLayers.length = 0\n // add new routes one by one with updating 'routeCount' in the meantime.\n let err\n try {\n for (const file of routeFiles) {\n const definitions = loadRouteModule(file)\n for (const def of definitions) {\n let method, url, response, range, delay, args, processResponse\n if (Array.isArray(def)) {\n let j\n switch (def.length) {\n case 0:\n case 1:\n continue\n case 2:\n [url, response] = def\n break\n case 3:\n [method, url, response] = def\n break\n default:\n [method, url, response] = def\n processResponse = []\n j = 3\n while (j < def.length) {\n switch (typeof def[j]) {\n case 'function':\n processResponse.push(def[j])\n break\n case 'object':\n args = def[j]\n break\n case 'string':\n range = def[j]\n break\n case 'number':\n delay = def[j]\n break\n default:\n }\n j++\n }\n }\n } else if (def) {\n method = def.method\n url = def.url\n response = def.response\n range = def.range\n delay = def.delay\n args = def.args\n processResponse = Array.isArray(def.processResponse) ? def.processResponse : [def.processResponse]\n } else {\n continue\n }\n processResponse = (processResponse || []).filter(e => typeof e === 'function')\n app[method || 'get'](url, function(req, res) {\n const count = range ? random(range) : 1\n let r\n if (typeof response === 'function') {\n r = response(req, res, { count, render, mock, delayCall })\n } else if (range) {\n r = new Array(count).fill(null).map((e, i) => mock(render(response, Object.assign({ req, i }, args))))\n } else {\n r = mock(render(response, Object.assign({ req }, args)))\n }\n\n processResponse.forEach(e => {\n r = e(r, req, res, { count, render, mock, delayCall })\n })\n\n if (r === res) {\n delayCall(delay, () => res.end())\n } else if (r !== void 0) {\n delayCall(delay, () => res.send(r))\n }\n })\n // save new layers\n addedLayers.push(stack.pop())\n }\n }\n } catch (e) {\n err = e\n }\n // add new layers\n if (~anchor) {\n stack.splice(anchor, 0, ...addedLayers)\n } else {\n stack.push(...addedLayers)\n }\n if (err) {\n throw err\n }\n }", "title": "" }, { "docid": "61c1f27d6a015e5eeffb22ccae39aec0", "score": "0.5467911", "text": "function appInit (opts) {\n const loc = document.location\n const state = { pathname: (opts.hash) ? hashMatch(loc.hash) : loc.href }\n const reducers = {\n setLocation: function setLocation (data, state) {\n return { pathname: data.location.replace(/#.*/, '') }\n }\n }\n // if hash routing explicitly enabled, subscribe to it\n const subs = {}\n if (opts.hash === true) {\n pushLocationSub(function (navigate) {\n hash(function (fragment) {\n navigate(hashMatch(fragment))\n })\n }, 'handleHash', subs)\n } else {\n if (opts.history !== false) pushLocationSub(history, 'handleHistory', subs)\n if (opts.href !== false) pushLocationSub(href, 'handleHref', subs)\n }\n\n return {\n namespace: 'location',\n subscriptions: subs,\n reducers: reducers,\n state: state\n }\n\n // create a new subscription that modifies\n // 'app:location' and push it to be loaded\n // (fn, obj) -> null\n function pushLocationSub (cb, key, model) {\n model[key] = function (send, done) {\n cb(function navigate (pathname) {\n send('location:setLocation', { location: pathname }, done)\n })\n }\n }\n}", "title": "" }, { "docid": "38759c076825b546c321648538ed4cf1", "score": "0.5456682", "text": "routes(path){\n var routes = Object.assign(\n super.routes(path),\n {\n [path + '/:id']: {\n\n 'get|delete': [\n Processor.PARSE_QUERY,\n JsonApiProcessor.PARSE_ID,\n\n (req, res, next) => {\n if (!isNaN(req.params.id)) res.build = this.process(req, res)\n next()\n }\n ],\n\n 'put|patch':[\n Processor.PARSE_QUERY,\n JsonApiProcessor.PARSE_BODY,\n JsonApiProcessor.PARSE_ID,\n\n (req, res, next) => {\n if (!isNaN(req.params.id)) res.build = this.process(req, res)\n next()\n }\n ]\n }\n }\n )\n\n return routes\n }", "title": "" }, { "docid": "f7270560c2f5ccdbe05ceb6bf5aa1f95", "score": "0.5439425", "text": "function routeReducer(state = routeInitialState, action) {\n switch (action.type) {\n /* istanbul ignore next */\n\n case LOCATION_CHANGE:\n return {\n ...state,\n locationBeforeTransitions: action.payload,\n };\n default:\n return state;\n }\n}", "title": "" }, { "docid": "289c1508de1e6292bde14af290566ac2", "score": "0.543457", "text": "getRoutes () {\n return Object.keys(this.modules).reduce((currentRoutes, moduleKey) => {\n return Object.assign({}, currentRoutes, this.modules[moduleKey].getRoutes())\n }, Object.keys(this.routes).reduce((currentInitialRoutes, routeKey) => {\n if (typeof this.routes[routeKey] === 'string') {\n currentInitialRoutes[(this.path.length ? `/${this.path.join('/') + routeKey}` : this.path.join('/') + routeKey)] = this.path.length ? `${this.path.join('.')}.${this.routes[routeKey]}` : this.routes[routeKey]\n } else {\n currentInitialRoutes[(this.path.length ? `/${this.path.join('/')}` : '') + routeKey] = Object.keys(this.routes[routeKey]).reduce((nestedRoutes, nestedKey) => {\n nestedRoutes[nestedKey] = this.path.length ? `${this.path.join('.')}.${this.routes[routeKey][nestedKey]}` : this.routes[routeKey][nestedKey]\n\n return nestedRoutes\n }, {})\n }\n\n return currentInitialRoutes\n }, {}))\n }", "title": "" }, { "docid": "d10f22f7dec584f1465084640e94328e", "score": "0.5427547", "text": "[ActionTypes.ROUTE_TO_FETCH](state, action) {\n const { payload, meta } = action;\n\n if (!payload) {\n return {\n ...state,\n fetch: null\n };\n }\n\n return {\n ...state,\n next: null,\n fetch: {\n ...meta.assign,\n _routeId: meta._routeId,\n routeKey: meta.routeKey,\n location: meta.location,\n url: meta.url,\n state: undefinedAsNull(payload.state),\n replace: !!payload.replace,\n exit: !!payload.exit\n },\n origin: state.origin || meta.location.origin\n };\n }", "title": "" }, { "docid": "d786d01784295c777e83e81d0443a914", "score": "0.5417277", "text": "Routes() {\n\n const { app } = this;\n\n app.use('/', Parallel.run([\n\n //init register routes\n LoginUsersRoute,\n RegisterUsersRoute,\n ActivationUsersRoute,\n ResendTokenUserRoute,\n ForgotPasswordUserRoute,\n ResetPasswordUserRoute,\n\n //init user routes\n CreateUserRoute,\n ResultsUserRoute,\n ResultUserRoute,\n DeleteUserRoute,\n UpdateUserRoute,\n\n //init register routes\n CreateRolesRoute,\n ResultRolesRoute,\n ResultsRolesRoute,\n DeleteRolesRoute,\n UpdateRolesRoute,\n\n //init credits routes\n CreateCreditsRoute,\n ResultsCreditsRoute,\n ResultCreditsRoute,\n DeleteCreditsRoute,\n UpdateCreditsRoute,\n\n //init credits routes\n CreateSubjectRoute,\n ResultsSubjectRoute,\n ResultSubjectRoute,\n DeleteSubjectRoute,\n UpdateSubjectRoute\n\n ]));\n\n // init roles routes\n // app.use('/role', CreateRolesRoute);\n // app.use('/role', ResultRolesRoute);\n // app.use('/role', ResultsRolesRoute);\n // app.use('/role', UpdateRolesRoute);\n // app.use('/role', DeleteRolesRoute);\n\n // //init register routes\n // app.use('/login', LoginUsersRoute);\n // app.use('/register', RegisterUsersRoute);\n // app.use('/activation', ActivationUsersRoute);\n // app.use('/resendtoken', ResendTokenUserRoute);\n // app.use('/forgotpassword', ForgotPasswordUserRoute);\n // app.use('/resetpassword', ResetPasswordUserRoute);\n\n // //init user routes\n // app.use('/user', CreateUserRoute);\n // app.use('/', ResultsUserRoute);\n // app.use('/user', ResultUserRoute);\n // app.use('/user', DeleteUserRoute);\n // app.use('/user', UpdateUserRoute);\n\n // //init credits routes\n // app.use('/credit', CreateCreditsRoute);\n // app.use('/credit', ResultsCreditsRoute);\n // app.use('/credit', ResultCreditsRoute);\n // app.use('/credit', DeleteCreditsRoute);\n // app.use('/credit', UpdateCreditsRoute);\n\n // //init credits routes\n // app.use('/subject', CreateSubjectRoute);\n // app.use('/subject', ResultsSubjectRoute);\n // app.use('/subject', ResultSubjectRoute);\n // app.use('/subject', DeleteSubjectRoute);\n // app.use('/subject', UpdateSubjectRoute);\n }", "title": "" }, { "docid": "703544c7584518035256022945789e7c", "score": "0.54113835", "text": "async function onLocationChange(location, action) {\n // Remember the latest scroll position for the previous location\n scrollPositionsHistory[currentLocation.key] = {\n scrollX: window.pageXOffset,\n scrollY: window.pageYOffset,\n };\n\n context.scrollWidth = window.document.body.scrollWidth;\n context.scrollHeight = window.document.body.scrollHeight;\n // Delete stored scroll position for next page if any\n if (action === 'PUSH') {\n delete scrollPositionsHistory[location.key];\n }\n currentLocation = location;\n\n const isInitialRender = !action;\n try {\n context.pathname = location.pathname;\n context.query = queryString.parse(location.search);\n\n // Traverses the list of routes in the order they are defined until\n // it finds the first route that matches provided URL path string\n // and whose action method returns anything other than `undefined`.\n const router1 = await router();\n const route = await router1.resolve({\n ...context,\n path: location.pathname,\n originalUrl: location.pathname + location.search,\n query: queryString.parse(location.search),\n // locale: store.getState().intl.locale,\n });\n\n // Prevent multiple page renders during the routing process\n if (currentLocation.key !== location.key) {\n return;\n }\n\n if (route.redirect) {\n history.replace(route.redirect);\n return;\n }\n\n // write route\n context.store.dispatch(\n setRuntimeVariable({\n name: 'route',\n value: {\n ...location,\n query: context.query,\n title: route.title,\n },\n }),\n );\n\n context.store.dispatch(\n setRuntimeVariable({\n name: 'browserMsg',\n value: {\n width: window.innerWidth,\n height: window.innerHeight,\n },\n }),\n );\n\n // clear prev page\n\n const renderReactApp = isInitialRender ? ReactDOM.hydrate : ReactDOM.render;\n appInstance = renderReactApp(\n <App context={context}>{route.component}</App>,\n container,\n () => {\n if (isInitialRender) {\n // Switch off the native scroll restoration behavior and handle it manually\n if (window.history && 'scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n\n const elem = document.getElementById('css');\n if (elem) elem.parentNode.removeChild(elem);\n return;\n }\n\n document.title = route.title;\n\n updateMeta('description', route.description);\n // Update necessary tags in <head> at runtime here, ie:\n // updateMeta('keywords', route.keywords);\n // updateCustomMeta('og:url', route.canonicalUrl);\n // updateCustomMeta('og:image', route.imageUrl);\n // updateLink('canonical', route.canonicalUrl);\n // etc.\n\n let scrollX = 0;\n let scrollY = 0;\n const pos = scrollPositionsHistory[location.key];\n if (pos) {\n scrollX = pos.scrollX;\n scrollY = pos.scrollY;\n } else {\n const targetHash = location.hash.substr(1);\n if (targetHash) {\n const target = document.getElementById(targetHash);\n if (target) {\n scrollY = window.pageYOffset + target.getBoundingClientRect().top;\n }\n }\n }\n\n // Restore the scroll position if it was saved into the state\n // or scroll to the given #hash anchor\n // or scroll to top of the page\n window.scrollTo(scrollX, scrollY);\n\n // Google Analytics tracking. Don't send 'pageview' event after\n // the initial rendering, as it was already sent\n if (window.ga) {\n // window.ga('send', 'pageview', createPath(location));\n }\n },\n );\n } catch (error) {\n if (__DEV__) {\n throw error;\n }\n\n console.error(error);\n\n // Do a full page reload if error occurs during client-side navigation\n if (!isInitialRender && currentLocation.key === location.key) {\n console.error('RSK will reload your page after error');\n window.location.reload();\n }\n }\n}", "title": "" }, { "docid": "7476758093ba29c6f1980c0a4ba824c6", "score": "0.5389351", "text": "function exportAllRoutes(){\n}", "title": "" }, { "docid": "ca2913b9954ae4203fc316d1ccada3ba", "score": "0.53804713", "text": "static buildRoutingConfig(props) {\n const { routingConfig } = props;\n\n const updatedConfig = { ...routingConfig, menu: ApplicationLayout.buildApplicationMenus(props, { ...routingConfig.menu, ...ApplicationLayout.buildNavigationMenuConfig(props) }) };\n\n return updatedConfig;\n }", "title": "" }, { "docid": "26e2e30a3aa7a7c306ddacfd38683468", "score": "0.5371235", "text": "routing() {\n this.app.use(this.router);\n }", "title": "" }, { "docid": "9a0e99d586b87bc92f2d7981d0c1f176", "score": "0.5368929", "text": "[ActionTypes.ROUTE_TO_NEXT](state, action) {\n const { payload, meta } = action;\n\n return {\n ...state,\n next: {\n ...meta.assign,\n _routeId: meta._routeId,\n routeKey: meta.routeKey,\n location: meta.location,\n url: meta.url,\n state: undefinedAsNull(payload.state),\n replace: !!payload.replace,\n exit: !!payload.exit\n },\n origin: state.origin || meta.location.origin\n };\n }", "title": "" }, { "docid": "44d10c27937116267c6131f473d2460d", "score": "0.5368061", "text": "includeRoutes(){\n\t\tnew routes(this.app).routesConfig();\n\t}", "title": "" }, { "docid": "8239164480064f534ea0c291a051adce", "score": "0.53673196", "text": "newRoute(route) { Store.contentRouter = route }", "title": "" }, { "docid": "87a24a6605029a911134ae42b1e65473", "score": "0.5340194", "text": "initRoutes() {\n this.userHandler.initRoutes(this.express);\n this.authHandler.initRoutes(this.express);\n this.accountHandler.initRoutes(this.express);\n }", "title": "" }, { "docid": "79999bfd505388cf84e1c4543f3f9b90", "score": "0.5331233", "text": "addRoutes () {\n indexRouter(this.app);\n this.app.use('/v1', apiV1);\n }", "title": "" }, { "docid": "7acf09dce29c57d883db84755208c0a7", "score": "0.5330343", "text": "addBaseRoutes() {\n AraDTApp.get('/', this.index);\n }", "title": "" }, { "docid": "cdd61a16f39bb9ea1ea9ede3247d7105", "score": "0.5325219", "text": "buildAll() {\n // create an index route\n this.routeBuilder.buildRoute('index', '/');\n\n // create routes for each page\n for (let page of this.pages.active) {\n this.routeBuilder.buildRoute(page);\n }\n }", "title": "" }, { "docid": "f34c88d54199b6528c2d577afea48d82", "score": "0.5320105", "text": "function defineArbiterRoutes (router) {\n defineAgentsRouter(router)\n defineLiquidatorsRouter(router)\n defineLoansRouter(router)\n defineSalesRouter(router)\n}", "title": "" }, { "docid": "5538030046bafffa54fae6898823f94c", "score": "0.53195804", "text": "function dispatch(ctx) {\r\n\r\n if (_curCtx) {\r\n var ret = _curCtx.route.exit({\r\n path: _curCtx.path,\r\n params: _curCtx.params\r\n }, true);\r\n if (!ret) {\r\n return;\r\n }\r\n }\r\n\r\n _prevCtx = _curCtx;\r\n _curCtx = ctx;\r\n if (!_curCtx.route) {\r\n var m = map(_curCtx.path);\r\n _curCtx.route = m.route;\r\n _curCtx.params = m.params;\r\n }\r\n\r\n var r = _curCtx.route.enter({\r\n force: _curCtx.force,\r\n path: _curCtx.path,\r\n params: _curCtx.params\r\n },true);\r\n\r\n langx.Deferred.when(r).then(function() {\r\n _hub.trigger(createEvent(\"routing\", {\r\n current: _curCtx,\r\n previous: _prevCtx\r\n }));\r\n\r\n _curCtx.route.enter({\r\n path: _curCtx.path,\r\n params: _curCtx.params\r\n },false);\r\n\r\n if (_prevCtx) {\r\n _prevCtx.route.exit({\r\n path: _prevCtx.path,\r\n params: _prevCtx.params\r\n }, false);\r\n }\r\n\r\n _hub.trigger(createEvent(\"routed\", {\r\n current: _curCtx,\r\n previous: _prevCtx\r\n }));\r\n });\r\n }", "title": "" }, { "docid": "af412bc7415a88a6ea372b14c0eea5e8", "score": "0.53188926", "text": "function setRoutes(app) {\n app.post(\"/messages/getShareUrlFromMessageId\", getShareUrlFromMessageId);\n app.post(\"/messages/getShortUrlFromMessageId\", getShortUrlFromMessageId);\n app.post(\"/messages/getReadUrlFromShareId\", getReadUrlFromShort);\n app.post(\"/messages/startUnknownRecipientMessageSend\", postStartUnknownRecipientMessageSend);\n app.post(\"/messages/completeUnknownRecipientMessageSend\", postCompleteUnknownRecipientMessageSend);\n app.post(\"/messages/addUnknownRecipientMessageToInbox\", postConvertUnknownRecipientMessageToKnownRecipient);\n app.post(\"/messages/startReplyMessageSend\", postStartReplyMessageSend);\n app.post(\"/messages/completeReplyMessageSend\", postCompleteReplyMessageSend);\n app.post(\"/messages/renewWriteUrlForMessage\", postRenewWriteUrlForMessage);\n app.post(\"/messages/userInbox\", postGetUserInbox);\n app.post(\"/messages/postGetReadURLForMessage\",postGetReadURLForMessage);\n app.post(\"/user/postUserProfilePicture\", postUserProfilePicture);\n app.post(\"/user/registerPushToken\", postRegisterPushToken);\n app.post(\"/user/postGetReadURLForUserProfilePicture\", postGetReadURLForUserProfilePicture);\n app.post(\"/messages/migrateMessage\", migrateMessage);\n app.post(\"/messages/countOldBlobMessages\", countOldBlobMessages);\n app.post(\"/messages/renewWriteUrlForMessageThumbnail\", postGetMessageThumbnailWriteUrl);\n app.post(\"/messages/markMessageAsDeleted\", markMessageAsDeleted);\n app.get(\"/messages/messageThumbnail\", GetMessageThumbnail)\n // app.post(\"/messages/threadsForUser\", getThreadsForUser);\n // app.post(\"/messages/messagesForThread\", getMessagesForThread);\n}", "title": "" }, { "docid": "1289fdeb973be580e326e1ada99805a7", "score": "0.53160703", "text": "pushVisitedRoute(state, {route}){\r\n if(route.name !== 'login'){\r\n state.visitedRoutes.push(route)\r\n }\r\n }", "title": "" }, { "docid": "96d5fec2fbf20fefdda2a78b8aa3cb28", "score": "0.52998966", "text": "constructor() {\n this._routes = new Map();\n }", "title": "" }, { "docid": "97d203d5e8673f48266e7fd31b871fe5", "score": "0.5297214", "text": "function Main() {\n const [state1, dispatch1] = useReducer(AppReducer, initialState);\n const [state, dispatch] = useMemo(() => [state1, dispatch1], [state1]);\n\n return (\n <AppContext.Provider value={{ state, dispatch }}>\n <AuthSession />\n <HashRouter>\n <RouteManager />\n </HashRouter>\n </AppContext.Provider>\n );\n}", "title": "" }, { "docid": "05833ca5fe83d05da5e98942e4c16d12", "score": "0.52967286", "text": "router() { return rtr; }", "title": "" }, { "docid": "f115396c368920f9b4ce111833f2dfda", "score": "0.5293685", "text": "setupRoutes() {\n log.info(` . set up routes`);\n log.info(` . route: /favicon`);\n this.app.get('/favicon.ico', function(req, res) {\n res.sendStatus(204);\n });\n log.info(` . route: /`);\n this.app.get('/', function(req, res){\n res.status(200).json({\"message\" : \"backend server for cribbage game\"});\n });\n log.info(` . route: /socketTest`);\n this.app.get('/socketTest', function(req, res){\n res.sendFile(process.cwd() + '/public/socketTest.html');\n });\n log.info(` . route: /api-docs`);\n this.app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(this.apiSpec));\n log.info(` . route: [user routes]`);\n this.app.use('/', userRoutes); \n }", "title": "" }, { "docid": "f5e88f0a08164ee29e7c8a3d03c21854", "score": "0.5288888", "text": "addRoutes(app, base = \"/api\") {\r\n this.apiUri = base;\r\n app.options(base + \"/descriptor\", this.originOptions.bind(this));\r\n app.options(base + \"/bind\", this.originOptions.bind(this));\r\n app.options(base + \"/actions\", this.originOptions.bind(this));\r\n app.get(base + \"/descriptor\", this.descriptor.bind(this));\r\n app.post(base + \"/bind\", this.binder.bind(this));\r\n app.delete(base + \"/bind\", this.unbinder.bind(this));\r\n app.get(base + \"/actions\", this.actions.bind(this));\r\n }", "title": "" }, { "docid": "72ce05b622948bbd8c2d5d8ee2aea1a1", "score": "0.5288346", "text": "routes(){\n this.server.use(routes);\n }", "title": "" }, { "docid": "bdb405adc6772866e45e4ddabece73e7", "score": "0.5287557", "text": "function configureRoutes () {\n app.post('/chef', handleChefGraphRequest);\n app.post('/meal', handleMealGraphRequest);\n}", "title": "" }, { "docid": "8dbbb84ace08453fdb3ba630407f1d24", "score": "0.52707374", "text": "function cfgMainStageRoutes($routeProvider, routeStates, $locationProvider) {\n\n $routeProvider\n .when(routeStates.homeState.url, routeStates.homeState)\n . when(routeStates.profileState.url, routeStates.profileState)\n . when(routeStates.dashboardState.url, routeStates.dashboardState)\n . when(routeStates.dashboardSeedlingState.url, routeStates.dashboardSeedlingState);\n\n $locationProvider.html5Mode(true);\n\n\n }", "title": "" }, { "docid": "e925fe9c303959cc5bd1ba5b538f90cb", "score": "0.5270573", "text": "refreshURL(router) {\n let desiredURL = null;\n if (this.props.galleryVisible) {\n desiredURL = CONSTANTS.FOLDER_ROUTE\n .replace(/:folderId\\??/, this.props.folderID);\n } else if (this.props.editorVisible) {\n desiredURL = CONSTANTS.EDITING_ROUTE\n .replace(/:fileId\\??/, this.props.fileID)\n .replace(/:folderId\\??/, this.props.folderID);\n }\n\n if (desiredURL !== null && desiredURL !== router.current) {\n // 3rd arg false so as not to trigger handleEnterRoute() and therefore an infinite loops\n router.show(desiredURL, null, false);\n }\n }", "title": "" }, { "docid": "f6da283e727ac2b9277712cca61dc257", "score": "0.5268941", "text": "function initStore() {\n var store = (0, _configureSagaStore2.default)();\n\n (0, _injectAsyncReducers2.default)(store, _actionTypes.API_STATUS_ROOT, (0, _reducers.reducer)(_actionTypes.API_STATUS_ROOT));\n (0, _injectAsyncReducers2.default)(store, _actionTypes.APP_DATA_ROOT, (0, _reducers.reducer)(_actionTypes.APP_DATA_ROOT));\n\n return {\n logon: _logon2.default.bind(null, store),\n logoff: _logoff2.default.bind(null, store),\n connection: loggedOn.bind(null, store),\n\n addServices: _addServices2.default.bind(null, store),\n getServices: _getServices2.default.bind(null, store),\n\n apiCall: _apiCall2.default.bind(null, store),\n apiCallAll: _apiCallAll2.default.bind(null, store),\n rafObject: _routeToObj2.default.bind(null, store),\n\n deleteRafObject: _deleteRafObject2.default.bind(null, store),\n\n jobState: _jobState2.default.bind(null, store),\n jobStateAll: _jobStateAll2.default.bind(null, store),\n\n submit: _apiSubmit2.default.bind(null, store),\n submitStatus: getApiStatus.bind(null, store),\n\n setAppData: _appData2.default.bind(null, store),\n getAppData: getAppData.bind(null, store),\n\n getState: store.getState,\n endStore: _endStore2.default.bind(null, store),\n store: store,\n\n getServiceRoot: _getServiceRoot2.default.bind(null, store),\n\n request: _request2.default\n };\n}", "title": "" }, { "docid": "391057f2ad4b71f76459161db23f4a3e", "score": "0.52623713", "text": "appRoutes() {\n this.app.post('/pet', routeHandler.addNewPetRouteHandler);\n\n this.app.get('/pet', routeHandler.findAllPetsRouteHandler);\n\n this.app.get('/pet/findById/:id', routeHandler.findPetByIdRouteHandler);\n\n this.app.get('/pet/findByStatus/:status', routeHandler.findPetByStatusRouteHandler);\n\n this.app.put('/pet/:id', routeHandler.updatePetByIdRouteHandler);\n\n this.app.get('*', routeHandler.routeNotFoundHandler);\n }", "title": "" }, { "docid": "9979286d4c351790fce1f7da4238f7f0", "score": "0.5259126", "text": "init() {\n this.app.use(bodyParser.urlencoded({ extended: false }));\n this.app.use(bodyParser.json());\n\n // data inspection routes\n httpMethods.forEach((method) => {\n const endpoint = method.toLowerCase();\n this.app.get(`/_/${endpoint}`, this.lookup(endpoint).bind(this));\n });\n\n // allow users to delete all messages\n this.app.delete('/_', (req, res) => {\n const promises = [];\n httpMethods.forEach((method) => {\n promises.push(this.db(`http_${method}`).delete());\n });\n Promise.all(promises)\n .then(() => {\n res.status(200).json({ status: 'success', message: 'All requests cleared'});\n });\n });\n\n httpMethods.forEach((method) => {\n this.app.delete(`/_/${method}`, (req, res) => {\n this.db(`http_${method}`).delete()\n .then(() => {\n res.status(200).json({ status: 'success', message: 'All requests cleared' });\n });\n });\n });\n\n this.app.get('/_/health-check', (req, res) => {\n res.status(200).json({ status: 'success', message: 'Hi' });\n });\n\n // catch \"all\" route (except, routes like /_)\n this.app.all(/^[^_]/, this.catchall.bind(this));\n }", "title": "" }, { "docid": "cffefdb56a2f084759d6a43810b9846d", "score": "0.5258225", "text": "appRoutes() {\n const v1 = express.Router();\n this.app.use('/api', v1);\n v1.use('/auth', require('./auth'));\n v1.use('/modify', require('./objectService'));\n v1.use('/image', require('./imageService'));\n }", "title": "" }, { "docid": "868c8514e321bc598003b96330e496aa", "score": "0.5253252", "text": "function App() {\n return <HashRouter>\n <Header/>\n <Route path=\"/rectcircle\" component={Rectangle}/>\n <Route path=\"/custom\" component={CustomSh}/>\n <Route path=\"/star\" component={DragStar}/>\n <Route path=\"/circledrag\" component={DragRectCir}/>\n <Route path=\"/konvanodrefapi\" component={RefApi}/>\n <Route path=\"/freedrawing\" component={Drawing}/>\n {/* <Route path=\"/animation1\" component={Animation1}/> */}\n <Route path=\"/transformer\" component={TransformRectangle}/>\n <Route path=\"/simpleani\" component={Animation}/>\n <Route path=\"/complexAnimation\" component={ColoredRect}/>\n <Route path=\"/zindex\" component={Zindex1}/>\n <Route path=\"/domimtocanvas\" component={ImageToCanvas}/>\n <Route path=\"/filter\" component={FilteringImage}/>\n <Route path=\"/images\" component={Images}/>\n <Route path=\"/rectcirstarpolygon\" component={FourShape}/>\n <Route path=\"/rotation\" component={Rotation}/>\n <Route path=\"/image\" component={Image1}/>\n <Route path=\"/zindexrect\" component={Zindex2}/> \n\n\n\n </HashRouter>\n}", "title": "" }, { "docid": "a44cb28e44d420b5425c3cde3f4b669c", "score": "0.5248905", "text": "function RegisterRoutes(app) {\n // ###########################################################################################################\n // NOTE: If you do not see routes for all of your controllers in this file, then you might not have informed tsoa of where to look\n // Please look into the \"controllerPathGlobs\" config option described in the readme: https://github.com/lukeautry/tsoa\n // ###########################################################################################################\n app.get('/api/v1', function (request, response, next) {\n var args = {};\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n var validatedArgs = [];\n try {\n validatedArgs = getValidatedArgs(args, request);\n }\n catch (err) {\n return next(err);\n }\n var controller = new index_controller_1.IndexController();\n var promise = controller.index.apply(controller, validatedArgs);\n promiseHandler(controller, promise, response, next);\n });\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n app.get('/api/v1/msg', function (request, response, next) {\n var args = {};\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n var validatedArgs = [];\n try {\n validatedArgs = getValidatedArgs(args, request);\n }\n catch (err) {\n return next(err);\n }\n var controller = new index_controller_1.IndexController();\n var promise = controller.msg.apply(controller, validatedArgs);\n promiseHandler(controller, promise, response, next);\n });\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n function isController(object) {\n return 'getHeaders' in object && 'getStatus' in object && 'setStatus' in object;\n }\n function promiseHandler(controllerObj, promise, response, next) {\n return Promise.resolve(promise)\n .then(function (data) {\n var statusCode;\n if (isController(controllerObj)) {\n var headers_1 = controllerObj.getHeaders();\n Object.keys(headers_1).forEach(function (name) {\n response.set(name, headers_1[name]);\n });\n statusCode = controllerObj.getStatus();\n }\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n if (data && typeof data.pipe === 'function' && data.readable && typeof data._read === 'function') {\n data.pipe(response);\n }\n else if (data || data === false) { // === false allows boolean result\n response.status(statusCode || 200).json(data);\n }\n else {\n response.status(statusCode || 204).end();\n }\n })[\"catch\"](function (error) { return next(error); });\n }\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n function getValidatedArgs(args, request) {\n var fieldErrors = {};\n var values = Object.keys(args).map(function (key) {\n var name = args[key].name;\n switch (args[key][\"in\"]) {\n case 'request':\n return request;\n case 'query':\n return validationService.ValidateParam(args[key], request.query[name], name, fieldErrors, undefined, { \"controllerPathGlobs\": [\"./src/controllers/**/*controller.ts\"], \"specVersion\": 3 });\n case 'path':\n return validationService.ValidateParam(args[key], request.params[name], name, fieldErrors, undefined, { \"controllerPathGlobs\": [\"./src/controllers/**/*controller.ts\"], \"specVersion\": 3 });\n case 'header':\n return validationService.ValidateParam(args[key], request.header(name), name, fieldErrors, undefined, { \"controllerPathGlobs\": [\"./src/controllers/**/*controller.ts\"], \"specVersion\": 3 });\n case 'body':\n return validationService.ValidateParam(args[key], request.body, name, fieldErrors, name + '.', { \"controllerPathGlobs\": [\"./src/controllers/**/*controller.ts\"], \"specVersion\": 3 });\n case 'body-prop':\n return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, 'body.', { \"controllerPathGlobs\": [\"./src/controllers/**/*controller.ts\"], \"specVersion\": 3 });\n }\n });\n if (Object.keys(fieldErrors).length > 0) {\n throw new tsoa_1.ValidateError(fieldErrors, '');\n }\n return values;\n }\n // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa\n}", "title": "" }, { "docid": "fcb62ebf2e148eaafe2d7f50cba26e7c", "score": "0.5246937", "text": "constructor() {\n this.routes = {};\n }", "title": "" }, { "docid": "9ebaf629160086d6c8ad99d78f62fed6", "score": "0.524399", "text": "appRoutes() {\n this._express.post('/login', authController_1.default.loginAuth);\n this._express.get('/logout', authController_1.default.logout);\n this._express.get('/login', checkJwt_1.isLogged, authController_1.default.loginView);\n this._express.use(testRoutes_1.default);\n this._express.use('/api/teachers', checkJwt_1.checkJwt, teacherRoutes_1.default);\n this._express.use('/api/students', checkJwt_1.checkJwt, studentRoutes_1.default);\n this._express.use(checkJwt_1.checkJwt, attendanceRoutes_1.default);\n this._express.use(checkJwt_1.checkJwt, dashboardRoutes_1.default);\n this._express.use(checkJwt_1.checkJwt, indexRoutes_1.default);\n this.errorRoutes();\n }", "title": "" }, { "docid": "bae2c1b729da56a0ba0bcf0172249e1f", "score": "0.52320004", "text": "function routeHandler() {\n routie({\n '': function () {\n sectionToggler('combo-generator');\n },\n favourites: function () {\n sectionToggler('favourites');\n },\n 'favourites/:id': function () {\n sectionToggler('fav-item');\n },\n // 'favourites/:id': function (id) {\n // console.log(id);\n // sectionToggler(id)\n // addSection(id);\n // toggle(id);\n // const filtered = filterPlayers(playerData, id);\n // renderPlayerData(filtered);\n // },\n });\n}", "title": "" }, { "docid": "8044e39694aeddd270a88e0696ae6d19", "score": "0.5227873", "text": "function setupRoutes(app) {\n app.use(cors(CORS_OPTIONS)); //needed for future projects\n //@TODO add routes to handlers\n app.use(bodyParser.json());\n app.get(`/${BASE}/${STORE}/:ssname`, doList(app));\n app.delete(`/${BASE}/${STORE}/:ssname`, doDelete(app));\n app.patch(`/${BASE}/${STORE}/:ssname`, doUpdate(app));\n app.put(`/${BASE}/${STORE}/:ssname`, doReplace(app));\n app.delete(`/${BASE}/${STORE}/:ssname/:id`, doDeleteCell(app));\n app.patch(`/${BASE}/${STORE}/:ssname/:id`, doUpdateCell(app));\n app.put(`/${BASE}/${STORE}/:ssname/:id`, doUpdateCell(app));\n \n\n app.use(do404(app));\n app.use(doErrors(app));\n}", "title": "" }, { "docid": "76f6a595a67f754f35c1ddea69c97ace", "score": "0.52267087", "text": "configureRouter(config, router) {\n this._router = router;\n config.title = \"Aurelia tutorial\";\n // config.map([\n // //routes go here\n // //route = URL , moduleId = name of the viewmodel\n // // also can have multiple urls \n // { route: [\"\", \"events\"], moduleId: 'viewmodels/events', title: \"Events\", nav: true },\n // {\n // route: \"jobs\", moduleId: \"viewmodels/jobs\",\n // title: \"Jobs\", nav: true\n // },\n // { route: \"discussion\", moduleId: \"viewmodels/discussion\", title: \"Discussion\", nav: true },\n // // name here is used as a unique identifier\n // { route: \"event/:eventId\", moduleId: \"viewmodels/eventDetail\", name: \"eventDetail\" }\n \n // ]);\n \n // we can also have 2 routers with different name in a page so that we can specify which module goes to which part of the screen\n // we do this by using viewPorts\n \n config.map([\n {\n route: [\"\", \"events\"],\n viewPorts:\n {\n mainContent: { moduleId: 'viewmodels/events' },\n sideBar: { moduleId: 'viewmodels/sponsors' }\n }, \n title : \"Events\",\n nav: true,\n },\n {\n route: \"jobs\",\n viewPorts:\n {\n mainContent: { moduleId: 'viewmodels/jobs' },\n sideBar: { moduleId: 'viewmodels/advert' }\n },\n title: \"Jobs\",\n nav: true,\n },\n {\n route: \"discussion\",\n viewPorts:\n {\n mainContent: { moduleId: 'viewmodels/discussion' },\n sideBar: { moduleId: 'viewmodels/advert' }\n },\n title: \"Discussion\",\n nav: true,\n },\n {\n route: \"event/:eventId\",\n viewPorts:\n {\n mainContent: { moduleId: 'viewmodels/eventDetail' },\n sideBar: { moduleId: 'viewmodels/sponsors' }\n },\n name: \"eventDetail\",\n\n }\n ]);\n \n //enabling push state, to remove the # in the URL \n // config.options.pushState = true; // will mess up the back end when refresh cause the confusion b/w server side and client side routing \n // need to fix the on the server\n \n //custom pipeline //adding middleware\n // config.addPipelineStep('authorize', LogNextStep);\n // config.addPipelineStep('preActivate', LogNextStep);\n // config.addPipelineStep('preRender', LogNextStep);\n // config.addPipelineStep('postRender', LogNextStep);\n config.addPipelineStep('authorize', NavToastStep);\n \n }", "title": "" }, { "docid": "c8fc309987a447f2d6af793540272e6d", "score": "0.5220267", "text": "function router(app, db) {\n return routes.forEach((route) => {\n route(app, db);\n });\n}", "title": "" }, { "docid": "12eda682108c72687a9a3e1fd3e19b0f", "score": "0.5206262", "text": "_routeChanged(route,endPoint){if(\"string\"===typeof route.path){if(\"string\"===typeof endPoint){if(route.path.startsWith(endPoint)){return}}// reload the page which since route changed will load that page\nwindow.location.reload()}}", "title": "" }, { "docid": "26701a28d265a5d517777b6d13decb58", "score": "0.52010715", "text": "routes() {\n if (process.env.NODE_ENV !== 'test') {\n this.server.use(logger);\n }\n this.server.use(routes);\n this.server.use(ErrorHandler);\n }", "title": "" }, { "docid": "45dfe9eb873085458ba5d751428197b9", "score": "0.5194856", "text": "function appReducers(state, action) {\n\n if (typeof state === 'undefined') {\n return initialState;\n }\n\n switch (action.type) {\n\n case _actions.LOG_OUT:\n {\n return Object.assign({}, state, {\n loggedIn: false\n });\n }\n\n case _actions.LOG_IN:\n {\n return Object.assign({}, state, {\n loggedIn: true\n });\n }\n\n case _actions.UPDATE_COURSE:\n {\n return Object.assign({}, state, {\n currentCourse: action.courseId\n });\n }\n\n case _actions.IS_INSTRUCTOR:\n {\n return Object.assign({}, state, {\n userType: 'INSTRUCTOR'\n });\n }\n\n }\n\n return state;\n}", "title": "" }, { "docid": "bc4ea19e59afda937fe9516419d706b2", "score": "0.5181999", "text": "init() { \n this.router.use(note.noteRoute.path, note.noteRoute.router);\n }", "title": "" }, { "docid": "278e33ec6b3a95d7a27adec231b6ab43", "score": "0.5179613", "text": "function App() {\n return (\n <UserState>\n <AlertState>\n <Router>\n <div className={`App`}>\n <Nav />\n <div className='container'>\n <Alerts />\n <Preload />\n <Switch>\n <Route path='/' exact component={MainApp} />\n <Route path='/register' component={Register} />\n <Route path='/login' component={Login} />\n <Route path='/about' component={About} />\n {/* <Route path='/mainapp' component={MainApp} /> */}\n\n <Route path='/abc' component={ABCApp} />\n <Route path='/animals' component={AnimalApp} />\n <Route\n path='/sightwords'\n component={ClockApp}\n />\n <Route path='/colors' component={ColorApp} />\n <Route path='/math' component={MathApp} />\n <Route path='/numbers' component={NumApp} />\n <Route path='/planets' component={PlanetApp} />\n <Route path='/shapes' component={ShapeApp} />\n </Switch>\n </div>\n </div>\n </Router>\n </AlertState>\n </UserState>\n );\n}", "title": "" }, { "docid": "9366028df92b3398b0f295ab0b5f45b0", "score": "0.5177785", "text": "function buildRoutes(app) {\n\tbuildApiRoutes(app);\n\tbuildRendrRoutes(app);\n\tapp.get(/^(?!\\/api\\/)/, mw.handle404());\n}", "title": "" }, { "docid": "2cbce66bfd5fd652cfd7c795ea39f6bc", "score": "0.5172252", "text": "function router() { // private function\n\n var path = location.hash;\n console.log('path is ' + path);\n if (!routes[path]) {\n var ele = document.createElement(\"div\");\n ele.innerHTML = \"<p>Error: unknown link '\" + path + \"' never added to the routing table.</p>\";\n inject(ele);\n } else {\n var ele = routes[path](); // returns DOM element from the function stored in the routes associative array\n inject (ele); \n }\n }", "title": "" }, { "docid": "1533ef371896c1a18248e76261e1db54", "score": "0.5170897", "text": "_proxyRouter() {\n const routeName = this._currentRouteName;\n history.replaceState({ routeName },0,this._currentRouteName);\n this._loadComponent(routeName);\n }", "title": "" }, { "docid": "71ff1825e592e93ffd51ca247f1825c0", "score": "0.5168691", "text": "routes() {\n this.app.use(this.routenames.empleado, empleado_1.default);\n this.app.use(this.routenames.cliente, cliente_1.default);\n this.app.use(this.routenames.authEmpleado, authempleado_1.default);\n this.app.use(this.routenames.authCliente, authCliente_1.default);\n this.app.use(this.routenames.categoria, categoria_1.default);\n this.app.use(this.routenames.marca, marca_1.default);\n this.app.use(this.routenames.proveedor, proveedor_1.default);\n this.app.use(this.routenames.producto, producto_1.default);\n this.app.use(this.routenames.rating, rating_1.default);\n this.app.use(this.routenames.orden, orden_1.default);\n this.app.use(this.routenames.ordenDte, OrdenDetalle_1.default);\n this.app.use(this.routenames.carrito, carrito_1.default);\n this.app.use(this.routenames.cupon, cupon_1.default);\n this.app.use(this.routenames.pay, pay_1.default);\n }", "title": "" }, { "docid": "4f8c709651b1869298dd7fee0560e532", "score": "0.51666456", "text": "routes() {\n this.server.use(routes);\n }", "title": "" }, { "docid": "4f8c709651b1869298dd7fee0560e532", "score": "0.51666456", "text": "routes() {\n this.server.use(routes);\n }", "title": "" }, { "docid": "9575d74d82c480747a3aae6e21dd9a3e", "score": "0.51429653", "text": "function rootReducer(state = initialState, action){\r\n \r\n if(action.type === constants.ADD_ARTICLE){\r\n return Object.assign({}, state,{\r\n articles: state.articles.concat(action.payload)\r\n });\r\n }\r\n\r\n if(action.type === constants.DATA_LOADED){\r\n\r\n return Object.assign({}, state,{\r\n remoteArticles: state.remoteArticles.concat(action.payload),\r\n fetchedData: true,\r\n })\r\n }\r\n \r\n if(action.type == constants.POST_DATA){\r\n return Object.assign({}, state, {\r\n lastPost : action.payload\r\n })\r\n }\r\n\r\n if(action.type == constants.STARTUP){\r\n console.log(\"updating startup state\")\r\n return Object.assign({},state, {startup : true})\r\n }\r\n if(action.type == constants.LOGIN){\r\n \r\n console.log(\"action payload:\")\r\n console.log(action.payload)\r\n return Object.assign({},state, action.payload)\r\n }\r\n if(action.type == constants.GITHUB.GET){\r\n return Object.assign({},state, action.payload)\r\n }\r\n \r\n return state\r\n\r\n \r\n}", "title": "" }, { "docid": "92e4b58e29dd2a6522f5c5588f035ae8", "score": "0.51418394", "text": "function handleRoutes(params){\n render(states[capitalize(params.path)]);\n}", "title": "" } ]
e900fdd5247e58457ccc5d716d79c1e8
Updated the gateway status for this shard
[ { "docid": "4a89ac22c51a06f5a575daa6f5137b29", "score": "0.6302448", "text": "gatewayPing() {\n\t\tthis._wsStatus = Date.now();\n\t}", "title": "" } ]
[ { "docid": "04cb882a407e7090eb7ac872a2c54776", "score": "0.5672624", "text": "onConnectionStatus() {\n const state = Store.getState();\n if (!this.isOnline()) {\n this.hangup();\n } else {\n Store.changeProperty(\"users.updatesCounter\",state.users.updatesCounter+1)\n }\n }", "title": "" }, { "docid": "6e826f37f94b163e1aa1c924ee72a34f", "score": "0.5531016", "text": "_updateStatus() {\n if (this._timer) {\n clearTimeout(this._timer);\n delete this._timer;\n }\n\n const self = this;\n\n this.servers.forEach((address, i) => CothorityWS.getStatus(address)\n .then((response) => {\n response.timestamp = Date.now(); // add the timestamp of the last check\n self.status[address] = response;\n self.triggerUpdate();\n })\n .catch(() => {\n self.status[address] = {\n timestamp: Date.now(),\n server: {address}\n };\n self.triggerUpdate();\n })\n );\n\n this._timer = setTimeout(() => self._updateStatus(), self.refreshInterval);\n }", "title": "" }, { "docid": "5d2812543d16032efec0b01fb2cd349d", "score": "0.55223286", "text": "updateStatus() {\n q.connect((err) => {\n q.full_stat((err, response) => {\n console.log(response);\n var status = {\n host: q.address()['address']\n };\n if (response) {\n status['online'] = true;\n status['playerCount'] = response['numplayers'];\n status['playerMax'] = response['maxplayers'];\n status['players'] = response['player_'];\n status['version'] = response['version']\n } else {\n status['online'] = false;\n }\n console.log(status);\n this.status = status;\n })\n })\n }", "title": "" }, { "docid": "30b61d8d62ebc653764ef1cee5ad4c9f", "score": "0.55109143", "text": "setStatus( newStatus ){\n\t\tthis.setState( { status: newStatus } );\n\t\tthis.emitter.emit( Ship.CHANGE_STATUS, newStatus );\n\t}", "title": "" }, { "docid": "0d160168c011126dd5a0c405eebc960e", "score": "0.5432728", "text": "refreshCurrentStatus() {\n if (this.token.timestamp + this.token.expires_in < (new Date()).getTime() / 1000) {\n this.refreshToken();\n }\n let options = {\n method: \"GET\",\n headers: {\n \"accept\": \"application/vnd.bsh.sdk.v1+json\",\n \"Accept-Language\": \"en-GB\",\n \"authorization\": \"Bearer \" + this.token.access_token\n }\n };\n\n let self = this;\n request(\"https://api.home-connect.com/api/homeappliances/\" + this.config.haId, options,\n (err, res, body) => {\n let result = JSON.parse(body);\n if (!result.data.connected) self.setStatus(Status.Disconnected);\n });\n\n\n request(\"https://api.home-connect.com/api/homeappliances/\" + this.config.haId + \"/status\", options,\n (err, res, body) => {\n let result = JSON.parse(body);\n try {\n let state = result.data.status[2].displayvalue;\n if (state === \"Inactive\") {\n self.log(\"Current state is inactive\");\n self.setStatus(Status.Inactive);\n } else if (state === \"Ready\") {\n self.log(\"Current state is Running\");\n self.setStatus(Status.Running);\n } else {\n self.log(\"Current state is unknown\");\n self.log(body);\n }\n } catch (e) {\n this.log(\"Unexpected response from result: \" + result);\n self.setStatus(Status.Disconnected);\n }\n });\n }", "title": "" }, { "docid": "adb817ef12904cfafecfc5a1fd3b6ab5", "score": "0.540578", "text": "doUpdate () {\n\t\tif (this.state.urls.length <= 0) {\n\t\t\tthis.clearStage ();\n\t\t\treturn;\n\t\t}\n\t\tif (! this.isDisplayConditionActive) {\n\t\t\tthis.clearStage ();\n\t\t\treturn;\n\t\t}\n\t\tconst monitorstatus = App.systemAgent.agentControl.getLocalAgent ().lastStatus.monitorServerStatus;\n\t\tif ((typeof monitorstatus != \"object\") || (monitorstatus == null)) {\n\t\t\tthis.clearStage ();\n\t\t\treturn;\n\t\t}\n\t\tthis.monitorStatus = monitorstatus;\n\t\tif (this.stage == \"\") {\n\t\t\tthis.setStage (Initializing);\n\t\t}\n\t}", "title": "" }, { "docid": "749452dae02cb570f4655f234666dc4c", "score": "0.5366966", "text": "_updateNetworkStatus () {\n nets({\n method: 'GET',\n url: this._serverURL\n }, (err, res) => {\n this._networkIsOnline = !err && (res.statusCode === 200);\n });\n }", "title": "" }, { "docid": "00ac54acf9bc1976551b015f092fb6c9", "score": "0.5335954", "text": "function updateStatus(new_status) {\r\n curr_status = new_status;\r\n status.innerHTML = (new_status === 'bc' ? 'BROADCASTING' : 'REQUESTING');\r\n }", "title": "" }, { "docid": "c0b19393c34b9e8e41725c3d5c18a0d2", "score": "0.52764696", "text": "async updateStates() {\n await this.sendRequests(this.updateCommands);\n }", "title": "" }, { "docid": "1b863c47f3ebe9147740120f0aa06bfb", "score": "0.526393", "text": "checkStatus() {\n this.sendRequest(Operations.status);\n }", "title": "" }, { "docid": "dffb550421658e1a65927f90571df7f8", "score": "0.5230193", "text": "updateOnline() {\n this.state.online = io.engine.clientsCount;\n this.softUpdate = true;\n }", "title": "" }, { "docid": "16d8124018d7eb9baaa40db5864fb789", "score": "0.52239823", "text": "_updateConnectionStatus(connectionStatus) {\n if (this._connectionStatus === connectionStatus) {\n return;\n }\n this._connectionStatus = connectionStatus;\n // If we are not 'connecting', reset any reconnection attempts.\n if (connectionStatus !== 'connecting') {\n this._reconnectAttempt = 0;\n clearTimeout(this._reconnectTimeout);\n }\n if (this.status !== 'dead') {\n if (connectionStatus === 'connected') {\n // Send pending messages, and make sure we send at least one message\n // to get kernel status back.\n if (this._pendingMessages.length > 0) {\n this._sendPending();\n }\n else {\n void this.requestKernelInfo();\n }\n }\n else {\n // If the connection is down, then we do not know what is happening\n // with the kernel, so set the status to unknown.\n this._updateStatus('unknown');\n }\n }\n // Notify others that the connection status changed.\n this._connectionStatusChanged.emit(connectionStatus);\n }", "title": "" }, { "docid": "5bedbb4fe6271aeaa5fb39b734f8ac90", "score": "0.5222667", "text": "moveBike(Status, BikeID, success) {\r\n connection.query('UPDATE Bike SET Status = ? WHERE BikeID = ?', [Status, BikeID], (error, results) => {\r\n if (error) return console.error(error);\r\n\r\n success();\r\n });\r\n }", "title": "" }, { "docid": "783d188f7915c6bc49fa0f229b680cfd", "score": "0.5221954", "text": "_updateStatus(status) {\n if (this._status === status || this._status === 'dead') {\n return;\n }\n this._status = status;\n Private.logKernelStatus(this);\n this._statusChanged.emit(status);\n if (status === 'dead') {\n this.dispose();\n }\n }", "title": "" }, { "docid": "af4d5b4dd6959b101029f57b309dfd06", "score": "0.5219385", "text": "function refreshStatus() {\n\tif ( !isControllerConnected() ) {\n\t\treturn;\n\t}\n\n\tvar finish = function() {\n\n\t\t// Notify the page container that the data has refreshed\n\t\t$( \"html\" ).trigger( \"datarefresh\" );\n\t\tcheckStatus();\n\t\treturn;\n\t};\n\n\tif ( checkOSVersion( 216 ) ) {\n\t\tupdateController( finish, networkFail );\n\t} else {\n\t\t$.when(\n\t\t\tupdateControllerStatus(),\n\t\t\tupdateControllerSettings(),\n\t\t\tupdateControllerOptions()\n\t\t).then( finish, networkFail );\n\t}\n}", "title": "" }, { "docid": "485db7d2789fb52b355f22cdf5728aff", "score": "0.52122515", "text": "function statusUpdate( response )\n {\n Logger.log(\"InteractiveAdModel::statusUpdate() working...\");\n }", "title": "" }, { "docid": "9479515153acf67049fcbdcf87905715", "score": "0.5185367", "text": "updateLobbyStatus(status) {\n\t\tthis.setState({\n\t\t\tinLobby: status,\n\t\t});\n\t}", "title": "" }, { "docid": "9f4d6f77c3ce8fd3c824d2782e2116ad", "score": "0.5147676", "text": "update(){\n\t\tthis.setState({\n\t\t\tstatus: this.props.model.getUserStatus()\n\t\t})\n\t}", "title": "" }, { "docid": "94e54c5f1c10f5e7a83967a6c6087224", "score": "0.5122686", "text": "function updateServerStatus(serverId, connId) {\n\t\tvar cfg = dataStorage.getSettings();\n\t\t\n if ( ! cfg ) return false;\n\t\t\n cfg.servers[serverId].__connection_id = connId;\n\n dataStorage.saveSettings(cfg);\n\n return cfg.servers[serverId];\n\t}", "title": "" }, { "docid": "30a78aacc7e475924362b047c89ce03d", "score": "0.5122583", "text": "_updateConnectionStatus(connectionStatus) {\n if (this._connectionStatus === connectionStatus) {\n return;\n }\n this._connectionStatus = connectionStatus;\n // If we are not 'connecting', stop any reconnection attempts.\n if (connectionStatus !== 'connecting') {\n this._reconnectAttempt = 0;\n clearTimeout(this._reconnectTimeout);\n }\n // Send the pending messages if we just connected.\n if (connectionStatus === 'connected') {\n this._sendPending();\n }\n // Notify others that the connection status changed.\n this._connectionStatusChanged.emit(connectionStatus);\n }", "title": "" }, { "docid": "3a74a8c877df5a75b7e8d92758d926e0", "score": "0.51088923", "text": "updatestatus(order) {\n // Note: Add headers if needed (tokens/bearer)\n const httpHeaders = this.httpUtils.getHTTPHeaders();\n const id = order.id_order;\n const APi_URL = this.getDomain() + 'status/';\n return this.http.put(APi_URL + id, order, { headers: httpHeaders });\n }", "title": "" }, { "docid": "5708f484e3f5c305a4a4d714cafc0b7a", "score": "0.50871354", "text": "function updateStatus() {\n\t\t$('#status').html($(statusTemplate(status())));\n\t}", "title": "" }, { "docid": "b0637200b68c6a7888fc008cf48e7e00", "score": "0.5077751", "text": "async changeStatus(status, version) {\n let body = {\n name: status,\n version: version\n }\n\n axios.put(\"https://iv1201-backend.herokuapp.com/alter-status/\" + this.state.watchingApplication.id, body, {\n headers: {\n Authorization: 'Bearer ' + this.props.jwt\n }\n }\n ).then((response) => {\n this.setState({ error: \"\" });\n this.setState({ status: \"\"});\n this.setState({ watchingApplication: response.data });\n\n }).catch((err) => {\n console.log(err.response.data.message);\n this.setState({ loading: false });\n this.setState({ error: err.response.data.message });\n });\n }", "title": "" }, { "docid": "00f37732f6c581d603e3153c0d123b49", "score": "0.5063927", "text": "set killswitch(state) {\n Api.busy = true;\n fetch(Api.urls.status + Api.session.token + '/' + state, {\n method: 'PUT' \n }).then(function(response) {\n return Api._handleErrors('killswitch', response);\n }).then(function(response) {\n Api.lastError = response.error;\n if (!response.error) {\n Api._killswitch = response.killswitch;\n Api.authenticated = true;\n }\n Api.busy = false;\n Api._callSubscribers('killswitch');\n }).catch(function(response) {\n Api._handleThrows('killswitch', response);\n });\n }", "title": "" }, { "docid": "e2df7079b652e2f6f0c3bc03159ceb33", "score": "0.5060638", "text": "updateStatus() {\n\t\tconst url = '/status';\n\n\t\tfetch(url)\n\t\t\t.then(res => {\n\t\t\t\tif (res.status === 200) {\n\t\t\t\t\treturn res.json();\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Could not retrieve current user status\");\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then(userStatus => {\n\t\t\t\t// Put it into state\n\t\t\t\tthis.setState({user: userStatus});\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.log(error);\n\t\t\t})\n\t}", "title": "" }, { "docid": "111e32dca66156fdda1f8b6ac583c507", "score": "0.50584394", "text": "async changeStatus(status, lightIp) {\n const msg = types_2.SetPilotMessage.buildStatusControlMessage(status);\n await this.validateMsg(msg, true);\n return this.udpManager.sendUDPCommand(msg, lightIp);\n }", "title": "" }, { "docid": "e67638a4c59ff5c324ca483ef117977a", "score": "0.50435746", "text": "function sendStatus() {\n io.emit('status', status)\n}", "title": "" }, { "docid": "0657ddc27075366334e364e73108fe5f", "score": "0.5042146", "text": "async function StatusSwitch() {\n let authenticatedApi;\n\n try {\n authenticatedApi = await getAuthenticatedApi();\n } catch (err) {\n log.error('SetStatus was not able to get an authenticated HUE API');\n }\n\n const currentLightStatus = await authenticatedApi.lights.getLightAttributesAndState(\n config.light_id\n );\n\n if (currentLightStatus.state.on) {\n const newLightState = new lightState().off();\n const status = await authenticatedApi.lights.setLightState(\n config.light_id,\n newLightState\n );\n log.info('Hue Status light turned off is ' + status);\n } else {\n const newLightState = new lightState().on();\n const status = await authenticatedApi.lights.setLightState(\n config.light_id,\n newLightState\n );\n log.info('Hue Status light turned on is ' + status);\n }\n}", "title": "" }, { "docid": "c3486e386884562686e17c56c54a98e2", "score": "0.50405616", "text": "set_status(new_status) {\n if (this.status != new_status) {\n this.status = new_status;\n this.update_load_info(); // run the method about how much power me and my children use\n this.switch_div.style.backgroundColor = this.get_current_color(0.25); // change background color of slider button box\n console.log('PowerSource/set_status:', this.name, this.status);\n return true;\n } else {\n console.log('PowerSource/set_status:', 'UNCHANGED!', this.name, this.status);\n return false;\n }\n }", "title": "" }, { "docid": "4ab11085a10f4c1434a54c7f5c40007f", "score": "0.50401163", "text": "async _refreshStatus() {\n try {\n const blindStatus = await this.blindController.getStatus()\n this.log.debug('connected:', this.blindConfig.serialNumber, '(getStatus)')\n this._updateAccessories(blindStatus, null)\n return null\n } catch (err) {\n this.log.error('_refreshStatus error getting blind status', err)\n this._updateAccessories(null, err)\n throw err\n }\n }", "title": "" }, { "docid": "d94228d57e83ec2fe9c767659281adcb", "score": "0.50254834", "text": "setUsersUpdateStatus(state, status) {\n state.usersUpdateStatus = status\n }", "title": "" }, { "docid": "5c9e5ea4b255ec62a9760b4cc7f6c98e", "score": "0.49958456", "text": "updateOnlineStatus() {\n const online = typeof window.navigator.onLine !== 'undefined' ? window.navigator.onLine : true;\n\n if (!online) {\n this.emit('is-offline');\n this.info(this.i18n('noInternetConnection'), 'error', 0);\n this.wasOffline = true;\n } else {\n this.emit('is-online');\n\n if (this.wasOffline) {\n this.emit('back-online');\n this.info(this.i18n('connectedToInternet'), 'success', 3000);\n this.wasOffline = false;\n }\n }\n }", "title": "" }, { "docid": "89867f89fe04dd2d30044ad4a1efc089", "score": "0.4985096", "text": "setStatus(num, index){\n let status = \"\";\n let guests = this.state.guests; \n if(num === 0){\n status = \"ready\";\n } else if (num === 1){\n status = \"inProgress\";\n let processStartTime = new Date();\n processStartTime = processStartTime.toString();\n\n guests[index].processStartTime = processStartTime;\n this.updateGuestData(guests[index].key , \"processStartTime\", processStartTime);\n }else {\n status = \"done\";\n }\n guests[index].status = status; \n \n this.setState({\n guests: guests\n });\n\n this.updateGuestData(guests[index].key , \"status\", status);\n }", "title": "" }, { "docid": "e591d61931836e9e9ae04ee68ce9e4f0", "score": "0.49792647", "text": "function updateStatus(order) {\n _orders.get(order.orderId).set('status', order.status);\n }", "title": "" }, { "docid": "4ab18c74324949cb39cc019acc9dc359", "score": "0.49775225", "text": "function updateJobStatus(value) {\n chrome.storage.sync.set({\"linkchecker-ongoing\": value}, function() {\n chrome.runtime.sendMessage(null, {action: \"updatedStatus\"});\n });\n }", "title": "" }, { "docid": "55e368f7829f86f4c81432d8518817b4", "score": "0.49772567", "text": "function SendMetersUpdate(){\n\tServerRequestSend(\"status\", \"meters\");\t\t\t\t\t\t\t\t\n}", "title": "" }, { "docid": "e3124425e5582905a8c203a35d6f7c71", "score": "0.49647352", "text": "function updateStatus() {\n if ($scope.isEnabled) {\n $scope.isEnabled = 1;\n } else {\n $scope.isEnabled = 0;\n }\n var sendData = $.param({\n 'task_id': $scope.taskid,\n 'is_enabled': $scope.isEnabled\n });\n ApiService.apiCall('/updateTask', 'POST', 3, sendData).then(function(response) {});\n }", "title": "" }, { "docid": "403e3c8051821933937652491f75f13a", "score": "0.49613893", "text": "repair() {\r\n this.status++;\r\n return true;\r\n }", "title": "" }, { "docid": "a3fe5db9f2db72f0d42458ea55ec2ab4", "score": "0.4956628", "text": "function setKnikkerbaanStatus(_request, response) {\n var newStatus = parseInt(_request.params.newStatus);\n var comment = \"SELECT * FROM\";\n pool.query(\"INSERT INTO baanStatus (status, tijd, opmerking) VALUES ($1, CURRENT_TIMESTAMP, $2)\", [newStatus, comment], (error, results) => {\n if (error) {\n throw error;\n }\n response.status(201).send(\"Knikkerbaanstatus is aangepast! De gegeven code was: \" + newStatus);\n });\n}", "title": "" }, { "docid": "eb7aa2dd2946ca117efeff9a81f2697e", "score": "0.49517968", "text": "_setState(data) {\n var updated = false;\n\n for (var prop in this._state) {\n if (data.hasOwnProperty(prop)) {\n this._state[prop] = data[prop];\n updated = true;\n }\n }\n\n if (updated) {\n this._emitter.emit('status:update', this.get());\n }\n }", "title": "" }, { "docid": "1a5b6c5c639c058cc4fb14585b32c6ac", "score": "0.4950595", "text": "status() {\r\n\t\tthis.client.ping()\r\n\t}", "title": "" }, { "docid": "fe63229f841f3179f551f1f680eacf5b", "score": "0.4947729", "text": "function handleUpdate() {\n if (getNearest === true) {\n useGeoURL();\n } else if (stationID !== '') {\n var url = 'http://avwx.rest/api/metar.php?station=' + stationID + '&format=JSON';\n updateReport(url);\n } else {\n sendDictionaryToPebble({'KEY_STATION': 'GOTO', 'KEY_CONDITION': 'STNG', 'KEY_SUCCESS': false});\n }\n}", "title": "" }, { "docid": "1f6356946170c774cc94bfa272e5c0d3", "score": "0.49434894", "text": "status(){\n this.client.emit('status');\n }", "title": "" }, { "docid": "05522236c174c789a31831dcb2b07315", "score": "0.4941088", "text": "setStatus(value) {\n status.set(value)\n }", "title": "" }, { "docid": "2c8c82080e818c132a4d13a55d64f6c0", "score": "0.4938961", "text": "update(details){\n\t\tif(details === 'user'){\n\t\t\tthis.setState({\n\t\t\t\tstatus: this.props.model.getUserStatus()\n\t\t\t})\n\t\t}\n\t}", "title": "" }, { "docid": "6edec7e725db1fcf8b1bb2cd148ac2c2", "score": "0.4938791", "text": "function broadcastStatus() {\n\tconsole.log('broadcasting status');\n\tNet.connect({\n\t\taddr: broadcastAddr,\n\t\tonconnect: function(conn) {\n\t\t\tlet data = {\n\t\t\t\tid: whoami.id,\n\t\t\t\tstate: state\n\t\t\t};\n\t\t\tNet.send(conn, JSON.stringify(data));\n\t\t\tNet.close(conn);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "305bcdc27087121ab9696c5ed8fc4a42", "score": "0.49374226", "text": "propergateGameStatus() {\n this.eventHandler.mainEvents.STATE_DATA_UPDATED.emit(this.gameState);\n }", "title": "" }, { "docid": "d245fa7a2f599ea01f36bb2a293da1c9", "score": "0.493254", "text": "updateStatus () {\n\n this.getNeighborStatus();\n\n let anyLivingCells = false;\n\n this.cells.forEach(cell => {\n\n let liveNeighbors = 0;\n\n for (const neighbor in cell.neighborsStatus) {\n if (cell.neighborsStatus.hasOwnProperty(neighbor) && cell.neighborsStatus[neighbor] === 'live') {\n liveNeighbors++;\n }\n }\n\n if (cell.status === 'live' && liveNeighbors < 2) {\n cell.status = 'dead';\n }\n\n if (cell.status === 'live' && liveNeighbors > 3) {\n cell.status = 'dead';\n }\n\n if (cell.status === 'dead' && liveNeighbors === 3) {\n cell.status = 'live';\n }\n\n for (const status in cell) {\n if (cell.hasOwnProperty(status) && cell[status] === 'live') {\n anyLivingCells = true;\n }\n }\n });\n\n if (!anyLivingCells) {\n clearInterval(this.gameStatus);\n }\n\n this.renderCells();\n }", "title": "" }, { "docid": "18a56732150a74fcba0d02402734f649", "score": "0.49298248", "text": "function eventHandler(response){\n\t\t//Propogate status change to the upstream\n\t\tvar statusNode = \"/deviceStatus\";\n\t\tlink.updateValue(statusNode, response);\n\t\t\n\t\t//Notify status change to the application layer\n\t\tjQuery(document).trigger(\"stateChanged\", response);\n\t}", "title": "" }, { "docid": "ad85b03525f7b0802f2e47a84db1d6dd", "score": "0.49295408", "text": "_onConnectionStatusChanged(sender, status) {\n // Proxy the signal\n this._connectionStatusChanged.emit(status);\n }", "title": "" }, { "docid": "b61b9e0d95026af0bd9a3c87fc1f89ee", "score": "0.49100557", "text": "function send(obj){\n //check is server status is ok\n if(instance.status==true){\n obj = JSON.stringify(obj);\n instance.ws.send(obj);\n //console.log('sending .. updatePosition :' , obj);\n } \n }", "title": "" }, { "docid": "3ecbcdbdf917ebd55b9c7d4f6ed8bae6", "score": "0.49030986", "text": "setUserUpdateStatus(state, status) {\n state.userUpdateStatus = status;\n }", "title": "" }, { "docid": "e4173e4fb116413998650190a3badfe9", "score": "0.489901", "text": "static async sendWin() {\n const token = config.get('auth.token');\n await superagent\n .patch(`${API_SERVER_URI}/updateStats`)\n .authBearer(token)\n .send({ win: 'win' });\n return;\n }", "title": "" }, { "docid": "4912935a92d656de12bca476f9c6bc56", "score": "0.48960248", "text": "updateStatus(pro, status, status_code, callback) {\n status = \" - \" + status;\n let sql = `UPDATE shipments set status= CONCAT(status,` + db.escape(status) + `), status_code='${status_code}' where pro='${pro}'`\n db.query(sql, callback)\n }", "title": "" }, { "docid": "1334e979ed83ea053fc5309ce4eb373e", "score": "0.48950619", "text": "connected() {\n if (this._process) {\n this._status = 2;\n this._process.send({\n action: 'connected'\n });\n }\n }", "title": "" }, { "docid": "83d1a11591b663eae5298a84726e519c", "score": "0.48874667", "text": "triggerStatus () {\n return this._call('NETWORK', 'TRIGGER_STATUS')\n }", "title": "" }, { "docid": "2eecc01ab2d9c6a8b84312320efcf082", "score": "0.48809096", "text": "function changeGameStatus(status) {\n\t\tif (status){\n\t\t\tconsole.log(\"Jogo Habilitado\");\n\t\t\tgameStatus = true;\n\t\t} else {\n\t\t\tconsole.log(\"Jogo Desabilitado\");\n\t\t\tgameStatus = false;\n\t\t}\n\t\tsendGameStatus();\n\t}", "title": "" }, { "docid": "864fd51b3a8eec4908c0fee87529b361", "score": "0.48803127", "text": "function updateStatus() {\n io.sockets.emit(\"updateStatus\", setPlayers.players);\n}", "title": "" }, { "docid": "0f016cddcc2484a5d0bc6fbb877af40f", "score": "0.48799393", "text": "putStatus(value)\n {\n \tthis.getData().status = value;\n }", "title": "" }, { "docid": "3ddf5dbd8ad2aa847bff3cff1d62f73f", "score": "0.4858766", "text": "set status(value) {}", "title": "" }, { "docid": "84d8b5d531ffc8d92db83fab11b2528d", "score": "0.48584154", "text": "handleStatus() {\n\t\tconst message = `Xdebug is ${this.php.isXdebugEnable() ? 'enabled' : 'disabled'}.`;\n\n\t\tthis.success(message);\n\t}", "title": "" }, { "docid": "6cbade6314cb09dfe4c494d95dd420f2", "score": "0.48501632", "text": "async updateBin() {\n\t\tawait dbRequests.updateUrlsBin(this);\n\t}", "title": "" }, { "docid": "526e24faa0b7df31fc248ea0401b7d88", "score": "0.48465538", "text": "modifyStatus(index) {\n // get old status\n const oldStatus = this.data[index].status;\n const statuses = [\"in the queue\", \"pending\", \"done\", \"to be deleted\"];\n const oldIndex = statuses.indexOf(oldStatus) || \"\";\n const newIndex = (oldIndex + 1) % statuses.length;\n this.data[index].status = statuses[newIndex] || \"in the queue\";\n this.emit(\"updated\", this.data);\n this.save();\n }", "title": "" }, { "docid": "9e99a817ca15b2d63ae9164f8acc9554", "score": "0.484533", "text": "changePPSBinStatus(bin, status) {\n this.props.changePPSBinStatus({bin, currentView: 'bins', enabled: status})\n }", "title": "" }, { "docid": "ea21e3cde6d719bdcd20f5435138c19c", "score": "0.48434412", "text": "function updateChargeStatus(isPluggedIn) {\n console.log('My isCharging status: ' + isPluggedIn);\n isCharging = isPluggedIn;\n\n}", "title": "" }, { "docid": "547256776055dadc2f19e305c5cf4eb9", "score": "0.4833504", "text": "function agentStatusChanged(newStatus,reason){}", "title": "" }, { "docid": "e2830e0fab9db5f2da5c6bbb23593e41", "score": "0.4832669", "text": "function updateOnlineStatus() {\n // let status = document.getElementById(\"onlineStatus\");\n // const condition = navigator.onLine ? \"online\" : \"offline\";\n // status.className = condition;\n // status.innerHTML = condition.toUpperCase();\n\n // DBHelper.syncOfflineUpdates();\n}", "title": "" }, { "docid": "1fda5e51f0179df4be1bc3c9a393f8d5", "score": "0.48300445", "text": "function handleSystemState(data) {\n var newData = JSON.parse(data);\n var state = newData.state;\n \n if (state == '1') {\n set_power('on');\n //console.log(\"Power: ON\");\n }\n else {\n set_power('off');\n //console.log(\"Power: OFF\");\n }\n \n /* Send Newly Updated Command */\n send_command();\n}", "title": "" }, { "docid": "b95ed3df8c4b01b6cf6b71fff26ca4c1", "score": "0.4827588", "text": "setOnline() {\n if (this.status !== \"ready\") {\n console.log(\"Setting service online\", this.name);\n logger_1.default.system.log(\"APPLICATION LIFECYCLE:STARTUP:SERVICE ONLINE\", this.name);\n routerClientInstance_1.default.transmit(SERVICE_READY_CHANNEL, { serviceName: this.name }); // notify service manager\n this.RouterClient.addListener(SERVICE_STOP_CHANNEL + \".\" + this.name, (err, response) => {\n this;\n dependencyManager_1.FSBLDependencyManagerSingleton.shutdown.checkDependencies();\n });\n this.status = \"ready\";\n }\n }", "title": "" }, { "docid": "5f4ae5e9e0eebbb9eff22f1859ddc937", "score": "0.48271883", "text": "function updateForwardproxyRoutingInfo(configid, targeturl, forwardurl, latency, https){\n\n\tvar query = { \"configid\" : configid };\n\n\tvar update = { $set : { \"targeturl\" : targeturl, \"forwardurl\" : forwardurl, \"latency\" : latency, \"https\" : https } };\n\n\tRoutingInfo.update(query, update, function(err, num){\n\t\tif(err)\n\t\t\tthrow err;\n\t\tconsole.log( (err === null) ? { msg: 'configuration updated' } : { msg: err });\n\n\t});\n}", "title": "" }, { "docid": "d955f48bea6c7bc21f038485d7b099a8", "score": "0.48255214", "text": "refreshAccessoryServiceIfNeed(statusArr, isRefesh) {\n this.isRefesh = isRefesh;\n for (var statusMap of statusArr) {\n if (statusMap.code === 'switch' || statusMap.code === 'switch_1') {\n this.switchLed = statusMap;\n this.setCachedState(Characteristic.On, this.switchLed.value);\n if(this.isRefesh){\n this.service\n .getCharacteristic(Characteristic.On)\n .updateValue(this.switchLed.value);\n }else{\n this.getAccessoryCharacteristic(Characteristic.On);\n }\n }\n }\n }", "title": "" }, { "docid": "f5e671faf3aee912b46d1dd6a7d5e0d2", "score": "0.4824874", "text": "function setUpdatedStatus(statusName) {\n vm.updatedStatus = statusName;\n }", "title": "" }, { "docid": "8fee61cbcf5bb39e115d99910f86e5cf", "score": "0.48183483", "text": "onKernelStatus(sender, state) {\n this._statusChanged.emit(state);\n }", "title": "" }, { "docid": "fcc9ff2673c38c8092de0480b03b1814", "score": "0.4809674", "text": "function set_agent_synced(next) {\n ZH.Agent.synced = true;\n ZH.l('ZH.Agent.synced');\n next(null, null);\n // NOTE: ZH.FireOnAgentSynced() is ASYNC\n if (ZH.FireOnAgentSynced) ZH.FireOnAgentSynced();\n}", "title": "" }, { "docid": "d3378be5fb7f37ae66b67fb829f01eff", "score": "0.4799789", "text": "function setConnectionStatus(status) {\n if (status == \"ESTABLISHED\") {\n $(\"#connectionStatus\").text(status).removeClass().attr(\"class\", \"text-success\");\n }\n\n if (status == \"DISCONNECTED\") {\n $(\"#connectionStatus\").text(status).removeClass().attr(\"class\", \"text-muted\");\n }\n\n if (status == \"FAILED\") {\n $(\"#connectionStatus\").text(status).removeClass().attr(\"class\", \"text-danger\");\n }\n}", "title": "" }, { "docid": "5a45e5385bda9f4601ccf9f58987f1f0", "score": "0.47991127", "text": "moveBike1(Status, Information, BikeID, success) {\r\n connection.query(\r\n 'UPDATE Bike SET Status = ?, Information = ? WHERE BikeID = ?',\r\n [Status, Information, BikeID],\r\n (error, results) => {\r\n if (error) return console.error(error);\r\n\r\n success();\r\n }\r\n );\r\n }", "title": "" }, { "docid": "c2434f184c55ab0384b86a4fb9f3432a", "score": "0.47966436", "text": "gotPowerUp() {\n console.log('Powered Up!')\n if (this.status = 'Small') {\n this.status = 'Big'\n } else if (this.status = 'Big') {\n this.status = 'Powered Up'\n } else if (this.status = 'Powered Up') {\n this.hasStar === true\n }\n }", "title": "" }, { "docid": "b90771425e729e451cadb1bc9cb8d997", "score": "0.4794246", "text": "async function SetStatus(status) {\n let authenticatedApi, colorCode;\n let turnFanOn = true;\n\n log.info('Preparing to set HUE status light to ' + status);\n\n try {\n authenticatedApi = await getAuthenticatedApi();\n } catch (err) {\n log.error('HUE SetStatus was not able to get an authenticated API');\n }\n\n switch (status) {\n case 'away':\n colorCode = StatusColors.Away;\n turnFanOn = false;\n break;\n case 'available':\n turnFanOn = true;\n colorCode = StatusColors.Available;\n break;\n case 'occupied':\n turnFanOn = true;\n colorCode = StatusColors.Occupied;\n break;\n case 'normal':\n turnFanOn = false;\n colorCode = StatusColors.Normal;\n break;\n default:\n turnFanOn = true;\n colorCode = StatusColors.Available;\n break;\n }\n\n const newLightState = new lightState()\n .on()\n .ct(153)\n .bri(198)\n .hue(1416)\n .sat(234)\n .xy(colorCode);\n\n try {\n const setLight = await authenticatedApi.lights.setLightState(\n config.light_id,\n newLightState\n );\n fanSetOn(turnFanOn);\n log.info(\n 'HUE Status Light turned on, status ' +\n status +\n ' (' +\n setLight +\n ')'\n );\n } catch (err) {\n log.error('Unable to set new HUE Status Light - current state ' + err);\n }\n}", "title": "" }, { "docid": "ee168ea65aba9f395ff3c293ff9f2d6e", "score": "0.47940108", "text": "setStatus(str) {\n this.meta.status = str;\n }", "title": "" }, { "docid": "3ed35a486d5954f1ff505b527c26c1ce", "score": "0.47908926", "text": "refreshAccessoryServiceIfNeed(statusArr, isRefesh) {\n this.isRefesh = isRefesh;\n for (var statusMap of statusArr) {\n if (statusMap.code === 'switch') {\n this.switchMap = statusMap\n var rawStatus = this.switchMap.value\n let status\n if (rawStatus) {\n status = '1'\n } else {\n status = '0'\n }\n this.setCachedState(Characteristic.Active, status);\n if (this.isRefesh) {\n this.service\n .getCharacteristic(Characteristic.Active)\n .updateValue(status);\n } else {\n this.getAccessoryCharacteristic(Characteristic.Active);\n }\n }\n }\n }", "title": "" }, { "docid": "08736905fa3e8310ca563d75b988a38a", "score": "0.47860098", "text": "function update(state){\n database.ref('/').update({\n gameState:state\n });\n }", "title": "" }, { "docid": "82dad72670835f7802558d7b66ebe187", "score": "0.47796354", "text": "setStatus(status) {\n this.status = status;\n }", "title": "" }, { "docid": "01eb21db383ee5b450bf8cae7de52a0a", "score": "0.47784996", "text": "function updateBatteryStatus() {\n\t\tif (battery.charging) {\n\t\t\tbatteryStatus.innerHTML = 'Charging';\n\t\t} else {\n\t\t\tbatteryStatus.innerHTML = 'Not Charging';\n\t\t}\n\t}", "title": "" }, { "docid": "a6482cacaa56b7ca6afa9ee621c57413", "score": "0.4774238", "text": "changeStatus(id, status) {\n return this.rest.put(`${this.baseUrl}/${id}/status/${status}`, null);\n }", "title": "" }, { "docid": "5f309643e6cf87934e55bcc2a12f1a4a", "score": "0.47734514", "text": "broadcastStatus(won = null) {\n\t\tthis.players.forEach((player) => {\n\t\t\tplayer.sendResponseData(JSON.stringify(this.getGameStatus(player, won)));\n\t\t});\n\t}", "title": "" }, { "docid": "80f5dc9cfccd8295fdee1d2ec62fc2d1", "score": "0.47664884", "text": "setStatus(newStatus) {\n\t\n\tif (this.status == newStatus) {\n\t return;\n\t}\n\n\tthis.status = newStatus;\n\tswitch (newStatus) {\n\tcase hdxStates.GRAPH_LOADED:\n\tcase hdxStates.WPT_LOADED:\n\tcase hdxStates.PTH_LOADED:\n\tcase hdxStates.NMP_LOADED:\n\tcase hdxStates.WPL_LOADED:\n\t this.algStat.innerHTML = \"\";\n\t this.algOptions.innerHTML = \"\";\n\t break;\n\n\tcase hdxStates.AV_COMPLETE:\n\t this.startPause.disabled = true;\n\t this.startPause.innerHTML = \"Start\";\n\t break;\n\t}\n }", "title": "" }, { "docid": "ff773524fa23b74741d23e10b1b7f6c5", "score": "0.47625953", "text": "onKernelConnectionStatus(sender, state) {\n this._connectionStatusChanged.emit(state);\n }", "title": "" }, { "docid": "ba40a0a9771fe1ece0ac24cd3fe43110", "score": "0.4761635", "text": "function updateStatus() {\n\n\t// Send command to get display buffer\n\tdispbuffReceived == 0;\n\tsendminiGamesConsoleCommand('dispbuff', 'none');\n\twhile (dispbuffReceived == 0);\n\n\t// Send command to get \"game running\" status\n\tgamerunReceived == 0;\n\tsendminiGamesConsoleCommand('gamerun', 'none');\n\twhile (gamerunReceived == 0);\n\n\t// Send command to get \"game selected\" status\n\tgameselectedReceived == 0;\n\tsendminiGamesConsoleCommand('gameselected', 'none');\n\twhile (gameselectedReceived == 0);\n\n\t// Send command to get \"LED brightness\" status\n\tledbrightnessReceived == 0;\n\tsendminiGamesConsoleCommand('ledbrightness', 'none');\n\twhile (ledbrightnessReceived == 0);\n}", "title": "" }, { "docid": "51444dc2f4a07dce833f59cbc18f9886", "score": "0.47608444", "text": "function setConnectionStatus(status) {\n if (status == \"ESTABLISHED\") {\n $(\"#connectionStatus\").text(status).removeClass().attr(\"class\",\"text-success\");\n }\n\n if (status == \"DISCONNECTED\") {\n $(\"#connectionStatus\").text(status).removeClass().attr(\"class\",\"text-muted\");\n }\n\n if (status == \"FAILED\") {\n $(\"#connectionStatus\").text(status).removeClass().attr(\"class\",\"text-danger\");\n }\n}", "title": "" }, { "docid": "b8c64153442aa1c4bceb97367d3a00c6", "score": "0.4753857", "text": "function update_status() {\r\n\t\tlogging('Update Statusbar', 3);\r\n\t\tdocument.getElementById(\"delete\").innerHTML = 'Deleted:' + deleted;\r\n\t\tdocument.getElementById(\"Hided\").innerHTML = 'Hide:' + hided;\r\n\t}", "title": "" }, { "docid": "d415c26c356252305ac295cc2a2d181a", "score": "0.4751095", "text": "function updateGame(boardStatus, gameState){\n //Send updated board status to server api\n console.log(\"about to send state to server...\");\n fetch('/updateGameState', {\n method: 'POST',\n headers : new Headers({'Content-Type': 'application/json'}),\n body:JSON.stringify(gameState)\n })\n .then(res => res.json()) //converts response to JSON data\n .then(data => unpackGameState(data)) //displays the board based on array data\n .catch(err => console.log(err))\n }", "title": "" }, { "docid": "64931e49493ebc6a5ffcdc022c2c127b", "score": "0.47493047", "text": "connected() {\n // Enabled based on device capabilities, which might change\n let incoming = this.device.settings.get_strv('incoming-capabilities');\n let outgoing = this.device.settings.get_strv('outgoing-capabilities');\n\n for (let action of this._gactions) {\n let info = this._meta.actions[action.name];\n\n if (info.incoming.every(type => outgoing.includes(type)) &&\n info.outgoing.every(type => incoming.includes(type)))\n action.set_enabled(true);\n }\n }", "title": "" }, { "docid": "f03a4ba5281bff0796cc4f4597acf80e", "score": "0.47488284", "text": "function send(obj) {\n log('Sending updated stats',t);\n log(' Sending update to ' + CONFIG.getPostPath(),i);\n request.post(CONFIG.getPostPath(), {json: true, body: obj}, function(err, res, body) {\n if (res && res.statusCode === 200) {\n log(' Update Handshake',i);\n //S3 server sends 'pass' or 'fail' if it updated or not\n if (res.body === 'fail') { //S3 Update Fail condition\n log('JSON Sent, but failed to update the S3 DB',e);\n log(' Make sure the access token and server ID are configured correctly in config.js',i);\n }\n else if (res.body === 'pass') { log('S3 Server Update Successful',t) } //S3 Update Condition\n else { log('Update Sent',t) } //generic response\n }\n else { log(err || res, e) }\n\t if (CONFIG.getWriteJson()) { backupJson(obj); } //backup json if applicable\n });\n }", "title": "" }, { "docid": "03da3bb330340228c419a5ee788ff91f", "score": "0.47480693", "text": "function UpdateConfig(listOfClient) {\n \n var fs = require('fs');\n\n var httpd_content = new Buffer(httpd_head);\n\n httpd_content += \"\\n\";\n\n for(var i = 0 ; i < listOfClient.length ; i++){\n if(listOfClient[i].TYPE == \"fronten\")\n httpd_content += \"\\t\\tBalancerMember http://\" + listOfClient[i].ip + \":8000 route=\"+ listOfClient[i].ID +\"\\n\";\n }\n\n httpd_content += \"\\n\\t\\tProxySet stickysession=ROUTEID \\n\\\n \\t</Proxy> \\\n \\n\\\n \\t<Proxy balancer://backend>\\n\";\n\n for(var i = 0; i < listOfClient.length ; i++){\n if(listOfClient[i].TYPE == \"backend\" )\n httpd_content += \"\\t\\tBalancerMember http://\" + listOfClient[i].ip + \":8000\\n\";\n }\n\n httpd_content += \"\\n\" + httpd_tail;\n\n fs.writeFile(path_httpd_file.toString(), httpd_content);\n\n /*reboot loadbalancer */\n container.restart(function (err, data) { // maybe restart ?\n console.log(data);\n });\n}", "title": "" }, { "docid": "b0c8ab47394bae903d6684d4562225ea", "score": "0.47474328", "text": "function houseStatus(houseId){\n handler.retrieveSensorStatus(houseId, function(Sensors){\n console.log(\"**********\"+houseId);\n console.log(\"***************\"+ Sensors);\n socket.broadcast.emit(events.DEVICE_STATUS, Sensors);\n });\n\n }", "title": "" }, { "docid": "280e71d3dbc2fa9946f662a1b85c599f", "score": "0.4746851", "text": "REMOTE_STATE_UPDATE(state, remoteState) {\n state.synced = remoteState;\n }", "title": "" }, { "docid": "3be0c0bc1b10f75ba73d2815f3e0c33b", "score": "0.47443125", "text": "async function handleServiceStatusChanged(DetailedStatus) {\n try {\n //Remove the existed status if this is an update\n ServiceStatus.details = ServiceStatus.details.filter(function (t_ServiceStatus) {\n return t_ServiceStatus.id != DetailedStatus.id;\n });\n //Add the detail if it was an issue\n if (DetailedStatus.status != enums.ServiceStatuses.Working) {\n ServiceStatus.details.push(DetailedStatus);\n }\n\n //Try to initialize if error arrive and qm is working\n if (ServiceStatus.status == enums.ServiceStatuses.Working && DetailedStatus.status != enums.ServiceStatuses.Working) {\n reInitializeQueuingService();\n }\n\n //Broadcast status\n var message = new responsePayload();\n message.topicName = ModuleName + \"/serviceStatusUpdate\";\n message.result = common.success;\n message.payload = ServiceStatus;\n events.broadcastMessage.emit('broadcast', broadcastTopic, message);\n }\n catch (error) {\n logger.logError(error);\n return common.error;\n }\n}", "title": "" }, { "docid": "6df685542745d3ba58acbba14bbe4960", "score": "0.4739711", "text": "gatewayCheck() {\n\t\tconst elapsed = (Date.now() - this._wsStatus) / 1000;\n\t\tif (elapsed > 900) {\n\t\t\tlogger.error(`No message received in 15 minutes, restarting cluster ${this.options.clusterId}`);\n\t\t\tprocess.exit(9);\n\t\t}\n\t}", "title": "" }, { "docid": "6df685542745d3ba58acbba14bbe4960", "score": "0.4739711", "text": "gatewayCheck() {\n\t\tconst elapsed = (Date.now() - this._wsStatus) / 1000;\n\t\tif (elapsed > 900) {\n\t\t\tlogger.error(`No message received in 15 minutes, restarting cluster ${this.options.clusterId}`);\n\t\t\tprocess.exit(9);\n\t\t}\n\t}", "title": "" } ]
5d522ed66def562527ca302170bcb386
Sets the position of the source in 3d space.
[ { "docid": "d198334b861b4be483794cfc2fa33f5a", "score": "0.63199824", "text": "setPosition(x, y, z) {\n this.positionX.value = x;\n this.positionY.value = y;\n this.positionZ.value = z;\n return this;\n }", "title": "" } ]
[ { "docid": "6c9145eff6e090eabcecf5bb4fb26888", "score": "0.64809686", "text": "function ChangeCameraPosX1() {\n var threeCamera = viewer3D.getCamera();\n threeCamera.position.set(position.x * 1.1, position.y, position.z);\n viewer3D.applyCamera(threeCamera, false);\n}", "title": "" }, { "docid": "87cd16f9e4c50d485b0b22c09798a0ac", "score": "0.63501185", "text": "function ChangeCameraPosX0() \n{\n var threeCamera = viewer3D.getCamera();\n threeCamera.position.set(position.x * 0.9, position.y, position.z);\n viewer3D.applyCamera(threeCamera, false);\n}", "title": "" }, { "docid": "1b325d1de55469c44958ad166dc0a8eb", "score": "0.6332374", "text": "setPosition(x, y, z) {\n this.positionX.value = x;\n this.positionY.value = y;\n this.positionZ.value = z;\n return this;\n }", "title": "" }, { "docid": "1b325d1de55469c44958ad166dc0a8eb", "score": "0.6332374", "text": "setPosition(x, y, z) {\n this.positionX.value = x;\n this.positionY.value = y;\n this.positionZ.value = z;\n return this;\n }", "title": "" }, { "docid": "1b325d1de55469c44958ad166dc0a8eb", "score": "0.6332374", "text": "setPosition(x, y, z) {\n this.positionX.value = x;\n this.positionY.value = y;\n this.positionZ.value = z;\n return this;\n }", "title": "" }, { "docid": "6b1b414c96c3259e9dbcb7edcb245d47", "score": "0.6305829", "text": "setPosition(x,y,z){\tthis.position.set(x,y,z);\treturn this; }", "title": "" }, { "docid": "845f1ce9cf747fc987ce66551edfbb87", "score": "0.6243925", "text": "setPosition(x, y, z)\n\t{\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}", "title": "" }, { "docid": "b0f3f53d6b9b354e86ef56af4321c904", "score": "0.62104744", "text": "function ChangeCameraPosZ1() {\n var threeCamera = viewer3D.getCamera();\n threeCamera.position.set(position.x, position.y, position.z * 1.1);\n viewer3D.applyCamera(threeCamera, false);\n}", "title": "" }, { "docid": "9e045011b968ad8c6ef2a71a25a5ffc0", "score": "0.6178017", "text": "position() {\n this._mesh.position.y = 20;\n this._mesh.position.z = 15;\n }", "title": "" }, { "docid": "7f43b53d154288d0b5233ce962ecad1f", "score": "0.6116733", "text": "move3d(x1, y1, z1)\n {\n this.x=x1; this.y=y1; this.z=z1;\n this.rotate();\n\n this.cx=Math.floor(this.x);\n this.cy=Math.floor(this.y);\n }", "title": "" }, { "docid": "1c38945a3f3b3017c52b0d48a8c39c5c", "score": "0.5979433", "text": "function setSourceXY(ax, ay) {\n\t\t\tmSourceX = ax;\n\t\t\tmSourceY = ay;\n\t\t}", "title": "" }, { "docid": "476383c0fdec481c6991275b4311f63f", "score": "0.5939748", "text": "function ChangeCameraPosZ0() {\n var threeCamera = viewer3D.getCamera();\n threeCamera.position.set(position.x, position.y, position.z * 0.9);\n viewer3D.applyCamera(threeCamera, false);\n}", "title": "" }, { "docid": "ac2732bb9aceeda20e0a420345e1866a", "score": "0.5893165", "text": "setVectorPos(position)\n {\n this.mesh.position.set(position);\n }", "title": "" }, { "docid": "086ec27782788e0b7ed58efa5d6c4500", "score": "0.5874492", "text": "function SetPosition() {\n\ttransform.position = player.transform.position;\n\t//var mousePos : Vector3 = Input.mousePosition;\n\tvar mousePos : Vector3 = Camera.main.ScreenToWorldPoint(Input.mousePosition);\n\tvar towardsMouse : Vector2 = mousePos - transform.position;\n\ttowardsMouse = towardsMouse.normalized * this.reach;\n\ttransform.position = player.transform.position + towardsMouse;\n\ttransform.position.z = -9;\n\t\n}", "title": "" }, { "docid": "b138d56395d492b6a7a1bc9e722c006a", "score": "0.5843295", "text": "setPosition() {\n this.imgDatas.forEach((img) => {\n img.mesh.position.x =\n -this.scroll().x + img.left - this.width / 2 + img.width / 2;\n img.mesh.position.y = -img.top + this.height / 2 - img.height / 2;\n });\n }", "title": "" }, { "docid": "1576b77451ffe572ab17901c0a0d4a84", "score": "0.5841395", "text": "set(_x = 0, _y = 0, _z = 0) {\n this.data[0] = _x;\n this.data[1] = _y;\n this.data[2] = _z;\n }", "title": "" }, { "docid": "e54a946e295741bb4cb6ad5e0766baad", "score": "0.5826243", "text": "function dSetPosition(position) { this.element.position=position }", "title": "" }, { "docid": "d5931d959c164320ef474ab820a2c99e", "score": "0.57993686", "text": "function setCameraPosition(camera, x, y, z)\n{\n //Set camera position\n camera.position.x = x;\n camera.position.y = y;\n camera.position.z = z;\n\n camera.lookAt(new THREE.Vector3(x, y, z));\n}", "title": "" }, { "docid": "216cfdad7e9e08e8616058142486dc2e", "score": "0.5777166", "text": "setSource (x, y, source) {\n const data = this.get(x, y)\n data.source = source\n this.set(x, y, data)\n return this\n }", "title": "" }, { "docid": "7b360b9f2a13003efd665fe8051ba385", "score": "0.576153", "text": "set position(position) {\n this._position = position;\n }", "title": "" }, { "docid": "8df743f2af8de4b77e559f2b26835b95", "score": "0.5749176", "text": "setPosition(position, update=true){\n this.setMatrixProperty('position', position, update);\n }", "title": "" }, { "docid": "9100dfa5fdbd56e1a1960f77ab4798b3", "score": "0.5747882", "text": "setWorldPosition(position) {\n\t\tthis.mesh.position.x = position.x + this.localPosition.x;\n\t\tthis.mesh.position.y = position.y + this.localPosition.y;\n\t\tthis.mesh.position.z = position.z + this.localPosition.z;\n\t}", "title": "" }, { "docid": "0d321032ce8461b2cf75e1b3052f0119", "score": "0.5745429", "text": "makeSourceAt(position) {\n const source = super.makeSourceAt(position)\n this.addWaterToScene(source)\n return source\n }", "title": "" }, { "docid": "eda95ea22cfcd89eecd6f2b2f2212b3c", "score": "0.57294184", "text": "function ChangeCameraPosY1() {\n var threeCamera = viewer3D.getCamera();\n threeCamera.position.set(position.x, position.y * 1.1, position.z);\n viewer3D.applyCamera(threeCamera, false);\n}", "title": "" }, { "docid": "13c92acc6009c8f025b329a0bab4bb0b", "score": "0.5722965", "text": "copyFrom(source) {\n this.x = source.x;\n this.y = source.y;\n this.z = source.z;\n this.w = source.w;\n return this;\n }", "title": "" }, { "docid": "f6af89e7df177301493934e5bc39c352", "score": "0.56710386", "text": "setZ(z) {\n this.position.z = z;\n }", "title": "" }, { "docid": "829d9e380c3695a60b6a097a6bbe540e", "score": "0.5650302", "text": "setPosition(x, y) {\n if (this.position.x != x || this.position.y != y) {\n this.position.x = x;\n this.position.y = y;\n\n this.sprite.getCanvas().style.left = x + \"px\";\n this.sprite.getCanvas().style.top = y + \"px\";\n }\n \n // Scroll the camera\n this.scrollCamera();\n }", "title": "" }, { "docid": "d0f621a473267a4891656485a0df9547", "score": "0.5630805", "text": "set x(value) {\n if (!this._follow && !this._cameraMoving) {\n this.pos.x = value;\n }\n }", "title": "" }, { "docid": "0d3bffd3e3a9daa84a441c64c63dc832", "score": "0.5619335", "text": "function z_position(value){\n\tobjects[selectShape].position.setZ(value);\n}", "title": "" }, { "docid": "ad49d41cb8bd1847826e4e93a4afe9d0", "score": "0.56184214", "text": "copyFrom(source) {\n this.x = source.x;\n this.y = source.y;\n this.z = source.z;\n this.w = source.w;\n return this;\n }", "title": "" }, { "docid": "f6e154e6984e60e154a63e68d84c33d4", "score": "0.5603962", "text": "set position(position) {\n this._positionIndex = position;\n this._computePositionAnimationState();\n }", "title": "" }, { "docid": "f6e154e6984e60e154a63e68d84c33d4", "score": "0.5603962", "text": "set position(position) {\n this._positionIndex = position;\n this._computePositionAnimationState();\n }", "title": "" }, { "docid": "be05930bb13969996e5f71c3c0bab685", "score": "0.559433", "text": "setPosition() {\n this.position.x = gamecanvas.width / 2 - this.size / 2;\n this.position.y = gamecanvas.height / 2 - this.size * 4;\n }", "title": "" }, { "docid": "433c744412d4d46e1dd292084dd9e920", "score": "0.5587862", "text": "setPosition(x, y){\n this.position = {\n x: x,\n y: y\n }\n }", "title": "" }, { "docid": "2a8131ba57b4664a83f7ed4b41f90e2b", "score": "0.55846316", "text": "set position(value) {}", "title": "" }, { "docid": "27787ab140bf3ad5e2d841efc42ece5a", "score": "0.5577628", "text": "static function SetTransformPositionWithOffset (playgroundParticles : PlaygroundParticles) {\n\t\tfor (var p = 0; p<playgroundParticles.particleCount; p++)\n\t\t\tplaygroundParticles.particleCache.particles[p].position = playgroundParticles.sourceTransform.position+GetOverflowOffset(playgroundParticles, p, 1);\n\t\tplaygroundParticles.shurikenParticleSystem.SetParticles(playgroundParticles.particleCache.particles, playgroundParticles.particleCache.particles.Length);\n\t}", "title": "" }, { "docid": "2bdc27eff9ccfcbba567e3d7bd191432", "score": "0.5551392", "text": "goToFrontView() {\n this._camera.position.set(0, 0, 1.5);\n }", "title": "" }, { "docid": "80a602d2b548652d573acf6a79927f8c", "score": "0.5528181", "text": "setPosition() {\n this.x = this.canvas.width;\n this.y = this.canvas.height - this.height - this.yOffset;\n }", "title": "" }, { "docid": "0e3c08f46e3b84d84dc6214c5ace76e5", "score": "0.5515619", "text": "setPositions() {\n var thisGraph = this.graph,\n thisPolicy = this,\n graphConsts = thisGraph.consts;\n\n var offset = graphConsts.displayOffset;\n var nodes = thisGraph.nodes;\n var ret = thisPolicy.d3ForceBounds.call(thisGraph);\n\n function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n\n _.forEach(nodes, function(node) {\n if (node.x == null || node.y == null) {\n var x = getRandomInt(node.radius + offset, ret.width - node.radius - offset);\n var y = getRandomInt(node.radius + offset, ret.height - node.radius - offset);\n node.x = x;\n node.y = y;\n }\n })\n }", "title": "" }, { "docid": "730cf3b18fbb4aa8c1330f99ac5395a9", "score": "0.5511704", "text": "function setsourceDirectionFn(scope) {\n\tselected_source_index = scope.source_Mdl;\n}", "title": "" }, { "docid": "4d540bf74d84d85ef65bff6528dc42e6", "score": "0.55042857", "text": "function setTranslate(xPos, yPos, el) {\n el.style.transform = \"translate3d(\" + xPos + \"px, \" + yPos + \"px, 0)\";\n}", "title": "" }, { "docid": "dea753f9a64215ce23c6dc1165f9910c", "score": "0.5490351", "text": "function setTranslation(x, y, z) { tr = [x, y, z]; }", "title": "" }, { "docid": "af849cb74da2b7aa68a6ecdf0c75fc63", "score": "0.5484716", "text": "function Vector3(/**\n * Defines the first coordinates (on X axis)\n */x,/**\n * Defines the second coordinates (on Y axis)\n */y,/**\n * Defines the third coordinates (on Z axis)\n */z){if(x===void 0){x=0;}if(y===void 0){y=0;}if(z===void 0){z=0;}this.x=x;this.y=y;this.z=z;}", "title": "" }, { "docid": "57491e73f1283aae6027d5457c68fb29", "score": "0.5483487", "text": "forward(d) {\n const p0 = this.patch\n this.obj3d.translateX(d)\n super.checkXYZ(p0)\n // let [x, y, z] = this.getxyz()\n // super.setxy(x, y, z)\n }", "title": "" }, { "docid": "edb5793ee7b9e42546e47b9dcd0d6d1e", "score": "0.5457519", "text": "lookAt(x,y,z) { // set look at point\r\n this.lookAtPoint = [x,y,z]\r\n this.updateView() // apply changes\r\n }", "title": "" }, { "docid": "d3615a7cefa3e9881583cc8b614a9b56", "score": "0.54501563", "text": "setTranslation(vector3) {\n return this.setTranslationFromFloats(vector3.x, vector3.y, vector3.z);\n }", "title": "" }, { "docid": "2fa2e2b71d54cacfdbe7154c13946da3", "score": "0.5448657", "text": "copyFrom(source) {\n return this.copyFromFloats(source.x, source.y, source.z);\n }", "title": "" }, { "docid": "d2e2c9a0fb5907a449c017da4ad3217f", "score": "0.544765", "text": "function placerXYZ(mesh,x,y,z){\n\tmesh.translateX(x) ; \n\tmesh.translateY(y) ; \n\tmesh.translateZ(z) ; \n}", "title": "" }, { "docid": "e35d44010058f5f49801b1045ea98dac", "score": "0.54474694", "text": "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "e35d44010058f5f49801b1045ea98dac", "score": "0.54474694", "text": "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "7e322d77051ebc7b57f2d14e3f366909", "score": "0.5442353", "text": "setStartPosition() {\n this.position = [Math.floor(pixelAmount / 2), Math.floor(pixelAmount / 2)];\n }", "title": "" }, { "docid": "1c26c2a061b04153b8f851f121f7dec0", "score": "0.5439747", "text": "set position(point){\n\t// Position the DOM wrapper to the coordinates in point.\n\tthis.node.style.left = point[0] + \"px\";\n\tthis.node.style.top = point[1] + \"px\";\n }", "title": "" }, { "docid": "d5dd21e76aafe4a5a3c2cc0b9a1b0cf4", "score": "0.543494", "text": "set(x, y, z) {\n return this.copyFromFloats(x, y, z);\n }", "title": "" }, { "docid": "ca4263378f2c58645ffd81781b42dae1", "score": "0.54300696", "text": "function setPosition(e) {\r\n pos.x = e.offsetX;\r\n pos.y = e.offsetY;\r\n }", "title": "" }, { "docid": "b16449d8a5664ccd93f4c619d167002f", "score": "0.541567", "text": "function camera_front_view() {\n camera.position.z = 3.4;\n}", "title": "" }, { "docid": "6d1f3570da3c00512d3de3ad9f644c59", "score": "0.5414523", "text": "function set_use_3d_transform (use_3d_transform) {\n this._use_3d_transform = use_3d_transform\n}", "title": "" }, { "docid": "6bfe53bfc5951dfa70fa99b88130d371", "score": "0.5407087", "text": "setPosition(translate){\n this.translation=translate;\n mat4.translate(this.node.transformMatrix, this.node.transformMatrix, this.translation); \n }", "title": "" }, { "docid": "cb96e32357a0459ca3fc107be96f5c22", "score": "0.54038954", "text": "setPosition() {\n this.x = this.canvas.width / 10;\n this.y = this.canvas.height - this.height - this.yOffset;\n }", "title": "" }, { "docid": "e07c31984069546da1b1d77fe274efb1", "score": "0.5400076", "text": "setSideView() {\n\t\t'use strict';\n\t\tvar ratio = 6;\n\t\tvar camera = new THREE.OrthographicCamera(window.innerWidth / - ratio, window.innerWidth / ratio, window.innerHeight / ratio, window.innerHeight / - ratio);\n\n\t\tcamera.position.set(0, 45, window.innerHeight / 6); //Camera is set to y = 45 and z = 100\n\t\tcamera.updateProjectionMatrix();\n\t\tthis.camera = camera;\n\n\t}", "title": "" }, { "docid": "d3d5d364cece4b31fffc0b376eb34c71", "score": "0.5399043", "text": "function setTRS(object3d,t,r,s){object3d.position.set(t.x,t.y,t.z);object3d.rotation.set(r.x,r.y,r.z,'ZYX');object3d.scale.set(s.x,s.y,s.z);}", "title": "" }, { "docid": "e3a171e422b524996aba407fe91214e3", "score": "0.53977007", "text": "function onSelectStart() {\n mesh.position.set(controller.position.x, controller.position.y, controller.position.z);\n mesh.rotation.y = controller.rotation.y; \n }", "title": "" }, { "docid": "3b2bdfb4c8fc32b9078f96a9abcb16cc", "score": "0.53864455", "text": "function setPosition(el, point) {\n /*eslint-disable */\n el._leaflet_pos = point;\n /* eslint-enable */\n\n if (any3d) {\n setTransform(el, point);\n } else {\n el.style.left = point.x + 'px';\n el.style.top = point.y + 'px';\n }\n } // @function getPosition(el: HTMLElement): Point", "title": "" }, { "docid": "a8dc50a94a897936351c009cc7a9c20c", "score": "0.5373935", "text": "_applySelectionPosition() {\n if(this.selectedNode) {\n this.selectionMesh.position.x = this.selectedNode.x;\n this.selectionMesh.position.y = this.selectedNode.y;\n }\n }", "title": "" }, { "docid": "339e72f606c7a4c4892ec9917a62faf3", "score": "0.5367409", "text": "setTranslationFromFloats(x, y, z) {\n this._m[12] = x;\n this._m[13] = y;\n this._m[14] = z;\n this._markAsUpdated();\n return this;\n }", "title": "" }, { "docid": "22d5d78bbeb87a0d7bf970198b09b31a", "score": "0.5363964", "text": "function setView(position, target, upVector, fieldWidth, fieldHeight, projection, animate) {\n if (!Acad.isNumber(fieldWidth) || !(fieldWidth > 0)) {\n throw TypeError('fieldWidth should be a double value and greater than 0');\n }\n if (!Acad.isNumber(fieldHeight) || !(fieldHeight > 0)) {\n throw TypeError('fieldHeight should be a double value and greater than 0');\n }\n if (!(position && target && upVector)) {\n throw Error('position/target/upVector are mandatory.');\n }\n if (!(position instanceof Acad.Point3d)) {\n throw TypeError('position should be of type Acad.Point3d');\n }\n if (!(target instanceof Acad.Point3d)) {\n throw TypeError('target should be of type Acad.Point3d');\n }\n if (!(upVector instanceof Acad.Vector3d)) {\n throw TypeError('upVector should be of type Acad.Vector3d');\n }\n if (animate && (typeof (animate) !== 'boolean')) {\n throw TypeError('animate flag should be boolean');\n }\n if (projection && (projection !== Acad.Enum_Projection.Parallel && projection !== Acad.Enum_Projection.Perspective)) {\n throw TypeError('projection should be Acad.Enum_Projection.Parallel or Acad.Enum_Projection.Perspective ');\n }\n if (!AutoCAD.CurrentViewportInterop.setView(position, target, upVector, fieldWidth, fieldHeight, projection, animate))\n throw Error(\"setView failed.\");\n }", "title": "" }, { "docid": "c042c0850706fe02fb4a7a576375b49a", "score": "0.5362443", "text": "setFrontView() {\n\t\t'use strict';\n\t\tvar ratio = 6;\n\t\tvar camera = new THREE.OrthographicCamera(window.innerWidth / - ratio, window.innerWidth / ratio, window.innerHeight / ratio, window.innerHeight / - ratio);\n\n\t\tcamera.position.set(window.innerWidth / - 6, 45, 0); //Camera is set on the position x = -200, y = 45\n\t\tcamera.rotation.y = - (Math.PI / 2); //Camera is rotated 90 degrees (default is xy, we want it looking to yz)\n\t\tcamera.updateProjectionMatrix();\n\t\tthis.camera = camera;\n\t}", "title": "" }, { "docid": "ffbc7b63131e3661075e417595957afb", "score": "0.53617597", "text": "initStartPosition () {\n this.position.set(0, 70, 80);\n }", "title": "" }, { "docid": "c039bde25ffbf676c6ed52aa6ba4634e", "score": "0.5359365", "text": "function setLayerPosition(map, x, y)\n{\n\tlet lay = getLayerById(map, \"position\");\n\tlay.getSource().addFeature(\n\t\tnew Feature({\n\t\t geometry: new Point([x,y])\n\t\t})\n\t);\n}", "title": "" }, { "docid": "3fbd1bdb2193244639695024012e507a", "score": "0.53584087", "text": "setPosition(position) {\n\t\tlet {x, y} = position\n\t\tthis.x = x\n\t\tthis.y = y\n\t\tthis.updatePathConnect()\n\n\t\td3.select(`#${this.id}`).attr('transform','translate(' + [x, y] + ')')\n\t}", "title": "" }, { "docid": "d7f7204cdce46fdaeb96584bf6b9ab6a", "score": "0.5354689", "text": "setZ(z) {\n this.setTo(this.start.x,z,this.end.x,z+(this.end.y-this.start.y));\n }", "title": "" }, { "docid": "1bf54dd5c5954b0ad7ae3000eb34265e", "score": "0.53427345", "text": "set x(v) {\n this._coords[this._offset + 0] = v;\n }", "title": "" }, { "docid": "8ebcbf223cb9536b0770d86f6ebbd9ba", "score": "0.53418887", "text": "goToSideView() {\n this._camera.position.set(1.5, 0, 0);\n }", "title": "" }, { "docid": "73305d8eb17173ce1bc4cdd2b4f54d5c", "score": "0.5331697", "text": "set x(value) {\n this._x = value;\n this.root.setAttribute('transform', `translate(${this._x},${this._y})`);\n }", "title": "" }, { "docid": "13708000ae9821727ca1684ae6f6e112", "score": "0.5328561", "text": "function setCubePositions() {\n for(var z = 1; z <= 3; z++) {\n for(var y = 1; y <= 3; y++) {\n for(var x = 1; x <= 3; x++) {\n var translateX = x * 9 - 9;\n var translateY = y * 9 - 9;\n var translateZ = z * -9 + 18;\n\n cubePositions[z+\"-\"+y+\"-\"+x] = \"translate3d(\"+translateX+\"em, \"+translateY+\"em, \"+translateZ+\"em)\";\n }\n }\n }\n}", "title": "" }, { "docid": "8029761c8b00911232f735fd0850af0c", "score": "0.53274375", "text": "function ChangeCameraPosY0() {\n var threeCamera = viewer3D.getCamera();\n threeCamera.position.set(position.x, position.y * 0.9, position.z);\n viewer3D.applyCamera(threeCamera, false);\n}", "title": "" }, { "docid": "cbe51a8ffc90c12cb737762b8407f821", "score": "0.5308347", "text": "moveto(x, y) {\n this.cam.xpos = x;\n this.cam.ypos = y;\n }", "title": "" }, { "docid": "2ce075e754937e24e5fb7a3cd0174127", "score": "0.5301151", "text": "function setPositionCameraX(fltX, tabCamera) {\n tabCamera[0] = fltX;\n}", "title": "" }, { "docid": "802afb1e0ceb8723e8a459bd50a7cfda", "score": "0.5298166", "text": "static function SetPosition (playgroundParticles : PlaygroundParticles, particleStateWorldObject : WorldObject) {\n\t\tif (!playgroundParticles.worldObject || playgroundParticles.worldObject.mesh==null) {\n\t\t\tDebug.Log(\"There is no mesh assigned to \"+playgroundParticles.particleSystemGameObject.name+\"'s worlObject.\");\n\t\t\treturn;\n\t\t}\n\t\tvar meshVertices : Vector3[] = particleStateWorldObject.mesh.vertices.Clone() as Vector3[];\n\t\tfor (var i = 0; i<playgroundParticles.particleCache.particles.Length; i++)\n\t\t\tplaygroundParticles.particleCache.particles[i].position = particleStateWorldObject.transform.TransformPoint(meshVertices[i%meshVertices.Length])+GetOverflowOffset(playgroundParticles, i, meshVertices.Length);\n\t}", "title": "" }, { "docid": "c61474ac7ee795908b166e4836b3544f", "score": "0.5294119", "text": "set position(value) {\n const oldPosition = this._position;\n if (oldPosition !== value) {\n this._positionStrategy = undefined;\n this._position = value;\n void this.requestUpdate('position', oldPosition);\n }\n }", "title": "" }, { "docid": "c93a04e673868e03c4214d259719548e", "score": "0.5284894", "text": "moveTo (position) {\n // TODO: Ensure it is within boundary\n this.pos = position\n }", "title": "" }, { "docid": "d8984013f8f004209dde2afe8af4e831", "score": "0.5279854", "text": "function teleport(x, y, z) {\n Memory.writeFloat(Vector3, x);\n Memory.writeFloat(ptr(Vector3).add(4), y);\n Memory.writeFloat(ptr(Vector3).add(8), z);\n setPosition(Player.objectInMemory, Vector3);\n}", "title": "" }, { "docid": "f8ea83ffe0fb879991bf5297f60dc9b9", "score": "0.52721375", "text": "function ViewerImagePanSetPosition(posX, posY, img, savePosition ) {\r\n\r\n if( savePosition ) {\r\n G.VOM.panPosX=posX;\r\n G.VOM.panPosY=posY;\r\n }\r\n\r\n posX+=G.VOM.zoom.posX;\r\n posY+=G.VOM.zoom.posY;\r\n \r\n img.style[G.CSStransformName]= 'translate3D('+ posX+'px, '+ posY+'px, 0) ';\r\n }", "title": "" }, { "docid": "5a3aca5fbbc34953e1e6062d2d0af4ce", "score": "0.5261929", "text": "set originX(value) {\n this._originX = value;\n this.setViewBox(-this._originX, -this._originY, this._width, this._height);\n }", "title": "" }, { "docid": "425e68136b0497a6aa1fa233ec83e6cc", "score": "0.5261897", "text": "setPosition(setPositionX, setPositionY) {\n\t\tthis.position.x = setPositionX\n\t\tthis.position.y = setPositionY\n\t}", "title": "" }, { "docid": "f53c478c2075e8c7f401b96c3d5b731b", "score": "0.5252659", "text": "set position(pos)\n {\n this._position = pos;\n \n var components = pos.split(',')\n var x = components[0];\n var y = components[1];\n \n const kUseTransform = true;\n if (kUseTransform) {\n// this.element.style.webkitTransform = 'translate(' + x + 'px, ' + y + 'px)'; ** commented because it thows an error in the browser\n }\n else {\n this.element.style.left = x + 'px';\n this.element.style.top = y + 'px';\n }\n }", "title": "" }, { "docid": "7d4d0f7f6f8d3fb5a54540432dc72490", "score": "0.5237583", "text": "setPos(pos) {\n this.setUniform(\"uPos\", pos);\n this.pos = pos;\n }", "title": "" }, { "docid": "7d4d0f7f6f8d3fb5a54540432dc72490", "score": "0.5237583", "text": "setPos(pos) {\n this.setUniform(\"uPos\", pos);\n this.pos = pos;\n }", "title": "" }, { "docid": "7918f9ce662ad65d18c6dc370b08dfaf", "score": "0.5235283", "text": "reset() {\n this.target.x = this.center.x;\n this.target.y = this.center.y;\n }", "title": "" }, { "docid": "a394b44e0ad3080f0b648df08ce9cb33", "score": "0.5233275", "text": "updatePosition(position) {\n this.position = position;\n this.shape.x = position.x * this.tileSize;\n this.shape.y = position.y * this.tileSize;\n }", "title": "" }, { "docid": "264c461bc52d64366f143fc6a7638019", "score": "0.5232894", "text": "function setPositionCameraZ(fltZ, tabCamera) {\n tabCamera[2] = fltZ;\n}", "title": "" }, { "docid": "95e0708773913a06fcf64f93c7137eb9", "score": "0.52317077", "text": "resetPosition(){\n this.speed = 0;\n this.deltaT = 0;\n this.rotation = 0;\n this.position[0] = this.startingPos[0];\n this.position[1] = this.startingPos[1];\n this.position[2] = this.startingPos[2];\n }", "title": "" }, { "docid": "fd5e134d4cf20fb6aa4a56019c396933", "score": "0.522728", "text": "move(x = 0, y = 0, z = 0) {\n let attr = this.attributes;\n let arr = attr.position.array;\n for (let i=0, l=arr.length; i<l; ) {\n arr[i] = arr[i++] + x;\n arr[i] = arr[i++] + y;\n arr[i] = arr[i++] + z;\n }\n this.reload(arr, attr.index ? attr.index.array : undefined);\n return this;\n }", "title": "" }, { "docid": "88291960cdd0d9c103f38da40fcc9393", "score": "0.522639", "text": "setCenter(x, y){ this.center.setPoint(x, y) }", "title": "" }, { "docid": "73d8f9b9ffbe91b605b9cdd432e5ab71", "score": "0.5223371", "text": "moveJointToPoint(x,y,z) {\n // Move the joint body to a new position\n this.jointBody.position.set(x,y,z);\n this.pointerConstraint.update();\n }", "title": "" }, { "docid": "9fdd01585a8d789f067c84b0708264e4", "score": "0.5223092", "text": "updatePosition (position) {\n\t\tthis.lat = position.coords.latitude;\n\t\tthis.long = position.coords.longitude;\n\t\tthis.pos_x = (this.long-this.init_z) * (40000000/360);\n\t\tthis.pos_z = (this.lat-this.init_x) * (40000000/360) * Math.cos(this.long*this.deg_rad);\n\t\tthis.camera.setAttribute(\"position\", this.pos_x+\" 2 \"+this.pos_z);\n\t\tconsole.log(\"lat and long: \", this.lat, this.long, \"x and z: \", this.pos_x, this.pos_z);\n\t\tthis.emit(\"update\", {\n\t\t\tlat: this.lat, \n\t\t\tlong: this.long\n\t\t});\n\t}", "title": "" }, { "docid": "99d2c76834a8ec8ff0bf2af1da475514", "score": "0.5218079", "text": "setDstPos(x, y) {\n\t\tthis.dstX = x;\n\t\tthis.dstY = y;\n\t}", "title": "" }, { "docid": "e2ee39d1cfb7852ec2694c054d033004", "score": "0.52124536", "text": "moveTo (direction) {\n const player = this.scene.children.find(mesh => mesh.name === 'player')\n\n // Defines movement\n let { x, z } = player.position\n switch (direction) {\n case 'top':\n z -= CASE\n break\n case 'bottom':\n z += CASE\n break\n case 'left':\n x -= CASE\n break\n case 'right':\n x += CASE\n break\n }\n\n // Check position of each cube and return a boolean\n const matchPosition = (position) => {\n return !!this.scene.children\n .filter(mesh => mesh.name === 'cube')\n .map(mesh => mesh.position)\n .find(({ z, x }) => x === position.x && z === position.z)\n }\n\n // Move the player if the path is clear\n if (!matchPosition({ x, z })) {\n if (player.position.z !== z) {\n player.position.z = z\n }\n if (player.position.x !== x) {\n player.position.x = x\n }\n }\n }", "title": "" }, { "docid": "d37ff11acf6573bedbd63d919b590658", "score": "0.5206156", "text": "function changePosition() {\r\n headX += positionX;\r\n headY += positionY;\r\n}", "title": "" }, { "docid": "a87ec60cc564eef2e3e759707d4e6388", "score": "0.52018946", "text": "SetMaterialOffset() {}", "title": "" }, { "docid": "1b364598a834e215a0eb3f0e469d37f0", "score": "0.5190668", "text": "setupCamera(){\n $camera.setTarget(this.target, 3);\n }", "title": "" } ]
0a9411f8ccb05d1e8af980c82ee4ad23
Initialization of the I2C and the BME
[ { "docid": "95eb8d6386adc879cfa5714468324784", "score": "0.8085346", "text": "function initI2C() {\n \ti2c = new I2C();\n i2c.setup({sda:B9,scl:B8}); // Pin changé par rapport au schémas\n}", "title": "" } ]
[ { "docid": "b603176a4e6e97ddcf80b2a0c8bacef1", "score": "0.67876685", "text": "function init() {\n console.log(\"Initializing LED matrix controller\");\n i2C.address(0x70);\n i2C.writeByte(char('0x21')); // Turn on oscillator\n i2C.writeByte(char('0xef')); // Brightness 15\n i2C.writeByte(char('0x81')); // No blinking\n}", "title": "" }, { "docid": "89749cb4dc0b15bd4b6b253cc18a1629", "score": "0.60886765", "text": "init() {\n this.Obniz.send({\n ble: {\n hci: {\n initialize: true,\n },\n },\n });\n }", "title": "" }, { "docid": "0e9994d8295b61e4865a524c662abc9d", "score": "0.59954715", "text": "function init() {\n adc0832.init(19, 26, 24);\n for(var i = 0; i < LED_PINS.length; i++){\n rpio.open(LED_PINS[i], rpio.OUTPUT, LED_OFF);\n }\n}", "title": "" }, { "docid": "7e492034d266bfe1dd7db3b46705270e", "score": "0.59616995", "text": "function initAmbisonicB()\n{\n B1 = ctx.createBufferSource();\n B2 = ctx.createBufferSource();\n B3 = ctx.createBufferSource();\n B4 = ctx.createBufferSource();\n ctx.decodeAudioData(bfile1, (data) => B1buffer = data);\n B1.buffer = B1buffer;\n ctx.decodeAudioData(bfile2, (data) => B2buffer = data);\n B2.buffer = B2buffer;\n ctx.decodeAudioData(bfile3, (data) => B3buffer = data);\n B3.buffer = B3buffer;\n ctx.decodeAudioData(bfile4, (data) => B4buffer = data);\n B4.buffer = B4buffer;\n}", "title": "" }, { "docid": "6d75b75e22f65be4ea2a246a44f502f7", "score": "0.58959234", "text": "function initUART() {\n \tSerial2.setup(57600, { tx:A2, rx:A3});\n \tSerial2.on('data', function(data){UARTprocess(data);});\n}", "title": "" }, { "docid": "eb7f51211c75eaecf8cf40dfdcd16384", "score": "0.5875774", "text": "async function init() {\n const comp = await queryController.getComponents();\n\n for (const i in comp) {\n const c = comp[i];\n try {\n components[c.id] = {\n name: c.name,\n description: c.description,\n physicalPin: c.physicalPin,\n direction: c.direction,\n gpio: new Gpio(c.physicalPin, (c.direction == \"out\") ? gpio.DIR_OUT : gpio.DIR_IN)\n };\n await components[c.id].gpio.init();\n }\n catch (err) {\n logger.error(err);\n logger.warning(\"Component: \" + c.name + \" was not initialised correctly.\")\n }\n }\n}", "title": "" }, { "docid": "f5a4f53ef3ca64e23e0666204c1fcf0e", "score": "0.58568597", "text": "function IR_Configuration(){\n I2C3.setup({scl:A8,sda:C9});\n i2c_write_reg(0x64,0x16,0xFF);// cntl3 adr = 0x16 , SRST (bit 0= 1) donc FF\n i2c_write_reg(0x64,0x14,0xED);// cntl1 (5 bits) adr =0x14 ,cut-off FC temp =2.5 Hz (001), FC IR=0.45 (11) \n i2c_write_reg(0x64,0x13,0xF8);// inten adr = 0x13 , interrupts only IR\n set_IR_thresh(10,0);\n}", "title": "" }, { "docid": "3d97bdb550f012a09d3256f54d2dc204", "score": "0.5732913", "text": "function initializeBackEnd() {\n backendControl.initialize(handleRxControlMsg);\n backendIsoch.initialize(handleRxIsochMsg);\n}", "title": "" }, { "docid": "16100d113233987341fb47acb79f56ac", "score": "0.5704621", "text": "function init() {\n\t//Make sure files needed exist or create default ones.\n\tcheckFile();\n\t//Widgets by GM\t\n\tcreateButtons();\n\t//Bluetooth Profile Get & Watch: Shows correct screen for connected phone situations.\n getBT();\n //watchBT();\n\t//Starts Data Events\n\tstartDataTracking();\n\t//Shut Down Procedures\n\tshutDownMindDrive();\n}", "title": "" }, { "docid": "df3fcd34e171c04cb1e61d76b0110303", "score": "0.561146", "text": "getFreeI2C() {\n return this._getFreePeripheralUnit('i2c');\n }", "title": "" }, { "docid": "0cb5c91608cf036034c7401a7de6c192", "score": "0.55771685", "text": "function init()\n {\n loadData2Dialog();\n loadURL2Browser();\n }", "title": "" }, { "docid": "0e2c3fcfab391f64d340648d8a48aada", "score": "0.552845", "text": "function ibpsInit() {\n _ibpsTimer = setTimeout(ibpsTick, IBPS_INTERVAL);\n}", "title": "" }, { "docid": "86335652da094957b4e1d83cd9808234", "score": "0.5524322", "text": "constructor(receivedHB, ID2Append2, HB_interval) {\r\n this.receivedHB = receivedHB;\r\n this.ID2Append2 = ID2Append2;\r\n this.HB_interval = HB_interval;\r\n this.HB_Tolerate = 0;\r\n this.HB_Phase = 0;\r\n this.CIRCLE_MAX_RADIUS = 25;\r\n }", "title": "" }, { "docid": "2baeb2d4ea84ea25b71c48e014e15e5b", "score": "0.55065554", "text": "function initialize() {\n deviceManager.log(\"Waiting for devices to connect...\");\n\n ipcon = new Tinkerforge.IPConnection();\n deviceManager.setIPConnection(ipcon);\n ipcon.connect(host, port);\n\n ipcon.on(Tinkerforge.IPConnection.CALLBACK_CONNECTED,\n function (connectReason) {\n ipcon.enumerate();\n }\n );\n\n ipcon.on(Tinkerforge.IPConnection.CALLBACK_ENUMERATE, _enumerationCallback);\n}", "title": "" }, { "docid": "a6a1def32dee78234d1984de2a9b54ab", "score": "0.5495862", "text": "function init() {\n configurePokokEditor();\n configurePartEditor();\n Tone.Master.connect(new Tone.Normalize(2,4));\n Tone.Transport.bpm.value = 140;\n setAllParts();\n Gamelan.config.forEach(buildInstrument);\n\n //TODO: move these two to inside the build instrument methods?\n initializeMuteButtons();\n initializeTempoVolumeSliders();\n configureKajar();\n configureGong();\n}", "title": "" }, { "docid": "d3c4fc540e5499356dd675cbdcc2f5cf", "score": "0.54717445", "text": "function onInit() {\n console.log(\"========== Program started ==========\\r\\n\");\n resetRn2483();\n //IR_Configuration();\n MODEM_Configuration();\n }", "title": "" }, { "docid": "48c119b0f17ba61b3b053f13c9c5ef51", "score": "0.54670507", "text": "function init() {\n // Create the DOM for our SIM cards and listen to any changes\n IccHandler.init(new SimDomGenerator(), checkSIMCard);\n\n cacheElements();\n addListeners();\n getData();\n checkNoContacts();\n updateTimestamps();\n\n // To avoid any race condition we listen for online events once\n // containers have been initialized\n window.addEventListener('online', checkOnline);\n window.addEventListener('offline', checkOnline);\n }", "title": "" }, { "docid": "44e6383ff18fe8c0d1163ae409e81fc0", "score": "0.5466135", "text": "function init(){\n // Set up the Box2d world that will do most of the physics calculation\n var gravity = new b2Vec2(0,9.8); //declare gravity as 9.8 m/s^2 downward\n var allowSleep = true; //Allow objects that are at rest to fall asleep and be excluded from calculations\n world = new b2World(gravity,allowSleep);\n\n createFloor();\n // Create some bodies with simple shapes\n createRectangularBody();\n createCircularBody();\n createSimplePolygonBody();\n\n // Create a body combining two shapes\n createComplexBody();\n\n // Join two bodies using a revolute joint\n createRevoluteJoint();\n\n createSpecialBody();\n\n setupDebugDraw();\n animate();\n}", "title": "" }, { "docid": "efd450d6c599f209ce7b4d7fccb03dc4", "score": "0.54538697", "text": "function init() {\n // if( Y.doccirrus.auth.isPRC() ) {\n // server = net.createServer( function( socket ) {\n // socket.miniDS = \"1\";\n // socket.on( \"data\", data => {\n // s2eClients[ \"miniDS:\" + data ] = socket;\n // updateNameList();\n // Y.log( \"miniDS \" + data + \" (\" + socket.remoteAddress + \") cconnected.\" );\n // socket.on( \"close\", () => {\n // delete s2eClients[ \"miniDS:\" + data ];\n // updateNameList();\n // Y.log( \"miniDS \" + data + \" (\" + socket.remoteAddress + \") discconnected.\" );\n // } );\n // } );\n // socket.on( \"error\", err => {\n // Y.log( \"miniDS error:\", 'warn', NAME );\n // Y.log( err, 'warn', NAME );\n // } );\n // } );\n //\n // server.listen( 15151 );\n // }\n\n Y.log( \"registering cardreader listeners...\" );\n //hello listener for initial handshake\n\n\n\n //Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"hello\", function( msg ) {\n // }\n\n\n Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"deviceList\", function( msg ) {\n //filter blacklisted devices out\n filterDefaultDevices( msg );\n devices[ msg.meta.myName ] = msg.data;\n\n if( requests[ msg.callID ] ) {\n requests[ msg.callID ].SDSAmount++;\n for( var i = 0; i < msg.data.length; i++ ) { //eslint-disable-line no-inner-declarations\n requests[ msg.callID ].deviceList.push( { name: msg.meta.myName, device: msg.data[ i ].comName } );\n }\n if( requests[ msg.callID ].SDSAmount >= Object.keys( s2eClients ).length ) {\n requests[ msg.callID ].callback( requests[ msg.callID ].deviceList );\n delete requests[ msg.callID ];\n }\n }\n else if( !msg.callID || msg.callID === 'serverDevListReq' ) {\n checkDBforDevices( msg );\n }\n\n if ( devicesInspector && devicesInspector.identityId ) {\n Y.doccirrus.communication.emitEventForUser( {\n targetId: devicesInspector.identityId,\n event: 'inspectDevicesChange',\n eventType: Y.doccirrus.schemas.socketioevent.eventTypes.DISPLAY,\n msg: {\n data: {}\n }\n } );\n }\n\n cleanupDevices( { tenant: msg.meta.tenant, client: msg.meta.myName, deviceList: msg.data } );\n } );\n //listeners that CAN be implemented, but are currently unused\n //Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"serialErrror\", function( msg ) {} );\n //Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"openedDevice\", function( msg ) {} );\n //Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"deviceClosed\", function( msg ) {} );\n //Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"sentSerialData\", function( msg ) {} );\n\n //receiving data\n Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"gotSerialData\", function( msg ) {\n var path = msg.meta.myName + \":\" + msg.device;\n dbg( path );\n sdbg( \"got data from\"+path );\n delete msg.user;\n serialEvents.emit( path, msg );\n } );\n Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"pcscReaderData\", function( msg ) {\n if( requests[ msg.meta.callID ] ) {\n requests[ msg.meta.callID ].callback( null, msg.readerData );\n }\n } );\n setTimeout( () => {\n Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"pcscNewCard\", function( msg ) {\n if ( pcscDevices && pcscDevices.NFC\n && Array.isArray( pcscDevices.NFC ) && pcscDevices.NFC.some( device => msg.data.reader.startsWith( device ) ) ) {\n\n const detectedIp = getIpOfSocketConnection( this );\n Y.doccirrus.api.auth.putCard( {\n data: {\n isLogin: true,\n deviceName: detectedIp,\n cardKey: msg.data.uid,\n ip: detectedIp,\n tenant: msg.meta.tenant\n },\n callback: function() {\n }\n } );\n }\n } );\n }, 1000 );\n\n Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"tcpProxyData\", function( msg ) {\n let { sessionId } = msg;\n let self = this;\n switch(msg.type) {\n case \"open\":\n proxyConnections[sessionId] = new net.Socket();\n proxyConnections[sessionId].connect( msg.port, \"127.0.0.1\", () => {} );\n proxyConnections[sessionId].on(\"data\", data => {\n self.emit( \"tcpProxyData\", { sessionId, type: \"data\", data } );\n });\n proxyConnections[sessionId].on(\"close\", () => {\n self.emit( \"tcpProxyData\", { sessionId, type: \"close\" } );\n delete proxyConnections[sessionId];\n });\n proxyConnections[sessionId].on(\"error\", err => {\n Y.log(\"TCP PROXY CLIENT ERR : \"+err, 'warn', NAME);\n self.emit( \"tcpProxyData\", { sessionId, type: \"close\" } );\n delete proxyConnections[sessionId];\n });\n break;\n case \"data\":\n if (proxyConnections[sessionId]) {\n proxyConnections[sessionId].write(msg.data);\n }\n break;\n default:\n if (proxyConnections[sessionId]) {\n proxyConnections[sessionId].destroy();\n delete proxyConnections[sessionId];\n }\n }\n } );\n\n \n /**\n * Helper.\n * @param {Object} params\n * @param {Object} params.user\n * @param {String} params.message\n */\n function sendIPPErrorMessage( params ) {\n let\n { user, message } = params;\n Y.doccirrus.communication.emitEventForUser( {\n targetId: user.identityId,\n event: 'message',\n messageId: 'IPPErrorMessage',\n msg: {\n data: message\n }\n } );\n }\n\n /**\n * Helper.\n * @param {Object} params\n * @param {String} params.ipAddress\n * @param {String} params.message\n */\n function findUserAndSendMessage( params ) {\n let\n { ipAddress, message } = params;\n Y.doccirrus.communication.getConnectedSockets( {}, ( err, socketList ) => {\n let\n user = null;\n if( err ) {\n Y.log( `IPP error. Can not get connected socket list. error: ${JSON.stringify( err )}`, 'error', NAME );\n return;\n }\n socketList.some( connectedSocket => {\n let\n ip = Y.doccirrus.communication.getIpOfSocketConnection( connectedSocket );\n if( ipAddress === ip && connectedSocket.user ) {\n user = connectedSocket.user;\n return true;\n }\n return false;\n } );\n if( user ) {\n sendIPPErrorMessage( {\n user,\n message\n } );\n } else {\n Y.log( `IPP error. User for with ip \"${ipAddress}\" not found.`, 'error', NAME );\n }\n } );\n }\n\n /**\n * @param {Object} msg\n *\n * msg have structure as below:\n * {\n * data: {\n * id: <Number, ex. 3>,\n * name: <String, Page title>,\n * ps: <Buffer>,\n * uri: <String, ex: ipp://<computer-name>.local:15157/3>,\n * userName: <String, firstname.lastname based on computer name>,\n * attributes: [\n * {\n * tag: <Number, ex. 12>,\n * name: <String, ex: 'job-id', 'job-uri', 'job-state' etc.>,\n * value: <String | Number, ex: ipp://<computer user name>.local:15157/3 or 3686>\n * },\n * ...\n * ]\n * },\n * meta: {\n * callID: <String, ex: \"RN_BA9ACi9CZWkO\">,\n * myName: <String, ex: \"Device server name\">,\n * serverName: <String, ex: \"device_server_name@Acomputer-name\">,\n * tenant: <String, ex: '0'>,\n * time: <String, ex: \"2018-11-19T13:41:09.994Z\">,\n * version: <String, ex: \"2.0.7\" -> this is device server version>\n * },\n * user: {\n * P: \" \",\n * U: \"DeviceServer\",\n * firstname: \"\",\n * groups: [\n * {\n * group: \"ADMIN\"\n * }\n * ],\n * id: \"su\",\n * identityId: \"000\",\n * lastname: \"Automatischer Prozess\",\n * roles: [],\n * superuser: true,\n * tenantId: \"0\"\n * }\n * }\n */\n Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"ippJob\", async function( msg = {} ) {\n const\n {data = {}, meta = {}, user: deviceServerSuperUser} = msg,\n {name: fileTitle, ps: fileBuffer} = data,\n {myName: deviceServerName, version: deviceServerVersion, tenant, time} = meta,\n ps2pdfProm = util.promisify(ps2pdf),\n importMediaFromFileProm = util.promisify(Y.doccirrus.media.importMediaFromFile),\n ipAddress = Y.doccirrus.communication.getIpOfSocketConnection( this ),\n openedActivities = Y.doccirrus.socketUtils.getActiveExtDocumentActivityIdByIP( ipAddress ),\n localSuperUser = Y.doccirrus.auth.getSUForLocal(),\n IPP_SOURCE_NAME = Y.doccirrus.i18n( 'DeviceMojit.ippPrinter.sourceName' );\n\n\n let\n err,\n result,\n mediaObj,\n user,\n isNew,\n socket,\n activityId,\n pdfFileBuffer,\n pdfPath,\n pdfFileName;\n\n Y.log(`ippJob-incoming: Incoming message received from deviceServer: '${deviceServerName} (version -> ${deviceServerVersion})' with fileTitle = '${fileTitle}', tenant = '${tenant}' and time = '${time}'`, \"info\", NAME);\n\n\n // -------------------------------------------- 1. Validations ---------------------------------------------------------------\n if( !fileBuffer ) {\n Y.log(`ippJob-incoming: Incoming message does not have 'msg.data.ps' file buffer. Stopping...`, \"warn\", NAME);\n return findUserAndSendMessage( { ipAddress, message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_01'} ) } );\n }\n // --------------------------------------------------- 1. END ----------------------------------------------------------------\n\n\n // -------------------- 2. Write incoming file to 'PDF' inside in-suite temp directory -------------------------------------\n [err, {pdfPath} = {}] = await formatPromiseResult( ps2pdfProm(fileBuffer) );\n\n if( err ) {\n Y.log(`ippJob-incoming: Error while converting file from 'ps' to 'pdf'. Error: ${err.stack || err}`, \"error\", NAME);\n return findUserAndSendMessage( { ipAddress, message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_02'} ) } );\n }\n\n pdfFileName = path.win32.basename(pdfPath).trim();\n // ----------------------------------------- 2. END -----------------------------------------------------------------------\n\n\n // -------------------- 3. Read the contents of file at 'pdfPath' in 'pdfFileBuffer' as buffer -------------------------------\n [err, pdfFileBuffer] = await formatPromiseResult( readFileProm(pdfPath) );\n\n if( err ) {\n Y.log(`ippJob-incoming: Error while reading uploaded file at path: '${pdfPath}'. Error: ${err.stack || err}`, \"error\", NAME);\n return findUserAndSendMessage( { ipAddress, message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_03'} ) } );\n }\n // --------------------------------------------- 3. END -------------------------------------------------------------------\n\n\n // ------- 4. If no activity is opened in the browser then create an 'unassigned' media book entry and notify user the same ------\n if( !openedActivities || !openedActivities.length ) {\n Y.log( `ippJob-incoming: no activity opened on the browser. Writing input file in media book with status = 'UNPROCESSED'`, 'warn', NAME );\n\n [err, result] = await formatPromiseResult(\n Y.doccirrus.api.devicelog.matchPatientAndCreateAttachment({\n user: deviceServerSuperUser || localSuperUser,\n caption: `ippJob (${fileTitle || \"\"})`,\n deviceId: IPP_SOURCE_NAME,\n file: {\n data: pdfFileBuffer,\n path: pdfPath\n },\n documentDetails: {\n fileSource: \"From IPP\"\n }\n })\n );\n\n if( err ) {\n Y.log(`ippJob-incoming: Error creating unclaimed media book entry for media file: ${pdfPath} for no activity opened on UI scenario. Error: ${err.stack || err}`, \"error\", NAME);\n return findUserAndSendMessage( { ipAddress, message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_04'} ) } );\n }\n\n return findUserAndSendMessage( { ipAddress, message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_05'} ) } );\n }\n // -------------------------------------------- 4. END ---------------------------------------------------------------------------\n\n\n // ------- 5. If more than one activity tabs are open then create a 'unassigned' media book entry and notify the user the same ---\n if( openedActivities.length > 1 ) {\n Y.log( `ippJob-incoming: More than 1 activity is opened with ext. document active tab. Writing input file in media book with status = 'UNPROCESSED'`, 'warn', NAME );\n\n [err, result] = await formatPromiseResult(\n Y.doccirrus.api.devicelog.matchPatientAndCreateAttachment({\n user: deviceServerSuperUser || localSuperUser,\n caption: `ippJob (${fileTitle || \"\"})`,\n deviceId: IPP_SOURCE_NAME,\n file: {\n data: pdfFileBuffer,\n path: pdfPath\n },\n documentDetails: {\n fileSource: \"From IPP\"\n }\n })\n );\n\n if( err ) {\n Y.log(`ippJob-incoming: Error creating unclaimed media book entry for media file: ${pdfPath} for more than one activity opened on UI scenario. Error: ${err.stack || err}`, \"error\", NAME);\n return sendIPPErrorMessage( {\n user: openedActivities[ 0 ].user,\n message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_06'} )\n } );\n }\n\n return sendIPPErrorMessage( {\n user: openedActivities[ 0 ].user,\n message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_07'} )\n } );\n }\n // -------------------------------------------- 5. END ---------------------------------------------------------------------------\n\n\n // --------------------- 6. Initialize 'user', 'isNew', 'activityId' and 'socket' from openedActivities[0] ---------------------------------\n ({user, isNew, activityId, socket} = openedActivities[0]);\n // ---------------------------------------------------- 6. END -------------------------------------------------------------------\n\n\n // ----------- 7 (If isNew). If activity is not new then create a media book entry which is claimed by activityId ---------------------------\n if( !isNew ) {\n\n // --------------- 7a. Query 'activityId' from DB and check if it exists and have a valid status -----------------------------\n [err, result] = await formatPromiseResult(\n Y.doccirrus.mongodb.runDb( {\n user,\n model: 'activity',\n action: 'get',\n query: {\n _id: activityId\n }\n })\n );\n\n if( err ) {\n Y.log(`ippJob-incoming: Error while querying activity with _id: ${activityId}. Error: ${err.stack || err}`, \"error\", NAME);\n return sendIPPErrorMessage( {\n user: user,\n message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_12' } )\n } );\n }\n\n if( !result || !Array.isArray(result) || !result.length ) {\n Y.log(`ippJob-incoming: activity Id: ${activityId} not found in the DB.`, \"warn\", NAME);\n return sendIPPErrorMessage( {\n user: user,\n message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_11' } )\n } );\n }\n\n if( result[0].status !== \"VALID\" ) { //TODO: Removed result[0].status !== \"CREATED\"\n Y.log(`ippJob-incoming: activity Id: ${activityId} cannot be changed because it has the status '${result[0].status}'`, \"warn\", NAME);\n return sendIPPErrorMessage( {\n user: user,\n message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_10', data: {$status: Y.doccirrus.i18n(`activity-schema.ActStatus_E.${result[0].status}`)} } )\n } );\n }\n // --------------------------------------------- 7a. END ---------------------------------------------------------------------\n\n\n // -------- 7b. Create media-book entry which is claimed by 'activityId' and notify UI to updateActivityAttachments ----------\n [err, result] = await formatPromiseResult(\n Y.doccirrus.api.devicelog.matchPatientAndCreateAttachment({\n user,\n caption: `ippJob (${fileTitle || \"\"})`,\n deviceId: IPP_SOURCE_NAME,\n overwrite: {\n activityId\n },\n file: {\n data: pdfFileBuffer,\n path: pdfPath\n },\n documentDetails: {\n fileSource: \"From IPP\"\n }\n })\n );\n\n if( err ) {\n Y.log(`ippJob-incoming: Error creating media book entry for media file: ${pdfPath} and claimant activityId: ${activityId}. Error: ${err.stack || err}`, \"error\", NAME);\n return sendIPPErrorMessage( {\n user: user,\n message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_08'} )\n } );\n }\n\n Y.doccirrus.communication.emitEventForSocket( {\n socket,\n event: 'updateActivityAttachments',\n msg: {\n data: {\n activityId: activityId,\n documentId: result.documentIdArr\n }\n },\n doNotChangeData: true\n } );\n return;\n // ----------------------------------------------- 7b. END -------------------------------------------------------------------\n }\n // -------------------------------------------- 7 (If isNew). END ---------------------------------------------------------------------------\n\n\n // ----- 7 (Else). If activity is new then create a media document from the input file and notify the new activity on the UI to update its attachment ----------\n [err, mediaObj] = await formatPromiseResult(importMediaFromFileProm( user, pdfPath, 'activity', activityId, pdfFileName, 'user', 'OTHER' ) );\n\n if( err ) {\n Y.log(`ippJob-incoming: Error while creating media object in 'media' collection. Error: ${err.stack || err}`, \"error\", NAME);\n return sendIPPErrorMessage( {\n user: user,\n message: Y.doccirrus.errorTable.getMessage( {code: 'deviceMojit_09'} )\n } );\n }\n\n mediaObj.ownerId = activityId;\n\n Y.doccirrus.communication.emitEventForSocket( {\n socket,\n event: 'updateActivityAttachments',\n msg: {\n data: {\n activityId: activityId,\n mediaObj: mediaObj\n }\n },\n doNotChangeData: true\n } );\n // ---------------------------------------------------------- 7 (Else). END ------------------------------------------------------------------------------------\n } );\n\n Y.doccirrus.communication.setListenerForNamespace( \"serial-to-ethernet\", \"checkForUpdate\", function( msg ) {\n Y.log( `update check request from a Device Server with data: ${util.inspect( msg, {depth: 1} )}`, 'debug', NAME );\n //Y.log( \"update check request from a Device Server with data: \" + util.inspect( msg ), 'debug', NAME );\n\n if( Y.doccirrus.commonutils.doesCountryModeIncludeSwitzerland() ) {\n Y.log( 'Device Server auto update is disabled server side for switzerland', 'info', NAME );\n return;\n }\n\n if( !updateQueue.includes( this.id ) ) {\n updateQueue.push( this.id );\n Y.log( `new device server is asking for update: ${updateQueue}`, 'info', NAME );\n } else {\n // Harden server against MOJ-9929 bug.\n Y.log( `device server is asking for repeated update, ignoring. ${updateQueue}`, 'info', NAME );\n return;\n }\n\n var dlList = getDownloadList();\n\n var files, pkgJsonPath;\n var JSZip = require( 'jszip' );\n var crypto = require( 'crypto' );\n if( msg.data.os === \"Darwin\" ) {\n files = dlList.dir_mac;\n pkgJsonPath = \"DC Device Server.app/Contents/Resources/app.nw/package.json\";\n }\n if( msg.data.os === \"Windows_NT\" ) {\n files = dlList.dir_win;\n pkgJsonPath = \"package.json\";\n }\n if( files && files.length > 0 ) {\n var mostRecent = files[files.length - 1]; //eslint-disable-line no-inner-declarations\n if( msg.data.os === \"Windows_NT\" && semver.lt( msg.data.version, \"2.0.26\" ) ) {\n if( !mostRecent.includes( \"updater\" ) ) {\n mostRecent = `${mostRecent.slice( 0, mostRecent.length - 4 )}updater${mostRecent.slice( mostRecent.length - 4 )}`;\n }\n }\n var filePath = dlList.path + mostRecent; //eslint-disable-line no-inner-declarations\n // var filePath = dlList.path + files; //eslint-disable-line no-inner-declarations\n var update = fs.readFileSync( filePath ); //eslint-disable-line no-inner-declarations\n var updateZip = new JSZip( update ); //eslint-disable-line no-inner-declarations\n if( updateZip.files[pkgJsonPath] ) {\n var pkgJsonObj = updateZip.files[pkgJsonPath].asText(); //eslint-disable-line no-inner-declarations\n var pkgJson = JSON.parse( pkgJsonObj ); //eslint-disable-line no-inner-declarations\n var serverDSver = pkgJson.version; //eslint-disable-line no-inner-declarations\n var clientDSver = msg.data.version; //eslint-disable-line no-inner-declarations\n Y.log( `most recent DS version on this server: ${serverDSver}`, 'debug', NAME );\n Y.log( `DS version from Device Server: ${clientDSver}`, 'debug', NAME );\n Y.log( `compare result: ${semver.lt( clientDSver, serverDSver )}`, 'debug', NAME );\n if( semver.lt( clientDSver, serverDSver ) ) {\n\n setTimeout( () => {\n //set specific device server version (2.0.27) MOJ-10159\n //remove this once every device server is on version 2.0.27 and above\n if( semver.lt( clientDSver, \"2.0.27\" ) ) {\n if( msg.data.os === \"Darwin\" ) {\n const pathMisc = \"DC Device Server.app/Contents/Resources/app.nw/device-server.misc.js\";\n const pathUpdater = \"DC Device Server.app/Contents/Resources/app.nw/device-server.updater.js\";\n const pathNode = \"DC Device Server.app/Contents/Resources/app.nw/node\";\n\n const writeMisc = {\n data: new Buffer( updateZip.files[pathMisc].asText() ),\n path: \"./device-server.misc.js\"\n };\n const writeUpdater = {\n data: new Buffer( updateZip.files[pathUpdater].asText() ),\n path: \"./device-server-updater.js\"\n };\n const writeNode = {\n data: updateZip.files[pathNode].asNodeBuffer(),\n path: \"./node\"\n };\n\n this.emit( \"writeFile\", writeNode );\n setTimeout( () => {\n this.emit( \"writeFile\", writeMisc );\n setTimeout( () => {\n this.emit( \"writeFile\", writeUpdater );\n setTimeout( () => {\n const execUpdateMac = {\n command: \"chmod 755 ./node\"\n };\n\n this.emit( 'executeProgramDetached', execUpdateMac );\n }, 10000 );\n }, 10000 );\n }, 10000 );\n\n } else if( msg.data.os === \"Windows_NT\" ) {\n const pathMisc = \"device-server.misc.js\";\n const pathUpdater = \"device-server.updater.js\";\n\n const writeMisc = {\n data: new Buffer( updateZip.files[pathMisc].asText() ),\n path: \"./device-server.misc.js\"\n };\n const writeUpdater = {\n data: new Buffer( updateZip.files[pathUpdater].asText() ),\n path: \"./device-server-updater.js\"\n };\n\n this.emit( \"writeFile\", writeMisc );\n setTimeout( () => {\n this.emit( \"writeFile\", writeUpdater );\n }, 10000 );\n }\n }\n\n setTimeout( () => {\n this.emit( \"foundVersion\", {\n callID: msg.meta.callID,\n version: serverDSver,\n fileName: mostRecent,\n fileSize: update.length,\n checksum: crypto.createHash( 'md5' ).update( update ).digest( \"hex\" )\n } );\n\n Y.log( \"sending update...\", 'debug', NAME );\n\n this.emit( \"considerUpdating\", update );\n updateQueue = updateQueue.filter( id => id !== this.id );\n\n Y.log( `device servers currently waiting for update in queue: ${updateQueue}`, 'info', NAME );\n }, 60000 );\n\n }, 240000 );\n\n } else if( msg.data.manual ) {\n //notify if check is manual\n this.emit( \"foundVersion\", {\n callID: msg.meta.callID,\n version: serverDSver\n } );\n }\n }\n }\n } );\n\n\n\n function startupCleanup() {\n require( 'dc-core' ).migrate.eachTenantParallelLimit( function( superUser, done ) {\n dbg( \"calling cleanup for tenant \" + superUser.tenantId );\n Y.doccirrus.mongodb.runDb( {\n user: superUser,\n model: \"inport\",\n action: \"get\",\n query: {}\n }, function( err, res ) { //eslint-disable-line handle-callback-err\n if( res ) {\n dbg( \"res of cleanup query: \" + util.inspect( res ) );\n var toBeRemoved = []; //eslint-disable-line no-inner-declarations\n for( var i = 0; i < res.length; i++ ) { //eslint-disable-line no-inner-declarations\n dbg( \"checking \" + res[ i ].path );\n if( !res[ i ].configured ) {\n dbg( \"not configured\" );\n if( !s2eClients[ res[ i ].path.split( \":\" )[ 0 ] ] ) {\n toBeRemoved.push( res[ i ].path );\n }\n } else {\n dbg( \"configured\" );\n }\n }\n dbg( \"to be removed: \" + toBeRemoved );\n\n if( 0 < toBeRemoved.length ) {\n deleteFromDb( { tenant: superUser.tenantId, data: toBeRemoved } );\n }\n }\n } );\n done( null, true );\n }, 5, function() {\n } );\n }\n\n Y.doccirrus.communication.setListenerForNamespace(\"/\", \"inspectDevicesChange\", function(msg) {\n devicesInspector = msg.user;\n });\n //Y.doccirrus.communication.setListenerForNamespace(\"/\", \"sd.cleanupDevices\", cleanupDevices);\n //Y.doccirrus.communication.setListenerForNamespace(\"admin\", \"sd.cleanupDevices\", cleanupDevices);\n\n setTimeout( startupCleanup, 3000 );\n }", "title": "" }, { "docid": "3c05aed29337d81c80fe57ac305c6c6b", "score": "0.54002607", "text": "function FieldCoil2(wire, kload, kpack, region1, rbend) {\n\tthis.wire = wire; // wire material/characteristics\n\tthis.kload = kload; // load factor (aka gamma)\n\tthis.kpack = kpack; // packing factor (aka beta)\n\tthis.region1 = region1; // original field coil region object\n\tthis.region2 = new Region(region1.study, \"fc2\", new Shape(region1.shape.ri, region1.shape.ro, \"-(\"+region1.shape.a1+\")\", \"-(\"+region1.shape.a0+\")\", region1.shape.l, region1.shape.pitch)); // inverted copy region\n\tthis.rbend = (rbend !== undefined) ? rbend : this.wire.rbend; // if not specified, use the value specified in wire\n\n\t// Calculate number of turns, wire current (assume only one wire, n_llel = 1)\n\tthis.I = \"(\"+this.kload +\"*\"+this.wire.ic+\")\";\n\tthis.nturns = \"(\"+this.kpack+\"*\"+this.region1.area+\")/(\"+this.wire.area+\")\";\n\tthis.J = \"((\"+this.kpack+\"*\"+this.I+\")/(\"+this.wire.area+\"))\";\n\n\t// Calculate wire length and mass\n\tvar width = \"2*pi*\"+this.region1.shape.ravg+\"*\"+this.region1.shape.dtheta+\"/360\";\n\tvar lpitch = \"2*pi*\"+this.region1.shape.ravg+\"*\"+this.region1.shape.pitch+\"/360\";\n\tvar coillength = \"2*(\"+this.region1.shape.l+\")+2*((\"+lpitch+\")-2*(\"+this.rbend+\")-(\"+width+\"))+2*pi*(\"+this.rbend+\"+(\"+width+\")/2)\";\n\tthis.wirelength = \"(\"+coillength+\")*(\"+this.nturns+\")\";\n\tthis.mass = \"(\"+this.kpack+\")*(\"+coillength+\")*(\"+this.region1.area+\")*(\"+this.wire.density+\")\";\n}", "title": "" }, { "docid": "a74ce39e2fef7fff2da5fcff9ae44790", "score": "0.53964007", "text": "function DS1307(i2c) {\n this.i2c = i2c;\n}", "title": "" }, { "docid": "aa9c2b0568a102ceb30386137b1c8f4c", "score": "0.53769886", "text": "async initWait() {\n await this.writeWait(MCP23S08.MCP23S08_REGISTER.IODIR, 0xff); // input\n for (let i = MCP23S08.MCP23S08_REGISTER.IPOL; i <= MCP23S08.MCP23S08_REGISTER.OLAT; i++) {\n await this.writeWait(i, 0x00);\n }\n await this.flushWait('direction');\n await this.flushWait('gpio');\n }", "title": "" }, { "docid": "d0f60f99151fd394b57b6c5602a2ae88", "score": "0.53753775", "text": "init() {\n\t\tdebug = this.debug;\n\t\tlog = this.log;\n\n\t\tthis.status(this.STATUS_OK);\n\n\t\tthis.initVariables();\n\t\tthis.initFeedbacks();\n\t\tthis.checkFeedbacks('sample');\n\n\t\tthis.initTCP();\n\t}", "title": "" }, { "docid": "252b4e4c904231a958325010140c96c3", "score": "0.5366758", "text": "function readData(){\n /** start reading fron st1 register */\n update = i2c_burst_read(0x64,0x04,7);\n // console.log(\"update\"+update);\n /** Indicated value of Temperature Sensor (ººC) = C) = 0.001983737 Measurement data of Temperature Sensor (Decimal) + 25 */\n c=(0.0019837*_2complement(concatReg(update[5],update[4]))+25).toFixed(1);\n //TEMP = ((5/9) * (c - 32)).toFixed(2);\n /** Output current of IR Sensor (pA) = 0.4578 Measurement data of IR Sensor (Decimal) */\n Ir=0.4578*_2complement(concatReg(update[3],update[2]));\n //status=Serial3.println(\"mac get status\");\n //status&=14;\n //if(status==0){//channel available \n console.log(\"tempurature = \"+ c+\" °C\");\n presence=\"00\";\n enc=encapsulation(c);\n sendToRn2483_Timeout(enc);\n //}\n \n}", "title": "" }, { "docid": "54884b0be286a28755d2987ac6915371", "score": "0.53637403", "text": "constructor() {\n this.pbi = new Array(MAX_FB_MT_DEC);//VP8D_COMP\n }", "title": "" }, { "docid": "df8535bd212ac491f4edf258f13c0f5a", "score": "0.53566116", "text": "function init()\n{\n\tvar rom = getRom();\n\t\n\tfor(var i = 0; i < 2048; i++)\n\t{\n\t\tMEM[i] = parseInt(parseInt(rom[i],2).toString(16),16);\n\t}\n\t\n\tfor (var i = 3050; i < 3306; i++)\n\t{\n\t\tMEM[i] = i * 8;\n\t}\n\t\n\tfor (var i = 3307; i < 85536; i++)\n\t{\n\t\tMEM[i] = 0;\n\t}\n}", "title": "" }, { "docid": "46eb3c8f99b40dc1c17d32724c7a9273", "score": "0.53397965", "text": "function setCO2ToZero() {\n co2Emissions = 0;\n // Declare that CO2e cannot be calculated\n co2Calculable = false;\n}", "title": "" }, { "docid": "0ae570de7755fa26a9fa179b6d8ed206", "score": "0.5326336", "text": "initialize() {\n LOGGER.info('Initialize the BleTransportManager...');\n\n this.requestCharacteristic = new RequestCharacteristic(requestMessage => {\n const isNewRequest = !this.lastReceivedRequestMessage ||\n this.lastReceivedRequestMessage.correlationId !== requestMessage.correlationId;\n LOGGER.debug('Receive a request message (isNewRequest = ' + isNewRequest + '): ', requestMessage);\n\n if (isNewRequest) {\n // Do not process this new request yet before the previous one is completely finished\n const waitForPreviousRequestToFinish = onFinished => {\n if (!this.isWaitingForAcknowledgement) {\n onFinished();\n } else {\n LOGGER.debug('Waiting in order to not process the new request before the previous one is finished...');\n setTimeout(() => waitForPreviousRequestToFinish(onFinished), 100);\n }\n };\n waitForPreviousRequestToFinish(() => {\n this.lastReceivedRequestMessage = requestMessage;\n this.lastReceivedRequestMessageTimestamp = Date.now();\n\n this.requestHandlers.forEach(requestHandler => {\n try {\n requestHandler(requestMessage.action, requestMessage.correlationId, requestMessage.payload);\n } catch (e) {\n LOGGER.error('An error occurred when invoking a request handler.', e);\n }\n });\n });\n } else {\n this.lastReceivedRequestMessage = requestMessage;\n this.lastReceivedRequestMessageTimestamp = Date.now();\n }\n });\n this.responseCharacteristic = new ResponseCharacteristic();\n\n bleno.on('stateChange', state => {\n LOGGER.info('on -> stateChange: ' + state + ', address = ' + bleno.address);\n if (state === 'poweredOn') {\n bleno.startAdvertising('scannerbridge', [ScannerBleService.getUUID()]);\n } else {\n bleno.stopAdvertising();\n }\n });\n\n bleno.on('accept', clientAddress => {\n LOGGER.info('on -> accept, client: ' + clientAddress);\n\n bleno.updateRssi();\n });\n\n bleno.on('disconnect', clientAddress => {\n LOGGER.info('on -> disconnect, client: ' + clientAddress);\n });\n\n bleno.on('rssiUpdate', rssi => {\n LOGGER.info('on -> rssiUpdate: ' + rssi);\n });\n\n bleno.on('mtuChange', mtu => {\n LOGGER.info('on -> mtuChange: ' + mtu);\n });\n\n bleno.on('advertisingStart', error => {\n LOGGER.info('on -> advertisingStart: ' + (error ? 'error ' + error : 'success'));\n\n if (!error) {\n bleno.setServices([new ScannerBleService(this.requestCharacteristic, this.responseCharacteristic)]);\n }\n });\n\n bleno.on('advertisingStop', () => {\n LOGGER.info('on -> advertisingStop');\n });\n\n bleno.on('servicesSet', error => {\n LOGGER.info('on -> servicesSet: ' + (error ? 'error ' + error : 'success'));\n });\n\n LOGGER.info('BleTransportManager initialized with success!');\n }", "title": "" }, { "docid": "660c381b6b530ba1a554ffb1b80ae95b", "score": "0.5316431", "text": "function init() {\n bdk.getBotData(roomId, botName)\n .then((res) => {\n const data = res.body;\n zip = data.filter((bd) => bd.name === 'location').length > 0 ?\n data.filter((bd) => bd.name === 'location')[0].value : null;\n temperature = data.filter((bd) => bd.name === 'temperature').length > 0 ?\n data.filter((bd) => bd.name === 'temperature')[0].value : null;\n weather = data.filter((bd) => bd.name === 'weather').length > 0 ?\n data.filter((bd) => bd.name === 'weather')[0].value : null;\n if (!zip) {\n bdk.findRoom(roomId)\n .then((res) => {\n const settings = res.body.settings ? res.body.settings : {};\n zip = settings.currentZipCode ? settings.currentZipCode : '90210';\n getWeather(zip);\n renderUI(null, null, null); \n });\n } else {\n getWeather(zip);\n renderUI(parseInt(temperature), weather, zip);\n }\n });\n}", "title": "" }, { "docid": "d92e0d7c9597d303d382cc6f56f540ea", "score": "0.5316398", "text": "function DataChannelInit() {\n}", "title": "" }, { "docid": "e6f37bb638370113084ea645d124b4f3", "score": "0.5316347", "text": "function init() {\n createBluetoothScannerWindow().then(scanforDevices);\n}", "title": "" }, { "docid": "788a2d82148eff6be13fdd24a27bce33", "score": "0.52974874", "text": "function BMA223(){\n var acc;\n\n function readreg(r){\n return acc.send([0x80|r,0x00],D2)[1];\n }\n\n function writereg(r,v){\n acc.send([0x7f & r,v],D2);\n }\n\n function setbit(r,b){\n var v = readreg(r);\n writereg(r,v | 1<<b);\n }\n\n function resetbit(r,b){\n var v = readreg(r);\n writereg(r,v & ~(1<<b));\n }\n\n function lowPowerMode(b){\n if (b)\n setbit(0x11,6);\n else\n resetbit(0x11,6);\n }\n\n function initAll(){\n acc=new SPI();\n acc.setup({sck:D29,miso:D31,mosi:D30,mode:0});\n D2.reset();\n D7.reset();\n setTimeout(()=>{\n D7.set();\n D2.set();\n setTimeout(()=>{\n writereg(0x21,0x0E); //latch interrupt for 50ms\n setbit(0x16,5); // single tap enable\n setbit(0x19,5); // map it to INT1\n lowPowerMode(true);\n },100); \n },100);\n }\n\n // values are 4 is face tap, 2 side tap, 1 bottom or top side tap\n setWatch(()=>{\n var rv = readreg(0x0b);\n var v = (rv&0x7f)>>4;\n v = rv&0x80?-v:v;\n DK08.emit(\"tap\",v);\n },D4,{ repeat:true, debounce:false, edge:'rising' });\n\n\n function readXYZ(){\n function conv(i){\n return (i & 0x7F)-(i & 0x80);\n }\n return {\n x:conv(readreg(3)),\n y:conv(readreg(5)),\n z:conv(readreg(7))\n };\n }\n\n return {init:initAll, read:readXYZ, lowPower:lowPowerMode};\n}", "title": "" }, { "docid": "a6ed48d4721ead98c10ed81f88daa877", "score": "0.5294622", "text": "function _init() {\n log.init(LOG_PREFIX, 'Starting...');\n if (!_bluetooth) {\n log.error(LOG_PREFIX, 'Bluetooth not available.');\n return;\n }\n Object.keys(ID_TO_UUID).forEach((id) => {\n const uuid = ID_TO_UUID[id];\n _uuidToId[uuid] = id;\n });\n _bluetooth.on('discover', (peripheral) => {\n const uuid = peripheral.uuid;\n const deviceName = peripheral.advertisement.localName;\n let deviceId = _uuidToId[uuid];\n if (!deviceId) {\n // Not in the list of devices we want to track\n return;\n }\n if (_somaDevices[deviceId]) {\n // We're already tracking this device\n return;\n }\n if (deviceName.indexOf('RISE') !== 0) {\n // This device doesn't start with RISE\n return;\n }\n const btAddress = peripheral.address;\n _somaDevices[deviceId] = peripheral;\n const msg = `Found ${deviceName} (${deviceId})`;\n const addr = `${btAddress} with UUID: ${uuid}`;\n log.log(LOG_PREFIX, msg + ' at ' + addr);\n _bluetooth.watch(peripheral);\n _updateDevice(deviceId, peripheral);\n });\n setInterval(_updateTick, UPDATE_REFRESH_INTERVAL);\n }", "title": "" }, { "docid": "6d1947532edfb4c0b16c489318b3f683", "score": "0.52941513", "text": "function init() {\n outputBrowserCard();\n outputDeviceCard();\n outputCountryCard();\n}", "title": "" }, { "docid": "8dd40af0edf7b3d1613a019604647e6d", "score": "0.5286875", "text": "function init() {\n\t\tdemobo.setController( {\n\t\t\turl : ui.controllerUrl\n\t\t});\n\t\t// your custom demobo input event dispatcher\n\t\tdemobo.mapInputEvents( {\n\t\t\t'playPauseButton' : playPause,\n\t\t\t'playButton' : \t\tplay,\n\t\t\t'pauseButton' : \tpause,\n\t\t\t'nextButton' : \t\tnext,\n\t\t\t'loveButton' : \t\tlike,\n\t\t\t'spamButton' : \t\tdislike,\n\t\t\t'volumeSlider' : \tsetVolume,\n\t\t\t'stationItem' : \tchooseStation,\n\t\t\t'demoboVolume' : \tonVolume,\n\t\t\t'demoboApp' : \t\tonReady\n\t\t});\n\t\tshowDemobo();\n\t\tsetupSongTrigger();\n\t\tsetupStationTrigger();\n\t\tsetupStateTrigger();\n\t}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.52608097", "text": "function init() {}", "title": "" }, { "docid": "b96f9e444a37cae88888bde158214de9", "score": "0.5257485", "text": "function BTTInitialize() {\n init();\n}", "title": "" }, { "docid": "6eb637daa2f70c381f92d3bcb546aa5f", "score": "0.523921", "text": "constructor()\n {\n this.digitalBoard = new board();\n this.ctx = {};\n this.imgBoard = {};\n this.imgBlack = {};\n this.imgWhite = {};\n this.onLoad();\n }", "title": "" }, { "docid": "48d9afea2fd41fcdb5188551b9c50f3c", "score": "0.52285796", "text": "init() {\n this.initBoard();\n this.generateSolvedBoard();\n this.initToDocument();\n this.listener();\n }", "title": "" }, { "docid": "6c16fb5f5c8cac4bb91564166cfc18ac", "score": "0.5215785", "text": "function init() {\n //assert((1 <= LOG_PAGESIZE) && (LOG_PAGESIZE <= LOG_MEMSIZE) && (LOG_MEMSIZE <= 16)); // Make sure the settings are reasonable\n sys.clearPageAccesses(); // Installs null devices for every page\n myDataBusLocked = false; // Bus starts out unlocked (in other words, peek() changes myDataBusState)\n\n var cpu = new Js6507(sys);\n sys.attachCPU(cpu);\n sys.attach(cpu); //creates the CPU and installs it\n }", "title": "" }, { "docid": "fde9f6baa0cb5ed1fb2a1082805fcb92", "score": "0.52149403", "text": "function init() {\n }", "title": "" }, { "docid": "60148fca6ef5c2f8aea4fbea0d244174", "score": "0.5214587", "text": "function init()\n {\n }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.5209562", "text": "function init() { }", "title": "" }, { "docid": "44e0fdb67468536e9749eb2972aa8eac", "score": "0.5204322", "text": "function testAPIi2c(req, res) {\n var CMD = 0x65;\n // req.params.dev -- device\n\n console.log(req.params.dev);\n i2c1.readByte(ARDUINO_ADDR, CMD, function(err, byte){\n\n if(err) {\n res.status(500).json({'message': err});\n } else {\n console.log(\"cmd: \" + CMD + \" byte: \" + byte);\n res.status(200).send({'value' : parseInt(byte)});\n }\n });\n\n\n // This funcion only sends a command ... descarted\n // // Only send a command\n // i2c1.sendByte(0x08, CMD, function(err){\n //\n // if(err) {\n // res.status(500).json({'message': err});\n // } else {\n // res.status(200).send('OK');\n // }\n // });\n}", "title": "" }, { "docid": "5378dfc40555b1d4ce55bfb2fd6890fc", "score": "0.51897156", "text": "function TOI_init()\n{\n if (TOI_inited == true) return;\n // init the vaiables\n TOI_img = document.getElementById('backImage');\n TOI_txt = document.getElementById('demoText0');\n TOI_tab = document.getElementById('demoTab0');\n TOI_isrc = new Image();\n TOI_isrc.src = TOI_img.src;\n TOI_inited = true;\n\n \n TOI_Bind('0');\n\n // update the preview\n TOI_update('0');\n}", "title": "" }, { "docid": "b9c954c6516ba953547d99038b2c4a23", "score": "0.5167301", "text": "_init() {\n\n this.elementBuilder = new ElementBuilder(\n this._elements,\n this._templateEngine,\n this._schemaValidator,\n this._options,\n );\n\n this.dataObserver = new DataObserver();\n\n this.dataManager = new DataManager(this.dataObserver, this._data);\n\n this.moduleLauncher = new ModuleLauncher(\n this._modules,\n this.dataObserver,\n this.elementBuilder,\n );\n }", "title": "" }, { "docid": "a8dcd3e60fb043c639fe9f3f64c7a169", "score": "0.5164618", "text": "constructor() {\n this.bizNetworkConnection = new BusinessNetworkConnection();\n this.businessNetworkDefinition = null;\n // init();\n // ( async() => {\n // this.businessNetworkDefinition = await this.bizNetworkConnection.connect(cardname);\n // })\n }", "title": "" }, { "docid": "7d10d3bd9b0a83879531fdcef98be419", "score": "0.5162129", "text": "async onReady() {\n\t\t// Initialize your adapter here\n\n\t\t// The adapters config (in the instance object everything under the attribute \"native\") is accessible via\n\t\t// this.config:\n\t\t// this.log.info(\"config option1: \" + this.config.option1);\n\t\t// this.log.info(\"config option2: \" + this.config.option2);\n\t\t\n\t\tthis.log.info(\"onReady\");\n\t\tthis.log.info(\"config ipswitch-Ip sensor: \" + this.config.ipswitchip);\n\n\t\t\n\t\trequest(\n {\n url: 'http://' + this.config.ipswitchip + '/csv.html',\n json: false,\n time: true,\n timeout: 4500\n },\n \n (error, response, content) => {\n this.log.info('local http request done');\n\n if (response) {\n \tthis.log.info('received data (' + response.statusCode + '): ' + content);\n\n \tvar tokens = content.split(',') ;\n\n\n \tvar tokenName = tokens[0] ;\n \tvar tokeniC1 = tokens[1] ;\n \tvar tokeniC2 = tokens[2] ;\n \tvar tokeniC3 = tokens[3] ;\n\t\t\t\t\t\t\tvar tokenTemp = tokens[4] ;\n\n\t\t\t\t\t\t\t//this.log.info('Name: ' + tokenName) ;\n \tthis.log.info('iC1: ' + tokeniC1) ;\n \tthis.log.info('iC2: ' + tokeniC2) ;\n \tthis.log.info('iC3: ' + tokeniC3) ;\n \tthis.log.info('Temp: ' + tokenTemp) ;\n\n\t\t\t\t\t\t\tthis.setObjectNotExists('IC1' , {\n\t\t\t\t\t type: 'state',\n\t\t\t\t\t common: {\n\t\t\t\t\t name: 'IC1',\n\t\t\t\t\t type: 'number',\n\t\t\t\t\t role: 'value',\n\t\t\t\t\t unit: 'kW/h',\n\t\t\t\t\t read: true,\n\t\t\t\t\t write: false\n\t\t\t\t\t },\n\t\t\t\t\t native: {}\n\t\t\t\t\t });\n\n\t\t\t\t\t this.setState('IC1', {val: parseFloat(tokeniC1), ack: true});\n\n\t\t\t\t\t\t\tthis.setObjectNotExists('IC2' , {\n\t\t\t\t\t type: 'state',\n\t\t\t\t\t common: {\n\t\t\t\t\t name: 'IC2',\n\t\t\t\t\t type: 'number',\n\t\t\t\t\t role: 'value',\n\t\t\t\t\t unit: 'kW/h',\n\t\t\t\t\t read: true,\n\t\t\t\t\t write: false\n\t\t\t\t\t },\n\t\t\t\t\t native: {}\n\t\t\t\t\t });\n\n\t\t\t\t\t this.setState('IC2', {val: parseFloat(tokeniC2), ack: true});\n\n\t\t\t\t\t\t\tthis.setObjectNotExists('IC3' , {\n\t\t\t\t\t type: 'state',\n\t\t\t\t\t common: {\n\t\t\t\t\t name: 'IC3',\n\t\t\t\t\t type: 'number',\n\t\t\t\t\t role: 'value',\n\t\t\t\t\t unit: 'kW/h',\n\t\t\t\t\t read: true,\n\t\t\t\t\t write: false\n\t\t\t\t\t },\n\t\t\t\t\t native: {}\n\t\t\t\t\t });\n\n\t\t\t\t\t this.setState('IC3', {val: parseFloat(tokeniC3), ack: true});\n\n\t\t\t\t\t\t\tthis.setObjectNotExists('Temp' , {\n\t\t\t\t\t type: 'state',\n\t\t\t\t\t common: {\n\t\t\t\t\t name: 'Temp',\n\t\t\t\t\t type: 'number',\n\t\t\t\t\t role: 'value',\n\t\t\t\t\t unit: 'C',\n\t\t\t\t\t read: true,\n\t\t\t\t\t write: false\n\t\t\t\t\t },\n\t\t\t\t\t native: {}\n\t\t\t\t\t });\n\n\t\t\t\t\t this.setState('Temp', {val: parseFloat(tokenTemp), ack: true});\n\n\t\t\t\t\t\t\tthis.setObjectNotExists('Name' , {\n\t\t\t\t\t type: 'state',\n\t\t\t\t\t common: {\n\t\t\t\t\t name: 'Name',\n\t\t\t\t\t type: 'string',\n\t\t\t\t\t role: 'value',\n\t\t\t\t\t unit: '',\n\t\t\t\t\t read: true,\n\t\t\t\t\t write: false\n\t\t\t\t\t },\n\t\t\t\t\t native: {}\n\t\t\t\t\t });\n\n\t\t\t\t\t this.setState('Name', {val: tokenName, ack: true});\n\n \t\t\t\t\t\t} else if (error) {\n this.log.info(error);\n }\n }\n );\n\t\t/*\n\t\tFor every state in the system there has to be also an object of type state\n\t\tHere a simple template for a boolean variable named \"testVariable\"\n\t\tBecause every adapter instance uses its own unique namespace variable names can't collide with other adapters variables\n\t\t*/\n\t\t// await this.setObjectAsync(\"testVariable\", {\n\t\t// \ttype: \"state\",\n\t\t// \tcommon: {\n\t\t// \t\tname: \"testVariable\",\n\t\t// \t\ttype: \"boolean\",\n\t\t// \t\trole: \"indicator\",\n\t\t// \t\tread: true,\n\t\t// \t\twrite: true,\n\t\t// \t},\n\t\t// \tnative: {},\n\t\t// });\n\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\t/*\n\t\tsetState examples\n\t\tyou will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd)\n\t\t*/\n\t\t// the variable testVariable is set to true as command (ack=false)\n\t\t//await this.setStateAsync(\"testVariable\", true);\n\n\n\t\t// // same thing, but the value is flagged \"ack\"\n\t\t// // ack should be always set to true if the value is received from or acknowledged from the target system\n\t\t//await this.setStateAsync(\"testVariable\", { val: true, ack: true });\n\n\t\t// // same thing, but the state is deleted after 30s (getState will return null afterwards)\n\t\t//await this.setStateAsync(\"testVariable\", { val: true, ack: true, expire: 30 });\n\n\t\t// // examples for the checkPassword/checkGroup functions\n\t\t// let result = await this.checkPasswordAsync(\"admin\", \"iobroker\");\n\t\t// this.log.info(\"check user admin pw ioboker: \" + result);\n\n\t\t// result = await this.checkGroupAsync(\"admin\", \"admin\");\n\t\t// this.log.info(\"check group user admin group admin: \" + result);\n\n\n\t\t setTimeout(this.stop.bind(this), 10000);\n\t}", "title": "" }, { "docid": "78845ff6b24405217da973d18c89e2c2", "score": "0.5159889", "text": "function init() {\n\t\tvar i;\n\t\tfor (i = 0; i < 0xffff; i++)\n\t\t\tmem[i] = 0;\n\t\tfor (i = 1; i < 16; i++)\n\t\t\treg[i] = 0;\n\t\t//указываем последнюю ячейку памяти для стека, если памяти меньше то и значение соответственно меняется\n\t\treg[0] = 0xffff;\n\t\tpc = 0;\n\t\tregx = 0;\n\t\tregy = 0;\n\t\timageSize = 1;\n\t\tbgcolor = 0;\n\t\tcolor = 1;\n\t\tinterrupt = 0;\n\t\t//задаем начальные координаты спрайтов вне границ экрана\n\t\tfor (i = 0; i < 32; i++) {\n\t\t\t_spr[i] = {\n\t\t\t\taddress: 0,\n\t\t\t\tx: 255,\n\t\t\t\ty: 255,\n\t\t\t\tpreviousx: 255,\n\t\t\t\tpreviousy: 255,\n\t\t\t\tspeedx: 0,\n\t\t\t\tspeedy: 0,\n\t\t\t\theight: 8,\n\t\t\t\twidth: 8,\n\t\t\t\tangle: 0,\n\t\t\t\tisonebit: 0,\n\t\t\t\tlives: 0,\n\t\t\t\tcollision: -1,\n\t\t\t\tsolid: 0,\n\t\t\t\tgravity: 0,\n\t\t\t\toncollision: 0,\n\t\t\t\tonexitscreen: 0,\n\t\t\t\tisscrolled: 1,\n\t\t\t\tfliphorisontal: 0\n\t\t\t};\n\t\t}\n\t\tfor (i = 0; i < maxParticles; i++) {\n\t\t\tparticles[i] = {\n\t\t\t\ttime: 0,\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t\tgravity: 0,\n\t\t\t\tspeedx: 0,\n\t\t\t\tspeedy: 0,\n\t\t\t\tcolor: 0,\n\t\t\t\tsize: 0\n\t\t\t};\n\t\t}\n\t\temitter = {\n\t\t\ttime: 0,\n\t\t\ttimer: 0,\n\t\t\ttimeparticle: 0,\n\t\t\tcount: 0,\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\tgravity: 0,\n\t\t\tspeedx: 0,\n\t\t\tspeedy: 0,\n\t\t\tspeedx1: 0,\n\t\t\tspeedy1: 0,\n\t\t\tcolor: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tsize: 0\n\t\t};\n\t\ttile = {\n\t\t\tadr: 0,\n\t\t\timgwidth: 0,\n\t\t\timgheight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\tcollisionMap: 0\n\t\t};\n\t\tcastomfont = {\n\t\t\tadress: 0,\n\t\t\tstart: 0,\n\t\t\tend: 255,\n\t\t\timgwidth: 0,\n\t\t\timgheight: 0,\n\t\t\tcharwidth: 6,\n\t\t\tcharheight: 8,\n\t\t\tcolumns: 0\n\t\t};\n\t\tfor (i = 0; i < 420; i++)\n\t\t\tcharArray[i] = '';\n\t\tfor (i = 0; i < 8; i++)\n\t\t\ttimers[i] = 0;\n\t\tsetClip(0, 0, 128, 128);\n\t}", "title": "" }, { "docid": "a0124ba07dfb0ed3527d73807fcafdb4", "score": "0.515977", "text": "function init() {\r\n network = [];\r\n netindex = [];\r\n bias = [];\r\n freq = [];\r\n radpower = [];\r\n var i, v;\r\n for (i = 0; i < netsize; i++) {\r\n v = (i << (netbiasshift + 8)) / netsize;\r\n network[i] = [v, v, v];\r\n freq[i] = intbias / netsize;\r\n bias[i] = 0;\r\n }\r\n }", "title": "" }, { "docid": "809ec23027ece706385efde93cf0aac1", "score": "0.5154946", "text": "function init() {\r\n }", "title": "" }, { "docid": "999dac647694525a3c2d164c452ef61f", "score": "0.5151123", "text": "init() {\n this.setPre();\n this.initSeqAndInc();\n this.fillSeq();\n }", "title": "" }, { "docid": "81857d78bc32e2c4b39ac594839ab77f", "score": "0.5127283", "text": "function cam2Setup()\n{\n\tvar x = 0;\n\n\tcamCompleteRequiredResearch(CAM1A_RESEARCH, THE_COLLECTIVE);\n\tcamCompleteRequiredResearch(CAM1A_RESEARCH, CAM_HUMAN_PLAYER);\n\tcamCompleteRequiredResearch(CAM1A_RESEARCH, ULTSCAV);\n\n\tcamCompleteRequiredResearch(CAM2A_RESEARCH, THE_COLLECTIVE);\n\tcamCompleteRequiredResearch(CAM2A_RESEARCH, CAM_HUMAN_PLAYER);\n\tcamCompleteRequiredResearch(CAM2A_RESEARCH, ULTSCAV);\n\n\tcamCompleteRequiredResearch(CAM2A_RES_COL, THE_COLLECTIVE);\n\tcamCompleteRequiredResearch(CAM2A_RES_COL, ULTSCAV);\n\n\tconst BASE_STRUCTURES = [\n\t\t\"A0CommandCentre\", \"A0PowerGenerator\", \"A0ResourceExtractor\",\n\t\t\"A0ResearchFacility\", \"A0LightFactory\",\n\t];\n\n\tfor (var i = 0; i < BASE_STRUCTURES.length; ++i)\n\t{\n\t\tenableStructure(BASE_STRUCTURES[i], CAM_HUMAN_PLAYER);\n\t}\n\n\tpreDamageStuff();\n}", "title": "" }, { "docid": "d362912ab12451106ea28babd37bdeee", "score": "0.5123118", "text": "function init () {\n self.world = new World(map);\n self.controls = isMobile ? new TouchControls(node) \n : new MouseControls(node);\n self.camera = new Camera(true);\n self.rendering = new Renderer(node.find(\"canvas.game\")[0]);\n self.recorder = new GameRecorder(self);\n self.player = new Player(self.world, map.data.start[0].x, map.data.start[0].y);\n self.camera.setWorldSize(self.world.width, self.world.height);\n\n self.ui = new Interface(node);\n self.uichrono = self.ui.chrono();\n self.message = self.ui.message();\n self.chrono = new Chrono();\n }", "title": "" }, { "docid": "1376d1d2c8bb7e1c43817921527fb9d1", "score": "0.5113978", "text": "async onReady() {\n\t\tthis.initObjects()\n\t\t\t.then(() => this.checkSettings()\n\t\t\t\t.then(() => this.saveKnownDeviceIDs()\n\t\t\t\t\t.then(() => \n\t\t\t\t\t{\n\t\t\t\t\t\tthis.connectToCloud();\n\t\t\t\t\t\tthis.subscribeStates(\"devices.*.control.*\"); // only subsribe to states changes under \"devices.X.control.\"\n\t\t\t\t\t})\n\t\t\t\t)\t\n\t\t\t)\n\t\t\t.catch(err => this.log.error(err));\n\t}", "title": "" }, { "docid": "8294940f695950ec130b5e2a469ff187", "score": "0.510296", "text": "_onReady() {\n super._onReady();\n\n this._forEach((channel) => this._gpio.open(channel, Gpio.direction.out))\n .then(() => this.emit('ready'))\n .catch(() => undefined);\n }", "title": "" }, { "docid": "4dca0c216c3797a9294affa0313e27a7", "score": "0.51024187", "text": "getI2CWithConfig(config) {\n if (typeof config !== 'object') {\n throw new Error('getI2CWithConfig need config arg');\n }\n if (config.i2c) {\n return config.i2c;\n }\n const i2c = this.getFreeI2C();\n i2c.start(config);\n return i2c;\n }", "title": "" }, { "docid": "3c2d1e07c78d2d7731b8fc658d2de4de", "score": "0.5091748", "text": "function init()\n {\n }", "title": "" }, { "docid": "e2812b19f0da22d5ea499edb36d29c74", "score": "0.50875694", "text": "constructor() {\n super();\n /**\n * the data being read at this outPin\n */\n this.outDataA = \"\";\n /**\n * the data being read at this outPin\n */\n this.outDataB = \"\";\n /**\n * An array of 32 registers. The data is stored here\n */\n this.registers = new Array();\n this.readNumberA = BItsGenerator_1.init_bits(RegisterFile.bitWidth);\n this.readNumberB = BItsGenerator_1.init_bits(RegisterFile.bitWidth);\n this.writeNumber = BItsGenerator_1.init_bits(RegisterFile.bitWidth);\n this.writeData = BItsGenerator_1.init_bits(Math.pow(2, RegisterFile.bitWidth));\n this.clockSignal = new Signal_1.Signal(false);\n this.writeEnable = new Signal_1.Signal(false);\n this.WriteMux = new Mux32_1.Mux32(BItsGenerator_1.init_bits(32), BItsGenerator_1.init_bits(32), 0);\n for (let i = 0; i < Math.pow(2, RegisterFile.bitWidth); ++i) {\n this.registers[i] = new Register_1._32BitsRegister();\n // this.addWire(this.clockSignal,this.registers[i].getClockSignal());\n }\n this.registers[29].setInpin32(StringHandle_1.decToUnsignedBin32(2147479548));\n this.registers[29].changeClockSignal();\n this.registers[29].changeClockSignal();\n this.registers[28].setInpin32(StringHandle_1.decToUnsignedBin32(268468224));\n this.registers[28].changeClockSignal();\n this.registers[28].changeClockSignal();\n let data = new Array();\n this.registers.forEach(register => {\n data.push(register.getOutPin32());\n });\n this.outDataA = this.Mux32Way32(this.readNumberA, data);\n this.outDataB = this.Mux32Way32(this.readNumberB, data);\n }", "title": "" }, { "docid": "ad1b4a8db6f22e705e544ca771448df4", "score": "0.50758946", "text": "constructor(rom) {\n // Save raw ROM bytes.\n this.rom = rom;\n \n // Read header checksum.\n this.headerChecksum = this.rom[0x014D];\n\n // Read global checksum.\n this.globalChecksum = (this.rom[0x014E]<<8) + this.rom[0x014F]; \n\n // Read ROM title.\n this.title = \"\";\n for (let i = 0x134; i <= 0x142; i++){\n if (this.rom[i] === 0x00) continue; \n this.title += String.fromCharCode(this.rom[i]);\n } \n\n // Read Color GB flag.\n this.colorGameboyFlag = this.rom[0x0143] !== 0x00; // TODO: Should this worry about GBC only flag?\n\n // Read Super GB flag.\n this.superGameboyFlag = this.rom[0x0146] === 0x03;\n\n // Read cartridge type, determine memory bank controller and other cartridge properties.\n this.cartridgeType = this.rom[0x0147];\n this.mbc = null;\n this.hasRam = false;\n this.hasBattery = false; \n switch (this.cartridgeType) {\n case 0x00: break;\n case 0x01: this.mbc = new MBC1(this); break;\n case 0x02: this.mbc = new MBC1(this); this.hasRam = true; break;\n case 0x03: this.mbc = new MBC1(this); this.hasRam = true; this.hasBattery = true; break;\n case 0x05: this.mbc = new MBC2(this); break;\n case 0x06: this.mbc = new MBC2(this); this.hasBattery = true; break;\n case 0x08: this.hasRam = true; break;\n case 0x08: this.hasRam = true; this.hasBattery = true; break;\n case 0x0F: this.mbc = new MBC3(this); this.hasBattery = true; break;\n case 0x10: this.mbc = new MBC3(this); this.hasBattery = true; break;\n case 0x11: this.mbc = new MBC3(this); break;\n case 0x12: this.mbc = new MBC3(this); this.hasRam = true; break;\n case 0x13: this.mbc = new MBC3(this); this.hasRam = true; this.rtcExists = true; this.hasBattery = true; break;\n case 0x19: this.mbc = new MBC5(this); break;\n case 0x1A: this.mbc = new MBC5(this); this.hasRam = true; break;\n case 0x1B: this.mbc = new MBC5(this); this.hasRam = true; this.hasBattery = true; break;\n case 0x1C: this.mbc = new MBC5(this); this.hasRumble = true; break;\n case 0x1D: this.mbc = new MBC5(this); this.hasRumble = true; this.hasRam = true; break;\n case 0x1E: this.mbc = new MBC5(this); this.hasRumble = true; this.hasRam = true; this.hasBattery = true; break;\n default:\n throw `Cartridge: Unsupported cartridge type: ${this.cartridgeType.toHex(2)}`;\n }\n\n // Read ROM size.\n this.romSize = this.rom[0x0148];\n\n // Determine total ROM banks.\n switch (this.romSize) {\n case 0x00: this.totalRomBanks = 1; break;\n case 0x01: this.totalRomBanks = 4; break;\n case 0x02: this.totalRomBanks = 8; break;\n case 0x03: this.totalRomBanks = 16; break;\n case 0x04: this.totalRomBanks = 32; break;\n case 0x05: this.totalRomBanks = 64; break;\n case 0x06: this.totalRomBanks = 128; break;\n case 0x07: this.totalRomBanks = 256; break;\n case 0x08: this.totalRomBanks = 512; break;\n case 0x52: this.totalRomBanks = 72; break;\n case 0x53: this.totalRomBanks = 80; break;\n case 0x54: this.totalRomBanks = 96; break;\n }\n\n // Read RAM size.\n this.ramSize = this.rom[0x0149];\n\n // Initialize RAM space.\n let totalRam = 0;\n switch (this.ramSize) {\n case 0x00: totalRam = 0; this.totalRamBanks = 0; break;\n case 0x01: totalRam = 2048; this.totalRamBanks = 1; break;\n case 0x02: totalRam = 8192; this.totalRamBanks = 1; break;\n case 0x03: totalRam = 32768; this.totalRamBanks = 4; break;\n case 0x04: totalRam = 131072; this.totalRamBanks = 16; break;\n case 0x05: totalRam = 65536; this.totalRamBanks = 8; break;\n }\n\n if (totalRam > 0) {\n this.ram = [];\n for (let i = 0; i < totalRam; i++) {\n this.ram[i] = Math.floor(Math.random() * 256);\n }\n }\n\n // Load \"battery-backed\" RAM for storage.\n if (this.hasBattery) {\n this.ramIsDirty = false;\n let ram = localStorage.getItem(`RAM-${this.title}-${this.globalChecksum}`);\n if (ram) {\n console.log(`Cartridge RAM found in local storage.`);\n ram = ram.split(\",\");\n this.ram = ram.map(value => { return parseInt(value); });\n }\n } \n\n console.log(this);\n }", "title": "" }, { "docid": "ac5ff980e4dd4290b3515b63ebbd88d7", "score": "0.50738317", "text": "function init() {\n\t\tdemobo.setController( {\n\t\t\turl : ui.controllerUrl,\n\t\t\torientation: 'portrait'\n\t\t});\n\t\t// your custom demobo input event dispatcher\n\t\tdemobo.mapInputEvents( {\n\t\t\t'demoboApp' : \t\tonReady,\n\t\t\t'typing-area' : insertTextAtCursor,\n\t\t\t'enter-button' : onEnter,\n\t\t\t'select-button' : onSelect\n\t\t});\n\t}", "title": "" }, { "docid": "49e4e5bfc2a9c2894ff2d5b71c627b19", "score": "0.5066907", "text": "__init2() {this._integrationsInitialized = false;}", "title": "" }, { "docid": "49e4e5bfc2a9c2894ff2d5b71c627b19", "score": "0.5066907", "text": "__init2() {this._integrationsInitialized = false;}", "title": "" }, { "docid": "31b50dfc8e8374d9bdf8de0a020401e7", "score": "0.5065979", "text": "function init() {\n\n }", "title": "" }, { "docid": "0fe139d46a3560fe5ca64b136f53e1d3", "score": "0.5062362", "text": "init() {\n this.ready = false;\n this.failed = false;\n }", "title": "" }, { "docid": "50519e99f9947b989ed1a9c22f5f7f40", "score": "0.50618273", "text": "initialiser() {\n\t\tthis.initialiserMap();\n\t\tthis.voiture = new Entite(this, 100, 80, this.ressources.voiture);\n\t\tthis.camera = new Camera(this,this.voiture);\n\t\tthis.boucle();\n\t}", "title": "" }, { "docid": "182f86525d61152556eadc7686f274c0", "score": "0.50500375", "text": "_initState() {\n this._initProps()\n this._initData()\n }", "title": "" }, { "docid": "14bc17b1318f7fa55e0098893bc22ba0", "score": "0.5044755", "text": "constructor() {\n\n\t\t// gpio functionality\n\t\tthis.pins=[\"\",\n\t\t\t\"+3V3\",\t\t\t\t\t\t\t\"+5V\",\t\t\t\t\t\t\t// 2\n\t\t\t\"GPIO_2 I2C1:SDA\",\t\t\t\t\"+5V\",\t\t\t\t\t\t\t// 4\n\t\t\t\"GPIO_3 I2C1:SCL\",\t\t\t\t\"GND\",\t\t\t\t\t\t\t// 6\n\t\t\t\"GPIO_4 1-Wire\",\t\t\t\t\"GPIO_14 UART0:TXD\",\t\t\t// 8\n\t\t\t\"GND\",\t\t\t\t\t\t\t\"GPIO_15 UART0:RXD\",\t\t\t// 10\n\t\t\t\"GPIO_17\",\t\t\t\t\t\t\"GPIO_18 PW0 I2S:CLK\",\t\t\t// 12\n\t\t\t\"GPIO_27\",\t\t\t\t\t\t\"GND\",\t\t\t\t\t\t\t// 14\n\t\t\t\"GPIO_22\",\t\t\t\t\t\t\"GPIO_23\",\t\t\t\t\t\t// 16\n\t\t\t\"+3V3\",\t\t\t\t\t\t\t\"GPIO_24\",\t\t\t\t\t\t// 18\n\t\t\t\"GPIO_10 SPI0:MOSI\",\t\t\t\"GND\",\t\t\t\t\t\t\t// 20\n\t\t\t\"GPIO_9 SPI0:MISO\",\t\t\t\t\"GPIO_25\",\t\t\t\t\t\t// 22\n\t\t\t\"GPIO_11 SPI0:CLK\",\t\t\t\t\"GPIO_8 SPI0:CE0\",\t\t\t\t// 24\n\t\t\t\"GND\",\t\t\t\t\t\t\t\"GPIO_7 SPI0:CE1\",\t\t\t\t// 26\n\t\t\t\"EEPROM I2C:SDA\",\t\t\t\t\"EEPROM I2C:SCL\",\t\t\t\t// 28\n\t\t\t\"GPIO_5\",\t\t\t\t\t\t\"GND\",\t\t\t\t\t\t\t// 30\n\t\t\t\"GPIO_6\",\t\t\t\t\t\t\"GPIO_12 PW0\",\t\t\t\t\t// 32\n\t\t\t\"GPIO_13 PW1\",\t\t\t\t\t\"GND\",\t\t\t\t\t\t\t// 34\n\t\t\t\"GPIO_19 PW1 SPI1:MISO I2S:WS\",\t\"GPIO_16 SPI1:CE0\",\t\t\t\t// 36\n\t\t\t\"GPIO_26\",\t\t\t\t\t\t\"GPIO_20 SPI1:MOSI I2S:DIN\",\t// 38\n\t\t\t\"GND\",\t\t\t\t\t\t\t\"GPIO_21 SPI1:CLK I2S:DOUT\",\t// 40\n\t\t];\n\n\t\t// gpio number to pin number\n\t\tthis.gpioPins=[\n\t\t\t0,0,3,5,7,29,31,26,24,21,19,23,32,33,8,10,36,11,12,35,38,40,15,16,18,22,37,13\n\t\t];\n\t\tthis.pinGpios=[\n\t\t\t 0,\n\t\t\t 0, 0, 2, 0, 3, 0, 4,14, 0,15,\n\t\t\t17,18,27, 0,22,23, 0,24,10, 0,\n\t\t\t 9,25,11, 8, 0, 7, 0, 0, 5, 0,\n\t\t\t 6,12,13, 0,19,16,26,20, 0,21,\n\t\t];\n\n\t\tthis.appObject = null;\t\t// application instance\n\n\t\tthis.createHwdSchema();\n\n\t}", "title": "" }, { "docid": "34eba9504222a69aa5080709c8957179", "score": "0.50416565", "text": "init() {\n\t this.onInitHandler();\n\t this.emit('onInit');\n\t }", "title": "" }, { "docid": "296f99d8cd82bdb78dd5d7e6b73452b6", "score": "0.5041398", "text": "function init()\n\t {\n\n\t }", "title": "" }, { "docid": "2ea14bc7ea24b12e321b8c51b8201cfe", "score": "0.5032297", "text": "constructor() {\n super()\n\n this.$BluetoothBinding = require('bindings')('BluetoothSerialPort.node').BTSerialPortBinding\n this.$DeviceINQ = new DeviceINQ()\n this.$connection = undefined\n this.$address = undefined\n }", "title": "" }, { "docid": "ef9063f8dbecb8698eed5e94fcec07c8", "score": "0.5031132", "text": "function init() {\n\t\tif(joi.initialized) {\n\t\t\treturn;\n\t\t}\n\t\tjoi['#initialize']();\n\t}", "title": "" }, { "docid": "f14a92214e1b51d8b1491f4c99c75875", "score": "0.50301445", "text": "function init () {\n currentOpponent = 0;\n boardState = BOARD.STATE_NOT_ACTIVE;\n\n currentOpponent = parseInt(attrs['currentOpponent'] ? attrs['currentOpponent'] : currentOpponent);\n boardState = parseInt(attrs['boardState'] ? attrs['boardState'] : boardState);\n\n numberOfFreeCells = BOARD.LINEAR_SIZE * BOARD.LINEAR_SIZE;\n\n var x, y;\n for (x = 0; x < BOARD.LINEAR_SIZE; x++) {\n scope.board[x] = [];\n for (y = 0; y < BOARD.LINEAR_SIZE; y++) {\n scope.board[x][y] = BOARD.CELL_FREE;\n }\n }\n }", "title": "" }, { "docid": "41ea3c1458e9722ee9607fd8a90f2993", "score": "0.50296855", "text": "function init() {\n getData()\n }", "title": "" }, { "docid": "051627cff362f259726fa797b57e301e", "score": "0.5027249", "text": "init() {\n //FBClient.setConfigSetting('initialize-with-discovery', true);\n \n this._cleanUpTLSKeys();\n this._setUpTLSKeys()\n .then(() => {\n this._initChannelMSP()\n .then(() => { \n logger.info('Successfully initialized ChannelMSP'); \n })\n });\n }", "title": "" }, { "docid": "a1a1574d19a123a10d32a81046f27465", "score": "0.50233424", "text": "function I2cDev(address, options) {\n i2c.call(this, address, options);\n}", "title": "" }, { "docid": "0d638e842b4617b91cff3206e0487488", "score": "0.50230616", "text": "function init() {\n \n }", "title": "" }, { "docid": "bc18d1691f23c70a1c619a0b7f33660d", "score": "0.5022209", "text": "Initialize() {}", "title": "" }, { "docid": "40e7d3a194aa4425135b8dceebee078f", "score": "0.5010663", "text": "function init(init_cb = null) {\n\tlog.msg('Initializing');\n\n\tupdate.status('hdmi.client_ready', false);\n\n\tclient = new cec.cec(config.hdmi.osd_string);\n\n\t// Initialize event listeners\n\tinit_listeners();\n\n\tlog.msg('Starting cec-client process');\n\tclient.start('cec-client', '-t', 't');\n\n\tclient.once('ready', () => { // Previous arg1: client\n\t\tlog.msg('Initialized');\n\n\t\tupdate.status('hdmi.client_ready', true);\n\n\t\t// Get status\n\t\tsetTimeout(() => {\n\t\t\tcommand('powerstatus');\n\t\t}, 3000);\n\n\t\tlog.msg('Initialized');\n\n\t\t// Holla back\n\t\ttypeof init_cb === 'function' && process.nextTick(init_cb);\n\t\tinit_cb = undefined;\n\t});\n}", "title": "" }, { "docid": "f24dfc1c9c7b15c7cc905bfa2e9f6707", "score": "0.50033265", "text": "function init() {\n if (_initialized) {\n return;\n }\n _initialized = true;\n\n kCardStateL10nId = {\n 'pinRequired' : 'simCardLockedMsg',\n 'pukRequired' : 'simCardLockedMsg',\n 'networkLocked' : 'simLockedPhone',\n 'serviceProviderLocked' : 'simLockedPhone',\n 'corporateLocked' : 'simLockedPhone',\n 'unknown' : 'unknownSimCardState',\n 'illegal' : 'simCardIllegal',\n 'absent' : 'noSimCard',\n 'null' : 'simCardNotReady',\n 'ready': ''\n };\n\n updateCallDescription();\n updateCellAndDataDescription();\n updateMessagingSettings();\n updateWifi();\n updateBluetooth();\n // register blutooth system message handler\n initSystemMessageHandler();\n }", "title": "" }, { "docid": "79c73223888a75b05ee4c1065c48e8e5", "score": "0.4999363", "text": "function setup() {\n // put the DOM elements into global variables:\n connectButton = document.getElementById('connect');\n connectButton.addEventListener('click', connectToBle);\n deviceDiv = document.getElementById('device');\n dataDiv = document.getElementById('data');\n dataDiv2 = document.getElementById('data2'); // added div\n dataDiv3 = document.getElementById('data3');\n}", "title": "" }, { "docid": "b9823dccf696803159fa69c89159ade0", "score": "0.49968693", "text": "init_() {\n this.state = 'READY';\n this.resetEverything();\n return this.monitorBuffer_();\n }", "title": "" }, { "docid": "b9996d972dfc26fd6b425da9daf7bda4", "score": "0.49869707", "text": "function init(_x2) {\n return _init.apply(this, arguments);\n }", "title": "" }, { "docid": "03a406e3bbfed663ee3f4004f8975554", "score": "0.49837252", "text": "function init(){\n\n\t\t}", "title": "" }, { "docid": "7c7cd2808ecab0cbd844549068f1c67e", "score": "0.49830598", "text": "function init() { \n \n }", "title": "" } ]
f683b731b811e2db5bb8e1d0a2bf008e
dropin replacement for _.isString
[ { "docid": "c8033da159ff8dd383ec9acf98f491e4", "score": "0.0", "text": "function isObject(input) {\n return _typeof$1(input) === 'object';\n }", "title": "" } ]
[ { "docid": "d7af997d6923e9a95dcea0aaadddc086", "score": "0.8049123", "text": "function isString(a){ return classOf(a) === '[object String]' }", "title": "" }, { "docid": "071bb8e1f76ca48a56c9219d8ff33df3", "score": "0.8032452", "text": "function _isString(v) {\n return typeof v === 'string' || Object.prototype.toString.call(v) === '[object String]';\n }", "title": "" }, { "docid": "023203734fb7ffc7ca9f4beefe7b58f0", "score": "0.80266076", "text": "isString (value) {\n return typeof value === 'string' || value instanceof String;\n }", "title": "" }, { "docid": "06efcba86fda680e8c07bc7b8ac33528", "score": "0.7814026", "text": "function _isstr(o) \n{ return o!==null && o._isString;\n}", "title": "" }, { "docid": "745233714688bbd03a7aade0a5d57f3c", "score": "0.78008974", "text": "function _isString(v) {\n return (typeof v === 'string' ||\n Object.prototype.toString.call(v) === '[object String]');\n}", "title": "" }, { "docid": "745233714688bbd03a7aade0a5d57f3c", "score": "0.78008974", "text": "function _isString(v) {\n return (typeof v === 'string' ||\n Object.prototype.toString.call(v) === '[object String]');\n}", "title": "" }, { "docid": "f709d17b3c7cf2666d2f037243a57633", "score": "0.7706373", "text": "function isString(obj) {\n\t return !!(obj === '' || obj && obj.charCodeAt && obj.substr);\n\t }", "title": "" }, { "docid": "e7c9aa119d8d5b941bfb3b8c04343be1", "score": "0.7655506", "text": "function isString ( o ){\n return _is( o, '[object String]')\n }", "title": "" }, { "docid": "da6866c244841e994a2bd106085bb9f4", "score": "0.7636115", "text": "static isString(value) {\n return typeof value === \"string\" || value instanceof String;\n }", "title": "" }, { "docid": "125a706f1d7deefdf22ded19bed25e8f", "score": "0.7635896", "text": "function isString(obj) {\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t}", "title": "" }, { "docid": "125a706f1d7deefdf22ded19bed25e8f", "score": "0.7635896", "text": "function isString(obj) {\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t}", "title": "" }, { "docid": "125a706f1d7deefdf22ded19bed25e8f", "score": "0.7635896", "text": "function isString(obj) {\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t}", "title": "" }, { "docid": "125a706f1d7deefdf22ded19bed25e8f", "score": "0.7635896", "text": "function isString(obj) {\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t}", "title": "" }, { "docid": "cf21a779b8e08795a123a60fdbdc1602", "score": "0.76250017", "text": "function isString(str) {\n\t return typeof str === 'string' || str instanceof String;\n\t}", "title": "" }, { "docid": "b65b1f1bf56b0fed53159db715205557", "score": "0.7589239", "text": "function isString(str_ck){return(typeof str_ck == 'string');}", "title": "" }, { "docid": "3bef5dde81a9aaf421ba68558305a1dd", "score": "0.7569657", "text": "function isString(o) { return typeof o !== \"undefined\" && o !== null && (typeof o === \"string\" || o.constructor === String); }", "title": "" }, { "docid": "460362c179bb777f495f88362b0f6e54", "score": "0.7563233", "text": "function isString(value){\n\treturn typeof(value)=='string';\n}", "title": "" }, { "docid": "248b30a9888719ed967a158a49dca86d", "score": "0.7560162", "text": "function isString(v) {\n return (typeof v === 'string' || v instanceof String);\n}", "title": "" }, { "docid": "e427759d351d8dab99f23ebc8085e990", "score": "0.7547912", "text": "function isString(v) {\n return typeof v === \"string\";\n}", "title": "" }, { "docid": "0ed557f2976a142745e9cd7a8e17c45a", "score": "0.7514529", "text": "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n }", "title": "" }, { "docid": "0ed557f2976a142745e9cd7a8e17c45a", "score": "0.7514529", "text": "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n }", "title": "" }, { "docid": "33d4d0d1fa714a44c045f6c3d4f19f53", "score": "0.750046", "text": "function _isString(obj) {\n return typeof obj === 'string';\n }", "title": "" }, { "docid": "3acfd9d15bd640ba855adb57f1f77cc5", "score": "0.7492954", "text": "function isString(s) {\n return typeof s === \"string\" || s instanceof String;\n }", "title": "" }, { "docid": "4e029a117edf1bacc591964a82bffb39", "score": "0.7465309", "text": "function isString(s) {\n return 'string' === typeof s\n}", "title": "" }, { "docid": "6469b44a93d99ceed36c53f13bdad91f", "score": "0.7455297", "text": "function isString(val) {\n return typeof val === 'string';\n}", "title": "" }, { "docid": "6469b44a93d99ceed36c53f13bdad91f", "score": "0.7455297", "text": "function isString(val) {\n return typeof val === 'string';\n}", "title": "" }, { "docid": "6a264f0272c95e0cd6e3fd17a8340dc3", "score": "0.74496585", "text": "isString(object) {\n\t\treturn \"string\" === typeof object && object.length > 0;\n\t}", "title": "" }, { "docid": "51535b41357c5b91c2050add13f277b5", "score": "0.7444546", "text": "function isString(arg) {\n return typeof arg === \"string\";\n}", "title": "" }, { "docid": "a665a20be1c0db7f89b29cac8812d87e", "score": "0.74389845", "text": "function isString(str) {\n return typeof str === \"string\"\n}", "title": "" }, { "docid": "917089834b9996fc4cf1c5aed2b6999c", "score": "0.74252814", "text": "function isString(s) {\n return typeof s === 'string' || s instanceof 'String';\n }", "title": "" }, { "docid": "0cae1675cd7145e0eae81acbb6eb57d4", "score": "0.7416996", "text": "function isString (value) {\n return typeof value === 'string' || value instanceof String;\n }", "title": "" }, { "docid": "0cae1675cd7145e0eae81acbb6eb57d4", "score": "0.7416996", "text": "function isString (value) {\n return typeof value === 'string' || value instanceof String;\n }", "title": "" }, { "docid": "99120549bd7f61be65b256efb720da82", "score": "0.7410818", "text": "function isString(val) {\n return typeof val == \"string\";\n}", "title": "" }, { "docid": "4196e17a76778035fe92d933f2140f80", "score": "0.7397521", "text": "function isString (value) {\n return typeof value === 'string' || value instanceof String\n}", "title": "" }, { "docid": "8fe6554abec62a8f1f1d32a3ad85ad76", "score": "0.7395496", "text": "function isString(value) {\n return value && Object.prototype.toString.call(value) === '[object String]';\n }", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.7389032", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.7389032", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.7389032", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.7389032", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "ed5489c34bbeafcbd0681ee6c8aa036b", "score": "0.73503524", "text": "function isString(value) {\r\n return typeof value === \"string\";\r\n}", "title": "" }, { "docid": "5d3d99c0ca637f28395ea54e75d06292", "score": "0.7345046", "text": "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "5d3d99c0ca637f28395ea54e75d06292", "score": "0.7345046", "text": "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "5d3d99c0ca637f28395ea54e75d06292", "score": "0.7345046", "text": "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "dd5aa73ac2a26ab7998ed43e738309d8", "score": "0.73405445", "text": "function isString(obj) {\n if (isUndefined(obj))\n return false;\n return typeof obj === 'string' || obj instanceof String;\n}", "title": "" }, { "docid": "11a81b91f5d989210af5d2d8447c9892", "score": "0.7337714", "text": "function isString(input){\n\n return typeof input === 'string'\n}", "title": "" }, { "docid": "4c865297295c463d1989491c446d6c35", "score": "0.73301136", "text": "static isString(ui){\n\t\treturn ui.kind == UIStruct.TYPE_STRING || ui.kind == UIStruct.TYPE_RAW;\n\t}", "title": "" }, { "docid": "de9673ff685c96cb02b1ad91a4769d1d", "score": "0.7329227", "text": "function isString(value) {\n return value instanceof String || typeof value === \"string\";\n}", "title": "" }, { "docid": "37ad2711bd587b332c5e916d3701ad35", "score": "0.7325062", "text": "function isString(val) {\n return (typeof val === \"string\");\n }", "title": "" }, { "docid": "ec56239f15e470c8d46a8910250748b6", "score": "0.73204917", "text": "function isString(s) {\n return typeof s === 'string' || s instanceof String;\n}", "title": "" }, { "docid": "ec56239f15e470c8d46a8910250748b6", "score": "0.73204917", "text": "function isString(s) {\n return typeof s === 'string' || s instanceof String;\n}", "title": "" }, { "docid": "ec56239f15e470c8d46a8910250748b6", "score": "0.73204917", "text": "function isString(s) {\n return typeof s === 'string' || s instanceof String;\n}", "title": "" }, { "docid": "f07d342878c1692bbe2fb2d7f80ad869", "score": "0.73002446", "text": "function isString(obj) {\n return toString.call(obj) === '[object String]';\n }", "title": "" }, { "docid": "e4be65ed59d21e05e2854b329386d2d2", "score": "0.72992134", "text": "function isString$1(obj) {\n return typeof obj === \"string\";\n}", "title": "" }, { "docid": "697d69702f9e3d229ac1ad3ce81e1ffa", "score": "0.729334", "text": "function isString(a) {\n\treturn (typeof a == 'string');\n\t}", "title": "" }, { "docid": "7415ca7c8318badc4cd306911789f429", "score": "0.7280958", "text": "function isString(value) {\n\t\tif (typeof value === 'string') { return true; }\n\t\tif (typeof value !== 'object') { return false; }\n\t\treturn toString.call(value) === '[object String]';\n\t}", "title": "" }, { "docid": "b6fa5ac8ca77e4938c34061fd7751994", "score": "0.72773534", "text": "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n }", "title": "" }, { "docid": "b6fa5ac8ca77e4938c34061fd7751994", "score": "0.72773534", "text": "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n }", "title": "" }, { "docid": "c09f77717b3ccc69823f5138b4f8ae41", "score": "0.7260586", "text": "function isString(object) {\n return typeof object === 'string' || object instanceof String;\n }", "title": "" }, { "docid": "c09f77717b3ccc69823f5138b4f8ae41", "score": "0.7260586", "text": "function isString(object) {\n return typeof object === 'string' || object instanceof String;\n }", "title": "" }, { "docid": "56634d7f675a2b839fe1573eed9b15e8", "score": "0.72602344", "text": "function isString(obj) {\n\treturn typeof obj == \"string\" || Object.prototype.toString.call(obj) === \"[object String]\";\n}", "title": "" }, { "docid": "f993410bf6f97fffb3c37076af78d4b2", "score": "0.72588515", "text": "function isString(input) {\n return typeof input === 'string';\n}", "title": "" }, { "docid": "f352697fccf8a183b4f19b5428736dae", "score": "0.72575", "text": "function isString(value) {\n return typeof value === \"string\";\n}", "title": "" }, { "docid": "f352697fccf8a183b4f19b5428736dae", "score": "0.72575", "text": "function isString(value) {\n return typeof value === \"string\";\n}", "title": "" }, { "docid": "f352697fccf8a183b4f19b5428736dae", "score": "0.72575", "text": "function isString(value) {\n return typeof value === \"string\";\n}", "title": "" }, { "docid": "f352697fccf8a183b4f19b5428736dae", "score": "0.72575", "text": "function isString(value) {\n return typeof value === \"string\";\n}", "title": "" }, { "docid": "d4a9e4e000bf9f440beb10a3a49d5a59", "score": "0.7253072", "text": "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n}", "title": "" }, { "docid": "d5b1a9d59e44a2ea8bfa9d22da443a5a", "score": "0.7237461", "text": "function isString(value) {\n return typeof value === 'string';\n}", "title": "" }, { "docid": "d5b1a9d59e44a2ea8bfa9d22da443a5a", "score": "0.7237461", "text": "function isString(value) {\n return typeof value === 'string';\n}", "title": "" }, { "docid": "63340178d426f5cb73b2214d2f2db482", "score": "0.7234795", "text": "function isString(input) {\n return typeof(input) == \"string\";\n}", "title": "" }, { "docid": "6f01e72f39fa5b1a3843868bc010ef87", "score": "0.72255456", "text": "function isString(data) {\n var flag = \"\";\n if (Array.isArray(data)) {\n flag = \"array\";\n } else if (typeof data == \"object\") {\n flag = \"object\";\n } else if (typeof data == \"string\") {\n flag = \"string\";\n }\n return flag == \"string\";\n}", "title": "" }, { "docid": "be07a302011fd065e52e518bcd918f1d", "score": "0.7223141", "text": "function isString(value) {\n return typeof value === 'string';\n}", "title": "" }, { "docid": "be07a302011fd065e52e518bcd918f1d", "score": "0.7223141", "text": "function isString(value) {\n return typeof value === 'string';\n}", "title": "" }, { "docid": "b0750097c29b33aca893a2c9f7c6e250", "score": "0.72230715", "text": "function isString(value) {\n return typeof(value) === 'string';\n}", "title": "" }, { "docid": "3a724f858c3dd61535494d09a5b2adba", "score": "0.7217257", "text": "function isString(value) {\n const stringTag = '[object String]';\n return typeof value === 'string' || (isObjectLike(value) && objToString.call(value) === stringTag);\n}", "title": "" }, { "docid": "cb12db7b8054ec5d6f7b7dfdbd4c4dc9", "score": "0.71824646", "text": "function isString ( sValue ) {\n return Object.prototype.toString.call( sValue ) === '[object String]';\n}", "title": "" }, { "docid": "b40958f08c0cd1f47f95f1db6908f595", "score": "0.71773577", "text": "function isStr(item) {\r\n\t\treturn typeof item === 'string';\r\n\t}", "title": "" }, { "docid": "ac9471d142df107de73f058cd4b55370", "score": "0.71631444", "text": "valIsString(val) {\n return typeof val === 'string' || val instanceof String;\n }", "title": "" }, { "docid": "0839fd883aac45cadb97ae5cf2785a9e", "score": "0.71326965", "text": "function isString (s) { // eslint-disable-line no-unused-vars\n return typeof s === 'string'\n}", "title": "" }, { "docid": "7bd10a1a8111023a965793dc13a03e25", "score": "0.7113452", "text": "function isString(value) {\n return typeof value === \"string\";\n }", "title": "" }, { "docid": "7bd10a1a8111023a965793dc13a03e25", "score": "0.7113452", "text": "function isString(value) {\n return typeof value === \"string\";\n }", "title": "" }, { "docid": "f88c668e98cb0248de6fdfabe95a475c", "score": "0.70846885", "text": "function isString(obj) {\n return (typeof obj === \"string\");\n }", "title": "" }, { "docid": "68c26cb1a63ab39a55b01ac71b39ed41", "score": "0.7023237", "text": "function is_string(v) {\r\n return (typeof(v) == 'string');\r\n}", "title": "" }, { "docid": "7bdcf0ec8172e5240385aadf48e559e1", "score": "0.6989822", "text": "isString (str) {\n if (typeof str !== 'string') throw new TypeError('Validator only accepts strings')\n }", "title": "" }, { "docid": "794ad7dcc3d9d48e5a2195bb8c7c378f", "score": "0.6972351", "text": "function string(val) {\n return typeof val === 'string';\n }", "title": "" }, { "docid": "05d82f1c5a4aad9f8e320b5cf4811d5f", "score": "0.69709325", "text": "function isString(obj) {\n 'use strict';\n return typeof obj === 'string';\n}", "title": "" }, { "docid": "068ec357b74291f8a5ec81eac050760d", "score": "0.69251245", "text": "function isString (thing) {\n return typeof thing === 'string';\n }", "title": "" }, { "docid": "a778df298600fa77821e93e042a9bf15", "score": "0.6918359", "text": "function isString(variable){\n return typeof variable === 'string';\n}", "title": "" }, { "docid": "1e6e15af21ca2ae6e210aa85dca16b7b", "score": "0.6918138", "text": "function string$1(value) {\r\n return typeof value === 'string';\r\n}", "title": "" }, { "docid": "9aace526e7e8898a01714751b3e901e0", "score": "0.6908368", "text": "function string(a) {\n if (typeof a === \"string\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "f4dacf497a57bde55c4f47fb72493426", "score": "0.68550634", "text": "function isString (a) {\n \n if (typeof a === \"string\") {\n var b = \"true\";\n }\n else {\n var b = \"false\";\n }\n return b;\n}", "title": "" }, { "docid": "e3d8033a71c3ddc616f41e676aa3d609", "score": "0.6830464", "text": "function isString(test){\n if(typeof test === \"string\"){\n return true;\n }\n}", "title": "" }, { "docid": "d15ee1dc5d48dc139e1d096e8b75145b", "score": "0.68210727", "text": "function fnIsString(input){\n return (input === String(input));\n}", "title": "" }, { "docid": "ef4bd359cefc6c007fbeb0238c496775", "score": "0.6811466", "text": "function isString(property) {\n return typeof property === 'string' || property instanceof String;\n }", "title": "" }, { "docid": "3392996b33a4b290d0e12fef4b26eb61", "score": "0.6806335", "text": "function _checkstr(o)\n{ if (o===null || o._isString) return o;\n throw (new java_lang_ClassCastException())._0()._e; \n}", "title": "" }, { "docid": "5001eb9b0e5725ade0687947565b611c", "score": "0.6772047", "text": "function is_string(mixed_var) {\n return (typeof(mixed_var) == 'string');\n}", "title": "" }, { "docid": "f6a39612daebe9ec1e46fbca63ca43e1", "score": "0.67687917", "text": "function str(word) {\n if (typeof word === \"string\") {\n return true\n }\n else if (typeof word !== \"string\") {\n return false\n }\n\n}", "title": "" }, { "docid": "4fde386ade7bab79099fa29d081e61ce", "score": "0.6768464", "text": "function IsStr(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n}", "title": "" }, { "docid": "58c97b7964db9b54a81c060101e91fb5", "score": "0.67411673", "text": "function isStringObject(obj){\n\treturn obj && typeof obj === \"object\"\n\t\t&& Function.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\n}", "title": "" }, { "docid": "65533641ede86e11cfb2603f94356d4c", "score": "0.67257446", "text": "function is_string( arg ) {\n return typeof arg === 'string';\n }", "title": "" }, { "docid": "65533641ede86e11cfb2603f94356d4c", "score": "0.67257446", "text": "function is_string( arg ) {\n return typeof arg === 'string';\n }", "title": "" }, { "docid": "65533641ede86e11cfb2603f94356d4c", "score": "0.67257446", "text": "function is_string( arg ) {\n return typeof arg === 'string';\n }", "title": "" } ]
0024ee61152027ecf4d49fff3eacbbcc
Should be called if a blur event is fired on a focusvisible element
[ { "docid": "e9d77a67f4a738a6e5b4a938963d9071", "score": "0.80082625", "text": "function handleBlurVisible() {\r\n // To detect a tab/window switch, we look for a blur event followed\r\n // rapidly by a visibility change.\r\n // If we don't see a visibility change within 100ms, it's probably a\r\n // regular focus change.\r\n hadFocusVisibleRecently = true;\r\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\r\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\r\n hadFocusVisibleRecently = false;\r\n }, 100);\r\n}", "title": "" } ]
[ { "docid": "9e145513276df02494f9e01a6327294f", "score": "0.79980636", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n }", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "9a08c1a6b0f37f092778e05e10a745f5", "score": "0.7982423", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "title": "" }, { "docid": "32283a03d6338278f94a2fef7203f031", "score": "0.7971416", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "title": "" }, { "docid": "32283a03d6338278f94a2fef7203f031", "score": "0.7971416", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "title": "" }, { "docid": "32283a03d6338278f94a2fef7203f031", "score": "0.7971416", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "title": "" }, { "docid": "32283a03d6338278f94a2fef7203f031", "score": "0.7971416", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "title": "" }, { "docid": "32283a03d6338278f94a2fef7203f031", "score": "0.7971416", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "title": "" }, { "docid": "32283a03d6338278f94a2fef7203f031", "score": "0.7971416", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "title": "" }, { "docid": "4192bcf16519e82043fcb96ce6641b67", "score": "0.7961759", "text": "function handleBlurVisible() {\n\t // To detect a tab/window switch, we look for a blur event followed\n\t // rapidly by a visibility change.\n\t // If we don't see a visibility change within 100ms, it's probably a\n\t // regular focus change.\n\t hadFocusVisibleRecently = true;\n\t window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n\t hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n\t hadFocusVisibleRecently = false;\n\t }, 100);\n\t}", "title": "" }, { "docid": "6ef64d7d969060594fdc401a8b1d5790", "score": "0.7800291", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n\n if (typeof document !== 'undefined') {\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n }\n} //$FlowFixMe", "title": "" }, { "docid": "6ef64d7d969060594fdc401a8b1d5790", "score": "0.7800291", "text": "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n\n if (typeof document !== 'undefined') {\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n }\n} //$FlowFixMe", "title": "" }, { "docid": "c7fc183cb46570ead37e81d15386aff3", "score": "0.7550871", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }", "title": "" }, { "docid": "c7fc183cb46570ead37e81d15386aff3", "score": "0.7550871", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }", "title": "" }, { "docid": "c7fc183cb46570ead37e81d15386aff3", "score": "0.7550871", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }", "title": "" }, { "docid": "d9891646277d044cb94110ed4e5fd1e1", "score": "0.75089574", "text": "function blur () { // 18960\n hasFocus = false; // 18961\n if (!noBlur) { // 18962\n ctrl.hidden = shouldHide(); // 18963\n } // 18964\n } // 18965", "title": "" }, { "docid": "70eba0a013d3e1adb5f1659322489e29", "score": "0.75004506", "text": "function checkblurEfect(e) {\n Ti.API.info('blur window');\n focusFlag = false;\n}", "title": "" }, { "docid": "e93fdf565bda8aa5bafba22c8add1e1e", "score": "0.7472184", "text": "blur() {\r\n if (!this.hasFocus) {\r\n return;\r\n }\r\n\r\n const focusedField = Object.values(this.fields).forEach(field => field.hasFocus);\r\n if (focusedField) {\r\n focusedField.blur();\r\n }\r\n }", "title": "" }, { "docid": "9c5ab808b167d9e81f8c4ec047147105", "score": "0.74082", "text": "function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n isFocusVisibleRef.current = false;\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "9c5ab808b167d9e81f8c4ec047147105", "score": "0.74082", "text": "function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n isFocusVisibleRef.current = false;\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "9c5ab808b167d9e81f8c4ec047147105", "score": "0.74082", "text": "function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n isFocusVisibleRef.current = false;\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "11fac19c213581e797e5e651388260e8", "score": "0.74042946", "text": "function ifNotFocusedDoOnBlur() { // was ifNotFocusedAttachFocusListener\n\tif (!isFocused(window)) {\n\t\tattachFocusListener();\n\t}\n}", "title": "" }, { "docid": "fb097568dcbd9c2e35c1a700caa08ad1", "score": "0.7383806", "text": "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "title": "" }, { "docid": "72196d90d10ab8838024367b6a3b47a3", "score": "0.7375744", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) ctrl.hidden = true;\n }", "title": "" }, { "docid": "f60fb6b3cd23c4db8fb29ed0715e2307", "score": "0.73294055", "text": "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "title": "" }, { "docid": "f60fb6b3cd23c4db8fb29ed0715e2307", "score": "0.73294055", "text": "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "title": "" }, { "docid": "f60fb6b3cd23c4db8fb29ed0715e2307", "score": "0.73294055", "text": "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "title": "" }, { "docid": "f60fb6b3cd23c4db8fb29ed0715e2307", "score": "0.73294055", "text": "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "title": "" }, { "docid": "f60fb6b3cd23c4db8fb29ed0715e2307", "score": "0.73294055", "text": "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "title": "" }, { "docid": "a6ff7b5870116d5980bdc18d9d4b1be3", "score": "0.7299643", "text": "function onBlur()\r\n\t{\r\n\t\tisFocused = false;\r\n\t\tbox2d.pauseResume( true );\r\n\t}", "title": "" }, { "docid": "969478fa3e9b230ed10989a63dd2780a", "score": "0.7276994", "text": "function onBlur() {\n console.log('blur');\n }", "title": "" }, { "docid": "7a1dca95bba3c3b26ba8042411507ef4", "score": "0.72733355", "text": "function doBlur(forceBlur){if(forceBlur){noBlur=false;hasFocus=false;}elements.input.blur();}", "title": "" }, { "docid": "01a5e3a35710f1d4eac93c8ec13970fb", "score": "0.72568697", "text": "blur () {\n this.trigger('blur:pre')\n\n this.performBlur()\n\n this.trigger('blur:post')\n }", "title": "" }, { "docid": "b69670fe0b1a09d4457ff5a6b0472d55", "score": "0.72175217", "text": "function blur($event){hasFocus=false;if(!noBlur){ctrl.hidden=shouldHide();evalAttr('ngBlur',{$event:$event});}}", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.72134155", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "1d764b772bca32104f37500469c8e27d", "score": "0.7212096", "text": "canBlur() {\n return this.isFocused();\n }", "title": "" }, { "docid": "7f11efe3c95bfe8a2d0c87671b41a7a7", "score": "0.7208241", "text": "blur() {\n this._blurHostElement();\n }", "title": "" }, { "docid": "7f11efe3c95bfe8a2d0c87671b41a7a7", "score": "0.7208241", "text": "blur() {\n this._blurHostElement();\n }", "title": "" }, { "docid": "121d0508f835671b95b6d4da107cdba5", "score": "0.7206142", "text": "blur() {\n if (!this.focusElement) {\n return;\n }\n this.focusElement.blur();\n this._setFocused(false);\n }", "title": "" }, { "docid": "39f9ee4a2f0baf6cf2ae837361070d4e", "score": "0.71945214", "text": "blur() {\n this.focused = false;\n // Blur the tag list if it is not focused\n if (!this._tagList.focused) {\n this.triggerValidation();\n this._tagList.blur();\n }\n // tslint:disable-next-line: no-unnecessary-type-assertion\n if (this.addOnBlur) {\n this.emitTagEnd();\n }\n this._tagList.stateChanges.next();\n }", "title": "" }, { "docid": "53ed68a27605551f9e92816a34b7664e", "score": "0.71943283", "text": "blur() { this.dispatchEvent(new DOMEvent('blur')); }", "title": "" }, { "docid": "043dcf971ec974c219704e099c52fff9", "score": "0.7170094", "text": "_onBlur() {\n this._focus(0, undefined);\n }", "title": "" }, { "docid": "e00e43f651e3e8f88743df5c1ddcd368", "score": "0.70375794", "text": "blur() {\n this.focusElement.blur();\n\n this._setFocused(false);\n }", "title": "" }, { "docid": "cc7a72bbdec633a0092dd082430e9171", "score": "0.7033553", "text": "_onBlur() {\n this._focused = false;\n if (!this.disabled && !this.panelOpen) {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "cc7a72bbdec633a0092dd082430e9171", "score": "0.7033553", "text": "_onBlur() {\n this._focused = false;\n if (!this.disabled && !this.panelOpen) {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "cc7a72bbdec633a0092dd082430e9171", "score": "0.7033553", "text": "_onBlur() {\n this._focused = false;\n if (!this.disabled && !this.panelOpen) {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "ec7f6f96eb915d01d5e1ba2d8543aa3e", "score": "0.70189077", "text": "blur() {\n super.blur();\n // If (this._mathfield) {\n // // Don't call this._mathfield.focs(): it checks the focus state,\n // // but super.blur() just changed it...\n // this._mathfield.keyboardDelegate.blur();\n // }\n }", "title": "" }, { "docid": "eea85c717665e8409322636b69e06d61", "score": "0.70145565", "text": "function blur(e) {\n\tvar element = this.find(e.element());\n\tif (element != null) {\n\t\telement.removeClassName(this.options.classNames.focus);\n\t\tif (this.isEnabled(element)) {\n\t\t\tthis.fire(this.options.events.blur, element, e);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5f7f24996b2bcba5f231b380c3449cb6", "score": "0.7007195", "text": "function onWindowBlur() {\n var _document = document,\n activeElement = _document.activeElement;\n var instance = activeElement._tippy;\n\n if (activeElement && activeElement.blur && instance && !instance.state.isVisible) {\n activeElement.blur();\n }\n }", "title": "" }, { "docid": "509241db72328b85d0d6dd4c9cd10861", "score": "0.6986984", "text": "handleBlur() {\n this.isFocused = false\n\n this.elem.removeClass('focused')\n\n // Trigger check\n if (this.syncCheck || this.asyncCheck) {\n this.runCheck()\n }\n\n // Trigger Sync\n if (this.sync) {\n this.$timeout(() => this.runSync())\n }\n }", "title": "" }, { "docid": "7790f3c58c6933b90d4644be9da5bf39", "score": "0.6985475", "text": "canBlur() {\n return this.isEnabled()\n && this.isFocused();\n }", "title": "" }, { "docid": "c189d231329e8e617b2d6279c5b0bebb", "score": "0.6966818", "text": "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n }", "title": "" }, { "docid": "284acd84307ed42c26192bac3b181184", "score": "0.69386023", "text": "function blur($event) {\n\t hasFocus = false;\n\t\n\t if (!noBlur) {\n\t ctrl.hidden = shouldHide();\n\t evalAttr('ngBlur', { $event: $event });\n\t }\n\t }", "title": "" }, { "docid": "5c305af2e87c006bea682cf05a67de7e", "score": "0.69293225", "text": "_blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipList.focused) {\n this._chipList._blur();\n }\n this._chipList.stateChanges.next();\n }", "title": "" }, { "docid": "5c305af2e87c006bea682cf05a67de7e", "score": "0.69293225", "text": "_blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipList.focused) {\n this._chipList._blur();\n }\n this._chipList.stateChanges.next();\n }", "title": "" }, { "docid": "5c305af2e87c006bea682cf05a67de7e", "score": "0.69293225", "text": "_blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipList.focused) {\n this._chipList._blur();\n }\n this._chipList.stateChanges.next();\n }", "title": "" }, { "docid": "5c305af2e87c006bea682cf05a67de7e", "score": "0.69293225", "text": "_blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipList.focused) {\n this._chipList._blur();\n }\n this._chipList.stateChanges.next();\n }", "title": "" }, { "docid": "38a64c4bf570a0891bfc3acd33dc7546", "score": "0.6909697", "text": "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "title": "" }, { "docid": "38a64c4bf570a0891bfc3acd33dc7546", "score": "0.6909697", "text": "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "title": "" }, { "docid": "38a64c4bf570a0891bfc3acd33dc7546", "score": "0.6909697", "text": "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "title": "" }, { "docid": "38a64c4bf570a0891bfc3acd33dc7546", "score": "0.6909697", "text": "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "title": "" }, { "docid": "38a64c4bf570a0891bfc3acd33dc7546", "score": "0.6909697", "text": "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "title": "" }, { "docid": "0a5b027c07107b142e00da12160abc0c", "score": "0.6884847", "text": "function blur() {\n vm.inSearch = false;\n vm.onBlur();\n }", "title": "" }, { "docid": "5ccfe8726387a10e524670d46bbd113d", "score": "0.68835825", "text": "function blur($event) {\n hasFocus = false;\n\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n evalAttr('ngBlur', { $event: $event });\n }\n }", "title": "" }, { "docid": "a730afcb33fdadb481face206b41942d", "score": "0.6863401", "text": "function onBlur() {\n console.log(\"blur\");\n\tg_pressedKeys.length = 0;\n}", "title": "" }, { "docid": "961849be86dcf1f10730f05b7e3edb95", "score": "0.6859716", "text": "function onBlurInput() {\n ctrl.inputFocused = false;\n\n if (angular.isFunction(ctrl.itemFocusCallback)) {\n ctrl.itemBlurCallback({inputName: ctrl.inputName});\n }\n\n onCurrentValueChange();\n }", "title": "" }, { "docid": "01414361513514ebb517a8f41ab9abf7", "score": "0.6856378", "text": "blur() {\n if ( this.display ) {\n if ( this.display.focusManager.pdomFocusHighlightsVisibleProperty.hasListener( this.boundInvalidateOverListener ) ) {\n this.display.focusManager.pdomFocusHighlightsVisibleProperty.unlink( this.boundInvalidateOverListener );\n }\n this.display = null;\n }\n\n // On blur, the button should no longer look 'over'.\n this.isFocusedProperty.value = false;\n }", "title": "" }, { "docid": "c15631ab7b02dda5534088367eda91a4", "score": "0.68488115", "text": "blur() {\n const event = DOM.createCustomEvent('blur');\n this.elm.dispatchEvent(event);\n }", "title": "" }, { "docid": "d8cef60a4eff9a50b3458b6bdd0c2c31", "score": "0.68463504", "text": "blur() {\n if (this.canBlur()) {\n // let our listeners know \n if (this.props.onBlur) {\n this.props.onBlur();\n }\n }\n }", "title": "" }, { "docid": "14ba3e6849fdfd4f2c35f0de7c1736d4", "score": "0.6809126", "text": "function blurElement(e)\n{\n\tif(e != null && e.focus && e.blur)\n\t\t{\n\t\te.focus();\n\t\te.blur();\n\t\t}\n}", "title": "" }, { "docid": "a28758d3f8cd3ba7c9f79deeeb47f706", "score": "0.6792578", "text": "onBlur () {\n this.props.childExposedApi.onChildBlur(this.getBlurFocusCallbackInfo())\n }", "title": "" }, { "docid": "384113ccc8a1c1bb9b49157085babf85", "score": "0.67797893", "text": "blur() {\n this._blurredSubject.next();\n }", "title": "" }, { "docid": "e023affb512f6d7b535ba89ba2065126", "score": "0.6772288", "text": "function blurHandler () {\n this.$emit('blur')\n if (this.errorBehavior === 'blur') {\n this.behavioralErrorVisibility = true\n }\n}", "title": "" }, { "docid": "c36d1f9a7a10c20581f450ffbeb59c84", "score": "0.675868", "text": "function blur(p_el) {p_el.blur();}", "title": "" }, { "docid": "fbed75a1b0fe082188a8e8c8d0228e86", "score": "0.6749681", "text": "function onWindowBlur() {\n focuser.blur();\n }", "title": "" }, { "docid": "93193485c709f9af2e1c23db8cc4d6df", "score": "0.6743443", "text": "blur() {\n if (this.canBlur()) {\n const {\n props\n } = this;\n // let our listeners know \n if (props.onBlur) {\n props.onBlur();\n }\n }\n }", "title": "" } ]
28a143fae6a366415d372b51b1d0f64f
v8 likes predictible objects
[ { "docid": "5eda6cb4f4707fa36cbceb42f873714d", "score": "0.0", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}", "title": "" } ]
[ { "docid": "e44d68fedba85467ee8187b87d80fd95", "score": "0.520419", "text": "function like (data, archetype) {\n\t var name;\n\n\t for (name in archetype) {\n\t if (archetype.hasOwnProperty(name)) {\n\t if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n\t return false;\n\t }\n\n\t if (object(data[name]) && like(data[name], archetype[name]) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\n\t return true;\n\t }", "title": "" }, { "docid": "d59c191c48d41f8af82d2164fe2d14db", "score": "0.5126739", "text": "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "d59c191c48d41f8af82d2164fe2d14db", "score": "0.5126739", "text": "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "7ad2a41bbabb0425d62cf15af60bf56c", "score": "0.51048017", "text": "function c(e,t,n,i){a=a||r(26);const o=Object.keys(e),c=o.length;let u,p;for(let r=0;r<c;++r){p=o[r],u=e[p],l(p,s.isPOJO(u)&&Object.keys(u).length&&(!u[i.typeKey]||\"type\"===i.typeKey&&u.type.type)?u:null,t,n,o,i)}}", "title": "" }, { "docid": "fefcc8752e26b0455efde7997e208a16", "score": "0.5085188", "text": "function compareLikes(a,b)\n {\n return b.likes-a.likes\n }", "title": "" }, { "docid": "be21d7deff13297c86cba7432fe50813", "score": "0.5033287", "text": "function likeTweep(tweep) {\n tweep.like = true\n}", "title": "" }, { "docid": "8b096de4fbb3fee31e9ba91dd5c3be6f", "score": "0.50091785", "text": "likeO() {\n return this.like(V3.O);\n }", "title": "" }, { "docid": "1cce4e562f9f11fc5e5cf055298eb37d", "score": "0.49817652", "text": "function gen_mood_plus_object(){\n let a = _.sample(moods)\n let b = _.sample(objects)\n let res = `${a} ${b.toLowerCase()}`\n return (sentiment(res)['comparative'] > 0) ? gen_mood_plus_object(): res\n}", "title": "" }, { "docid": "beb64d1e725b9ad1e6864ff8344e968d", "score": "0.4954237", "text": "function c(e,t,r,o){a=a||n(15);const i=Object.keys(e),c=i.length;let l,p;for(let n=0;n<c;++n){l=e[p=i[n]],u(p,s.isPOJO(l)&&Object.keys(l).length&&(!l[o.typeKey]||\"type\"===o.typeKey&&l.type.type)?l:null,t,r,i,o)}}", "title": "" }, { "docid": "70610530e447574747e5e50f4f65d1c1", "score": "0.49527955", "text": "function a(t,e,r,i){s=s||n(7);const a=Object.keys(t),c=a.length;let l,f;for(let n=0;n<c;++n){l=t[f=a[n]],u(f,o.isPOJO(l)&&Object.keys(l).length&&(!l[i.typeKey]||\"type\"===i.typeKey&&l.type.type)?l:null,e,r,a,i)}}", "title": "" }, { "docid": "dffa87711751cf018f6ed582cd63363f", "score": "0.4951409", "text": "colisioned(object){}", "title": "" }, { "docid": "e275b1052b2a401cfaf5cc22f408dcef", "score": "0.4938278", "text": "function c(e,t,i,r){a=a||n(23);const o=Object.keys(e),c=o.length;let u,p;for(let n=0;n<c;++n){p=o[n],u=e[p],l(p,s.isPOJO(u)&&Object.keys(u).length&&(!u[r.typeKey]||\"type\"===r.typeKey&&u.type.type)?u:null,t,i,o,r)}}", "title": "" }, { "docid": "4512fa65c439eff96588116f2b116912", "score": "0.49319893", "text": "function canFollow(keyword1,keyword2){if(!ts.isAccessibilityModifier(keyword1)){// Assume any other keyword combination is legal.\n// This can be refined in the future if there are more cases we want the classifier to be better at.\nreturn true;}switch(keyword2){case 131/* GetKeyword */:case 142/* SetKeyword */:case 129/* ConstructorKeyword */:case 120/* StaticKeyword */:return true;// Allow things like \"public get\", \"public constructor\" and \"public static\".\ndefault:return false;// Any other keyword following \"public\" is actually an identifier, not a real keyword.\n}}", "title": "" }, { "docid": "de428a6d87daf2f858c63e9d51789fdb", "score": "0.4914879", "text": "function like(liked){\n //pic.liked recibe si e strue o false\n pic.liked=liked;\n //condicion if en una linea donde recibe el parametro like\n //si es verdadero se aumenta 1 si no (:) se resta 1\n pic.likes+= liked ? 1 : -1;\n //la variable newElement recibe todo de la funcion render pic\n var newElement=render(pic);\n //se actualizara la vista del antiguo elemento al nuevo elemento\n yo.update(el,newElement);\n //regresara falso para volver a entrar en la condicion\n return false;\n }", "title": "" }, { "docid": "faa857072fb6545685e9524e1e7e7053", "score": "0.49089268", "text": "function rela_visibility(obj){\n\t\n}", "title": "" }, { "docid": "70adeaa2261ab23d4ca91a8af794897f", "score": "0.4905794", "text": "function describeObject(obj){\n\n}", "title": "" }, { "docid": "6b82b848262c7fd4d0d5b12db07b8391", "score": "0.48714787", "text": "function HijinksProto() {}", "title": "" }, { "docid": "271a58bbe8c72fff344588650455eebb", "score": "0.48360035", "text": "function MangledObject() {}", "title": "" }, { "docid": "cf214fda906797e13279f8e7809d05b5", "score": "0.48247674", "text": "_initAttributes() {\n this.defineNoun(\n {\n name: \"bool\",\n clazz: Boolean,\n allowsArbitraryAttrs: false,\n isPrimitive: true,\n // favor true before false\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return b - a;\n },\n toParamAndValue(aBool) {\n return [null, aBool ? 1 : 0];\n },\n },\n this.NOUN_BOOLEAN\n );\n this.defineNoun(\n {\n name: \"number\",\n clazz: Number,\n allowsArbitraryAttrs: false,\n continuous: true,\n isPrimitive: true,\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a - b;\n },\n toParamAndValue(aNum) {\n return [null, aNum];\n },\n },\n this.NOUN_NUMBER\n );\n this.defineNoun(\n {\n name: \"string\",\n clazz: String,\n allowsArbitraryAttrs: false,\n isPrimitive: true,\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a.localeCompare(b);\n },\n toParamAndValue(aString) {\n return [null, aString];\n },\n },\n this.NOUN_STRING\n );\n this.defineNoun(\n {\n name: \"date\",\n clazz: Date,\n allowsArbitraryAttrs: false,\n continuous: true,\n isPrimitive: true,\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a - b;\n },\n toParamAndValue(aDate) {\n return [null, aDate.valueOf() * 1000];\n },\n },\n this.NOUN_DATE\n );\n this.defineNoun(\n {\n name: \"fulltext\",\n clazz: String,\n allowsArbitraryAttrs: false,\n continuous: false,\n isPrimitive: true,\n comparator(a, b) {\n throw new Error(\"Fulltext nouns are not comparable!\");\n },\n // as noted on NOUN_FULLTEXT, we just pass the string around. it never\n // hits the database, so it's okay.\n toParamAndValue(aString) {\n return [null, aString];\n },\n },\n this.NOUN_FULLTEXT\n );\n\n this.defineNoun(\n {\n name: \"folder\",\n clazz: GlodaFolder,\n allowsArbitraryAttrs: false,\n isPrimitive: false,\n queryHelpers: {\n /**\n * Query for accounts based on the account associated with folders. We\n * walk all of the folders associated with an account and put them in\n * the list of folders that match if gloda would index them. This is\n * unsuitable for producing a persistable constraint since it does not\n * adapt for added/deleted folders. However, it is sufficient for\n * faceting. Also, we don't persist constraints yet.\n *\n * @TODO The long-term solution is to move towards using arithmetic\n * encoding on folder-id's like we use for MIME types and friends.\n */\n Account(aAttrDef, aArguments) {\n let folderValues = [];\n let seenRootFolders = {};\n for (let iArg = 0; iArg < aArguments.length; iArg++) {\n let givenFolder = aArguments[iArg];\n let givenMsgFolder = givenFolder.getXPCOMFolder(\n givenFolder.kActivityFolderOnlyNoData\n );\n let rootFolder = givenMsgFolder.rootFolder;\n\n // skip processing this folder if we have already processed its\n // root folder.\n if (rootFolder.URI in seenRootFolders) {\n continue;\n }\n seenRootFolders[rootFolder.URI] = true;\n\n for (let folder of rootFolder.descendants) {\n let folderFlags = folder.flags;\n\n // Ignore virtual folders, non-mail folders.\n // XXX this is derived from GlodaIndexer's shouldIndexFolder.\n // This should probably just use centralized code or the like.\n if (\n !(folderFlags & Ci.nsMsgFolderFlags.Mail) ||\n folderFlags & Ci.nsMsgFolderFlags.Virtual\n ) {\n continue;\n }\n // we only index local or IMAP folders\n if (\n !(folder instanceof Ci.nsIMsgLocalMailFolder) &&\n !(folder instanceof Ci.nsIMsgImapMailFolder)\n ) {\n continue;\n }\n\n let glodaFolder = Gloda.getFolderForFolder(folder);\n folderValues.push(glodaFolder);\n }\n }\n return this._inConstraintHelper(aAttrDef, folderValues);\n },\n },\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a.name.localeCompare(b.name);\n },\n toParamAndValue(aFolderOrGlodaFolder) {\n if (aFolderOrGlodaFolder instanceof GlodaFolder) {\n return [null, aFolderOrGlodaFolder.id];\n }\n return [null, GlodaDatastore._mapFolder(aFolderOrGlodaFolder).id];\n },\n },\n this.NOUN_FOLDER\n );\n this.defineNoun(\n {\n name: \"account\",\n clazz: GlodaAccount,\n allowsArbitraryAttrs: false,\n isPrimitive: false,\n equals(a, b) {\n if ((a && !b) || (!a && b)) {\n return false;\n }\n if (!a && !b) {\n return true;\n }\n return a.id == b.id;\n },\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a.name.localeCompare(b.name);\n },\n },\n this.NOUN_ACCOUNT\n );\n this.defineNoun(\n {\n name: \"conversation\",\n clazz: GlodaConversation,\n allowsArbitraryAttrs: false,\n isPrimitive: false,\n cache: true,\n cacheCost: 512,\n tableName: \"conversations\",\n attrTableName: \"messageAttributes\",\n attrIDColumnName: \"conversationID\",\n datastore: GlodaDatastore,\n objFromRow: GlodaDatastore._conversationFromRow,\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a.subject.localeCompare(b.subject);\n },\n toParamAndValue(aConversation) {\n if (aConversation instanceof GlodaConversation) {\n return [null, aConversation.id];\n }\n // assume they're just passing the id directly\n return [null, aConversation];\n },\n },\n this.NOUN_CONVERSATION\n );\n this.defineNoun(\n {\n name: \"message\",\n clazz: GlodaMessage,\n allowsArbitraryAttrs: true,\n isPrimitive: false,\n cache: true,\n cacheCost: 2048,\n tableName: \"messages\",\n // we will always have a fulltext row, even for messages where we don't\n // have the body available. this is because we want the subject indexed.\n dbQueryJoinMagic:\n \" INNER JOIN messagesText ON messages.id = messagesText.rowid\",\n attrTableName: \"messageAttributes\",\n attrIDColumnName: \"messageID\",\n datastore: GlodaDatastore,\n objFromRow: GlodaDatastore._messageFromRow,\n dbAttribAdjuster: GlodaDatastore.adjustMessageAttributes,\n dbQueryValidityConstraintSuffix:\n \" AND +deleted = 0 AND +folderID IS NOT NULL AND +messageKey IS NOT NULL\",\n // This is what's used when we have no validity constraints, i.e. we allow\n // for ghost messages, which do not have a row in the messagesText table.\n dbQueryJoinMagicWithNoValidityConstraints:\n \" LEFT JOIN messagesText ON messages.id = messagesText.rowid\",\n objInsert: GlodaDatastore.insertMessage,\n objUpdate: GlodaDatastore.updateMessage,\n toParamAndValue(aMessage) {\n if (aMessage instanceof GlodaMessage) {\n return [null, aMessage.id];\n }\n // assume they're just passing the id directly\n return [null, aMessage];\n },\n },\n this.NOUN_MESSAGE\n );\n this.defineNoun(\n {\n name: \"contact\",\n clazz: GlodaContact,\n allowsArbitraryAttrs: true,\n isPrimitive: false,\n cache: true,\n cacheCost: 128,\n tableName: \"contacts\",\n attrTableName: \"contactAttributes\",\n attrIDColumnName: \"contactID\",\n datastore: GlodaDatastore,\n objFromRow: GlodaDatastore._contactFromRow,\n dbAttribAdjuster: GlodaDatastore.adjustAttributes,\n objInsert: GlodaDatastore.insertContact,\n objUpdate: GlodaDatastore.updateContact,\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a.name.localeCompare(b.name);\n },\n toParamAndValue(aContact) {\n if (aContact instanceof GlodaContact) {\n return [null, aContact.id];\n }\n // assume they're just passing the id directly\n return [null, aContact];\n },\n },\n this.NOUN_CONTACT\n );\n this.defineNoun(\n {\n name: \"identity\",\n clazz: GlodaIdentity,\n allowsArbitraryAttrs: false,\n isPrimitive: false,\n cache: true,\n cacheCost: 128,\n usesUniqueValue: true,\n tableName: \"identities\",\n datastore: GlodaDatastore,\n objFromRow: GlodaDatastore._identityFromRow,\n /**\n * Short string is the contact name, long string includes the identity\n * value too, delimited by a colon. Not tremendously localizable.\n */\n userVisibleString(aIdentity, aLong) {\n if (!aLong) {\n return aIdentity.contact.name;\n }\n if (aIdentity.contact.name == aIdentity.value) {\n return aIdentity.value;\n }\n return aIdentity.contact.name + \" (\" + aIdentity.value + \")\";\n },\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n return a.contact.name.localeCompare(b.contact.name);\n },\n toParamAndValue(aIdentity) {\n if (aIdentity instanceof GlodaIdentity) {\n return [null, aIdentity.id];\n }\n // assume they're just passing the id directly\n return [null, aIdentity];\n },\n },\n this.NOUN_IDENTITY\n );\n this.defineNoun(\n {\n name: \"attachment-infos\",\n clazz: GlodaAttachment,\n allowsArbitraryAttrs: false,\n isPrimitive: false,\n toJSON(x) {\n return [\n x._name,\n x._contentType,\n x._size,\n x._part,\n x._externalUrl,\n x._isExternal,\n ];\n },\n fromJSON(x, aGlodaMessage) {\n let [name, contentType, size, _part, _externalUrl, isExternal] = x;\n return new GlodaAttachment(\n aGlodaMessage,\n name,\n contentType,\n size,\n _part,\n _externalUrl,\n isExternal\n );\n },\n },\n this.NOUN_ATTACHMENT\n );\n\n // parameterized identity is just two identities; we store the first one\n // (whose value set must be very constrainted, like the 'me' identities)\n // as the parameter, the second (which does not need to be constrained)\n // as the value.\n this.defineNoun(\n {\n name: \"parameterized-identity\",\n clazz: null,\n allowsArbitraryAttrs: false,\n comparator(a, b) {\n if (a == null) {\n if (b == null) {\n return 0;\n }\n return 1;\n } else if (b == null) {\n return -1;\n }\n // First sort by the first identity in the tuple\n // Since our general use-case is for the first guy to be \"me\", we only\n // compare the identity value, not the name.\n let fic = a[0].value.localeCompare(b[0].value);\n if (fic) {\n return fic;\n }\n // Next compare the second identity in the tuple, but use the contact\n // this time to be consistent with our identity comparator.\n return a[1].contact.name.localeCompare(b[1].contact.name);\n },\n computeDelta(aCurValues, aOldValues) {\n let oldMap = {};\n for (let tupe of aOldValues) {\n let [originIdentity, targetIdentity] = tupe;\n let targets = oldMap[originIdentity];\n if (targets === undefined) {\n targets = oldMap[originIdentity] = {};\n }\n targets[targetIdentity] = true;\n }\n\n let added = [],\n removed = [];\n for (let tupe of aCurValues) {\n let [originIdentity, targetIdentity] = tupe;\n let targets = oldMap[originIdentity];\n if (targets === undefined || !(targetIdentity in targets)) {\n added.push(tupe);\n } else {\n delete targets[targetIdentity];\n }\n }\n\n for (let originIdentity in oldMap) {\n let targets = oldMap[originIdentity];\n for (let targetIdentity in targets) {\n removed.push([originIdentity, targetIdentity]);\n }\n }\n\n return [added, removed];\n },\n contributeObjDependencies(\n aJsonValues,\n aReferencesByNounID,\n aInverseReferencesByNounID\n ) {\n // nothing to do with a zero-length list\n if (aJsonValues.length == 0) {\n return false;\n }\n\n let nounIdentityDef = Gloda._nounIDToDef[Gloda.NOUN_IDENTITY];\n let references = aReferencesByNounID[nounIdentityDef.id];\n if (references === undefined) {\n references = aReferencesByNounID[nounIdentityDef.id] = {};\n }\n\n for (let tupe of aJsonValues) {\n let [originIdentityID, targetIdentityID] = tupe;\n if (!(originIdentityID in references)) {\n references[originIdentityID] = null;\n }\n if (!(targetIdentityID in references)) {\n references[targetIdentityID] = null;\n }\n }\n\n return true;\n },\n resolveObjDependencies(\n aJsonValues,\n aReferencesByNounID,\n aInverseReferencesByNounID\n ) {\n let references = aReferencesByNounID[Gloda.NOUN_IDENTITY];\n\n let results = [];\n for (let tupe of aJsonValues) {\n let [originIdentityID, targetIdentityID] = tupe;\n results.push([\n references[originIdentityID],\n references[targetIdentityID],\n ]);\n }\n\n return results;\n },\n toJSON(aIdentityTuple) {\n return [aIdentityTuple[0].id, aIdentityTuple[1].id];\n },\n toParamAndValue(aIdentityTuple) {\n return [aIdentityTuple[0].id, aIdentityTuple[1].id];\n },\n },\n this.NOUN_PARAM_IDENTITY\n );\n\n GlodaDatastore.getAllAttributes();\n }", "title": "" }, { "docid": "29b08975510838bc7888ad634d052a2c", "score": "0.48048875", "text": "async function detectLabels(data) {\n\n let labels = await rekognition\n .detectLabels({\n Image: {\n S3Object: {\n Bucket: data.bucket,\n Name: data.key\n }\n }\n })\n .promise()\n\n data.labels = labels\n return Promise.resolve(data)\n}", "title": "" }, { "docid": "c87cb94c6042d76303d54dde074e322e", "score": "0.47502264", "text": "forbiddenForObjectProperties(_o, _className) {\n return { names: [], includeGlobalForbidden: false };\n }", "title": "" }, { "docid": "cd825703d5652efac054182dcb4c8273", "score": "0.4735868", "text": "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver()\r\n ob[SKIPFLAG] = true\r\n def(obj, '__ob__', ob)\r\n // mark as Raw\r\n rawSet.set(obj, true)\r\n return obj\r\n }", "title": "" }, { "docid": "d5b63acc66c7306b3facdd29803a557f", "score": "0.47289026", "text": "function manyTypes() {\n const diverseObject = { name: \"banana\", count: 42, isDelicious: true };\n}", "title": "" }, { "docid": "6b70e3544b148619e71f2763fa9c5a77", "score": "0.4720269", "text": "function V(e){if(null==e)return!1;var t=typeof e;return\"string\"!==t&&(\"number\"!==t&&(!Buffer.isBuffer(e)&&\"ObjectID\"!==e.constructor.name))}", "title": "" }, { "docid": "e324eac3423aa7d9c6e500da25ccf57a", "score": "0.47074774", "text": "function Vegetable(){\r\n\t// defines the object\r\n}", "title": "" }, { "docid": "aaea85704a8e5a41248ab13f8aae64b9", "score": "0.46670786", "text": "function sup_likes() {\n\tinit();\n\tsuppression_likes(environnement.clef);\n}", "title": "" }, { "docid": "a016e59c895ec8c14f6abe1a99193d3d", "score": "0.46457234", "text": "function like(){\n likeTweets.likeTweets();\n}", "title": "" }, { "docid": "694f990ed796c0c5d325552fea2d7098", "score": "0.46377194", "text": "function Y8(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "title": "" }, { "docid": "e92f4836aa5dc7f32709e4f6fee3b835", "score": "0.4628666", "text": "function Pokemon(obj) {\n this.name = obj.name;\n}", "title": "" }, { "docid": "5380ca1e497768547ce6c6d7703bbcdd", "score": "0.46175486", "text": "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach((function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)}))}", "title": "" }, { "docid": "45eedeaae84e4671eef6f9cb38136754", "score": "0.46086934", "text": "function likes(names) {\n if (typeof names === \"object\"){\n if (names.length === 0){\n return \"no one likes this\";\n }\n else if (names.length === 1){\n return `${names[0]} likes this`\n }\n else if (names.length === 2){\n return `${names[0]} and ${names[1]} like this`\n }\n else if (names.length === 3){\n return `${names[0]}, ${names[1]} and ${names[2]} like this`\n }\n else if (names.length >= 4){\n return `${names[0]}, ${names[1]} and ${names.length - 2} others like this`\n }\n }\n else {\n return \"Sorry, arrays only!\"\n }\n }", "title": "" }, { "docid": "1eeea3d928de79ef588fc81e908fae80", "score": "0.4604945", "text": "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob[SKIPFLAG] = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n }", "title": "" }, { "docid": "c397afea78c346f617a2f7f6aa34ed72", "score": "0.4584006", "text": "function t(n){const o={};for(const e in n){if(\"declaredClass\"===e)continue;const r=n[e];if(null!=r&&\"function\"!=typeof r)if(Array.isArray(r)){o[e]=[];for(let n=0;n<r.length;n++)o[e][n]=t(r[n])}else\"object\"==typeof r?r.toJSON&&(o[e]=JSON.stringify(r)):o[e]=r}return o}", "title": "" }, { "docid": "240d9f625197f082c60b1ff8f34a34d9", "score": "0.457647", "text": "function classifyVideo() {\n classifier.predict(gotResult);\n}", "title": "" }, { "docid": "1ec4017f3edcf45e0743b15ae04dff8d", "score": "0.45762423", "text": "function classifyVideo(){\r\n classifier.classify(gotResult);\r\n}", "title": "" }, { "docid": "58a86b89f575576d89a4834f6029c512", "score": "0.45732525", "text": "function censor(censor) {\n\tvar i = 0;\n\treturn function(key, value) {\n\t\tif (i !== 0 && typeof(censor) === 'object' && typeof(value) == 'object' && censor == value)\n\t\t\treturn '[Circular]';\n\t\tif (i >= 29)\n\t\t\treturn '[Unknown]';\n\t\t++i;\n\t\treturn value;\n\t}\n}", "title": "" }, { "docid": "cbff7cdd1945e8107a8631f0eff02e2f", "score": "0.45664838", "text": "function MethodsToWorkWithObjects() {}", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.45661232", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.45661232", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "7c845f7cf4f6cab8061107cfdf0c231c", "score": "0.45642543", "text": "function e(e,t,a){let c,d;return void 0===t||Array.isArray(t)?(d=e,a=t,c=[void 0]):(d=t,c=Array.isArray(e)?e:[e]),(e,t)=>{const s=e.constructor.prototype;c.forEach((c=>{const p=Object(_property_js__WEBPACK_IMPORTED_MODULE_1__[\"propertyJSONMeta\"])(e,c,d);p.read&&\"object\"!=typeof p.read&&(p.read={}),Object(_object_js__WEBPACK_IMPORTED_MODULE_0__[\"setDeepValue\"])(\"read.reader\",s[t],p),a&&(p.read.source=(p.read.source||[]).concat(a))}))}}", "title": "" }, { "docid": "055cc9d1fea7c6bcd2b7cf03b6542b21", "score": "0.4553553", "text": "function bufferMyLikes(){\r\n\t\tif(that.mode ===\"findWhoILike\")\r\n\t\t\tlikesBuff = likesBuff+10;\r\n\t\tfor(var i = 0; i< that.myLikes.length; i++){\r\n\t\t\tif(i > likesBuff )\r\n\t\t\t\treturn;\r\n\t\t\tif(that.myLikes[i].refs === undefined){\r\n\t\t\t\tthat.myLikes[i].refs = null;\r\n\t\t\t\tR.request('getVideoRefs',{FromFbId:that.myLikes[i].FbId,Type:\"findWhoILike\"});\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6c3d770960b547c9026849fb103aaae0", "score": "0.4549761", "text": "static flag() { return new NodeProp({ deserialize: () => true }); }", "title": "" }, { "docid": "bbc0f8e4f45d03cf3a3164dd28708144", "score": "0.4549233", "text": "likeClass() {\n if (this.props.place.liked) {\n return \"liked\"\n }\n return \"\"\n }", "title": "" }, { "docid": "c6a89ba9e7145190c611cd3200ce6b60", "score": "0.4547224", "text": "toJSON() {\n return this.probs;\n }", "title": "" }, { "docid": "dd13b930180a537ac5ad99d5730eed38", "score": "0.4546025", "text": "async function predict() {\n const prediction = await model.predict(video);\n for (let i = 0; i < maxPredictions; i++) {\n const classPrediction =\n prediction[i].className + \": \" + prediction[i].probability.toFixed(2);\n labelContainer.childNodes[i].innerHTML = classPrediction;\n console.log(classPrediction);\n }\n }", "title": "" }, { "docid": "5337bbcb4a58790f65408504e9548605", "score": "0.45421177", "text": "function Boy(name, age, likes_music){\n this.name = name\n this.age = age\n this.likes_music = likes_music\n }", "title": "" }, { "docid": "733c6788f03af5f2bb2d33619ad53366", "score": "0.45384997", "text": "annotate(message:string, data:Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "title": "" }, { "docid": "3e90f5c1744aafa58910f85fd15903bb", "score": "0.45362744", "text": "getOptimisticResponse() {\n return {\n quote: {\n id: this.props.quote.id,\n likesCount: this.props.quote.likesCount + 1\n }\n }\n }", "title": "" }, { "docid": "e9f3aae1045ff448a7e66d4a178dce3b", "score": "0.45185566", "text": "function ya(e){return!0===ga(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "title": "" }, { "docid": "fbfdcc88c18881e112cf30a7e5ad05ef", "score": "0.4515948", "text": "function classifyVideo() {\r\n classifier.classify(gotResult);\r\n}", "title": "" }, { "docid": "a9b0b8e03a6868cb7768bc7d6288e499", "score": "0.4469718", "text": "static initialize(obj, sensitive) { \n obj['sensitive'] = sensitive;\n }", "title": "" }, { "docid": "3d5b3cc65677b56f3bd06fa113ce099e", "score": "0.4461626", "text": "function Obj(){ return Literal.apply(this,arguments) }", "title": "" }, { "docid": "5c33d0f3dba81f8fb1c32f07c9ea2645", "score": "0.4459745", "text": "function wrapJavaObject(thing) {\n\n // HAT Java model object wrapper. Handles all cases \n // (instance, object/primitive array and Class objects)\t\n function javaObject(jobject) {\t\t\n // FIXME: Do I need this? or can I assume that these would\n // have been resolved already?\n if (jobject instanceof hatPkg.model.JavaObjectRef) {\n jobject = jobject.dereference();\n if (jobject instanceof hatPkg.model.HackJavaValue) {\n print(jobject);\n return null;\n }\n }\n\n if (jobject instanceof hatPkg.model.JavaObject) {\n return new JavaObjectWrapper(jobject);\n } else if (jobject instanceof hatPkg.model.JavaClass) {\n return new JavaClassWrapper(jobject);\n } else if (jobject instanceof hatPkg.model.JavaObjectArray) {\n return new JavaObjectArrayWrapper(jobject);\n } else if (jobject instanceof hatPkg.model.JavaValueArray) {\n return new JavaValueArrayWrapper(jobject);\n } else {\n print(\"unknown heap object type: \" + jobject.getClass());\n return jobject;\n }\n }\n \n // returns wrapper for Java instances\n function JavaObjectWrapper(instance) {\n var things = instance.fields;\n var fields = instance.clazz.fieldsForInstance;\n \t\t\n // instance fields can be accessed in natural syntax\n return new JSAdapter() {\n __getIds__ : function() {\n var res = new Array(fields.length);\n for (var i in fields) {\n res[i] = fields[i].name;\n }\n return res;\n },\n __has__ : function(name) {\n for (var i in fields) {\n if (name == fields[i].name) return true;\n }\n return name == 'class' || name == 'toString' ||\n name == 'wrapped-object';\n },\n __get__ : function(name) {\n \n for (var i in fields) {\n if(fields[i].name == name) {\n return wrapJavaValue(things[i]);\n }\n }\n \n if (name == 'class') {\n return wrapJavaValue(instance.clazz);\n } else if (name == 'wrapped-object') {\n return instance;\n } \n \n return undefined;\n },\n __call__: function(name) {\n if (name == 'toString') {\n return instance.toString();\n } else {\n return undefined;\n }\n } \n }\t\t\t\t\n }\n\n\n // return wrapper for Java Class objects\n function JavaClassWrapper(jclass) {\t\n var fields = jclass.statics;\n \n // to access static fields of given Class cl, use \n // cl.statics.<static-field-name> syntax\n this.statics = new JSAdapter() {\n __getIds__ : function() {\n var res = new Array(fields.length);\n for (var i in fields) {\n res[i] = fields[i].field.name;\n }\n return res;\n },\n __has__ : function(name) {\n for (var i in fields) {\n if (name == fields[i].field.name) {\n return true;\n }\t\t\t\t\t\n }\n return false;\n },\n __get__ : function(name) {\n for (var i in fields) {\n if (name == fields[i].field.name) {\n return wrapJavaValue(fields[i].value);\t\n }\t\t\t\t\t\n }\n return undefined;\n }\n }\n \t\t\n if (jclass.superclass != null) {\n this.superclass = wrapJavaValue(jclass.superclass);\n } else {\n this.superclass = null;\n }\n\n this.loader = wrapJavaValue(jclass.getLoader());\n this.signers = wrapJavaValue(jclass.getSigners());\n this.protectionDomain = wrapJavaValue(jclass.getProtectionDomain());\n this.instanceSize = jclass.instanceSize;\n this.name = jclass.name; \n this.fields = jclass.fields;\n this['wrapped-object'] = jclass;\n }\n\n for (var i in theJavaClassProto) {\n if (typeof theJavaClassProto[i] == 'function') {\n JavaClassWrapper.prototype[i] = theJavaClassProto[i];\n }\n }\n \n // returns wrapper for Java object arrays\n function JavaObjectArrayWrapper(array) {\n var elements = array.elements;\n // array elements can be accessed in natural syntax\n // also, 'length' property is supported.\n return new JSAdapter() {\n __getIds__ : function() {\n var res = new Array(elements.length);\n for (var i = 0; i < elements.length; i++) {\n res[i] = String(i);\n }\n return res;\n },\n __has__: function(name) {\n return (name >= 0 && name < elements.length) ||\n name == 'length' || name == 'class' ||\n name == 'toString' || name == 'wrapped-object';\n },\n __get__ : function(name) {\n if (name >= 0 && name < elements.length) {\n return wrapJavaValue(elements[name]);\n } else if (name == 'length') {\n return elements.length;\n } else if (name == 'class') {\n return wrapJavaValue(array.clazz);\n } else if (name == 'wrapped-object') {\n return array;\n } else {\n return undefined;\n }\t\t\t\t\n },\n __call__: function(name) {\n if (name == 'toString') {\n return array.toString();\n } else {\n return undefined;\n }\n } \n }\t\t\t\n }\n \n // returns wrapper for Java primitive arrays\n function JavaValueArrayWrapper(array) {\n var type = String(java.lang.Character.toString(array.elementType));\n var elements = array.elements;\n // array elements can be accessed in natural syntax\n // also, 'length' property is supported.\n return new JSAdapter() {\n __getIds__ : function() {\n var r = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n r[i] = String(i);\n }\n return r;\n },\n __has__: function(name) {\n return (name >= 0 && name < array.length) ||\n name == 'length' || name == 'class' ||\n name == 'toString' || name == 'wrapped-object';\n },\n __get__: function(name) {\n if (name >= 0 && name < array.length) {\n return elements[name];\n }\n \n if (name == 'length') {\n return array.length;\n } else if (name == 'wrapped-object') {\n return array;\n } else if (name == 'class') {\n return wrapJavaValue(array.clazz);\n } else {\n return undefined;\n }\n },\n __call__: function(name) {\n if (name == 'toString') {\n return array.valueString(true);\n } else {\n return undefined;\n }\n } \n }\n }\n return javaObject(thing);\n}", "title": "" }, { "docid": "c236db0281886a30d819853b1e11052a", "score": "0.44580987", "text": "function tweeter(object){\n var a = object.age;\n if (a >= 18){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "bdba4bc8685e96dc7fa3b27405bf7a57", "score": "0.4456893", "text": "function classify() {\n classifier.classify(video,gotResults);\n}", "title": "" }, { "docid": "ad2e7b83d11731cb55bbdda52c29aa98", "score": "0.4456764", "text": "is_unused_fallback_object() {\n let parent = this.parentNode;\n let element = lookup_element(\"ruffle-object\");\n\n if (element !== null) {\n do {\n if (parent.nodeName === element.name) {\n return true;\n }\n\n parent = parent.parentNode;\n } while (parent != document);\n }\n\n return false;\n }", "title": "" }, { "docid": "add8cc1722c28afc1902832cd73ae7f1", "score": "0.44561088", "text": "function k(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "title": "" }, { "docid": "84a180d0376c60366efd386877b2414e", "score": "0.44528657", "text": "function favoriteBook() {\n return { \"title\": \"The Guards\", \"author\": \"Ken Bruen\" };\n}", "title": "" }, { "docid": "62518d3317dda2f4191b7b5953902f93", "score": "0.44485876", "text": "function snowWhite(obj) {\n return freeze(whitelistAll(obj));\n }", "title": "" }, { "docid": "10bc3235c25321fddbe1b730909b7655", "score": "0.44476855", "text": "function Kitties(obj){\n this.name=obj.name;\n this.sweetlittletoebeans=obj.sweetlittletoebeans;\n }", "title": "" }, { "docid": "499457135fee666987e85364fbcfc360", "score": "0.4446745", "text": "function classifyVideo() {\n classifier.classify(gotResult);\n}", "title": "" }, { "docid": "499457135fee666987e85364fbcfc360", "score": "0.4446745", "text": "function classifyVideo() {\n classifier.classify(gotResult);\n}", "title": "" }, { "docid": "8046767d6f12d538c984b7fd3e8491ab", "score": "0.44463736", "text": "function verifyJSONForVisjsNodes( returnedObject ) {\n var returnedNodes = returnedObject.nodes;\n if(returnedNodes[0]!==null&&(!_.has(returnedNodes[0], \"id\"))) {\n for(var iterator = 0; iterator<returnedNodes.length; iterator++) {\n returnedNodes[iterator].id = iterator;\n returnedNodes[iterator].label = returnedNodes[iterator].value; //This will write out the nodes label.\n returnedNodes[iterator].title = returnedNodes[iterator].type; //Titles are on mouse-over.\n //returnedNodes[iterator].group = returnedNodes[iterator].type;\n\t returnedNodes[iterator].group = setGroup(returnedNodes[iterator]);\n }\n }\n\n return returnedNodes;\n}", "title": "" }, { "docid": "578ed3e8d45de18d9b75e82892f660fc", "score": "0.44348916", "text": "function use_vuln(o) {\n\tlet a = o.y;\n\tObject.create(o);\n\tval = o.p21.x1;\n\treturn val;\n}", "title": "" }, { "docid": "3732f678cfec64b9daaaad016f6d80e5", "score": "0.44284958", "text": "function Lodsafe() {\n\n Resa.call(this);\n var _this = this;\n this.geocoder = new Geocoder();\n\n this.watchList.countries = {};\n this.watchList.mapdata = [];\n this.watchList.related_entities = {};\n\n /**\n * Instantiate extension parameters\n * @function initParams\n * @override\n */\n this.initParams = function (){\n /**\n * @property {object} params - Extension parameters / properties\n * @property {string} params.name - Extension name\n * @property {string} params.strict - Location settings mode\n * @property {object} params.visualizations - Extension visualizations\n * @property {string} params.visualizations.name - Extension visualizations name\n * @property {string} params.visualizations.title - Extension visualizations title\n */\n this.params = {\n name : 'lodsafe',\n strict : true,\n visualizations : [\n {'name': 'bubblecloud', 'title': 'Entities Bubble Cloud'},\n {'name': 'lodsafe-facet', 'title': 'Location Facet'},\n {'name': 'map', 'title': 'Tweet Map'}\n ]\n };\n };\n\n /**\n * Handle Annotated Tweet Callback\n * @override\n * @function annotateCallback\n * @param tweet {object} - Tweet Object\n * @param output {object} - Dbpedia Response\n */\n this.annotateCallback = function (tweet, output) {\n var resources = output.response.Resources;\n if (resources !== undefined) {\n _.each(resources, function (resource) {\n //do not count search keywords\n if (!_.contains(_this.watchList.search_for, resource['@surfaceForm'])) {\n _this.updateWatchListSymbol();\n _this.annotateTweetTextWithResource(resource, tweet);\n _this.updateEntityBubblecloudData(resource, tweet, resources);\n }\n });\n _this.updateWatchListTweet(tweet);\n _this.updateViewData(tweet);\n }\n\n };\n\n this.customPostEmit = function () {\n this.watchList.countries = {};\n this.watchList.geocoordinates = [];\n };\n\n /**\n * Check if property is guarded/protected\n * @override\n * @function isGuarded\n * @param key {string} - Guarded property\n * @returns {boolean}\n */\n this.isGuarded = function (key) {\n return _.contains(this.guarded, key);\n };\n\n /**\n * Check if tweet has a text and location\n * @override\n * @function isValidTweet\n * @param tweet {object} - Tweet Object\n * @returns {boolean}\n */\n this.isValidTweet = function (tweet) {\n\n if(!this.params.strict)\n return tweet.text !== undefined;\n\n return (tweet.text !== undefined && tweet.place !== null);\n };\n\n this.updateViewData = function (tweet) {\n this.updateCountryFacetData(tweet);\n this.updateMapData(tweet);\n };\n\n /**\n * @function updateEntityBubblecloudData\n * @param resource {object} - Dbpedia Resource\n * @param tweet {object} - Tweet Object\n * @param resources\n */\n this.updateEntityBubblecloudData = function (resource, tweet, resources) {\n if (this.watchList.symbols[resource['@surfaceForm']] == undefined) {\n this.watchList.symbols[resource['@surfaceForm']] = {\n count: 1,\n type: this.getEntityType(resource['@types']),\n uri: resource['@URI'],\n tweet_from: [this.getTweetCountryCode(tweet)]\n };\n } else {\n this.watchList.symbols[resource['@surfaceForm']].tweet_from.push(this.getTweetCountryCode(tweet));\n this.watchList.symbols[resource['@surfaceForm']].count++;\n //Increment total\n this.watchList.total++;\n //limit for demo\n if (Object.keys(this.watchList.symbols).length > 400) {\n this.pause_streaming = 1;\n }\n }\n this.updateRelatedEntities(resource, resources);\n };\n\n this.updateRelatedEntities = function(resource, resources){\n\n var type = this.getEntityType(resource['@types']);\n if( type == 'Place' || type == 'Country' || type == 'City') {\n\n if (this.watchList.related_entities[resource['@surfaceForm']] == undefined) {\n this.watchList.related_entities[resource['@surfaceForm']] = [];\n }\n\n this.addRelatedEntity(resource['@surfaceForm'], resources);\n\n }\n\n };\n\n this.addRelatedEntity = function(key, resources){\n if (resources !== undefined) {\n var location = this.watchList.related_entities[key];\n _.each(resources, function (resource) {\n if(!_.contains(location, resource['@surfaceForm'])){\n _this.watchList.related_entities[key].push(resource['@surfaceForm']);\n }\n });\n }\n };\n\n /**\n * Update Country Facet Data\n * @function updateCountryFacetData\n * @param tweet {object} - Tweet Object\n */\n this.updateCountryFacetData = function (tweet) {\n\n var countryCode = this.getTweetCountryCode(tweet);\n\n if (this.watchList.countries[countryCode] == undefined) {\n this.watchList.countries[countryCode] = {\n tweet: tweet.text,\n count: 1,\n city: this.getTweetCity(tweet),\n country: this.getTweetCountry(tweet)\n };\n } else {\n this.watchList.countries[countryCode].count++;\n }\n };\n\n this.updateMapData = function (tweet) {\n this.watchList.mapdata.push({\n 'text' : tweet.text,\n 'coordinate' : this.getTweetGeoCoordinates(this.getTweetFullPlace(tweet))\n });\n };\n\n /**\n * Update Object WatchList Symbol\n * @override\n * @function updateWatchListSymbol\n */\n this.updateWatchListSymbol = function () {\n this.updateWatchListTotal();\n this.limitForDemo();\n };\n\n /**\n * Update Object WatchList Tweet\n * @override\n * @function updateWatchListTweet\n * @param tweet {object} - Tweet Object\n */\n this.updateWatchListTweet = function (tweet) {\n this.watchList.tweets_no++;\n this.watchList.recent_tweets.push({text: tweet.text, date: tweet.created_at, location: this.getTweetCountry(tweet)});\n };\n\n /**\n * Get geo-coordinate using Google's geocoder service.\n * @param address\n * @returns {array} - Longitude and Latitude pair\n */\n this.getTweetGeoCoordinates = function(address) {\n return this.geocoder.getGeoCode(address);\n };\n\n /**\n * Get country of tweet\n * @function getTweetCountry\n * @param tweet {object} - Tweet Object\n * @returns {string}\n */\n this.getTweetCountry = function (tweet){\n return tweet.place != null ? tweet.place.country : 'N/A';\n };\n\n /**\n * Get country code of tweet\n * @function getTweetCountryCode\n * @default [null]\n * @param tweet {object} - Tweet Object\n * @returns {string}\n */\n this.getTweetCountryCode = function(tweet) {\n return tweet.place !== null ? tweet.place.country_code : 'N/A';\n };\n\n /**\n * Get tweet city\n * @function getTweetCity\n * @default [null]\n * @param tweet {object} - Tweet Object\n * @returns {string}\n */\n this.getTweetCity = function(tweet) {\n return tweet.place.place_type == \"city\" ? this.getTweetFullPlace(tweet) : 'N/A';\n };\n\n this.getTweetFullPlace = function (tweet) {\n return tweet.place.full_name;\n };\n\n}", "title": "" }, { "docid": "1c9286d6a947763f8faa24c014bdd408", "score": "0.4420055", "text": "watch(t) {\n const e = {};\n e.database = this.serializer.yn, e.addTarget = this.serializer.qe(t);\n const s = this.serializer.ei(t);\n s && (e.labels = s), this.Eu(e);\n }", "title": "" }, { "docid": "743467ce0f804d94ab48a7d053583828", "score": "0.44180506", "text": "function like(id, doLike) {\n if (!id) return undefined;\n var body = ((typeof doLike == 'undefined') || (doLike.toString() === \"true\")) ? \"true\" : \"false\";\n \n return {method:'PUT', \n path:\"people/~/network/updates/key=\" + id + \"/is-liked\", \n body: body,\n headers:{\"x-li-format\":\"json\", \"Content-Type\":\"application/json;charset=UTF-8\"},\n resource:UPDATE_RESOURCE};\n}", "title": "" }, { "docid": "6c916d2e738ec96544d9c620af203ab6", "score": "0.4417518", "text": "async function like_and_dislike(element) {\r\n await fetch(`/like/${element.dataset.id}`)\r\n .then(response => response.json())\r\n .then(data => {\r\n element.className = data.css_class;\r\n element.querySelector('small').innerHTML = data.total_likes;\r\n });\r\n }", "title": "" }, { "docid": "89d875416c678f7e6a6b521338444221", "score": "0.44164836", "text": "async function predict() {\n // predict can take in an image, video or canvas html element\n let image = document.querySelector(\"#face-image\")\n const prediction = await model.predict(image, false);\n prediction.sort((a,b) => parseFloat(b.probability) - parseFloat(a.probability));\n let resultTitle, resultExplain, resultCause;\n\n switch(prediction[0].className) {\n case \"기쁨\" :\n resultTitle = \"행복한 레몬\"\n resultExplain = \"#웃음꽃 #과즙미 뿜뿜 #상큼함이 폭발 #행복전도사\"\n resultCause = \"명랑하고 자신감이 넘쳐있는 당신! 광대가 올라가 있고 입술 모서리는 올라가 있군요! 너무 행복하고 상큼해 보입니다. 지켜만 보고 있어도 웃음이 날 것 같은 표정이에요. 행복하면서도 들떠 있을 만큼 좋은 일이 있으셨나요? 만약 아니더라도 곧 좋은 일이 찾아올 것 같은 얼굴입니다. 주변 사람들에게 이 사진을 은근 슬쩍 보여주면 호감이 급상승 할 것 같은 예감!\"\n break;\n\n case \"까칠\" :\n resultTitle = \"까칠한 키위\"\n resultExplain = \"#시크절정 #아무도 건들지마 #도도한 매력\"\n resultCause = \"시크한 표정을 가지고 있는 당신! 한 쪽 얼굴이 올라가면서 입술의 끝이 당겨져있습니다. 오늘 도도하다는 말을 듣진 않았나요? 아이러니하게도 도도하고 시크한 표정을 짓고 있으면 외모가 업이 됩니다. 기분은 그렇다치고 오늘 셀카를 찍어보는 건 어떨까요? 그리고 일이나 주변 사람들 때문에 스트레스를 받고 있다면 반신욕으로 기분을 달래보는 건 어떨까요? \"\n break;\n\n case \"놀람\" :\n resultTitle = \"놀란 오렌지\"\n resultExplain = \"#리액션천국 #(ノ'□゚) #다이나믹한 하루 #오늘 일이 많지? \"\n resultCause = \"놀란 표정을 가지고 있는 당신! 눈썹 높이가 올라가고 동그란 모양으로 변하며 턱이 벌어졌습니다. 오늘 무슨 일이 그렇게 많았길래 놀란 표정을 하고 있나요? 아니면 컨셉으로 놀란 모습을?? 오늘이 다이나믹한 하루였다면 집에서 치킨 시켜놓고 잔잔한 영화를 보면서 힐링하는 건 어떨까요?\"\n break;\n\n case \"분노\" :\n resultTitle = \"짜증난 딸기\"\n resultExplain = \"#건들기만 해봐 #폭발한다!!!! #다 죽는다!!!!!!!!\"\n resultCause = \"분노한 표정을 가지고 있는 당신.. 눈썹 높이가 낮고 아랫눈꺼풀이 팽팽하며 시선이 확고할수록 화난 것 처럼 보입니다. 오늘 누가 당신을 그렇게 짜증나게 만들었나요? 딱 데려오세요! 화가 나는 만큼 에너지를 쓰는 것도 좋아요! 달리기나 스포츠 같은 활동적인 활동으로 스트레스를 푸는 건 어떨까요? 스트레스를 풀수록 표정도 밝아진답니다.\"\n break;\n\n case \"소심\" :\n resultTitle = \"소심한 포도\"\n resultExplain = \"#이거 뭐지..? #뭘까....? #응.....? #으잉....?\"\n resultCause = \"소심한 표정을 가지고 있는 당신! 눈썹 높이가 높아지고 입술이 가늘어졌군요. 나도 모르게 의기소침해지지 않나요? 평소와 다르게 괜히 말도 조심하게 되고 음추러 들진 않나요? 그렇다면 코인 노래방에서 노래 한 곡 뽑는 건 어떤가요?\"\n break;\n\n case \"슬픔\" :\n resultTitle = \"슬픈 블루베리\"\n resultExplain = \"#나는 아무 생각이 없다 #왜냐면 아무 생각이 없기 때문이다\" \n resultCause = \"무표정 또는 슬픈 표정을 가지고 있는 당신! 눈 바깥쪽이 아래로 비스듬이 기울어졌군요. 오늘은 크게 즐겁지도 그렇다고 나쁘지도 않은 하루를 보냈나요? 미지근한 물이 잔잔하게 흐르듯 평범한 표정이지만 가장 일상적이고 보람찬 표정입니다. 아니면 도도한 표정 컨셉으로 찍은 사진일수도 있구요. 만약 슬픈 일이 있었나요? 걱정마세요. 다 잘 풀릴 겁니다! 그러니 집에서 반신욕으로 스트레스를 날려버려요. \"\n break;\n\n default:\n resultTitle = \"존재하지 않음\"\n resultExplain = \"존재하지 않음\"\n resultCause = \"존재하지 않은 건 흔치 않은데...? 다른 사진으로 도전 해보세요!\"\n break;\n }\n console.log(prediction)\n let title = `<div class= '${prediction[0].className}-feeling-title'> ${resultTitle}</div>`;\n let explain = `<div class='${prediction[0].className}-explain'> ${resultExplain}</div>`;\n let cause = `<div class ='${prediction[0].className}-cause'> ${resultCause}</dlv>`;\n \n \n $('.push-result').html(title + explain + cause);\n let barWidth;\n for (let i = 0; i < maxPredictions; i++) {\n if(prediction[i].probability.toFixed(2) > 0.1) {\n barWidth = Math.round(prediction[i].probability.toFixed(2) * 100) + \"%\";\n } else if (prediction[i].probability.toFixed(2) >= 0.01) {\n barWidth = \"4%\"\n }else {\n barWidth= \"2%\"\n }\n\n let labelTitle;\n switch (prediction[i].className) { \n case \"기쁨\":\n labelTitle = \"기쁨\"\n break;\n\n case \"까칠\":\n labelTitle = \"까칠\"\n break;\n\n case \"놀람\":\n labelTitle = \"놀람\"\n break;\n\n case \"분노\":\n labelTitle = \"분노\"\n break;\n\n case \"소심\":\n labelTitle = \"소심\"\n break;\n\n case \"슬픔\":\n labelTitle = \"슬픔\"\n break;\n\n default:\n labelTitle = \"존재하지 않음\"\n break;\n }\n console.log(barWidth);\n let label = `<div class ='feeling-label'> ${labelTitle} </div>`\n let bar = `<div class ='bar-container'><div class='${prediction[i].className}-box'><div class='align-center ${prediction[i].className}-bar' style='width:${barWidth}'><span class ='percent-text'>${Math.round(prediction[i].probability.toFixed(2) * 100)}%</span></div></div>`;\n labelContainer.childNodes[i].innerHTML = label + bar;\n\n \n }\n\n }", "title": "" }, { "docid": "c0d938718aaab6bbac58d2d2182a331f", "score": "0.44134596", "text": "hello(){\n\t\t\tvar b= [1,2,3];\n\n\t\t\t// {\n\t\t\tvar obj = {\n\t\t\t\t\"fn\" : function(){\n\t\t\t\t\tvar kk = {b};\n\t\t\t\t},\n\t\t\t\t[\"a\" + \"b\"] : function(){},\n\t\t\t\tget [\"i\" + \"o\"](){return b[0];},\n\t\t\t\tset [\"io\"](value){ b[0] = value; },\n\t\t\t\tb,\n\t\t\t\t[\"p\"](){},\n\t\t\t\tgeta (){},\n\t\t\t\tset a (value){\n\t\t\t\t\tif(\n\t\t\t\t\t\ttrue\t\n\t\t\t\t\t){\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"cc\"(){},\n\t\t\t\tbb : {\n\t\t\t\t\t\tx : { b, z : {b} },\n\t\t\t\t\t\tCar : Car\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tconsole.log(\"对象测试\", obj);\n\t\t}", "title": "" }, { "docid": "f9089f335bbc4643c07a48bd046c14f5", "score": "0.4407968", "text": "function checkMetaConsistency(core, node) {\n var metaNodes = core.getAllMetaNodes(node),\n names = {},\n result = [],\n isPointer,\n i,\n key,\n path,\n metaNode,\n metaName,\n setNames,\n pointerNames,\n aspectNames,\n childPaths,\n ownMetaJson;\n\n function isTypeOfAny(node, paths) {\n var i,\n metaNode;\n\n for (i = 0; i < paths.length; i += 1) {\n metaNode = metaNodes[paths[i]];\n if (metaNode && core.isTypeOf(node, metaNode)) {\n return true;\n }\n }\n\n return false;\n }\n\n function getUnderScoreError(metaName, path, key, type) {\n return {\n severity: 'error',\n message: metaName + ' defines ' + type + ' [' + key + '] starting with an underscore (\"_\").',\n description: 'Such relations/properties in the models are considered private and can ' +\n 'collied with reserved properties.',\n hint: 'Remove/rename it.',\n path: path,\n relatedPaths: []\n };\n }\n\n function getReservedNameError(metaName, path, key, type) {\n return {\n severity: 'error',\n message: metaName + ' defines ' + type + ' [' + key + '] which is a reserved name.',\n description: 'Such relations/properties in the models can lead to collisions resulting in unexpected' +\n ' behavior.',\n hint: 'Remove/rename it.',\n path: path,\n relatedPaths: []\n };\n }\n\n function getMixinError(mixinError) {\n return {\n severity: mixinError.severity,\n message: mixinError.message,\n description: 'Mixin violations makes it hard to see which definition is used.',\n hint: mixinError.hint,\n path: path,\n relatedPaths: mixinError.collisionPaths || []\n };\n }\n\n for (path in metaNodes) {\n metaNode = metaNodes[path];\n metaName = core.getFullyQualifiedName(metaNode);\n ownMetaJson = core.getOwnJsonMeta(metaNode);\n setNames = core.getValidSetNames(metaNode);\n pointerNames = core.getValidPointerNames(metaNode);\n aspectNames = core.getValidAspectNames(metaNode);\n childPaths = core.getValidChildrenPaths(metaNode);\n\n //Patch the ownMetaJson\n ownMetaJson.attributes = ownMetaJson.attributes || {};\n ownMetaJson.children = ownMetaJson.children || {};\n ownMetaJson.pointers = ownMetaJson.pointers || {};\n ownMetaJson.aspects = ownMetaJson.aspects || {};\n ownMetaJson.constraints = ownMetaJson.constraints || {};\n\n // Check for name duplication.\n if (typeof names[metaName] === 'string') {\n result.push({\n severity: 'error',\n message: 'Duplicate name among meta-nodes [' + metaName + ']',\n description: 'Non-unique meta names makes it hard to reason about the meta-model',\n hint: 'Rename one of the objects',\n path: path,\n relatedPaths: [names[metaName]]\n });\n } else {\n names[metaName] = path;\n }\n\n // Get the mixin errors.\n result = result.concat(core.getMixinErrors(metaNode).map(getMixinError));\n\n if (ownMetaJson.children.items) {\n for (i = 0; i < ownMetaJson.children.items.length; i += 1) {\n if (!metaNodes[ownMetaJson.children.items[i]]) {\n result.push({\n severity: 'error',\n message: metaName + ' defines containment of a node that is not part of the meta.',\n description: 'All defined meta-relations should be between meta-nodes.',\n hint: 'Locate the related node, add it to the meta and remove the containment definition.',\n path: path,\n relatedPaths: [ownMetaJson.children.items[i]]\n });\n }\n }\n }\n\n for (key in ownMetaJson.pointers) {\n isPointer = ownMetaJson.pointers[key].max === 1;\n\n for (i = 0; i < ownMetaJson.pointers[key].items.length; i += 1) {\n if (!metaNodes[ownMetaJson.pointers[key].items[i]]) {\n result.push({\n severity: 'error',\n message: metaName + ' defines a ' + (isPointer ? 'pointer' : 'set') + ' [' + key + '] ' +\n 'where the ' + (isPointer ? 'target' : 'member') + ' is not part of the meta.',\n description: 'All defined meta-relations should be between meta-nodes.',\n hint: 'Locate the related node, add it to the meta and remove the ' +\n (isPointer ? 'pointer' : 'set') + ' definition.',\n path: path,\n relatedPaths: [ownMetaJson.pointers[key].items[i]]\n });\n }\n }\n\n if (isPointer) {\n if (setNames.indexOf(key) > -1) {\n result.push({\n severity: 'error',\n message: metaName + ' defines a pointer [' + key + '] colliding with a set definition.',\n description: 'Pointer and set definitions share the same namespace.',\n hint: 'Remove/rename one of them.',\n path: path,\n relatedPaths: ownMetaJson.pointers[key].items\n });\n }\n\n if (key === CONSTANTS.BASE_POINTER || key === CONSTANTS.MEMBER_RELATION) {\n result.push(getReservedNameError(metaName, path, key, 'a pointer'));\n }\n } else {\n if (pointerNames.indexOf(key) > -1) {\n result.push({\n severity: 'error',\n message: metaName + ' defines a set [' + key + '] colliding with a pointer definition.',\n description: 'Pointer and set definitions share the same namespace.',\n hint: 'Remove/rename one of them.',\n path: path,\n relatedPaths: ownMetaJson.pointers[key].items\n });\n }\n\n if (aspectNames.indexOf(key) > -1) {\n result.push({\n severity: 'error',\n message: metaName + ' defines a set [' + key + '] colliding with an aspect definition.',\n description: 'Sets and aspects share the same name-space.',\n hint: 'Remove/rename one of them.',\n path: path,\n relatedPaths: ownMetaJson.pointers[key].items\n });\n }\n\n if (key === CONSTANTS.OVERLAYS_PROPERTY) {\n result.push(getReservedNameError(metaName, path, key, 'a set'));\n }\n }\n\n if (key[0] === '_') {\n result.push(getUnderScoreError(metaName, path, key, isPointer ? 'a pointer' : 'a set'));\n }\n }\n\n for (key in ownMetaJson.aspects) {\n for (i = 0; i < ownMetaJson.aspects[key].length; i += 1) {\n if (!metaNodes[ownMetaJson.aspects[key][i]]) {\n result.push({\n severity: 'error',\n message: metaName + ' defines an aspect [' + key + '] where a member is not part of' +\n ' the meta.',\n description: 'All defined meta-relations should be between meta-nodes.',\n hint: 'Remove the item from the aspect.',\n path: path,\n relatedPaths: [ownMetaJson.aspects[key][i]]\n });\n } else if (isTypeOfAny(metaNodes[ownMetaJson.aspects[key][i]], childPaths) === false) {\n result.push({\n severity: 'error',\n message: metaName + ' defines an aspect [' + key + '] where a member does not have a ' +\n 'containment definition.',\n description: 'All defined meta-relations should be between meta-nodes.',\n hint: 'Remove the item from the aspect or add a containment definition.',\n path: path,\n relatedPaths: [ownMetaJson.aspects[key][i]]\n });\n }\n }\n\n if (setNames.indexOf(key) > -1) {\n result.push({\n severity: 'error',\n message: metaName + ' defines an aspect [' + key + '] colliding with a set definition.',\n description: 'Sets and aspects share the same name-space.',\n hint: 'Remove the aspect and create a new one.',\n path: path,\n relatedPaths: []\n });\n }\n\n if (key === CONSTANTS.OVERLAYS_PROPERTY) {\n result.push(getReservedNameError(metaName, path, key, 'an aspect'));\n }\n\n if (key[0] === '_') {\n result.push(getUnderScoreError(metaName, path, key, 'an aspect'));\n }\n }\n\n for (key in ownMetaJson.attributes) {\n if (ownMetaJson.attributes[key].hasOwnProperty('regexp')) {\n try {\n new RegExp(ownMetaJson.attributes[key].regexp);\n } catch (err) {\n result.push({\n severity: 'error',\n message: metaName + ' defines an invalid regular expression for the attribute [' + key +\n '], \"' + ownMetaJson.attributes[key].regexp + '\".',\n description: 'Invalid properties can lead to unexpected results in the models.',\n hint: 'Edit the regular expression for the attribute.',\n path: path,\n relatedPaths: []\n });\n }\n }\n\n if (ownMetaJson.attributes[key].type === CONSTANTS.ATTRIBUTE_TYPES.INTEGER ||\n ownMetaJson.attributes[key].type === CONSTANTS.ATTRIBUTE_TYPES.FLOAT) {\n\n if (ownMetaJson.attributes[key].hasOwnProperty('min') &&\n typeof ownMetaJson.attributes[key].min !== 'number') {\n result.push({\n severity: 'error',\n message: metaName + ' defines an invalid min value for the attribute [' + key +\n ']. The type is not a number but \"' + typeof ownMetaJson.attributes[key].min + '\".',\n description: 'Invalid properties can lead to unexpected results in the models.',\n hint: 'Edit the min value for the attribute.',\n path: path,\n relatedPaths: []\n });\n }\n\n if (ownMetaJson.attributes[key].hasOwnProperty('max') &&\n typeof ownMetaJson.attributes[key].max !== 'number') {\n result.push({\n severity: 'error',\n message: metaName + ' defines an invalid max value for the attribute [' + key +\n ']. The type is not a number but \"' + typeof ownMetaJson.attributes[key].max + '\".',\n description: 'Invalid properties can lead to unexpected results in the models.',\n hint: 'Edit the max value for the attribute.',\n path: path,\n relatedPaths: []\n });\n }\n }\n\n // This cannot happen since _s are filtered out.\n if (key[0] === '_') {\n result.push(getUnderScoreError(metaName, path, key, 'an attribute'));\n }\n }\n\n // for (key in ownMetaJson.constraints) {\n // // Any checking on constraints?\n // }\n }\n\n return result;\n }", "title": "" }, { "docid": "799d1576a01b20ac2fadf4c8500aefb6", "score": "0.43955076", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "70f0cb9bf0955500fa62c81b8b8158d2", "score": "0.43918312", "text": "async function handleLike(version) {\n if (!currentUserId) {\n return addNoti({\n mode: \"fail\",\n message: `Must sign-in to ${version} ${likeableType.toLowerCase()}s`,\n });\n }\n\n // create newLike obj from passed down props for later use\n const newLike = {\n likeable_type: likeableType,\n likeable_id: likeableId,\n version: version,\n };\n\n if (isLiked && isLiked.version === version) {\n // deleteLike, if liked version and liking version is the same {eg: dislike == dislike}\n changeLikeStatus(\"nolikes\");\n await deleteLike(isLiked.id);\n\n if (likeableType === \"Video\" && version === \"like\")\n addNoti({ mode: \"success\", message: \"Removed from Liked videos\" });\n if (likeableType === \"Video\" && version === \"dislike\")\n addNoti({ mode: \"success\", message: \"Dislike removed\" });\n\n return;\n }\n\n // deleteLike then createLike, if liked version and liking version isn't the same\n if (isLiked && isLiked.version != version) {\n await deleteLike(isLiked.id);\n await createLike(newLike);\n changeLikeStatus(version);\n\n if (likeableType === \"Video\" && version === \"like\")\n addNoti({ mode: \"success\", message: \"Added to Liked videos\" });\n if (likeableType === \"Video\" && version === \"dislike\")\n addNoti({ mode: \"success\", message: \"Removed from Liked videos\" });\n\n return;\n }\n\n // create new like, if not yet liked\n changeLikeStatus(version);\n await createLike(newLike);\n\n if (likeableType === \"Video\" && version === \"like\")\n addNoti({ mode: \"success\", message: \"Added to Liked videos\" });\n if (likeableType === \"Video\" && version === \"dislike\")\n addNoti({ mode: \"success\", message: \"You Dislike this video\" });\n }", "title": "" }, { "docid": "95c14016c0f883db5e915cd0b9c019b6", "score": "0.43894914", "text": "GetRawObject() {}", "title": "" }, { "docid": "9dd1d666624b01bc5ad316e23e29d65d", "score": "0.4383952", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1b7c3a2b517bd09e97f0a7edc11745e7", "score": "0.43838516", "text": "async function v21(v22,v23) {\n const v25 = \"/1fK6Zlg5n\";\n // v25 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"])\n const v26 = undefined;\n // v26 = .undefined\n const v27 = 0;\n // v27 = .integer\n const v28 = Object;\n // v28 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"freeze\", \"getOwnPropertyDescriptors\", \"isFrozen\", \"isExtensible\", \"keys\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"getOwnPropertySymbols\", \"assign\", \"create\", \"fromEntries\", \"isSealed\", \"setPrototypeOf\", \"getOwnPropertyNames\", \"defineProperty\", \"values\", \"getPrototypeOf\", \"defineProperties\", \"preventExtensions\", \"seal\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v29 = 0;\n // v29 = .integer\n const v30 = 100;\n // v30 = .integer\n const v31 = 1;\n // v31 = .integer\n let v34 = 0;\n const v35 = v34 + 1;\n // v35 = .primitive\n v34 = v35;\n const v37 = [13.37,13.37,13.37];\n // v37 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v39 = [1337,1337,v37];\n // v39 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v46 = [v2,v14];\n // v46 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v47 = v37.findIndex;\n // v47 = .unknown\n const v48 = Reflect.apply(v47,v20,v46);\n // v48 = .unknown\n const v49 = [1337,1337,1337];\n // v49 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v50 = [\"string\",Int32Array,v49,v49,-4238751726,-4238751726];\n // v50 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n for (const v51 of v50) {\n const v52 = v23[v10];\n // v52 = .unknown\n const v53 = \"a\"[1024];\n // v53 = .unknown\n for (let v57 = 0; v57 < 10; v57 = v57 + 1) {\n }\n v51[1337] = v39;\n }\n const v58 = v49.pop();\n // v58 = .unknown\n function v59(v60,v61) {\n return v34;\n }\n const v65 = v47(1337,...Int8Array,...\"length\",...v49,...\"bigint\");\n // v65 = .unknown\n const v66 = [13.37,100,1337,v13,...1,...-4096,1,...Int32Array,...v10];\n // v66 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n for (let v67 = 0; v67 < 100; v67 = v67 + 1) {\n }\n }", "title": "" }, { "docid": "df84e9e6def27c270645cfe1b7bca5d4", "score": "0.43831858", "text": "function Surrogate(){}", "title": "" }, { "docid": "67378048da8b2f8abfa41da267c6860e", "score": "0.43778557", "text": "function Je(e,t){return{}.hasOwnProperty.call(e,t)}", "title": "" }, { "docid": "cdfc5679ff2ab69adb5dcda12ec9f8d6", "score": "0.43776184", "text": "predict(instances) {\n let pred = [];\n for (let i = 0; i < instances.length; i++) {\n let inst = instances[i];\n pred.push(this.classify(inst));\n }\n return pred;\n }", "title": "" }, { "docid": "abc486c818bea818ab9236252858abfe", "score": "0.43765116", "text": "function markovify(text){\n return new TestString(text);\n}", "title": "" }, { "docid": "5a0d534e22e61708c44fccd2c85212c2", "score": "0.437288", "text": "function BetterPokemon (name, type){\n this.name = name;\n this.type = type;\n}", "title": "" }, { "docid": "a11f5b287afe33cf5b3e033bf0357635", "score": "0.43715292", "text": "function Yn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}", "title": "" }, { "docid": "73c326882981cd2386f9af222d3ec4ab", "score": "0.4371435", "text": "isRelevant() {\n return true;\n }", "title": "" }, { "docid": "eaa73189b38659374e11173ed7fd664b", "score": "0.4370884", "text": "async function likeIt() {\n const like = {\n likeStatus: isLiked.msg,\n type: \"post\",\n aid: postData?._id,\n doerId: user?._id,\n doerName: user?.name,\n doerPic: user?.profilePic,\n };\n let likedata = await (await postService.post(`/like/like`, like)).data;\n\n if (likedata.msg === \"ok\") {\n setisLiked({ msg: \"liked\", result: 1 });\n setactivityDetail({ ...activityDetail, likeCount: likedata.likeCount });\n }\n }", "title": "" }, { "docid": "867a1357f5326a60277e74934f939ba9", "score": "0.4370507", "text": "function MyObject() {\n }", "title": "" }, { "docid": "07366dd4ea81b5c62c1a91102c12255e", "score": "0.43689", "text": "getMetaKeywords() {}", "title": "" }, { "docid": "ef4c5ea515fb68f11029aa054a246dfb", "score": "0.4368015", "text": "function lukesPets(pets){\n pets.ownerName == \"Luke\";\n}", "title": "" }, { "docid": "b60f7e871ed38ecc0e700cd978868b24", "score": "0.43665996", "text": "static get observedAttributes() {\n return ['label'];\n }", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.4363528", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.4363528", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.4363528", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.4363528", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.4363528", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.4363528", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "4876ad37bbb3ea1157653ecf37fbfb21", "score": "0.43632448", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n#ifdef GHCJS_TRACE_GC\n var start = Date.now();\n#endif\n TRACE_GC(\"following\");\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n TRACE_GC(\"work length: \" + work.length + \" w: \" + w);\n c = work[--w];\n TRACE_GC(\"[\" + work.length + \"] mark step: \" + typeof c);\n#ifdef GHCJS_TRACE_GC\n if(typeof c === 'object') {\n if(c !== null) {\n TRACE_GC(\"object: \" + c.toString());\n TRACE_GC(\"object props: \" + h$collectProps(c));\n TRACE_GC(\"object mark: \" + c.m + \" (\" + typeof(c.m) + \") (current: \" + mark + \")\");\n } else {\n TRACE_GC(\"object: \" + c);\n }\n }\n#endif\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n TRACE_GC(\"first accepted\");\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n TRACE_GC(\"marking heap object: \" + c.f.n + \" size: \" + c.f.size);\n // only change the two least significant bits for heap objects\n MARK_OBJ(c);\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: ADDW(c.d1); break;\n case 2: ADDW2(c.d1, d); break;\n case 3: var d3=c.d2; ADDW3(c.d1, d3.d1, d3.d2); break;\n case 4: var d4=c.d2; ADDW4(c.d1, d4.d1, d4.d2, d4.d3); break;\n case 5: var d5=c.d2; ADDW4(c.d1, d5.d1, d5.d2, d5.d3); ADDW(d5.d4); break;\n case 6: var d6=c.d2; ADDW4(c.d1, d6.d1, d6.d2, d6.d3); ADDW2(d6.d4, d6.d5); break;\n case 7: var d7=c.d2; ADDW4(c.d1, d7.d1, d7.d2, d7.d3); ADDW3(d7.d4, d7.d5, d7.d6); break;\n case 8: var d8=c.d2; ADDW4(c.d1, d8.d1, d8.d2, d8.d3); ADDW4(d8.d4, d8.d5, d8.d6, d8.d7); break;\n case 9: var d9=c.d2; ADDW4(c.d1, d9.d1, d9.d2, d9.d3); ADDW4(d9.d4, d9.d5, d9.d6, d9.d7); ADDW(d9.d8); break;\n case 10: var d10=c.d2; ADDW4(c.d1, d10.d1, d10.d2, d10.d3); ADDW4(d10.d4, d10.d5, d10.d6, d10.d7); ADDW2(d10.d8, d10.d9); break;\n case 11: var d11=c.d2; ADDW4(c.d1, d11.d1, d11.d2, d11.d3); ADDW4(d11.d4, d11.d5, d11.d6, d11.d7); ADDW3(d11.d8, d11.d9, d11.d10); break;\n case 12: var d12=c.d2; ADDW4(c.d1, d12.d1, d12.d2, d12.d3); ADDW4(d12.d4, d12.d5, d12.d6, d12.d7); ADDW4(d12.d8, d12.d9, d12.d10, d12.d11); break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n TRACE_GC(\"adding static marks\");\n for(var i=0;i<s.length;i++) ADDW(s[i]);\n }\n } else if(typeof c.len === 'number' && c.buf instanceof ArrayBuffer) {\n TRACE_GC(\"marking ByteArray\");\n MARK_OBJ(c);\n } else if(c instanceof h$Weak) {\n MARK_OBJ(c);\n } else if(c instanceof h$MVar) {\n TRACE_GC(\"marking MVar\");\n MARK_OBJ(c);\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n\t\t ADDW(ii[1]); // value\n\t\t ADDW(ii[0]); // thread\n\t\t}\n\t\titer = c.readers.iter();\n\t\twhile((ii = iter()) !== null) {\n\t\t ADDW(ii);\n\t\t}\n\t if(c.waiters) {\n\t\t for(i=c.waiters.length-1;i>=0;i--) {\n\t\t ADDW(c.waiters[i]);\n\t\t }\n\t\t}\n if(c.val !== null && !IS_MARKED(c.val)) ADDW(c.val);\n } else if(c instanceof h$MutVar) {\n TRACE_GC(\"marking MutVar\");\n MARK_OBJ(c);\n ADDW(c.val);\n } else if(c instanceof h$TVar) {\n TRACE_GC(\"marking TVar\");\n MARK_OBJ(c);\n ADDW(c.val);\n\t\titer = c.blocked.iter();\n\t\twhile((ii = iter.next()) !== null) {\n\t\t ADDW(ii);\n\t\t}\n\t\tif(c.invariants) {\n\t\t iter = c.invariants.iter();\n\t\t while((ii = iter.next()) !== null) {\n\t\t\tADDW(ii);\n\t\t }\n\t\t}\n } else if(c instanceof h$Thread) {\n TRACE_GC(\"marking Thread\");\n MARK_OBJ(c);\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n\t\t\tADDW(c.stack[i]);\n\t\t }\n }\n\t\tfor(i=0;i<c.excep.length;i++) {\n\t\t ADDW(c.excep[i]);\n\t\t}\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n TRACE_GC(\"marking STM transaction\");\n MARK_OBJ(c);\n for(i=c.invariants.length-1;i>=0;i--) {\n\t\t ADDW(c.invariants[i].action);\n\t\t}\n ADDW(c.action);\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n\t\t ADDW(ii.val);\n\t\t}\n } else if(c instanceof Array && c.__ghcjsArray) {\n\t\t// only for Haskell arrays with lifted values\n MARK_OBJ(c);\n TRACE_GC(\"marking array\");\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !IS_MARKED(x)) {\n\t\t ADDW(x);\n\t\t }\n }\n } else if(typeof c === 'object') {\n TRACE_GC(\"extensible retention marking\");\n#ifdef GHCJS_TRACE_GC_UNKNOWN\n var extensibleMatched = false;\n#endif\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n#ifdef GHCJS_TRACE_GC_UNKNOWN\n extensibleMatched = true;\n#endif\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n\t\t ADDW(x[j]);\n\t\t }\n }\n break;\n }\n#ifdef GHCJS_TRACE_GC_UNKNOWN\n if(!extensibleMatched) {\n TRACE_GC(\"unknown object: \" + h$collectProps(c));\n }\n#endif\n } // otherwise: not an object, no followable values\n }\n }\n TRACE_GC(\"h$follow: \" + (Date.now()-start) + \"ms\");\n}", "title": "" }, { "docid": "0f20b03996c0dbb9e120d948bc085821", "score": "0.43628812", "text": "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol$1) {\n classObject.prototype[nodejsCustomInspectSymbol$1] = fn;\n }\n}", "title": "" }, { "docid": "8183325adf2548553c204d09d1466242", "score": "0.43623117", "text": "function importantObject(object){\n return object = {\n dogName:\"rupert\",\n breed:\"bulldog\"\n }\n}", "title": "" }, { "docid": "afd29ff884a319b4063d017ce3da5b2f", "score": "0.43615744", "text": "function testObjectMirror(o, cls_name, ctor_name, hasSpecialProperties) {\n // Create mirror and JSON representation.\n var mirror = debug.MakeMirror(o);\n var json = mirror.toJSONProtocol(true);\n\n // Check the mirror hierachy.\n assertTrue(mirror instanceof debug.Mirror);\n assertTrue(mirror instanceof debug.ValueMirror);\n assertTrue(mirror instanceof debug.ObjectMirror);\n\n // Check the mirror properties.\n assertTrue(mirror.isObject());\n assertEquals('object', mirror.type());\n assertFalse(mirror.isPrimitive());\n assertEquals(cls_name, mirror.className());\n assertTrue(mirror.constructorFunction() instanceof debug.ObjectMirror);\n assertTrue(mirror.protoObject() instanceof debug.Mirror);\n assertTrue(mirror.prototypeObject() instanceof debug.Mirror);\n assertFalse(mirror.hasNamedInterceptor(), \"hasNamedInterceptor()\");\n assertFalse(mirror.hasIndexedInterceptor(), \"hasIndexedInterceptor()\");\n\n var names = mirror.propertyNames();\n var properties = mirror.properties()\n assertEquals(names.length, properties.length);\n for (var i = 0; i < properties.length; i++) {\n assertTrue(properties[i] instanceof debug.Mirror);\n assertTrue(properties[i] instanceof debug.PropertyMirror);\n assertEquals('property', properties[i].type());\n assertEquals(names[i], properties[i].name());\n }\n \n for (var p in o) {\n var property_mirror = mirror.property(p);\n assertTrue(property_mirror instanceof debug.PropertyMirror);\n assertEquals(p, property_mirror.name());\n // If the object has some special properties don't test for these.\n if (!hasSpecialProperties) {\n assertEquals(0, property_mirror.attributes(), property_mirror.name());\n assertFalse(property_mirror.isReadOnly());\n assertTrue(property_mirror.isEnum());\n assertTrue(property_mirror.canDelete());\n }\n }\n\n // Parse JSON representation and check.\n var fromJSON = eval('(' + json + ')');\n assertEquals('object', fromJSON.type);\n assertEquals(cls_name, fromJSON.className);\n assertEquals('function', fromJSON.constructorFunction.type);\n if (ctor_name !== undefined)\n assertEquals(ctor_name, fromJSON.constructorFunction.name);\n assertEquals(void 0, fromJSON.namedInterceptor);\n assertEquals(void 0, fromJSON.indexedInterceptor);\n\n // For array the index properties are seperate from named properties.\n if (!cls_name == 'Array') {\n assertEquals(names.length, fromJSON.properties.length, 'Some properties missing in JSON');\n }\n\n // Check that the serialization contains all properties.\n for (var i = 0; i < fromJSON.properties.length; i++) {\n var name = fromJSON.properties[i].name;\n if (!name) name = fromJSON.properties[i].index;\n var found = false;\n for (var j = 0; j < names.length; j++) {\n if (names[j] == name) {\n assertEquals(properties[i].value().type(), fromJSON.properties[i].value.type);\n // If property type is normal nothing is serialized.\n if (properties[i].propertyType() != debug.PropertyType.Normal) {\n assertEquals(properties[i].propertyType(), fromJSON.properties[i].propertyType);\n } else {\n assertTrue(typeof(fromJSON.properties[i].propertyType) === 'undefined');\n }\n // If there are no attributes nothing is serialized.\n if (properties[i].attributes() != debug.PropertyAttribute.None) {\n assertEquals(properties[i].attributes(), fromJSON.properties[i].attributes);\n } else {\n assertTrue(typeof(fromJSON.properties[i].attributes) === 'undefined');\n }\n if (!properties[i].value() instanceof debug.AccessorMirror &&\n properties[i].value().isPrimitive()) {\n // NaN is not equal to NaN.\n if (isNaN(properties[i].value().value())) {\n assertTrue(isNaN(fromJSON.properties[i].value.value));\n } else {\n assertEquals(properties[i].value().value(), fromJSON.properties[i].value.value);\n }\n }\n found = true;\n }\n }\n assertTrue(found, '\"' + name + '\" not found');\n }\n}", "title": "" }, { "docid": "d23f818dfb63d8aef9321c78aec2869b", "score": "0.43604338", "text": "function Van() {}", "title": "" }, { "docid": "40a744fe7149fd5d6e18095d2c01e708", "score": "0.43567657", "text": "like_limit(likes){\n \n \n\n }", "title": "" }, { "docid": "c84a95f720c07a68a4f1b645fcc4f96d", "score": "0.43498462", "text": "predict() {\r\n throw new ReferenceError('Missing predict method implementation');\r\n }", "title": "" } ]
a01642404f214e081bc608f7b314e87a
get and parse id num from jquery object
[ { "docid": "964c8864c01fff57406bbc5f8092f358", "score": "0.75585467", "text": "function get_id( obj ) {\n var id = obj.attr( 'id' );\n return parseInt( id, 10 );\n }", "title": "" } ]
[ { "docid": "a1d34d080c562ced30ec56d1899c5f00", "score": "0.66367024", "text": "function getNumFromId(val) {\n\treturn val.substr(val.indexOf(\"-\") + 1);\n}", "title": "" }, { "docid": "967e57dfe424d649f28b85a8e1740abb", "score": "0.6607016", "text": "function getNeededId(self){\n var manipulator = $(self);\n var neededId = manipulator.attr('id').split('_')[1];//getting unique general value of id\n return neededId;\n}", "title": "" }, { "docid": "c2cb674e02655510c5a1e1b50439f679", "score": "0.6354188", "text": "function getId(ele){\t// store the id value\r\n id_value = ele.id; \r\n}", "title": "" }, { "docid": "db93817102f0363bc5eefd848494b521", "score": "0.6246261", "text": "function getObj(id) {\n\treturn $(id);\n}", "title": "" }, { "docid": "48c3b46782e6f87b57b3b80ed8bca321", "score": "0.61521274", "text": "function jq(myid) {\r\n\t\treturn '#' + myid.replace(/(:|\\.)/g,'\\\\$1');\r\n}", "title": "" }, { "docid": "bf97b9812f7b9b2e1994ef4a610138d5", "score": "0.6145218", "text": "function get_id() {\n\treturn $('.user-link').attr('id');\n}", "title": "" }, { "docid": "0d8f7b55ad00d8639ac8f775b04387bf", "score": "0.6127921", "text": "function num(id) {\n return Number($(id).val());\n}", "title": "" }, { "docid": "d6cccaabb24eee61a31f75f56b78a9da", "score": "0.60821456", "text": "function getIdMain()\n{\n _idMainChar = jisQuery( '.idHolder' ).first().html();\n _idStorage += _idMainChar;\n}", "title": "" }, { "docid": "54ada10dbeac1b5abaed90d6ce0c7025", "score": "0.6072014", "text": "function extractId(panoId){\n if (!panoId){ panoId = gCurPano }\n // console.log('checkInput panoId:', panoId)\n let pId = panoId.toString().match(/\\d+/)[0]\n if(!pId){pId=gCurPano}\n pId = Number(pId)\n return pId\n }", "title": "" }, { "docid": "62f9200ff233d8f29c9ac0743a231efd", "score": "0.60674024", "text": "function jq( myid ) {\n return \"#\" + myid.replace( /(:|\\.|\\[|\\]|,)/g, \"\\\\$1\" );\n}", "title": "" }, { "docid": "89a21cd5fe26242404eadb2c794b5d9d", "score": "0.6043157", "text": "function getIdFromSplit(element) {\r\n var idArray = element.split(\"_\");\r\n var first = idArray[0];\r\n var id = parseInt(idArray[1]);\r\n return id;\r\n}", "title": "" }, { "docid": "e6fa8eab45bfe1e3efe66aa07f0d4040", "score": "0.6024257", "text": "function jq(myid) {\n return '#' + myid.replace(/(:|\\.)/g, '\\\\$1');\n}", "title": "" }, { "docid": "467fb2400304d10e4018e588191f59a6", "score": "0.60070413", "text": "function generateID ( $ )\n{\n thisid = $.prop ( 'id' );\n if ( strlen ( thisid ) === 0 )\n {\n thisid = \"GenID_\" + str_pad ( generateID_counter + \"\" , 4 , \"0\" , STR_PAD_LEFT );\n generateID_counter++;\n $.prop ( 'id' , thisid );\n }\n return thisid;\n}", "title": "" }, { "docid": "1be36ccf1861ad54117e1ffebd5a339c", "score": "0.5965449", "text": "function jq(myid) {\n return '#' + myid.replace(/(:|\\.|\\[|\\])/g, '\\\\$1');\n}", "title": "" }, { "docid": "88ba37834fa50ba552194f41146562b0", "score": "0.59528", "text": "function getId(cell) {\r\n\t\treturn parseInt(cell.attr('id'), 10);\r\n\t}", "title": "" }, { "docid": "a10b447e6d3ca6220b4f4fa6a7a2f77f", "score": "0.5921462", "text": "function getId(el){\n var id = el.getAttribute('adf-id');\n return id ? id : '-1';\n }", "title": "" }, { "docid": "cd1889468560fe8c2054f92cd99e2c16", "score": "0.59017736", "text": "function toId(elem) {\n return elem.id;\n}", "title": "" }, { "docid": "0970a587bfba6fbf516f42c2ea4c04ae", "score": "0.5890154", "text": "function getId(obj) {\n return obj.id;\n }", "title": "" }, { "docid": "bcfd9f3c44ce1d8f31df9e55e08c4809", "score": "0.5885488", "text": "function getId(obj) {\n return obj.id;\n}", "title": "" }, { "docid": "fc7599e1fd71269d43e1eec501757826", "score": "0.5884075", "text": "function igtId() {\n id = $('#igt-instance').attr('igtid');\n return id;\n}", "title": "" }, { "docid": "53fdbd69b5d9d62f138fbef997c7a3ec", "score": "0.5862364", "text": "function item_id(tv) {\n var item_id = tv.id;\n return item_id;\n }", "title": "" }, { "docid": "34c5a093fac6185cd50e7f115a48b6ff", "score": "0.57957107", "text": "function _id(val) {\n return document.getElementById(val);\n}", "title": "" }, { "docid": "125838fe9df249416ccf0a49c6c466ba", "score": "0.57110703", "text": "function makeJQueryID ( myid )\r\n{\r\n\treturn \"#\" + myid.replace( /(:|\\.|\\/|\\%|\\[|\\])/g, \"\\\\$1\" );\r\n}", "title": "" }, { "docid": "f2bf5f08c7e2a79dc8fac4c0364cfe5a", "score": "0.570636", "text": "function getItemId() {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "634fa462316ac7489f5faee06f62d9fb", "score": "0.57055026", "text": "function get_auto_id() {\n $.ajax({\n url:'action/get_auto_id.php',\n type:'POST',\n cache:false,\n data:{id:menuId},\n dataType:'JSON',\n success:function (data) {\n $('#txt-id').val(parseInt(data.id)+1);\n }\n });\n }", "title": "" }, { "docid": "e87ec741e859eaafe2cb33f08c4ef5db", "score": "0.56695414", "text": "function parse_imageId() {\n\t// URL is like http://emptysquare.net/photography/lower-east-side/#5/\n\t// fragment from http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/\n\tvar fragment = $.param.fragment();\n\tif (fragment.length) {\n\t\t// URL's image index is 1-based, our internal index is 0-based\n\t\timageId = parseInt(fragment.replace(/\\//g, '')) - 1;\n\t\tif (imageId < 0 || isNaN(imageId)) imageId = 0;\n\t} else {\n\t\timageId = 0;\n\t}\n}", "title": "" }, { "docid": "c398d6b7b6de475a9de0534cdc8926d0", "score": "0.56616855", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "c398d6b7b6de475a9de0534cdc8926d0", "score": "0.56616855", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "c398d6b7b6de475a9de0534cdc8926d0", "score": "0.56616855", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "c398d6b7b6de475a9de0534cdc8926d0", "score": "0.56616855", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "c398d6b7b6de475a9de0534cdc8926d0", "score": "0.56616855", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Product_main1_Product_top11_Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "25b00a5f0a446eac1a210f03a8816daa", "score": "0.56332356", "text": "function v(num) {\n\treturn $('#'+s_[num]);\n}", "title": "" }, { "docid": "a0226800cd988ab4fa7015708ea88f83", "score": "0.56234884", "text": "function get_id_value(id){\r\r\n\treturn $(\"#\"+id).val().trim();\r\r\n}", "title": "" }, { "docid": "0f2b4b0f7fe732e01e3cca06010d3551", "score": "0.56189847", "text": "function splitIdFromThis(splitId) {\n let id = $(splitId).attr(\"id\");\n let salvaId = id.split(\"-\");\n id = salvaId[1];\n return id;\n}", "title": "" }, { "docid": "a6702055f4a798f45426e15c02be459f", "score": "0.5599853", "text": "function id(d) { return d[0]; }", "title": "" }, { "docid": "a6702055f4a798f45426e15c02be459f", "score": "0.5599853", "text": "function id(d) { return d[0]; }", "title": "" }, { "docid": "a6702055f4a798f45426e15c02be459f", "score": "0.5599853", "text": "function id(d) { return d[0]; }", "title": "" }, { "docid": "3a08ac627f8062fcc7e90a3922dfdbe7", "score": "0.55994004", "text": "function getID(str) {\n return str.replace(/^[^\\d]*(\\d+).*/, \"$1\");\n}", "title": "" }, { "docid": "5a4e99896989a22436cf8a9aa95271c5", "score": "0.55987155", "text": "function $(idobj) {\n return document.getElementById(idobj);\n}", "title": "" }, { "docid": "a9e03b180c4041c3fc8ceb254d688bae", "score": "0.5588205", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n if(element!=null)\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "637afff401861e5cfffb2080868ded8e", "score": "0.55877745", "text": "load_Book(element) {\n alert(element.id);\n }", "title": "" }, { "docid": "9dd2c003ea966102c1a0cbb3f5498157", "score": "0.55855715", "text": "function fetchDeleteId(obj) {\r\n\tvar id = obj.id;\r\n\t/* Set hidden text field value */\r\n\t$(\"#deleteId\").val(id);\r\n\r\n}", "title": "" }, { "docid": "ffd90768b8a8316b901840a5669a06d1", "score": "0.55785054", "text": "function getnum(spanid) {\n return parseInt(spanid.split(\"-\").slice(-1)[0]);\n }", "title": "" }, { "docid": "840ef6ec5843ce86de9c34470ca77b40", "score": "0.5576968", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "840ef6ec5843ce86de9c34470ca77b40", "score": "0.5576968", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "840ef6ec5843ce86de9c34470ca77b40", "score": "0.5576968", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "840ef6ec5843ce86de9c34470ca77b40", "score": "0.5576968", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "840ef6ec5843ce86de9c34470ca77b40", "score": "0.5576968", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "840ef6ec5843ce86de9c34470ca77b40", "score": "0.5576968", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "840ef6ec5843ce86de9c34470ca77b40", "score": "0.5576968", "text": "function getItemId()\r\n {\r\n var element =document.getElementById(\"Label12\");\r\n var item_id=0;\r\n item_id = element.textContent;\r\n return item_id;\r\n }", "title": "" }, { "docid": "f6775da9c644897a25751e6e790cb13b", "score": "0.55697167", "text": "function toObjectId( data ) {\n\treturn data ;\n}", "title": "" }, { "docid": "1bc456a2cd56c9604302a308e5ddc17a", "score": "0.55663216", "text": "function parseNodeId(id)\n{\n var r = null;\n var match = /([0-9]+)(.*)/.exec(id);\n if (match)\n {\n r = new Object();\n r.id = match[1];\n r.wtPrefix = match[2];\n }\n return r;\n}", "title": "" }, { "docid": "e82312ee1d009602b2791e38afef201b", "score": "0.5560883", "text": "function $(identifier) {\n\n var split = identifier.split(\":\");\n return Realm.getObject(Util.capitalize(split[0]), parseInt(split[1], 10));\n}", "title": "" }, { "docid": "b65f355bc0d9051cefa90cf32b2ff96f", "score": "0.5558895", "text": "function getIdValue(formElement) {\n return typeof formElement === 'object' ? formElement['$oid'] : formElement\n}", "title": "" }, { "docid": "72701182b6efff7530b6094bfa9c81e3", "score": "0.55498564", "text": "getID() {\n return this._data.id ? this._data.id.trim() : null;\n }", "title": "" }, { "docid": "15e740a3684115fe87f26a0e3b7990a6", "score": "0.5531636", "text": "function getStudentId(){\r\n var studentId = $('#studentId').html();\r\n return studentId;\r\n}", "title": "" }, { "docid": "f20a3b98a883429ec14e227cc1297201", "score": "0.5524741", "text": "function _$(id){return document.getElementById( id );}", "title": "" }, { "docid": "1a1b7428305eca081e77fa881364e459", "score": "0.5517541", "text": "function findId(object) {\n return object.id\n }", "title": "" }, { "docid": "7494263b0c063884b7b7d63690a67d51", "score": "0.5512429", "text": "function $C(obj){\r\n\treturn $(\"flid_\"+obj);\r\n}", "title": "" }, { "docid": "d3514bb2c11d20356be6fc3e8e5ed0e2", "score": "0.5498067", "text": "function elementIdFetcher(elArr) {\n return elArr.map(function(el) {\n var newObj = {value: el.value._id, number: el.number};\n return newObj;\n });\n}", "title": "" }, { "docid": "6ae9a3aa0c20325cfb8fdb825ce94bee", "score": "0.54938376", "text": "function objectID() {\r\n return {\r\n \"Sun\": \"#sun-data\",\r\n \"Mercury\": \"#mercury-data\",\r\n \"Venus\": \"#venus-data\",\r\n \"Mars\": \"#mars-data\",\r\n \"Jupiter\": \"#jupiter-data\",\r\n \"Saturn\": \"#saturn-data\",\r\n \"Uranus\": \"#uranus-data\",\r\n \"Neptune\": \"#neptune-data\",\r\n \"Pluto\": \"#pluto-data\",\r\n \"Moon\": \"#moon-data\"\r\n };\r\n }", "title": "" }, { "docid": "368e525537703d447be358edaa4bb74b", "score": "0.54813266", "text": "function getId(x) {\n\treturn document.getElementById(x);\n}", "title": "" }, { "docid": "4180fe5a7700dbc8e33d4b2fef6b1ea3", "score": "0.5475462", "text": "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "title": "" }, { "docid": "4180fe5a7700dbc8e33d4b2fef6b1ea3", "score": "0.5475462", "text": "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "title": "" }, { "docid": "e92ef3a9c5a231e36437e0443f4e78bb", "score": "0.5470726", "text": "function getCID($element) {\n var cid = 0;\n var id = $element.attr(\"id\");\n if (id[0] === 'h') {\n cid = parseInt(id.substring(1));\n }\n else {\n cid = parseInt(id);\n }\n return cid;\n}", "title": "" }, { "docid": "e2728767c9e29f5a37bafd35fa2a7223", "score": "0.54453367", "text": "function getRoomIdByElement(obj) {\n var str = obj.split(\"-\");\n return str[(str.length-1)];\n}", "title": "" }, { "docid": "dc7da9d862cfb2dbda712521409a4eb8", "score": "0.5433112", "text": "function icm_id (src) {\r\n var a = $x(\"//input[@name='comment[reference_id]']\", src);\r\n if(a.length == 1)\r\n return a[0].value;\r\n}", "title": "" }, { "docid": "b0a4fd4880b87c15a2bd677cdd4cdabc", "score": "0.54322696", "text": "function getCraigslistId(str) {\n var linkRegex = /\\d+/;\n var id = str.match(linkRegex);\n return id[0];\n}", "title": "" }, { "docid": "70296d2fb4c280c618f67478f1929b94", "score": "0.54314417", "text": "function domnavGetFieldSetId($dom) {\n return $dom.closest(\"[name='fieldSet']\").data(\"fieldsetid\");\n }", "title": "" }, { "docid": "fb0bee294208471c79f6936616c3692c", "score": "0.5420348", "text": "function getIdFromUrl(urlData,id){\n\t// let arr = ulr.split(\"-\");\n\tlet arr2 = ulr.indexOf(id);\n\tlet arr3 = ulr.substr(arr2, id.length);\n\treturn arr3;\n}", "title": "" }, { "docid": "08f7ec1058e7e0b949b6764360e2a1b8", "score": "0.54183924", "text": "function dom2id(li)\n {\n var domid = String(li.attr('id')).replace(new RegExp('^' + (p.id_prefix) || '%'), '').replace(/--xsR$/, '');\n return p.id_decode ? p.id_decode(domid) : domid;\n }", "title": "" }, { "docid": "26b88846a9acf59e53577fce01575e57", "score": "0.54166144", "text": "function getENumber(ele) {\n return parseInt($(ele).attr(HTML_NAME).slice(1));\n}", "title": "" }, { "docid": "43ecafe4cca61cb27eab2c24f899ab19", "score": "0.5408041", "text": "get id() {\n return this.getAttributeValue(\"id\");\n }", "title": "" }, { "docid": "c182d8c003e2dd26798f06e5304cd0a8", "score": "0.5391108", "text": "function getMainId() {\n\treturn $('main').attr('id');\n}", "title": "" }, { "docid": "c23633bf04c6db5e8076acacbad253c9", "score": "0.53743976", "text": "function $(id) {\n\t\treturn typeof id == 'string' ? document.getElementById(id) : id;\n\t}", "title": "" }, { "docid": "fa059461c276f626279b9ea921568315", "score": "0.5371584", "text": "get id(){\n let id = this.data.id;\n if (id === undefined){\n id = this._id = (this._id || ++idCounter);\n }\n return id;\n }", "title": "" }, { "docid": "f177c0fd29c5d2c898f0415c96c7a56b", "score": "0.5369054", "text": "function getValue(id) {\n return $(`#${id}`).val();\n}", "title": "" }, { "docid": "429e2d8b24d2491e59f0e089cab3d918", "score": "0.53598493", "text": "findSmallId(obj) {\n\t\tvar i = 1;\n\t\twhile (i in obj) {\n\t\t\ti++;\n\t\t}\n\t\treturn i;\n\t}", "title": "" }, { "docid": "6f9b8d596795c3f0a5134e3753f70ad6", "score": "0.535708", "text": "function id(el){\n return document.getElementById(el);\n}", "title": "" }, { "docid": "b10d3dde53274bf1bc1fb64f3d36b7de", "score": "0.5350042", "text": "function parseid(id){\n\tvar hash = {};\n\tvar tokens = id.split('_');\n\ttokens.each(function(el){\n\t\tvar pair = el.split('-');\n\t\thash[pair[0]] = pair[1];\n\t});\n\treturn hash;\n}", "title": "" }, { "docid": "5865effc085ffea6d4b3bf4c43660ab2", "score": "0.5345483", "text": "function rowNumber(id) {\n let rowArr = [];\n rowArr = id.split(\"c\");\n return parseInt(rowArr[1]);\n}", "title": "" }, { "docid": "7642763f6019677f1fb5dc5b45f20d24", "score": "0.5341572", "text": "function getNum(id) {\n return document.getElementById(id).innerHTML;\n}", "title": "" }, { "docid": "ef69e251df3b58a9fa8d71437ef63f8f", "score": "0.5337109", "text": "function extractId(houseData) {\r\n var extractedId = houseData.url.replace('https://anapioficeandfire.com/api/houses/', '').replace('/', '');\r\n return parseInt(extractedId);\r\n}", "title": "" }, { "docid": "a5b65f946ab5feaadfe2c7f5937203b5", "score": "0.53255695", "text": "function objectId(o) {\r\n\t\tvar prop = \"|**objectid**|\"; // Private property name for storing ids\r\n\t\tif (!o.hasOwnProperty(prop)) // If the object has no id\r\n\t\t\to[prop] = Set._v2s.next++; // Assign it the next available\r\n\t\treturn o[prop]; // Return the id\r\n\t}", "title": "" }, { "docid": "09a3ea88224f27d02b329753a9b2b0ba", "score": "0.5323592", "text": "function i(e){return Object.defineProperty(e.data(),\"id\",{value:e.id})}", "title": "" }, { "docid": "d45385eb54eff785a02ed0f78ce39a5d", "score": "0.53089243", "text": "getLongId() {\n return this.form_.id_ + '-' + this.id_;\n }", "title": "" }, { "docid": "b0efe6b0871894dcebc116cd64d2e904", "score": "0.53059924", "text": "function getID(idWithName)\n{\n //returns the id from the name on the search bar\n return idWithName.split(\".\")[0];\n}", "title": "" }, { "docid": "ef95198c71fad140290d628cae6f919e", "score": "0.5303805", "text": "function getAssocId(obj){\n\tswitch(obj.id.substr(0,3)) {\n\t\tcase \"twe\":\n\t\t\t$zapId = obj.id;\n\t\t\t$zapId = $zapId.slice(10,$zapId.length);\n\t\t\treturn \".btn.tweettag\" + $zapId;\n\t\tcase \"vis\":\n\t\t\t$zapId = obj.id;\n\t\t\t$zapId = $zapId.slice(11,$zapId.length);\n\t\t\treturn \".btn.visualtag\" + $zapId;\n\t\tcase \"\":\n\t\t\t//if its a tag element , check wether its on tweets or tags and return the right zappoint id\n\t\t\tif($('#tag-toggle-button').html() == \"Tweets\"){\n\t\t\t\t$tagId = obj.className;\n\t\t\t\t$tagId = $tagId.slice(27,$tagId.length);\n\t\t\t\treturn \"tweetPoint\" + $tagId;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$tagId = obj.className;\n\t\t\t\t$tagId = $tagId.slice(28,$tagId.length);\n\t\t\t\treturn \"visualPoint\" + $tagId;\n\t\t\t}\n\t}\n}", "title": "" }, { "docid": "5e9688f40c02b1bfa7963b61f9ce44e3", "score": "0.5302655", "text": "function getModalId(){\r\n id = $('#modal_id').val();\r\n name = $('#modal_name').val();\r\n gender = $('#modal_gender').val();\r\n uni = $('#modal_uni').val();\r\n room = $('#modal_room').val();\r\n}", "title": "" }, { "docid": "b7f2004cea40ad36b971d268e5677144", "score": "0.5293814", "text": "function parse_RecalcId(blob, length) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}", "title": "" }, { "docid": "b7f2004cea40ad36b971d268e5677144", "score": "0.5293814", "text": "function parse_RecalcId(blob, length) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}", "title": "" }, { "docid": "b7f2004cea40ad36b971d268e5677144", "score": "0.5293814", "text": "function parse_RecalcId(blob, length) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}", "title": "" }, { "docid": "b7f2004cea40ad36b971d268e5677144", "score": "0.5293814", "text": "function parse_RecalcId(blob, length) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}", "title": "" }, { "docid": "b7f2004cea40ad36b971d268e5677144", "score": "0.5293814", "text": "function parse_RecalcId(blob, length) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}", "title": "" }, { "docid": "b7f2004cea40ad36b971d268e5677144", "score": "0.5293814", "text": "function parse_RecalcId(blob, length) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}", "title": "" }, { "docid": "f8bccc51688ef493b36657d6ed6d058c", "score": "0.5287087", "text": "function id(a){ return a }", "title": "" }, { "docid": "4431f90ce9c4b1e4a980287aac7a50bc", "score": "0.52799666", "text": "getId(){\r\n return this.#id;\r\n }", "title": "" }, { "docid": "2077973bb6d04e8d2a1b1b05a7ad6aa2", "score": "0.5275175", "text": "get value() {\n return this.id.substring(1, this.id.lastIndexOf('\"'));\n }", "title": "" }, { "docid": "2077973bb6d04e8d2a1b1b05a7ad6aa2", "score": "0.5275175", "text": "get value() {\n return this.id.substring(1, this.id.lastIndexOf('\"'));\n }", "title": "" }, { "docid": "1f9da5967e598c1f6b26a54bcf22266c", "score": "0.5273118", "text": "function GetModuleidFromEditContainer(obj)\n{\n var parent = obj.parents('div[data-m_moduleid]');\n if (parent.length)\n return parent.attr('data-m_moduleid');\n else\n alert(\"GetModuleidFromEditContainer(): Failed to find parent container\");\n}", "title": "" } ]
c12ec0ab460ce55960e62927557afb08
MAKE SURE THE USER EXISTS, THEN TEST IF THE THE REQUESTED ID IS IN THE USER'S LIST ALREADY
[ { "docid": "60392b46ab2020bdf7b891d7a763f21c", "score": "0.0", "text": "function removeStar(req, res, user) {\n Star.findByIdAndUpdate(\n req.body.id,\n {$inc: {Bookmarks: -1}},\n {safe: true},\n function(err, model) {\n if (err) {\n console.log('Error removing bookmarks for ' + model.Username + ': ' + err);\n } else if (!model) {\n console.log('fail model DNE');\n }\n console.log(\"running\");\n console.log(model.Bookmarks);\n });\n User.findByIdAndUpdate(\n user.id,\n {$pull: {StarFavorites: req.body.id}},\n {safe: true},\n function(err, model) {\n if (err) {\n console.log('Error removing bookmarks for ' + model.Username + ': ' + err);\n res.send(\"error removing favorites\");\n } else if (!model){\n console.log('fail, model DNE');\n res.send(\"failure removing bookmark, user model DNE\");\n } else {\n console.log('removed star');\n res.send(\"success removing bookmark\");\n }\n });\n}", "title": "" } ]
[ { "docid": "e7d7480dc8326ee0b315bd2976dae702", "score": "0.7255328", "text": "function userExists(user){\n\n}", "title": "" }, { "docid": "bb80e7829c72148de3d67019cc23a6df", "score": "0.7106823", "text": "userExists(user) {\n return this.users.indexOf(user) != -1;\n }", "title": "" }, { "docid": "906fd0c8f13e8332bba95c47c6d2b691", "score": "0.69276434", "text": "function checkUser(){\n $.ajax({\n url: '/api/currentuser',\n method: \"GET\"\n }).done(function(res1){\n if (data === res1.id){ //i.e if the current user is the recipient of the request\n receivedRequest(); // which shows the request in the request management portal\n } else {\n return; // do nothing\n }\n });\n }", "title": "" }, { "docid": "436e2197d9cf479ea7e9ed485fbaaec9", "score": "0.686631", "text": "function availableId(user) {\n return db('users')\n .where({ id: user })\n .then(result => {\n if (result.length) {\n return false\n } else {\n return true\n }\n })\n}", "title": "" }, { "docid": "7d6a9dd9f0fb8654eb64bb02ef1e82b1", "score": "0.68639845", "text": "static async checkExisting(ctx, next) {\n const { field, value } = ctx.params\n const conditionalWhere = {}\n conditionalWhere[field] = value\n\n const user = await User.query({ where: conditionalWhere }).fetch()\n if (!user) {\n ctx.body = JRes.success(Responses.USER_EXISTS)\n return\n }\n\n SendError(ctx, 400, Responses.USER_NOT_FOUND)\n }", "title": "" }, { "docid": "3e54caab72d56836911f49965dd6c20f", "score": "0.685223", "text": "async isUserExists(ctx, next) {\n const total = await db.model('User').count({\n _id: ctx.params.id\n }).exec();\n if (total < 1) {\n return ctx.throw(400, 'User not found');\n }\n next();\n }", "title": "" }, { "docid": "8ab1243446f50877fd62229e902aea6c", "score": "0.6831783", "text": "exists(user) {\n return this.selected.indexOf(user._id) > -1;\n }", "title": "" }, { "docid": "228d91a5be6c2ce5739673f86e6f3414", "score": "0.68077564", "text": "function doesUserExist(userId){\r\n let user = getUserFromId(userId);\r\n if(user == null){\r\n return false;\r\n }else{\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "e6ab64078407c69fef62a71157460f8d", "score": "0.6749146", "text": "function checkIfUserExists(userId, shouldCreate) {\n console.log('[checkIfUserExists] userId: ', userId);\n\n // var usersRef = new Firebase(usersRef);\n return usersRef.child(userId).once('value', function(snapshot) {\n console.log('snapshot: ', snapshot.val());\n var exists = (snapshot.val() !== null);\n if(exists){\n //get user info\n userData = snapshot.val();\n return true;\n }\n else if(shouldCreate){\n console.log('userData: ', userData);\n var email = 'email' in userData ? userData.email : null;\n var provider = 'provider' in userData ? userData.provider : 'twitter';\n usersRef.child(userId).set({userId:userId, displayName:userData.displayName, email:email, provider:provider});\n loggedIn = true;\n return true;\n }\n else{\n return false;\n }\n // return userExistsCallback(userId, exists);\n });\n }", "title": "" }, { "docid": "0b9645baae85fc1df50b9b5de34b350f", "score": "0.67062473", "text": "function existsUser(userId){\n return Meteor.users.findOne({ _id: userId }) !== undefined;\n }", "title": "" }, { "docid": "1232af948ab395812461a7f4d5006859", "score": "0.6669956", "text": "function isUserExist(id, callback_InsertUser, callback_UserRegistered) {\n User.find({ id: id}, function(err, data) {\n if (data.length == 0) {\n callback_InsertUser();\n } else {\n callback_UserRegistered();\n }\n });\n}", "title": "" }, { "docid": "fc956000a9ad9cf9a3bc315c34e184ea", "score": "0.66513026", "text": "function checkUserExistence(cookie) {\n for (let key in users) {\n if (cookie === users[key].id) {\n return true;\n }\n }\n}", "title": "" }, { "docid": "a939a03fe8ece8d2398d70048ac83f63", "score": "0.6626281", "text": "function checkUserExists(obj, list) {\n for(let i=0; i<list.length; i++) {\n // check if username exists\n if( list[i].email === obj.email ){\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "1666f2c1ceaa71716f205a4c93347e06", "score": "0.6590034", "text": "userExists(user) {\n return this.users.has(user);\n }", "title": "" }, { "docid": "9dab1244a3b9a71cbcb0efa8aaca7875", "score": "0.65661365", "text": "function FindUserById(id, list) {\n var i;\n for (i = 0; i < list.length; i++) {\n if (list[i].id == id) {\n return list[i];\n }\n };\n\n return false;\n}", "title": "" }, { "docid": "09d5b1b2a970973685c661dba5f7e263", "score": "0.6552687", "text": "function checkExistence(){\n return (req,res,next)=>{\n userCtrl.findByOpenId(\n req.decoded.openid,\n (err,user)=> {\n if (err) res.status(500).send(\"Error while logging in\");\n else if (user === null || user === \"\") {\n next();\n }\n else if (user !== null || user !== \"\") { \n let err=new Error(\"User is already registered\") \n err.status=403;\n next(err);\n }\n }) \n };\n}", "title": "" }, { "docid": "e51d24b63462825df3b38bd5fd469f61", "score": "0.6549221", "text": "function isOwnedByUser(list, access, res) {\n return list.userID === res.locals.id || (access === \"read\" && list.userID === \"quickpick.admin\");\n}", "title": "" }, { "docid": "31cbd36e1a43e762a5e764e001aac962", "score": "0.6529185", "text": "checkUserExists (userId) {\n console.log('ConcreteClass user exists ' + userId)\n return true\n }", "title": "" }, { "docid": "aa230ede94e73be92fc73f30a6043343", "score": "0.6520245", "text": "function checkIdExist(req, res, next) {\n const { id } = req.params;\n const index = projects.find(p => p.id == id);\n if (!index) {\n return res.status(400).json({ error: \"User does not exist\" });\n }\n return next();\n}", "title": "" }, { "docid": "04a665dbeca7d6b46b308fdc59406df2", "score": "0.6513061", "text": "checkUser() {\n\t\tthis.props.client\n\t\t\t.query({\n\t\t\t\tquery: this.GET_USERS_QUERY,\n\t\t\t\tvariables: {\n\t\t\t\t\tCode_User: `'${this.state.username}'`,\n\t\t\t\t\tPassword: `'${this.state.password}'`\n\t\t\t\t},\n\t\t\t\tfetchPolicy: 'no-cache'\n\t\t\t})\n\t\t\t.then((data) => {\n\t\t\t\tif (data.data.getvalid_users.length == 1) {\n\t\t\t\t\twindow.location.href = '/home';\n\t\t\t\t} else {\n\t\t\t\t\tthis.props.handleOpenSnackbar('error', 'Error: Loading users: User not exists in data base');\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.props.handleOpenSnackbar('error', 'Error: Loading users: ', error);\n\t\t\t});\n\t}", "title": "" }, { "docid": "2eaeab9fa1c05946ae4c49385da7c500", "score": "0.65099156", "text": "function checkIfProfileExists(id) {\n// console.log(\"userid function \" + userId)\n API.getDj(id)\n .then(function (res) {\n if (res.data.length >= 1) {\n // funct(res.data[0]._id);\n } else {\n window.location.replace(\"/dj/signup\");\n }\n })\n .catch((err) => console.log(err));\n}", "title": "" }, { "docid": "6dc11935618e8003fdbf04dd6ba83c3a", "score": "0.64745593", "text": "checkNewUser(user) {\n (async () => {\n const data = await API.graphql(graphqlOperation(listUsers, {\n filter: { username: { eq: user.username } }\n }));\n console.log(data.data.listUsers);\n if(data.data.listUsers.items.length == 0) {\n API.graphql(graphqlOperation(createUser, {\n input: {\n username: user.username,\n email: user.attributes.email,\n emailVerified: user.attributes.email_verified\n }\n }))\n .then(data => console.log(\"New User Created: \" + data.data.createUser.username));\n }\n })();\n }", "title": "" }, { "docid": "bc97900dbd31e9af731575b9c8ab19c7", "score": "0.6466495", "text": "function checkIfUserExist(pObj, pJournalId, pMode, pDocumentId, pRoundId, pRole, pSource){\n\t$.ajax({\n\t\turl : gCreateUserPageUrl,\n\t\tdataType : 'json',\n\t\t//async : false,\n\t\tdata :{\n\t\t\tajax \t\t: 1,\n\t\t\tjournal_id \t: pJournalId,\n\t\t\tmode\t\t: pMode,\n\t\t\tdocument_id\t: pDocumentId,\n\t\t\tround_id\t: pRoundId,\n\t\t\trole\t\t: pRole,\n\t\t\tsource\t\t: pSource,\n\t\t\ttAction \t: 'showedit',\n\t\t\temail \t\t: $(pObj).val()\n\t\t},\n\t\tsuccess : function(pAjaxResult){\n\t\t\t//~ $('#user_roles_checkbox input').each(function(){\n\t\t\t\t//~ var lSE = $(this).attr('value') == '3';\n\t\t\t\t//~ if(lSE == true)\n\t\t\t\t\t//~ $('#categories_holder').css('display', 'block');\n\t\t\t\t\t//~ // lSE.trigger('click');\n\t\t\t\t\t//~ // alert(lSE);\n\t\t\t\t\t//~ $(this).click();\n\t\t\t\t//~ // $(this).trigger('click');\n\t\t\t//~ });\n\t\t\t//~ lRole = $('#user_roles_checkbox input:nth-child(1)').val();\n\t\t\tif(pAjaxResult){\n\t\t\t\t$('#dashboard-content').html(pAjaxResult['html']);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "18843de55fcc1428e77232e48a2167d1", "score": "0.6463229", "text": "function userExist() {\n\tif (localStorage.getItem('User')) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "b09fb2a895d8b6956691c173f8343c76", "score": "0.64257467", "text": "async tryFindInvitedUser () {\n\t\tconst company = await this.data.companies.getById(this.request.params.id.toLowerCase());\n\t\tconst users = await this.data.users.getByQuery(\n\t\t\t{\n\t\t\t\tsearchableEmail: this.user.email.toLowerCase()\n\t\t\t},\n\t\t\t{\n\t\t\t\thint: UserIndexes.bySearchableEmail\n\t\t\t}\n\t\t);\n\t\treturn users.find(user => {\n\t\t\treturn (\n\t\t\t\t(user.get('teamIds') || []).length === 1 &&\n\t\t\t\tuser.get('teamIds')[0] === company.get('everyoneTeamId')\n\t\t\t)\n\t\t});\n\t}", "title": "" }, { "docid": "5f0fbe8fe2df89871b3de74ebe0346e4", "score": "0.64168155", "text": "function checkUserExists(userInfo, callback){\r\n getUniversityId(userInfo.domain, function(id){\r\n pool.none(`INSERT INTO shelf.users(username, email, uid) \r\n SELECT $1, $2, $3\r\n WHERE NOT EXISTS(\r\n SELECT username, email FROM shelf.users WHERE email = $2\r\n )`, [userInfo.username, userInfo.email, id])\r\n .then(function(){\r\n callback(\"done\");\r\n })\r\n .catch(function(error){\r\n console.log(error);\r\n callback(\"error\");\r\n });\r\n });\r\n}", "title": "" }, { "docid": "cc281c29f485a22ecf9eb4e59f095bb3", "score": "0.6409205", "text": "function checkUserIfExist(req, res, next){\n const userId = req.params.userId;\n User\n .find({ _id: userId })\n .exec()\n .then(user => {\n if(!user){\n res.status(500).json({\n state: false\n })\n } else{\n next()\n }\n })\n .catch(err => {\n res.status(500).json({\n state: false,\n Message: \"User Not Exist\"\n })\n })\n}", "title": "" }, { "docid": "b3f26adccfd94a9ce35bf515cee9a059", "score": "0.63922375", "text": "function checkUserExists(username) {\r\n console.log(\"Checking user exists\");\r\n var response = false;\r\n for (var i = 0; i < playerList.length; i++) {\r\n console.log(playerList[i].username);\r\n console.log(username);\r\n if (playerList[i].username === username) {\r\n response = true;\r\n console.log(\"playerlist: \" + playerList)\r\n }\r\n }\r\n console.log(\"playerList \" + playerList)\r\n console.log(\"Response \" + response)\r\n return response\r\n}", "title": "" }, { "docid": "118f2e29b34c5f21bc7cfd4bdccda501", "score": "0.63905776", "text": "function checkForId() {\n\n\tif(getCurrentUserId()) {\n\t\tconsole.log(\"You are logged in\");\n\t} else {\n\t\twindow.location= \"/login\";\n\t}\n\n}", "title": "" }, { "docid": "0d236da37fe3cfc43b9244fa8b33a31c", "score": "0.6383416", "text": "function isCheck(user) {\n if (list == null || list.length == 0) {\n return false;\n }\n for (var i = 0; i < list.length; i++) {\n if (list[i] == user) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "7d7449bc7d5aa3abd94eb9a0c8a1364f", "score": "0.6382138", "text": "function findUser(username) {\n return list.indexOf(username) === -1;\n\n}", "title": "" }, { "docid": "b90f8cc5959135de1942d130e66bad92", "score": "0.63600796", "text": "function seekUser(name){ //----> OK\n\tvar existe = false;\n\tfor (var i = 0; i < list_user.length; i++) {\n\t\tif (name == list_user[i].user){\n\t\t\treturn existe = true;\n\t\t\tbreak\n\t\t}\n\t}\n\treturn existe\t\n}", "title": "" }, { "docid": "2d543d19838ac266da74bc2479da5bbf", "score": "0.6358278", "text": "function checkUserId(user) {\n var userId = user || \"\";\n if (userId) {\n $.get(\"api/users?user_id=\" + userId, function (data) {\n var i = userId - 1;\n userNameInput = data[i].name;\n bioInput = data[i].bio\n console.log(data[i].points_earned)\n loadUser();\n });\n }\n }", "title": "" }, { "docid": "3f64a8fca1e67dd7d57069e8686b933f", "score": "0.6345956", "text": "function checkForUser() {\n\n if (url.indexOf(\"?user_id=\") !== -1) {\n userId = url.split(\"=\")[1];\n checkUserId(userId);\n }\n else {\n // window.location.href = \"/challenges\";\n }\n }", "title": "" }, { "docid": "1d1a448eed5dbd76d3f38f93ab3748fb", "score": "0.6343396", "text": "function existsUserRoleProcess(){\n \tvar dataSource = View.dataSources.get('ds_ab-sp-asgn-current-user-role');\n \tvar records = dataSource.getRecords();\n \tif(records.length>0){\n \treturn true;\n \t}\n \treturn false;\n }", "title": "" }, { "docid": "416d81808bc0fc614a37e35be0c44382", "score": "0.6338588", "text": "function findUserList(user_id){\n for(let id in urlDatabase){\n if (user_id === id){\n return true;\n }\n }\n}", "title": "" }, { "docid": "810b711540485d5c7521ab9d8601095d", "score": "0.6333017", "text": "function fnUserExists(username){\n return fnListUsers().includes(username);\n}", "title": "" }, { "docid": "d0213fe440c724c674fc75b4c0ae56a9", "score": "0.6332417", "text": "async checkId(id) {\n try {\n await this.userService.checkUser(id);\n return true\n }catch(err){\n return false\n };\n }", "title": "" }, { "docid": "aa734eab836255c831e5d5e479fbcd3a", "score": "0.6300565", "text": "function checkMemeber(user_id, callback) {\n if (!user_id) return;\n if (!callback) return;\n\n avoscloud.users.get({\n where: JSON.stringify({username: user_id}) // This is ugly\n }, function(data) {\n var user = data.results;\n if (user.length > 0)\n return callback(null, true);\n\n return callback(null, false);\n }, function(err) {\n return callback(err);\n });\n }", "title": "" }, { "docid": "e815e93833354d7a9415440e478dfb56", "score": "0.62942165", "text": "function check_user_in_users(data)\n{\n const email = data[0];\n return new Promise((resolve, reject) =>\n {\n console.log(\"checking if user already exists\");\n db.query(\"SELECT * FROM ?? WHERE EMAIL=?\", [init.db.user_table, email], (err, res) =>\n {\n if (err) reject([err.code, err.sql]);\n\n console.log(res);\n\n if (res !== undefined && res.length > 0) reject(\"User already exists.\");\n else resolve(data);\n });\n });\n}", "title": "" }, { "docid": "9dffe0788751c865786748dac299126a", "score": "0.6291558", "text": "function findUser(id) {\n for(let i = 0; i < users.length; i++) {\n if(users[i].id == id) return true;\n }\n return false;\n}", "title": "" }, { "docid": "3773e5457e66d76aa6b5094cbf0c931a", "score": "0.62907386", "text": "function doesUserExistByEmail(email, callback){\n\n // Get a list of the users and check if the email is in it\n listUsers(function(err, result){\n\n var userExists = false;\n\n if(err){\n console.log('error retrieving keystone userList');\n }else{\n // Loop through the results to find user\n\n //console.log('user list length: '+ result.users.size );\n\n result.users.forEach(function(item){\n\n if(item.name == email){\n userExists = true;\n }\n });\n\n callback(null, userExists);\n }\n });\n}", "title": "" }, { "docid": "5590a77ce902b424c870fcb2cec6ab6c", "score": "0.6262371", "text": "function checkUser(name) {\n var findUser = onLineUsers.find(u => u.name == name);\n return findUser ? true : false;\n }", "title": "" }, { "docid": "20bb1479fc5654eda43ed9a3b8005753", "score": "0.625096", "text": "function checkUserId(req, res, next) {\n const { id } = req.params;\n const project = allProjects.find(one => one.id == id);\n if (!project) {\n return res.status(400).json({ message: 'No matching project found' });\n }\n return next();\n}", "title": "" }, { "docid": "bd4ee4a62c1c39a6482f3c3d98b5e1f1", "score": "0.62483823", "text": "function checkCreatorIsUser(){\n if($scope.event){\n //check user is logged in\n if(!$scope.isAuthenticated()){\n $scope.checkCreatorIsUser = false;\n }\n\n if(!$scope.event.createdBy._id){\n $scope.checkCreatorIsUser = false;\n }\n\n if($scope.getPayload().sub === $scope.event.createdBy._id){\n $scope.checkCreatorIsUser = true;\n }else{\n $scope.checkCreatorIsUser = false;\n }\n }\n }", "title": "" }, { "docid": "961ffb1bdb74c62ab35c1668aca7f4f5", "score": "0.62457615", "text": "function checkIfUserExists(userId) {\n var usersRef = new Firebase(profilesLocation);\n usersRef.child(userId).once('value', function(snapshot) {\n var exists = snapshot.exists();\n userExistsCallback(userId, exists);\n });\n }", "title": "" }, { "docid": "1da4972ba4e1ac73a10553072f3bff17", "score": "0.624277", "text": "function isUser(userList, username){\n return username in userList\n}", "title": "" }, { "docid": "12ac58e1bbf2476576d20b53def8c8bc", "score": "0.6241999", "text": "static userExistBefore(user, res) {\n\n return res.json({\n status: false,\n message: 'Sorry that email is already used'\n })\n\n }", "title": "" }, { "docid": "f80cbae86de8ed301655ed026f67efdc", "score": "0.62401104", "text": "function userLoggedIn() {\n return USER.id > 0;\n}", "title": "" }, { "docid": "62eb36da39d7212df1f4b93b7118c0fc", "score": "0.6234019", "text": "userExists(users, user, index) {\n if (index == users.length) {\n return false;\n }\n if (users[index].userId === user.userId) {\n return index;\n } else {\n return this.userExists(users, user, index + 1);\n }\n }", "title": "" }, { "docid": "2aa6057dc3d88c7b0910c781f4304440", "score": "0.6226577", "text": "function verifyId(req, res, next){\n const id = req.params.id;\n\n Users.findById(id)\n .then(item => {\n if(item){\n req.item = item;\n next();\n } else {\n res.status(404).json({ message: \"User Not Found.\" })\n }\n })\n .catch(err => {\n res.status(500).json(err)\n })\n}", "title": "" }, { "docid": "540cbb273c9c861639c6116abc3406e4", "score": "0.62215894", "text": "id_exists(unique_id) {\n return this.participants[unique_id] !== undefined;\n }", "title": "" }, { "docid": "0d79c7586c3a7e93107c18bcdf2e745d", "score": "0.62176484", "text": "function checkIfUserExists(userId, response) {\n var usersRef = database.ref(USERS_LOCATION);\n usersRef.child(userId).once('value', function(snapshot) {\n var exists = (snapshot.val() !== null);\n\n //console.log(exists);\n if(exists == false){\n\n userExistsCallback(exists, response);\n }else {\n //console.log(exists);\n userExistsCallback(exists, response);\n }\n\n });\n }", "title": "" }, { "docid": "cd235843e470bf2ae55a23a9e7050e2a", "score": "0.62059486", "text": "isUserExists(value, type) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet sql = `select contact_id from contact where ${type} = '${value}'`;\n\t\t\tDbInstance.executeQuery(sql).then(userData => {\n\t\t\t\tresolve(userData);\n\t\t\t}).catch(err => {\n\t\t\t\treject(err);\n\t\t\t});\n\t\t})\n\t}", "title": "" }, { "docid": "624c4c87ea0f88a098363ba05a0301a6", "score": "0.6197487", "text": "function exists (ctx, username) {\n username = userMap.normalize(username)\n\n // Extract stuff from storage:\n var userStorage = new UserStorage(ctx.localStorage, username)\n var pinAuthId = userStorage.getItem('pinAuthId')\n var pinBox = userStorage.getJson('pinBox')\n if (!pinAuthId || !pinBox) {\n return false\n }\n\n return true\n}", "title": "" }, { "docid": "f940a96b6e025b38134174985c50dc03", "score": "0.619575", "text": "async function checkUser(req, res, next){\n const id = req.params.id;\n const userExists = await User.getById(id)\n if(userExists){\n next()\n }else{\n res.status(500).json('This User does not exist or you have no plants')\n }\n}", "title": "" }, { "docid": "7de1e9500257407d437224a4caf03500", "score": "0.6193966", "text": "checkRegister(user) {\n API.getAllCategory(`users/?username=${user.username}`).then(data => {\n if (data.length === 0) {\n API.saveItem(\"users\", user).then(newUser => {\n let currentUser = new comp.user(newUser);\n sessionStorage.setItem(\"currentUser\", JSON.stringify(newUser));\n console.log(\"Username checkRegister: \", currentUser)\n navBar.loadNavBar();\n buildMissionControl.printPlanets();\n })\n } else if (data.length === 1) {\n $(\"#usernameExistsRegister\").toggle();\n }\n })\n }", "title": "" }, { "docid": "005db1502d39d7f62ebdb30e0ca999b6", "score": "0.61755687", "text": "function isUser(userList, username){\n \treturn username in userList\n}", "title": "" }, { "docid": "fd64e484545848cef9dd04bbc2fee2c1", "score": "0.61709934", "text": "function findUserByName(userId) {\n console.log('userId---------------' + userId);\n for (var socketID in people) {\n console.log('http' + (0, _stringify2.default)(people[socketID]));\n if (people[socketID] === userId) {\n console.log('socketId-----------' + socketID);\n return test = socketID;\n }\n }\n // return false;\n console.log('not there');\n }", "title": "" }, { "docid": "ccccb9975dea49801acb61c080322031", "score": "0.6132589", "text": "function loggedInUserExists(username){\n let output = loggedIn.find(user =>user.username === username);\n if (output){return true};\n return false;\n}", "title": "" }, { "docid": "d4424a41219e12a4edb6716c6bfc3388", "score": "0.61244416", "text": "function isUser(userList, username) {\n return username in userList\n}", "title": "" }, { "docid": "99dbd97114c44c59a458c7f4093f44b8", "score": "0.6121113", "text": "function checkPrivilige(req) {\n product.findById(req.body.productOID, function (err, result) {\n if (err) {\n console.log(err);\n callback(false);\n } else {\n\n if (result.familyID == req.session.family) { // User has rights for this action\n callback(true);\n } else { // User is not allowed\n callback(false);\n }\n\n }\n });\n}", "title": "" }, { "docid": "b48205a9ad82e8ee3ccbc088ec232c28", "score": "0.6114475", "text": "function isOwner (competitionId, user, failureCB, successCB) {\n db.get(queries.getCompetitionById, [competitionId], function (err, row) {\n if (err) {\n console.log(err.message);\n failureCB();\n }\n\n if (row.creator_id != user.id) {\n // TODO error message\n // perhaps a parameter?\n failureCB();\n }\n\n successCB();\n })\n}", "title": "" }, { "docid": "7965ab517c573547c4e8adc941dfae9b", "score": "0.6109221", "text": "function checkUnique(name){\n\tif(userList.indexOf(name) == -1){\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "768f08a386ad9daa4346765defed8035", "score": "0.6104722", "text": "function checkForExistingUser(users, username) {\n console.log(\"checkForExistingUser\");\n users.forEach(function(user) {\n // if username already exists in backend,\n // create JS user object and set equal to currentUser\n // call displayUser\n if (user.username === username) {\n currentUser = new User(user.username, user.id);\n userBoards = user.boards;\n displayUser();\n }\n });\n // if currentUser doesn't exist, call postUser\n if (currentUser === undefined || currentUser === null) {\n userBoards = null;\n postUser(username);\n }\n}", "title": "" }, { "docid": "9381d5cdb623d1b8833be69c4c7a2a8c", "score": "0.61037844", "text": "function verUser (longitud, user) {\r\n\tvar status = false;\r\n\tif (longitud >= 1){\r\n \t\tfor (var i in listNewUser){\r\n \t\tif (user == listNewUser[i].user){\r\n status = true;\r\n break;\r\n }\r\n else{\r\n status = false;\r\n }\r\n }\r\n }\r\n return status;\r\n}", "title": "" }, { "docid": "5c7e3d9722aaed8ee6a61e99270f1db0", "score": "0.6102008", "text": "function checkIdPrivilege (req, res, next) {\n if (req.user[\"_id\"].toString() === req.params.userId) {\n next();\n } else {\n res.status(httpStatus.FORBIDDEN).send(null);\n }\n\n}", "title": "" }, { "docid": "0f721b1d9839a604b4e7461b1c3c898e", "score": "0.60747826", "text": "function isAuthorized(userid) {\n\n for(i = 0; i < authorized_users.length; i++) \n if(authorized_users[i ] == userid) return true;\n \n return false;\n}", "title": "" }, { "docid": "6d9830fdc7bc299a8a67732502ae8b2c", "score": "0.60698515", "text": "function isOwnerOf(data){\n var currentUserId = $('.user-info').data('uid');\n if(data == currentUserId){\n return(true);\n }else{\n return(false);\n }\n}", "title": "" }, { "docid": "b1e789092a95a34150bd92f547d57a29", "score": "0.6064974", "text": "function userExists(username){\n let output = users.find(user =>user.username === username);\n if (output){return true};\n return false;\n}", "title": "" }, { "docid": "aac6d7886ec0998dc072a7cb2f6f9fa4", "score": "0.6064771", "text": "function getUser (userInfo) {\r\n for (id in users) {\r\n if (users[id].id == userInfo || users[id].email == userInfo) {\r\n return users[id]\r\n break\r\n }\r\n }\r\n return false\r\n}", "title": "" }, { "docid": "24b772b10b172ebc6593d216020a0823", "score": "0.6050803", "text": "function userExists(userArray, id) {\n for (let i = 0; i < userArray.length; i += 1) {\n if (userArray[i].id === id) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "e7927d13553fea1469aff95185463721", "score": "0.6040115", "text": "function isAuthent() {\n\treturn localStorage.getItem(\"userId\");\n}", "title": "" }, { "docid": "3e7a013317e1b122698d5b03e0243433", "score": "0.60332614", "text": "function checkIfUserExists(userId) {\n\n return new Promise(function(resolve, reject) {\n\n database.ref().child(\"users\").child(userId).get().then((snapshot) => {\n resolve(snapshot.exists());\n });\n\n });\n\n \n }", "title": "" }, { "docid": "5c33d616aa8cedd9229f688d2ab796b9", "score": "0.6031034", "text": "usernameNotTaken(username){\n if(username){\n if(USERS.find(function (user) {//if credentials match existing user, username is taken\n return (user.Username === username);\n })) {\n\n\n console.log('[LOGIN] Validation failure, username is taken!!');\n return false;\n }\n else {\n\n return true;\n }\n }\n }", "title": "" }, { "docid": "207426879759e255750bc3f42aeeb606", "score": "0.6030719", "text": "function doesUserExist (req, res) {\n _db.users.findOne({\n email: req.body.email\n }, function(err,dbres) {\n if (err)\n if(res) res.status(503).end(JSON.stringify(err))\n if (dbres)\n if(res) res.status(400).end(\"User Exists\");\n else\n if(res) res.status(401).end(\"User Doesn't Exist\")\n });\n}", "title": "" }, { "docid": "318c8e61ee81006a03a12a316268a5f1", "score": "0.60298365", "text": "lookup(req, res) {\n const email = req.body.email;\n User.findOne({\n where: { email },\n })\n .then((user) => {\n if (user) {\n // Email is already in use\n res.sendStatus(403);\n } else {\n res.sendStatus(200);\n }\n })\n .catch((err) => console.log(`Error looking user up, ${err}`));\n }", "title": "" }, { "docid": "6099346abb9f6f32c902c79416fc51c3", "score": "0.6026467", "text": "friendRequestedYou() {\n return this.props.auth.friendRequests.filter(user => user.spotifyId === this.props.user.spotifyId).length > 0;\n }", "title": "" }, { "docid": "0154a910c2bf038e1985127b2366a74a", "score": "0.6018824", "text": "function checksExistsUserAccount(request, response, next) {\r\n const { username } = request.headers;\r\n\r\n const user = users.find((user) => user.username === username);\r\n\r\n if(!user) {\r\n return response.status(404).json({ error: \"User not found\"})\r\n }\r\n\r\n request.user = user;\r\n\r\n return next();\r\n}", "title": "" }, { "docid": "f4455f70c69d3f481cadbae546be17db", "score": "0.601412", "text": "function userExists(email) {\n return users.some(function (el) {\n return el.email === email;\n });\n}", "title": "" }, { "docid": "0f273b2b764eadcb52a6d5dfa2adbd8e", "score": "0.60124147", "text": "function userExist(user) {\n // Check if user contains only letters\n if (lettersOnly(user)) {\n // if users array is not empty\n if (users.length) {\n let i = 0;\n\n users.forEach((element) => {\n if (user.toLowerCase() == element.user.toLowerCase()) {\n i++;\n }\n });\n\n if (i > 0) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "9ff5222b50416daa22ddd08df1a95121", "score": "0.6009232", "text": "async function userExists (email) {\n // api.get('/exist/email/:email', utilCtrl.emailExists)\n}", "title": "" }, { "docid": "fe45cd24ea9da3d3c5adc47d238fa93a", "score": "0.60010105", "text": "async checker() {\n\n const wmUserId = this.ctx.query.userid;\n const userName = this.ctx.query.name;\n const wmUserLvl = 1;\n const shopId = this.ctx.query.shopid;\n const token = this.ctx.query.token;\n\n if (!this.validateToken(token)) {\n this.ctx.redirect.redirect('/public/404.html');\n return;\n }\n\n if (!await this.existOrInsert({ wmUserId, userName, wmUserLvl })) {\n this.ctx.response(403, `update user's info failed`);\n return;\n }\n\n const assigned = await this.service.counterUser.count({ userId: wmUserId }, ['id']);\n if (assigned) {\n this.ctx.redirect(`/public/checker.html?userId=${wmUserId}&shopId=${shopId}`);\n return;\n }\n\n this.ctx.redirect(`/public/checkout.html?userId=${wmUserId}&shopId=${shopId}`);\n return;\n }", "title": "" }, { "docid": "59d97001f72dbe68b2b91dcd926a2c1b", "score": "0.600064", "text": "function existUser(newUser){\n\n\tfor (var i = 0; i < user.length; i++) {\n\t\t\n\t\tif(user[i].nom == newUser.nom\n\t\t\t&& user[i].prenom == newUser.prenom\n\t\t\t&& user[i].mail == newUser.mail){\n\t\t\treturn i;\n\t\t}\n\t}\n\t\n\treturn -1;\n}", "title": "" }, { "docid": "d470c49713f700dd5f0250f741e9eb7d", "score": "0.6000529", "text": "function existUser(){\n\t\tif(peticionHTTP.readyState == 4)// valor numerico del estado de la peticion\n\t\t\tif(peticionHTTP.status == 200){// valor numerico de una respuesta correcta\n\t\t\t\t\t//alert(peticionHTTP.responseText);\n\t\t\t\t\tif(peticionHTTP.responseText==\"1\"){\n\t\t\t\t\t\t//alert(\"Usuario\");\n\t\t\t\t\t\twindow.location=\"php/user.php\";\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if(peticionHTTP.responseText==\"2\"){\n\t\t\t\t\t\t//alert(\"Administrador\");\n\t\t\t\t\t\twindow.location=\"administrador/index.php\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\talert(\"No existe el Usuario\");\n\t\t\t\t\t\tlimpiarLogin();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t}//end if1\n\t}//end func", "title": "" }, { "docid": "f503bb335b4b40c592e5ed80e827935f", "score": "0.5998531", "text": "function userChecker() {\n return currentUser.getToken()\n .then(function(idToken) {\n return $http({\n method: 'GET',\n url: '/users',\n headers: {\n id_token: idToken\n }\n })\n .then(function(response) {\n return response;\n })\n .catch(function(err) {\n console.log(\"getUser in UserFactory err: \", err);\n throw err;\n })\n })\n }", "title": "" }, { "docid": "ce110d0fb12f9cd977a7740edca63a3c", "score": "0.5997691", "text": "function checkId(){ \n\tdb.localQuery(\"uniqueId\", function(data){\n\t\tif (data.device_id != undefined && data.device_id[0].prop_value > 0 ) {\n\t\t\tconsole.log(\"device verified\");\n\t\t\treactToId(true); \n\t\t} else {\n\t\t\tconsole.log(\"device unverified\");\n\t\t\treactToId(false);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7f1e4401ba42c8ac19d30a36f59e8ebe", "score": "0.5982875", "text": "function userExists(email) {\n for (let key in users) {\n if(users[key].email === email) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "380337f3e4969ffe38f770e56fccd3d0", "score": "0.59791774", "text": "function checkID(id, cb)\n{\n Connection.query(\n `SELECT * FROM user WHERE user_id = ` + id, \n function(err, rows)\n {\n if(err) cb(0)\n else cb(rows.length)\n \n }\n )\n}", "title": "" }, { "docid": "54b7fb17ffa9ad86058438e35a9dfcd5", "score": "0.597735", "text": "@action\n async checkIfUserExists (email) {\n this.isLoading = true;\n try {\n const userExist = await checkUser(email);\n this.isLoading = false;\n return userExist.body.available;\n } catch (e) {\n console.log(e);\n }\n this.isLoading = false;\n }", "title": "" }, { "docid": "a503f7b7670df5be5aa012e600b231d1", "score": "0.59508723", "text": "function check_if_user_already_has_asession() {\n\t\t\t/**\n\t\t\t * IF THE USER ALREADY HAS THE SESSION STARTED THE SEND IT TO \n\t\t\t * PHP PAGES TO ALLOW USE TO USE THE SYSTEM WITHOUT HAVING TO LOGIN\n\t\t\t */\n\t\t\tif (sessionStorage.getItem('user_log') != null){\n\t\t\t\tvar user_session = sessionStorage.getItem(\"user_log\");\n\t\t\t\tsend_user_started_session(user_session);\n\t\t \t\t// deliver_message('user session ' + sessionStorage.getItem(\"user_log\"), 'msg_info');\n\t\t \t}\n\t\t}", "title": "" }, { "docid": "b1594927afcf895d085090687480cedb", "score": "0.59491205", "text": "validateUser() {\n return __awaiter(this, void 0, void 0, function* () {\n if (Sojiro_1.Sojiro.isEmpty(this.configurations.command.client.authorization.blacklist.users)) {\n return true;\n }\n return !this.configurations.command.client.authorization.blacklist.users.includes(this.authorID);\n });\n }", "title": "" }, { "docid": "5db5c3c49032e56d070eb35463f33a34", "score": "0.5944049", "text": "exists(username) {\n const i = this.getIndexByUsername(username)\n return (i > -1) ? true : false\n }", "title": "" }, { "docid": "87e03d0375236631700b366cd3424ebf", "score": "0.59426755", "text": "function findOrCreateUser(user,done){\n \n db.query(`SELECT * FROM users u WHERE ${user.id} = u.id`,function(err,result)\n {\n if (err) throw err;\n else if(result.length == 0) //no exists\n {\n let sql = `INSERT INTO users VALUES (${user.id},'${user.displayName}','user','${user.photos[0].value}','${user.emails[0].value}')`;\n db.query(sql,function(err,result)\n {\n if(err) throw err;\n console.log(\"ADDED THIS USER\")\n done(null,let_user(result[0]));\n });\n }\n else \n {\n console.log(\"ALREADY EXISTS\");\n let usr = let_user(result[0]);\n console.log(usr)\n done(null,usr);\n }\n });\n}", "title": "" }, { "docid": "3675f1fd03345f1b4af18b74631bf588", "score": "0.5941907", "text": "function validateUserId(req, res, next) {\n\tlet userId = req.params.id;\n\n\tdb.get(userId).then(user => {\n\t\t// console.log('validatUserId', userId);\n\t\tif (user === undefined || user.length === 0) {\n\t\t\tres.status(400).json({ message: 'invalid user id' });\n\t\t} else {\n\t\t\treq.user = user;\n\t\t\tnext();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "4e4360afb761de0038efb849ee1519e7", "score": "0.5940816", "text": "* checkUserExists(req, resp) {\n const User = use('App/Model/User')\n\n let user;\n if (req.input('username')) {\n user = yield User.findBy('username', req.input('username'))\n }\n else {\n user = yield User.findBy('email', req.input('email'))\n }\n\n if (user) {\n resp.status(400).send('exists')\n }\n else {\n resp.send('ok')\n }\n }", "title": "" }, { "docid": "52362adf52407eb24ac23ba01ed43a16", "score": "0.59376436", "text": "function idCheck(userID, userDatabase) {\n if(userDatabase[userID]) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "27bb734f679ba3c9aede3663f2d373c0", "score": "0.5937431", "text": "async function user_already_saved(model, user_info){\n\tlet data = await model.find({'email': user_info.email});\n\tlet res;\n\tif(data.length > 0){//if an account with the same email is inside the database the request won't be accepted\n\t\tres = true;\n\t}\n\telse{\n\t\tres = false;\n\t}\n\t////console.log(\"res: \"+res);\n\treturn res;\n\n}", "title": "" }, { "docid": "4d659e1fb703aa9febc1e1274c296d2b", "score": "0.59347904", "text": "function checkUser(req,res,next){\n if(req.isAuthenticated()){\n Product.findById(req.params.id,function(err,foundProduct){\n if(err){\n console.log(err);\n }else{\n if(foundProduct.author.id.equals(req.user._id)){\n next();\n }else{\n req.flash(\"error\",\"You are not allowed to do that\");\n res.redirect(\"back\");\n }\n }\n })\n }\n }", "title": "" }, { "docid": "20e5e06eca49f45a4507e0b0e9f71e4c", "score": "0.5932564", "text": "function findById(id, fn) {\n var found_it = false;\n for (var i = 0; i < users.length; i++) {\n if (users[i].id == id) {\n found_it = true;\n //console.log('found what I was looking for, id ' + users[i].id)\n fn(null,users[i]);\n }\n }\n if (!found_it) {\n fn(new Error('User ' + id + ' does not exist'));\n }\n}", "title": "" }, { "docid": "cc6ebeca030f4823ae79108a4e4b802f", "score": "0.59283644", "text": "getUserList() {\n fetch.getAll(\"users\").then(usersArray => {\n let userName = document.querySelector(\"#usernameInputForm\").value;\n let email = document.querySelector(\"#emailInputForm\").value;\n let loginSuccess = usersArray.find(obj => {\n return obj.userName === userName && obj.email === email\n });\n\n if (loginSuccess) {\n console.log(loginSuccess);\n window.sessionStorage.setItem(\"userName\", userName);\n window.sessionStorage.setItem(\"userID\", loginSuccess.id)\n domAppender.nav.appendNav();\n domAppender.home.createDOM();\n } else {\n alert(\"Your username and/or email address did not match the information in our system, please retry or register a new account.\")\n }\n\n })\n }", "title": "" } ]
76d7ca3d998151dadda96c46a46aeb63
Get all the tags that a video matches in its filter
[ { "docid": "664837064eeb137e136f90d31756f834", "score": "0.6254784", "text": "function getMatchingTags(ytrData, callback){\n let filterId = ytrData.filterId ? ytrData.filterId : matchesFilter(ytrData);\n \n chrome.runtime.sendMessage({\n method: 'get-full-parsed-filter',\n filterId: filterId\n },\n function({groupedTags, tags}){ // {groupedTags, tags}\n let tagMatches = [],\n groupMatches = [];\n\n for(let tag of tags)\n if(matchesSG(tag, ytrData))\n tagMatches.push(tag);\n \n for(let group of groupedTags)\n if(group.every(tag => matchesSG(tag, ytrData)))\n groupMatches.push(group);\n\n callback(tagMatches, groupMatches);\n }\n );\n}", "title": "" } ]
[ { "docid": "745b71dccecb0600d8d15ba48fc0e11c", "score": "0.5995924", "text": "function getTagsForVideos(videos) {\n return knex('tags')\n .join('taggings', 'taggings.tag_id', 'tags.id')\n .whereIn('taggings.video_id', videos.map(video => video.id))\n }", "title": "" }, { "docid": "15238d2ae7c6131c7e0cb2fddf9f2108", "score": "0.5932511", "text": "filterEventListByTags(filter_tags = []) {\n let filtered_events = [];\n let final_filtered_list = [];\n\n for(let event_cycler = 0; event_cycler < this.events.length; event_cycler++)\n {\n let tags_matched = 0;\n for(let tag_cycler = 0; tag_cycler < filter_tags.length; tag_cycler++)\n {\n if(this.events[event_cycler].tags.includes(filter_tags[tag_cycler])) {\n tags_matched += 1;\n }\n }\n\n if(tags_matched > 0) {\n filtered_events.push([tags_matched,this.events[event_cycler]]);\n }\n }\n\n //sorts by most relevant\n filtered_events.sort(function(first_ele, second_ele) {\n return second_ele[0] - first_ele[0];\n });\n\n //strips numbering\n for(let event_cycler = 0; event_cycler < filtered_events.length; event_cycler++)\n {\n filtered_events[event_cycler] = filtered_events[event_cycler][1];\n }\n\n return filtered_events;\n }", "title": "" }, { "docid": "9495ff102ec4d198f9dcf599feeb6d1b", "score": "0.58275956", "text": "function filteredMoviesMock(tag){\n return moviesMock.filter(movie => movie.tags.includes(tag))\n}", "title": "" }, { "docid": "b526cf06bb2bbb4896e81020c4d2854e", "score": "0.58212876", "text": "function filterVideos(videoJsonData, filter) {\n \n // Filters through the json data\n let filterSearchResults = videoJsonData.filter( (video) => {\n \n // Iterates through the keys in the filter\n for (let key in filter) {\n // Gets rid of any videos that don't contain the title given in the filter (if present in filter)\n if (key === 'title' && !video.title.toLowerCase().includes(filter.title)) {\n return false;\n }\n // Gets rid of any videos that don't match the style filter (if present in filter)\n else if (key === 'style' && video.style != filter.style) {\n return false;\n }\n // Gets rid of any videos that don't match the teacher filter (if present in filter)\n else if (key === 'teacher' && !video.teacher.some(e => e.value == filter.teacher)) {\n return false;\n }\n // Gets rid of any videos that don't match level (if set)\n else if (key === 'level' && video.level != filter.level) {\n return false;\n }\n // Gets rid of any videos that don't match calena steps (if set in filter)\n else if (key === 'step' && video.calena_steps.indexOf(filter.step) == -1) {\n return false;\n }\n }\n // If it passes all of the above tests, this video matches the search criteria and will be added to the search results\n return true;\n })\n \n // Generates HTML content for search results\n getVideosHTML(filterSearchResults);\n}", "title": "" }, { "docid": "aca8caa1e3cb3f57682e9f0b92f0d356", "score": "0.56836045", "text": "function filteredMoviesMocks(tag) {\n return moviesMock.filter(movie => movie.tags.includes(tag));\n}", "title": "" }, { "docid": "33438e5009b1bf8785c4dd2cde2ddbef", "score": "0.56742793", "text": "function counctTag(word) {\n return movie.filter(element => element.tag === word);\n}", "title": "" }, { "docid": "85d08ae848fa8ebcc250f8aee1b15618", "score": "0.5653624", "text": "function groupTags(tags) {\n return tags.reduce(function (result, tag) {\n result[tag.video_id] = result[tag.video_id] || []\n result[tag.video_id].push(tag)\n return result\n }, {})\n }", "title": "" }, { "docid": "d02f9435f13bc59d1f6f1ff6d81752a9", "score": "0.5563505", "text": "function videoFilter(){\n return function( video ) {\n return video._id != self.video._id;\n };\n }", "title": "" }, { "docid": "1baff67ba52e3d098107098147d54f07", "score": "0.5547389", "text": "filterDescriptorText(filterId){\n let isDefault = filterId == 0,\n filter = this.options.filters[filterId],\n parsedTagList = this.parsedFilters[filterId];\n \n if(!filter.enabled || !parsedTagList){\n return 'This filter is disabled and so won\\'t affect any video suggestions.';\n }else{\n if(parsedTagList.error){\n return 'This filter has an error and won\\'t work';\n }else{\n let chGroupedTags = parsedTagList.groupedTags.filter((g) => g.some((t) => t.getDisplayMode() == 'ch')).length,\n ch = parsedTagList.tags.filter((t) => t.getDisplayMode() == 'ch').length + chGroupedTags,\n vi = parsedTagList.tags.filter((t) => t.getDisplayMode() == 'vi').length,\n sg = parsedTagList.tags.filter((t) => t.isSearchGroup()).length + parsedTagList.groupedTags.length - chGroupedTags,\n s = [];\n\n if(ch > 0)\n s.push(ch == 1 ? '1 channel' : ch + ' channels');\n if(vi > 0)\n s.push(vi == 1 ? '1 video' : vi + ' videos');\n if(sg > 0)\n s.push(sg == 1 ? '1 other' : sg + ' others');\n\n if(s.length == 0)\n return isDefault ? 'This filter affects anything that didn\\'t match another filter.' : 'This filter affects nothing. Add some tags.';\n else\n return 'This filter affects ' + s.join(', ').replace(/,\\s(?=[^,]+$)/, ' and ') + (isDefault ? ' and anything that didn\\'t match another filter.' : '.');\n }\n }\n }", "title": "" }, { "docid": "6912e790988a9b9ccd52938587942c6e", "score": "0.5543798", "text": "function filterTags(r, runs) {\n var result = [];\n runs.forEach(function (x) { return result = result.concat(r[x]); });\n return _.uniq(result).sort(VZ.Sorting.compareTagNames);\n }", "title": "" }, { "docid": "687f7bbfa84f556f200707806183eaf2", "score": "0.5531448", "text": "entriesWithTag(tagSearch) {\n let entries = [];\n\n this.entryList.forEach(entry => {\n if (entry.tags.includes(tagSearch)) {\n entries.push(entry.msg);\n }\n });\n\n\n return entries;\n }", "title": "" }, { "docid": "118a3595bde418364aec39ed19b11da4", "score": "0.55276066", "text": "function renderVideoCards(filterId) {\n tempArray = [];\n if (filterId == \"all\") {\n sortCards(videoData[\"videoDetails\"]);\n } else {\n for (let index = 0; index < videoData[\"videoDetails\"].length; index++) {\n var element = videoData[\"videoDetails\"][index];\n if (\n element[\"category\"].toLowerCase() == filterId.toLowerCase() ||\n element[\"subcategory\"].toLowerCase() == filterId.toLowerCase()\n ) {\n tempArray.push(element);\n }\n }\n sortCards(tempArray);\n }\n generateFilterTags(\"#filterTags\", filterId);\n }", "title": "" }, { "docid": "22df11bd5c65741557185a61796abf22", "score": "0.55271393", "text": "function setupVideoFilter() {\n const searchForm = document.getElementById('video-search-form');\n const filterSel = '.video-filter-group .video-filter';\n const activeClass = 'active';\n const activeSel = `${filterSel}.${activeClass}`;\n let filterSchedule = null;\n\n // shouldn't be necessary since the click events will only attach to elements on the video page,\n // and they are what trigger any actual work in this method... but it also is good to be sure.\n if (!searchForm) {\n return;\n }\n\n function updateSearchFormFields() {\n let activeFilters = [...document.querySelectorAll(activeSel)];\n let queries = {};\n let newQueries = [];\n\n // for each filter clicked, build an array of queries for that filter aspect to be OR'd\n // together by lunr.\n activeFilters.forEach((el) => {\n const key = el.getAttribute('data-filter-key');\n const value = el.getAttribute('data-filter-value');\n if (!queries[key]) {\n queries[key] = [];\n }\n queries[key].push(`${key}:${value}`);\n });\n\n // newQueries will be an array like:\n // Array [ \"programming_lang:css programming_lang:R\", \"author:Chris Bail\" ]\n newQueries = Object.values(queries).map((q) => q.join(\" \"));\n\n // add each query as a hidden input to the main search form, and submit it\n searchForm\n .querySelectorAll(\"input[type='hidden']\")\n .forEach((e) => e.remove());\n for (let i = 0; i < newQueries.length; i++) {\n let input = document.createElement(\"input\");\n input.setAttribute(\"type\", \"hidden\");\n input.setAttribute(\"name\", \"addl_query\");\n input.setAttribute(\"value\", newQueries[i]);\n searchForm.append(input);\n }\n searchForm.querySelector(\"[type='submit']\").click();\n }\n\n on('click', filterSel, function (ev) {\n ev.preventDefault();\n let filterEl = ev.target;\n filterEl.classList.toggle(activeClass);\n clearTimeout(filterSchedule);\n filterSchedule = setTimeout(updateSearchFormFields, 300);\n });\n}", "title": "" }, { "docid": "a4edd92830cdaa9a40cdf8cc058ed6c2", "score": "0.54874814", "text": "function filtered(value) {\n return state.pichas.filter(photo => {\n return !!photo.tags.find(tag => {\n return tag.description.toLowerCase() === value.toLowerCase()\n })\n })\n}", "title": "" }, { "docid": "3e5f9aeb4941b70e433969d3951841ec", "score": "0.5478849", "text": "function tagFilter(event) {\n const targetEl = event.target;\n const tagValue = targetEl.innerHTML.trim();\n const tagClasses = ['tag', 'close-tag'];\n\n /* this function will only run when we\n loop through the tagClasses array using the some method that returns true or false\n if the conditions specified in the call back is met. in our case if it is false, we return nothing, hence we run the rest of the program*/\n\n if (\n !tagClasses.some((className) =>\n targetEl.classList.contains(className)\n )\n ) {\n return;\n }\n\n //Get the search bar content\n const searchContentEl = document.getElementById('search-content');\n\n //Get the array of tags in the searchBar content\n const tagsInSearchContent = getSearchBarTags(\n tagValue,\n searchContentEl\n );\n\n searchContentEl.innerHTML = tagsInSearchContent.reduce(\n (acc, currentTag) => {\n return acc + getHtmlTag(currentTag, 'close-tag');\n },\n ''\n );\n\n displaySearchBar(tagsInSearchContent.length > 0);\n toggleActiveClass(targetEl, 'active-tag');\n setJobs(tagsInSearchContent);\n}", "title": "" }, { "docid": "16859498e7ca6be56b0ecba2a79b621f", "score": "0.54652506", "text": "videos(doc, topNode) {\n const videoList = [];\n const candidates = doc(topNode).find(\"iframe, embed, object, video\");\n\n candidates.each(function() {\n const candidate = doc(this);\n const tag = candidate[0].name;\n\n if (tag === \"embed\") {\n if (candidate.parent() && (candidate.parent()[0].name === \"object\")) {\n return videoList.push(getObjectTag(doc, candidate));\n } else {\n return videoList.push(getVideoAttrs(doc, candidate));\n }\n } else if (tag === \"object\") {\n return videoList.push(getObjectTag(doc, candidate));\n } else if ((tag === \"iframe\") || (tag === \"video\")) {\n return videoList.push(getVideoAttrs(doc, candidate));\n }\n });\n\n // Filter out junky or duplicate videos\n const urls = [];\n const results = [];\n each(videoList, function(vid) {\n if (vid && vid.height && vid.width && (urls.indexOf(vid.src) === -1)) {\n results.push(vid);\n return urls.push(vid.src);\n }\n });\n\n return results;\n }", "title": "" }, { "docid": "23e1af7495957d239a30d20b39dbbd10", "score": "0.5458598", "text": "function getMatchingTags(matchTags, matchResources, allowPartialMatch) {\n\t\tvar tagsResult = [];\n\t\tvar matchingTags;\n\t\tvar resources = seedcodeCalendar.get('resources');\n\t\tvar matchingResources = dbk.objectArrayMatch(matchResources, resources, 'name');\n\t\tif (!matchingResources || !matchingResources.length) {\n\t\t\treturn [];\n\t\t}\n\t\n\t\tfor (var i = 0; i < matchingResources.length; i++) {\n\t\t\tmatchingTags = dbk.objectArrayMatch(matchTags, matchingResources[i].tags, 'name', allowPartialMatch);\n\t\t\tif (!matchingTags || !matchingTags.length) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tfor (var ii = 0; ii < matchingTags.length; ii++) {\n\t\t\t\ttagsResult.push(matchingTags[ii]);\n\t\t\t}\n\t\t}\n\t\treturn tagsResult;\n\t}", "title": "" }, { "docid": "49fd5376e4eede6c388e596817297aaf", "score": "0.5439287", "text": "filtered( data ) {\n if ( this.filterTags.length > 0 ) {\n return data.filter( job => this.filterTags.every( tag => job.tags.includes( tag ) ) );\n }\n return data;\n }", "title": "" }, { "docid": "1c176f985d48f4f957f25602b16af184", "score": "0.54313326", "text": "function getVideoSources(query) {\n const elements = [...document.querySelectorAll(query)]\n return elements.map(_ => _.src)\n}", "title": "" }, { "docid": "f03bc6b675fb654d36caf31201fedc06", "score": "0.54003364", "text": "function filterVids() {\r\n var selObject = document.getElementById('cat-select');\r\n var path = 'https://web.engr.oregonstate.edu/~toke/a4p2/videos.php';\r\n var params = {filter: selObject.value};\r\n\r\n sendForm(path, params, 'POST');\r\n}", "title": "" }, { "docid": "11d7a891aa3a89b4be19e525105909b8", "score": "0.5378229", "text": "static from_video(video) {\n\t\treturn new StreamFilter(video.streams.formats, video.streams.adaptive_formats);\n\t}", "title": "" }, { "docid": "23c5232a8806cec189ca192f67c8f1bb", "score": "0.53468794", "text": "function returnFilteredArray (arr, tag_arr) {\r\n\r\n return arr.filter(arrayitem => {\r\n var tag_match_count = 0;\r\n\r\n //tag array\r\n for (let index = 0; index < tag_arr.length; index++) {\r\n \r\n const tag = tag_arr[index];\r\n\r\n //tags in history item\r\n for (let index = 0; index < arrayitem.tags.length; index++) {\r\n const tag_obj = arrayitem.tags[index];\r\n if(tag_obj.tag.match(\"(^\"+tag+\")\")) \r\n {\r\n tag_match_count ++; \r\n break;\r\n }\r\n }\r\n\r\n } \r\n\r\n if (tag_match_count == tag_arr.length)\r\n {\r\n return true;\r\n }\r\n \r\n // Loops again if arritm[key] is an array (for material attribute).\r\n \r\n // if (Array.isArray(arritm[filter])) \r\n // {\r\n // return arritm[filter].some(keyEle => tag_arr[filter].includes(keyEle));\r\n // }\r\n\r\n // return tag_arr[tag].includes(arritm.tags.tag[tag]);\r\n \r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "c6f57fc63ba3acc7c584f11459de65e4", "score": "0.5318917", "text": "function filterTagMagnetLink(tags) {\n return tags.filter(tag => { return tag.href.match(REGEX_MAGNET) });\n}", "title": "" }, { "docid": "6f751e774d5ea54a3b358925933dc023", "score": "0.5265618", "text": "function filter() {\n if(name === \"TV Shows\") {\n return 'tv';\n } else {\n return 'movie'\n }\n }", "title": "" }, { "docid": "a61c27046d15c58db681ef531405edd9", "score": "0.526464", "text": "function filterSlides(slideArray, filterTag) {\r\n\r\n\t\tvar filteredSlides = [];\r\n \r\n\t\tvar l = slideArray.length;\r\n\t\tfor (var i = 0; i < l; i++)\r\n\t\t{\r\n\t\t\tvar $slide = $(slideArray[i]);\r\n\r\n\t\t\tvar tags = $slide.data().tags.split(',');\r\n\t\t\tvar n = tags.length;\r\n\t\t\tfor (var j = 0; j < n; j++)\r\n\t\t\t{\r\n\t\t\t\tvar tag = tags[j];\r\n\r\n\t\t\t\tif (filterTag === tag)\r\n\t\t\t\t{\r\n\t\t\t\t\tfilteredSlides.push($slide);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn filteredSlides;\r\n\t}", "title": "" }, { "docid": "dd343c4f7888cd07ab3882eb330db510", "score": "0.52527726", "text": "function filterTags(element_tags, filter_tags) {\n\tfor (var i = filter_tags.length - 1; i >= 0; i--) {\n\t\tvar listed = false;\n\t\tfor (var u = element_tags.length - 1; u >= 0; u--) {\n\t\t\tif (element_tags[u] === filter_tags[i]) {\n\t\t\t\tlisted = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (listed === false)\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "e122d838c51a5f79579df6e3c8f7872d", "score": "0.52449113", "text": "function filter_movies_genre(search, movieList){\r\n let filtered = [];\r\n\r\n for(let movieId in movieList){\r\n let genres = movieList[movieId].genre;\r\n let newSearch = search.toUpperCase();\r\n\r\n //console.log(genres);\r\n\r\n //console.log(currTitle);\r\n for(let i = 0; i < genres.length; i++){\r\n currGenre = genres[i].toUpperCase();\r\n //console.log(currGenre);\r\n if(currGenre.includes(newSearch)){\r\n //console.log(\"found match\");\r\n filtered.push(movieList[movieId]);\r\n }\r\n }\r\n \r\n }\r\n // console.log(filtered)\r\n return filtered;\r\n}", "title": "" }, { "docid": "e0c6219f50c4ef6f3c7992492c511b66", "score": "0.52348584", "text": "getTags(tagName) {\n return this.blockTags.filter((tag) => tag.tag === tagName);\n }", "title": "" }, { "docid": "5a4e59bea75d63d3dbd786bbb2a569ba", "score": "0.5223374", "text": "function filterArr(data) {\n let newArr = [];\n\n for (let i = 0; i < data.length; i++) {\n let image = getNestedOrRoot(data[i]);\n\n if (image.type !== \"video/mp4\") {\n let node = {\n title: data[i].title,\n author: data[i].account_url,\n views: data[i].views,\n id: image.id,\n image: image,\n tags: data[i].tags\n };\n newArr.push(node);\n }\n }\n return newArr;\n }", "title": "" }, { "docid": "d8b3d6f08e3ec0624892f4298746f886", "score": "0.52103204", "text": "async function getRelatedVideosByTag(call) {\n // TODO: Stop \"cheating\" and using data directly from other services\n\n let { request } = call;\n let videoId = toCassandraUuid(request.videoId);\n\n // Get tags for the given video\n let client = getCassandraClient();\n let tagsResultSet = await client.executeAsync('SELECT tags FROM videos WHERE videoid = ?', [ videoId ]);\n\n // Make sure we have tags\n let tagRow = tagsResultSet.first();\n if (tagRow === null) {\n return emptyResponse();\n }\n\n let { tags } = tagRow;\n if (tags.length === 0) {\n return emptyResponse();\n }\n\n // Use the number of results we want to return * 2 when querying so that we can account for potentially having\n // to filter out the video Id we're looking up, as well as duplicates\n const pageSize = RELATED_BY_TAG_RETURN_COUNT * 2;\n\n // Kick off queries in parallel for the tags\n let inFlight = [];\n let videos = {};\n let videoCount = 0;\n for (let i = 0; i < tags.length; i++) {\n let tag = tags[i];\n let promise = client.executeAsync('SELECT * FROM videos_by_tag WHERE tag = ? LIMIT ?', [ tag, pageSize ]);\n inFlight.push(promise);\n\n // If we don't have at least three in-flight queries and this isn't the last tag, keep kicking off queries\n if (inFlight.length < 3 && i !== tags.length - 1) {\n continue;\n }\n\n // Otherwise, wait for all in-flight queries to complete\n let resultSets = await Promise.all(inFlight);\n\n // Process the results\n for (let resultSet of resultSets) {\n for (let row of resultSet.rows) {\n let video = toSuggestedVideoPreview(row);\n\n // Skip self\n if (video.videoId.value === request.videoId.value) {\n continue;\n }\n\n // Skip it if we already have it in the results\n if (videos.hasOwnProperty(video.videoId.value)) {\n continue;\n }\n\n // Add to results\n videos[video.videoId.value] = video;\n videoCount++;\n\n // Do we have enough results?\n if (videoCount >= RELATED_BY_TAG_RETURN_COUNT)\n break;\n }\n\n // Do we have enough results?\n if (videoCount >= RELATED_BY_TAG_RETURN_COUNT)\n break;\n }\n\n // Do we have enough results?\n if (videoCount >= RELATED_BY_TAG_RETURN_COUNT)\n break;\n\n // Not enough yet so clear the in-flight query list and start again\n inFlight = [];\n }\n\n // Return the response\n return new GetRelatedVideosResponse({\n videoId: request.videoId,\n videos: Object.keys(videos).map(id => videos[id]),\n pagingState: '' // Does not support paging\n });\n}", "title": "" }, { "docid": "9b73d2314b88217f96082fc19efddffa", "score": "0.51976883", "text": "projectsWithTag(tag) {\n return this.projects.filter((p) => p.tags.includes(tag));\n }", "title": "" }, { "docid": "e256afd1cfb6b289bbf2f25538033ba3", "score": "0.51860964", "text": "function matchesFilter(ytrData){\n let filter = Infinity;\n\n if(ytrData.videoId && ytrData.videoId in filterCache.videoid)\n filter = filterCache.videoid[ytrData.videoId];\n\n let ch = filterCache.channels[ytrData.normalizedChannelName];\n if(Number.isInteger(ch)){\n filter = Math.min(filter, ch);\n }else if(Array.isArray(ch)){\n let subFilters = ch.slice(),\n hasDefault = Number.isInteger(subFilters[subFilters.length - 1]),\n defaultFilterId = hasDefault ? subFilters.pop() : undefined;\n for(let [id, ...sg] of subFilters){\n if(id >= filter){\n break;\n }else if(sg.every(e => matchesSG(e, ytrData))){ // If every sg matches the video\n filter = id;\n break;\n }\n }\n if(hasDefault && defaultFilterId < filter)\n filter = defaultFilterId;\n }\n\n for(let [id, ...sg] of filterCache.searchgroups){\n if(id >= filter){\n break;\n }else if(Array.isArray(sg[0])){\n if(sg.every(e => matchesSG(e, ytrData))){ // If every sg matches the video\n filter = id;\n break;\n }\n }else{\n if(matchesSG(sg, ytrData)){\n filter = id;\n break;\n }\n }\n }\n\n return Number.isFinite(filter) ? filter : 0;\n}", "title": "" }, { "docid": "6128e45da477bf44916a9df159cc915e", "score": "0.5158487", "text": "function findAllMatches(eventId, bracketNum, roundNum) {\n console.log(\n \"findAllMatches(%d,%d,%d,%d)\",\n eventId,\n bracketNum,\n roundNum,\n matchNum\n );\n let attFilter = '.item-player[data-eventid=\"' + eventId + '\"]';\n attFilter += '[data-bracketnum=\"' + bracketNum + '\"]';\n attFilter += '[data-roundnum=\"' + roundNum + '\"]';\n console.log(\"Attribute filter:\", attFilter)\n let $allMatchElems = $(attFilter);\n return $allMatchElems;\n }", "title": "" }, { "docid": "bdb893803578adf19336e5d0930cb5c1", "score": "0.5134958", "text": "function getBattleTags(team) {\r\n team = team || '';\r\n let spans = $(\".match-detail__players [class*='match-detail__players_team\"\r\n + team + \"'] p span:contains('#')\");\r\n return spans.map(function(i, span) {\r\n return $.trim($(span).text().replace(/#/g, '-'));\r\n });\r\n}", "title": "" }, { "docid": "34cca5f2305894eba283334d3d146ea2", "score": "0.51303506", "text": "function getVideoNames(tests){\n\tconst videoNames = tests.map(test => test.name)\n\tconst uniqueVideoNames = [...new Set(videoNames)]\n\treturn uniqueVideoNames\n}", "title": "" }, { "docid": "50d3a3382db2ea77f6009473c1dec9eb", "score": "0.5115189", "text": "function genreMatch(genre) {\n\n\t\t\t\t\tvar g = data\n\t\t\t\t\t\t.filter(function(el) { return el.genre_main === genre; })\n\t\t\t\t\t\t.map(function(elt) { return elt.movie; });\n\n\t\t\t\t\treturn g;\n\t\t\t\t\n\t\t\t\t} // genreMatch()", "title": "" }, { "docid": "35feb399bc2ceabb86e9dad727243a48", "score": "0.51112336", "text": "function get_tagged_instances() {\n\n\n // TODO implement\n var filter = {\n// Filters: [\n// {\n// Name: 'tag:iops',\n// Values: ['dynamic']\n// }\n// ]\n };\n//filter,\n ec2.describeInstances(filter, function (err, data) {\n if (err) return console.error(err.message);\n console.log(\"tagged: %j\", data);\n\n return data;\n\n });\n }", "title": "" }, { "docid": "91792ed854b687f03d9b28c89f570fcb", "score": "0.5110489", "text": "function search_Tag(){\n var temporary= current_buffer;\n tags_search = Array();\n var key=\"\";\n var tags = this.className==\"tagPrimary\"?document.getElementById(\"tagPrimaryPicker\"):document.getElementById(\"tagSecondaryPicker\");\n tags = tags.getElementsByTagName(\"label\");\n key=this.className==\"tagPrimary\"?\"primary_hashtag\":\"secondary_hashtag\";\n if(this.style.fontWeight!=\"bold\"){\n this.style.fontWeight=\"bold\";\n this.style.textDecoration=\"overline\";\n }\n else{\n this.style.fontWeight=\"\";\n this.style.textDecoration=\"\"; \n }\n for(var i=0;i<tags.length;i++){\n if(tags[i].style.fontWeight==\"bold\")\n tags_search.push(tags[i].id);\n }\n var temporary_array=[];\n if(tags_search.length!=0){\n for(var i=0;i<recieved_reply.length;i++){\n for(var j=0;j<tags_search.length;j++){\n if(jQuery.inArray(tags_search[j].substr(3,tags_search[j].length),recieved_reply[i][key])!=-1)\n break;\n } \n if(j==tags_search.length)\n continue;\n if(IS_SECONDARY_TAG_CHOSEN&&key==\"primary_hashtag\"){\n for(var l=0;l<secondary_tags_search.length;l++){\n if(jQuery.inArray(secondary_tags_search[l][\"secondary_hashtag\"],recieved_reply[i][\"secondary_hashtag\"])!=-1) {\n temporary_array.push(recieved_reply[i]);\n break;\n }\n }\n }\n else if(IS_PRIMARY_TAG_CHOSEN&&key==\"secondary_hashtag\"){\n for(var l=0;l<primary_tags_search.length;l++){\n if(jQuery.inArray(primary_tags_search[l][\"primary_hashtag\"][0],recieved_reply[i][\"primary_hashtag\"])!=-1) {\n temporary_array.push(recieved_reply[i]);\n break;\n }\n }\n }\n else\n temporary_array.push(recieved_reply[i]);\n \n }\n }\n if(key==\"primary_hashtag\")\n primary_tags_search=temporary_array;\n else\n secondary_tags_search=temporary_array;\n currentYear=currentMonth=currentDay=null;\n if(temporary_array.length==0){\n current_buffer=null;\n IS_PRIMARY_TAG_CHOSEN = key==\"primary_hashtag\"?false:IS_PRIMARY_TAG_CHOSEN?true:false;\n IS_SECONDARY_TAG_CHOSEN = key==\"secondary_hashtag\"?false:IS_SECONDARY_TAG_CHOSEN?true:false;\n if(IS_PRIMARY_TAG_CHOSEN)\n document.getElementById('PNULLTAG').click();\n else if(IS_SECONDARY_TAG_CHOSEN)\n document.getElementById(\"SNULLTAG\").click();\n }\n else{\n Parse_Reply_Backend(temporary_array);\n var i=0;\n IS_PRIMARY_TAG_CHOSEN = key==\"primary_hashtag\"?true:IS_PRIMARY_TAG_CHOSEN?true:false;\n IS_SECONDARY_TAG_CHOSEN = key==\"secondary_hashtag\"?true:IS_SECONDARY_TAG_CHOSEN?true:false;\n }\n var flag = true;\n if(temporary!=null&&current_buffer!=null){\n if(temporary.length==current_buffer.length&&temporary_array.length==0){\n for(var i=0;i<temporary.length;i++){\n if(temporary[i][\"content-id\"]!=current_buffer[i][\"content-id\"]){\n flag=false;\n }\n }\n }\n else\n flag=false;\n }\n else\n flag=false;\n if(flag){\n this.style.fontWeight=\"\";\n this.style.textDecoration=\"\";\n this.style.color='red';\n t = setTimeout(function(){\n $(\"#tagPrimaryPicker label,#tagSecondaryPicker label\").css(\"color\",color_picker[color_picked][3]);\n },100);\n }\n else{\n implode();\n $('#dateShower select').empty();\n set_dateViewer(current_buffer);\n Call_Logic(current_buffer);\n Init();\n }\n }", "title": "" }, { "docid": "90d9058646f15b8d62171c88713adabd", "score": "0.5082547", "text": "function customFilterElements() {\n\tvar path = window.location.hash.substr(1);\n\tvar filter_tag_array = extractTagsAsStrings($(\"#active-tag-container\"));\n\n\t$(\".element\").hide();\n\n\t$(\".element\").filter(function() {\n\t\t// Get tags for this element\n\t\tvar element_tag_array = extractTagsAsStrings($(this).find(\"#element-tag-container\"));\n\t\tvar q1 = $(this).find(\"#path:contains('\"+path+\"')\").length > 0;\n\t\tvar q2 = filterTags(element_tag_array, filter_tag_array);\n\t\treturn q1 && q2;\n\t}).show();\n\n\tupdateTagList();\n}", "title": "" }, { "docid": "c8a78894093de076cc7d93ddcf98ed5f", "score": "0.5077431", "text": "static search_results() {\n const doc = navigationDocument.documents[navigationDocument.documents.length - 1]\n const e = doc.getElementsByTagName('textField').item(0)\n const search = e.getFeature('Keyboard').text\n\n // search last week, primetime, over our channels of interest\n const rite = new Date().getTime()\n const left = rite - (7 * 86400 * 1000)\n const l = new Date(left).toISOString().substr(0, 10)\n const r = new Date(rite).toISOString().substr(0, 10)\n log(l, ' to ', r)\n\n // stick with just our channels of interest\n const chans = `contributor:${Object.keys(TVA.channel_times()).join(' OR contributor:')}`\n\n // stick with primetime, 5-11pm\n const primetime = []\n for (const n of [...Array(7).keys()]) {\n primetime.push(`title:\"${n + 5}pm\"`)\n primetime.push(`title:\"${n + 5}:30pm\"`)\n }\n\n const query = `(${search}) AND (${chans}) AND (${primetime.join(' OR ')})`\n const url = `https://archive.org/tv?output=json&and%5B%5D=publicdate:%5B${l}+TO+${r}%5D&q=${encodeURIComponent(query)}`\n log(url)\n\n $.getJSON(url, (response) => {\n let vids = ''\n for (const hit of response) {\n log(hit)\n const vid = (hit.video\n .replace(/&ignore=x.mp4/, '')\n // boost the sample to up to 3 minutes\n .replace(/t=([\\d.]+)\\/[\\d.]+/, (x, m) => `t=${m}/${180 + parseInt(m, 10)}`)\n )\n vids += TVA.videoTile2(`https:${hit.thumb}`, vid, TVA.amp(hit.title)) // xxx .snip => description\n }\n log(vids)\n // debugger\n\n TVA.render(`\n<document>\n <stackTemplate>\n <banner>\n <title>Search results for: ${TVA.amp(search)}</title>\n </banner>\n <collectionList>\n <grid>\n <section>\n ${vids}\n </section>\n </grid>\n </collectionList>\n </stackTemplate>\n</document>`, null)\n }, null)\n }", "title": "" }, { "docid": "5c36f4491c3bced0699c527d7c5895f9", "score": "0.50619155", "text": "function searchTag() {\n var searchbar, filter, tagList, div, a, i, txtValue;\n searchbar = document.getElementById(\"searchbar\");\n filter = searchbar.value.toUpperCase();\n tagList = document.getElementById(\"searchTagList\");\n div = tagList.getElementsByTagName(\"div\");\n for (i = 0; i < div.length; i++) {\n a = div[i].getElementsByTagName(\"a\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n div[i].style.display = \"\";\n } else {\n div[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "2d6805d7a8e82479733f8ec7e9e5e14b", "score": "0.50554794", "text": "function displayVideosByTitle(title){\r\n var filteredVideos = [];\r\n $.each(videos, function (i, video) {\r\n if(video.title.includes(title)){\r\n filteredVideos.push(video);\r\n }\r\n });\r\n \r\n displayVideos(filteredVideos);\r\n }", "title": "" }, { "docid": "292ebfc4fec8165b3fc570070dc172e3", "score": "0.5050727", "text": "function findTags() {\n let tags = [];\n recipeData.forEach(recipe => {\n recipe.tags.forEach(tag => {\n if (!tags.includes(tag)) {\n tags.push(tag);\n }\n });\n });\n tags.sort();\n listTags(tags);\n}", "title": "" }, { "docid": "e8eb0f4f72b202526ba3f91bf27dec94", "score": "0.5040725", "text": "function filter_movies()\r\n{\r\n var filterDebugStr = \"None.\";\r\n\r\n if (filters.num == 0)\r\n {\r\n movies_filtered = movies;\r\n }\r\n else\r\n {\r\n movies_filtered = movies.filter(applyFilters);\r\n\r\n filterDebugStr = \"\";\r\n filters.genre.forEach(function(filterVal) {\r\n filterDebugStr += (filterVal + \" | \");\r\n });\r\n }\r\n filterDebugStr = filterDebugStr.substring(0, filterDebugStr.length-3);\r\n\r\n\r\n // console.log(\"Filter: Genres [\" + filterDebugStr + \"]\");\r\n // console.log(\" -- \");\r\n // console.log(\".[dataloader.filter_movies] \\n - Printing movies_filtered obj\");\r\n // console.log(movies_filtered);\r\n\r\n console.log(\".[dataloader.filter_movies] \\n - Printing sizes\");\r\n console.log(\" movies num: \" + movies.length);\r\n console.log(\"filtered num: \" + movies_filtered.length);\r\n}", "title": "" }, { "docid": "19457c4e34efa9fb0adde65e6316c6b0", "score": "0.5031587", "text": "function findTags() {\n const tags = []\n\n allRecipes.forEach(recipe => {\n recipe.tags.forEach(tag => {\n if (!tags.includes(tag)) {\n tags.push(tag)\n }\n })\n })\n\n tags.sort()\n domUpdates.addListTags(tags)\n addTagEventListeners()\n}", "title": "" }, { "docid": "00c1b3395854123c47fae2c2166958ac", "score": "0.5021065", "text": "getTagsList() {\n let tags = [];\n // Get the list of all tags\n this.data.forEach((show) => {\n $.merge(tags, show.tags);\n })\n // Remove Duplicates Tags\n tags = $.grep(tags, (v, k) => {\n return $.inArray(v ,tags) === k;\n });\n // Sort Tags Alphabetically\n tags.sort((a, b) => {\n return a.toLowerCase().localeCompare(b.toLowerCase());\n });\n return tags;\n }", "title": "" }, { "docid": "fab2ec9109f024d0edb3ebb8a29de0c5", "score": "0.50180316", "text": "static filterTags (tags) {\n return (tags.length === 2) && tags[0].includes('isCriteriaOf') && tags[1].includes('mark')\n }", "title": "" }, { "docid": "6021215ac863ec0090884e11c118f831", "score": "0.49900398", "text": "concatFilters() {\n let filters = this.mergeListFilters();\n // Filter order is very important\n // rotate -> zoompan -> fade -> overlay\n filters = this.mergeSpecialFilters('alpha', filters);\n filters = this.mergeSpecialFilters('rotate', filters);\n filters = this.mergeSpecialFilters('zoompan', filters);\n filters = this.swapFadeFilterPosition(filters);\n filters = this.mergeSpecialFilters('overlay', filters);\n filters = this.convertToFFmpegFilter(filters);\n\n return filters;\n }", "title": "" }, { "docid": "cc3b14f4ec8f4ee354e018672de76768", "score": "0.49867532", "text": "getTagged(tag) {\n\t\t\tconst ret = [];\n\t\t\tthis.forEach((v) => {\n\t\t\t\t/*\n\t\t\t\t\tWe need this instanceof check in case a non-datamap was added by the author.\n\t\t\t\t*/\n\t\t\t\tconst tags = v instanceof Map && v.get('tags');\n\t\t\t\tif (Array.isArray(tags) && tags.includes(tag)) {\n\t\t\t\t\tret.push(v);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ret.sort((left, right) => left.get('name') > right.get('name'));\n\t\t}", "title": "" }, { "docid": "df33767db298550973dc9e835717e2df", "score": "0.49863952", "text": "function filterTag(posts, tag) {\n var reTag = new RegExp(tag);\n return posts.filter(function filterPosts(post) {\n return post.tags.data.some(function checkRe(postTag) {\n return reTag.test(postTag.name);\n });\n });\n }", "title": "" }, { "docid": "5a361b0f6bcd5afc0a24369b85cef311", "score": "0.4965692", "text": "function getTags() {\r\n var tags = [];\r\n var groups = {\r\n innlent : [\"/frettir/innlent\", \"/FRETTIR01\"],\r\n erlent : [\"/FRETTIR02\", \"/frettir/erlent\", \"/utlond\"],\r\n sport : [\"/sport\", \"/IDROTTIR\"],\r\n politik : [\"/frettir/stjornmal\", \"/althingi\", \"/politik\"],\r\n taekni : [\"/frettir/teakni\", \"/frettir/togt\"],\r\n vidskipti: [\"/vidskipti\", \"/frettir/vidskipti\"],\r\n musik : [\"/musik\", \"/LIFID02\"],\r\n folk : [\"/folk\", \"/LIFID\"]\r\n }\r\n\r\n for (var group in groups) {\r\n if (groups.hasOwnProperty(group)) {\r\n var subsites = groups[group];\r\n for (var item in subsites) {\r\n var subsite = subsites[item];\r\n if ((self.url).indexOf(subsite) > -1) {\r\n tags.push(group);\r\n }\r\n }\r\n }\r\n }\r\n if(tags.length == 0) {\r\n tags.push(\"annad\");\r\n }\r\n return tags;\r\n }", "title": "" }, { "docid": "2a2e0d50a46ac1b18ff7823d7f4062b6", "score": "0.49637645", "text": "function findVideos() {\n let videos = document.querySelectorAll('.video');\n\n for (let i = 0; i < videos.length; i++) {\n setupVideo(videos[i]);\n }\n }", "title": "" }, { "docid": "b432e9b1a7a50db52b142e0a7ee3d045", "score": "0.49619797", "text": "function getTestsByVideoType(tests){\n let videosSets = [[\"margarida.mp4\", \"rui.mp4\", \"paula.mp4\"], [\"pedro.mp4\", \"alexandre.mp4\", \"rafa.mp4\"], [\"\"]]\n return videosSets.map(videos => getVideosTests(videos, tests) )\n}", "title": "" }, { "docid": "9e74e2f794a7d7ec5644a43d5f16aa2a", "score": "0.49606526", "text": "function recipesByTags(){\n for (const recipe of recipes) {\n let ingredients = [];\n recipe.ingredients.forEach(ing => ingredients.push(ing.ingredient.toUpperCase())); // Get all recipes ingredients\n for(let k=0; k<allSelectedTag.length; k++){\n if(recipe.appliance.toUpperCase().includes(allSelectedTag[k].innerText.toUpperCase()) || ingredients.join().includes(allSelectedTag[k].innerText.toUpperCase()) || recipe.ustensils.join().toUpperCase().includes(allSelectedTag[k].innerText.toUpperCase())){ // Tags match with one recipe in database or more ...\n if(document.getElementById(\"recipe-\" + recipe.id).classList.contains(\"display-recipe\")){\n document.getElementById(\"recipe-\" + recipe.id).style.display = \"block\"; // ... display cards of the recipes ...\n }\n } else {\n document.getElementById(\"recipe-\" + recipe.id).style.display = \"none\"; // ... hide others\n document.getElementById(\"recipe-\" + recipe.id).classList.remove(\"display-recipe\");\n }\n }\n if(allSelectedTag.length == 0){ // No tag selected ...\n document.querySelectorAll(\".card\").forEach(card => card.style.display = \"block\"); // ... display all cards\n document.querySelectorAll(\".card\").forEach(card => card.classList.add(\"display-recipe\"));\n }\n }\n updateFilters(); // Update filters based on recipes displayed\n}", "title": "" }, { "docid": "41b7ee3535abd8976b1208a3ff6685aa", "score": "0.49522924", "text": "function getVideosWithTagsAndComments() {\n return getVideos()\n .then(function (videos) {\n return Promise.all([\n getTagsForVideos(videos),\n getCommentsForVideos(videos)\n ]).then(results => populateVideos(videos, ...results) )\n })\n }", "title": "" }, { "docid": "5cb7daa8018f2307ef7995da278f8368", "score": "0.49487668", "text": "function filteredFiles(filters) {\n //TODO: update this I got all matches instead of all files with at least these filters\n var matches = new Set()\n for (var i = 0; i < filters.length; i++) {\n console.log(classifierToFiles)\n console.log(filters)\n matches.forEach(classifierToFiles[filters[i]].add, classifierToFiles[filters[i]]);\n }\n return Array.from(matches);\n}", "title": "" }, { "docid": "8fe4554484d3762108e895c1562cc765", "score": "0.4939592", "text": "function findVideos() {\n var videos = document.querySelectorAll('.video');\n\n for (var i = 0; i < videos.length; i++) {\n setupVideo(videos[i]);\n }\n }", "title": "" }, { "docid": "44356175c4d3bbbcdbbc7bd82746afb0", "score": "0.49364597", "text": "function videoSearch(video,maxVideo) {\n $.get(\"https://www.googleapis.com/youtube/v3/search?key=\"+api_Key+\"&type=video&part=snippet&maxResults=\"+maxVideo+\"&q=\"+video,function(data){\n \n data.items.forEach(item => {\n video=`<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/${item.id.videoId}\" frameborder=\"0\" allowfullscreen></iframe>`\n });\n $(\"#video\").append(video);\n })\n}", "title": "" }, { "docid": "1315c2966e6f3058530edd780e40504b", "score": "0.49320266", "text": "function filtradoTags(tags) {\n return (tags.length==2) && tags[0].includes(\"isCriteriaOf\") && tags[1].includes(\"mark\");\n}", "title": "" }, { "docid": "848dd5454c752a2e3f2c11ea8eede782", "score": "0.49315488", "text": "function categorize(videos) {\n /*\n @param classifier json state\n @returns a list of titles and their thumbnails\n\n var results = []\n for i in titles:\n let category = classifier.categorize(titles[i]);\n let video = {\"title\" : titles[i][title], \"category\" : category}\n results.push(video)\n return results\n */\n\n var results = []\n for (let i = 0; i < videos.length; i++) {\n let reaction = classifier.categorize(videos[i][\"title\"]);\n\n try {\n if (reaction == 'cb') {\n document.querySelector(`[title=\"${videos[i]['title']}\"]`).style = 'color: red';\n }\n } catch { }\n\n\n // let video = { \"title\": videos[i][\"title\"], \"reaction\": reaction };\n // results.push(video)\n }\n // return results;\n}", "title": "" }, { "docid": "716b7b3e8836c55ae622a3688be14516", "score": "0.491861", "text": "static filterTags2 (tags) {\n return (tags.length === 2) && tags[0].includes('mark') && tags[1].includes('isCriteriaOf')\n }", "title": "" }, { "docid": "11a850fbadc9cad1cb1308c128f3b366", "score": "0.49123004", "text": "function getTags(r) {\n return _.union.apply(null, _.values(r)).sort(VZ.Sorting.compareTagNames);\n }", "title": "" }, { "docid": "04d3038a6cc837a0d8cf2a9f6dc46176", "score": "0.49103868", "text": "function filter_movies_year(search, movieList){\r\n let filtered = [];\r\n\r\n for(let movieId in movieList){\r\n let currRelease = movieList[movieId].released.toUpperCase();\r\n let currYear = currRelease.substr(currRelease.length-4);\r\n let newSearch = search.toUpperCase();\r\n\r\n //console.log(currTitle);\r\n if(currYear == newSearch){\r\n filtered.push(movieList[movieId]);\r\n }\r\n }\r\n // console.log(filtered)\r\n return filtered;\r\n}", "title": "" }, { "docid": "373bcd64b926d14b937ef8e4931ac9a7", "score": "0.49079487", "text": "function intersect(src, filter) {\n\treturn src.filter(function(e) {\n\t\treturn filter.indexOf(e) != -1;\n\t});\n}", "title": "" }, { "docid": "8c6a69c91ca0e9ce60deb1a40694fde9", "score": "0.49028254", "text": "static displayTag(filters) {\n filters.forEach((filter) => {\n const tag = document.createElement(\"li\");\n document.querySelector(\".nav-tag-list\").appendChild(tag);\n const tagnode = document.createTextNode(\"#\"+filter.name);\n tag.appendChild(tagnode);\n tag.className = filter.classname;\n tag.setAttribute(\"filter\", filter.name);\n }\n )\n }", "title": "" }, { "docid": "0c313ea650e7ec077d3e3bcbd22c60f8", "score": "0.49004555", "text": "getTags() {\n const tags = [];\n this.shadowRoot\n .querySelector('.tags-container .tags')\n .children.forEach((item) => {\n tags.push(item.innerText);\n });\n return tags;\n }", "title": "" }, { "docid": "46ff64bc1e96160f3708e2d14d58dbdb", "score": "0.4899179", "text": "function findChildrenVideo(parentVideo){\n var childrenVideos;\n for(var i = 0; i < sequence.length; i++){\n if(sequence[i].parent === parentVideo){\n childrenVideos = sequence[i].children;\n break;\n }\n }\n return childrenVideos;\n}", "title": "" }, { "docid": "bcf02175e8e61004afb232b3715e11bf", "score": "0.4899165", "text": "function applyFilterTags(filters, names, filetags, embed) {\n var result = [];\n for (var tag in filters) {\n tag = parseInt(tag);\n if (filetags.indexOf(tag) > -1) {\n result.push(filters[tag]);\n }\n }\n if (result.length == 0) {\n return;\n }\n var name = result.length == 1 ? names[0] : names[1];\n // Add to the embed list.\n embed.fields.push(\n {\n name: name,\n value: result.join(', '),\n inline: true\n }\n );\n}", "title": "" }, { "docid": "d708dc5de784689292f056e348264227", "score": "0.48976016", "text": "filterCheck() {\n //this.settings might not be loaded yet when we first start\n if (!this.settings || !this.settings.enableFilters) {\n return;\n }\n\n this.video = this.video || (this.hulu ? this.jQuery('#content-video-player').get(0) : this.jQuery('video:last').get(0));\n\n if (!this.video) {\n return;\n }\n else if (this.getCurrentTime() === 0) {\n this.video = (this.hulu ? this.jQuery('#content-video-player').get(0) : this.jQuery('video:last').get(0));\n }\n\n this.webVTTCheck();\n\n this.currentStatus = {\n currentTime: this.getCurrentTime(),\n paused: this.video.paused,\n duration: this.video.duration,\n entries: this.entries,\n amazon: this.amazon,\n netflix: this.netflix,\n closedCaptionUrl: this.closedCaptionUrl,\n closedCaptionList: this.closedCaptionList,\n autoMuteEnabled: this.autoMuteEnabled,\n serviceId: this.serviceId,\n comment: this.comment\n };\n\n if (this.controlsWindow) {\n this.controlsWindow.postMessage({\n action: 'currentStatus',\n from: 'openangel',\n status: this.currentStatus\n }, '*');\n }\n this.setupControls();\n\n if (this.loopSettings && this.loopSettings.enable) {\n this.video.playbackRate = this.loopSettings.halfSpeed ? 0.5 : 1;\n if (this.getCurrentTime() >= this.loopSettings.filterStart && this.getCurrentTime() <= this.loopSettings.filterEnd && this.loopSettings.enableFilter){\n this.video.muted = true;\n }\n else{\n this.video.muted = false;\n }\n\n if (this.getCurrentTime() >= this.loopSettings.loopEnd && !this.video.paused){\n this.moveToTime(this.loopSettings.loopStart);\n }\n return;\n }\n\n let filters = this.entries.filter(x => x.from <= this.getCurrentTime() && x.to >= this.getCurrentTime() && x.enabled);\n if (filters.length > 0) {\n if (!filters[0].active) {\n filters[0].active = true;\n this.video.muted = true;\n if (filters[0].type === 'video') {\n if (this.netflix) {\n this.netflixMoveToTime(filters[0].to);\n }\n else {\n if (location.href.toLowerCase().indexOf('youtube') > -1) {\n this.video.currentTime = filters[0].to;\n }\n else {\n this.video.pause();\n this.video.currentTime = parseFloat(filters[0].to) + (this.amazon ? this.weirdAmazonBuffer : 0);\n this.video.play();\n }\n }\n }\n }\n this.closedCaptionCensor();\n console.log('in a filter');\n this.jQuery('#whattime').text(this.getCurrentTime());\n }\n else {\n let activeFilters = this.entries.filter(x => x.active);\n if (activeFilters.length > 0) {\n activeFilters[0].active = false;\n this.video.muted = false;\n this.video.playbackRate = this.playSpeed;\n if (this.netflix) {\n this.jQuery(this.video).show();\n this.jQuery('#censorme').remove();\n }\n }\n else {\n this.autoMute();\n }\n\n if (this.settings.showConsole) {\n console.log(this.getCurrentTime());\n }\n }\n }", "title": "" }, { "docid": "e03855910320225672fe6127e0e44ee8", "score": "0.48973122", "text": "getFilter(){\n const searchTerm = this.state.inputFilter || ''\n\t\tconst tags = this.getTagsFromSearchTerm(searchTerm)\n\n const filter = {}\n //Industries Filter\n if(this.state.industryFilter != ''){\n filter.industryIds = this.state.industryFilter\n }\n //Theme Filter\n if(this.state.themeFilter != ''){\n filter.themeId = this.state.themeFilter\n }\n //Input Filter\n if(this.state.inputFilter != '') {\n filter.$or = []\n filter.$or.push({name : { $regex: this.state.inputFilter, $options: 'i' }})\n filter.$or.push({tagIds : {$in: tags}})\n }\n\n return filter\n }", "title": "" }, { "docid": "d4e7c83a869ac21c45eadb83409104ce", "score": "0.48882183", "text": "function getCheckedFilters() {\n // \n // for (var i = 0; i < tagToggles.length; i++){\n // var item = tagToggles[i]\n // if (item == true){\n //\n // }\n // }\n var ids = Object.values(tagToggles).filter(item => item == true);\n console.log(Object.values(tagToggles))\n var c = [];\n for (var i = 0; i < ids.length; i++) {\n c.push(Util.one(\"#\" + ids[i]));\n }\n console.log(c)\n return c;\n}", "title": "" }, { "docid": "becabe149716b0a9de53e21d23217476", "score": "0.48839438", "text": "function filterBadges() {\n let filteredBadges = data;\n filterTags.map((tag) => {\n filteredBadges = filteredBadges.filter(\n (item) =>\n item.role === tag ||\n item.level === tag ||\n item.languages.includes(tag) ||\n item.tools.includes(tag)\n );\n });\n return filteredBadges;\n }", "title": "" }, { "docid": "ef908f2abc3a783a95620c4a6aee85c9", "score": "0.48736066", "text": "function extendFilter(fid, negate, elms) {\r\n var rv = [], ri = -1, v, i = 0, ok,\r\n DIGIT = /^\\s*(?:[\\-+]?)[\\d,\\.]+\\s*$/,\r\n NEGATIVE = /^\\s*\\-[\\d,\\.]+\\s*$/;\r\n\r\n while ( (v = elms[i++]) ) {\r\n ok = 0;\r\n switch (fid) {\r\n case 0x40: ok = DIGIT.test(v[_innerText] || \"\"); break;\r\n case 0x41: ok = NEGATIVE.test(v[_innerText] || \"\"); break;\r\n case 0x42: ok = !!v.tween; break;\r\n case 0x43: ok = v.tween && v.tween.playing(); break;\r\n }\r\n if (ok ^ negate) {\r\n rv[++ri] = v;\r\n }\r\n }\r\n return rv;\r\n}", "title": "" }, { "docid": "218eb9072b219384b2b34f7f7e408a9e", "score": "0.48705202", "text": "function filterReleases(addFilterLink = false) {\n\t\t$('.latest-releases > ul > li').each(function() {\n\t\t\tif(addFilterLink) { $(this)/*.find('> a')*/.prepend('<span class=\"dashicons dashicons-no filter-link\"></span>'); }\n\n\t\t\tlet stub = $(this).find('> a').attr('href').replace(/^\\/shows\\/(.*?)#.*?$/, '$1');\n\t\t\tif($.inArray(stub, window.filtered) !== -1) {\n\t\t\t\tconsole.log(`Stub matched (${stub})`);\n\n\t\t\t\t$(this).addClass('filtered');\n\t\t\t}\n\t\t});\n\t\t// if($.inArray(stub, window.filtered) !== -1) {\n\t}", "title": "" }, { "docid": "b99b4b5f0b269ba468d5c07f00c4ac0c", "score": "0.48678178", "text": "function getAnxiousTv(){\n var emotionAnxious = [\"Crime\", \"Documentary\", \"Film-Noir\", \"Horror\", \"Music\", \"Mystery\", \"Thriller\"]\n var TvAlreadyAdded = false;\n for(i=0;i<emotionAnxious.length;i++){\n for(j=0;j<tvObject.length;j++){\n if(tvObject[j].genre.search(emotionAnxious[i]) >= 0){\n for(k=0;k<anxiousTv.length;k++){\n if(anxiousTv[k] === tvObject[j]){\n TvAlreadyAdded = true;\n }\n }\n if(!TvAlreadyAdded){\n anxiousTv.push(tvObject[j])\n }else{\n TvAlreadyAdded = false;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "fc61dbea86dd294ed3878beb28d99185", "score": "0.48667", "text": "static displayProfileTags(photographers, filters) {\n photographers.forEach((photographer, index) => {\n filters.forEach((filter) => {\n if (filter.photographers.includes(photographer.name)) {\n const tag = document.createElement(\"li\");\n document.querySelector(`[photographer=\"${photographer.name}\"]`).appendChild(tag);\n const tagnode = document.createTextNode(\"#\"+filter.name);\n tag.appendChild(tagnode);\n tag.className = filters[index].classname;\n tag.setAttribute(\"filter\", filter.name);\n }\n })\n })\n }", "title": "" }, { "docid": "7e20f60a79560412bb6454ee8f48664c", "score": "0.48612848", "text": "hasFilter(obj, tags) {\n return ObjectContainsTagSearch(obj, tags);\n }", "title": "" }, { "docid": "f66346da2e068f860ffc02b41054f972", "score": "0.48582366", "text": "function findVideos() {\n let videos = document.querySelectorAll('.video__iframe');\n\n for (let i = 0; i < videos.length; i++) {\n setupVideo(videos[i]);\n }\n }", "title": "" }, { "docid": "1f8740fd6018fafb9d0848217a055d1d", "score": "0.48493892", "text": "function ex3() {\n var newReleases = [{\n \"id\": 70111470,\n \"title\": \"Die Hard\",\n \"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n \"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n \"rating\": 4.0,\n \"bookmark\": []\n }, {\n \"id\": 654356453,\n \"title\": \"Bad Boys\",\n \"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n \"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n \"rating\": 5.0,\n \"bookmark\": [{ id: 432534, time: 65876586 }]\n }, {\n \"id\": 65432445,\n \"title\": \"The Chamber\",\n \"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n \"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n \"rating\": 4.0,\n \"bookmark\": []\n }, {\n \"id\": 675465,\n \"title\": \"Fracture\",\n \"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n \"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n \"rating\": 5.0,\n \"bookmark\": [{ id: 432534, time: 65876586 }]\n }];\n\n // ------------ INSERT CODE HERE! -----------------------------------\n // Chain the filter and map functions to select the id of all videos\n // with a rating of 5.0.\n\n return newReleases // Complete this expression\n // ------------ INSERT CODE HERE! -----------------------------------\n}", "title": "" }, { "docid": "d11c21fef8402f448a0c3f959abca633", "score": "0.48487613", "text": "matchesFilter(filterString) {\n return this.name.toLowerCase().includes(filterString) ||\n (this.tags || []).concat(this.extraTags || []).some(tag => tag.toLowerCase().includes(filterString))\n }", "title": "" }, { "docid": "196d9933934b6ab5ce675cb3d5b33fa2", "score": "0.48415402", "text": "searchWatchedVideos () {\n console.log('[YouTubeHideWatched] searchWatchedVideos')\n const progressBars = document.querySelectorAll('#progress')\n if (!progressBars.length) {\n return\n }\n Array.from(progressBars).forEach(i => {\n if (i.style.width === '100%') {\n const parent = i.closest('ytd-rich-item-renderer')\n parent.classList.add(`-youtube-hide-watched-mode-${this.mode}`)\n }\n })\n }", "title": "" }, { "docid": "9981c7c605bee958f8b66247e2f3226f", "score": "0.48311114", "text": "_getVideoDevices() {\n return from(navigator.mediaDevices.enumerateDevices()).pipe(map(devices => devices.filter(device => device.kind === 'videoinput')));\n }", "title": "" }, { "docid": "acefa212a6bd77d794e0e8cd2d471e62", "score": "0.4826748", "text": "function getTagList() {\n return sidebarService.getTag({}, (tags, error) => {\n vm.tags = [];\n if (tags) {\n if (!angular.isArray(tags)) {\n vm.tags.push(tags); // response is an object, not an array\n } else {\n vm.tags = tags;\n }\n\n for(let tag of vm.tags) {\n if (tag.$.color) {\n tag.$.rgb = vncConstant.COLOR_CODES[tag.$.color];\n }\n }\n }\n });\n }", "title": "" }, { "docid": "b0f3a0cd301f3b704e09e965c30f11e3", "score": "0.48140487", "text": "function getFilters(){\n return filters;\n }", "title": "" }, { "docid": "d37728ae038c24754dc1fbfb4755ed09", "score": "0.48091814", "text": "function filterPosts(tag) {\n $('#posts-list .post').each(function() {\n var post = $(this);\n var tags = getTags(post);\n if(findOne(tagSearchFilters, tags)) {\n post.show();\n } else {\n post.hide();\n }\n });\n }", "title": "" }, { "docid": "dee031e00d36fab06a5e1361419509ab", "score": "0.48042285", "text": "videoSearch(term) {\n YTSearch({ key: API_KEY, term: term + ' conspiracy theory' }, (videos) => {\n this.setState({\n videos: videos,\n selectedVideo: videos[0],\n });\n });\n }", "title": "" }, { "docid": "283a56e2958c135515e77530a7db078f", "score": "0.4800259", "text": "function filterFilms(watched) {\n const filteredFilms = films.filter(film => film.watched === watched)\n return filteredFilms\n }", "title": "" }, { "docid": "c0a637900237ce90d3d46f35cd6001cc", "score": "0.47997448", "text": "function findtags(musicfile){\n const tracks = document.querySelectorAll('.track')\n const jsmediatags = window.jsmediatags\n\n jsmediatags.read(musicfile, {\n onSuccess: function(tags){\n tracks.forEach(track => {\n let picture = tags.tags.picture\n if(picture){\n let base64String = ''\n for(let i = 0; i < picture.data.length; i++){\n base64String += String.fromCharCode(picture.data[i])\n }\n const imgSrc = 'data:'+ picture.format + ';base64,' + window.btoa(base64String);\n track.dataset.picture = imgSrc\n }\n \n track.dataset.title = tags.tags.title\n track.dataset.artist = tags.tags.artist\n track.dataset.album = tags.tags.album\n \n })\n \n \n },\n onError: function(error){\n console.log(error.type,error.info)\n \n }\n })\n}", "title": "" }, { "docid": "1439b34c677deb57b4a874fd6fd96dbd", "score": "0.47958076", "text": "async function __searchFromChannelsByFilters() {\n const youtube = __getClient();\n const filters = __getFilterFileConfig();\n const channelIds = await __getChannelIds();\n\n const searchArray = filters.map(filter => {\n const search = channelIds.map(channelId => {\n return youtube.search.list({\n part: 'snippet',\n channelId,\n q: filter,\n });\n });\n\n return search;\n });\n\n searchArray.flat(Infinity);\n\n return searchArray;\n}", "title": "" }, { "docid": "df35fce977587e04fdbc211c1bdaf4be", "score": "0.4787211", "text": "videoSearch(term){\n YTSearch({key:API_KEY ,term:term}, (videos) => {\n console.log(videos);\n this.setState({\n videos:videos,\n selectedVideo:videos[0]\n });\n });\n }", "title": "" }, { "docid": "0f100e483d73e359a2a910032da0d379", "score": "0.4785929", "text": "function getAllQuestTags(viewer) {\r\n\tvar vTags = [];\r\n\tfor (var _autoKey in global.vQuests) {\r\n\t\tvar quest = global.vQuests[_autoKey];\r\n\t\tif ( viewer && viewer.quest(\"QUEDIT_DISP_TOG\") != 0 && !arrContains(quest.editors, viewer.name)) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tfor (var _autoKey in quest.tags) {\r\n\t\t\tvar tag = quest.tags[_autoKey];\r\n\t\t\tif ( arrContains(vTags,tag) == false ) {\r\n\t\t\t\tvTags.push(tag);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvTags.sort();\r\n\treturn vTags;\r\n}", "title": "" }, { "docid": "17d007829b3b4fe2c1c1f300aa2fca8d", "score": "0.47840455", "text": "function renderTags(id) {\n state.pichas.find(pic => pic.id === id).tags\n .forEach(tag => {\n const tagBtn = document.createElement('button')\n const tagSpan = document.createElement('span')\n tagBtn.className = 'tag-button'\n tagSpan.innerText = tag.description\n // Filters the images on clicking tag\n tagBtn.addEventListener('click', event => {\n event.preventDefault()\n cardHold.innerHTML = ''\n renderPhotos(filtered(tag.description))\n togglePopup2()\n })\n tagBtn.append(tagSpan)\n tagsContainer.append(tagBtn)\n })\n}", "title": "" }, { "docid": "ff3e17d33a3279f141b95ecdfc6f4a22", "score": "0.47712678", "text": "function findInChildNodes(tagToCheck, domElement){\n\tvar i, matchedElements={\n\t\tmatchStatus:new Boolean(false),\n\t\tmatchedObjects:[]\n\t};\n\tfor(i=0;i<domElement.childNodes.length;i++){\n\t\tif((domElement.childNodes[i].tagName)==tagToCheck.toUpperCase()){\n\t\t\tconsole.log(matchedElements.matchedObjects);\n\t\t}\n\t}\n\treturn matchedElements;\n}", "title": "" }, { "docid": "fc270c5465dc67fd807dfb57269173b9", "score": "0.47619992", "text": "tags() {\n\n this.entryList.map(entry => {\n entry.tags.forEach(tag => this.allTags.push(tag));\n });\n\n\n //Passing in allTags array to a Set constructor: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\n //All values are now unique using set and converting back to array\n return Array.from(new Set(this.allTags));\n }", "title": "" }, { "docid": "aa88d183bc3a7f939b2ced1e68110648", "score": "0.47599378", "text": "function filter_movies_title(search, movieList){\r\n let filtered = [];\r\n\r\n for(let movieId in movieList){\r\n let currTitle = movieList[movieId].title.toUpperCase();\r\n let newSearch = search.toUpperCase();\r\n\r\n //console.log(currTitle);\r\n if(currTitle.includes(newSearch)){\r\n filtered.push(movieList[movieId]);\r\n }\r\n }\r\n // console.log(filtered)\r\n return filtered;\r\n}", "title": "" }, { "docid": "a9882611b21abb714396bf39a3320c7a", "score": "0.47494048", "text": "function getInLoveTv(){\n var emotionInLove = [\"Adventure\", \"Animation\", \"Drama\", \"Family\", \"Fantasy\", \"Romance\"]\n var TvAlreadyAdded = false;\n for(i=0;i<emotionInLove.length;i++){\n for(j=0;j<tvObject.length;j++){\n if(tvObject[j].genre.search(emotionInLove[i]) >= 0){\n for(k=0;k<inLoveTv.length;k++){\n if(inLoveTv[k] === tvObject[j]){\n TvAlreadyAdded = true;\n }\n }\n if(!TvAlreadyAdded){\n inLoveTv.push(tvObject[j])\n }else{\n TvAlreadyAdded = false;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "9ba5d24e788fdef0223c994272c73df2", "score": "0.47460213", "text": "function getImgs() {\n if (!gFilterBy) return gImgs\n return gImgs.filter(img => img.keyword.includes(gFilterBy.toLowerCase()))\n}", "title": "" }, { "docid": "9ba5d24e788fdef0223c994272c73df2", "score": "0.47460213", "text": "function getImgs() {\n if (!gFilterBy) return gImgs\n return gImgs.filter(img => img.keyword.includes(gFilterBy.toLowerCase()))\n}", "title": "" }, { "docid": "7582e4151b703f4692115eba518999de", "score": "0.47363436", "text": "function getEnrichedAndSortedTagList(filter) {\n let all_tags = {};\n for (let i = 0; i < items.length; i++) {\n\n for (let sub of items[i].subitems) {\n\n if (filter && sub._include !== 1) {\n continue;\n }\n\n for (let direct_tag of sub._direct_tags) {\n if (all_tags[direct_tag] !== undefined) {\n all_tags[direct_tag] += 1;\n }\n else {\n all_tags[direct_tag] = 1;\n }\n }\n\n for (let implied_tag of sub._implied_tags) {\n if (all_tags[implied_tag] !== undefined) {\n all_tags[implied_tag] += 1;\n }\n else {\n all_tags[implied_tag] = 1;\n }\n }\n\n for (let inherited_tag of sub._inherited_tags) {\n if (all_tags[inherited_tag] !== undefined) {\n all_tags[inherited_tag] += 1;\n }\n else {\n all_tags[inherited_tag] = 1;\n }\n }\n }\n }\n let list = [];\n for (let key in all_tags) {\n list.push({ 'tag': key, 'count': all_tags[key]});\n }\n list.sort(function (a, b) {\n if (a.count < b.count) {\n return -1;\n }\n if (a.count > b.count) {\n return 1;\n }\n return b.tag.localeCompare(a.tag);\n });\n list.reverse();\n return list;\n }", "title": "" }, { "docid": "82fb284a1cd3e60cc1dde9826e3c743c", "score": "0.47362587", "text": "function filterTags(nodeList, filter) {\r\n var filtered = [].filter.call(nodeList, function (node) {\r\n return node.nodeType == 1 && node.tagName.toLowerCase() == filter.tag && hasClass(node, filter[\"class\"]);\r\n // return element.parentNode == filter.parent;\r\n });\r\n return filtered;\r\n /*\r\n [].filter.call(ul.querySelectorAll(\"li\"), function(element){\r\n return element.parentNode == ul;\r\n });\r\n [].filter.call(ul.childNodes, function(node) {\r\n return node.nodeType == 1 && node.tagName.toLowerCase() == 'li';\r\n });*/\r\n}", "title": "" } ]
3a13e5d6e6f9467315065ee2e2248302
Reorders the edges so that a search for points of intersection between two planes and a face will go in a predictable order, eg bottom plane, top, top, bottom, and begin on the edge with the first bottom.
[ { "docid": "6fd099939171cc9302137daf3a70eafd", "score": "0.7191305", "text": "reorderEdges(plane, edges, initial) {\n let reorderedEdges = [];\n // Test for reversal\n if (this.testForEdgeReversal(plane, edges, initial)) {\n // Reverse and Reorder\n for (let i = initial.initialEdgeIndex + edges.length; i > initial.initialEdgeIndex; i--) {\n // Switch direction of edge\n reorderedEdges.push(new THREE.Line3(edges[i % edges.length].end, edges[i% edges.length].start));\n }\n } else {\n // reorder\n for (let i = initial.initialEdgeIndex; i < initial.initialEdgeIndex + edges.length; i++) {\n reorderedEdges.push(edges[i % edges.length]); \n }\n }\n return reorderedEdges;\n }", "title": "" } ]
[ { "docid": "12ce7242c929c5ea758604fa2c80b796", "score": "0.6270114", "text": "function HalfEdge(room, wall, front) {\n this.room = room;\n this.wall = wall;\n this.front = front;\n /** used for intersection testing... not convinced this belongs here */\n this.plane = null;\n /** transform from world coords to wall planes (z=0) */\n this.interiorTransform = new THREE.Matrix4();\n /** transform from world coords to wall planes (z=0) */\n this.invInteriorTransform = new THREE.Matrix4();\n /** transform from world coords to wall planes (z=0) */\n this.exteriorTransform = new THREE.Matrix4();\n /** transform from world coords to wall planes (z=0) */\n this.invExteriorTransform = new THREE.Matrix4();\n /** */\n this.redrawCallbacks = $.Callbacks();\n /**\n * this feels hacky, but need wall items\n */\n this.generatePlane = function () {\n function transformCorner(corner) {\n return new THREE.Vector3(corner.x, 0, corner.y);\n }\n var v1 = transformCorner(this.interiorStart());\n var v2 = transformCorner(this.interiorEnd());\n var v3 = v2.clone();\n v3.y = this.wall.height;\n var v4 = v1.clone();\n v4.y = this.wall.height;\n var geometry = new THREE.Geometry();\n geometry.vertices = [v1, v2, v3, v4];\n geometry.faces.push(new THREE.Face3(0, 1, 2));\n geometry.faces.push(new THREE.Face3(0, 2, 3));\n geometry.computeFaceNormals();\n geometry.computeBoundingBox();\n this.plane = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial());\n this.plane.visible = false;\n this.plane.edge = this; // js monkey patch\n this.computeTransforms(this.interiorTransform, this.invInteriorTransform, this.interiorStart(), this.interiorEnd());\n this.computeTransforms(this.exteriorTransform, this.invExteriorTransform, this.exteriorStart(), this.exteriorEnd());\n };\n this.front = front || false;\n this.offset = wall.thickness / 2.0;\n this.height = wall.height;\n if (this.front) {\n this.wall.frontEdge = this;\n }\n else {\n this.wall.backEdge = this;\n }\n }", "title": "" }, { "docid": "ca0e960e98a48e385171259dcdec8f26", "score": "0.6257275", "text": "generatePlane() {\n let geometry = new Geometry();\n let v1 = this.transformCorner(this.interiorStart());\n let v2 = this.transformCorner(this.interiorEnd());\n let v3 = v2.clone();\n let v4 = v1.clone();\n\n let ab = null;\n let ac = null;\n // v3.y = this.wall.height;\n // v4.y = this.wall.height;\n\n v3.y = this.wall.startElevation;\n v4.y = this.wall.endElevation;\n\n ab = v2.clone().sub(v1);\n ac = v3.clone().sub(v1);\n this.__vertices = [v1, v2, v3, v4];\n this.__normal = ab.cross(ac).normalize();\n geometry.vertices = [v1, v2, v3, v4];\n geometry.faces.push(new Face3(0, 1, 2));\n geometry.faces.push(new Face3(0, 2, 3));\n geometry.computeFaceNormals();\n geometry.computeBoundingBox();\n\n if (!this.plane) {\n this.plane = new Mesh(new BufferGeometry().fromGeometry(geometry), new MeshBasicMaterial({ visible: true }));\n } else {\n this.plane.geometry.dispose();\n this.plane.geometry = new BufferGeometry().fromGeometry(geometry); //this.plane.geometry.fromGeometry(geometry);\n }\n\n //The below line was originally setting the plane visibility to false\n //Now its setting visibility to true. This is necessary to be detected\n //with the raycaster objects to click walls and floors.\n this.plane.visible = true;\n this.plane.edge = this; // js monkey patch\n this.plane.wall = this.wall;\n\n this.plane.geometry.computeBoundingBox();\n this.plane.geometry.computeFaceNormals();\n\n\n this.computeTransforms(this.interiorTransform, this.invInteriorTransform, this.interiorStart(), this.interiorEnd());\n this.computeTransforms(this.exteriorTransform, this.invExteriorTransform, this.exteriorStart(), this.exteriorEnd());\n\n let b3 = new Box3();\n b3.setFromObject(this.plane);\n this.min = b3.min.clone();\n this.max = b3.max.clone();\n this.center = this.max.clone().sub(this.min).multiplyScalar(0.5).add(this.min);\n }", "title": "" }, { "docid": "bb94b3c2c779ac8dd3ae9b7d5e578b15", "score": "0.62433016", "text": "order_edges(slice) {\n var visit = new util.set();\n var evisit = new util.set();\n var newedges = [];\n\n for (var v of slice.verts) {\n if (visit.has(v) || v.edges.length == 0) {\n continue;\n }\n\n var loop = [], eloop=[];\n\n visit.add(v);\n\n var e2 = v.edges[0];\n var v2 = e2.v1;\n var _i = 0;\n var wind = 0;\n var cent = new Vector3();\n var totcent=0;\n\n do {\n cent.add(v2);\n totcent++;\n loop.push(v2);\n eloop.push(e2);\n\n if (v2 !== e2.v1) {\n slice.flip_edge(e2);\n }\n\n if (v2.edges.length != 2) {\n _appstate.console.trace(\"WARNING: nonmanifold geometry detected\");\n break;\n }\n\n if (_i++ > 10000) {\n _appstate.console.log(\"infinite loop detected!\");\n break;\n }\n\n visit.add(v2);\n\n v2 = e2.other_vertex(v2);\n\n if (v2.edges.length != 2) {\n //_appstate.console.log(\"eek! non-manifold vertex?\", v2.edges.length, v2);\n break;\n }\n e2 = v2.other_edge(e2);\n } while (v2 !== v);\n\n if (totcent == 0)\n continue;\n\n //calculate winding\n cent.divScalar(totcent);\n\n for (var i=1; i<loop.length-1; i++) {\n var v1 = loop[i], v2 = loop[(i+1)%loop.length];\n\n wind += math.winding(loop[0], v1, v2) ? 1 : -1;\n }\n\n //enforce winding\n if (wind > 0) {\n //flip\n for (e of eloop) {\n slice.flip_edge(e);\n }\n\n eloop.reverse();\n }\n\n for (var e of eloop) {\n newedges.push(e);\n }\n }\n\n this.edges = newedges;\n }", "title": "" }, { "docid": "33328949c66017fcec54c127c48f9f7a", "score": "0.5998622", "text": "findPointsOfIntersection(bed, planes) {\n\n let edges = this.edges;\n let points = [];\n let initialBottom = this.findInitialIntersection(planes.bottom);\n\n if (initialBottom) {\n edges = this.reorderEdges(planes.bottom, this.edges, initialBottom);\n return this.verticiesInOrder(bed, planes, edges, ['bottom', 'top', 'top', 'bottom']);\n } else {\n let initialTop = this.findInitialIntersection(planes.top);\n if (initialTop) {\n edges = this.reorderEdges(planes.top, this.edges, initialTop);\n return this.verticiesInOrder(bed, planes, edges, ['top', 'bottom', 'bottom', 'top']);\n } else {\n // this.checkLastBed(bed, planes)\n return [];\n } \n }\n }", "title": "" }, { "docid": "62df953ec4d0480f94d102f157156756", "score": "0.5966189", "text": "function getVisibleOrder(cube) {\n let cornerLoc = cube.getCornerLocations();\n let cornerOrient = cube.getCornerOrientations();\n let edgeLoc = cube.getEdgeLocations();\n let edgeOrient = cube.getEdgeOrientations();\n let sideLoc = cube.getSideLocations();\n let sideOrient = cube.getSideOrientations();\n let order = 1;\n\n let visitedLocs;\n let i, j, k, n, p;\n let prevOrient;\n let length;\n\n // determine cycle lengths of the current corner permutation\n // and compute smallest common multiple\n visitedLocs = new Array(cornerLoc.length);\n\n for (i = 0, n = cornerLoc.length; i < n; i++) {\n if (!visitedLocs[i]) {\n if (cornerLoc[i] == i && cornerOrient[i] == 0) {\n continue;\n }\n\n length = 1;\n\n visitedLocs[i] = true;\n prevOrient = 0;\n\n for (j = 0; cornerLoc[j] != i; j++) {\n // search first permuted part\n }\n\n while (!visitedLocs[j]) {\n visitedLocs[j] = true;\n prevOrient = (prevOrient + cornerOrient[j]) % 3;\n\n length++;\n\n for (k = 0; cornerLoc[k] != j; k++) {\n }\n j = k;\n }\n\n prevOrient = (prevOrient + cornerOrient[i]) % 3;\n if (prevOrient != 0) {\n length *= 3;\n }\n order = scm(order, length);\n }\n }\n\n // determine cycle lengths of the current edge permutation\n // and compute smallest common multiple\n visitedLocs = new Array(edgeLoc.length);\n for (i = 0, n = edgeLoc.length; i < n; i++) {\n if (!visitedLocs[i]) {\n if (edgeLoc[i] == i && edgeOrient[i] == 0) {\n continue;\n }\n\n length = 1;\n\n visitedLocs[i] = true;\n prevOrient = 0;\n\n for (j = 0; edgeLoc[j] != i; j++) {\n // search first permuted part\n }\n\n while (!visitedLocs[j]) {\n visitedLocs[j] = true;\n prevOrient ^= edgeOrient[j];\n\n length++;\n\n for (k = 0; edgeLoc[k] != j; k++) {\n }\n j = k;\n }\n\n if ((prevOrient ^ edgeOrient[i]) == 1) {\n length *= 2;\n }\n order = scm(order, length);\n }\n }\n\n // Determine cycle lengths of the current side permutation\n // and compute smallest common multiple.\n // - Ignore changes of orientation.\n // - Ignore side permutations which are entirely on same face.\n visitedLocs = new Array(sideLoc.length);\n for (i = 0, n = sideLoc.length; i < n; i++) {\n if (!visitedLocs[i]) {\n if (sideLoc[i] == i && sideOrient[i] == 0) {\n continue;\n }\n\n length = 1;\n\n visitedLocs[i] = true;\n let facesInPermutation = new Array();\n facesInPermutation.push(sideLoc[i] % 6);\n\n for (j = 0; sideLoc[j] != i; j++) {\n // search first permuted part\n }\n\n while (!visitedLocs[j]) {\n visitedLocs[j] = true;\n\n length++;\n facesInPermutation.push(sideLoc[j] % 6);\n\n for (k = 0; sideLoc[k] != j; k++) {\n // search next permuted part\n }\n j = k;\n }\n if (length > 0) {\n // If all parts at a distance of 3 are on the same face, the length can be divided by 3.\n // If all parts at a distance of 2 are on the same face, the length can be divided by 2\n // If all parts are in the same face, the length can be reduced to 1\n let reducedLength = length;\n SubcycleSearch:\n for (let subcycleLength = 1; subcycleLength < length; subcycleLength++) {\n if (subcycleLength > 0 && length % subcycleLength == 0) {\n let canReduceLength = true;\n for (j = subcycleLength; j < length; j += subcycleLength) {\n for (k = 0; k < subcycleLength; k++) {\n if (facesInPermutation[j + k - subcycleLength] != facesInPermutation[j + k]) {\n canReduceLength = false;\n break;\n }\n }\n }\n if (canReduceLength) {\n reducedLength = subcycleLength;\n break SubcycleSearch;\n }\n }\n }\n order = scm(order, reducedLength);\n }\n }\n }\n\n return order;\n }", "title": "" }, { "docid": "98b953780c8669431663582fff33a8e7", "score": "0.5936655", "text": "function findOuterEdges() {\n var edges = []\n var faces = geometry.faces\n for (var firstI = 0; firstI < faces.length; firstI++) {\n var firstFace = faces[firstI]\n firstFace.eachEdge(function(vertIndexA, vertIndexB, other) {\n var isEdge = true\n for (var secondI = 0; secondI < faces.length; secondI++) {\n if (firstI == secondI) continue\n var secondFace = faces[secondI]\n if (secondFace.contains(vertIndexA) && secondFace.contains(vertIndexB)) return\n }\n edges.push([vertIndexA, vertIndexB, other])\n })\n }\n return edges\n}", "title": "" }, { "docid": "ffd304179dc209483e9c00290a09b1dd", "score": "0.59297717", "text": "generatePlane()\n\t{\n\t\tvar geometry = new Geometry();\n\t\tvar v1 = this.transformCorner(this.interiorStart());\n\t\tvar v2 = this.transformCorner(this.interiorEnd());\n\t\tvar v3 = v2.clone();\n\t\tvar v4 = v1.clone();\n\t\tv3.y = this.wall.height;\n\t\tv4.y = this.wall.height;\n\n\t\tgeometry.vertices = [v1, v2, v3, v4];\n\t\tgeometry.faces.push(new Face3(0, 1, 2));\n\t\tgeometry.faces.push(new Face3(0, 2, 3));\n\t\tgeometry.computeFaceNormals();\n\t\tgeometry.computeBoundingBox();\n\t\t\n \n\t\tthis.plane = new Mesh(geometry, new MeshBasicMaterial({visible:false}));\n\t\t//The below line was originally setting the plane visibility to false\n\t\t//Now its setting visibility to true. This is necessary to be detected\n\t\t//with the raycaster objects to click walls and floors.\n\t\tthis.plane.visible = true;\n\t\tthis.plane.edge = this; // js monkey patch\n\n\t\tthis.computeTransforms(this.interiorTransform, this.invInteriorTransform, this.interiorStart(), this.interiorEnd());\n\t\tthis.computeTransforms(this.exteriorTransform, this.invExteriorTransform, this.exteriorStart(), this.exteriorEnd());\n\t\t\n\t\tvar b3 = new Box3();\n\t\tb3.setFromObject(this.plane);\n\t\tthis.min = b3.min.clone();\n\t\tthis.max = b3.max.clone();\n\t\tthis.center = this.max.clone().sub(this.min).multiplyScalar(0.5).add(this.min);\n\t}", "title": "" }, { "docid": "0b5bb1de879a0efdca991593e9325b34", "score": "0.5903039", "text": "function addBackEdges(r) {\n for (var i in r) {\n var src = r[i];\n src.incoming = [];\n for (var j in src.outgoing) {\n var edge = src.outgoing[j];\n edge.src = src;\n edge.dst.incoming.push(edge);\n }\n }\n\n for (var i in r) {\n r[i].incoming.sort(edgePO);\n};\n\n/** examples ******************************************************************/\n\n/* example 1\n**\n** _e\n** _╱ ╱\n** _╱ ╱ _g ────> x\n** _╱ ╱ ╱ │\n** a d───f │\n** ╲ b _╱ h ▽\n** ╲ __╱\n** c y\n**\n*/\n\nR.example1 = function example1() {\n\n var a, b, c, d, e, f, g, h;\n a = {pos: V.fromIntPair([0, 0]), isolated: BOUNDARY, incoming: [], outgoing: []};\n b = {pos: V.fromIntPair([1, 1]), isolated: INSIDE, incoming: [], outgoing: []};\n c = {pos: V.fromIntPair([1, 2]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: c, dst: a, leftIn: false, rightIn: false}]};\n d = {pos: V.fromIntPair([2, 0]), isolated: BOUNDARY, incoming: [], outgoing: []};\n e = {pos: V.fromIntPair([3, -2]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: e, dst: a, leftIn: true, rightIn: false},\n {src: e, dst: d, leftIn: false, rightIn: true}]};\n f = {pos: V.fromIntPair([4, 0]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: f, dst: d, leftIn: true, rightIn: false},\n {src: f, dst: c, leftIn: false, rightIn: true}]};\n g = {pos: V.fromIntPair([5, -1]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: g, dst: f, leftIn: false, rightIn: false}]};\n h = {pos: V.fromIntPair([5, 1]), isolated: OUTSIDE, incoming: [], outgoing: []};\n\n var result = [a,b,c,d,e,f,g,h];\n addBackEdges(result);\n\n return result;\n};\n\n/* example 2\n**\n** a──────────c\n** │ │\n** │ d──g\n** │ │ │\n** │ e──h\n** │ │\n** b──────────f\n**\n*/\nR.example2 = function() {\n var a, b, c, d, e, f, g, h;\n\n a = {pos: V.fromIntPair([0, 0]), isolated: BOUNDARY, incoming: [], outgoing: []};\n b = {pos: V.fromintPair([0, 3]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: b, dst: a, leftIn: false, rightIn: true}]};\n c = {pos: V.fromIntPair([3, 0]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: c, dst: a, leftIn: true, rightIn: false}]};\n d = {pos: V.fromIntPair([3, 1]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: d, dst: c, leftIn: true, rightIn: false}]};\n e = {pos: V.fromIntPair([3, 2]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: e, dst: d, leftIn: true, rightIn: true}]};\n f = {pos: V.fromIntPair([3, 3]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: f, dst: e, leftIn: true, rightIn: false},\n {src: f, dst: b, leftIn: false, rightIn: true}]};\n g = {pos: V.fromIntPair([4, 1]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: g, dst: d, leftIn: true, rightIn: false}]};\n h = {pos: V.fromIntPair([4, 2]), isolated: BOUNDARY, incoming: [],\n outgoing: [{src: h, dst: g, leftIn: true, rightIn: false},\n {src: h, dst: e, leftIn: false, rightIn: true}]};\n\n var result = [a,b,c,d,e,f,g,h];\n addBackEdges(result);\n\n return result;\n};\n\n/** constructors **************************************************************/\n\n/** create a region representing a simple polygon, given as a list of points in\n * clockwise order around the boundary.\n */\nR.ofPoly = function ofPoly(points) {\n var result = points.map(function (p) { return pos: p, isolated: BOUNDARY, outgoing: [] };\n\n for (var i in result) {\n here = result[i];\n next = result[(i+1)%result.length];\n if (vertPO.leq(here, next))\n next.outgoing.push({dst: here, leftIn: true, rightIn: false});\n else\n here.outgoing.push({dst: next, leftIn: false, rightIn: true});\n }\n\n for (var i in result)\n result[i].outgoing.sort(edgePO(result[i].pos).cmp);\n\n result.sort(vertPO.cmp);\n addBackEdges(result);\n\n return result;\n};\n\n/** utility functions *********************************************************/\n\nR.ofString = function ofString(s) {\n // TODO: handle cycles\n return JSON.parse(s, function (k,v) {\n return k == \"pos\" ? V.ofString(v) : v;\n });\n};\n\nR.stringOf = function stringOf(r) {\n // TODO: handle cycles\n return JSON.stringify(r, function(k, v) {\n return k == \"pos\" ? V.stringOf(v) : v;\n });\n};\n\nR.copy = function copy(r) {\n var updated = new buckets.MultiDictionary(vertexPO.stringOf, vertexPO.eq);\n var result = [];\n for (var i in r) {\n var newv = {pos: r[i].pos,\n isolated: r[i].isolated,\n outgoing: r[i].outgoing.map(function (e) { return\n {dst: updated.get(e.dst), leftIn: e.leftIn, rightIn: e.rightIn}; }),\n incoming: []\n };\n updated.set(r[i],newv);\n result.push(newv);\n }\n addBackEdges(result);\n\n return result;\n};\n\n/** a copy of r with all low-dimensional features removed */\nR.regularize = function regularize(r) {\n var r = R.copy(r);\n\n // remove low-d edges\n for (var i in r) {\n r[i].outgoing = r[i].outgoing.filter(function (e) { return e.leftIn != e.rightIn; });\n r[i].incoming = r[i].incoming.filter(function (e) { return e.leftIn != e.rightIn; });\n }\n\n // remove isolated vertices\n return r.filter(function (v) { return v.incoming.length > 0 || v.outgoing.length > 0; });\n};\n\n/** a copy of r with all vertices translated by offset */\nR.translate = function translate(r, offset) {\n var result = R.copy(r);\n\n for (var i in r)\n r[i].pos = V.plus(r[i].pos, offset);\n\n return result;\n};\n\n/** merge *********************************************************************/\n\n/** a copy of r with adjacent colinear edges merged */\nR.merge = function merge(r) {\n throw new Error(\"not implemented\");\n};\n\n/** union *********************************************************************/\n\n/**\n * @typedef Event @type {object}\n * @property {Vector} position\n */\n\n/** @constructor */\nfunction Event(vertex) {\n this.position = vertex.pos;\n};\n\nvar eventPO;\n\nfunction Boundary() {\n throw new Error(\"Not Implemented\");\n}\n\nvar boundaryPO;\n\n/** union the two regions */\nR.union = function union(r1, r2) {\n var worklist = new util.PrioritySet(eventPO.cmp);\n\n for (var i in r1) {\n var ev = worklist.findOrAdd(new Event(r1.pos));\n ev.addV1(v1);\n }\n for (var i in r2)\n var ev = worklist.findOrAdd(new Event(r2.pos));\n ev.addV2(v2);\n }\n\n var sweepLine = new buckets.BSTree(boundaryPO.compare);\n var result = [];\n\n while(!worklist.isEmpty()) {\n var ev = worklist.dequeue();\n throw new Error(\"Not Implemented\");\n }\n\n return result;\n}", "title": "" }, { "docid": "24e6c63e4439ccf1f128fe1b921a3dc0", "score": "0.58621305", "text": "function getOrder(cube) {\n let cornerLoc = cube.getCornerLocations();\n let cornerOrient = cube.getCornerOrientations();\n let edgeLoc = cube.getEdgeLocations();\n let edgeOrient = cube.getEdgeOrientations();\n let sideLoc = cube.getSideLocations();\n let sideOrient = cube.getSideOrientations();\n\n let order = 1;\n\n let visitedLocs;\n let i, j, k, n, p;\n let prevOrient;\n let length;\n\n // determine cycle lengths of the current corner permutation\n // and compute smallest common multiple\n visitedLocs = new Array(cornerLoc.length);\n\n for (i = 0; i < 8; i++) {\n if (!visitedLocs[i]) {\n if (cornerLoc[i] == i && cornerOrient[i] == 0) {\n continue;\n }\n\n length = 1;\n\n visitedLocs[i] = true;\n prevOrient = 0;\n\n for (j = 0; cornerLoc[j] != i; j++) {\n }\n\n while (!visitedLocs[j]) {\n visitedLocs[j] = true;\n prevOrient = (prevOrient + cornerOrient[j]) % 3;\n\n length++;\n\n for (k = 0; cornerLoc[k] != j; k++) {\n }\n j = k;\n }\n\n prevOrient = (prevOrient + cornerOrient[i]) % 3;\n if (prevOrient != 0) {\n //order = scm(order, 3);\n length *= 3;\n }\n order = scm(order, length);\n }\n }\n\n // determine cycle lengths of the current edge permutation\n // and compute smallest common multiple\n visitedLocs = new Array(edgeLoc.length);\n for (i = 0, n = edgeLoc.length; i < n; i++) {\n if (!visitedLocs[i]) {\n if (edgeLoc[i] == i && edgeOrient[i] == 0) {\n continue;\n }\n\n length = 1;\n\n visitedLocs[i] = true;\n prevOrient = 0;\n\n for (j = 0; edgeLoc[j] != i; j++) {\n }\n\n while (!visitedLocs[j]) {\n visitedLocs[j] = true;\n prevOrient ^= edgeOrient[j];\n\n length++;\n\n for (k = 0; edgeLoc[k] != j; k++) {\n }\n j = k;\n }\n\n if ((prevOrient ^ edgeOrient[i]) == 1) {\n //order = scm(order, 2);\n length *= 2;\n }\n order = scm(order, length);\n }\n }\n\n // determine cycle lengths of the current side permutation\n // and compute smallest common multiple\n visitedLocs = new Array(sideLoc.length);\n for (i = 0, n = sideLoc.length; i < n; i++) {\n if (!visitedLocs[i]) {\n if (sideLoc[i] == i && sideOrient[i] == 0) {\n continue;\n }\n\n length = 1;\n\n visitedLocs[i] = true;\n prevOrient = 0;\n\n for (j = 0; sideLoc[j] != i; j++) {\n }\n\n while (!visitedLocs[j]) {\n visitedLocs[j] = true;\n\n length++;\n\n prevOrient = (prevOrient + sideOrient[j]) % 4;\n\n for (k = 0; sideLoc[k] != j; k++) {\n }\n j = k;\n }\n\n prevOrient = (prevOrient + sideOrient[i]) % 4;\n switch (prevOrient) {\n case 0: // no sign\n break;\n case 1: // '-' sign\n //order = scm(order, 4);\n length *= 4;\n break;\n case 2: // '++' sign\n //order = scm(order, 2);\n length *= 2;\n break;\n case 3: // '+' sign\n //order = scm(order, 4);\n length *= 4;\n break;\n }\n order = scm(order, length);\n }\n }\n\n return order;\n}", "title": "" }, { "docid": "8c7dd57b2a3407906eccbb669b04fbb1", "score": "0.56963813", "text": "function unZorroIntersection(intersection, graph) {\n\t var vertex = graph.entity(intersection.nodeId);\n\t var way1 = graph.entity(intersection.movedId);\n\t var way2 = graph.entity(intersection.unmovedId);\n\t var isEP1 = intersection.movedIsEP;\n\t var isEP2 = intersection.unmovedIsEP; // don't move the vertex if it is the endpoint of both ways.\n\n\t if (isEP1 && isEP2) return graph;\n\t var nodes1 = graph.childNodes(way1).filter(function (n) {\n\t return n !== vertex;\n\t });\n\t var nodes2 = graph.childNodes(way2).filter(function (n) {\n\t return n !== vertex;\n\t });\n\t if (way1.isClosed() && way1.first() === vertex.id) nodes1.push(nodes1[0]);\n\t if (way2.isClosed() && way2.first() === vertex.id) nodes2.push(nodes2[0]);\n\t var edge1 = !isEP1 && geoChooseEdge(nodes1, projection(vertex.loc), projection);\n\t var edge2 = !isEP2 && geoChooseEdge(nodes2, projection(vertex.loc), projection);\n\t var loc; // snap vertex to nearest edge (or some point between them)..\n\n\t if (!isEP1 && !isEP2) {\n\t var epsilon = 1e-6,\n\t maxIter = 10;\n\n\t for (var i = 0; i < maxIter; i++) {\n\t loc = geoVecInterp(edge1.loc, edge2.loc, 0.5);\n\t edge1 = geoChooseEdge(nodes1, projection(loc), projection);\n\t edge2 = geoChooseEdge(nodes2, projection(loc), projection);\n\t if (Math.abs(edge1.distance - edge2.distance) < epsilon) break;\n\t }\n\t } else if (!isEP1) {\n\t loc = edge1.loc;\n\t } else {\n\t loc = edge2.loc;\n\t }\n\n\t graph = graph.replace(vertex.move(loc)); // if zorro happened, reorder nodes..\n\n\t if (!isEP1 && edge1.index !== way1.nodes.indexOf(vertex.id)) {\n\t way1 = way1.removeNode(vertex.id).addNode(vertex.id, edge1.index);\n\t graph = graph.replace(way1);\n\t }\n\n\t if (!isEP2 && edge2.index !== way2.nodes.indexOf(vertex.id)) {\n\t way2 = way2.removeNode(vertex.id).addNode(vertex.id, edge2.index);\n\t graph = graph.replace(way2);\n\t }\n\n\t return graph;\n\t }", "title": "" }, { "docid": "5fc8802909fcbb6102d99a8c0abeb0f2", "score": "0.5689453", "text": "edgeLines() {\n if( this.head_x < 0){\n this.head_x = abs(this.head_x);\n this.x_delta *= -1;\n }\n if( this.head_x > width ){\n this.head_x = width - abs(width - this.head_x);\n this.x_delta *= -1;\n }\n if( this.head_y < 0){\n this.head_y = abs(this.head_y);\n this.y_delta *= -1;\n }\n if( this.head_y > height ){\n this.head_y = height - abs(height - this.head_y);\n this.y_delta *= -1;\n }\n }", "title": "" }, { "docid": "7912c023ca33cedfaed7322f401c45f0", "score": "0.5682531", "text": "coverFaces () {\n let coveredFaces = new THREE.Group();\n this.faces.forEach((face) => {\n let coveredFace = new THREE.Group();\n coveredFace.name = face.faceType;\n \n for (let i = 0; i < beds.children.length; i++) {\n const bed = beds.children[i];\n let planes = {\n top: planeFromObject(bed, 4), // 4 and 5 are the indicies of the triangles on the top face of the bed (BoxGeometry) made by THREE.js\n bottom: planeFromObject(bed, 6), // 6 and 7 are the indicies of the triangles on the bottom face of the bed (BoxGeometry) made by THREE.js\n }\n \n let points = face.findPointsOfIntersection(bed, planes);\n\n if (Array.isArray(points) && points.length >= 3) {\n let geometry = makeGeometryFromPoints(points);\n geometry.computeFaceNormals();\n // geometry.computeVertexNormals();\n let material = new THREE.MeshPhongMaterial({\n color: bed.material.color,\n side: THREE.DoubleSide,\n })\n let coveredBedFace = new THREE.Mesh( geometry, material);\n scene.add(coveredBedFace);\n coveredFace.add(coveredBedFace);\n }\n }\n coveredFaces.add(coveredFace); \n });\n coveredFaces.name = 'coveredFaces';\n scene.add(coveredFaces);\n return coveredFaces;\n }", "title": "" }, { "docid": "52d2f79740eec3cf6b6c98654d3644ce", "score": "0.5680823", "text": "makeClipPlanes() {\n let clipPlanes = {};\n for (const [faceType, normalVector] of Object.entries(this.normalVectors)) {\n // Plane goes to infinity in all directions. Position, in direction of normal vectork, is half of edge length\n clipPlanes[faceType] = new THREE.Plane(normalVector, this.edgeLength/2);\n }\n return clipPlanes;\n }", "title": "" }, { "docid": "395c0fa7386ccc197a51ba99624101b2", "score": "0.56677514", "text": "edges(){\r\n if(this.pos.x>width){\r\n this.pos.x=0;\r\n this.updateprev();\r\n }\r\n \r\n if(this.pos.x<0){\r\n this.pos.x=width;\r\n this.updateprev();\r\n }\r\n \r\n if(this.pos.y>height) {\r\n this.pos.y=0;\r\n this.updateprev();\r\n } \r\n \r\n if(this.pos.y<0) {\r\n this.pos.y=height;\r\n this.updateprev();\r\n } \r\n \r\n }", "title": "" }, { "docid": "047b2ae446a091b5c22c640d108d5053", "score": "0.5646414", "text": "function initPlane(){\n var plane = new THREE.Plane( new THREE.Vector3(0, 0, 1), 0);\n plane.applyMatrix4(\n new THREE.Matrix4().makeRotationFromEuler(\n new THREE.Euler( planeAttr.r[0], planeAttr.r[1], planeAttr.r[2])\n )\n );\n plane.p = $V([planeAttr.p[0], planeAttr.p[1], planeAttr.p[2]]);\n plane.n = $V([plane.normal.x, plane.normal.y, plane.normal.z]);\n \n //store the points on the corners of the faces for later collision detection\n for (var i=0; i < polygon.geometry.faces.length; i++){\n FACES[i] = [];\n var face = polygon.geometry.faces[i];\n FACES[i][0] = $V([polygon.geometry.vertices[face.a].x + plane.p.elements[0], polygon.geometry.vertices[face.a].y + plane.p.elements[1], polygon.geometry.vertices[face.a].z + plane.p.elements[2]]);\n FACES[i][1] = $V([polygon.geometry.vertices[face.b].x + plane.p.elements[0], polygon.geometry.vertices[face.b].y + plane.p.elements[1], polygon.geometry.vertices[face.b].z + plane.p.elements[2]]);\n FACES[i][2] = $V([polygon.geometry.vertices[face.c].x + plane.p.elements[0], polygon.geometry.vertices[face.c].y + plane.p.elements[1], polygon.geometry.vertices[face.c].z + plane.p.elements[2]]);\n }\n \n return plane;\n}", "title": "" }, { "docid": "580f4c397392657ce5c3418a0a928624", "score": "0.5642849", "text": "function unZorroIntersection(intersection, graph) {\n var vertex = graph.entity(intersection.nodeId);\n var way1 = graph.entity(intersection.movedId);\n var way2 = graph.entity(intersection.unmovedId);\n var isEP1 = intersection.movedIsEP;\n var isEP2 = intersection.unmovedIsEP;\n\n // don't move the vertex if it is the endpoint of both ways.\n if (isEP1 && isEP2) return graph;\n\n var nodes1 = graph.childNodes(way1).filter(function(n) { return n !== vertex; });\n var nodes2 = graph.childNodes(way2).filter(function(n) { return n !== vertex; });\n\n if (way1.isClosed() && way1.first() === vertex.id) nodes1.push(nodes1[0]);\n if (way2.isClosed() && way2.first() === vertex.id) nodes2.push(nodes2[0]);\n\n var edge1 = !isEP1 && geoChooseEdge(nodes1, projection(vertex.loc), projection);\n var edge2 = !isEP2 && geoChooseEdge(nodes2, projection(vertex.loc), projection);\n var loc;\n\n // snap vertex to nearest edge (or some point between them)..\n if (!isEP1 && !isEP2) {\n var epsilon = 1e-6, maxIter = 10;\n for (var i = 0; i < maxIter; i++) {\n loc = geoVecInterp(edge1.loc, edge2.loc, 0.5);\n edge1 = geoChooseEdge(nodes1, projection(loc), projection);\n edge2 = geoChooseEdge(nodes2, projection(loc), projection);\n if (Math.abs(edge1.distance - edge2.distance) < epsilon) break;\n }\n } else if (!isEP1) {\n loc = edge1.loc;\n } else {\n loc = edge2.loc;\n }\n\n graph = graph.replace(vertex.move(loc));\n\n // if zorro happened, reorder nodes..\n if (!isEP1 && edge1.index !== way1.nodes.indexOf(vertex.id)) {\n way1 = way1.removeNode(vertex.id).addNode(vertex.id, edge1.index);\n graph = graph.replace(way1);\n }\n if (!isEP2 && edge2.index !== way2.nodes.indexOf(vertex.id)) {\n way2 = way2.removeNode(vertex.id).addNode(vertex.id, edge2.index);\n graph = graph.replace(way2);\n }\n\n return graph;\n }", "title": "" }, { "docid": "54daf9b2eac434f8254b5a400fac3141", "score": "0.5637802", "text": "function addPlaneShape( polytope ) {\n\n var polytopeVertexes = polytope.vertexes();\n\n function addVertexes() {\n var shapeMaterial, shapeGeometry, shape;\n\n scene.remove( scene.getObjectByName( 'plane-vertexes' ) );\n\n shapeGeometry = new THREE.Geometry();\n polytopeVertexes = sphericalizeVertices( polytopeVertexes );\n polytopeVertexes = applyRotationToVertices( polytopeVertexes );\n polytopeVertexes = applyStereographicProjection( polytopeVertexes );\n // shapeGeometry.vertices = applyStereographicProjection( polytopeVertexes );\n shapeGeometry.vertices = polytopeVertexes;\n\n planeMaterial = new THREE.PointsMaterial( {\n size: 0.15,\n map: blue_vertex,\n alphaTest: 0.1,\n transparent: true,\n sizeAttenuation: true,\n } );\n\n shape = new THREE.Points( shapeGeometry, planeMaterial );\n shape.name = 'plane-vertexes';\n\n scene.add( shape );\n\n }\n\n function drawLines() {\n\n var vertexPairs = [];\n // TOP 4\n vertexPairs.push( [polytopeVertexes[0], polytopeVertexes[1]] );\n vertexPairs.push( [polytopeVertexes[1], polytopeVertexes[2]] );\n vertexPairs.push( [polytopeVertexes[2], polytopeVertexes[3]] );\n vertexPairs.push( [polytopeVertexes[0], polytopeVertexes[3]] );\n\n // VERTICAL 4\n vertexPairs.push( [polytopeVertexes[0], polytopeVertexes[4]] );\n vertexPairs.push( [polytopeVertexes[1], polytopeVertexes[5]] );\n vertexPairs.push( [polytopeVertexes[2], polytopeVertexes[6]] );\n vertexPairs.push( [polytopeVertexes[3], polytopeVertexes[7]] );\n\n // BOTTOM 4\n vertexPairs.push( [polytopeVertexes[4], polytopeVertexes[5]] );\n vertexPairs.push( [polytopeVertexes[5], polytopeVertexes[6]] );\n vertexPairs.push( [polytopeVertexes[6], polytopeVertexes[7]] );\n vertexPairs.push( [polytopeVertexes[4], polytopeVertexes[7]] );\n\n for (var i=0; i<vertexPairs.length; i++) {\n createLine( vertexPairs[i], i, true );\n }\n }\n\n drawLines();\n addVertexes();\n}", "title": "" }, { "docid": "02ed18953007241c7745002375f16cc6", "score": "0.56308573", "text": "function redrawAxesPlanes() {\r\n\r\n //==|| Empty YZ Plane first\r\n emptyYZ_Plane();\r\n //==|| Redrawing the YZ Plane\r\n drawYZ_Plane();\r\n\r\n\r\n\r\n //==|| Empty XZ Plane first\r\n emptyXZ_Plane();\r\n //==|| Redrawing the XZ Plane\r\n drawXZ_Plane();\r\n\r\n\r\n\r\n //==|| Empty XY Plane first\r\n emptyXY_Plane();\r\n //==|| Redrawing the XY Plane\r\n drawXY_Plane(); \r\n\r\n\r\n\r\n //==|| remove the previous North Arrow \r\n WELLVIS.theMainObject.remove(WELLVIS.theArrowNorth);\r\n\r\n //==|| Now redraw the North Arrow\r\n drawArrowNorth();\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "f4d2a71c2a3f441c62c8c6366ef62caf", "score": "0.56284744", "text": "recreateFaces() {\n // Remove all faces\n this.faces.clear();\n for (let edge of this.edges) {\n edge.face = null;\n }\n\n // Restore faces\n let first;\n let unassignedEdgeFound = true;\n while (unassignedEdgeFound) {\n unassignedEdgeFound = false;\n for (let edge of this.edges) {\n if (edge.face === null) {\n first = edge;\n unassignedEdgeFound = true;\n break;\n }\n }\n\n if (unassignedEdgeFound) {\n let last = first;\n do {\n last = last.next;\n } while (last.next !== first)\n\n this.addFace(first, last);\n }\n }\n }", "title": "" }, { "docid": "c4f03759819ad86928546cd3b7f7f8fe", "score": "0.55746466", "text": "function setFrustumGeometry() { \n iplu.set(200, 150, -params.focalLength); \n ipld.set(200, -150, -params.focalLength); \n ipru.set(-200, 150, -params.focalLength); \n iprd.set(-200, -150, -params.focalLength);\n\n imagePlane.children.forEach(function(el){\n if (el.geometry) {\n el.geometry.verticesNeedUpdate = true;\n }\n });\n\n copRayLU.subVectors(iplu, cop);\n t = -(cop.dot(farPlaneNormal) + params.focalLength + FAR_PLANE_Z) / copRayLU.dot(farPlaneNormal)\n vflu.copy(cop.clone().add(copRayLU.clone().multiplyScalar(t)));\n\n copRayRU.subVectors(ipru, cop);\n t = -(cop.dot(farPlaneNormal) + params.focalLength + FAR_PLANE_Z) / copRayRU.dot(farPlaneNormal)\n vfru.copy(cop.clone().add(copRayRU.clone().multiplyScalar(t)));\n\n copRayLD.subVectors(ipld, cop);\n t = -(cop.dot(farPlaneNormal) + params.focalLength + FAR_PLANE_Z) / copRayLD.dot(farPlaneNormal)\n vfld.copy(cop.clone().add(copRayLD.clone().multiplyScalar(t)));\n\n copRayRD.subVectors(iprd, cop);\n t = -(cop.dot(farPlaneNormal) + params.focalLength + FAR_PLANE_Z) / copRayRD.dot(farPlaneNormal)\n vfrd.copy(cop.clone().add(copRayRD.clone().multiplyScalar(t)));\n\n frustumEdge1Geo.vertices.push( cop, copRayLU.add(cop) );\n frustumEdge1 = new THREE.Line( frustumEdge1Geo, lineMat );\n \n frustumEdge2Geo.vertices.push( cop, copRayRU.add(cop) );\n frustumEdge2 = new THREE.Line( frustumEdge2Geo, lineMat );\n \n frustumEdge3Geo.vertices.push( cop, copRayLD.add(cop) );\n frustumEdge3 = new THREE.Line( frustumEdge3Geo, lineMat );\n\n frustumEdge4Geo.vertices.push( cop, copRayRD.add(cop) );\n frustumEdge4 = new THREE.Line( frustumEdge4Geo, lineMat );\n \n // The frustum vertices nearest the image plane are calculated based on the far vertices\n // and the image plane vertices.\n vrlu.addVectors(vflu, iplu.clone().add(imagePlane.position).multiplyScalar(2)).divideScalar(3); \n vrru.addVectors(vfru, ipru.clone().add(imagePlane.position).multiplyScalar(2)).divideScalar(3); \n vrld.addVectors(vfld, ipld.clone().add(imagePlane.position).multiplyScalar(2)).divideScalar(3); \n vrrd.addVectors(vfrd, iprd.clone().add(imagePlane.position).multiplyScalar(2)).divideScalar(3); \n}", "title": "" }, { "docid": "d4a7b8aa1cfa76e425022a1abd076777", "score": "0.55569905", "text": "computeInitialHull() {\n const vertices = this.vertices;\n const extremes = this.computeExtremes();\n const min2 = extremes.min;\n const max3 = extremes.max;\n let maxDistance = 0;\n let index2 = 0;\n for (let i4 = 0; i4 < 3; i4++) {\n const distance4 = max3[i4].point.getComponent(i4) - min2[i4].point.getComponent(i4);\n if (distance4 > maxDistance) {\n maxDistance = distance4;\n index2 = i4;\n }\n }\n const v0 = min2[index2];\n const v13 = max3[index2];\n let v22;\n let v32;\n maxDistance = 0;\n _line3.set(v0.point, v13.point);\n for (let i4 = 0, l2 = this.vertices.length; i4 < l2; i4++) {\n const vertex = vertices[i4];\n if (vertex !== v0 && vertex !== v13) {\n _line3.closestPointToPoint(vertex.point, true, _closestPoint);\n const distance4 = _closestPoint.distanceToSquared(vertex.point);\n if (distance4 > maxDistance) {\n maxDistance = distance4;\n v22 = vertex;\n }\n }\n }\n maxDistance = -1;\n _plane.setFromCoplanarPoints(v0.point, v13.point, v22.point);\n for (let i4 = 0, l2 = this.vertices.length; i4 < l2; i4++) {\n const vertex = vertices[i4];\n if (vertex !== v0 && vertex !== v13 && vertex !== v22) {\n const distance4 = Math.abs(_plane.distanceToPoint(vertex.point));\n if (distance4 > maxDistance) {\n maxDistance = distance4;\n v32 = vertex;\n }\n }\n }\n const faces = [];\n if (_plane.distanceToPoint(v32.point) < 0) {\n faces.push(Face.create(v0, v13, v22), Face.create(v32, v13, v0), Face.create(v32, v22, v13), Face.create(v32, v0, v22));\n for (let i4 = 0; i4 < 3; i4++) {\n const j2 = (i4 + 1) % 3;\n faces[i4 + 1].getEdge(2).setTwin(faces[0].getEdge(j2));\n faces[i4 + 1].getEdge(1).setTwin(faces[j2 + 1].getEdge(0));\n }\n } else {\n faces.push(Face.create(v0, v22, v13), Face.create(v32, v0, v13), Face.create(v32, v13, v22), Face.create(v32, v22, v0));\n for (let i4 = 0; i4 < 3; i4++) {\n const j2 = (i4 + 1) % 3;\n faces[i4 + 1].getEdge(2).setTwin(faces[0].getEdge((3 - i4) % 3));\n faces[i4 + 1].getEdge(0).setTwin(faces[j2 + 1].getEdge(1));\n }\n }\n for (let i4 = 0; i4 < 4; i4++) {\n this.faces.push(faces[i4]);\n }\n for (let i4 = 0, l2 = vertices.length; i4 < l2; i4++) {\n const vertex = vertices[i4];\n if (vertex !== v0 && vertex !== v13 && vertex !== v22 && vertex !== v32) {\n maxDistance = this.tolerance;\n let maxFace = null;\n for (let j2 = 0; j2 < 4; j2++) {\n const distance4 = this.faces[j2].distanceToPoint(vertex.point);\n if (distance4 > maxDistance) {\n maxDistance = distance4;\n maxFace = this.faces[j2];\n }\n }\n if (maxFace !== null) {\n this.addVertexToFace(vertex, maxFace);\n }\n }\n }\n return this;\n }", "title": "" }, { "docid": "586f1aa9d6ee3d90febbe7b1fd7cc97d", "score": "0.5533126", "text": "invert() {\r\n for (const polygon of this.polygons) {\r\n polygon.flip();\r\n }\r\n this.plane.flip();\r\n if (this.front) {\r\n this.front.invert();\r\n }\r\n if (this.back) {\r\n this.back.invert();\r\n }\r\n const temp = this.front;\r\n this.front = this.back;\r\n this.back = temp;\r\n }", "title": "" }, { "docid": "0136243b6888576cdf0bdcf6bb447f5c", "score": "0.55286604", "text": "function unZorroIntersection(intersection$$1, graph) {\n var vertex = graph.entity(intersection$$1.nodeId);\n var way1 = graph.entity(intersection$$1.movedId);\n var way2 = graph.entity(intersection$$1.unmovedId);\n var isEP1 = intersection$$1.movedIsEP;\n var isEP2 = intersection$$1.unmovedIsEP;\n\n // don't move the vertex if it is the endpoint of both ways.\n if (isEP1 && isEP2) return graph;\n\n var nodes1 = without(graph.childNodes(way1), vertex);\n var nodes2 = without(graph.childNodes(way2), vertex);\n\n if (way1.isClosed() && way1.first() === vertex.id) nodes1.push(nodes1[0]);\n if (way2.isClosed() && way2.first() === vertex.id) nodes2.push(nodes2[0]);\n\n var edge1 = !isEP1 && geoChooseEdge(nodes1, projection(vertex.loc), projection);\n var edge2 = !isEP2 && geoChooseEdge(nodes2, projection(vertex.loc), projection);\n var loc;\n\n // snap vertex to nearest edge (or some point between them)..\n if (!isEP1 && !isEP2) {\n var epsilon = 1e-6, maxIter = 10;\n for (var i = 0; i < maxIter; i++) {\n loc = geoVecInterp(edge1.loc, edge2.loc, 0.5);\n edge1 = geoChooseEdge(nodes1, projection(loc), projection);\n edge2 = geoChooseEdge(nodes2, projection(loc), projection);\n if (Math.abs(edge1.distance - edge2.distance) < epsilon) break;\n }\n } else if (!isEP1) {\n loc = edge1.loc;\n } else {\n loc = edge2.loc;\n }\n\n graph = graph.replace(vertex.move(loc));\n\n // if zorro happened, reorder nodes..\n if (!isEP1 && edge1.index !== way1.nodes.indexOf(vertex.id)) {\n way1 = way1.removeNode(vertex.id).addNode(vertex.id, edge1.index);\n graph = graph.replace(way1);\n }\n if (!isEP2 && edge2.index !== way2.nodes.indexOf(vertex.id)) {\n way2 = way2.removeNode(vertex.id).addNode(vertex.id, edge2.index);\n graph = graph.replace(way2);\n }\n\n return graph;\n }", "title": "" }, { "docid": "9b1566164c2fa2951895a2ce3739723f", "score": "0.54888475", "text": "create_walls(parrent, offset, material, outer_wall) {\n\n var small_inner_side_geom = new THREE.PlaneGeometry(2 * offset, 2 * offset);\n\n var side1 = new THREE.Mesh( small_inner_side_geom, material );\n side1.position.set(0, -offset, -offset);\n side1.rotation.y = Math.PI * outer_wall;\n parrent.add( side1 );\n\n var side2 = new THREE.Mesh( small_inner_side_geom, material );\n side2.position.set(offset, -offset, 0);\n side2.rotation.y = Math.PI * -0.5 + Math.PI * outer_wall;\n parrent.add( side2 );\n\n var side3 = new THREE.Mesh( small_inner_side_geom, material );\n side3.position.set(0, -offset, offset);\n side3.rotation.y = Math.PI * 1 + Math.PI * outer_wall;\n parrent.add( side3 );\n\n var side4 = new THREE.Mesh( small_inner_side_geom, material );\n side4.position.set(-offset, -offset, 0);\n side4.rotation.y = Math.PI * 0.5 + Math.PI * outer_wall;\n parrent.add( side4 );\n }", "title": "" }, { "docid": "323eb0ba31ab8c255f38989702e568da", "score": "0.54605865", "text": "_postprocessHull() {\n\n\t\tconst faces = this.faces;\n\t\tconst edges = this.edges;\n\n\t\tif ( this.mergeFaces === true ) {\n\n\t\t\t// merges faces if the result is still convex and coplanar\n\n\t\t\tconst cache = {\n\t\t\t\tleftPrev: null,\n\t\t\t\tleftNext: null,\n\t\t\t\trightPrev: null,\n\t\t\t\trightNext: null\n\t\t\t};\n\n\t\t\t// gather unique edges and temporarily sort them\n\n\t\t\tthis.computeUniqueEdges();\n\n\t\t\tedges.sort( ( a, b ) => b.length() - a.length() );\n\n\t\t\t// process edges from longest to shortest\n\n\t\t\tfor ( let i = 0, l = edges.length; i < l; i ++ ) {\n\n\t\t\t\tconst entry = edges[ i ];\n\n\t\t\t\tif ( this._mergePossible( entry ) === false ) continue;\n\n\t\t\t\tlet candidate = entry;\n\n\t\t\t\t// cache current references for possible restore\n\n\t\t\t\tcache.prev = candidate.prev;\n\t\t\t\tcache.next = candidate.next;\n\t\t\t\tcache.prevTwin = candidate.twin.prev;\n\t\t\t\tcache.nextTwin = candidate.twin.next;\n\n\t\t\t\t// temporarily change the first polygon in order to represent both polygons\n\n\t\t\t\tcandidate.prev.next = candidate.twin.next;\n\t\t\t\tcandidate.next.prev = candidate.twin.prev;\n\t\t\t\tcandidate.twin.prev.next = candidate.next;\n\t\t\t\tcandidate.twin.next.prev = candidate.prev;\n\n\t\t\t\tconst polygon = candidate.polygon;\n\t\t\t\tpolygon.edge = candidate.prev;\n\n\t\t\t\tconst ccw = polygon.plane.normal.dot( up ) >= 0;\n\n\t\t\t\tif ( polygon.convex( ccw ) === true && polygon.coplanar( this._tolerance ) === true ) {\n\n\t\t\t\t\t// correct polygon reference of all edges\n\n\t\t\t\t\tlet edge = polygon.edge;\n\n\t\t\t\t\tdo {\n\n\t\t\t\t\t\tedge.polygon = polygon;\n\n\t\t\t\t\t\tedge = edge.next;\n\n\t\t\t\t\t} while ( edge !== polygon.edge );\n\n\t\t\t\t\t// delete obsolete polygon\n\n\t\t\t\t\tconst index = faces.indexOf( entry.twin.polygon );\n\t\t\t\t\tfaces.splice( index, 1 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// restore\n\n\t\t\t\t\tcache.prev.next = candidate;\n\t\t\t\t\tcache.next.prev = candidate;\n\t\t\t\t\tcache.prevTwin.next = candidate.twin;\n\t\t\t\t\tcache.nextTwin.prev = candidate.twin;\n\n\t\t\t\t\tpolygon.edge = candidate;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// recompute centroid of faces\n\n\t\t\tfor ( let i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\tfaces[ i ].computeCentroid();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// compute centroid of convex hull and the final edge and vertex list\n\n\t\tthis.computeCentroid();\n\t\tthis.computeUniqueEdges();\n\t\tthis.computeUniqueVertices();\n\n\t\treturn this;\n\n\t}", "title": "" }, { "docid": "39f1eda3bd107201fe813aded98e6151", "score": "0.54532474", "text": "invert() {\n for (let i = 0; i < this.polygons.length; i++) {\n this.polygons[i].negate();\n }\n this.plane.negate();\n if (this.front) this.front.invert();\n if (this.back) this.back.invert();\n const temp = this.front;\n this.front = this.back;\n this.back = temp;\n }", "title": "" }, { "docid": "08a4b7fc822919c7ed2f4dbb57a2d76f", "score": "0.54451543", "text": "function fixupEdgePoints(g) {\n g.eachEdge(function(e, s, t, a) { if (a.reversed) a.points.reverse(); });\n }", "title": "" }, { "docid": "08a4b7fc822919c7ed2f4dbb57a2d76f", "score": "0.54451543", "text": "function fixupEdgePoints(g) {\n g.eachEdge(function(e, s, t, a) { if (a.reversed) a.points.reverse(); });\n }", "title": "" }, { "docid": "21b7ad945581ad8c8b4a437572f86dbc", "score": "0.5433968", "text": "sortCorners() {\n for (const center of this.centers) {\n const comp = this.comparePolyPoints(center);\n center.corners.sort(comp);\n }\n }", "title": "" }, { "docid": "ff392132a30398890dcdee47cbeb91bb", "score": "0.543301", "text": "function buildSideFaces() {\n\n var start = verticesArray.length / 3;\n var layeroffset = 0;\n sidewalls(contour, layeroffset);\n layeroffset += contour.length;\n\n for (h = 0, hl = holes.length; h < hl; h++) {\n\n ahole = holes[h];\n sidewalls(ahole, layeroffset);\n\n //, true\n layeroffset += ahole.length;\n\n }\n\n\n scope.addGroup(start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n }", "title": "" }, { "docid": "e89964daa1245a28b68437deb6a1dbc7", "score": "0.542034", "text": "intersectEdge(edge, infiniteLength){\n // Simple checking first\n let edge1Index = null;\n let edge2Index = null;\n\n // Find edge.p1 then edge.p2\n for (let i = 0; i < this.edges.length; i ++){\n // At the same time, check if one edge has both points\n let hasP1 = this.edges[i].hasPoint(edge.p1);\n let hasP2 = this.edges[i].hasPoint(edge.p2);\n if (hasP1 && hasP2) return null;\n\n if (hasP1) edge1Index = i;\n }\n\n for (let i = 0; i < this.edges.length; i ++){\n if (this.edges[i].hasPoint(edge.p2)) edge2Index = i;\n }\n\n if (edge1Index !== null && edge2Index !== null){\n // console.log(edge1Index, edge2Index);\n // Make sure the order is correct\n // if (edge1Index < edge2Index) return new Edge(edge.p1, edge.p2);\n // return new Edge(edge.p2, edge.p1);\n return edge;\n }\n\n if (!infiniteLength && (edge1Index === null || edge2Index === null)) return null;\n\n // Has to do more complicated checking\n // Find two intersection points first\n let p1 = null;\n let p2 = null;\n edge1Index = null;\n edge2Index = null;\n for (let i = 0; i < this.edges.length; i ++){\n let pTmp = this.edges[i].intersectEdge(edge, true);\n if (pTmp === null) continue;\n if (pTmp.isOutsideFace(this)) continue;\n\n p1 = pTmp;\n edge1Index = i;\n }\n\n for (let i = 0; i < this.edges.length; i ++){\n if (i === edge1Index) continue;\n\n let pTmp = this.edges[i].intersectEdge(edge, true);\n if (pTmp === null ||\n pTmp.isOutsideFace(this) ||\n pTmp.isEqual(p1)) continue;\n p2 = pTmp;\n edge2Index = i;\n }\n\n if (edge1Index !== null && edge2Index !== null) {\n let newEdge = new Edge(p1, p2);\n // Even if infinite length\n // collinear edge does not count as intersected\n if(this.hasEdge(newEdge, true)) return null;\n\n return newEdge;\n }\n\n return null;\n }", "title": "" }, { "docid": "ea2439d5496a38d6b9ee4629883502f4", "score": "0.54050934", "text": "_checkEdgeDirections( polyhedronA, polyhedronB ) {\n\n\t\tconst edgesA = polyhedronA.edges;\n\t\tconst edgesB = polyhedronB.edges;\n\n\t\tfor ( let i = 0, il = edgesA.length; i < il; i ++ ) {\n\n\t\t\tconst edgeA = edgesA[ i ];\n\n\t\t\tfor ( let j = 0, jl = edgesB.length; j < jl; j ++ ) {\n\n\t\t\t\tconst edgeB = edgesB[ j ];\n\n\t\t\t\tedgeA.getDirection( directionA );\n\t\t\t\tedgeB.getDirection( directionB );\n\n\t\t\t\t// edge pruning: only consider edges if they build a face on the minkowski difference\n\n\t\t\t\tif ( this._minkowskiFace( edgeA, directionA, edgeB, directionB ) ) {\n\n\t\t\t\t\t// compute axis\n\n\t\t\t\t\tconst distance = this._distanceBetweenEdges( edgeA, directionA, edgeB, directionB, polyhedronA );\n\n\t\t\t\t\tif ( distance > 0 ) return true; // separating axis found\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "ea2439d5496a38d6b9ee4629883502f4", "score": "0.54050934", "text": "_checkEdgeDirections( polyhedronA, polyhedronB ) {\n\n\t\tconst edgesA = polyhedronA.edges;\n\t\tconst edgesB = polyhedronB.edges;\n\n\t\tfor ( let i = 0, il = edgesA.length; i < il; i ++ ) {\n\n\t\t\tconst edgeA = edgesA[ i ];\n\n\t\t\tfor ( let j = 0, jl = edgesB.length; j < jl; j ++ ) {\n\n\t\t\t\tconst edgeB = edgesB[ j ];\n\n\t\t\t\tedgeA.getDirection( directionA );\n\t\t\t\tedgeB.getDirection( directionB );\n\n\t\t\t\t// edge pruning: only consider edges if they build a face on the minkowski difference\n\n\t\t\t\tif ( this._minkowskiFace( edgeA, directionA, edgeB, directionB ) ) {\n\n\t\t\t\t\t// compute axis\n\n\t\t\t\t\tconst distance = this._distanceBetweenEdges( edgeA, directionA, edgeB, directionB, polyhedronA );\n\n\t\t\t\t\tif ( distance > 0 ) return true; // separating axis found\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "714f8b97be998d1f84880cbdea789010", "score": "0.54033136", "text": "filterVerticesBetweenEdges(sides, lEdges, geometry) {\r\n \r\n // sort vertices along Z axis on each line\r\n // and remove doubles\r\n sides[0].sort(function(a, b) { return geometry.vertices[a].z - geometry.vertices[b].z;});\r\n sides[1].sort(function(a, b) { return geometry.vertices[a].z - geometry.vertices[b].z;});\r\n\r\n sides[0] = sides[0].filter(function(item, pos, ary) { return !pos || item != ary[pos - 1];});\r\n sides[1] = sides[1].filter(function(item, pos, ary) { return !pos || item != ary[pos - 1];});\r\n \r\n // get vertices in the similar edges\r\n var eVerts = [].concat.apply([], lEdges);\r\n\r\n // remove top and bottom vertices not involved in an edge\r\n while(eVerts.indexOf(sides[0][0]) == -1) { sides[0].shift(); }\r\n while(eVerts.indexOf(sides[1][0]) == -1) { sides[1].shift(); }\r\n \r\n while(eVerts.indexOf(sides[0][sides[0].length - 1]) == -1) { sides[0].pop(); }\r\n while(eVerts.indexOf(sides[1][sides[1].length - 1]) == -1) { sides[1].pop(); }\r\n\r\n return sides;\r\n }", "title": "" }, { "docid": "e0ad652cb4e7ed61e7005edc7d950958", "score": "0.5401706", "text": "function smooth(geometry) {\n var tmp = new THREE.Vector3();\n\n var oldVertices, oldFaces;\n var newVertices, newFaces; // newUVs = [];\n\n var n, l, i, il, j, k;\n var metaVertices, sourceEdges;\n\n // new stuff.\n var sourceEdges, newEdgeVertices, newSourceVertices;\n\n oldVertices = geometry.vertices; // { x, y, z}\n oldFaces = geometry.faces; // { a: oldVertex1, b: oldVertex2, c: oldVertex3 }\n\n /******************************************************\n *\n * Step 0: Preprocess Geometry to Generate edges Lookup\n *\n *******************************************************/\n\n metaVertices = new Array(oldVertices.length);\n sourceEdges = {}; // Edge => { oldVertex1, oldVertex2, faces[] }\n\n generateLookups(oldVertices, oldFaces, metaVertices, sourceEdges);\n\n\n /******************************************************\n *\n * Step 1.\n * For each edge, create a new Edge Vertex,\n * then position it.\n *\n *******************************************************/\n\n newEdgeVertices = [];\n var other, currentEdge, newEdge, face;\n var edgeVertexWeight, adjacentVertexWeight, connectedFaces;\n\n for (i in sourceEdges) {\n currentEdge = sourceEdges[i];\n newEdge = new THREE.Vector3();\n\n edgeVertexWeight = 3 / 8;\n adjacentVertexWeight = 1 / 8;\n\n connectedFaces = currentEdge.faces.length;\n\n // check how many linked faces. 2 should be correct.\n if (connectedFaces != 2) {\n\n // if length is not 2, handle condition\n edgeVertexWeight = 0.5;\n adjacentVertexWeight = 0;\n\n if (connectedFaces != 1) {\n\n if (WARNINGS) console.warn('Subdivision Modifier: Number of connected faces != 2, is: ', connectedFaces, currentEdge);\n\n }\n\n }\n\n newEdge.addVectors(currentEdge.a, currentEdge.b).multiplyScalar(edgeVertexWeight);\n\n tmp.set(0, 0, 0);\n\n for (j = 0; j < connectedFaces; j++) {\n\n face = currentEdge.faces[j];\n\n for (k = 0; k < 3; k++) {\n\n other = oldVertices[face[ABC[k]]];\n if (other !== currentEdge.a && other !== currentEdge.b) break;\n\n }\n\n tmp.add(other);\n\n }\n\n tmp.multiplyScalar(adjacentVertexWeight);\n newEdge.add(tmp);\n\n currentEdge.newEdge = newEdgeVertices.length;\n newEdgeVertices.push(newEdge);\n\n // console.log(currentEdge, newEdge);\n\n }\n\n /******************************************************\n *\n * Step 2.\n * Reposition each source vertices.\n *\n *******************************************************/\n\n var beta, sourceVertexWeight, connectingVertexWeight;\n var connectingEdge, connectingEdges, oldVertex, newSourceVertex;\n newSourceVertices = [];\n\n for (i = 0, il = oldVertices.length; i < il; i++) {\n\n oldVertex = oldVertices[i];\n\n // find all connecting edges (using lookupTable)\n connectingEdges = metaVertices[i].edges;\n n = connectingEdges.length;\n beta;\n\n if (n == 3) {\n\n beta = 3 / 16;\n\n } else if (n > 3) {\n\n beta = 3 / ( 8 * n ); // Warren's modified formula\n\n }\n\n // Loop's original beta formula\n // beta = 1 / n * ( 5/8 - Math.pow( 3/8 + 1/4 * Math.cos( 2 * Math. PI / n ), 2) );\n\n sourceVertexWeight = 1 - n * beta;\n connectingVertexWeight = beta;\n\n if (n <= 2) {\n\n // crease and boundary rules\n // console.warn('crease and boundary rules');\n\n if (n == 2) {\n\n if (WARNINGS) console.warn('2 connecting edges', connectingEdges);\n sourceVertexWeight = 3 / 4;\n connectingVertexWeight = 1 / 8;\n\n // sourceVertexWeight = 1;\n // connectingVertexWeight = 0;\n\n } else if (n == 1) {\n\n if (WARNINGS) console.warn('only 1 connecting edge');\n\n } else if (n == 0) {\n\n if (WARNINGS) console.warn('0 connecting edges');\n\n }\n\n }\n\n newSourceVertex = oldVertex.clone().multiplyScalar(sourceVertexWeight);\n\n tmp.set(0, 0, 0);\n\n for (j = 0; j < n; j++) {\n\n connectingEdge = connectingEdges[j];\n other = connectingEdge.a !== oldVertex ? connectingEdge.a : connectingEdge.b;\n tmp.add(other);\n\n }\n\n tmp.multiplyScalar(connectingVertexWeight);\n newSourceVertex.add(tmp);\n\n newSourceVertices.push(newSourceVertex);\n\n }\n\n\n /******************************************************\n *\n * Step 3.\n * Generate Faces between source vertecies\n * and edge vertices.\n *\n *******************************************************/\n\n newVertices = newSourceVertices.concat(newEdgeVertices);\n var sl = newSourceVertices.length, edge1, edge2, edge3;\n newFaces = [];\n\n for (i = 0, il = oldFaces.length; i < il; i++) {\n\n face = oldFaces[i];\n\n // find the 3 new edges vertex of each old face\n\n edge1 = getEdge(face.a, face.b, sourceEdges).newEdge + sl;\n edge2 = getEdge(face.b, face.c, sourceEdges).newEdge + sl;\n edge3 = getEdge(face.c, face.a, sourceEdges).newEdge + sl;\n\n // create 4 faces.\n\n newFace(newFaces, edge1, edge2, edge3);\n newFace(newFaces, face.a, edge1, edge3);\n newFace(newFaces, face.b, edge2, edge1);\n newFace(newFaces, face.c, edge3, edge2);\n\n }\n\n // Overwrite old arrays\n geometry.vertices = newVertices;\n geometry.faces = newFaces;\n\n // console.log('done');\n\n }", "title": "" }, { "docid": "c9485918fd90ad56aa1474b14ff9bcfd", "score": "0.53948766", "text": "function buildSideFaces() {\n\n\t var start = verticesArray.length / 3;\n\t var layeroffset = 0;\n\t sidewalls(contour, layeroffset);\n\t layeroffset += contour.length;\n\n\t for (h = 0, hl = holes.length; h < hl; h++) {\n\n\t ahole = holes[h];\n\t sidewalls(ahole, layeroffset);\n\n\t //, true\n\t layeroffset += ahole.length;\n\t }\n\n\t scope.addGroup(start, verticesArray.length / 3 - start, 1);\n\t }", "title": "" }, { "docid": "18dbcf82114d689c87ef34f09e343b82", "score": "0.53754216", "text": "function buildSideFaces() {\n\n\t\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\t\tlet layeroffset = 0;\n\t\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t\t//, true\n\t\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t\t}", "title": "" }, { "docid": "d629a8e1be2c8b2adcf92d26d2b0214b", "score": "0.5375409", "text": "function CollideEdgePolygon(manifold, edgeA, xfA, polygonB, xfB) {\n // Algorithm:\n // 1. Classify v1 and v2\n // 2. Classify polygon centroid as front or back\n // 3. Flip normal if necessary\n // 4. Initialize normal range to [-pi, pi] about face normal\n // 5. Adjust normal range according to adjacent edges\n // 6. Visit each separating axes, only accept axes within the range\n // 7. Return if _any_ axis indicates separation\n // 8. Clip\n\n var m_type1, m_type2; // VertexType unused?\n\n var xf = Transform.mulTXf(xfA, xfB);\n\n var centroidB = Transform.mulVec2(xf, polygonB.m_centroid);\n\n var v0 = edgeA.m_vertex0;\n var v1 = edgeA.m_vertex1;\n var v2 = edgeA.m_vertex2;\n var v3 = edgeA.m_vertex3;\n\n var hasVertex0 = edgeA.m_hasVertex0;\n var hasVertex3 = edgeA.m_hasVertex3;\n\n var edge1 = Vec2.sub(v2, v1);\n edge1.normalize();\n var normal1 = Vec2.neo(edge1.y, -edge1.x);\n var offset1 = Vec2.dot(normal1, Vec2.sub(centroidB, v1));\n var offset0 = 0.0;\n var offset2 = 0.0;\n var convex1 = false;\n var convex2 = false;\n\n // Is there a preceding edge?\n if (hasVertex0) {\n var edge0 = Vec2.sub(v1, v0);\n edge0.normalize();\n var normal0 = Vec2.neo(edge0.y, -edge0.x);\n convex1 = Vec2.cross(edge0, edge1) >= 0.0;\n offset0 = Vec2.dot(normal0, centroidB) - Vec2.dot(normal0, v0);\n }\n\n // Is there a following edge?\n if (hasVertex3) {\n var edge2 = Vec2.sub(v3, v2);\n edge2.normalize();\n var normal2 = Vec2.neo(edge2.y, -edge2.x);\n convex2 = Vec2.cross(edge1, edge2) > 0.0;\n offset2 = Vec2.dot(normal2, centroidB) - Vec2.dot(normal2, v2);\n }\n\n var front;\n var normal = Vec2.zero();\n var lowerLimit = Vec2.zero();\n var upperLimit = Vec2.zero();\n\n // Determine front or back collision. Determine collision normal limits.\n if (hasVertex0 && hasVertex3) {\n if (convex1 && convex2) {\n front = offset0 >= 0.0 || offset1 >= 0.0 || offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal0);\n upperLimit.set(normal2);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.setMul(-1, normal1);\n }\n } else if (convex1) {\n front = offset0 >= 0.0 || (offset1 >= 0.0 && offset2 >= 0.0);\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal0);\n upperLimit.set(normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal2);\n upperLimit.setMul(-1, normal1);\n }\n } else if (convex2) {\n front = offset2 >= 0.0 || (offset0 >= 0.0 && offset1 >= 0.0);\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal1);\n upperLimit.set(normal2);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.setMul(-1, normal0);\n }\n } else {\n front = offset0 >= 0.0 && offset1 >= 0.0 && offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal1);\n upperLimit.set(normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal2);\n upperLimit.setMul(-1, normal0);\n }\n }\n } else if (hasVertex0) {\n if (convex1) {\n front = offset0 >= 0.0 || offset1 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal0);\n upperLimit.setMul(-1, normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.set(normal1);\n upperLimit.setMul(-1, normal1);\n }\n } else {\n front = offset0 >= 0.0 && offset1 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal1);\n upperLimit.setMul(-1, normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.set(normal1);\n upperLimit.setMul(-1, normal0);\n }\n }\n } else if (hasVertex3) {\n if (convex2) {\n front = offset1 >= 0.0 || offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.set(normal2);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.set(normal1);\n }\n } else {\n front = offset1 >= 0.0 && offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.set(normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal2);\n upperLimit.set(normal1);\n }\n }\n } else {\n front = offset1 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.setMul(-1, normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.set(normal1);\n upperLimit.set(normal1);\n }\n }\n\n // Get polygonB in frameA\n polygonBA.count = polygonB.m_count;\n for (var i = 0; i < polygonB.m_count; ++i) {\n polygonBA.vertices[i] = Transform.mulVec2(xf, polygonB.m_vertices[i]);\n polygonBA.normals[i] = Rot.mulVec2(xf.q, polygonB.m_normals[i]);\n }\n\n var radius = 2.0 * Settings.polygonRadius;\n\n manifold.pointCount = 0;\n\n { // ComputeEdgeSeparation\n edgeAxis.type = e_edgeA;\n edgeAxis.index = front ? 0 : 1;\n edgeAxis.separation = Infinity;\n\n for (var i = 0; i < polygonBA.count; ++i) {\n var s = Vec2.dot(normal, Vec2.sub(polygonBA.vertices[i], v1));\n if (s < edgeAxis.separation) {\n edgeAxis.separation = s;\n }\n }\n }\n\n // If no valid normal can be found than this edge should not collide.\n if (edgeAxis.type == e_unknown) {\n return;\n }\n\n if (edgeAxis.separation > radius) {\n return;\n }\n\n { // ComputePolygonSeparation\n polygonAxis.type = e_unknown;\n polygonAxis.index = -1;\n polygonAxis.separation = -Infinity;\n\n var perp = Vec2.neo(-normal.y, normal.x);\n\n for (var i = 0; i < polygonBA.count; ++i) {\n var n = Vec2.neg(polygonBA.normals[i]);\n\n var s1 = Vec2.dot(n, Vec2.sub(polygonBA.vertices[i], v1));\n var s2 = Vec2.dot(n, Vec2.sub(polygonBA.vertices[i], v2));\n var s = Math.min(s1, s2);\n\n if (s > radius) {\n // No collision\n polygonAxis.type = e_edgeB;\n polygonAxis.index = i;\n polygonAxis.separation = s;\n break;\n }\n\n // Adjacency\n if (Vec2.dot(n, perp) >= 0.0) {\n if (Vec2.dot(Vec2.sub(n, upperLimit), normal) < -Settings.angularSlop) {\n continue;\n }\n } else {\n if (Vec2.dot(Vec2.sub(n, lowerLimit), normal) < -Settings.angularSlop) {\n continue;\n }\n }\n\n if (s > polygonAxis.separation) {\n polygonAxis.type = e_edgeB;\n polygonAxis.index = i;\n polygonAxis.separation = s;\n }\n }\n }\n\n if (polygonAxis.type != e_unknown && polygonAxis.separation > radius) {\n return;\n }\n\n // Use hysteresis for jitter reduction.\n var k_relativeTol = 0.98;\n var k_absoluteTol = 0.001;\n\n var primaryAxis;\n if (polygonAxis.type == e_unknown) {\n primaryAxis = edgeAxis;\n } else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) {\n primaryAxis = polygonAxis;\n } else {\n primaryAxis = edgeAxis;\n }\n\n var ie = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n\n if (primaryAxis.type == e_edgeA) {\n manifold.type = Manifold.e_faceA;\n\n // Search for the polygon normal that is most anti-parallel to the edge\n // normal.\n var bestIndex = 0;\n var bestValue = Vec2.dot(normal, polygonBA.normals[0]);\n for (var i = 1; i < polygonBA.count; ++i) {\n var value = Vec2.dot(normal, polygonBA.normals[i]);\n if (value < bestValue) {\n bestValue = value;\n bestIndex = i;\n }\n }\n\n var i1 = bestIndex;\n var i2 = i1 + 1 < polygonBA.count ? i1 + 1 : 0;\n\n ie[0].v = polygonBA.vertices[i1];\n ie[0].id.cf.indexA = 0;\n ie[0].id.cf.indexB = i1;\n ie[0].id.cf.typeA = Manifold.e_face;\n ie[0].id.cf.typeB = Manifold.e_vertex;\n\n ie[1].v = polygonBA.vertices[i2];\n ie[1].id.cf.indexA = 0;\n ie[1].id.cf.indexB = i2;\n ie[1].id.cf.typeA = Manifold.e_face;\n ie[1].id.cf.typeB = Manifold.e_vertex;\n\n if (front) {\n rf.i1 = 0;\n rf.i2 = 1;\n rf.v1 = v1;\n rf.v2 = v2;\n rf.normal.set(normal1);\n } else {\n rf.i1 = 1;\n rf.i2 = 0;\n rf.v1 = v2;\n rf.v2 = v1;\n rf.normal.setMul(-1, normal1);\n }\n } else {\n manifold.type = Manifold.e_faceB;\n\n ie[0].v = v1;\n ie[0].id.cf.indexA = 0;\n ie[0].id.cf.indexB = primaryAxis.index;\n ie[0].id.cf.typeA = Manifold.e_vertex;\n ie[0].id.cf.typeB = Manifold.e_face;\n\n ie[1].v = v2;\n ie[1].id.cf.indexA = 0;\n ie[1].id.cf.indexB = primaryAxis.index;\n ie[1].id.cf.typeA = Manifold.e_vertex;\n ie[1].id.cf.typeB = Manifold.e_face;\n\n rf.i1 = primaryAxis.index;\n rf.i2 = rf.i1 + 1 < polygonBA.count ? rf.i1 + 1 : 0;\n rf.v1 = polygonBA.vertices[rf.i1];\n rf.v2 = polygonBA.vertices[rf.i2];\n rf.normal.set(polygonBA.normals[rf.i1]);\n }\n\n rf.sideNormal1.set(rf.normal.y, -rf.normal.x);\n rf.sideNormal2.setMul(-1, rf.sideNormal1);\n rf.sideOffset1 = Vec2.dot(rf.sideNormal1, rf.v1);\n rf.sideOffset2 = Vec2.dot(rf.sideNormal2, rf.v2);\n\n // Clip incident edge against extruded edge1 side edges.\n var clipPoints1 = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n var clipPoints2 = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n\n var np;\n\n // Clip to box side 1\n np = Manifold.clipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1);\n\n if (np < Settings.maxManifoldPoints) {\n return;\n }\n\n // Clip to negative box side 1\n np = Manifold.clipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2);\n\n if (np < Settings.maxManifoldPoints) {\n return;\n }\n\n // Now clipPoints2 contains the clipped points.\n if (primaryAxis.type == e_edgeA) {\n manifold.localNormal = Vec2.clone(rf.normal);\n manifold.localPoint = Vec2.clone(rf.v1);\n } else {\n manifold.localNormal = Vec2.clone(polygonB.m_normals[rf.i1]);\n manifold.localPoint = Vec2.clone(polygonB.m_vertices[rf.i1]);\n }\n\n var pointCount = 0;\n for (var i = 0; i < Settings.maxManifoldPoints; ++i) {\n var separation = Vec2.dot(rf.normal, Vec2.sub(clipPoints2[i].v, rf.v1));\n\n if (separation <= radius) {\n var cp = manifold.points[pointCount]; // ManifoldPoint\n\n if (primaryAxis.type == e_edgeA) {\n cp.localPoint = Transform.mulT(xf, clipPoints2[i].v);\n cp.id = clipPoints2[i].id;\n } else {\n cp.localPoint = clipPoints2[i].v;\n cp.id.cf.typeA = clipPoints2[i].id.cf.typeB;\n cp.id.cf.typeB = clipPoints2[i].id.cf.typeA;\n cp.id.cf.indexA = clipPoints2[i].id.cf.indexB;\n cp.id.cf.indexB = clipPoints2[i].id.cf.indexA;\n }\n\n ++pointCount;\n }\n }\n\n manifold.pointCount = pointCount;\n}", "title": "" }, { "docid": "73651c0df688bc6ade6911b3491fc675", "score": "0.5371064", "text": "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "title": "" }, { "docid": "80171aa5b7f21d0824a9a644ee309ba9", "score": "0.53691274", "text": "function get_bond_vertices(face_src, face_dest){\n\t// this should've length 3\n\tvar v0 = face_src[0];\n\tvar v1 = face_src[1];\n\tvar v2 = face_src[2];\n\tvar v3 = face_src[3];\n\n\tvar v4 = face_dest[0];\n\tvar v5 = face_dest[1];\n\tvar v6 = face_dest[2];\n\tvar v7 = face_dest[3];\n\n\tvar v = [\n\t\t// // // front\n\t\tv2[0],v2[1],v2[2],\n\t\tv1[0],v1[1],v1[2],\n\t\tv0[0],v0[1],v0[2],\n\t\t\n\t\tv0[0],v0[1],v0[2],\n\t\tv3[0],v3[1],v3[2],\n\t\tv2[0],v2[1],v2[2],\n\n\t\t// // back\n\t\tv6[0],v6[1],v6[2],\n\t\tv5[0],v5[1],v5[2],\n\t\tv4[0],v4[1],v4[2],\n\n\t\tv4[0],v4[1],v4[2],\n\t\tv7[0],v7[1],v7[2],\n\t\tv6[0],v6[1],v6[2],\n\n\n\t\t// left\n\t\tv5[0],v5[1],v5[2],\n\t\tv4[0],v4[1],v4[2],\n\t\tv0[0],v0[1],v0[2],\n\n\t\tv0[0],v0[1],v0[2],\n\t\tv1[0],v1[1],v1[2],\n\t\tv5[0],v5[1],v5[2],\n\n\t\t//right\n\t\tv6[0],v6[1],v6[2],\n\t\tv2[0],v2[1],v2[2],\n\t\tv3[0],v3[1],v3[2],\n\n\t\tv3[0],v3[1],v3[2],\n\t\tv7[0],v7[1],v7[2],\n\t\tv6[0],v6[1],v6[2],\n\t\t\n\t\t// top\n\t\tv5[0],v5[1],v5[2],\n\t\tv1[0],v1[1],v1[2],\n\t\tv2[0],v2[1],v2[2],\n\t\t\n\t\tv2[0],v2[1],v2[2],\n\t\tv6[0],v6[1],v6[2],\n\t\tv5[0],v5[1],v5[2],\n\n\n\t\t// bot \n\t\tv4[0],v4[1],v4[2],\n\t\tv7[0],v7[1],v7[2],\n\t\tv3[0],v3[1],v3[2],\n\n\t\tv3[0],v3[1],v3[2],\n\t\tv0[0],v0[1],v0[2],\n\t\tv4[0],v4[1],v4[2],\t\n\t\n\t]\n\treturn v;\n\n\n}", "title": "" }, { "docid": "b57837bbf8adae4b531666e2f7a6c3ea", "score": "0.5356446", "text": "function buildSideFaces() {\n\n var layeroffset = 0;\n sidewalls( contour, layeroffset );\n layeroffset += contour.length;\n\n for ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n ahole = holes[ h ];\n sidewalls( ahole, layeroffset );\n\n //, true\n layeroffset += ahole.length;\n\n }\n\n }", "title": "" }, { "docid": "7e9b0a2950a178f5020d9dbff0def0c0", "score": "0.53558236", "text": "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length / 3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1 );\n\n\n\t}", "title": "" }, { "docid": "1016eca5d78881f197ba19ec227c6c87", "score": "0.5343693", "text": "function createPlane() {\n var random = randomIntFromInterval(1, 20);\n var plane = new THREE.Group();\n var planeGeometry = new THREE.PlaneGeometry(20, 20);\n if (random == 1) { // then the plane will be filled with violet color\n var planeMaterial = new THREE.MeshBasicMaterial({ color: 0xB026FF, side: THREE.DoubleSide });\n } else { // most of the time each plane's color will be dark blue\n var planeMaterial = new THREE.MeshBasicMaterial({ color: 0x000026, side: THREE.DoubleSide });\n }\n var edgesGeometry = new THREE.EdgesGeometry(planeGeometry);\n var edgesMaterial = new THREE.LineBasicMaterial({ color: 0xB026FF, linewidth: 10});\n \n var planeObject = new THREE.Mesh(planeGeometry, planeMaterial);\n var edgesMesh = new THREE.LineSegments(edgesGeometry, edgesMaterial); // the edges of each plane, always violet\n \n planeObject.rotateOnAxis(new THREE.Vector3(1, 0, 0), Math.PI / 2);\n edgesMesh.rotateOnAxis(new THREE.Vector3(1, 0, 0), Math.PI / 2);\n planeObject.receiveShadow = true;\n\n plane.add(planeObject);\n plane.add(edgesMesh);\n\n return plane;\n}", "title": "" }, { "docid": "1990bc62b966131f33d94b0b86b70f77", "score": "0.5340877", "text": "function drawArrowNorth() {\r\n\r\n \r\n\r\n //==|| The Outline Material\r\n WELLVIS.theArrowNorthmaterial = new THREE.LineBasicMaterial( {\r\n color: WELLVIS.theArrowNorthColor, \r\n lineWidth: 1,\r\n transparent: true,\r\n opacity: WELLVIS.theArrowNorthOpacity\r\n }\r\n );\r\n\r\n\r\n\r\n var midX = (WELLVIS.maxX + WELLVIS.minX) / 2; \r\n\r\n var halfLength = (WELLVIS.maxX - WELLVIS.minX) / 2 - WELLVIS.theUnit;\r\n\r\n if(halfLength > 3 * WELLVIS.theUnit) { \r\n halfLength = 3 * WELLVIS.theUnit;\r\n }\r\n\r\n colorTrace(\"midX = \" + midX + \" halfLength = \" + halfLength + \" minX = \" + WELLVIS.minX + \" maxX = \" + WELLVIS.maxX + \"Green\");\r\n \r\n //==|| The Outline Geometry\r\n WELLVIS.theArrowNorthgeo = new THREE.Geometry();\r\n WELLVIS.theArrowNorthgeo.vertices.push(\r\n\r\n v(midX, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin, WELLVIS.theZ), v(midX - halfLength, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin, WELLVIS.theZ),\r\n v(midX - halfLength, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin, WELLVIS.theZ), v(midX - halfLength, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin - WELLVIS.theArrowNorth_Width, WELLVIS.theZ),\r\n v(midX, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin, WELLVIS.theZ), v(midX + halfLength, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin, WELLVIS.theZ),\r\n v(midX + halfLength, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin, WELLVIS.theZ), v(midX + WELLVIS.theArrowNorth_Width, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin - WELLVIS.theArrowNorth_Width, WELLVIS.theZ),\r\n v(midX + halfLength, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin, WELLVIS.theZ), v(midX + WELLVIS.theArrowNorth_Width, WELLVIS.maxY + WELLVIS.theArrowNorth_Margin + WELLVIS.theArrowNorth_Width, WELLVIS.theZ)\r\n\r\n\r\n );\r\n\r\n\r\n //==|| The Outline\r\n WELLVIS.theArrowNorth = new THREE.Line(WELLVIS.theArrowNorthgeo, WELLVIS.theArrowNorthmaterial);\r\n WELLVIS.theArrowNorth.type = THREE.Lines;\r\n\r\n WELLVIS.theMainObject.add(WELLVIS.theArrowNorth);\r\n\r\n}", "title": "" }, { "docid": "a5f61e13197c637d639a3523f7737073", "score": "0.53408486", "text": "function sortLines(oldgeo) {\n\tvar obj = new THREE.Object3D();\n\tvar verts = oldgeo.vertices;\n\n\twhile(verts.length > 0) {\n\t\tvar sorted = [];\n\t\tif(verts.length === 1) break;\n\n\t\tsorted.push(verts[0]);\n\t\tsorted.push(verts[1]);\n\t\tverts.splice(0,2);\n\n\t\tfor(var i=0; i<verts.length; i++) {\n\n\t\t\tvar first = sorted[0];\n\t\t\tvar last = sorted[sorted.length-1];\n\n\t\t\tfor(var j=0; j<verts.length; j++) {\n\t\t\t\t// test with last element\n\t\t\t\tif(equalVectors(last, verts[j], 8)) {\n\t\t\t\t\tif(j%2 == 0) {\n\t\t\t\t\t\tsorted.push(verts[j+1]);\n\t\t\t\t\t\tverts.splice(j,2);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsorted.push(verts[j-1]);\n\t\t\t\t\t\tverts.splice(j-1, 2);\n\t\t\t\t\t}\n\t\t\t\t\tj -= 2;\n\t\t\t\t\ti -= 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// test with first element\n\t\t\t\telse if(equalVectors(first, verts[j], 8)) {\n\t\t\t\t\tif(j%2 == 0) {\n\t\t\t\t\t\tsorted.unshift(verts[j+1]);\n\t\t\t\t\t\tverts.splice(j,2);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsorted.unshift(verts[j-1]);\n\t\t\t\t\t\tverts.splice(j-1, 2);\n\t\t\t\t\t}\n\t\t\t\t\tj -= 2;\n\t\t\t\t\ti -= 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add new Line object\n\t\tvar geo = new THREE.Geometry();\n\t\tgeo.vertices = sorted;\n\t\tobj.add(new THREE.Line(geo, materials['sliceLineMat'], THREE.LineStrip));\n\t}\n\n\treturn obj;\n}", "title": "" }, { "docid": "8091349f238df2593011a85ea5c5b26b", "score": "0.5330495", "text": "function createFaces(geometry, pointNum, width, length){\n // calculate each face's normal, and create the face\n for (var i = 0; i<pointNum-(width+1); i++){\n // if vertices[i] is not in the left edge\n if(i%(width+1)!=0){\n var faceNormal = new THREE.Vector3();\n var point1 = geometry.vertices[i];\n var point2 = geometry.vertices[i+width];\n var point3 = geometry.vertices[i+width+1];\n var vector1 = new THREE.Vector3();\n var vector2 = new THREE.Vector3();\n vector1.subVectors(point1, point2); // !!! use sub, not add !!!\n vector2.subVectors(point2, point3);\n faceNormal.crossVectors(vector1,vector2);\n faceNormal.normalize();\n //console.log(faceNormal.x);\n geometry.faces.push(new THREE.Face3(i, i+width, i+width+1,faceNormal));\n }\n // if vertices[i] is not in the right edge\n if((i+1)%(width+1)!=0){\n var faceNormal = new THREE.Vector3();\n var point1 = geometry.vertices[i];\n var point2 = geometry.vertices[i+width+1];\n var point3 = geometry.vertices[i+1];\n var vector1 = new THREE.Vector3();\n var vector2 = new THREE.Vector3();\n vector1.subVectors(point1, point2);\n vector2.subVectors(point2, point3);\n faceNormal.crossVectors(vector1,vector2);\n faceNormal.normalize();\n\n geometry.faces.push(new THREE.Face3(i, i+width+1, i+1,faceNormal));\n }\n }\n}", "title": "" }, { "docid": "51177517a6870266ebba394cfb829902", "score": "0.532972", "text": "createEdge(va, vb) {\n let eab = this.getHalfEdge(va, vb);\n if (eab !== null) {\n return eab;\n }\n let left = new HalfEdge(va, vb), right = new HalfEdge(vb, va);\n left.twin = right; right.twin = left;\n va.outEdges.push(left);\n vb.outEdges.push(right);\n this.edges.push(left); this.edges.push(right);\n return left;\n }", "title": "" }, { "docid": "1c33d5ee63b1b40386c59565f49bb3e1", "score": "0.5329676", "text": "function buildSideFaces() {\n\n var layeroffset = 0;\n sidewalls( contour, layeroffset );\n layeroffset += contour.length;\n\n for ( h = 0, hl = holes.length; h < hl; h++ ) {\n\n ahole = holes[ h ];\n sidewalls( ahole, layeroffset );\n\n //, true\n layeroffset += ahole.length;\n\n }\n\n }", "title": "" }, { "docid": "aab34d8d331249c603ef6bfb46f191db", "score": "0.53266233", "text": "function filterBoundingBoxes (planes, vertices, partialSelect) { \n \n //Test\n //fragments list array\n var fragList = viewer.model.getFragmentList();\n //boxes array \n var boxes = fragList.fragments.boxes;\n //map from frag to dbid\n var fragid2dbid = fragList.fragments.fragId2dbId; \n console.log(\"Frag\" + fragid2dbid);\n //build _boundingBoxInfo by the data of Viewer directly\n //might probably be a bit slow with large model..\n \n var index = 0;\n for(var step=0;step<fragid2dbid.length;step++){\n index = step * 6;\n var thisBox = new THREE.Box3(new THREE.Vector3(boxes[index],boxes[index+1],boxes[index+2]),\n new THREE.Vector3(boxes[index+3],boxes[index+4],boxes[index+5]));\n \n \n boundingBoxInfo.push({bbox:thisBox,dbId:fragid2dbid[step]});\n }\n \n //Test\n console.log(\"BoundingBoxInfo \" + JSON.stringify(boundingBoxInfo,null,4));\n var intersect = []\n var outside = []\n var inside = []\n\n var triangles = [\n {a:vertices[0],b:vertices[1],c:vertices[2]},\n {a:vertices[0],b:vertices[2],c:vertices[3]},\n {a:vertices[1],b:vertices[0],c:vertices[4]},\n {a:vertices[2],b:vertices[1],c:vertices[4]},\n {a:vertices[3],b:vertices[2],c:vertices[4]},\n {a:vertices[0],b:vertices[3],c:vertices[4]} \n ] \n \n for (let bboxInfo of boundingBoxInfo) {\n \n \n // if bounding box inside, then we can be sure\n // the mesh is inside too\n \n if (containsBox (planes, bboxInfo.bbox)) \n { \n inside.push(bboxInfo) \n \n } else if (partialSelect) { \n \n //reconstructed by using AABBCollision lib.\n if(boxIntersectVertex(bboxInfo.bbox,triangles))\n intersect.push(bboxInfo)\n else \n outside.push(bboxInfo)\n \n } else { \n outside.push(bboxInfo)\n \n\n }\n }\n \n console.log(\"Inside \" + JSON.stringify(inside,null,4));\n console.log(\"Outside\" + JSON.stringify(outside,null,4));\n return {\n intersect,\n outside,\n inside\n }\n }", "title": "" }, { "docid": "2cf6fd097b1786d7559d7d2391eec290", "score": "0.532532", "text": "populateGeometry(tiles, preparedVertices) {\n // Keep track of which material each texutre corresponds to.\n let materials = [];\n let materialMap = {};\n materials.push(new THREE.MeshLambertMaterial( { \n vertexColors: THREE.VertexColors,\n side: THREE.FrontSide,\n //wireframe: true,\n }));\n\n // Extract for simpler code\n let vertices = preparedVertices.vertices;\n let geometry = preparedVertices.geometry;\n\n let flow = [];\n\n for (let x = 0; x < this.metadata.wSIZE; x++) {\n for (let y = 0; y < this.metadata.wSIZE; y++) {\n let tile = tiles[x][y];\n // tile.draw == none -> do not draw this tile\n if (tile.draw == 'none') continue;\n\n let v00 = vertices[x][y].index;\n let v10 = vertices[x + 1][y].index;\n let v11 = vertices[x + 1][y + 1].index;\n let v01 = vertices[x][y + 1].index;\n\n let face1, face2;\n\n let material1 = this.materialIndex(materials, materialMap, 'lambert', tile.texture1, 'buildings/floors/');\n let material2 = this.materialIndex(materials, materialMap, 'lambert', tile.texture2, 'buildings/floors/');\n\n let vertexColors = this.computeVertexColors(tiles[x][y], tiles[x][y+1], tiles[x+1][y], tiles[x+1][y+1]);\n\n let draw1 = true;\n let draw2 = true;\n\n if (material1 == 0 && !tile.color) draw1 = false;\n if (material2 == 0 && !tile.color) draw2 = false; \n\n if (tile.orientation == 'diaga') {\n face1 = new THREE.Face3(v00,v01,v11);\n face2 = new THREE.Face3(v00,v11,v10);\n\n let prefix1 = tile.texture1 == 'water.png' ? \"w\" : material1 == 0 ? \"\" : \"t\";\n face1.vertexColors[0] = vertexColors[prefix1 + \"00\"];\n face1.vertexColors[1] = vertexColors[prefix1 + \"01\"];\n face1.vertexColors[2] = vertexColors[prefix1 + \"11\"];\n\n let prefix2 = tile.texture2 == 'water.png' ? \"w\" : material2 == 0 ? \"\" : \"t\";\n face2.vertexColors[0] = vertexColors[prefix2 + \"00\"];\n face2.vertexColors[1] = vertexColors[prefix2 + \"11\"];\n face2.vertexColors[2] = vertexColors[prefix2 + \"10\"];\n \n if (draw1) {\n geometry.faceVertexUvs[0].push(diaga_uvs_0);\n }\n if (draw2) {\n geometry.faceVertexUvs[0].push(diaga_uvs_1);\n }\n } else {\n face1 = new THREE.Face3(v00,v01,v10);\n face2 = new THREE.Face3(v10,v01,v11);\n \n let prefix1 = tile.texture1 == 'water.png' ? \"w\" : material1 == 0 ? \"\" : \"t\";\n face1.vertexColors[0] = vertexColors[prefix1 + \"00\"];\n face1.vertexColors[1] = vertexColors[prefix1 + \"01\"];\n face1.vertexColors[2] = vertexColors[prefix1 + \"10\"];\n\n let prefix2 = tile.texture2 == 'water.png' ? \"w\" : material2 == 0 ? \"\" : \"t\";\n face2.vertexColors[0] = vertexColors[prefix2 + \"10\"];\n face2.vertexColors[1] = vertexColors[prefix2 + \"01\"];\n face2.vertexColors[2] = vertexColors[prefix2 + \"11\"];\n\n if (draw1) {\n geometry.faceVertexUvs[0].push(diagb_uvs_0);\n } \n if (draw2) {\n geometry.faceVertexUvs[0].push(diagb_uvs_1);\n }\n }\n\n face1.materialIndex = material1;\n face2.materialIndex = material2;\n\n if (draw1) {\n geometry.faces.push(face1);\n for (let i = 0; i < 3; i++) {\n flow.push(tile.waterFlow ? tile.waterFlow[0] : 0.0);\n flow.push(tile.waterFlow ? tile.waterFlow[1] : 0.0);\n }\n } \n if (draw2) {\n geometry.faces.push(face2);\n for (let i = 0; i < 3; i++) {\n flow.push(tile.waterFlow ? tile.waterFlow[0] : 0.0);\n flow.push(tile.waterFlow ? tile.waterFlow[1] : 0.0);\n }\n }\n }\n }\n\n geometry.computeFaceNormals();\n geometry.computeVertexNormals();\n\n let buffergeometry = new THREE.BufferGeometry().fromGeometry(geometry);\n buffergeometry.addAttribute('flow', new THREE.Float32BufferAttribute(Float32Array.from(flow), 2));\n\n let mesh = new THREE.Mesh(buffergeometry, materials);\n mesh.matrixAutoUpdate = false;\n return mesh;\n }", "title": "" }, { "docid": "6ea8477adf69585be223511c3da36867", "score": "0.53237784", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "title": "" }, { "docid": "6ea8477adf69585be223511c3da36867", "score": "0.53237784", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "title": "" }, { "docid": "6ea8477adf69585be223511c3da36867", "score": "0.53237784", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "title": "" }, { "docid": "6ea8477adf69585be223511c3da36867", "score": "0.53237784", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "title": "" }, { "docid": "6ea8477adf69585be223511c3da36867", "score": "0.53237784", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "title": "" }, { "docid": "6ea8477adf69585be223511c3da36867", "score": "0.53237784", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "title": "" }, { "docid": "e501438f3f88a4704e122d0c726c315a", "score": "0.53173167", "text": "drawVertexTraversals() {\n let drawer = this.drawer;\n if (this.vertTest.showResult) {\n let v = this.mesh.vertices[this.vertTest.vertexIndex];\n let p1 = glMatrix.vec3.create();\n let p1_2 = glMatrix.vec3.create();\n glMatrix.vec3.scale(p1, v.pos, DRAW_OFFSET);\n glMatrix.vec3.scale(p1_2, v.pos, 1.0/DRAW_OFFSET);\n drawer.drawPoint(p1, [1, 0, 0]);\n if (this.vertTest.type == 'getVertexNeighbors' || this.vertTest.type == 'getAttachedFaces') {\n let vs = v.getVertexNeighbors();\n for (let i = 0; i < vs.length; i++) {\n let p2 = glMatrix.vec3.create();\n let p2_2 = glMatrix.vec3.create();\n glMatrix.vec3.scale(p2, vs[i].pos, DRAW_OFFSET);\n glMatrix.vec3.scale(p2_2, vs[i].pos, 1.0/DRAW_OFFSET);\n drawer.drawLine(p1, p2, [0, 1, 1]);\n drawer.drawPoint(p2, [0, 1, 1]);\n drawer.drawLine(p1_2, p2_2, [0, 1, 1]);\n drawer.drawPoint(p2_2, [0, 1, 1]);\n }\n }\n if (this.vertTest.type == 'getAttachedFaces') {\n // Draw all attached faces in red\n let faces = v.getAttachedFaces();\n this.faceDrawer.clear();\n let idx2V = {}; // Convert from mesh index to new vertex in face drawer\n for (let i = 0; i < faces.length; i++) {\n const f = faces[i];\n const vs = f.getVertices();\n let face = [];\n let face_2 = [];\n for (let j = 0; j < vs.length; j++) {\n const v = vs[j];\n if (!(v.ID in idx2V)) {\n let p = glMatrix.vec3.create();\n let p_2 = glMatrix.vec3.create();\n glMatrix.vec3.scale(p, v.pos, DRAW_OFFSET);\n glMatrix.vec3.scale(p_2, v.pos, 1.0/DRAW_OFFSET);\n const vnew = this.faceDrawer.addVertex(p);\n const vnew_2 = this.faceDrawer.addVertex(p_2);\n idx2V[v.ID] = [vnew, vnew_2];\n }\n face.push(idx2V[v.ID][0]);\n face_2.push(idx2V[v.ID][1])\n }\n this.faceDrawer.addFace(face);\n this.faceDrawer.addFace(face_2);\n }\n let materialBefore = this.material;\n this.material = {'ka':[1, 1, 0], 'kd':[1, 1, 0]};\n this.faceDrawer.render(this);\n this.material = materialBefore;\n }\n }\n }", "title": "" }, { "docid": "35090f35793a30c8bc77e30cf84d5e56", "score": "0.53144157", "text": "function CollidePolygons(manifold, polyA, xfA, polyB, xfB) {\n manifold.pointCount = 0;\n var totalRadius = polyA.m_radius + polyB.m_radius;\n\n FindMaxSeparation(polyA, xfA, polyB, xfB);\n var edgeA = FindMaxSeparation._bestIndex;\n var separationA = FindMaxSeparation._maxSeparation;\n if (separationA > totalRadius)\n return;\n\n FindMaxSeparation(polyB, xfB, polyA, xfA);\n var edgeB = FindMaxSeparation._bestIndex;\n var separationB = FindMaxSeparation._maxSeparation;\n if (separationB > totalRadius)\n return;\n\n var poly1; // reference polygon\n var poly2; // incident polygon\n var xf1;\n var xf2;\n var edge1; // reference edge\n var flip;\n var k_tol = 0.1 * Settings.linearSlop;\n\n if (separationB > separationA + k_tol) {\n poly1 = polyB;\n poly2 = polyA;\n xf1 = xfB;\n xf2 = xfA;\n edge1 = edgeB;\n manifold.type = Manifold.e_faceB;\n flip = 1;\n } else {\n poly1 = polyA;\n poly2 = polyB;\n xf1 = xfA;\n xf2 = xfB;\n edge1 = edgeA;\n manifold.type = Manifold.e_faceA;\n flip = 0;\n }\n\n var incidentEdge = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);\n\n var count1 = poly1.m_count;\n var vertices1 = poly1.m_vertices;\n\n var iv1 = edge1;\n var iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0;\n\n var v11 = vertices1[iv1];\n var v12 = vertices1[iv2];\n\n var localTangent = Vec2.sub(v12, v11);\n localTangent.normalize();\n\n var localNormal = Vec2.cross(localTangent, 1.0);\n var planePoint = Vec2.combine(0.5, v11, 0.5, v12);\n\n var tangent = Rot.mulVec2(xf1.q, localTangent);\n var normal = Vec2.cross(tangent, 1.0);\n\n v11 = Transform.mulVec2(xf1, v11);\n v12 = Transform.mulVec2(xf1, v12);\n\n // Face offset.\n var frontOffset = Vec2.dot(normal, v11);\n\n // Side offsets, extended by polytope skin thickness.\n var sideOffset1 = -Vec2.dot(tangent, v11) + totalRadius;\n var sideOffset2 = Vec2.dot(tangent, v12) + totalRadius;\n\n // Clip incident edge against extruded edge1 side edges.\n var clipPoints1 = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n var clipPoints2 = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n var np;\n\n // Clip to box side 1\n np = Manifold.clipSegmentToLine(clipPoints1, incidentEdge, Vec2.neg(tangent),\n sideOffset1, iv1);\n\n if (np < 2) {\n return;\n }\n\n // Clip to negative box side 1\n np = Manifold.clipSegmentToLine(clipPoints2, clipPoints1, tangent,\n sideOffset2, iv2);\n\n if (np < 2) {\n return;\n }\n\n // Now clipPoints2 contains the clipped points.\n manifold.localNormal = localNormal;\n manifold.localPoint = planePoint;\n\n var pointCount = 0;\n for (var i = 0; i < clipPoints2.length/* maxManifoldPoints */; ++i) {\n var separation = Vec2.dot(normal, clipPoints2[i].v) - frontOffset;\n\n if (separation <= totalRadius) {\n var cp = manifold.points[pointCount]; // ManifoldPoint\n cp.localPoint.set(Transform.mulTVec2(xf2, clipPoints2[i].v));\n cp.id = clipPoints2[i].id;\n if (flip) {\n // Swap features\n var cf = cp.id.cf; // ContactFeature\n var indexA = cf.indexA;\n var indexB = cf.indexB;\n var typeA = cf.typeA;\n var typeB = cf.typeB;\n cf.indexA = indexB;\n cf.indexB = indexA;\n cf.typeA = typeB;\n cf.typeB = typeA;\n }\n ++pointCount;\n }\n }\n\n manifold.pointCount = pointCount;\n}", "title": "" }, { "docid": "4b9e40e3feeb53142358d1506d7221e9", "score": "0.53116715", "text": "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "4b9e40e3feeb53142358d1506d7221e9", "score": "0.53116715", "text": "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "4b9e40e3feeb53142358d1506d7221e9", "score": "0.53116715", "text": "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "4b9e40e3feeb53142358d1506d7221e9", "score": "0.53116715", "text": "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "4b9e40e3feeb53142358d1506d7221e9", "score": "0.53116715", "text": "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "4b9e40e3feeb53142358d1506d7221e9", "score": "0.53116715", "text": "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "4b9e40e3feeb53142358d1506d7221e9", "score": "0.53116715", "text": "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "9ebdad3f999f695961d246567830ee95", "score": "0.53080595", "text": "function buildSideFaces() {\n\n\t\t\t\tvar start = verticesArray.length / 3;\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "9ebdad3f999f695961d246567830ee95", "score": "0.53080595", "text": "function buildSideFaces() {\n\n\t\t\t\tvar start = verticesArray.length / 3;\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "9ebdad3f999f695961d246567830ee95", "score": "0.53080595", "text": "function buildSideFaces() {\n\n\t\t\t\tvar start = verticesArray.length / 3;\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "9ebdad3f999f695961d246567830ee95", "score": "0.53080595", "text": "function buildSideFaces() {\n\n\t\t\t\tvar start = verticesArray.length / 3;\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "9ebdad3f999f695961d246567830ee95", "score": "0.53080595", "text": "function buildSideFaces() {\n\n\t\t\t\tvar start = verticesArray.length / 3;\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "title": "" }, { "docid": "0f3f758715b8cc2224df131b3aeadf31", "score": "0.5306159", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length/3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t\t}", "title": "" }, { "docid": "0f3f758715b8cc2224df131b3aeadf31", "score": "0.5306159", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length/3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t\t}", "title": "" }, { "docid": "132c676f913b8726bc9c6bee10359619", "score": "0.530503", "text": "function updatePlanes() {\n\n view.planes.children[0].position.y = view.planes.children[0].height;\n view.waistHeight = view.planes.children[0].height;\n\n for(var i=1;i<view.planes.children.length;i++){\n\n view.planes.children[i].position.y = view.planes.children[i].height + view.planes.children[0].height;\n\n }\n\n }", "title": "" }, { "docid": "72d060615e1208c71be16f7c448c2e5b", "score": "0.5301252", "text": "function flipEdge (hds,he) {\n\tvar ohe = hds.halfedge[he.opp];\n\tvar henxt = hds.halfedge[he.nxt];\n\tvar ohenxt = hds.halfedge[ohe.nxt];\n\thds.joinFace (he);\n\thds.splitFace (henxt,ohenxt);\n}", "title": "" }, { "docid": "8633bdf122424ebeeb8b8f7b31ac4a73", "score": "0.5298798", "text": "edges() {\n if (this.pos.x > width) {\n this.pos.x = 0;\n } else if (this.pos.x < 0) {\n this.pos.x = width;\n } else if (this.pos.y > height) {\n this.pos.y = 0;\n } else if (this.pos.y < 0) {\n this.pos.y = height;\n }\n }", "title": "" }, { "docid": "2f593e0b36dba36edd0f99eac2d3639a", "score": "0.52913773", "text": "getBoxEdge(supportDir, body) {\n let r = body.getRight(true);\n let u = body.getUp(true);\n let rd = r.dot(supportDir);\n let ud = u.dot(supportDir);\n //Find most significant axis\n if(Math.abs(rd) > Math.abs(ud)) {\n if(rd > 0.0)\n return [body.pos.add(r).add(u), body.pos.add(r).sub(u)];\n //Orthogonal to most significant axis to get edge direction\n return [body.pos.sub(r).add(u), body.pos.sub(r).sub(u)];\n }\n if(ud > 0.0)\n return [body.pos.add(u).add(r), body.pos.add(u).sub(r)];\n return [body.pos.sub(u).add(r), body.pos.sub(u).sub(r)];\n }", "title": "" }, { "docid": "bb1f9225f67678e831e8025f272842a1", "score": "0.528303", "text": "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1 );\n\n\n\t\t}", "title": "" }, { "docid": "b8943d0ddef68a180d2e7f9b2fcd7f77", "score": "0.52790695", "text": "function splitSides(div, vertices, faces){\n\n var newVertices = [];\n var newFaces = [];\n\n // Function taken from task2.js from assignment 3\n var edgeMap = {};\n function getOrInsertEdge(a, b, centroid) {\n var edgeKey = a < b ? a + \":\" + b : b + \":\" + a;\n if (edgeKey in edgeMap) {\n return edgeMap[edgeKey];\n } else {\n var idx = newVertices.length;\n newVertices.push(centroid);\n edgeMap[edgeKey] = idx;\n return idx;\n }\n }\n\n // Limit of divisions\n if(div <= 0){\n return{'vertices': vertices, 'faces': faces};\n }\n\n // Otherwise...\n for(var i = 0; i < vertices.length; i++){\n newVertices.push(vertices[i].clone());\n }\n for (var i = 0; i < faces.length; i++){\n var v0 = faces[i][0];\n var v1 = faces[i][1];\n var v2 = faces[i][2];\n var c01 = getOrInsertEdge(v0, v1, Vector.lerp(vertices[v0], vertices[v1], .5));\n var c12 = getOrInsertEdge(v1, v2, Vector.lerp(vertices[v1], vertices[v2], .5));\n var c20 = getOrInsertEdge(v2, v0, Vector.lerp(vertices[v2], vertices[v0], .5));\n\n newFaces.push([v0, c01, c20]);\n newFaces.push([v1, c12, c01]);\n newFaces.push([v2, c20, c12]);\n newFaces.push([c01, c12, c20]);\n }\n\n var nextDiv = splitSides(div - 1, newVertices, newFaces);\n return{'vertices' : nextDiv.vertices, 'faces' : nextDiv.faces};\n\n}", "title": "" }, { "docid": "c78e6a15f6c4efa533b599b10a742519", "score": "0.527769", "text": "generateBlockGeometry(x, y, z, sides) {\n let geometries = []\n\n x -= (this.size / 2)\n z -= (this.size / 2)\n\n if (!sides[0]) {\n var pxGeometry = new THREE.PlaneGeometry(1, 1);\n pxGeometry.rotateY(Math.PI / 2);\n pxGeometry.translate(x + 0.5, y, z);\n\n geometries.push({\n geometry: pxGeometry,\n side: 'px',\n index: 1\n })\n\n pxGeometry.dispose()\n }\n if (!sides[1]) {\n var nxGeometry = new THREE.PlaneGeometry(1, 1);\n nxGeometry.rotateY(-Math.PI / 2);\n nxGeometry.translate(x - 0.5, y, z);\n\n geometries.push({\n geometry: nxGeometry,\n side: 'nx',\n index: 2\n })\n\n nxGeometry.dispose()\n }\n\n if (!sides[2]) {\n var pyGeometry = new THREE.PlaneGeometry(1, 1);\n pyGeometry.rotateX(-Math.PI / 2);\n pyGeometry.translate(x, y + 0.5, z);\n\n geometries.push({\n geometry: pyGeometry,\n side: 'py',\n index: 3\n })\n\n pyGeometry.dispose()\n }\n if (!sides[3]) {\n var nyGeometry = new THREE.PlaneGeometry(1, 1);\n nyGeometry.rotateX(Math.PI / 2);\n nyGeometry.translate(x, y - 0.5, z);\n\n geometries.push({\n geometry: nyGeometry,\n side: 'ny',\n index: 4\n })\n\n nyGeometry.dispose()\n }\n\n if (!sides[4]) {\n var pzGeometry = new THREE.PlaneGeometry(1, 1);\n pzGeometry.translate(x, y, z + 0.5);\n\n geometries.push({\n geometry: pzGeometry,\n side: 'pz',\n index: 5\n })\n\n pzGeometry.dispose()\n }\n if (!sides[5]) {\n var nzGeometry = new THREE.PlaneGeometry(1, 1);\n nzGeometry.rotateY(Math.PI);\n nzGeometry.translate(x, y, z - 0.5);\n\n geometries.push({\n geometry: nzGeometry,\n side: 'nz',\n index: 6\n })\n\n nzGeometry.dispose()\n }\n\n return geometries\n }", "title": "" }, { "docid": "954baede293d0dd723a9b2aa2782b939", "score": "0.5276232", "text": "function parseEdges(data) {\r\n if (!useVTK) {\r\n for (var i = 0; i < data.edges.length; i++) {\r\n EDGES[i] = makeDeepCopy(data.edges[i]);\r\n }\r\n }\r\n\r\n for (var edge in EDGES) {\r\n EDGES[edge].geometry = new THREE.Geometry();\r\n EDGES[edge].geometry.vertices.push(\r\n new THREE.Vector3(\r\n NODES[EDGES[edge].connectivity.n[0]].position.x,\r\n NODES[EDGES[edge].connectivity.n[0]].position.y,\r\n NODES[EDGES[edge].connectivity.n[0]].position.z),\r\n new THREE.Vector3(\r\n NODES[EDGES[edge].connectivity.n[1]].position.x,\r\n NODES[EDGES[edge].connectivity.n[1]].position.y,\r\n NODES[EDGES[edge].connectivity.n[1]].position.z)\r\n );\r\n\r\n EDGES[edge].material = new THREE.LineBasicMaterial({\r\n color: new THREE.Color(Math.random() * 0xffffff),\r\n linewidth: 1\r\n });\r\n\r\n EDGES[edge].mesh = new THREE.Line(EDGES[edge].geometry, EDGES[edge].material);\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "8f441677741b0525e9507df68fa44dc5", "score": "0.526763", "text": "drawBoxes() {\n this.geometry.setMode(DrawModes.lines);\n let aabbs = this.octree.aabbs;\n let length = Object.keys(aabbs).length;\n let c = new Float32Array(length * 24 * 3);\n let p = new Float32Array(length * 24 * 3);\n\n for (let i = 0; i < c.length; i++) {\n c[i] = 255.0;\n }\n\n let index = 0;\n\n for (var key in aabbs) {\n let corners = AABB.getCorners(aabbs[key]);\n p[index++] = corners[0][0];\n p[index++] = corners[0][1];\n p[index++] = corners[0][2];\n p[index++] = corners[1][0];\n p[index++] = corners[1][1];\n p[index++] = corners[1][2];\n p[index++] = corners[0][0];\n p[index++] = corners[0][1];\n p[index++] = corners[0][2];\n p[index++] = corners[2][0];\n p[index++] = corners[2][1];\n p[index++] = corners[2][2];\n p[index++] = corners[0][0];\n p[index++] = corners[0][1];\n p[index++] = corners[0][2];\n p[index++] = corners[4][0];\n p[index++] = corners[4][1];\n p[index++] = corners[4][2];\n p[index++] = corners[1][0];\n p[index++] = corners[1][1];\n p[index++] = corners[1][2];\n p[index++] = corners[3][0];\n p[index++] = corners[3][1];\n p[index++] = corners[3][2];\n p[index++] = corners[1][0];\n p[index++] = corners[1][1];\n p[index++] = corners[1][2];\n p[index++] = corners[5][0];\n p[index++] = corners[5][1];\n p[index++] = corners[5][2];\n p[index++] = corners[2][0];\n p[index++] = corners[2][1];\n p[index++] = corners[2][2];\n p[index++] = corners[3][0];\n p[index++] = corners[3][1];\n p[index++] = corners[3][2];\n p[index++] = corners[2][0];\n p[index++] = corners[2][1];\n p[index++] = corners[2][2];\n p[index++] = corners[6][0];\n p[index++] = corners[6][1];\n p[index++] = corners[6][2];\n p[index++] = corners[3][0];\n p[index++] = corners[3][1];\n p[index++] = corners[3][2];\n p[index++] = corners[7][0];\n p[index++] = corners[7][1];\n p[index++] = corners[7][2];\n p[index++] = corners[4][0];\n p[index++] = corners[4][1];\n p[index++] = corners[4][2];\n p[index++] = corners[5][0];\n p[index++] = corners[5][1];\n p[index++] = corners[5][2];\n p[index++] = corners[4][0];\n p[index++] = corners[4][1];\n p[index++] = corners[4][2];\n p[index++] = corners[6][0];\n p[index++] = corners[6][1];\n p[index++] = corners[6][2];\n p[index++] = corners[5][0];\n p[index++] = corners[5][1];\n p[index++] = corners[5][2];\n p[index++] = corners[7][0];\n p[index++] = corners[7][1];\n p[index++] = corners[7][2];\n p[index++] = corners[6][0];\n p[index++] = corners[6][1];\n p[index++] = corners[6][2];\n p[index++] = corners[7][0];\n p[index++] = corners[7][1];\n p[index++] = corners[7][2];\n }\n\n this.setAttribute(\"position\", p);\n this.setAttribute(\"color\", c);\n }", "title": "" }, { "docid": "ad5a552c40301f114525de31ced22514", "score": "0.52592045", "text": "rotateData(faceIDs, hingeEdgeID, rads){\n\t\tlet faces = [];\n\t\tlet hingeEdge = this.getEdge(hingeEdgeID);\n\n\t\tfaceIDs.map((ID) => {\n\t\t\tlet face = this.getFace(ID);\n\t\t\tfaces.push(face);\n\t\t});\n\n\t\tlet rotation = new THREE.Quaternion();\n\t\trotation = rotation.setFromAxisAngle(hingeEdge.axis, rads);\n\n\t\tfaces.map((face) => {\n\t\t\tDG_PRIVATES.get(this).faceMap.removeData(face.position);\n\n\t\t\tlet sepVec = new THREE.Vector3().subVectors(face.position, hingeEdge.position);\n\t\t\tsepVec.applyQuaternion(rotation);\n\t\t\tsepVec.add(hingeEdge.position);\n\n\t\t\tface.position = toLatticeVector(sepVec);\n\n\t\t\tlet normal = face.normal;\n\n\t\t\tnormal.applyQuaternion(rotation);\n\t\t\tnormal.normalize();\n\t\t\tface.normal = toLatticeVector(normal);\n\n\t\t\tDG_PRIVATES.get(this).faceMap.addToMap(face, face.position);\n\n\t\t\tface.edges.map((edge) => {\n\t\t\t\tremoveEdgeFromMaps(this, edge);\n\n\t\t\t\tlet sepVec = new THREE.Vector3().subVectors(edge.position, hingeEdge.position);\n\t\t\t\tsepVec.applyQuaternion(rotation);\n\t\t\t\tsepVec.add(hingeEdge.position);\n\n\t\t\t\tedge.position = toLatticeVector(sepVec);\n\n\t\t\t\tlet newAxis = edge.axis.clone();\n\t\t\t\tnewAxis.applyQuaternion(rotation);\n\t\t\t\tnewAxis.normalize();\n\t\t\t\tedge.axis = toQ1Vector(toLatticeVector(newAxis));\n\n\t\t\t\tlet endpoint1 = new THREE.Vector3().addVectors(edge.position, newAxis);\n\t\t\t\tlet endpoint2 = new THREE.Vector3().addVectors(edge.position, newAxis.multiplyScalar(-1));\n\n\n\t\t\t\tedge.setEndpoints(toLatticeVector(endpoint1), toLatticeVector(endpoint2));\n\n\t\t\t\taddEdgeToMaps(this, edge);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "edf6adefaab69783964b5559d9aee6a7", "score": "0.5253935", "text": "_addAdjoiningFace( vertex, horizonEdge ) {\n\n\t\t// all the half edges are created in ccw order thus the face is always pointing outside the hull\n\n\t\tconst face = new Face( vertex.point, horizonEdge.prev.vertex, horizonEdge.vertex );\n\n\t\tthis.faces.push( face );\n\n\t\t// join face.getEdge( - 1 ) with the horizon's opposite edge face.getEdge( - 1 ) = face.getEdge( 2 )\n\n\t\tface.getEdge( - 1 ).linkOpponent( horizonEdge.twin );\n\n\t\treturn face.getEdge( 0 ); // the half edge whose vertex is the given one\n\n\t}", "title": "" }, { "docid": "5df578b636f409246553294ddc8dab5c", "score": "0.5250721", "text": "function intersectionsFacePlane(pV, pN, v0, v1, v2) {\n\tvar num = 0;\n\tvar o = {};\n\n\to.sideA = intersectionLinePlane(pV, pN, v0, v1);\n\tif(!o.sideA.t) num++;\n\to.sideB = intersectionLinePlane(pV, pN, v1, v2);\n\tif(!o.sideB.t) num++;\n\to.sideC = intersectionLinePlane(pV, pN, v2, v0);\n\tif(!o.sideC.t) num++;\n\n\tif(num == 1) return o;\n\telse return null; // possible logic problem\n}", "title": "" }, { "docid": "767d2538c222f1cefe3bad25da34051f", "score": "0.5248875", "text": "buildFaceMeshGeometry(scaledMesh, part) {\n const geom = new Geometry();\n let vCnt = 0;\n geom.uvsNeedUpdate = true;\n part.forEach((e) => {\n const vectorA = new Vector3(\n ((this.facemeshResolution.width - scaledMesh[e[0]][0]) / this.facemeshResolution.width) * 2 - 1,\n ((this.facemeshResolution.height - scaledMesh[e[0]][1]) / this.facemeshResolution.height) * 2 - 1,\n -scaledMesh[e[0]][2] / this.facemeshResolution.height + 5\n );\n const vectorB = new Vector3(\n ((this.facemeshResolution.width - scaledMesh[e[1]][0]) / this.facemeshResolution.width) * 2 - 1,\n ((this.facemeshResolution.height - scaledMesh[e[1]][1]) / this.facemeshResolution.height) * 2 - 1,\n -scaledMesh[e[1]][2] / this.facemeshResolution.height + 5\n );\n const vectorC = new Vector3(\n ((this.facemeshResolution.width - scaledMesh[e[2]][0]) / this.facemeshResolution.width) * 2 - 1,\n ((this.facemeshResolution.height - scaledMesh[e[2]][1]) / this.facemeshResolution.height) * 2 - 1,\n -scaledMesh[e[2]][2] / this.facemeshResolution.height + 5\n );\n geom.vertices.push(vectorA);\n geom.vertices.push(vectorB);\n geom.vertices.push(vectorC);\n geom.faces.push(new Face3(vCnt + 0, vCnt + 1, vCnt + 2));\n geom.faceVertexUvs[0][vCnt / 3] = [\n new Vector2(Coord[e[0]].x, Coord[e[0]].y),\n new Vector2(Coord[e[1]].x, Coord[e[1]].y),\n new Vector2(Coord[e[2]].x, Coord[e[2]].y),\n ];\n vCnt += 3;\n });\n geom.computeFaceNormals();\n return geom;\n }", "title": "" }, { "docid": "fb2500b9331c31544045f6b04ccf475d", "score": "0.51978606", "text": "mergeVertices(precisionPoints = 4) {\n const verticesMap = {};\n const unique = [], changes = [];\n const precision = Math.pow(10, precisionPoints);\n for (let i4 = 0, il = this.vertices.length; i4 < il; i4++) {\n const v4 = this.vertices[i4];\n const key = `${Math.round(v4.x * precision)}_${Math.round(v4.y * precision)}_${Math.round(v4.z * precision)}`;\n if (verticesMap[key] === void 0) {\n verticesMap[key] = i4;\n unique.push(this.vertices[i4]);\n changes[i4] = unique.length - 1;\n } else {\n changes[i4] = changes[verticesMap[key]];\n }\n }\n const faceIndicesToRemove = [];\n for (let i4 = 0, il = this.faces.length; i4 < il; i4++) {\n const face = this.faces[i4];\n face.a = changes[face.a];\n face.b = changes[face.b];\n face.c = changes[face.c];\n const indices = [face.a, face.b, face.c];\n for (let n2 = 0; n2 < 3; n2++) {\n if (indices[n2] === indices[(n2 + 1) % 3]) {\n faceIndicesToRemove.push(i4);\n break;\n }\n }\n }\n for (let i4 = faceIndicesToRemove.length - 1; i4 >= 0; i4--) {\n const idx = faceIndicesToRemove[i4];\n this.faces.splice(idx, 1);\n for (let j2 = 0, jl2 = this.faceVertexUvs.length; j2 < jl2; j2++) {\n this.faceVertexUvs[j2].splice(idx, 1);\n }\n }\n const diff = this.vertices.length - unique.length;\n this.vertices = unique;\n return diff;\n }", "title": "" }, { "docid": "89e51de9573310bb549f542aa43edf8f", "score": "0.5181364", "text": "function splitFaceIntoFaces(face, vertices, o, linegeo) {\n\t// vertex indices\n\tvar i0 = face.a;\n\tvar i1 = face.b;\n\tvar i2 = face.c;\n\n\t// intersection points\n\tvar vA = o.sideA.intersection;\n\tvar vB = o.sideB.intersection;\n\tvar vC = o.sideC.intersection;\n\n\tvar iA, iB, iC;\n\tvar nA, nB, nC;\n\n\t// insert new intersection points, compute new vertex normals\n\tif(vA) {\n\t\tvertices.push(vA);\n\t\tiA = vertices.length - 1;\n\t\tnA = interpolateVectors(face.vertexNormals[0], face.vertexNormals[1], o.sideA.t);\n\t\tlinegeo.vertices.push(vA);\n\t}\n\tif(vB) {\n\t\tvertices.push(vB);\n\t\tiB = vertices.length - 1;\n\t\tnB = interpolateVectors(face.vertexNormals[1], face.vertexNormals[2], o.sideB.t);\n\t\tlinegeo.vertices.push(vB);\n\t}\n\tif(vC) {\n\t\tvertices.push(vC);\n\t\tiC = vertices.length - 1;\n\t\tnC = interpolateVectors(face.vertexNormals[2], face.vertexNormals[0], o.sideC.t);\n\t\tlinegeo.vertices.push(vC);\n\t}\n\n\tvar fa, fb;\n\n\t// create new faces\n\tif(iA && iB) {\n\t\tface.a = i1; face.b = iB; face.c = iA;\n\n\t\tfa = new THREE.Face3(i0, iA, iB, face.normal, face.color, 0);\n\t\tfb = new THREE.Face3(i0, iB, i2, face.normal, face.color, 0);\n\n\t\tfa.vertexNormals = [face.vertexNormals[0], nA, nB];\n\t\tfb.vertexNormals = [face.vertexNormals[0], nB, face.vertexNormals[2]];\n\t\tface.vertexNormals = [face.vertexNormals[1], nB, nA];\n\t}\n\telse if(iB && iC) {\n\t\tface.a = i2; face.b = iC; face.c = iB;\n\n\t\tfa = new THREE.Face3(i1, iB, iC, face.normal, face.color, 0);\n\t\tfb = new THREE.Face3(i0, i1, iC, face.normal, face.color, 0);\n\n\t\tfa.vertexNormals = [face.vertexNormals[1], nB, nC];\n\t\tfb.vertexNormals = [face.vertexNormals[0], face.vertexNormals[1], nC];\n\t\tface.vertexNormals = [face.vertexNormals[2], nC, nB];\n\t}\n\telse if(iA && iC) {\n\t\tface.a = i0; face.b = iA; face.c = iC;\n\n\t\tfa = new THREE.Face3(i2, iC, iA, face.normal, face.color, 0);\n\t\tfb = new THREE.Face3(iA, i1, i2, face.normal, face.color, 0);\n\n\t\tfa.vertexNormals = [face.vertexNormals[2], nC, nA];\n\t\tfb.vertexNormals = [nA, face.vertexNormals[1], face.vertexNormals[2]];\n\t\tface.vertexNormals = [face.vertexNormals[0], nA, nC];\n\t}\n\n\treturn [face, fa, fb];\n}", "title": "" }, { "docid": "f85de4cb3756ed8bec34ca593c9f103a", "score": "0.5178066", "text": "function createCustomFaceGeometry(lBorderPoints, rBorderPoints) {\n\n\tif (lBorderPoints.length == 0 || rBorderPoints.length == 0) return;\n\n\tvar geometry = new THREE.BufferGeometry();\n\tvar vertices = [];\n\tvar uvs = [];\n\tvar index = [];\n\n\tvertices = vertices.concat([rBorderPoints[0].x, rBorderPoints[0].y, rBorderPoints[0].z]);\n\tvertices = vertices.concat([lBorderPoints[0].x, lBorderPoints[0].y, lBorderPoints[0].z]);\n\n\tuvs = uvs.concat(1, 0)\n\tuvs = uvs.concat(0, 0)\n\n\t// start from iBorder's first point, each loop draw 2 triangles representing the quadralateral iBorderP[i], iBorderP[i+1], oBorder[i+1], oBorder[i] \n\tfor (var i = 0; i < Math.min(lBorderPoints.length, rBorderPoints.length) - 1; i++) {\n\t\t//vertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\t//vertices = vertices.concat([rBorderPoints[i + 1].x, rBorderPoints[i + 1].y, rBorderPoints[i + 1].z]);\n\t\t//vertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\n\t\t//vertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\t//vertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\t\t//vertices = vertices.concat([lBorderPoints[i].x, lBorderPoints[i].y, lBorderPoints[i].z]);\n\t}\n\n\tfor (var i = 0; i < Math.min(lBorderPoints.length, rBorderPoints.length) - 1; i++) {\n\t\tvertices = vertices.concat([rBorderPoints[i + 1].x, rBorderPoints[i + 1].y, rBorderPoints[i + 1].z]);\n\t\tvertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\n\t\tindex = index.concat([2 * i, 2 * i + 2, 2 * i + 3, 2 * i, 2 * i + 3, 2 * i + 1]);\n\n\t\tuvs = uvs.concat(1, (i + 1) / Math.max(lBorderPoints.length, rBorderPoints.length))\n\t\tuvs = uvs.concat(0, (i + 1) / Math.max(lBorderPoints.length, rBorderPoints.length))\n\t}\n\n\tif (lBorderPoints.length < rBorderPoints.length) {\n\n\t\tvar lPoint = lBorderPoints[lBorderPoints.length - 1];\n\n\t\tfor (var i = lBorderPoints.length - 1; i < rBorderPoints.length - 1; i++) {\n\t\t\t//vertices = vertices.concat([lPoint.x, lPoint.y, lPoint.z]);\n\t\t\t//vertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\t\t//vertices = vertices.concat([rBorderPoints[i + 1].x, rBorderPoints[i + 1].y, rBorderPoints[i + 1].z]);\n\t\t}\n\n\t\tvar lIndex = lBorderPoints.length * 2 - 1;\n\t\tfor (var i = 0; i < rBorderPoints.length - lBorderPoints.length; i++) {\n\t\t\tvertices = vertices.concat([rBorderPoints[lBorderPoints.length + i].x, rBorderPoints[lBorderPoints.length + i].y, rBorderPoints[lBorderPoints.length + i].z]);\n\t\t\tindex = index.concat([lIndex, lIndex - 1, lIndex + i + 1]);\n\n\t\t\tuvs = uvs.concat(1, (lBorderPoints.length + i) / Math.max(lBorderPoints.length, rBorderPoints.length))\n\t\t}\n\t}\n\n\tif (lBorderPoints.length > rBorderPoints.length) {\n\n\t\tvar rPoint = rBorderPoints[rBorderPoints.length - 1];\n\t\t\n\t\tfor (var i = rBorderPoints.length - 1; i < lBorderPoints.length - 1; i++) {\n\t\t\t//vertices = vertices.concat([rPoint.x, rPoint.y, rPoint.z]);\n\t\t\t//vertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\t\t\t//vertices = vertices.concat([lBorderPoints[i].x, lBorderPoints[i].y, lBorderPoints[i].z]);\n\t\t}\n\n\t\tvar rIndex = rBorderPoints.length * 2 - 2;\n\t\tfor (var i = 0; i < lBorderPoints.length - rBorderPoints.length; i++) {\n\t\t\tvertices = vertices.concat([lBorderPoints[rBorderPoints.length + i].x, lBorderPoints[rBorderPoints.length + i].y, lBorderPoints[rBorderPoints.length + i].z]);\n\t\t\tindex = index.concat([rIndex, rIndex + 1 + i + 1, rIndex + 1 + i]);\n\n\t\t\tuvs = uvs.concat(1, (rBorderPoints.length + i) / Math.max(lBorderPoints.length, rBorderPoints.length))\n\t\t}\n\t}\n\n\tvertices = Float32Array.from(vertices);\n\tuvs = Float32Array.from(uvs);\n\tindex = Uint32Array.from(index);\n\t// itemSize = 3 becuase there are 3 values (components) per vertex\n\tgeometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3));\n\tgeometry.addAttribute('uv', new THREE.BufferAttribute(uvs, 2));\n\tgeometry.setIndex(new THREE.BufferAttribute(index, 1));\n\t// geometry.computeVertexNormals();\n\n\treturn geometry;\n}", "title": "" }, { "docid": "823d3fff7f5eadf164031af273feaf7f", "score": "0.516628", "text": "function rotateFace(direction, currentArray)\n{\n /* Reading the array of the boundary colours\n \n Extraction pattern:\n Original face of currentArray:\n 1 2 3\n 4 5 6\n 7 8 9\n\n Then swapper stores in the following order:\n 7, 4, 1, 2, 3, 6, 9, 8\n Anticlockwise read from bottom right.\n */\n\n // Reading the boundary elements as given above\n swapper1 = [];\n for(i = 0; i < cubeSize; i++)\n {\n swapper1.push(currentArray[i][0]);\n }\n for(i = 1; i < cubeSize; i++)\n {\n swapper1.push(currentArray[cubeSize-1][i]);\n }\n for(i = 1; i < cubeSize ; i++)\n {\n swapper1.push(currentArray[cubeSize-i-1][cubeSize-1]);\n }\n for(i = 1; i < cubeSize-1; i++)\n {\n swapper1.push(currentArray[0][cubeSize-i-1]);\n }\n\n // Performing actions on the array depending on the direction of operation\n if(direction == 1)\n { \n //Manually without using push/unshift and splice\n for(j = 0;j < cubeSize - 1; j++)\n { temp = swapper1[0];\n for(i = 0; i< cubeSize*cubeSize-1 ; i++)\n {\n swapper1[i] = swapper1[i+1];\n }\n swapper1[swapper1.length-1] = temp;\n }\n }\n else if(direction == -1)\n { \n for( i = 0; i < cubeSize -1; i++)\n {\n temp = swapper1.splice(swapper1.length-1,1);\n swapper1.unshift(temp);\n }\n \n }\n else if(direction == 2)\n {\n swapper1.reverse();\n for( i = 0; i < cubeSize -1; i++)\n {\n temp = swapper1.splice(swapper1.length-1,1);\n swapper1.unshift(temp);\n }\n swapper1.reverse();\n }\n else if(direction == -2)\n {\n for( i = 0; i < cubeSize -1; i++)\n {\n temp = swapper1.splice(swapper1.length-1,1);\n swapper1.unshift(temp);\n }\n }\n else if(direction == 3)\n {\n for( i = 0; i < cubeSize -1; i++)\n {\n temp = swapper1.splice(swapper1.length-1,1);\n swapper1.unshift(temp);\n }\n }\n else if(direction == -3)\n {\n swapper1.reverse();\n for( i = 0; i < cubeSize -1; i++)\n {\n temp = swapper1.splice(swapper1.length-1,1);\n swapper1.unshift(temp);\n }\n swapper1.reverse();\n }\n else if(direction == 4)\n {\n for( i = 0; i < cubeSize -1; i++)\n {\n temp = swapper1.splice(swapper1.length-1,1);\n swapper1.unshift(temp);\n }\n }\n else if(direction == -4)\n {\n swapper1.reverse();\n for( i = 0; i < cubeSize -1; i++)\n {\n temp = swapper1.splice(swapper1.length-1,1);\n swapper1.unshift(temp);\n }\n swapper1.reverse();\n }\n\n //Writing back elements to the currentArray in the required order as given above\n for(i = 0; i < cubeSize ; i++)\n {\n currentArray[i][0] = swapper1.splice(0,1);\n }\n for(i = 1; i < cubeSize; i++)\n {\n currentArray[cubeSize-1][i] = swapper1.splice(0,1);\n }\n for(i = 1; i < cubeSize-1 ; i++)\n {\n currentArray[cubeSize-i-1][cubeSize-1] = swapper1.splice(0,1);\n }\n \n for(i = 0; i < cubeSize-1; i++)\n {\n currentArray[0][cubeSize - 1 -i] = swapper1.splice(0,1);\n }\n return currentArray;\n}", "title": "" }, { "docid": "ca3fd15f2dc16ee90f700df2f6e9fbc9", "score": "0.5164536", "text": "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "ca3fd15f2dc16ee90f700df2f6e9fbc9", "score": "0.5164536", "text": "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "ca3fd15f2dc16ee90f700df2f6e9fbc9", "score": "0.5164536", "text": "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "ca3fd15f2dc16ee90f700df2f6e9fbc9", "score": "0.5164536", "text": "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "0c0806df8739e5db2547e28ee955de7e", "score": "0.516007", "text": "function buildSideFaces() {\n\t\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\t\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\t\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\t\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\t\n\t\t\t\t}\n\t\n\t\t\t}", "title": "" }, { "docid": "0c0806df8739e5db2547e28ee955de7e", "score": "0.516007", "text": "function buildSideFaces() {\n\t\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\t\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\t\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\t\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\t\n\t\t\t\t}\n\t\n\t\t\t}", "title": "" }, { "docid": "1a8e38dc798ddd959977e49bacc3f781", "score": "0.5158374", "text": "function drawEdge(edge, paper){\n\t\tvar a = edge.a;\n\t\tvar b = edge.b;\n\n\t\tvar curve = getPath(edge) //get the curve's path\n\t\tvar normal = getUnitNormal(edge)\n\t\tvar e = paper.path(curve).attr({'stroke-width':5})\n\t\t.transform(\"...t\"+(1*normal[0])+\",\"+(1*normal[1]))\n\t\t.insertBefore(nodeDivider);//put behind the islands\n\t\t\n\t\tvar e2 = paper.path(curve).attr({'stroke-width':5})\n\t\t\t.transform(\"...t\"+(-1*normal[0])+\",\"+(-1*normal[1]))\n\t\t\t.insertBefore(e)\n\t\t\t\n\t\t// var stipple = paper.path(getThickPath(edge,5))\n\t\t// \t.attr({'stroke-opacity':0,'fill':'url(/images/game/bridgepattern.png)','fill-opacity':0.2})\n\t\t// \t.insertAfter(e)\n\t\t\n\t\tvar arrow = drawArrow(edge, curve, paper, 2.5)\n\t\tarrow[0].attr({'stroke-linejoin':'round','stroke-opacity':0}).insertAfter(e2)\n\t\tarrow[1].insertAfter(e)\n\n\t\t//set attributes based on relationship type (bitcheck with constants)\n\t\tif(edge.reltype&INCREASES){\n\t\t\te.attr({stroke:EDGE_COLORS['increases']})\n\t\t\te2.attr({stroke:EDGE_HIGHLIGHT_COLORS['increases']})\n\t\t\tarrow[0].attr({fill:EDGE_HIGHLIGHT_COLORS['increases']})\n\t\t}\n\t\telse if(edge.reltype&SUPERSET){\n\t\t\te.attr({stroke:EDGE_COLORS['superset']})\n\t\t\te2.attr({stroke:EDGE_HIGHLIGHT_COLORS['superset']})\n\t\t\tarrow[0].attr({fill:EDGE_HIGHLIGHT_COLORS['superset']})\n\t\t}\n\t\telse{ //if decreases\n\t\t\te.attr({stroke:EDGE_COLORS['decreases']})\n\t\t\te2.attr({stroke:EDGE_HIGHLIGHT_COLORS['decreases']})\n\t\t\tarrow[0].attr({fill:EDGE_HIGHLIGHT_COLORS['decreases']})\n\t\t}\n\n\t\tvar center = getPathCenter(curve,-2)\n\t\tvar selector = paper.circle(center.x,center.y,10).attr({'fill':'#00ff00', 'opacity':0.0, 'stroke-width':0})\n\t\t// $(selector.node).qtip(edge_selector_qtip(edge))\n\t\tselector.dblclick(function() {toggleEdge(edge);})\n\t\t.mouseover(function() {this.node.style.cursor='pointer';})\n\t\t// $(selector.node).on(\"contextmenu\", function(e){destroyEdge(edge);e.preventDefault();});\n\t\t$(selector.node).on(\"contextmenu\", function(e){confirmDestroy(edge);e.preventDefault();});\n\t\t$(selector.node).qtip(help_qtip('Double-click to change direction<br>Right-click to delete'));\n\t\tif(edge.id >= 0) //only if edge exists\n\t\t\t$([e.node, e2.node/*, stipple.node*/]).qtip(edge_qtip(edge))\n\t\tvar icon = paper.set() //for storing pieces of the line as needed\n\t\t\t.push(e, e2, arrow[0], arrow[1], selector);/*, stipple)*/\n\n\t\treturn icon;\n}", "title": "" }, { "docid": "dc7ea0c8ae48077a169df9df1d260333", "score": "0.5155838", "text": "function addAxesPlanes() {\r\n\r\n //==|| Draw the Three Planes\r\n drawYZ_Plane();\r\n drawXZ_Plane();\r\n drawXY_Plane();\r\n\r\n //==|| Draw the arrow pointing to the North\r\n drawArrowNorth();\r\n\r\n\r\n \r\n\r\n //==|| Add the well path in the main object\r\n WELLVIS.theMainObject.add(WELLVIS.theWellPath);\r\n\r\n //==|| Add the main object to the Scene\r\n WELLVIS.theScene.add(WELLVIS.theMainObject);\r\n\r\n}", "title": "" }, { "docid": "3f065a1b9a3bdb79e678a14bf7f11dec", "score": "0.5155752", "text": "removeAllVerticesFromFace(face) {\n if (face.outside !== null) {\n const start2 = face.outside;\n let end = face.outside;\n while (end.next !== null && end.next.face === face) {\n end = end.next;\n }\n this.assigned.removeSubList(start2, end);\n start2.prev = end.next = null;\n face.outside = null;\n return start2;\n }\n }", "title": "" }, { "docid": "e811b1376cc6371f8cf9a60354a29233", "score": "0.51461786", "text": "function buildSideFaces() {\n\t\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\t\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\t\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\t\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\t\n\t\t\t}\n\t\n\t\t}", "title": "" }, { "docid": "e811b1376cc6371f8cf9a60354a29233", "score": "0.51461786", "text": "function buildSideFaces() {\n\t\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\t\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\t\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\t\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\t\n\t\t\t}\n\t\n\t\t}", "title": "" } ]
09992b1a2cf42de9653016f0b9b7d378
define selectors using getter methods
[ { "docid": "e1a460b60bfc7a0a068e7265183050e0", "score": "0.0", "text": "get inputSearchBox() {return $(\"//div/input[placeholder='Quick Find']\")}", "title": "" } ]
[ { "docid": "070f9756463428e8c2eeefc8c46840f7", "score": "0.69060665", "text": "get selector() {\n return this._selector;\n }", "title": "" }, { "docid": "8d01ca607ebd8ff5895e8292fe4a02ec", "score": "0.67229784", "text": "get selectors () {\n return _.extend(super.selectors, {\n active: '.active',\n })\n }", "title": "" }, { "docid": "4b6c46f8f8886f55c76740945c7d1551", "score": "0.65743524", "text": "_initSelectors () {\n this.toggleAttribute = 'data-rvt-disclosure-toggle'\n this.targetAttribute = 'data-rvt-disclosure-target'\n\n this.toggleSelector = `[${this.toggleAttribute}]`\n this.targetSelector = `[${this.targetAttribute}]`\n }", "title": "" }, { "docid": "af7eac39d5332537759edc8f7bf660d9", "score": "0.6457763", "text": "find(_sel) {\n // TODO: how is this different from selector?\n return this.node.find(_sel).get().map((el)=>{\n return this._node(el);\n });\n }", "title": "" }, { "docid": "f2a04e0c0230f4c9106c7b12c62973a1", "score": "0.63338685", "text": "function querySelectorFunc(selector,classPrototype,methodOrAttributeName,index){null!==selector?\"number\"!=typeof index?addToObjectProps(classPrototype,\"querySelectors\",{attributeName:methodOrAttributeName,querySelector:selector}):console.error(\"ag-Grid: QuerySelector should be on an attribute\"):console.error(\"ag-Grid: QuerySelector selector should not be null\")}", "title": "" }, { "docid": "2b664b9aaa38d7f486991c782e455ee0", "score": "0.6312137", "text": "_getSelectorMap () {\n return {\n dropdown: {\n option: this.options.dropdownClass,\n selector: 'select',\n tag: 'select'\n },\n checkbox: {\n option: this.options.checkboxClass,\n tag: 'input',\n types: ['checkbox']\n },\n input: {\n option: this.options.inputFieldClass,\n tag: 'input',\n types: [\n 'password', 'email', 'number', 'text', 'date',\n 'datetime', 'month', 'search', 'range', 'time',\n 'week', 'tel', 'color', 'datetime-local'\n ]\n },\n radio: {\n option: this.options.radioClass,\n tag: 'input',\n types: ['radio']\n },\n textarea: {\n option: this.options.textAreaClass,\n tag: 'textarea'\n }\n }\n }", "title": "" }, { "docid": "833c39c53dc38b5bb268a0748f8e31db", "score": "0.62691367", "text": "selector() { // eslint-disable-line class-methods-use-this\n throw new Error('not implemented');\n }", "title": "" }, { "docid": "c9b1012ac5c60995eedf2c5bc9a7c9c8", "score": "0.6169393", "text": "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}", "title": "" }, { "docid": "c9b1012ac5c60995eedf2c5bc9a7c9c8", "score": "0.6169393", "text": "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}", "title": "" }, { "docid": "c9b1012ac5c60995eedf2c5bc9a7c9c8", "score": "0.6169393", "text": "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}", "title": "" }, { "docid": "c0225e48bc761eb60819942885975403", "score": "0.61247754", "text": "getElementsBySelector(selector) {\n const ele = this.element ? this.element : this.element;\n return ele.querySelectorAll(`.${selector}`);\n }", "title": "" }, { "docid": "1c5891f827b379b079e5c5283d8c5306", "score": "0.6091226", "text": "select$(selectorDef, args) {\n const key = this.makeKey(selectorDef.key, args);\n const cachedObs = this._selectorsMap.get(key);\n if (cachedObs) {\n return cachedObs;\n }\n if (args) {\n const newObs = this._stateHolder$.pipe(map((state) => selectorDef.selector(state, args)), this.processPipe());\n this._selectorsMap.set(key, newObs);\n return newObs;\n }\n const selectorWithoutArgs = selectorDef.selector;\n const newObs = this._stateHolder$.pipe(map((state) => selectorWithoutArgs(state)), this.processPipe());\n this._selectorsMap.set(key, newObs);\n return newObs;\n }", "title": "" }, { "docid": "531b8aace193729f8343293522ab1815", "score": "0.6083671", "text": "function SelectorSet() {\n // Construct new SelectorSet if called as a function.\n if (!(this instanceof SelectorSet)) {\n return new SelectorSet();\n }\n\n // Public: Number of selectors added to the set\n this.size = 0;\n\n // Internal: Incrementing ID counter\n this.uid = 0;\n\n // Internal: Array of String selectors in the set\n this.selectors = [];\n\n // Internal: All Object index String names mapping to Index objects.\n this.indexes = Object.create(this.indexes);\n\n // Internal: Used Object index String names mapping to Index objects.\n this.activeIndexes = [];\n}", "title": "" }, { "docid": "9180d901b3f1b5c8da6d3c040fbf41be", "score": "0.60083294", "text": "function getAllActiveSelectors(){\r\n\t\r\n}", "title": "" }, { "docid": "68be4bb2c17c77ec304358ae3cd6d788", "score": "0.5994617", "text": "static get is(){return'array-selector';}", "title": "" }, { "docid": "d8f6576d15cd1aaeb93fbdfe2bd6771a", "score": "0.5993788", "text": "_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 }", "title": "" }, { "docid": "d8f6576d15cd1aaeb93fbdfe2bd6771a", "score": "0.5993788", "text": "_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 }", "title": "" }, { "docid": "eccc2cfe24aeaf46579d2b0e37ddecf2", "score": "0.59823465", "text": "getElement() {\n return this.selector('#' + this.id);\n }", "title": "" }, { "docid": "daf3d3cff859d03a90a9cdac04d8423b", "score": "0.59070885", "text": "select(...selectors) {\n const path = selectors.join(',');\n if (this.selectorMap[path] === void 0) {\n this.selectorMap[path] = new style_1.Style();\n }\n return this.selectorMap[path];\n }", "title": "" }, { "docid": "4b304e0cb17baa49d70480bb80832f16", "score": "0.58830595", "text": "function handleSelectors(apis) {\n return mapValues(apis, function (_, name) {\n return {\n getData: function getData(state) {\n return state[name].data;\n },\n getLastUpdated: function getLastUpdated(state) {\n return state[name].lastUpdated;\n },\n getError: function getError(state) {\n return state[name].error;\n },\n isFetching: function isFetching(state) {\n return state[name].isFetching;\n },\n isError: function isError(state) {\n return !!state[name].error;\n }\n };\n });\n}", "title": "" }, { "docid": "056ab6f31bf22b9160acfbc89d5aa897", "score": "0.58781403", "text": "_initializeSelector() {\n for (const transformation of this._selectorTransformations) {\n const transformedSelector = _.isFunction(transformation) ?\n transformation(this._selector, this.bemBase) :\n this._transformSelector(transformation);\n\n // TODO How to check more reliably?\n if (!transformedSelector) {\n throw new TypeError(\n `${this.displayName}: selector transformation must return new ` +\n `selector but it return ${typeOf(transformedSelector)} ` +\n `(${transformedSelector})`\n );\n }\n\n this._selector = transformedSelector;\n }\n\n this._selectorInitialized = true;\n }", "title": "" }, { "docid": "62aabe052f251e12e804b863a46b48ce", "score": "0.5862285", "text": "function selector(selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW$1;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n }", "title": "" }, { "docid": "dca332017852b96cd674c4ee16b54ae1", "score": "0.5809065", "text": "_getFindSelector(args) {\n if (args.length == 0) return {};else return args[0];\n }", "title": "" }, { "docid": "c6302d5001795528796806f1777ca408", "score": "0.57948834", "text": "constructor () {\n this[_config] = Config.get('selector');\n }", "title": "" }, { "docid": "c19a2bd86dc7bf60e1d2cb585eb98449", "score": "0.5768055", "text": "function initSelectors() {\n // next 2 statements should generate error message, see console\n MAIN.createRelatedSelector();\n MAIN.createRelatedSelector\n (document.querySelector('#areaselect1'));\n\n //countries\n MAIN.createRelatedSelector\n (document.querySelector('#areaselect1') // from select element\n , document.querySelector('#areaselect2') // to select element\n , area2\n , function (a, b) { return a > b ? 1 : a < b ? -1 : 0; } // sort method\n );\n\n}", "title": "" }, { "docid": "5775b0bb88b268742680e1dcb792aec0", "score": "0.5766275", "text": "function EventSelector() {}", "title": "" }, { "docid": "f13f1b8d9ece25cbeb14381105e3cf3c", "score": "0.57318956", "text": "function CLC_CreateSelectorsMember(selector_string){\r\n var rawSelectors = CLC_SplitSelectors(selector_string);\r\n var parsedSelectors = new Array();\r\n for (var k = 0; k < rawSelectors.length; k++){\r\n var selector_rule = new Array();\r\n var raw_selector_rule = CLC_DecomposeCompoundSelector(rawSelectors[k]); \r\n for (var j = 0; j < raw_selector_rule.length; j++){ \r\n var temparray = CLC_ParseSimpleSelector(raw_selector_rule[j]);\r\n selector_rule.push(temparray);\r\n }\r\n parsedSelectors.push(selector_rule);\r\n }\r\n return parsedSelectors;\r\n }", "title": "" }, { "docid": "c42bcf7806c5d51c6bf6b17094f71f16", "score": "0.5731252", "text": "gets(identifier){\r\n\r\n return document.querySelectorAll(identifier);\r\n\r\n }", "title": "" }, { "docid": "4b1a04df86aab92742acf621c61666fe", "score": "0.5724127", "text": "_compileSelector(selector) {\n // you can pass a literal function instead of a selector\n if (selector instanceof Function) {\n this._isSimple = false;\n this._selector = selector;\n\n this._recordPathUsed('');\n\n return doc => ({\n result: !!selector.call(doc)\n });\n } // shorthand -- scalar _id\n\n\n if (LocalCollection._selectorIsId(selector)) {\n this._selector = {\n _id: selector\n };\n\n this._recordPathUsed('_id');\n\n return doc => ({\n result: EJSON.equals(doc._id, selector)\n });\n } // protect against dangerous selectors. falsey and {_id: falsey} are both\n // likely programmer error, and not what you want, particularly for\n // destructive operations.\n\n\n if (!selector || hasOwn.call(selector, '_id') && !selector._id) {\n this._isSimple = false;\n return nothingMatcher;\n } // Top level can't be an array or true or binary.\n\n\n if (Array.isArray(selector) || EJSON.isBinary(selector) || typeof selector === 'boolean') {\n throw new Error(\"Invalid selector: \".concat(selector));\n }\n\n this._selector = EJSON.clone(selector);\n return compileDocumentSelector(selector, this, {\n isRoot: true\n });\n }", "title": "" }, { "docid": "115ae19efab442df7f7cac6f598665df", "score": "0.5658169", "text": "function initSelector(elm, soname, soinit, req)\n {\n return initSelectorExt(\n elm, soname, soinit, constempty, getElementText, {}, 0, req) ;\n }", "title": "" }, { "docid": "fa9d9023b94c0201bb8295f8bed57c26", "score": "0.5655656", "text": "function selectorize(value) {\n return isComposition(value) ? value.selector : value;\n }", "title": "" }, { "docid": "bd1ff07c660d501e893889f427df2494", "score": "0.56505007", "text": "function selectorize(value) {\n return isComposition(value) ? value.selector : value;\n}", "title": "" }, { "docid": "bd1ff07c660d501e893889f427df2494", "score": "0.56505007", "text": "function selectorize(value) {\n return isComposition(value) ? value.selector : value;\n}", "title": "" }, { "docid": "bd1ff07c660d501e893889f427df2494", "score": "0.56505007", "text": "function selectorize(value) {\n return isComposition(value) ? value.selector : value;\n}", "title": "" }, { "docid": "bd1ff07c660d501e893889f427df2494", "score": "0.56505007", "text": "function selectorize(value) {\n return isComposition(value) ? value.selector : value;\n}", "title": "" }, { "docid": "3a55cabf77beba010b9a0c13015e8f0b", "score": "0.563831", "text": "function addInternalSelectors(){\r\n //adding internal class names to void problem with common ones\r\n $(options.sectionSelector).each(function(){\r\n $(this).addClass(SECTION);\r\n });\r\n $(options.slideSelector).each(function(){\r\n $(this).addClass(SLIDE);\r\n });\r\n }", "title": "" }, { "docid": "7393cdbd63e244920f53f239b4b2024b", "score": "0.5635794", "text": "function selector(a){\n\ta=a.match(/^(\\W)?(.*)/);var b=document[\"getElement\"+(a[1]?a[1]==\"#\"?\"ById\":\"sByClassName\":\"sByTagName\")](a[2]);\n\tvar ret=[];\tb!==null&&(b.length?ret=b:b.length===0?ret=b:ret=[b]);\treturn ret;\n}", "title": "" }, { "docid": "7393cdbd63e244920f53f239b4b2024b", "score": "0.5635794", "text": "function selector(a){\n\ta=a.match(/^(\\W)?(.*)/);var b=document[\"getElement\"+(a[1]?a[1]==\"#\"?\"ById\":\"sByClassName\":\"sByTagName\")](a[2]);\n\tvar ret=[];\tb!==null&&(b.length?ret=b:b.length===0?ret=b:ret=[b]);\treturn ret;\n}", "title": "" }, { "docid": "df477f3ef7f61720612aa9483e2d6782", "score": "0.5631976", "text": "render() {\n const {type, values} = calculateType(this.props.type);\n const Selector = this.getSelector(type, values);\n return (<Selector {...this.props} values={values}/>);\n }", "title": "" }, { "docid": "8e9b003e62019f1da8a13bcc94690652", "score": "0.56292266", "text": "function selector( a ) {\n\t\ta = a.match( /^(\\W)?(.*)/ );\n\t\tvar b = document[\"getElement\" + (a[1] ? a[1] == \"#\" ? \"ById\" : \"sByClassName\" : \"sByTagName\")]( a[2] );\n\t\tvar ret = [];\n\t\tb != null && (b.length ? ret = b : b.length == 0 ? ret = b : ret = [b]);\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "3da66425670c437f9f522f040801e069", "score": "0.5618534", "text": "function addInternalSelectors(){\n //adding internal class names to void problem with common ones\n $(options.sectionSelector).each(function(){\n $(this).addClass(SECTION);\n });\n $(options.slideSelector).each(function(){\n $(this).addClass(SLIDE);\n });\n }", "title": "" }, { "docid": "dd044dfb3c229ab966199d0e766dce37", "score": "0.5604887", "text": "get blockSelectors() {\n return \"a\";\n }", "title": "" }, { "docid": "6509d09067b958a867526c3f9a5112bb", "score": "0.5602896", "text": "static selectionFromSelector(score, selector) {\n if (typeof(selector.pitches) !== 'undefined' && selector.pitches.length) {\n return SmoSelection.pitchSelection(score,\n selector.staff, selector.measure, selector.voice, selector.tick, selector.pitch);\n }\n if (typeof(selector.tick) === 'number') {\n return SmoSelection.noteFromSelector(score, selector);\n }\n return SmoSelection.measureSelection(score, selector.staff, selector.measure);\n }", "title": "" }, { "docid": "3ffc5598ca3b324eefa8b07ad0bb7d20", "score": "0.5588902", "text": "function CssSelectorParser() {\n\t\tthis.pseudos = {};\n\t\tthis.attrEqualityMods = {};\n\t\tthis.ruleNestingOperators = {};\n\t\tthis.substitutesEnabled = false;\n\t}", "title": "" }, { "docid": "97e42e11fa7f2634bfb7487e3bcd3947", "score": "0.5553802", "text": "htmlFromSelector(selector, traversal, innerText = \"\", atts) {\n if (selector.startsWith('#') || selector.startsWith('.')) selector = 'div' + selector;\n const arr = [\n [/#([\\w-]+)/, ` id=\"$1\"`],\n [/((\\.[\\w-]+)+)/, (_, c) => ` class=\"${c.split`.`.join` `.trim()}\"`],\n [/(\\[.+?\\])/g, (_, a) => \" \" + a.slice(1, -1)],\n [/([\\S]+)(.*)/, `<$1$2 ${atts}>${innerText}${traversal}</$1>`]\n ].map((replacement) => {\n const regex = replacement[0];\n const str = replacement[1];\n selector = selector.replace(regex, str);\n return selector;\n }\n )[3];\n return arr;\n }", "title": "" }, { "docid": "ad747464c9ed8a35191131513bc3689c", "score": "0.5552697", "text": "static get is() { return 'array-selector'; }", "title": "" }, { "docid": "ad747464c9ed8a35191131513bc3689c", "score": "0.5552697", "text": "static get is() { return 'array-selector'; }", "title": "" }, { "docid": "ad747464c9ed8a35191131513bc3689c", "score": "0.5552697", "text": "static get is() { return 'array-selector'; }", "title": "" }, { "docid": "f99b593cb3b1c87b527ca20091737ddc", "score": "0.55475223", "text": "function getSelectors(contract) {\n\tconst signatures = Object.keys(contract.interface.functions);\n\tconst selectors = signatures.reduce((acc, val) => {\n\t\tif (val !== \"init(bytes)\") {\n\t\t\tacc.push(contract.interface.getSighash(val));\n\t\t}\n\t\treturn acc;\n\t}, []);\n\tselectors.contract = contract;\n\tselectors.remove = remove;\n\tselectors.get = get;\n\treturn selectors;\n}", "title": "" }, { "docid": "8880f602a9e8e89452dd8dfb449de0d3", "score": "0.552642", "text": "function makeSelector(selector, transformFn) {\n if (!selector || !selector.length) {\n throw new Error('Invalid path specified: ' + selector);\n }\n\n return new Selector(selector, transformFn);\n}", "title": "" }, { "docid": "899ad45a704de99c1b19a038d7de1979", "score": "0.5515349", "text": "function genSelectState(selectors, workers) {\n\n if (\"function\" === typeof selectors) {\n return from_function(selectors, workers);\n } else {\n // throw new Error(\"'selectors' must be a function\")\n return from_function(function (state) {\n return Object.keys(selectors).reduce(function (output, propName) {\n return Object.assign(output, _defineProperty({}, propName, Array.isArray(selectors[propName]) ? selectors[propName].map(function (fn) {\n return fn(state);\n }) : selectors[propName](state)));\n }, {});\n }, workers);\n //return from_object(selectors,workers)\n }\n}", "title": "" }, { "docid": "8342d6fa5196d016d70d4b06050007f6", "score": "0.5507944", "text": "function selector(state) {\n return state;\n}", "title": "" }, { "docid": "4bb0ec32b7674843ca4d5eb5b4c48836", "score": "0.5495792", "text": "function parseSelector(selector) {\n var sel = selector.trim();\n var tagRegex = new RegExp(TAG, 'y');\n var tag = tagRegex.exec(sel)[0];\n var regex = new RegExp(TOKENS, 'y');\n regex.lastIndex = tagRegex.lastIndex;\n var matches = [];\n var nextSelector = undefined;\n var lastCombinator = undefined;\n var index = -1;\n while (regex.lastIndex < sel.length) {\n var match = regex.exec(sel);\n if (!match && lastCombinator === undefined) {\n throw new Error('Parse error, invalid selector');\n }\n else if (match && combinatorRegex.test(match[0])) {\n var comb = combinatorRegex.exec(match[0])[0];\n lastCombinator = comb;\n index = regex.lastIndex;\n }\n else {\n if (lastCombinator !== undefined) {\n nextSelector = [\n getCombinator(lastCombinator),\n parseSelector(sel.substring(index))\n ];\n break;\n }\n matches.push(match[0]);\n }\n }\n var classList = matches\n .filter(function (s) { return s.startsWith('.'); })\n .map(function (s) { return s.substring(1); });\n var ids = matches.filter(function (s) { return s.startsWith('#'); }).map(function (s) { return s.substring(1); });\n if (ids.length > 1) {\n throw new Error('Invalid selector, only one id is allowed');\n }\n var postprocessRegex = new RegExp(\"(\" + IDENT + \")\" + SPACE + \"(\" + OP + \")?\" + SPACE + \"(\" + VALUE + \")?\");\n var attrs = matches\n .filter(function (s) { return s.startsWith('['); })\n .map(function (s) { return postprocessRegex.exec(s).slice(1, 4); })\n .map(function (_a) {\n var attr = _a[0], op = _a[1], val = _a[2];\n return (_b = {},\n _b[attr] = [getOp(op), val ? parseAttrValue(val) : val],\n _b);\n var _b;\n })\n .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {});\n var pseudos = matches\n .filter(function (s) { return s.startsWith(':'); })\n .map(function (s) { return postProcessPseudos(s.substring(1)); });\n return {\n id: ids[0] || '',\n tag: tag,\n classList: classList,\n attributes: attrs,\n nextSelector: nextSelector,\n pseudos: pseudos\n };\n}", "title": "" }, { "docid": "bc98c2b0928ae3318ff4cf8cdbd61ec3", "score": "0.547918", "text": "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 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 = Object(__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\", \"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\n var useInternalProps = internalProps.mark === __WEBPACK_IMPORTED_MODULE_14__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var triggerRef = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var selectorRef = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var listRef = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var tokenWithEnter = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_18__hooks_useDelayReset__[\"a\" /* default */])(),\n _useDelayReset2 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(),\n _useState2 = Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState, 2),\n innerId = _useState2[0],\n setInnerId = _useState2[1];\n\n Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n setInnerId(\"rc_select_\".concat(Object(__WEBPACK_IMPORTED_MODULE_15__utils_commonUtil__[\"a\" /* 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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(false),\n _useState4 = Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState3, 2),\n mobile = _useState4[0],\n setMobile = _useState4[1];\n\n Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n // Only update on the client side\n setMobile(Object(__WEBPACK_IMPORTED_MODULE_8_rc_util_es_isMobile__[\"a\" /* default */])());\n }, []); // ============================== Ref ===============================\n\n var selectorDomRef = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_11_rc_util_es_hooks_useMergedState__[\"a\" /* default */])(defaultValue, {\n value: value\n }),\n _useMergedState2 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return Object(__WEBPACK_IMPORTED_MODULE_15__utils_commonUtil__[\"e\" /* toInnerValue */])(mergedValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [mergedValue, mergedLabelInValue]),\n _useMemo2 = Object(__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 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(null),\n _useState6 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(''),\n _useState8 = Object(__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 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]);\n var getValueOption = Object(__WEBPACK_IMPORTED_MODULE_23__hooks_useCacheOptions__[\"a\" /* default */])(mergedFlattenOptions); // Display options for OptionList\n\n var displayOptions = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return Object(__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 Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n Object(__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 = Object(__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 Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])(Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_22__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])([]),\n _useState10 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_15__utils_commonUtil__[\"f\" /* 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 = Object(__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, Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])(Object(__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, Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])(Object(__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' && 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 = Object(__WEBPACK_IMPORTED_MODULE_11_rc_util_es_hooks_useMergedState__[\"a\" /* default */])(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState4 = Object(__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 }; // 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 Object(__WEBPACK_IMPORTED_MODULE_21__hooks_useSelectTriggerControl__[\"a\" /* default */])(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 : Object(__WEBPACK_IMPORTED_MODULE_20__utils_valueUtil__[\"f\" /* 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(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(mergedRawValue), Object(__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(Object(__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 Object(__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 Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_17__hooks_useLock__[\"a\" /* default */])(),\n _useLock2 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_15__utils_commonUtil__[\"c\" /* 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 = Object(__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(Object(__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 Object(__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 _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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(0),\n _useState12 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(null),\n _useState14 = Object(__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 = Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])({}),\n _useState16 = Object(__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 Object(__WEBPACK_IMPORTED_MODULE_19__hooks_useLayoutEffect__[\"a\" /* default */])(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__*/__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_16__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_16__TransBtn__[\"a\" /* default */], {\n className: __WEBPACK_IMPORTED_MODULE_10_classnames___default()(\"\".concat(prefixCls, \"-arrow\"), Object(__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 (\"development\" !== 'production' && warningProps) {\n warningProps(props);\n } // ============================= Render =============================\n\n\n var mergedClassName = __WEBPACK_IMPORTED_MODULE_10_classnames___default()(prefixCls, className, (_classNames2 = {}, Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n var selectorNode = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_13__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 onPopupVisibleChange: onTriggerVisibleChange\n }, customizeRawInputElement ? /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"cloneElement\"](customizeRawInputElement, {\n ref: Object(__WEBPACK_IMPORTED_MODULE_9_rc_util_es_ref__[\"a\" /* composeRef */])(selectorDomRef, customizeRawInputElement.props.ref)\n }) : /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_12__Selector__[\"a\" /* default */], Object(__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 }))); // Render raw\n\n if (customizeRawInputElement) {\n return selectorNode;\n }\n\n return /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](\"div\", Object(__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(', '))), selectorNode, arrowNode, clearNode);\n }\n\n var RefSelect = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"forwardRef\"](Select);\n return RefSelect;\n}", "title": "" }, { "docid": "3ef7951c7eab4bc0b0c2c533b3099a6e", "score": "0.547918", "text": "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_5__.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_12__.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_6__.useRef)(null);\n var triggerRef = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)(null);\n var selectorRef = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)(null);\n var listRef = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)(null);\n var tokenWithEnter = (0,react__WEBPACK_IMPORTED_MODULE_6__.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_16__.default)(),\n _useDelayReset2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_6__.useState)(),\n _useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.default)(_useState, 2),\n innerId = _useState2[0],\n setInnerId = _useState2[1];\n\n (0,react__WEBPACK_IMPORTED_MODULE_6__.useEffect)(function () {\n setInnerId(\"rc_select_\".concat((0,_utils_commonUtil__WEBPACK_IMPORTED_MODULE_13__.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_6__.useRef)(null);\n react__WEBPACK_IMPORTED_MODULE_6__.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_9__.default)(defaultValue, {\n value: value\n }),\n _useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_6__.useMemo)(function () {\n return (0,_utils_commonUtil__WEBPACK_IMPORTED_MODULE_13__.toInnerValue)(mergedValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [mergedValue, mergedLabelInValue]),\n _useMemo2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_6__.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_6__.useState)(null),\n _useState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.default)(_useState3, 2),\n activeValue = _useState4[0],\n setActiveValue = _useState4[1];\n\n var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(''),\n _useState6 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_6__.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_6__.useMemo)(function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]);\n var getValueOption = (0,_hooks_useCacheOptions__WEBPACK_IMPORTED_MODULE_21__.default)(mergedFlattenOptions); // Display options for OptionList\n\n var displayOptions = (0,react__WEBPACK_IMPORTED_MODULE_6__.useMemo)(function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__.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_3__.default)(filteredOptions).sort(filterSort);\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode, mergedShowSearch, filterSort]);\n var displayFlattenOptions = (0,react__WEBPACK_IMPORTED_MODULE_6__.useMemo)(function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n (0,react__WEBPACK_IMPORTED_MODULE_6__.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_6__.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_2__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__.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_20__.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_6__.useState)([]),\n _useState8 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_13__.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_2__.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_2__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__.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_2__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__.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_9__.default)(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_19__.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_18__.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_3__.default)(mergedRawValue), (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__.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_3__.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_6__.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_6__.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_15__.default)(),\n _useLock2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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 === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.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 === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = (0,_utils_commonUtil__WEBPACK_IMPORTED_MODULE_13__.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_6__.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_3__.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_6__.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_6__.useState)(0),\n _useState10 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_6__.useState)(null),\n _useState12 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.default)(_useState11, 2),\n containerWidth = _useState12[0],\n setContainerWidth = _useState12[1];\n\n var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)({}),\n _useState14 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.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_17__.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_6__.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_6__.createElement(_TransBtn__WEBPACK_IMPORTED_MODULE_14__.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_6__.createElement(_TransBtn__WEBPACK_IMPORTED_MODULE_14__.default, {\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()(\"\".concat(prefixCls, \"-arrow\"), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.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_8___default()(prefixCls, className, (_classNames2 = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__.default)(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__.createElement(\"div\", (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.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__WEBPACK_IMPORTED_MODULE_6__.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_6__.createElement(_SelectTrigger__WEBPACK_IMPORTED_MODULE_11__.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_6__.createElement(_Selector__WEBPACK_IMPORTED_MODULE_10__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.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__*/react__WEBPACK_IMPORTED_MODULE_6__.forwardRef(Select);\n return RefSelect;\n}", "title": "" }, { "docid": "e56bae5bd1796acd4bc5696c8a5584a5", "score": "0.54695", "text": "function get(selector, context, results) {\r\n results = results || [];\r\n context = context || document; // 赋初值\r\n var match = rquickExpr.exec(selector);\r\n if (match) { // 如果不为null, 说明selector符合要求\r\n if (match[1]) results = getId(match[1], results); // id选择器\r\n else {\r\n // 统一类型 为array\r\n if (context.nodeType) context = [context]; // 如果为dom结点,就其转换成数组\r\n // 如果为字符串,就当做选择器,并获取相应dom元素\r\n if (typeof context === 'string') context = get(context);\r\n each(context, function () {\r\n if (match[2]) results = getClass(match[2], this, results); // 类选择器\r\n else if (match[3]) results = getTag(match[3], this, results); // tag(标签)选择器\r\n else if (match[4]) results = getTag(match[4], this, results); // 通配符\r\n });\r\n }\r\n }\r\n return results;\r\n }", "title": "" }, { "docid": "bdf469178d553254d24c82074703998a", "score": "0.54488176", "text": "function select(sel) {\n //main function, instantiated via $(sel)\n if (sel) { this.push(query(document, sel)); }\n return this;\n }", "title": "" }, { "docid": "5b6fab3512f83592db0a18be6f296775", "score": "0.54485524", "text": "function combineSelectors (type, args) {\n var out = [], c;\n out.push(type);\n if (args.id) {\n out.push('#' + args.id);\n }\n if (args.className) {\n out.push('.' + args.className);\n }\n if (c = args.classes || args.classNames) {\n c.forEach(function (value) {\n out.push('.' + value);\n });\n }\n return out;\n }", "title": "" }, { "docid": "86824c5a92987e7e64034f09fd68ca56", "score": "0.5446142", "text": "_getProps() {\n\t const that = this;\n\t return {\n\t get readonly() { return that.element.nodeName.toLowerCase() === 'select' ? !!that.element.getAttribute( 'readonly' ) : !!that.element.readOnly; },\n\t appearances: [ ...this.element.closest( '.question, form.or' ).classList ]\n\t .filter( cls => cls.indexOf( 'or-appearance-' ) === 0 )\n\t .map( cls => cls.substring( 14 ) ),\n\t multiple: !!this.element.multiple,\n\t disabled: !!this.element.disabled,\n\t type: this.element.getAttribute( 'data-type-xml' ),\n\t };\n\t }", "title": "" }, { "docid": "ee3d53c89a0fdf504a4fd56b5305742b", "score": "0.54256797", "text": "function parseSelector(selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector$1);\n }", "title": "" }, { "docid": "63e1243e2210813ef46c0d63abe5a9d2", "score": "0.54141796", "text": "function RandomSelectorFactory() {\n \n}", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5411659", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5411659", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5411659", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "6084489626f49996d0424719b8280f07", "score": "0.5405605", "text": "function CLC_ParseSimpleSelector(rawSelectorString){\r\n var parsed_selector = new Array(3);\r\n parsed_selector[0] = \"*\";\r\n parsed_selector[1] = \"*\";\r\n parsed_selector[2] = \"*\";\r\n //Get the element\r\n if ((rawSelectorString.charAt(0) != \"#\") && (rawSelectorString.charAt(0) != \".\")) {\r\n var pos = rawSelectorString.indexOf(\"#\");\r\n if (pos == -1){\r\n pos = rawSelectorString.indexOf(\".\");\r\n }\r\n if (pos == -1){\r\n parsed_selector[0] = rawSelectorString;\r\n }\r\n else {\r\n parsed_selector[0] = CLC_RemoveSpaces( rawSelectorString.substring(0, pos) );\r\n rawSelectorString = CLC_RemoveLeadingSpaces( rawSelectorString.substring(pos, rawSelectorString.length) );\r\n }\r\n }\r\n //Check for id (#)\r\n if (rawSelectorString.charAt(0) == \"#\"){\r\n rawSelectorString = rawSelectorString.substring(1, rawSelectorString.length);\r\n var pos = rawSelectorString.indexOf(\".\"); \r\n if (pos == -1){\r\n parsed_selector[1] = rawSelectorString;\r\n }\r\n else {\r\n parsed_selector[1] = CLC_RemoveSpaces( rawSelectorString.substring(0, pos) );\r\n rawSelectorString = CLC_RemoveLeadingSpaces( rawSelectorString.substring(pos, rawSelectorString.length) );\r\n }\r\n }\r\n //Check for className (.)\r\n if (rawSelectorString.charAt(0) == \".\"){\r\n parsed_selector[2] = CLC_RemoveSpaces( rawSelectorString.substring(1, rawSelectorString.length) );\r\n }\r\n return parsed_selector;\r\n }", "title": "" }, { "docid": "25f5f871c1b6ae7f499dc17d5d91f4f4", "score": "0.5405268", "text": "function prepareSelectors(selector) {\n if (typeof(selector) == \"string\") {\n selector = selector.split(\" \");\n }\n return selector;\n }", "title": "" }, { "docid": "4c01f90683150b48bf4367538727a3ca", "score": "0.5403252", "text": "function getCurrentSelector()\n{\n var selectorobj = get_object(\"atkselector\");\n if (selectorobj)\n {\n if (selectorobj.value)\n {\n var selector = selectorobj.value;\n }\n else if (selectorobj.innerHTML)\n {\n var selector = selectorobj.innerHTML;\n }\n }\n return selector;\n}", "title": "" }, { "docid": "d4c8b19b17ba0deaf5de1f957af3b919", "score": "0.5396061", "text": "_getCMS() {\n for (let i = 0; i < this._selectors.length; i++) {\n if (this._selectors[i].selector) {\n if (document.querySelector(this._selectors[i].selector)) {\n return this._selectors[i];\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "401ed9615991a4f2865b1f1c7cccb2f2", "score": "0.538389", "text": "get(identifiier){\r\n\r\n return document.querySelector(identifiier);\r\n\r\n }", "title": "" }, { "docid": "1b59c51706665117b7069712fac1302b", "score": "0.53815824", "text": "function setupSelector() {\n sel = createSelect();\n sel.position(width + 120, 16);\n sel.option('4');\n sel.option('5');\n sel.option('6');\n sel.option('7');\n sel.option('8');\n sel.option('9');\n sel.option('10');\n sel.changed(mySelectEvent);\n}", "title": "" }, { "docid": "8c93615e4159c0d817fb60626d05fc39", "score": "0.53431034", "text": "function pupulateSelectors(){\n $.each(IncomingDirectionsCurrencies, function(key, val){\n var buildHtml = '<div class=\"ui-select__dropdown__item\" data-id=\"' + val.CurrencyId + '\"><i class=\"ico ico-currency ico-currency--'+ val.LogoName +'\"></i><span class=\"currency__name\">' + val.Title + '</span></div>';\n $('#incomingDirections').prepend(buildHtml);\n });\n\n $.each(OutgoingDirectionsCurrencies, function(key, val){\n var buildHtml = '<div class=\"ui-select__dropdown__item\" data-id=\"' + val.CurrencyId + '\"><i class=\"ico ico-currency ico-currency--'+ val.LogoName +'\"></i><span class=\"currency__name\">' + val.Title + '</span></div>';\n $('#outgoingDirections').prepend(buildHtml);\n });\n }", "title": "" }, { "docid": "68ffcdef7a8b008cbcf679d973f4f95d", "score": "0.53368264", "text": "function addInternalSelectors() {\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "417468ceedda6cc90ae0aee4ca6f2ff1", "score": "0.5335198", "text": "function computeSelectors(abi) {\n if (abi === undefined) {\n return undefined;\n }\n return Object.assign({}, ...abi\n .filter((abiEntry) => abiEntry.type === \"function\")\n .map((abiEntry) => ({\n [abiSelector(abiEntry)]: abiEntry\n })));\n}", "title": "" }, { "docid": "7aa8109cb69bdc0eff9fd922422b2a6c", "score": "0.5299749", "text": "buildByQuery(selector) {\n document.querySelectorAll(selector).forEach(this.build, this);\n }", "title": "" }, { "docid": "08f6d41d430cb005f2c6f51eac9837f4", "score": "0.5299076", "text": "function h1Selector(){\n return $('h1');\n}", "title": "" }, { "docid": "123e84ca7ff0fcf8e21336094a92537d", "score": "0.5299034", "text": "getSelectedDishes(type) {\n //TODO Lab 1\n }", "title": "" }, { "docid": "4a8940b6e1371675cc1756333372a5d1", "score": "0.52871215", "text": "constructor() {\n this.pageId = '#add-item';\n this.pageSelector = Selector(this.pageId);\n }", "title": "" }, { "docid": "64f75af80e0e707b580022b5eb0768bf", "score": "0.5284054", "text": "function __(cssSelectors) {\n // Grab all elements with given selector and insert into array\n this.elements = Array.prototype.slice.call(document.querySelectorAll(cssSelectors));\n}", "title": "" }, { "docid": "c332425b5b28adebb352bd0c41c3bb26", "score": "0.52713794", "text": "get type() {\n return 'selection';\n }", "title": "" }, { "docid": "1c966be1a8ac1bfdaa41bd605cb35164", "score": "0.5270702", "text": "function addInternalSelectors() {\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "1c966be1a8ac1bfdaa41bd605cb35164", "score": "0.5270702", "text": "function addInternalSelectors() {\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "08b7f0f7e4496a971520999a200d94be", "score": "0.5265079", "text": "getObjects(selector) {\n return getAllObjectsRecursive(this).filter(obj => selector.selects(obj)); // HACK: Type checking appeared to not be working correctly\n }", "title": "" }, { "docid": "9fad4b686ead25311d66ddfedd65696e", "score": "0.5246135", "text": "function gQueryObj(selector, elements) {\n }", "title": "" }, { "docid": "24dcecccea29098c8a40093e2d22cca8", "score": "0.5243856", "text": "$(selector) { return $(selector, this); }", "title": "" }, { "docid": "3e76b4af7dc1ee841894f95c7cabdfcf", "score": "0.523861", "text": "function buildSelector(key, subkey) {\n return `#${OPTIONS_IDS[key][subkey]}`;\n}", "title": "" }, { "docid": "da243da60368b120121def643f6ffe9b", "score": "0.5235752", "text": "static PvdBuildSelector(selector) {\n try {\n let templateSelector = new App.Models.TemplateSelector();\n templateSelector.Library = selector.lib;\n templateSelector.Subject = selector.subject;\n templateSelector.Element = selector.name;\n return templateSelector;\n }\n catch (erro) {\n throw erro;\n }\n }", "title": "" }, { "docid": "0184dc6fc8c7d09a0b9647b9373a313a", "score": "0.52306724", "text": "function stdSelectorGenerator(id, prefix) {\n\t\treturn prefix + id;\n\t}", "title": "" }, { "docid": "edebfb48183a352c3df98a85ae1197ac", "score": "0.52201414", "text": "static select() {\n this.selected = document.querySelectorAll(\"#b_results > li\");\n }", "title": "" }, { "docid": "b52100f421e43e8b5bb4420c3b6768d8", "score": "0.5217747", "text": "select () {\n return (typeof this.composedObject.select === 'function' ? this.composedObject.select(this.count) : undefined)\n }", "title": "" }, { "docid": "0dccb5040fd9f46dd1e09f18220704b0", "score": "0.521588", "text": "function jqSlim(selector) {\n // debugging info\n //console.log(\"[init] selector: \" + selector);\n array.push.apply(\n this,\n selector && selector.nodeType ?\n [selector] : '' +\n selector === selector ?\n querySwitch(selector) :\n element\n );\n }", "title": "" }, { "docid": "fa26f1ccd201745520e35c438d3f4e9a", "score": "0.52076083", "text": "function $$(sel) {\n\treturn $(sel, $.mobile.activePage);\n}", "title": "" }, { "docid": "2c2b0ed94034937877ae5dab5f441c78", "score": "0.5203012", "text": "constructor(props){\n\t\tsuper(props);\n\n\t\tthis.state={\n\t\t\tselector:function(data_item){return true} //select all items\n\t\t}\n\t}", "title": "" }, { "docid": "ac9d392f37d22b5d18370dc87f711296", "score": "0.51875603", "text": "function addInternalSelectors() {\n addClass($(getOptions().sectionSelector, getContainer()), SECTION);\n addClass($(getOptions().slideSelector, getContainer()), SLIDE);\n }", "title": "" }, { "docid": "764a8b9564c0e175d8807d08705d2da0", "score": "0.5185949", "text": "function addInternalSelectors(){\n addClass($(options.sectionSelector, container), SECTION);\n addClass($(options.slideSelector, container), SLIDE);\n }", "title": "" }, { "docid": "764a8b9564c0e175d8807d08705d2da0", "score": "0.5185949", "text": "function addInternalSelectors(){\n addClass($(options.sectionSelector, container), SECTION);\n addClass($(options.slideSelector, container), SLIDE);\n }", "title": "" }, { "docid": "182fcbbae83a474e07f07a6184415a5b", "score": "0.5175669", "text": "function select( elem ) {\n\t\tvar selector = elem.tagName +\n\t\t ( $(elem).attr('id') ? '#' + $(elem).attr('id') : '' ) +\n\t\t\t\t\t\t\t\t\t ( $(elem).attr('class') ? '.' + $(elem).attr('class') : '' );\n\t\treturn selector;\n\t}", "title": "" }, { "docid": "a238ebbe4f6677bcd3461a1a609532a0", "score": "0.5175039", "text": "function initSelectorExt(elm, soname, soinit, soattr, soelem, defattr, width, req)\n {\n //logDebug(\"initSelectorExt: \", elm, \", \", soname, \", \", /* soattr, \", \", sofunc, \", \", */ req) ;\n //logDebug(\"initSelectorExt: req.responseText \", req.responseText ) ;\n //logDebug(\"initSelectorExt: req.responseXML \", req.responseXML ) ;\n //logDebug(\"initSelectorExt: req.getAllResponseHeaders() \", req.getAllResponseHeaders() ) ;\n\n // Construct attributes for option element\n function mkattr(e)\n {\n var a = soattr(e)\n //a[\"test1\"] = \"True\"\n //a[\"test2\"] = soinit\n //a[\"test3\"] = soelem(e)\n //a[\"test4\"] = getElementText(e)\n if ( soinit && soinit == soelem(e) )\n {\n a[\"selected\"] = \"True\"\n }\n return a\n }\n\n // Construct text for option content\n function mktext(e)\n {\n var t = soelem(e) ;\n if (width > 0) t = mkFixedWidthOptionText(t, width) ;\n return t ;\n }\n\n // Selector initialization main function\n var rsp = null ;\n var msg = null ;\n if ( req instanceof Error )\n {\n msg = \"Server returned error: \"+req ;\n }\n else\n {\n try\n {\n rsp = req.responseXML.documentElement ;\n }\n catch(e)\n {\n msg = \"No XML document in server response\"+e ;\n logWarning(\"initSelectorExt: \"+msg) ;\n showError(msg) ;\n replaceChildNodes(elm, [OPTION(defattr, \"-- (Error) --\")]) ;\n throw e ; // Ensure the deferred returns an error\n }\n }\n if ( rsp == null )\n {\n msg = \"No server response\" ;\n }\n if ( msg != null )\n {\n logWarning(\"initSelectorExt: \"+msg) ;\n showError(msg) ;\n replaceChildNodes(elm, [OPTION(defattr, \"-- (Error) --\")]) ;\n return null ;\n }\n var elms = rsp.getElementsByTagName(soname) ;\n var opts = map(OPTION, map(mkattr, elms), map(mktext, elms)) ;\n if (opts.length == 0)\n {\n // Ensure at least one entry in list\n opts[0] = OPTION( defattr, mkFixedWidthOptionText(\"-- (none) --\",width) ) ;\n }\n replaceChildNodes(elm, opts) ;\n return elm ;\n }", "title": "" }, { "docid": "6a40f0b33b8a6bc26696f0111bab90a4", "score": "0.51742435", "text": "get label () {\n throw new Error(`Selection class ${this.type} has not implemented the required label getter`);\n }", "title": "" }, { "docid": "c9e1611aca242ed6f8de1cc3a8b63857", "score": "0.517071", "text": "static get is() {\n return 'array-selector';\n }", "title": "" }, { "docid": "b8131632fd621aa2ef86ab3926b0dd58", "score": "0.5170406", "text": "function __WEBPACK_DEFAULT_EXPORT__(selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}", "title": "" }, { "docid": "c9884e0a1dee89c25b437bdde518861e", "score": "0.5166441", "text": "function selectorMultiple(selector, callback){\n\tvar elementos = document.querySelectorAll(selector);\n\tObject.keys(elementos).map(function(k){\n\t\tcallback(k, elementos);\n\t});\n}", "title": "" } ]
26947f1ad3404ebdf351a7912d6e77d4
Validates as many continuation bytes for a multibyte UTF8 character as needed or are available. If we see a noncontinuation byte where we expect one, we "replace" the validated continuation bytes we've seen so far with UTF8 replacement characters ('\ufffd'), to match v8's UTF8 decoding behavior. The continuation byte check is included three times in the case where all of the continuation bytes for a character exist in the same buffer. It is also done this way as a slight performance increase instead of using a loop.
[ { "docid": "f461a579d03238fb59c3f3a798c53aef", "score": "0.0", "text": "function utf8CheckExtraBytes(self, buf, p) {\n\t if ((buf[0] & 0xC0) !== 0x80) {\n\t self.lastNeed = 0;\n\t return '\\ufffd'.repeat(p);\n\t }\n\t if (self.lastNeed > 1 && buf.length > 1) {\n\t if ((buf[1] & 0xC0) !== 0x80) {\n\t self.lastNeed = 1;\n\t return '\\ufffd'.repeat(p + 1);\n\t }\n\t if (self.lastNeed > 2 && buf.length > 2) {\n\t if ((buf[2] & 0xC0) !== 0x80) {\n\t self.lastNeed = 2;\n\t return '\\ufffd'.repeat(p + 2);\n\t }\n\t }\n\t }\n\t}", "title": "" } ]
[ { "docid": "ade1a9a4660114845946c43f2f8dbf6a", "score": "0.8078758", "text": "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3;}return nb;}return 0;}// Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "9cc749e1b02573d2c656118d13028531", "score": "0.8015968", "text": "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3;}return nb;}return 0;}// Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "9cc749e1b02573d2c656118d13028531", "score": "0.8015968", "text": "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3;}return nb;}return 0;}// Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "9cc749e1b02573d2c656118d13028531", "score": "0.8015968", "text": "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3;}return nb;}return 0;}// Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "8e197149990e2cec356641120b128773", "score": "0.73940766", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n\n return nb;\n }\n\n return 0;\n} // Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "8e197149990e2cec356641120b128773", "score": "0.73940766", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n\n return nb;\n }\n\n return 0;\n} // Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "8e197149990e2cec356641120b128773", "score": "0.73940766", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n\n return nb;\n }\n\n return 0;\n} // Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "8e197149990e2cec356641120b128773", "score": "0.73940766", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n\n return nb;\n }\n\n return 0;\n} // Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "8e197149990e2cec356641120b128773", "score": "0.73940766", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n\n return nb;\n }\n\n return 0;\n} // Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "8e197149990e2cec356641120b128773", "score": "0.73940766", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n\n return nb;\n }\n\n return 0;\n} // Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "ce7c07b7bab1d1d423e9341c6a5a587b", "score": "0.73084027", "text": "function validateUtf8(bytes, start, end) {\n var continuation = 0;\n\n for (var i = start; i < end; i += 1) {\n var byte = bytes[i];\n\n if (continuation) {\n if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) {\n return false;\n }\n\n continuation -= 1;\n } else if (byte & FIRST_BIT) {\n if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) {\n continuation = 1;\n } else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) {\n continuation = 2;\n } else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) {\n continuation = 3;\n } else {\n return false;\n }\n }\n }\n\n return !continuation;\n }", "title": "" }, { "docid": "504ad033f4ddfdcced2309bbd8b70235", "score": "0.72330046", "text": "function validateUtf8(bytes, start, end) {\n var continuation = 0;\n for (var i = start; i < end; i += 1) {\n var byte = bytes[i];\n if (continuation) {\n if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) {\n return false;\n }\n continuation -= 1;\n }\n else if (byte & FIRST_BIT) {\n if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) {\n continuation = 1;\n }\n else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) {\n continuation = 2;\n }\n else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) {\n continuation = 3;\n }\n else {\n return false;\n }\n }\n }\n return !continuation;\n}", "title": "" }, { "docid": "bc4382dacddcb68368ef3e7e578ba438", "score": "0.71379596", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n\n return nb;\n }\n\n return 0;\n } // Validates as many continuation bytes for a multi-byte UTF-8 character as", "title": "" }, { "docid": "74cac571955666d5b5c78fb146cc4c2c", "score": "0.6976919", "text": "function decodeUtf8(bytes) {\n function cb(i) {\n if (i < 0 || i >= bytes.length)\n throw new RangeError(\"Missing continuation bytes\");\n const result = bytes.codePointAt(i);\n if ((result & 0b11000000) != 0b10000000)\n throw new RangeError(\"Invalid continuation byte value\");\n return result & 0b00111111;\n }\n let result = \"\";\n for (let i = 0; i < bytes.length; i++) {\n const lead = bytes.codePointAt(i);\n if (lead < 0b10000000) // Single byte ASCII (0xxxxxxx)\n result += bytes.charAt(i);\n else if (lead < 0b11000000) // Continuation byte (10xxxxxx)\n throw new RangeError(\"Invalid leading byte\");\n else if (lead < 0b11100000) { // Two bytes (110xxxxx 10xxxxxx)\n const c = (lead & 0b00011111) << 6 | cb(i + 1) << 0;\n if (c < (1 << 7))\n throw new RangeError(\"Over-long UTF-8 sequence\");\n result += String.fromCodePoint(c);\n i += 1;\n }\n else if (lead < 0b11110000) { // Three bytes (1110xxxx 10xxxxxx 10xxxxxx)\n const c = (lead & 0b00001111) << 12 | cb(i + 1) << 6 | cb(i + 2) << 0;\n if (c < (1 << 11))\n throw new RangeError(\"Over-long UTF-8 sequence\");\n if (0xD800 <= c && c < 0xE000)\n throw new RangeError(\"Invalid UTF-8 containing UTF-16 surrogate\");\n result += String.fromCodePoint(c);\n i += 2;\n }\n else if (lead < 0b11111000) { // Four bytes (11110xxx 10xxxxxx 10xxxxxx 10xxxxxx)\n let c = (lead & 0b00000111) << 18 | cb(i + 1) << 12 | cb(i + 2) << 6 | cb(i + 3);\n if (c < (1 << 16))\n throw new RangeError(\"Over-long UTF-8 sequence\");\n if (c >= 0x110000)\n throw new RangeError(\"UTF-8 code point out of range\");\n result += String.fromCodePoint(c);\n i += 3;\n }\n else\n throw new RangeError(\"Invalid leading byte\");\n }\n return result;\n }", "title": "" }, { "docid": "1a7cd4801730d4a898ee3820cac33b6b", "score": "0.6671304", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return'\\ufffd'.repeat(p);}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return'\\ufffd'.repeat(p+1);}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return'\\ufffd'.repeat(p+2);}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "dd06fbd200a01dc9274448752db398c8", "score": "0.66341925", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "dd06fbd200a01dc9274448752db398c8", "score": "0.66341925", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "004e221fcbe9dd3047c24b74c73b50d2", "score": "0.66087073", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "004e221fcbe9dd3047c24b74c73b50d2", "score": "0.66087073", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "004e221fcbe9dd3047c24b74c73b50d2", "score": "0.66087073", "text": "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "ceef3d0aefccfb07d9e2445bd8cc1c91", "score": "0.65921366", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "ceef3d0aefccfb07d9e2445bd8cc1c91", "score": "0.65921366", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "ceef3d0aefccfb07d9e2445bd8cc1c91", "score": "0.65921366", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "ceef3d0aefccfb07d9e2445bd8cc1c91", "score": "0.65921366", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n} // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "314d664782c08fc4a86ca20f1fde5213", "score": "0.6451521", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return \"\\uFFFD\";\n }\n\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return \"\\uFFFD\";\n }\n }\n }\n } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.", "title": "" }, { "docid": "51a1dac671fa78c9cd98dc6b90ce2fd6", "score": "0.6224846", "text": "function utf8CheckIncomplete(self, buf, i) {\nvar j = buf.length - 1;\nif (j < i) return 0;\nvar nb = utf8CheckByte(buf[j]);\nif (nb >= 0) {\nif (nb > 0) self.lastNeed = nb - 1;\nreturn nb;\n}\nif (--j < i || nb === -2) return 0;\nnb = utf8CheckByte(buf[j]);\nif (nb >= 0) {\nif (nb > 0) self.lastNeed = nb - 2;\nreturn nb;\n}\nif (--j < i || nb === -2) return 0;\nnb = utf8CheckByte(buf[j]);\nif (nb >= 0) {\nif (nb > 0) {\nif (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n}\nreturn nb;\n}\nreturn 0;\n}", "title": "" }, { "docid": "4b4fe542d4cb884076f0ebf24c17ca45", "score": "0.6188191", "text": "function utf8CheckExtraBytes(self, buf, p) {\nif ((buf[0] & 0xC0) !== 0x80) {\nself.lastNeed = 0;\nreturn '\\ufffd';\n}\nif (self.lastNeed > 1 && buf.length > 1) {\nif ((buf[1] & 0xC0) !== 0x80) {\nself.lastNeed = 1;\nreturn '\\ufffd';\n}\nif (self.lastNeed > 2 && buf.length > 2) {\nif ((buf[2] & 0xC0) !== 0x80) {\nself.lastNeed = 2;\nreturn '\\ufffd';\n}\n}\n}\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "db27efb4ffd81e1860edd823ff13793a", "score": "0.6074783", "text": "function utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}", "title": "" }, { "docid": "40965508c192e80781cee1c17d4737e9", "score": "0.60605145", "text": "function utf8CheckByte(_byte){if(_byte<=0x7F)return 0;else if(_byte>>5===0x06)return 2;else if(_byte>>4===0x0E)return 3;else if(_byte>>3===0x1E)return 4;return _byte>>6===0x02?-1:-2;}// Checks at most 3 bytes at the end of a Buffer in order to detect an", "title": "" }, { "docid": "40965508c192e80781cee1c17d4737e9", "score": "0.60605145", "text": "function utf8CheckByte(_byte){if(_byte<=0x7F)return 0;else if(_byte>>5===0x06)return 2;else if(_byte>>4===0x0E)return 3;else if(_byte>>3===0x1E)return 4;return _byte>>6===0x02?-1:-2;}// Checks at most 3 bytes at the end of a Buffer in order to detect an", "title": "" }, { "docid": "40965508c192e80781cee1c17d4737e9", "score": "0.60605145", "text": "function utf8CheckByte(_byte){if(_byte<=0x7F)return 0;else if(_byte>>5===0x06)return 2;else if(_byte>>4===0x0E)return 3;else if(_byte>>3===0x1E)return 4;return _byte>>6===0x02?-1:-2;}// Checks at most 3 bytes at the end of a Buffer in order to detect an", "title": "" }, { "docid": "d02050082405878dbcf7b54252ff85d6", "score": "0.6046061", "text": "function utf8CheckByte(byte){if(byte<=0x7F)return 0;else if(byte>>5===0x06)return 2;else if(byte>>4===0x0E)return 3;else if(byte>>3===0x1E)return 4;return-1;}// Checks at most 3 bytes at the end of a Buffer in order to detect an", "title": "" }, { "docid": "1e62312f8e73f865b22c1653677352e1", "score": "0.60077226", "text": "function utf8CheckIncomplete(self, buf, i) {\n\t\t\t var j = buf.length - 1;\n\t\t\t if (j < i) return 0;\n\t\t\t var nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 1;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 2;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) {\n\t\t\t if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n\t\t\t }\n\t\t\t return nb;\n\t\t\t }\n\t\t\t return 0;\n\t\t\t}", "title": "" }, { "docid": "1e62312f8e73f865b22c1653677352e1", "score": "0.60077226", "text": "function utf8CheckIncomplete(self, buf, i) {\n\t\t\t var j = buf.length - 1;\n\t\t\t if (j < i) return 0;\n\t\t\t var nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 1;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 2;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) {\n\t\t\t if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n\t\t\t }\n\t\t\t return nb;\n\t\t\t }\n\t\t\t return 0;\n\t\t\t}", "title": "" }, { "docid": "1e62312f8e73f865b22c1653677352e1", "score": "0.60077226", "text": "function utf8CheckIncomplete(self, buf, i) {\n\t\t\t var j = buf.length - 1;\n\t\t\t if (j < i) return 0;\n\t\t\t var nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 1;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 2;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) {\n\t\t\t if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n\t\t\t }\n\t\t\t return nb;\n\t\t\t }\n\t\t\t return 0;\n\t\t\t}", "title": "" }, { "docid": "1e62312f8e73f865b22c1653677352e1", "score": "0.60077226", "text": "function utf8CheckIncomplete(self, buf, i) {\n\t\t\t var j = buf.length - 1;\n\t\t\t if (j < i) return 0;\n\t\t\t var nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 1;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 2;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) {\n\t\t\t if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n\t\t\t }\n\t\t\t return nb;\n\t\t\t }\n\t\t\t return 0;\n\t\t\t}", "title": "" }, { "docid": "1e62312f8e73f865b22c1653677352e1", "score": "0.60077226", "text": "function utf8CheckIncomplete(self, buf, i) {\n\t\t\t var j = buf.length - 1;\n\t\t\t if (j < i) return 0;\n\t\t\t var nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 1;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) self.lastNeed = nb - 2;\n\t\t\t return nb;\n\t\t\t }\n\t\t\t if (--j < i) return 0;\n\t\t\t nb = utf8CheckByte(buf[j]);\n\t\t\t if (nb >= 0) {\n\t\t\t if (nb > 0) {\n\t\t\t if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n\t\t\t }\n\t\t\t return nb;\n\t\t\t }\n\t\t\t return 0;\n\t\t\t}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" }, { "docid": "9fe9cfa424dfeb6f251925696c57bb20", "score": "0.6002878", "text": "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}", "title": "" } ]
67e5c61146fc33a36c75f3653a5ad882
Annotate source tree by injecting comments into the underlying DOM
[ { "docid": "c8c8b36f2b7697169282e790b9593d63", "score": "0.6275732", "text": "function annotate_source(doc, matching, invert) {\n var collector = deltaProfile.createCollector(delta, doc,\n docProfile.createNodeEqualityTest(doc, doc));\n var domdoc = doc.tree.data.ownerDocument;\n var annotator = new da.DocumentAnnotator(domdoc);\n var excludes = [];\n\n \n //collector.forEachChange(function(type, path, par, remove, insert) {\n collector.forEachChange(function(op) {\n var deep = (op.type === 2),\n i, nodes, dompar, before, ancestors;\n\n if (op.anchor.base) {\n dompar = op.anchor.base.data;\n before = op.anchor.target;\n before = before && before.data;\n }\n else {\n dompar = domdoc;\n before = doc.tree.data;\n }\n\n for (nodes = [], i = 0; i < op.remove.length; i++) {\n nodes.push(op.remove[i].data.cloneNode(deep));\n }\n annotator.wrap(dompar, before, nodes,\n '<span class=\"change change-remove\">', '</span>');\n\n for (nodes = [], i = 0; i < op.insert.length; i++) {\n nodes.push(domdoc.importNode(op.insert[i].data, deep));\n }\n annotator.wrap(dompar, before, nodes,\n '<span class=\"change change-insert\">', '</span>');\n\n for (nodes = [], i = 0; i < op.remove.length; i++) {\n excludes.push([op.remove[i].data, deep]);\n }\n });\n\n for (var i = 0; i < excludes.length; i++) {\n annotator.exclude.apply(annotator, excludes[i]);\n }\n\n return annotator.toHTML();\n}", "title": "" } ]
[ { "docid": "8ff3d80df578ffe81943bdd6f66e1825", "score": "0.69074595", "text": "function annotate_comment(exp) {\n exp.tag = \"comments\";\n\n if (exp.list) {\n exp.opening.tag = \"comments\";\n exp.closing.tag = \"comments\";\n \n for (var i = 0; i < exp.list.length; i++) {\n var child = exp.list[i];\n if (child.list) {\n annotate_comment(child);\n }\n if (child.attached_node) {\n annotate_comment(child.attached_node);\n }\n else {\n child.tag = \"comments\";\n }\n }\n }\n }", "title": "" }, { "docid": "ffebac0ed5bdaf1aa35fbf254ea500fb", "score": "0.60446364", "text": "function processSource(src) {\n var ast = esprima.parse(src, {\n attachComment: true\n });\n for (var i = 0, len = ast.comments.length; i < len; i++) {\n var comment = ast.comments[i];\n\n if (comment.type !== \"Block\") {\n continue;\n }\n\n // Document comments must start with \"/**\"\n if (comment.value[0] !== \"*\") {\n continue;\n }\n\n processComment(comment);\n }\n}", "title": "" }, { "docid": "79116c10c04dc4902ef1da2e361b900f", "score": "0.59967303", "text": "function AttachCommentTreeVisitorImpl() {\n ParseTreeVisitor.call(this);\n }", "title": "" }, { "docid": "69f5f43d958ce3b3142bf2a3c1fd7bb0", "score": "0.5760177", "text": "function addASTTag(source) {\n if (source) {\n source = decomment(source);\n source = combineAllJsonIntoArray(source);\n\n var ast = JSON.parse(source);\n var ret = traverseAST(ast, \"\"/*parent*/);\n // Translate an original AST to render library format.\n // astToChart(ret);\n }\n}", "title": "" }, { "docid": "7b387427a86a7049d19e9520ddf94516", "score": "0.57173693", "text": "function populateCodeSamples() {\n // any <code /> blocks that have 'data-src-id' set to a given element\n $('pre[data-src-id]').each(function() {\n var elemNames = $(this).attr('data-src-id').split(\",\");\n\n var html = \"\";\n\n for (var i=0;i<elemNames.length;i++) {\n html += getElementHTML(elemNames[i]);\n }\n $(this).text( html );\n });\n }", "title": "" }, { "docid": "73a8d034ddf07e9c1eb0acd2199e4914", "score": "0.5591846", "text": "function codeHighlight() {\n $('.doc-example .doc-bd').each(function () {\n var $code = $(this),\n $link = $('<a class=\"doc-pill\" data-label=\"Hide source\">Show source</a>')\n ;\n $link\n .insertAfter($code)\n .click(function () {\n var $this = $(this),\n label = $this.data('label'),\n $temp = $('<pre></pre>')\n ;\n $this\n .data('label', $this.text())\n .text(label)\n ;\n if (! $this.next()[0] || $this.next().is(':not(pre)')) {\n $temp.text($code.html());\n var $pre = $('<pre class=\"prettyprint\"></pre>'),\n html = $.trim($temp.html())\n // remove everything between <!-- |--> and <!--| -->\n .replace(/(.*)(&lt;!-- \\|--&gt;\\D*&lt;!--\\| --&gt;)(.*)/gi, '…')\n // mark everything between .-d and .d- as bold\n .replace(/(-d )(.*)( d-)/g, '<strong>$2</strong>')\n // mark the whole line when this .-d- is defined\n .replace(/&lt;((\\S.*)( .*?)(-d-).*)&gt;/g, '&lt;<strong>$1</strong>&gt;')\n // remove indicators\n .replace(/ class=\"-d-\"|-d- | -d-|&amp;nbsp;/g, '')\n // remove indentention\n .replace(/\\n.*(&lt;.*&gt;)$/,'\\n$1')\n ;\n // triming\n var beginIndex = html.indexOf('&') - 1;\n if (beginIndex > -1) {\n html = html.replace(RegExp(' {' + beginIndex + '}', 'g'), '');\n }\n $pre\n .html($.trim(html))\n .hide()\n .insertAfter($this)\n ;\n prettyPrint();\n }\n $this.next().toggle();\n })\n ;\n });\n }", "title": "" }, { "docid": "19027f10cc8f6405494fbd22f1351f67", "score": "0.5563171", "text": "function collectCommentsWithTreeWalker( rootNode ) {\n\n\t\tvar comments = [];\n\n\t\t// NOTE: Last two arguments use default values but are NOT optional in Internet \n\t\t// Explorer. As such, we have to use them here for broader support.\n\t\tvar treeWalker = document.createTreeWalker( rootNode, NodeFilter.SHOW_COMMENT, null, false );\n\n\t\twhile ( treeWalker.nextNode() ) {\n\n\t\t\tcomments.push( treeWalker.currentNode );\n\n\t\t}\n\n\t\treturn( comments );\n\n\t}", "title": "" }, { "docid": "ea74c758683992efd59bbde16dcb4cb2", "score": "0.5561435", "text": "removeAnnotation(url) {\n let result = [];\n let beautify = require('js-beautify').js_beautify,\n fs = require('fs');\n let data = fs.readFileSync(url, 'utf8');\n let code = beautify(data, {indent_size: 2});\n let annoIdf = 0;\n let stmts = code.split('\\r\\n');\n for (let i = 0; i < stmts.length; i++) {\n if (annoIdf > 0) {\n if (contains(stmts[i], '*/')) {\n --annoIdf;\n }\n stmts[i] = \"\";\n } else {\n if (contains(stmts[i], '//') && notInQuote(stmts[i], stmts[i].indexOf('//'))) {\n stmts[i] = stmts[i].substring(0, stmts[i].indexOf('//'));\n } else if (contains(stmts[i], '/*') && notInQuote(stmts[i], stmts[i].indexOf('/*'))) {\n ++annoIdf;\n stmts[i] = stmts[i].substring(0, stmts[i].indexOf('/*'));\n } else {\n stmts[i] = stmts[i].indexOf('\\r') >= 0 ? stmts[i].substring(0, stmts[i].indexOf('\\r')) : stmts[i];\n }\n }\n let reg = /^[ ]+$/;\n if (reg.test(stmts[i])) {\n stmts[i] = '';\n }\n }\n let res = '', resStmt = [];\n for (let i = 0; i < stmts.length; i++) {\n if (stmts[i].length > 0) {\n res = res + stmts[i];\n resStmt.push(stmts[i]);\n }\n }\n result.push(res);\n result.push(resStmt);\n return result;\n }", "title": "" }, { "docid": "98d399a4cd542b5751e4f1ed07ed803b", "score": "0.5560024", "text": "function enter(node, parent) {\n if(!node.body)return;\n for(var i = 0; i < node.body.length; i++){\n\n // Function to append a statement after the current statement\n var append = [].splice.bind(node.body, i+1, 0);\n\n // Get all comments associated with the current statement\n var current = node.body[i];\n var comment = [].concat(current.leadingComments, current.trailingComments);\n\n // For every comment find the @examples and @expose tags \n for(var j in comment){\n if(!comment[j])continue;\n var test = parseComment(comment[j], append);\n if(test)tests.push(test);\n }\n }\n }", "title": "" }, { "docid": "97d05ceb7eecadde4a2235d8c5208cd0", "score": "0.552409", "text": "function withcomment () {\n console.log('hi');\n}", "title": "" }, { "docid": "63a3c816a0388388192139ffc26a7c0d", "score": "0.5489713", "text": "function annotateComments(ci) {\n let resolved = true;\n const children = ci.children || [];\n let allRead = (children.length > 0) ? true : ci.read;\n for (const child of children) {\n annotateComments(child);\n resolved = resolved && child.resolved && child.comment.id >= 0;\n allRead = allRead && child.allRead;\n }\n if (children.length > 0) {\n ci.resolved = resolved;\n } else {\n ci.resolved = (ci.comment.flags || []).indexOf('resolved') >= 0;\n }\n ci.allRead = allRead;\n}", "title": "" }, { "docid": "f1ec051aff7c21187028d962a93468b6", "score": "0.54598665", "text": "function decorateComment(node, comment, text, options) {\n var locStart = options.locStart;\n var locEnd = options.locEnd;\n var childNodes = getSortedChildNodes(node, text, options);\n var precedingNode = void 0;\n var followingNode = void 0;\n // Time to dust off the old binary search robes and wizard hat.\n var left = 0;\n var right = childNodes.length;\n while (left < right) {\n var middle = left + right >> 1;\n var child = childNodes[middle];\n\n if (locStart(child) - locStart(comment) <= 0 && locEnd(comment) - locEnd(child) <= 0) {\n // The comment is completely contained by this child node.\n comment.enclosingNode = child;\n\n decorateComment(child, comment, text, options);\n return; // Abandon the binary search at this level.\n }\n\n if (locEnd(child) - locStart(comment) <= 0) {\n // This child node falls completely before the comment.\n // Because we will never consider this node or any nodes\n // before it again, this node must be the closest preceding\n // node we have encountered so far.\n precedingNode = child;\n left = middle + 1;\n continue;\n }\n\n if (locEnd(comment) - locStart(child) <= 0) {\n // This child node falls completely after the comment.\n // Because we will never consider this node or any nodes after\n // it again, this node must be the closest following node we\n // have encountered so far.\n followingNode = child;\n right = middle;\n continue;\n }\n\n /* istanbul ignore next */\n throw new Error(\"Comment location overlaps with node location\");\n }\n\n // We don't want comments inside of different expressions inside of the same\n // template literal to move to another expression.\n if (comment.enclosingNode && comment.enclosingNode.type === \"TemplateLiteral\") {\n var quasis = comment.enclosingNode.quasis;\n var commentIndex = findExpressionIndexForComment(quasis, comment, options);\n\n if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options) !== commentIndex) {\n precedingNode = null;\n }\n if (followingNode && findExpressionIndexForComment(quasis, followingNode, options) !== commentIndex) {\n followingNode = null;\n }\n }\n\n if (precedingNode) {\n comment.precedingNode = precedingNode;\n }\n\n if (followingNode) {\n comment.followingNode = followingNode;\n }\n}", "title": "" }, { "docid": "d9ed1b4cb9b818bc86346ff94150337d", "score": "0.5453503", "text": "buildCommentAnnotation () {\n return new CommentAnnotation({\n comment: 'test',\n target: 'http://www.example.org/image-service/abcd1234'\n })\n }", "title": "" }, { "docid": "570fc8560c021515c75efab1a933982b", "score": "0.5441577", "text": "function decorateComment(node, comment, options) {\n var locStart = options.locStart,\n locEnd = options.locEnd;\n var childNodes = getSortedChildNodes(node, options);\n var precedingNode;\n var followingNode; // Time to dust off the old binary search robes and wizard hat.\n\n var left = 0;\n var right = childNodes.length;\n\n while (left < right) {\n var middle = left + right >> 1;\n var child = childNodes[middle];\n\n if (locStart(child) - locStart(comment) <= 0 && locEnd(comment) - locEnd(child) <= 0) {\n // The comment is completely contained by this child node.\n comment.enclosingNode = child;\n decorateComment(child, comment, options);\n return; // Abandon the binary search at this level.\n }\n\n if (locEnd(child) - locStart(comment) <= 0) {\n // This child node falls completely before the comment.\n // Because we will never consider this node or any nodes\n // before it again, this node must be the closest preceding\n // node we have encountered so far.\n precedingNode = child;\n left = middle + 1;\n continue;\n }\n\n if (locEnd(comment) - locStart(child) <= 0) {\n // This child node falls completely after the comment.\n // Because we will never consider this node or any nodes after\n // it again, this node must be the closest following node we\n // have encountered so far.\n followingNode = child;\n right = middle;\n continue;\n }\n /* istanbul ignore next */\n\n\n throw new Error(\"Comment location overlaps with node location\");\n } // We don't want comments inside of different expressions inside of the same\n // template literal to move to another expression.\n\n\n if (comment.enclosingNode && comment.enclosingNode.type === \"TemplateLiteral\") {\n var quasis = comment.enclosingNode.quasis;\n var commentIndex = findExpressionIndexForComment(quasis, comment, options);\n\n if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options) !== commentIndex) {\n precedingNode = null;\n }\n\n if (followingNode && findExpressionIndexForComment(quasis, followingNode, options) !== commentIndex) {\n followingNode = null;\n }\n }\n\n if (precedingNode) {\n comment.precedingNode = precedingNode;\n }\n\n if (followingNode) {\n comment.followingNode = followingNode;\n }\n}", "title": "" }, { "docid": "b7a0f15e31473b7904c86ce7e02bdebd", "score": "0.5419841", "text": "function annotateReactNodes() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n var options = arguments[1];\n\n annotateReactNode(node, options);\n var current = node.firstChild;\n while (current) {\n annotateReactNodes(current, options);\n current = current.nextSibling;\n }\n}", "title": "" }, { "docid": "1cb2e0f50ea6fcd8b777275cb5f4389d", "score": "0.54193765", "text": "function installAsynchronousAnnotator() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n var options = arguments[1];\n\n var observer = new MutationObserver(function (mutations) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = mutations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var mutation = _step.value;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = mutation.addedNodes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _node = _step2.value;\n\n annotateReactNodes(_node, options);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n });\n annotateReactNodes(node, options);\n observer.observe(node, { childList: true, subtree: true });\n return function () {\n return observer.disconnect();\n };\n}", "title": "" }, { "docid": "b9f30145960b6b8cc4323980c49aa110", "score": "0.53955513", "text": "function comment(ctx, node) {\n return '<!--' + node.value + '-->'\n}", "title": "" }, { "docid": "0f429c2d8cab15267e9300b43dbc2967", "score": "0.53816164", "text": "buildInnerAnnotationElement(comments) {\n\n const thisClass = this;\n $(thisClass.innerContainer).empty();\n\n let innerAnnotation = document.createElement('div');\n innerAnnotation.id = \"innerAnnotation\";\n thisClass.innerContainer = innerAnnotation;\n var timeBlockcount = 0;\n\n let newEl;\n var commentBlock;\n var previousParentId;\n // hold current time stamp element\n var timeStampBlockEl;\n\n // Just so that we don't repeat code...\n function addReplyBox () {\n // Add the reply box at the end of the block containing comment plus its replies\n newEl = $(thisClass.tc_reply_box);\n // Set the button and input ids\n var textAreaId = timeStampBlockEl.id + \"_replyText\";\n var replyTextArea = $(newEl).find('input.tc_reply_textarea');\n $(replyTextArea).attr('id', textAreaId);\n $(replyTextArea).attr(\"data-type\", \"reply\");\n $(commentBlock).append(newEl);\n timeStampBlockEl.appendChild(commentBlock);\n innerAnnotation.appendChild(timeStampBlockEl);\n }\n\n comments.forEach(function (l) {\n const parsedComments = l.value;\n // Bump both inpoint and outpoint down to match offset of trim start\n const inAdjusted = l.inpoint - (thisClass._trimming.enabled ? thisClass._trimming.start : 0);\n const outAdjusted = l.outpoint - (thisClass._trimming.enabled ? thisClass._trimming.start : 0);\n if (parsedComments && (typeof parsedComments !== 'object')) {\n parsedComments = JSON.parse(parsedComments);\n }\n if (parsedComments[ \"timedComment\"]) {\n var comment = parsedComments[ \"timedComment\"];\n\n if (comment.mode == \"comment\") {\n // This is the comment\n if (previousParentId) {\n // Add previous reply box\n addReplyBox();\n }\n previousParentId = l.annotationId;++ timeBlockcount;\n paella.log.debug(\"creating comment block for \" + l.annotationId);\n timeStampBlockEl = document.createElement('div');\n timeStampBlockEl.className = \"tc_timestamp_block\";\n timeStampBlockEl.setAttribute('data-sec-begin', inAdjusted);\n timeStampBlockEl.setAttribute('data-sec-end', outAdjusted);\n timeStampBlockEl.setAttribute('data-sec-id', l.annotationId);\n timeStampBlockEl.id = 'TimedCommentPlugin_Comments_' + timeBlockcount;\n\n // The innerAnnotation's first child is the timestamp\n var timeStampEl = document.createElement('div');\n timeStampEl.className = \"tc_timestamp\";\n timeStampEl.setAttribute('data-sec-begin-button', inAdjusted);\n var timeStampText = paella.utils.timeParse.secondsToTime(inAdjusted);\n timeStampEl.innerHTML = timeStampText;\n timeStampBlockEl.appendChild(timeStampEl);\n // jump to time on click on just the timestamp div\n $(timeStampEl).click(function (e) {\n var secBegin = $(this).attr(\"data-sec-begin-button\");\n paella.player.videoContainer.seekToTime(parseInt(secBegin));\n });\n\n commentBlock = document.createElement(\"div\");\n commentBlock.className = \"tc_comment_block\";\n commentBlock.setAttribute('data-parent-id', l.annotationId);\n commentBlock.setAttribute('data-inpoint', inAdjusted);\n commentBlock.setAttribute('data-private', l.isPrivate);\n // create the comment\n newEl = $(thisClass.tc_comment);\n } else {\n // This is a reply\n newEl = $(thisClass.tc_reply);\n }\n newEl.attr('data-annot-id', l.annotationId);\n var friendlyDateStrig = thisClass.getFriendlyDate(l.created);\n $(newEl).find(\".tc_comment_text\").html(comment.value);\n $(newEl).find(\".user_name\").html(comment.userName);\n $(newEl).find(\".user_comment_date\").html(friendlyDateStrig);\n $(commentBlock).append(newEl);\n }\n });\n\n if (previousParentId) {\n // Add last reply box\n addReplyBox();\n }\n\n return innerAnnotation;\n }", "title": "" }, { "docid": "453db4ed08e26b87510afca7a862dc4a", "score": "0.5380671", "text": "bindAnnotation(stmts) {\n let statements = [];\n let annoIdf = 0;\n let annotation = [];\n for (let i = 0; i < stmts.length; i++) {\n if(stmts[i]=== undefined){\n continue;\n }\n if (annoIdf > 0) {\n if (contains(stmts[i], '*/')) {\n --annoIdf;\n }\n annotation.push(stmts[i] + '\\n');\n } else {\n // in case of '//'\n if (contains(stmts[i], '//') && notInQuote(stmts[i], stmts[i].indexOf('//'))) {\n if (stmts[i].indexOf('//') > 0) {\n let prev = stmts[i].substring(0, stmts[i].indexOf('//'));\n let reg = /^[ ]+$/;\n if (reg.test(prev)) {\n annotation.push(stmts[i] + '\\n');\n }\n //egnore\n } else {\n //bind to the nearest stmt\n annotation.push(stmts[i] + '\\n');\n }\n } else if (contains(stmts[i], '/*') && notInQuote(stmts[i], stmts[i].indexOf('/*'))) {\n ++annoIdf;\n annotation.push(stmts[i] + '\\n');\n } else {\n stmts[i] = stmts[i].indexOf('\\r') >= 0 ? stmts[i].substring(0, stmts[i].indexOf('\\r')) : stmts[i];\n let tmp_stmt = new Stmt(stmts[i], i,{...annotation}); // {...object} is a deep clone in ES6\n\n statements.push(tmp_stmt);\n if (annotation.length > 0) {\n annotation.splice(0, annotation.length);\n }\n }\n }\n let reg = /^[ ]+$/;\n if (reg.test(stmts[i])) {\n stmts[i] = '';\n }\n }\n return statements;\n }", "title": "" }, { "docid": "ad958077e1a51ed96ac524f59a8e8fd7", "score": "0.53727514", "text": "insertComment() {\n let regex = /\\# .*/;\n let comment = `<!--\nThis file is auto-generated from a 'template.md'\nfile using the 'md-process' script.\nTherefore *DO NOT* edit this file directly!\nInstead edit the template file and then run 'md-process'.\n-->\n`\n this.content = this.content.replace(regex, function(topHeader) {\n console.log('Inserting comment before topHeader:', topHeader);\n return comment + '\\n' + topHeader;\n });\n\n return this;\n }", "title": "" }, { "docid": "da634912eafcf510edceb2b52457cd08", "score": "0.5363503", "text": "function inject () {\n\t\tconst observerConfig = {childList: true, subtree: true};\n\t\tconst commentObserver = new MutationObserver(e => {\n\t\t\tfor (let mut of e) {\n\t\t\t\tif (mut.target.id == \"comments\") {\n\t\t\t\t\tcommentObserver.disconnect();\n\t\t\t\t\tcommentObserver.observe(mut.target, observerConfig);\n\t\t\t\t} else if (mut.target.id == \"contents\") {\n\t\t\t\t\tfor (let n of mut.addedNodes) {\n\t\t\t\t\t\tlet main = n.querySelector(\"#body>#main\");\n\t\t\t\t\t\tif (!main) continue;\n\n\t\t\t\t\t\tlet tb = main.querySelector(QS_TRANSLATE_BUTTON);\n\t\t\t\t\t\tif (tb != null) {\n\t\t\t\t\t\t\tif (tb._ntext.parentNode) {\n\t\t\t\t\t\t\t\ttb._ntext.parentNode.appendChild(tb._otext);\n\t\t\t\t\t\t\t\ttb._ntext.parentNode.removeChild(tb._ntext);\n\t\t\t\t\t\t\t\ttb.innerText = TRANSLATE_TEXT;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttb._ntext.innerText = \"\";\n\t\t\t\t\t\t\ttb.onclick = TranslateButton_Translate;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmain.querySelector(QS_BUTTON_CONTAINER).appendChild(TranslateButton(main));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tcommentObserver.observe(document, observerConfig);\n\t}", "title": "" }, { "docid": "282f65ec903b8612201054eb28a892c3", "score": "0.53304446", "text": "adjustExpectedComments(change) {\n this.expectedComments += change\n this.checkLoadCompletion()\n }", "title": "" }, { "docid": "c5f2927455008b1b5d102232c1626236", "score": "0.53163767", "text": "function createCommentTagEvaluator(contentLiteral) {\n generate.statement(function () {\n generate.call(generate.writer('comment'), [defer(contentLiteral)]);\n });\n }", "title": "" }, { "docid": "f5d57f3abb3b23cb485681f53fef784d", "score": "0.52659696", "text": "function toComment(sourceMap){\n// eslint-disable-next-line no-undef\nvar base64=btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\nvar data='sourceMappingURL=data:application/json;charset=utf-8;base64,'+base64;\n\nreturn '/*# '+data+' */';\n}", "title": "" }, { "docid": "b30e853db080c8ff6be3f26c5f57f6c1", "score": "0.52480924", "text": "function decorateComment(node, comment) {\n var childNodes = getSortedChildNodes(node);\n\n // Time to dust off the old binary search robes and wizard hat.\n var left = 0, right = childNodes.length;\n while (left < right) {\n var middle = (left + right) >> 1;\n var child = childNodes[middle];\n\n if (comparePos(child.loc.start, comment.loc.start) <= 0 &&\n comparePos(comment.loc.end, child.loc.end) <= 0) {\n // The comment is completely contained by this child node.\n decorateComment(comment.enclosingNode = child, comment);\n return; // Abandon the binary search at this level.\n }\n\n if (comparePos(child.loc.end, comment.loc.start) <= 0) {\n // This child node falls completely before the comment.\n // Because we will never consider this node or any nodes\n // before it again, this node must be the closest preceding\n // node we have encountered so far.\n var precedingNode = child;\n left = middle + 1;\n continue;\n }\n\n if (comparePos(comment.loc.end, child.loc.start) <= 0) {\n // This child node falls completely after the comment.\n // Because we will never consider this node or any nodes after\n // it again, this node must be the closest following node we\n // have encountered so far.\n var followingNode = child;\n right = middle;\n continue;\n }\n\n throw new Error(\"Comment location overlaps with node location\");\n }\n\n if (precedingNode) {\n comment.precedingNode = precedingNode;\n }\n\n if (followingNode) {\n comment.followingNode = followingNode;\n }\n}", "title": "" }, { "docid": "d85646c5287cae397178097e16de8a10", "score": "0.5229317", "text": "function insertSnippet(url, name, compressedHTML, codeClass, query, lineNumbers) {\n function Html(html) { this.html = html; }\n function jsonML(json, prefixTags, suffixTags) {\n // Render strings as text nodes\n if (typeof json === 'string') { return document.createTextNode(json); }\n var node, first;\n for (var i = 0, l = json.length; i < l; i++) {\n var part = json[i];\n\n if (!node) {\n if (typeof part === 'string') {\n node = document.createElement(part);\n first = true;\n continue;\n } else {\n node = document.createDocumentFragment();\n }\n }\n\n // Except the first item if it's an attribute object\n if (first && typeof part === 'object' && Object.prototype.toString.call(part) !== '[object Array]' && !(part instanceof Html)) {\n for (var key in part) {\n if (part.hasOwnProperty(key)) {\n node.setAttribute(key, part[key]);\n\n }\n }\n } else {\n // Functions are a hack to embed pre-generated html\n if (part instanceof Html) {\n var indentation = \"&nbsp;&nbsp;&nbsp;&nbsp;\"; // IE7 discards leading tabs\n node.innerHTML = prefixTags + part.html.replace(/\\t/g, indentation) + suffixTags;\n } else {\n node.appendChild(jsonML(part, prefixTags, suffixTags));\n }\n }\n first = false;\n }\n return node;\n }\n\n var tags = document.getElementsByTagName(\"script\");\n\n for (var i = 0, l = tags.length; i < l; i++) {\n var tag = tags[i];\n var src = tag.getAttribute('src');\n if (!(src && src.substr(src.length - url.length) === url)) { continue; }\n\n var html = compressedHTML.replace(/<@/g, \"<span class=\").replace(/@>/g, \"span>\"),\n markup = [\"div\", {\"class\":\"snippet\"}],\n // IE7 discards newlines unless we provide <PRE>-wrapped content to innerHTML\n // therefore it's better to provide it as a string\n prefixTags = '<pre class=\"prettyprint\"><code class=\"' + (codeClass || '') + '\">',\n suffixTags = '</code></pre>',\n preCode = [\"div\", new Html(html)],\n snippetHeader, divLineNumbers;\n\n markup.splice(2, 0, preCode);\n\n if (query && !query.noheader) {\n snippetHeader = [\"h5\", {\"class\": \"filename\"}, [\"strong\", \"FILE\"], \"/\" + name];\n if (query.linestart) {\n snippetHeader.push([\"span\", {\"class\": \"lines\" }, \"L \"+ query.linestart + \"-\" + query.lineend]);\n }\n markup.splice(2, 0, snippetHeader);\n }\n\n if (query && query.numbers) {\n var list = [], start = 1, end = lineNumbers;\n divLineNumbers = [\"div\", {\"class\": \"linenumbers noheader\"}];\n\n if (query && !query.noheader) {\n divLineNumbers = [\"div\", {\"class\": \"linenumbers\"}];\n }\n\n if (query.linestart) { start = parseInt(query.linestart, 10); end = (parseInt(query.lineend, 10) + 1); }\n for (var cont = start; cont < end; cont++) {\n list.push([\"div\", cont.toString()]);\n }\n\n divLineNumbers.push(list);\n\n if (query && !query.noheader) {\n markup.splice(3,0, divLineNumbers);\n } else {\n markup.splice(2,0, divLineNumbers);\n }\n }\n\n var snippet = jsonML(markup, prefixTags, suffixTags);\n\n // Replace script tag with the snippet\n tag.parentNode.replaceChild(snippet, tag);\n\n break;\n }\n}", "title": "" }, { "docid": "1b449e28feeaec911240d46681248487", "score": "0.5199115", "text": "function toComment(sourceMap) {\r\n\t// eslint-disable-next-line no-undef\r\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\r\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\r\n\r\n\treturn '/*# ' + data + ' */';\r\n}", "title": "" }, { "docid": "34ff4fc143f43c74cca3d97928be5b70", "score": "0.51947445", "text": "onComment(comment) {}", "title": "" }, { "docid": "d0f2e16c59be2ff5d30caefe6d92669e", "score": "0.5186929", "text": "function mungeComment() {\r\n mungeCommentQuoteURLs();\r\n // Previous munges are copied back to cccp_comment;\r\n cccp_comment.value=cccp_comment_dom.innerHTML\r\n mungeCommentCode();\r\n}", "title": "" }, { "docid": "7f69b68da3a6701900c5c2626b83c942", "score": "0.5182623", "text": "function paintComments (commentObj){\n var $newComment = $(\"<div />\");\n var $textComment = $(\"<p />\");\n\n $newComment.addClass(\"comments-container\");\n\n $newComment.append($textComment);\n $textComment.text(commentObj.comment);\n\n//se agrega el elemento creado por el DOM a un elemento que está en HTML\n $(\"#comments-container\").prepend($newComment);\n\n}", "title": "" }, { "docid": "7f69b68da3a6701900c5c2626b83c942", "score": "0.5182623", "text": "function paintComments (commentObj){\n var $newComment = $(\"<div />\");\n var $textComment = $(\"<p />\");\n\n $newComment.addClass(\"comments-container\");\n\n $newComment.append($textComment);\n $textComment.text(commentObj.comment);\n\n//se agrega el elemento creado por el DOM a un elemento que está en HTML\n $(\"#comments-container\").prepend($newComment);\n\n}", "title": "" }, { "docid": "330ea21dbc87dad471c86fa28ddc2658", "score": "0.5161298", "text": "function toComment(sourceMap) {\n\t\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "0648286c82a4307bdf2c066ebc02f9d5", "score": "0.5158566", "text": "function decorateComment(node, comment, lines) {\n\t var childNodes = getSortedChildNodes(node, lines);\n\t // Time to dust off the old binary search robes and wizard hat.\n\t var left = 0;\n\t var right = childNodes && childNodes.length;\n\t var precedingNode;\n\t var followingNode;\n\t while (typeof right === \"number\" && left < right) {\n\t var middle = (left + right) >> 1;\n\t var child = childNodes[middle];\n\t if (util_1$2.comparePos(child.loc.start, comment.loc.start) <= 0 &&\n\t util_1$2.comparePos(comment.loc.end, child.loc.end) <= 0) {\n\t // The comment is completely contained by this child node.\n\t decorateComment((comment.enclosingNode = child), comment, lines);\n\t return; // Abandon the binary search at this level.\n\t }\n\t if (util_1$2.comparePos(child.loc.end, comment.loc.start) <= 0) {\n\t // This child node falls completely before the comment.\n\t // Because we will never consider this node or any nodes\n\t // before it again, this node must be the closest preceding\n\t // node we have encountered so far.\n\t precedingNode = child;\n\t left = middle + 1;\n\t continue;\n\t }\n\t if (util_1$2.comparePos(comment.loc.end, child.loc.start) <= 0) {\n\t // This child node falls completely after the comment.\n\t // Because we will never consider this node or any nodes after\n\t // it again, this node must be the closest following node we\n\t // have encountered so far.\n\t followingNode = child;\n\t right = middle;\n\t continue;\n\t }\n\t throw new Error(\"Comment location overlaps with node location\");\n\t }\n\t if (precedingNode) {\n\t comment.precedingNode = precedingNode;\n\t }\n\t if (followingNode) {\n\t comment.followingNode = followingNode;\n\t }\n\t}", "title": "" }, { "docid": "45fbef150250a0ab2c8f5c9b3f8590f4", "score": "0.51544935", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\t\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "45fbef150250a0ab2c8f5c9b3f8590f4", "score": "0.51544935", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\t\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "45fbef150250a0ab2c8f5c9b3f8590f4", "score": "0.51544935", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\t\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "8e25aaa48f13ac3a19ddb9de558ad622", "score": "0.5151743", "text": "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "8e25aaa48f13ac3a19ddb9de558ad622", "score": "0.5151743", "text": "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "0c606d0d156578812c8f6c63b8d285b9", "score": "0.51510996", "text": "function toComment(sourceMap) {\n\t var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\t var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t return '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "9e2ab0b4db6709192e91d11867c1f741", "score": "0.51486236", "text": "function decorateComment(node, comment, lines) {\n\t var childNodes = getSortedChildNodes(node, lines);\n\n\t // Time to dust off the old binary search robes and wizard hat.\n\t var left = 0, right = childNodes.length;\n\t while (left < right) {\n\t var middle = (left + right) >> 1;\n\t var child = childNodes[middle];\n\n\t if (comparePos(child.loc.start, comment.loc.start) <= 0 &&\n\t comparePos(comment.loc.end, child.loc.end) <= 0) {\n\t // The comment is completely contained by this child node.\n\t decorateComment(comment.enclosingNode = child, comment, lines);\n\t return; // Abandon the binary search at this level.\n\t }\n\n\t if (comparePos(child.loc.end, comment.loc.start) <= 0) {\n\t // This child node falls completely before the comment.\n\t // Because we will never consider this node or any nodes\n\t // before it again, this node must be the closest preceding\n\t // node we have encountered so far.\n\t var precedingNode = child;\n\t left = middle + 1;\n\t continue;\n\t }\n\n\t if (comparePos(comment.loc.end, child.loc.start) <= 0) {\n\t // This child node falls completely after the comment.\n\t // Because we will never consider this node or any nodes after\n\t // it again, this node must be the closest following node we\n\t // have encountered so far.\n\t var followingNode = child;\n\t right = middle;\n\t continue;\n\t }\n\n\t throw new Error(\"Comment location overlaps with node location\");\n\t }\n\n\t if (precedingNode) {\n\t comment.precedingNode = precedingNode;\n\t }\n\n\t if (followingNode) {\n\t comment.followingNode = followingNode;\n\t }\n\t}", "title": "" }, { "docid": "a5f98009c0b48ff9e4f6e30f073ab1c0", "score": "0.5130301", "text": "function decorateComment(node, comment) {\n var childNodes = getSortedChildNodes(node);\n // Time to dust off the old binary search robes and wizard hat.\n var left = 0, right = childNodes.length;\n while (left < right) {\n var middle = (left + right) >> 1;\n var child = childNodes[middle];\n if (recast.comparePos(child.loc.start, comment.loc.start) <= 0 && recast.comparePos(comment.loc.end, child.loc.end) <= 0) {\n // The comment is completely contained by this child node.\n decorateComment(comment.enclosingNode = child, comment);\n return; // Abandon the binary search at this level.\n }\n if (recast.comparePos(child.loc.end, comment.loc.start) <= 0) {\n // This child node falls completely before the comment.\n // Because we will never consider this node or any nodes\n // before it again, this node must be the closest preceding\n // node we have encountered so far.\n var precedingNode = child;\n left = middle + 1;\n continue;\n }\n if (recast.comparePos(comment.loc.end, child.loc.start) <= 0) {\n // This child node falls completely after the comment.\n // Because we will never consider this node or any nodes after\n // it again, this node must be the closest following node we\n // have encountered so far.\n var followingNode = child;\n right = middle;\n continue;\n }\n throw new Error(\"Comment location overlaps with node location\");\n }\n if (precedingNode) {\n comment.precedingNode = precedingNode;\n }\n if (followingNode) {\n comment.followingNode = followingNode;\n }\n }", "title": "" }, { "docid": "1971bced96c255274e4d68583bd88297", "score": "0.51266176", "text": "function preProcessJavaScript(target) {\n\n var source = target.innerHTML;\n source = js_beautify(source);\n target.innerHTML = source;\n }", "title": "" }, { "docid": "f9a3a0ee3de53aa4d6c92fe7fc02619a", "score": "0.5114627", "text": "function attachComment(stmts) {\n\tif(!stmts.length)\n\t return;\n\n\tvar comment_text = \"\";\n\tfor(var i=1;i<arguments.length;++i) {\n\t var fragment = arguments[i];\n\t if(typeof fragment !== 'string')\n\t\tfragment = options.pp(fragment);\n\t if(typeof fragment !== 'string')\n\t\treturn;\n\t comment_text += fragment;\n\t}\n\tcomment_text = ' ' + comment_text.replace(/\\s+/g, ' ');\n\t\n\tif(!stmts[0].leadingComments)\n\t stmts[0].leadingComments = [];\n\tstmts[0].leadingComments.push({ type: 'Line', value: comment_text });\n }", "title": "" }, { "docid": "cae7ed8d869563cc01e07353f2aabeb0", "score": "0.5097605", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "cae7ed8d869563cc01e07353f2aabeb0", "score": "0.5097605", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "cae7ed8d869563cc01e07353f2aabeb0", "score": "0.5097605", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "cae7ed8d869563cc01e07353f2aabeb0", "score": "0.5097605", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "cae7ed8d869563cc01e07353f2aabeb0", "score": "0.5097605", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "cae7ed8d869563cc01e07353f2aabeb0", "score": "0.5097605", "text": "function toComment(sourceMap) {\n\t\t// eslint-disable-next-line no-undef\n\t\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\t\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\t\treturn '/*# ' + data + ' */';\n\t}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" }, { "docid": "aaf0e50f171bbd38cc8b2349baa9ed2c", "score": "0.5097082", "text": "function toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "title": "" } ]
6e901846ab1f5a07615010af4ff8750a
this should not be used outside of visualize
[ { "docid": "1138f2ef0a3503bce7c98ceec76680db", "score": "0.0", "text": "_setUiState(uiState) {\n if (uiState instanceof PersistedState) {\n this.__uiState = uiState;\n }\n }", "title": "" } ]
[ { "docid": "42c03673c6a29ae7d00f4e630e82fb65", "score": "0.58258104", "text": "display(){\n //this.enableNormalViz();\n super.display();\n\t}", "title": "" }, { "docid": "e0e69d7e565497b199cac5e2b90ff7b8", "score": "0.5819342", "text": "function buildPlot() {\n // @TODO: YOUR CODE HERE\n}", "title": "" }, { "docid": "36fd9a6284d5f55c4c9258b9a5f72be6", "score": "0.57426935", "text": "function showTitle() {\n vis.style(\"display\", \"none\");\n g.selectAll('line').remove();\n }", "title": "" }, { "docid": "e64b562ead17c5870ee9642b6e46edf0", "score": "0.57354355", "text": "function plotStaticSingle() {\n plotClsSingle();\n plotmPkSingle();\n}", "title": "" }, { "docid": "04c8ce3d5ec6842220250729bf332974", "score": "0.57160604", "text": "drawGraphic(){\n let sn = this.shortNames(this.props.data);\n let canvas = this.setCanvas();\n let scales = this.setScales(sn);\n let axis = this.setAxis(scales);\n this.setAxisToCanvas(canvas, axis);\n this.drawBars(canvas, sn, scales);\n this.setLabelBars(canvas, sn, scales, this.props.language, this.props.percentage_y);\n this.setGridLines(canvas, axis, scales); \n }", "title": "" }, { "docid": "cf06638afb73262ee669c470f88f1401", "score": "0.5708182", "text": "function showELines(){\n //flag=false;\n step();\n g.selectAll(\".ptchangelable\").remove();\n vis.style(\"display\", \"inline-block\");\n }", "title": "" }, { "docid": "4bcd87887bee8107c9c771e2b324c708", "score": "0.5672246", "text": "exportVisualModel() {\n let iv = this.i.ia();\n return (iv);\n }", "title": "" }, { "docid": "047bb3cfe91e7cc3f710177c562d4cbd", "score": "0.56715876", "text": "getPlotDesc() { return this.plotDesc; }", "title": "" }, { "docid": "e787653d09317659becd66fd5bbd3f88", "score": "0.5643245", "text": "function M$3(t){const{view:n,graphic:i}=t,o=new e$1({graphic:i}),a=[],r=C$2(t,o,a);return P$2(t,o,a,r),a.push(n.trackGraphicState(o)),{visualElement:r,remove(){r$8(a).remove();}}}", "title": "" }, { "docid": "19efcca1295c4a6aee10893d4faab343", "score": "0.56397134", "text": "function CollaborativeGraph(){\n\n}", "title": "" }, { "docid": "873090e1f9d97675c43b6c6e5c9ad1ed", "score": "0.5637222", "text": "visualize(eeImage) {\n const options = this.options\n\n return eeImage.visualize(\n options.legend\n ? options.params\n : {\n min: 0,\n max: this._legend.length - 1,\n palette: options.params.palette,\n }\n )\n }", "title": "" }, { "docid": "7bff1d8151f119ad98f46b0ace22c48d", "score": "0.5631805", "text": "function visualize(){\n\tif(clickable){\n\t\tclearPath();\n\t\tif(algo == -1){\n\n\t\t}\n\t\telse if(algo == 0){\n\t\t\tdijkstra(strtIndex, finIndex);\n\t\t}\n\t\telse if(algo == 1){\n\t\t\tastar(strtIndex, finIndex);\n\t\t}\n\t\telse if(algo == 3){\n\t\t\tdfs(strtIndex, finIndex);\n\t\t}\n\t\telse if(algo == 2){\n\t\t\tbfs(strtIndex, finIndex);\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "9c92578b0cbf4a8a192062e5693c3c0b", "score": "0.5631368", "text": "function showTitle() {\n\n g.selectAll(\".locator\")\n .transition()\n .duration(500)\n .style(\"fill\",\"none\")\n .style(\"opacity\",0)\n\n g.selectAll(\".count-title\")\n .transition()\n .duration(0)\n .attr(\"opacity\", 0);\n\n g.selectAll(\".openvis-title\")\n .transition()\n .duration(600)\n .attr(\"opacity\", 1.0);\n\n g.select(\"#chinaLine\")\n .transition()\n .duration(700)\n .ease(\"linear\")\n .style(\"stroke-dashoffset\", 15000);\n\n svg.selectAll(\".annotation\")\n .transition()\n .ease(\"linear\")\n .style(\"opacity\", 0);\n\n svg.selectAll(\".axis_lable\")\n .transition()\n .duration(500)\n .style(\"opacity\",0)\n\n g.select(\".chinaY\")\n .transition()\n .duration(500)\n .style('opacity',0)\n\n hideAxis(xAxisLine, yAxis);\n }", "title": "" }, { "docid": "408cf86cc4f14214e89005748e9156c9", "score": "0.5612832", "text": "function _showVisualizationStep() {\n RightMenu.showRightMenu(Pages.modifySerieGraphTypeStep, currentGraph);\n }", "title": "" }, { "docid": "e53796dac5db2ca11aa013413dd05587", "score": "0.5598678", "text": "renderVis() {\n const vis = this;\n }", "title": "" }, { "docid": "4a38174e388cf6477941db8bf2950825", "score": "0.557975", "text": "createVisualizer() {\n this._canvas.width = this._canvas.parentNode.offsetWidth;\n this._canvas.height = this._canvas.parentNode.offsetHeight;\n\n this.visualizer = {\n ctx: this._canvas.getContext('2d'),\n height: this._canvas.height,\n width: this._canvas.width,\n barWidth: this._canvas.width / this.state.eq.bands.length\n };\n\n this.drawVisualizer();\n }", "title": "" }, { "docid": "e3a380cc8d6c99e9d7f6d81ded0317f4", "score": "0.5575458", "text": "displaySequence(sequence) {\n this.visualizer = new mm.Visualizer(\n sequence, this.querySelector('#canvas'),\n {pixelsPerTimeStep: this.pixelsPerTimeStep, noteSpacing:0.1});\n }", "title": "" }, { "docid": "7b2a41c7e7829ca3000298708a5e599f", "score": "0.5569851", "text": "function visualize(element) {\n var nodeEdges = [1, 2, 3, 4];\n //graph = new Visualizer(element);\n //for (var i = 0; i < nodesEdges.length ; ++i) {\n // graph.addLink(nodeEdges[i].source, nodeEdge[i].target);\n //}\n d3.select(element).selectAll(\"h2\").data(nodeEdges).enter().append(\"h2\").text(function (d) { return \"We did it \" + d;});\n}", "title": "" }, { "docid": "7c57aaeba1326354f3609a162ce156d3", "score": "0.55682844", "text": "function renderStructure() {\r\n svg.transition().attr('width', totalW)\r\n .attr('height', totalH);\r\n }", "title": "" }, { "docid": "47ca4be29893c4c30aea79c5128a7810", "score": "0.55316347", "text": "function initBlobVis(){\n // clear out the old visualisation if needed\n if (visjsobj != undefined){\n visjsobj.destroy();\n }\n // find all songs from the Songs collection\n var songs = Songs.find({});\n var nodes = new Array();\n var ind = 0;\n\n var highestVal = 0;\n var lowestVal = 0;\n var highestLabel = \"\";\n var lowestLabel = \"\";\n // iterate the songs, converting each song into \n // a node object that the visualiser can understand\n songs.forEach(function(song){\n // set up a label with the song title and artist\n var label = \"ind: \"+ind;\n if (song.metadata.tags.title != undefined){// we have a title\n label = song.metadata.tags.artist[0] + \" - \" + \n song.metadata.tags.title[0];\n } \n // figure out the value of this feature for this song\n var value = song[Session.get(\"feature\")[\"type\"]][Session.get(\"feature\")[\"name\"]];\n\n if (value>highestVal) {\n highestVal = value;\n highestLabel = label;\n } if (value<lowestVal || lowestVal==0) {\n lowestVal = value;\n lowestLabel = label;\n } \n\n // create the node and store it to the nodes array\n nodes[ind] = {\n id:ind, \n label:label, \n value:value,\n }\n ind ++;\n })\n // edges are used to connect nodes together. \n // we don't need these for now...\n edges =[\n ];\n // this data will be used to create the visualisation\n var data = {\n nodes: nodes,\n edges: edges\n };\n // options for the visualisation\n var options = {\n nodes: {\n shape: 'dot',\n }\n };\n // get the div from the dom that we'll put the visualisation into\n container = document.getElementById('visjs');\n showStats(highestVal, highestLabel, lowestVal, lowestLabel);\n // create the visualisation\n visjsobj = new vis.Network(container, data, options);\n}", "title": "" }, { "docid": "cf6e7c749a2017e87d049ad6c8db8f56", "score": "0.55248696", "text": "async function doviz_rt() {\n let data = await fetch_imaginea_json(\"rt_daily_summary\");\n\n let spec = {\n width: 'container',\n data: { values: data.states },\n //height: 'container',\n layer: [\n {\n mark: {\n type: \"errorbar\",\n color: \"grey\",\n ticks: true\n },\n encoding: {\n x: {\n field: \"p95\",\n type: \"quantitative\",\n title: \"Rt\"\n },\n x2: {\n field: \"p05\"\n },\n y: {\n field: \"state_name\",\n type: \"ordinal\",\n title: \"State\",\n sort: null\n },\n tooltip: [\n { field: \"state_name\", type: \"nominal\", title: \"State\" },\n { field: \"p05\", type: \"quantitative\", title: \"5 %tile\", format: \".2f\" },\n { field: \"p95\", type: \"quantitative\", title: \"95 %tile\", format: \".2f\" }\n ]\n }\n },\n {\n mark: {\n type: \"errorbar\",\n color: \"crimson\",\n ticks: true\n },\n encoding: {\n x: {\n field: \"p75\",\n type: \"quantitative\",\n title: \"Rt\"\n },\n x2: {\n field: \"p25\"\n },\n y: {\n field: \"state_name\",\n type: \"ordinal\",\n title: \"State\",\n sort: null\n },\n tooltip: [\n { field: \"state_name\", type: \"nominal\", title: \"State\" },\n { field: \"p25\", type: \"quantitative\", title: \"25 %tile\", format: \".2f\" },\n { field: \"p75\", type: \"quantitative\", title: \"75 %tile\", format: \".2f\" }\n ] \n }\n }, \n {\n mark: {\n type: \"point\",\n filled: true,\n color: \"blue\",\n size: 50\n },\n encoding: {\n x: {\n field: \"rt\",\n type: \"quantitative\"\n },\n y: {\n field: \"state_name\",\n type: \"ordinal\",\n title: \"State\",\n sort: null\n },\n tooltip: [\n { field: \"state_name\", type: \"nominal\", title: \"State\" },\n { field: \"rt\", type: \"quantitative\", title: \"Mean Rt\", format: \".2f\" },\n { field: \"p05\", type: \"quantitative\", title: \"5 %tile\", format: \".2f\" },\n { field: \"p95\", type: \"quantitative\", title: \"95 %tile\", format: \".2f\" },\n { field: \"p25\", type: \"quantitative\", title: \"25 %tile\", format: \".2f\" },\n { field: \"p75\", type: \"quantitative\", title: \"75 %tile\", format: \".2f\" },\n\n { field: \"daily_cases\", type: \"quantitative\", title: \"Cases\" },\n { field: \"date\", type: \"nominal\", title: \"Date\" }\n ]\n }\n },\n {\n data: { values: [{rt: 1.0}] },\n mark: { type: \"rule\", color: \"darkgrey\", size: 3 },\n encoding: {\n x: { field: \"rt\", type: \"quantitative\" }\n }\n }\n ]\n };\n\n vegaEmbed('#vis_rt', spec);\n}", "title": "" }, { "docid": "f58d282471636d1e4659425f5c8753e0", "score": "0.55160517", "text": "function GraphCollection(){\n\tthis.data = {};\n\tthis.worksheets = {};\n\t\n\tthis.graphs = [];\n\tthis.selectedGraphIndex = 0;\n\tthis.datasetsMenuShowing = false;\n\tthis.datasetsVisible = {};\n\t\n\t//Drawing Variables\n\tthis.w = this.calcGraphWidth();\n\tthis.h = this.calcGraphHeight();\n\tthis.padBot = 0;\n\tthis.padTop = 32;\n\tthis.padLeft = 35;\n\tthis.padRight = 25;\n\tthis.defaultGraphHeight = 200;\n\tthis.labelTextSize = \"16\";\n\tthis.allOtherTextSize = \"14\";\n\tthis.tickTextSize = \"12\";\n\tthis.buckets = 30;\n\tthis.bucketDotSize = 5;\n\tthis.numberOfCategories = 0;\n\t\n\t//Colors\n\tthis.categoryColors = {};\n\tthis.colorScale = pv.Colors.category20(0,20);\n\t\n\tthis.numberOfAddedCategories = this.numberOfCategories;\n\t\n\t//Used to draw edited category titles in red\n\tthis.editedCategories = {};\n\n\t//Increments a value added to end of default labels\n\tthis.nextDefaultLabel = {};\n\n\t//Mode flags\n\tthis.editModeEnabled = false;\n\tthis.advancedUser = false;\n\tthis.buttonIcon = true;\n\tthis.buttonText = true;\n\t\n\t//for highlighting points with the same label\n\tthis.selectedLabel = null;\n\t\n\tthis.nextSampleSetNumber = 0;\n\tthis.nextResampleSetNumber = 0;\n\tthis.nextIntermedResampleSetNumber = 0;\n\t\n\tthis.resamplingEnabled = false;\n\t\n\tthis.bwMode = false;\n\tthis.lineMode = false;\n\t\n\tthis.nextDefaultCategoryNumber = 0;\n\t\n\tthis.printMode = false;\n}", "title": "" }, { "docid": "dd9e3d0dbf93ba0c4f49acf9fe487e05", "score": "0.5507274", "text": "async function doviz() {\n let confirmed = await data_confirmed;\n let columnar = countrySeries(21, window_length, confirmed, \"India\", \"US\", \"United Kingdom\");\n let multiplexed = multiplex(transpose(columnar), \"date\", \"d2dpcnt\", \"country\");\n\n let spec = {\n width: 'container',\n //height: 'container',\n layer: [\n {\n data: {\n values: multiplexed\n },\n selection: {\n hover: {\n type: \"single\",\n on: \"mouseover\",\n empty: \"all\",\n fields: [\"country\"],\n init: {country: \"India\"}\n }\n },\n mark: { type: \"line\", point: { size: 70 } },\n transform: [\n { calculate: \"log(2)/log(1+datum.d2dpcnt/100)\", as: \"dbl\", type: \"quantitative\" },\n { calculate: \"(datum.d2dpcnt > 0 ? '+' : '')+floor(datum.d2dpcnt)+'.'+(floor(datum.d2dpcnt*10)%10)+'%'\", as: \"pcnttext\", type: \"text\" },\n { calculate: \"(datum.d2dpcnt_chg > 0 ? '+' : '')+datum.d2dpcnt_chg\", as: \"abschg\", type: \"text\" },\n { calculate: \"''+(datum.d2dpcnt_dbl > 0 ? datum.d2dpcnt_dbl + ' days' : 'N/A')\", as: \"dblperiod\", type: \"text\" },\n //{ calculate: \"'' + (datum.d2dpcnt_wow > 1 ? '+' : '') + round((datum.d2dpcnt_wow-1)*100) + '%'\", as: \"wowpcnt\", type: \"text\" }\n { calculate: \"(datum.d2dpcnt_wow > 1 ? '+' : '')+floor((datum.d2dpcnt_wow-1)*100)+'%'\", as: \"wowpcnt\", type: \"text\" }\n ],\n encoding: {\n x: {field: \"date\", type: \"temporal\"},\n y: {field: \"dbl\", type: \"quantitative\", title: '['+window_length+\" day avg] Doubling period in days\"},\n tooltip: [\n { field: \"pcnttext\", type: \"nominal\", title: '['+window_length+\" day avg] D2D %\" },\n { field: \"abschg\", type: \"nominal\", title: \"D2D change\" },\n { field: \"dblperiod\", type: \"nominal\", title: \"Doubled in\" },\n { field: \"wowpcnt\", type: \"nominal\", title: \"Weekly cases growth %\" },\n { field: \"d2dpcnt\" + suffix_cum, type: \"quantitative\", title: \"Confirmed cases\" }\n ],\n color: {\n condition: { selection: \"hover\", field: \"country\", type: \"nominal\" },\n value: \"grey\"\n },\n opacity: {\n condition: { selection: \"hover\", value: 1 },\n value: 0.2\n },\n strokeWidth: { condition: { selection: \"hover\", value: 3 }, value: 1 }\n }\n }]\n };\n\n vegaEmbed('#vis', spec);\n}", "title": "" }, { "docid": "41afb0dbed60b104cc8dc0959a6f0ebb", "score": "0.5501279", "text": "function VisualizeHelper() {\n\n this.convertLayers = function (inputLayer, hiddenLayers, outputLayer) {\n inputLayer = jQuery.extend(true, {}, inputLayer);\n hiddenLayers = jQuery.extend(true, [], hiddenLayers);\n outputLayer = jQuery.extend(true, {}, outputLayer);\n\n let inputHasBias = hiddenLayers && hiddenLayers[0] ? hiddenLayers[0].hasBias : outputLayer.hasBias;\n let drawableInputLayer = convertToDrawableLayer(inputLayer, inputHasBias);\n \n let drawableHiddenLayers = [];\n for (let i = 0; i < hiddenLayers.length; i++) {\n let nextLayerHasBias = (i + 1) >= hiddenLayers.length ? outputLayer.hasBias : hiddenLayers[i + 1].hasBias;\n drawableHiddenLayers.push(convertToDrawableLayer(hiddenLayers[i], nextLayerHasBias));\n }\n let drawableOutputLayer = convertToDrawableLayer(outputLayer, false);\n\n let layers = [];\n layers.push(drawableInputLayer);\n for (let i = 0; i < drawableHiddenLayers.length; i++) {\n layers.push(drawableHiddenLayers[i]);\n }\n layers.push(drawableOutputLayer);\n\n for (let i = 0; i < layers.length; i++) {\n layers[i].hasBias = layerHasBiasNeuron(layers[i]);\n if (i + 1 <= layers.length - 1 && layers[i].hasBias) {\n layers[i + 1].hasBias = false;\n }\n }\n\n return layers;\n }\n\n /**\n * Checks if the layer has a bias neuron\n * @param {Layer} layer\n * @returns {bool} hasBias\n */\n function layerHasBiasNeuron(layer) {\n let hasBias;\n for (let n = 0; n < layer.neurons.length; n++) {\n let neuron = layer.neurons[n];\n if (neuron.isBias) {\n hasBias = true;\n break;\n }\n }\n return hasBias;\n }\n\n /**\n * Convert the layer to a drawable layer\n * @param {layer} layer\n * @param {bool} nextLayerHasBias\n * @returns {layer} drawable layer\n */\n var convertToDrawableLayer = function (layer, nextLayerHasBias) {\n let drawLayer = jQuery.extend({}, layer);\n drawLayer.neurons = [];\n layer.neurons = parseInt(layer.neurons);\n if (nextLayerHasBias) {\n layer.neurons++;\n }\n for (let i = 0; i < layer.neurons; i++) {\n drawLayer.neurons.push({ neuronValue: false, isBias: i == 0 ? nextLayerHasBias : false, weights: null, value: null });\n }\n return drawLayer;\n }\n}", "title": "" }, { "docid": "e0ede5a87f5a2068eaa8f0e7e99fa594", "score": "0.54965776", "text": "function plot() {}", "title": "" }, { "docid": "9b5c6683a451eec7d70d0565dbfb955d", "score": "0.54937917", "text": "show() {\n stroke(255)\n noFill()\n strokeWeight(1)\n rectMode(CENTER)\n rect(\n this.boundary.x,\n this.boundary.y,\n this.boundary.w * 2,\n this.boundary.h * 2\n )\n for (let p of this.points) {\n strokeWeight(2)\n point(p.x, p.y)\n }\n\n if (this.divided) {\n this.northeast.show()\n this.northwest.show()\n this.southeast.show()\n this.southwest.show()\n }\n }", "title": "" }, { "docid": "09cec39c6b7f564c3507791ba0a0450c", "score": "0.54716986", "text": "_firstRendered() {}", "title": "" }, { "docid": "6649fc4ad5a4d0b6e5d4970284ef5360", "score": "0.54485154", "text": "function initDateVis(){\n // clear out the old visualisation if needed\n if (visjsobj != undefined){\n visjsobj.destroy();\n }\n var songs = Songs.find({});\n var ind = 0;\n // generate an array of items\n // from the songs collection\n // where each item describes a song plus the currently selected\n // feature\n var items = new Array();\n\n var highestVal = 0;\n var lowestVal = 0;\n var highestLabel = \"\";\n var lowestLabel = \"\";\n\n // iterate the songs collection, converting each song into a simple\n // object that the visualiser understands\n songs.forEach(function(song){\n if (song.metadata.tags.date != undefined && \n song.metadata.tags.date[0] != undefined ){\n var label = \"ind: \"+ind;\n if (song.metadata.tags.title != undefined){// we have a title\n label = song.metadata.tags.artist[0] + \" - \" + \n song.metadata.tags.title[0];\n } \n var value = song[Session.get(\"feature\")[\"type\"]][Session.get(\"feature\")[\"name\"]];\n var valComp = Session.get(\"featureComp\");\n //var valComp = song.metadata.tags.date[0] + \"-01-01\";\n console.log(\"dasdada\" + valComp);\n\n var xVal = valComp != undefined ? song[Session.get(\"featureComp\")[\"type\"]][Session.get(\"featureComp\")[\"name\"]] : song.metadata.tags.date[0] + \"-01-01\";\n\n if (value>highestVal) {\n highestVal = value;\n highestLabel = label;\n } if (value<lowestVal || lowestVal==0) {\n lowestVal = value;\n lowestLabel = label;\n } \n \n // here we create the actual object for the visualiser\n // and put it into the items array\n items[ind] = {\n x: xVal, \n y: value, \n // slighlty hacky label -- check out the vis-label\n // class in song_data_viz.css \n label:{content:label, className:'vis-label', xOffset:-5}, \n };\n ind ++ ;\n }\n });\n // set up the data plotter\n var options = {\n style:'bar', \n };\n // get the div from the DOM that we are going to \n // put our graph into \n var container = document.getElementById('visjs');\n showStats(highestVal, highestLabel, lowestVal, lowestLabel);\n // create the graph\n visjsobj = new vis.Graph2d(container, items, options);\n // tell the graph to set up its axes so all data points are shown\n visjsobj.fit();\n\n}", "title": "" }, { "docid": "8cc33157ec77cf7d40ecea49c4d69409", "score": "0.544726", "text": "show() {\n if (this.display) {\n drawAxis(offset, this.rows * spacing + tableSpacingFactor * offset);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n setGradiant(this.knowledge[i][j], this.maxValue);\n strokeWeight(1);\n stroke(0);\n \n textSize(spacing * 0.3);\n \n let stringText;\n if (this.knowledge[i][j][1] == \"X\") {\n fill(0);\n rect(offset + j * spacing, this.rows * spacing + tableSpacingFactor * offset + i * spacing, spacing, spacing);\n\n fill(255, 0, 0);\n strokeWeight(2);\n //textSize(spacing * 0.8); --> deactivated for debugging porupsase\n //stroke(255, 0, 0);\n stringText = this.knowledge[i][j][0] + \" \" + this.knowledge[i][j][1] + \n \"\\n\" + this.riskKnowledgeGain[i][j] + \" \" + this.explorativeKnowledgeGain[i][j];\n //stringText = \"X\"; --> deactivated for debugging porupsase\n\n } else {\n rect(offset + j * spacing, this.rows * spacing + tableSpacingFactor * offset + i * spacing, spacing, spacing);\n fill(0);\n strokeWeight(0);\n\n stringText = this.knowledge[i][j][0] + \" \" + this.knowledge[i][j][1] + \n \"\\n\" + this.riskKnowledgeGain[i][j] + \" \" + this.explorativeKnowledgeGain[i][j];\n }\n\n textAlign(CENTER, CENTER);\n text(stringText, (offset + j * spacing) + spacing * 0.5, \n (this.rows * spacing + tableSpacingFactor * offset + i * spacing) + spacing * 0.55);\n \n }\n }\n }\n }", "title": "" }, { "docid": "fa309b7a32c400cf1762a790dca3a524", "score": "0.5432836", "text": "function stepOne(){\n nfirstLayout=true;\n //slide=1;\n draw();\n g.selectAll('line').remove();\n g.selectAll(\".ptchangelable\").remove();\n vis.style(\"display\", \"inline-block\");\n\n }", "title": "" }, { "docid": "5eadc9b542240c0f53500be09adfe83a", "score": "0.5431234", "text": "spyDisplay() {\n noStroke();\n fill(this.col);\n rect(this.x, this.y, 120, 100, 5, 5, 5, 5);\n if (this.isRed && !this.isFlipped) {\n fill(255, 68, 71);\n }\n else if(this.isBlue && !this.isFlipped) {\n fill(35, 127, 224);\n }\n else if (this.isBlack && !this.isFlipped) {\n fill(0, 0, 0);\n }\n else if (this.isNon && !this.isFlipped) {\n fill(127, 127, 127);\n }\n else {\n fill(this.textCol);\n }\n textSize(18);\n textAlign(CENTER, CENTER);\n text(this.word, this.x, this.y, 120, 100);\n }", "title": "" }, { "docid": "7d0310e945cb2dc32a0428c2be1ceee5", "score": "0.54242", "text": "display()\n {\n\t\t\n\t image(this.geoBoy, this.x,this.y);\n\t\t\n\t\t// tetsing part (forget this part)\n\t\t//push();\n\t\t//fill(255,0,0);\n\t\t//ellipse(this.x+32, this.y+32, 5, 5);\n\t\t//pop();\n\t\t\n \n }", "title": "" }, { "docid": "fd6d8c0db43d767cba89a2b3a8ea2dd6", "score": "0.54154485", "text": "function drawVisualization() {\n\n // Create and populate a data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Tag');\n data.addColumn('string', 'URL');\n\t\tdata.addColumn('number', 'Font size');\n data.addRows(8);\n data.setCell(0, 0, 'Organic Coding');\n data.setCell(0, 1, 'http://itsmyviewofthings.blogspot.com/2011/07/organic-coding.html');\n\t\tdata.setCell(0, 2, 2+2.5*7);\n data.setCell(1, 0, 'Art of Effective Computing');\n data.setCell(1, 1, 'http://itsmyviewofthings.blogspot.com/2011/04/art-of-affective-computing.html');\n\t\tdata.setCell(1, 2, 2+2.5*5);\n data.setCell(2, 0, 'Smudge Attacks');\n data.setCell(2, 1, 'http://itsmyviewofthings.blogspot.com/2011/03/smudge-attacks-for-smartphones.html');\n\t\tdata.setCell(2, 2, 2+2.5*6);\n data.setCell(3, 0, 'Denial of Service Attack on web app framework');\n data.setCell(3, 1, 'http://itsmyviewofthings.blogspot.com/2012/01/denial-of-service-on-web-app.html');\n\t\tdata.setCell(3, 2, 2+2.5*7);\n data.setCell(4, 0, 'Technological Singularity');\n data.setCell(4, 1, 'http://itsmyviewofthings.blogspot.com/2011/03/technological-singularity-not-for.html');\n\t\tdata.setCell(4, 2, 2+2.5*3);\n data.setCell(5, 0, 'Wireless Mesh Network');\n data.setCell(5, 1, 'http://itsmyviewofthings.blogspot.com/2011/02/wireless-mesh-network-using-android.html');\n\t\tdata.setCell(5, 2, 2+2.5*2);\n data.setCell(6, 0, 'Xen hypervisor on Ubuntu 11.10');\n data.setCell(6, 1, 'http://itsmyviewofthings.blogspot.com/2011/12/xen-with-ubuntu-1110-as-dom0.html');\n\t\tdata.setCell(6, 2, 2+2.5*1);\n data.setCell(7, 0, 'Android 4.0 Compile and Build');\n data.setCell(7, 1, 'http://itsmyviewofthings.blogspot.com/2011/12/compiling-and-building-android-40.html');\n\t\tdata.setCell(7, 2, 2+2.5*1);\n\n // Instantiate our table object.\n var vis = new gviz_word_cumulus.WordCumulus(document.getElementById('clouddiv'));\n\n // Draw our table with the data we created locally.\n vis.draw(data, {text_color: '#aaaaaa', speed: 190, width:900, height:400});\n}", "title": "" }, { "docid": "67a7146de70dadced16791b4e04606e0", "score": "0.5413812", "text": "show() {\n image(Sunflower, this.x, this.y, this.r, this.r);\n fill(0);\n textSize(100);\n text('Be patient, nothing in nature', 200, 280);\n text('blooms all year', 400, 480);\n //stroke(255);\n //strokeWeight(4);\n //fill(100);\n //ellipse(this.x, this.y, this.r * 2);\n }", "title": "" }, { "docid": "b737e7729ac83f90dcfb05c805df607b", "score": "0.54086363", "text": "function graphics(){\n\n // mug= s.bData( qu.gR(\"mug\") ).drag()\n\n me = createjs.bm( qu.gR(\"me\") ).drag()\n s.A( me )\n\n\n }", "title": "" }, { "docid": "b9412f0dcd4cd2e1af959569c0d84656", "score": "0.540309", "text": "exportSerializedVisualData() {\n let iv = this.i.d1();\n return (iv);\n }", "title": "" }, { "docid": "3babb49b78ba85c841a95c24fcc41461", "score": "0.5396156", "text": "#plot() {\n this.#addTopFigure();\n const rOrV = this.#ruleOrVerification();\n this.#parentDom.append(`<div class=\"accordion\" id=\"accordionPanelsStayOpenExample\">\n ${this.#tilingInfo()}\n ${rOrV}\n </div>`);\n if (!rOrV) this.#expansionsStrats();\n }", "title": "" }, { "docid": "58eb964a8758a18ae166f48611060143", "score": "0.5392721", "text": "initVis(data) {\n let vis = this;\n\n /**common variables**/\n // Keep track of which visualization we are on and which was the last\n // index activated. When user scrolls quickly, we want to call all the\n // activate functions that they pass.\n vis.lastIndex = -1;\n vis.activeIndex = 0;\n\n // vis.width = Math.min(document.documentElement.clientHeight,\n // window.innerHeight,\n // document.documentElement.clientWidth,\n // window.innerWidth)*0.6;\n // vis.height = vis.width;\n\n vis.width = $(\"#\" + vis.parentElement).width()*0.8;\n vis.height = $(\"#\" + vis.parentElement).width()*0.8;\n\n\n\n // Sizing for the grid visualization\n vis.numPerRow = 30;\n vis.numPerCol = 30;\n\n vis.circleSize = Math.floor(vis.width/vis.numPerRow*2/3);\n vis.circlePad = Math.floor(vis.width/vis.numPerRow/3);\n\n // constants to define the size and margins of the vis area.\n vis.margin = { top: vis.circleSize/2, bottom: 0, left: vis.circleSize/2, right: 0 };\n\n vis.relative = false;\n\n vis.namelist = [];\n\n vis.wrangleData();\n\n }", "title": "" }, { "docid": "442cf0eb3532ecafad56d4c5e9b6d807", "score": "0.53900737", "text": "renderTitle() {\n this.plot.append(\"text\")\n .classed(\"diagramTitle\", true)\n .classed(\"diagramSubTitle\", true)\n .text(\"deaths per\")\n .attr(\"x\",this.width/2)\n .attr(\"y\",this.width/2 - (this.width * 0.05))\n .style(\"font-size\",\"2vh\")\n\n this.plot.append(\"text\")\n .classed(\"diagramTitle\", true)\n .text(this.title)\n .attr(\"x\",this.width/2)\n .attr(\"y\",this.width/2 + (this.width * 0.07))\n }", "title": "" }, { "docid": "bfc36d54ff368db6ea927fc774c281a4", "score": "0.53776556", "text": "function Icicle(a,b){function c(b,c){function i(a){return 0<=q.indexOf(a.data.name)&&A}// node.name is the metric/group name\n// node.disp is the display value\n// node.value determines sorting order\n// node.weight determines partition height\n// node.sum is the sum of children weights\nfunction j(a){return a?A&&1===a?\"Date\":l[a-(A?2:1)]:\"Metric\"}function m(a){for(var b=[a],c=a;c.parent;)b.push(c.parent),c=c.parent;return b}function n(b,c){var d=\"<table>\";if(u){var h=m(c);h.reverse().forEach(function(a){var b=a.depth===c.depth;d+=\"<tbody>\",d+=\"<tr>\"+\"<td>\"+\"<div \"+(\"style='border: 2px solid \"+(b?\"black\":\"transparent\")+\";\")+(\"background-color: \"+a.color+\";'\")+\"></div>\"+\"</td>\"+(\"<td>\"+j(a.depth)+\"</td>\")+(\"<td>\"+a.name+\"</td>\")+(\"<td>\"+a.disp+\"</td>\")+\"</tr>\"})}else d+=\"<thead><tr><td colspan=\\\"3\\\">\"+(\"<strong>\"+j(c.depth)+\"</strong>\")+\"</td></tr></thead><tbody>\",d+=\"<tr>\"+\"<td>\"+(\"<div style='border: thin solid grey; background-color: \"+c.color+\";'\")+\"></div>\"+\"</td>\"+(\"<td>\"+c.name+\"</td>\")+(\"<td>\"+c.disp+\"</td>\")+\"</tr>\";d+=\"</tbody></table>\";var e=_d.default.mouse(a),f=e[0],g=e[1];b.html(d).style(\"left\",f+15+\"px\").style(\"top\",g+\"px\")}// Keep text centered in its division\nfunction p(a){return\"translate(8,\"+a.dx*J/2+\")\"}// When clicking a subdivision, the vis will zoom in to it\nfunction r(a){if(!a.children)return!!a.parent&&r(a.parent);I=(a.y?F-40:F)/(1-a.y),J=w/a.dx,h.domain([a.y,1]).range([a.y?40:0,F]),x.domain([a.x,a.x+a.dx]);var b=K.transition().duration(_d.default.event.altKey?7500:750).attr(\"transform\",function(a){return\"translate(\"+h(a.y)+\",\"+x(a.x)+\")\"});return b.select(\"rect\").attr(\"width\",a.dy*I).attr(\"height\",function(a){return a.dx*J}),b.select(\"text\").attr(\"transform\",p).style(\"opacity\",function(a){return 12<a.dx*J?1:0}),_d.default.event.stopPropagation(),!0}var v=c[b],F=d,w=e/f.length,h=_d.default.scale.linear().range([0,F]),x=_d.default.scale.linear().range([0,w]),y=z.append(\"div\").attr(\"class\",\"chart\").style(\"width\",F+\"px\").style(\"height\",w+\"px\").append(\"svg:svg\").attr(\"width\",F).attr(\"height\",w);b!==f.length-1&&1<f.length&&y.style(\"padding-bottom\",\"3px\"),0!==b&&1<f.length&&y.style(\"padding-top\",\"3px\");var G=(0,_d3Hierarchy.hierarchy)(v);G.eachAfter(function(a){a.disp=a.data.val,a.value=0>a.disp?-a.disp:a.disp,a.weight=a.value,a.name=a.data.name,a.parent&&i(a.parent)&&(a.weight=k?1:a.value,a.value=a.name,a.name=C(a.name)),o&&(a.weight=Math.log(a.weight+1)),a.disp=a.disp&&!Number.isNaN(a.disp)&&Number.isFinite(a.disp)?B(a.disp):\"\"}),G.sort(function(c,a){var b=a.value-c.value;return 0==b?a.name>c.name?1:-1:b}),t&&0<=t&&G.each(function(a){if(a.sum=a.children?a.children.reduce(function(b,a){return b+a.weight},0)||1:1,a.children)// Dates are not ordered by weight\nif(i(a)){if(k)return;// Keep at least one child\nfor(var b=[],c=1;c<a.children.length;c++)a.children[c].weight/a.sum<t&&b.push(c);for(var d=b.length-1;0<=d;d--)a.children.splice(b[d],1)}else{// Find first child that falls below the threshold\nvar e;for(e=1;e<a.children.length&&!(a.children[e].weight/a.sum<t);e++);a.children=a.children.slice(0,e)}}),s&&0<=s&&G.each(function(a){a.children&&a.children.length>s&&!i(a)&&(a.children=a.children.slice(0,s))}),G.eachAfter(function(a){a.sum=a.children?a.children.reduce(function(b,a){return b+a.weight},0)||1:1});var H=init(G),I=F/G.dx,J=w/1,K=y.selectAll(\"g\").data(H).enter().append(\"svg:g\").attr(\"transform\",function(a){return\"translate(\"+h(a.y)+\",\"+x(a.x)+\")\"}).on(\"mouseover\",function(a){E.interrupt().transition().duration(100).style(\"opacity\",.9),n(E,a)}).on(\"mousemove\",function(a){n(E,a)}).on(\"mouseout\",function(){E.interrupt().transition().duration(250).style(\"opacity\",0)});// Apply color scheme\nK.on(\"click\",r),K.append(\"svg:rect\").attr(\"width\",G.dy*I).attr(\"height\",function(a){return a.dx*J}),K.append(\"svg:text\").attr(\"transform\",p).attr(\"dy\",\"0.35em\").style(\"opacity\",function(a){return 12<a.dx*J?1:0}).text(function(a){return a.disp?a.name+\": \"+a.disp:a.name}),K.selectAll(\"rect\").style(\"fill\",function(a){return a.color=D(a.name),a.color})}var d=b.width,e=b.height,f=b.data,g=b.colorScheme,h=b.dateTimeFormat,k=b.equalDateSize,l=b.levels,m=b.useLogScale,o=void 0!==m&&m,p=b.metrics,q=void 0===p?[]:p,r=b.numberFormat,s=b.partitionLimit,t=b.partitionThreshold,u=b.useRichTooltip,v=b.timeSeriesOption,w=void 0===v?\"not_time\":v,z=_d.default.select(a);z.classed(\"superset-legacy-chart-partition\",!0);// Chart options\nvar A=0<=[\"adv_anal\",\"time_series\"].indexOf(w),B=(0,_numberFormat.getNumberFormatter)(r),C=(0,_timeFormat.getTimeFormatter)(h),D=_color.CategoricalColorNamespace.getScale(g);z.selectAll(\"*\").remove();for(var E=z.append(\"div\").classed(\"partition-tooltip\",!0),F=0;F<f.length;F++)c(F,f)}", "title": "" }, { "docid": "c11a56df1d6557e56e74e3dc39e2ea95", "score": "0.53662264", "text": "function computeBoxes(){\n setBox(scatterPlot, visHeight);\n setBox(barChart, visHeight);\n }", "title": "" }, { "docid": "e40bb52327e5420bfc19efbf1e1a5da8", "score": "0.5359852", "text": "function setup() {\n createCanvas(500, 500);\n\n init_slider = createSlider(-20.0, 20.0, 7.0, 0)\n args_slider = createSlider(-20.0, 20.0, 12.0, 0)\n init = [init_slider.value()];\n args = [args_slider.value()];\n\n [t, gt, eu, im, rk] = run_analysis(f1, init, args);\n gt_points = generatePoints(t, gt.col(1).elements);\n eu_points = generatePoints(t, eu.col(1).elements);\n im_points = generatePoints(t, im.col(1).elements);\n rk_points = generatePoints(t, rk.col(1).elements);\n\n plt = new GPlot(this, 0, 0, width, height);\n plt.addLayer(\"gt_points\", gt_points);\n plt.getLayer(\"gt_points\").setPointColor(color(255, 0, 0));\n plt.addLayer(\"eu_points\", eu_points);\n plt.getLayer(\"eu_points\").setPointColor(color(0, 255, 0));\n plt.addLayer(\"im_points\", im_points);\n plt.getLayer(\"im_points\").setPointColor(color(255, 255, 0));\n plt.addLayer(\"rk_points\", rk_points);\n plt.getLayer(\"rk_points\").setPointColor(color(0, 0, 255));\n plt.getXAxis().setAxisLabelText(\"this is x\");\n plt.getYAxis().setAxisLabelText(\"this is y\");\n plt.setTitleText(\"this is title\");\n}", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.5359057", "text": "_firstRendered() { }", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.5359057", "text": "_firstRendered() { }", "title": "" }, { "docid": "2f9a23e49296ba313f16ebc5590e7ff4", "score": "0.5354531", "text": "show (){\n this.visible = 1.0 ;\n this.curve.setUniform('visible',1.0) ;\n }", "title": "" }, { "docid": "ef18a77f1d85ba272de1477667f8b271", "score": "0.53544164", "text": "drawFeature(data,config,view){\n if(data && config && view) {\n let topLeft = new paper.Point(0, 0);\n let rectSize = new paper.Size(1, 1);\n return new paper.Path.Rectangle(new paper.Rectangle(topLeft, rectSize));\n }\n }", "title": "" }, { "docid": "6b859f77db13a599c3b4e98011aaa059", "score": "0.53486973", "text": "function showTitle() {\r\n // count openvis title\r\n g = svg.append('g')\r\n\r\n g.append('text')\r\n .attr('class', 'title')\r\n .attr('x', STAGE_WIDTH / 2)\r\n .attr('y', STAGE_HEIGHT / 3)\r\n .text('CS4460');\r\n\r\n // console.log(d3.select(\".text\"))\r\n\r\n g.append('text')\r\n .attr('class', 'subtitle')\r\n .attr('x', STAGE_WIDTH / 2)\r\n .attr('y', STAGE_HEIGHT / 3 + (STAGE_HEIGHT / 5))\r\n .text('ScrollyTelling of Airplane Incidents!');\r\n}", "title": "" }, { "docid": "b49c73fa0e18b37b21d058b85ea81204", "score": "0.53461516", "text": "plotTaskDataRun(runName) {\n\n const taskNames = this.taskdata.taskNames;\n\n let canvas=this.canvas;\n let context=canvas.getContext(\"2d\");\n context.clearRect(0,0,canvas.width,canvas.height);\n context.fillStyle=\"#444444\";\n context.fillRect(0,0,canvas.width,canvas.height);\n \n context.font='20px Arial';\n context.textAlign=\"center\";\n context.textBaseline=\"middle\";\n context.fillStyle=\"#ffffff\";\n context.fillText('Showing Task Definitions for '+runName,\n 0.5*canvas.width,0.5*this.margins[1]);\n \n context.fillStyle = \"#ffffff\";\n context.font='16px Arial';\n const texth=25;\n \n for (let i=0;i<taskNames.length;i++) {\n let y= this.htaskbase+this.htask*(i+1)+OFFSET;\n let x=Math.round(canvas.width-this.legendMargin+OFFSET/2);\n let cl=util.getobjectmapcolor(i+1);\n context.fillStyle=`rgba(${cl[0]},${cl[1]},${cl[2]},${OPACITY})`;\n context.fillRect(x,y,this.textWidth,1.25*texth);\n context.fillStyle=\"#000000\";\n context.fillText(taskNames[i],Math.floor(x+this.textWidth/2),Math.floor(y+0.625*texth));\n }\n\n context.fillStyle=\"#585858\";\n context.fillRect(this.margins[0],this.margins[1],this.margins[2],this.margins[3]);\n\n\n const parsedRuns = this.taskdata.runs;\n const runInfo=parsedRuns[runName];\n\n let maxt=0;\n for (let i=0;i<taskNames.length;i++) {\n let task=taskNames[i];\n let runpairs=runInfo[task] || [];\n for (let i = 0; i < runpairs.length; i++) {\n if (runpairs[i].indexOf('-')>=0)\n runpairs[i]=runpairs[i].split('-');\n let m = parseFloat(runpairs[i][1]);\n if (m > maxt)\n maxt = m;\n }\n\n }\n\n maxt=Math.ceil(maxt/20)*20;\n\n // draw Time axis;\n let axis_start=this.margins[0]+OFFSET;\n let axis_stop=this.margins[0]+this.margins[2]-2*OFFSET;\n context.beginPath();\n let liney=this.margins[1]+this.margins[3]-0.7*AXIS;\n context.strokeStyle=\"#ffffff\";\n\n context.moveTo(axis_start,liney);\n context.lineTo(axis_stop,liney);\n context.stroke();\n context.font='12px Arial';\n context.fillStyle = \"#ffffff\";\n context.textAlign=\"center\";\n context.textBaseline=\"bottom\";\n\n\n for (let i=0;i<taskNames.length;i++) {\n let task=taskNames[i];\n let runpairs=runInfo[task] || [];\n\n let maxy=this.htaskbase+this.htask*(i+1)+OFFSET*2;\n let miny=maxy-0.8*this.htask;\n \n context.save();\n context.strokeStyle=\"#cccccc\";\n context.beginPath();\n context.setLineDash([20,5]);\n context.moveTo(axis_start,maxy);\n context.lineTo(axis_stop,maxy);\n context.stroke();\n context.restore();\n context.save();\n let cl=util.getobjectmapcolor(i+1);\n for (let i=0;i<runpairs.length;i++) {\n let limits=[ runpairs[i][0], runpairs[i][1] ];\n\n for (let i=0;i<=1;i++) {\n limits[i]=axis_start+(limits[i]/maxt)*(axis_stop-axis_start);\n }\n context.fillStyle=`rgba(${cl[0]},${cl[1]},${cl[2]},${OPACITY})`;\n context.fillRect(limits[0],maxy,limits[1]-limits[0],miny-maxy);\n }\n context.restore();\n }\n \n // Vertical Grid Lines\n\n let stept=20.0;\n while (stept*12<maxt)\n stept=stept+10.0;\n \n \n for (let t=0;t<=maxt;t+=stept) {\n let x=(t/maxt)*(axis_stop-axis_start)+axis_start;\n let x2=((t+0.5*stept)/maxt)*(axis_stop-axis_start)+axis_start;\n context.beginPath();\n context.moveTo(x,liney-0.2*AXIS);\n context.lineTo(x,liney+0.2*AXIS);\n context.stroke();\n context.fillText(util.scaledround(t,2)+'s',x,liney+0.7*AXIS);\n context.save();\n \n context.strokeStyle=\"#ffffff\";\n context.beginPath();\n context.setLineDash([20,5]);\n context.moveTo(x,liney-0.3*AXIS);\n context.lineTo(x,this.margins[1]);\n context.stroke();\n\n if (t<maxt) {\n context.strokeStyle=\"#606060\";\n context.beginPath();\n context.setLineDash([20,10]);\n context.moveTo(x2,liney);\n context.lineTo(x2,this.margins[1]);\n context.stroke();\n }\n context.restore();\n }\n\n }", "title": "" }, { "docid": "9109c7da9aa217ea8f72ef89f596d3e6", "score": "0.53341824", "text": "function plotStaticMulti() {\n plotClsMulti();\n plotmPkMulti();\n}", "title": "" }, { "docid": "c7a55ea778d2611f4b7adbade7a90fa0", "score": "0.53337425", "text": "renderVis() {\n let vis = this;\n\n // Add area path\n vis.chart.append('path')\n .datum(vis.rollupData)\n .attr('fill', '#00acc1')\n .attr('d', vis.area);\n\n const defaultSelection = [vis.xScale.range()[0], vis.xScale.range()[1]];\n\n // Append brush component here\n vis.brushG = vis.chart\n .attr('class', 'brush-context')\n .call(vis.brush)\n .call(vis.brush.move, defaultSelection);\n\n // Update the axes/grid lines by calling axis functions\n // Second call removes axis lines and shows only grid lines\n vis.xAxisG\n .call(vis.xAxis)\n .call(g => g.select('.domain').remove());\n }", "title": "" }, { "docid": "8aac3d2f03ccdddc64def6bdfb0b3d50", "score": "0.5331473", "text": "async function doviz_rt_states_graph() {\n let data = await fetch_imaginea_json(\"rt_india_states\");\n\n let spec = {\n width: 'container',\n // height: 300,\n data: { values: data },\n facet: {\n column: {field: 'state_name', type: 'ordinal', sort: { op: 'max', field: 'rt', order: 'descending' }},\n\n },\n //height: 'container',\n spec: {\n layer: [\n {\n mark: { type: \"area\", color: \"gainsboro\" },\n encoding: {\n x: { field: \"date\", title: \"Date\", type: \"temporal\" },\n y: { field: \"p05\", type: \"quantitative\" },\n y2: { field: \"p95\", type: \"quantitative\" },\n tooltip: [\n { field: \"date\", title: \"Date\", type: \"temporal\" },\n { field: \"p05\", title: \"5%tile\", type: \"quantitative\" },\n { field: \"rt\", title: \"Est. Rt\", type: \"quantitative\" },\n { field: \"p95\", title: \"95%tile\", type: \"quantitative\" },\n { field: \"daily_cases\", title: \"Cases\", type: \"quantitative\" }\n ]\n }\n },\n {\n mark: { type: \"area\", color: \"silver\" },\n encoding: {\n x: { field: \"date\", title: \"Date\", type: \"temporal\" },\n y: { field: \"p25\", type: \"quantitative\" },\n y2: { field: \"p75\", type: \"quantitative\" },\n tooltip: [\n { field: \"date\", title: \"Date\", type: \"temporal\" },\n { field: \"p25\", title: \"25%tile\", type: \"quantitative\" },\n { field: \"rt\", title: \"Est. Rt\", type: \"quantitative\" },\n { field: \"p75\", title: \"75%tile\", type: \"quantitative\" },\n { field: \"daily_cases\", title: \"Cases\", type: \"quantitative\" }\n ]\n }\n },\n {\n mark: { type: 'line', point: { size: 20, color: 'red' }, color: \"red\" },\n encoding: {\n x: { field: \"date\", title: \"Date\", type: \"temporal\" },\n y: { field: \"rt\", title: \"Estimated Rt\", type: \"quantitative\" },\n tooltip: [\n { field: \"date\", title: \"Date\", type: \"temporal\" },\n { field: \"rt\", title: \"Est. Rt\", type: \"quantitative\" },\n { field: \"daily_cases\", title: \"Cases\", type: \"quantitative\" }\n ]\n\n }\n },\n {\n data: { values: [{y: 1.0}] },\n mark: { type: 'rule', color: \"lime\", size: 3 },\n encoding: {\n y: { field: 'y', type: 'quantitative' }\n }\n }\n ]\n }\n };\n\n vegaEmbed('#vis_rt_states_graph', spec);\n}", "title": "" }, { "docid": "8b2d7f71c87d291a7d6fd956788e57b6", "score": "0.5328743", "text": "function graphics() {\n // mug= s.bData( qu.gR(\"mug\") ).drag()\n me = cjs.bm(qu.gR(\"me\")).drag()\n s.A(me)\n }", "title": "" }, { "docid": "1fdfc9306e444fa98e7e5e96ef4a31b4", "score": "0.53273535", "text": "render_() {\n super.render_();\n this.updateGraph_();\n }", "title": "" }, { "docid": "ab7e3a4ad6d7ec50e179f8dac20a8f19", "score": "0.5320903", "text": "function showTitle() {\n\n //Hide tooltip\n tooltipDiv.transition()\n .duration(0)\n .style('opacity', 0);\n\n //Hide graph\n g.select('.y-axis')\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n g.selectAll('.link')\n .on('mouseover', null)\n .on('mouseout', null)\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n g.selectAll('.node')\n .on('mouseover', null)\n .on('mouseout', null)\n .select('image')\n .transition(0)\n .duration(600)\n .attr('opacity', 0);\n\n //Show title\n g.selectAll('.vis-title')\n .transition()\n .duration(600)\n .attr('opacity', 1.0);\n\n }", "title": "" }, { "docid": "5d188f915280fc63a790c934cfa4d6f6", "score": "0.5310909", "text": "function drawVisualization() {\n\t\n\t/************************************* \n\t\tWHAT KIND OF VISUALIZATION? \n\t**************************************/\n\n\tif (VISUALIZATION_TYPE === \"youtube\") {\n\t\n\t\t// Input parameters = list of lengths of YouTube comments for given video\n\t\t\n\t\tconst videoId = getVideoId();\n\t\t\n\t\tgetYoutubeDataThenUpdateVisualization(videoId)\t// get comments info for video and do something with it\n\t\t\n\t} else if (VISUALIZATION_TYPE === \"random\") {\n\t\t\n\t\t// Input parameters = list of random positive integers\n\t\tupdateVisualization(generateRandomInputData());\n\t\t\n\t} else if (VISUALIZATION_TYPE === \"animation\") {\n\t\t\n\t\tconsole.log(\"NEED TO SET UP ANIMATION STUFF\");\n\t\t// getYoutubeDataThenUpdateVisualizationWtihAnimation(videoId)\n\t\t\n\t}\n}", "title": "" }, { "docid": "cbeae261032c9f6322563d4cba854736", "score": "0.53087586", "text": "updateGraph_() {\n if (!this.imageElement_) {\n return;\n }\n const i = this.getValue();\n this.imageElement_.style.backgroundPosition = (-i * 37) + 'px 0';\n }", "title": "" }, { "docid": "1333925df82bf467989958f25e14739e", "score": "0.5306373", "text": "show()\n {\n this.altura = this.arbol.calcularAltura(this.arbol.getRaiz(), 0, 0);\n if(this.arbol.getRaiz() == TipoOperadorString.NOT)\n {\n this.altura= this.altura - 2.5;\n }\n else\n {\n this.altura= this.altura - 1.5;\n }\n createCanvas(pow(2, this.altura) * (this.scale + (this.scale / 2)) , this.altura * this.scale * 2);\n background(100);\n this.showNodes(this.arbol.getRaiz(), 0, width, null);\n this.drawLines(this.arbol.getRaiz());\n this.showNodes(this.arbol.getRaiz(), 0, width, null);\n }", "title": "" }, { "docid": "9793d40c26056e0fc502ab383de7310a", "score": "0.53000593", "text": "display() {\n\t\tthis.drawElements(this.primitiveType);\n\t\tthis.displayTop();\n\t}", "title": "" }, { "docid": "3fe8d3e8661a873c70ce7cf346f83993", "score": "0.5294924", "text": "drawExperiment () {\n experiment.highLoop.forEach((element,index)=>{\n let instance = element[0];\n let x_var = element[1][0];\n let y_var = element[1][1];\n // prepare fragments of doubly series = loops + no loop to highlight loops\n // let sub_x = [], sub_y = [];\n // let loop_x = [], loop_y = [];\n // element[1][2].forEach((element_,index_)=>{\n // if (index_) {\n // sub_x.push(experiment.dataSmooth[instance][x_var].slice(element[1][2][index_-1][0]+element[1][2][index_-1][1]+1,element_[0]+1));\n // sub_y.push(experiment.dataSmooth[instance][y_var].slice(element[1][2][index_-1][0]+element[1][2][index_-1][1]+1,element_[0]+1));\n // } else {\n // sub_x.push(experiment.dataSmooth[instance][x_var].slice(0,element_[0]+1));\n // sub_y.push(experiment.dataSmooth[instance][y_var].slice(0,element_[0]+1));\n // }\n // loop_x.push(experiment.dataSmooth[instance][x_var].slice(element_[0],element_[0]+element_[1]+2));\n // loop_y.push(experiment.dataSmooth[instance][y_var].slice(element_[0],element_[0]+element_[1]+2));\n // });\n // sub_x.push(experiment.dataSmooth[instance][x_var].slice(element[1][2][element[1][2].length-1][0]+element[1][2][element[1][2].length-1][1]+1));\n // sub_y.push(experiment.dataSmooth[instance][y_var].slice(element[1][2][element[1][2].length-1][0]+element[1][2][element[1][2].length-1][1]+1));\n // prepare parameters for plotly\n let n_loop = element[1][2].length;\n let n_timePoint = experiment.timeInfo.length;\n let myColor = experiment.timeInfo.map((element_,index_)=>'rgb(${255*index_/n_timePoint},${0},${0})');\n let trace = [], trace1 = [], trace2_x = [], trace2_y = [];\n for (let i = 0; i < 2*n_loop+1; i++) {\n trace[i] = {\n type: 'scatter',\n mode: 'lines+markers',\n name: '',\n showlegend: false,\n // xaxis: 'x',\n // yaxis: 'y',\n };\n trace1[i] = {\n type: 'scatter',\n mode: 'lines+markers',\n name: '',\n showlegend: false,\n // xaxis: 'x',\n // yaxis: 'y',\n };\n trace2_x[i] = {\n type: 'scatter',\n mode: 'lines',\n // x: experiment.timeInfo,\n // y: experiment.data[instance][x_var],\n name: '',\n showlegend:false,\n hoverinfo: 'x+y',\n yaxis: 'y',\n };\n trace2_y[i] = {\n type: 'scatter',\n mode: 'lines',\n // x: experiment.timeInfo,\n // y: experiment.data[instance][y_var],\n name: '',\n showlegend:false,\n hoverinfo: 'x+y',\n yaxis: 'y2',\n };\n if (i%2===0) {\n // trace[i].x = sub_x[i/2];\n // trace[i].y = sub_y[i/2];\n trace[i].line = {\n color: '#000000',\n };\n trace1[i].line = {\n color: '#000000',\n };\n trace2_x[i].line = {color:'#a6cee3'};\n trace2_y[i].line = {color:'#cab2d6'};\n if (i===0) {\n trace[i].x = experiment.dataSmoothRaw[instance][x_var].slice(0,element[1][2][0][0]+1);\n trace[i].y = experiment.dataSmoothRaw[instance][y_var].slice(0,element[1][2][0][0]+1);\n trace1[i].x = experiment.dataRaw[instance][x_var].slice(0,element[1][2][0][0]+1);\n trace1[i].y = experiment.dataRaw[instance][y_var].slice(0,element[1][2][0][0]+1);\n trace2_x[i].x = experiment.timeInfo.slice(0,element[1][2][0][0]+1);\n trace2_x[i].y = experiment.dataRaw[instance][x_var].slice(0,element[1][2][0][0]+1);\n trace2_y[i].x = experiment.timeInfo.slice(0,element[1][2][0][0]+1);\n trace2_y[i].y = experiment.dataRaw[instance][y_var].slice(0,element[1][2][0][0]+1);\n } else if (i===2*n_loop) {\n trace[i].x = experiment.dataSmoothRaw[instance][x_var].slice(element[1][2][i/2-1][1]+1);\n trace[i].y = experiment.dataSmoothRaw[instance][y_var].slice(element[1][2][i/2-1][1]+1);\n trace1[i].x = experiment.dataRaw[instance][x_var].slice(element[1][2][i/2-1][1]+1);\n trace1[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][i/2-1][1]+1);\n trace2_x[i].x = experiment.timeInfo.slice(element[1][2][i/2-1][1]+1);\n trace2_x[i].y = experiment.dataRaw[instance][x_var].slice(element[1][2][i/2-1][1]+1);\n trace2_y[i].x = experiment.timeInfo.slice(element[1][2][i/2-1][1]+1);\n trace2_y[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][i/2-1][1]+1);\n } else {\n trace[i].x = experiment.dataRaw[instance][x_var].slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n trace[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n trace1[i].x = experiment.dataRaw[instance][x_var].slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n trace1[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n trace2_x[i].x = experiment.timeInfo.slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n trace2_x[i].y = experiment.dataRaw[instance][x_var].slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n trace2_y[i].x = experiment.timeInfo.slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n trace2_y[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][i/2-1][1]+1,element[1][2][i/2][0]+1);\n }\n } else {\n // trace[i].x = loop_x[(i-1)/2];\n // trace[i].y = loop_y[(i-1)/2];\n trace[i].line = {\n color: experiment.colorList[(i-1)/2],\n };\n trace1[i].line = {\n color: experiment.colorList[(i-1)/2],\n };\n trace2_x[i].line = {color:experiment.colorList[(i-1)/2]};\n trace2_y[i].line = {color:experiment.colorList[(i-1)/2]};\n trace[i].x = experiment.dataRaw[instance][x_var].slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n trace[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n trace1[i].x = experiment.dataRaw[instance][x_var].slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n trace1[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n trace2_x[i].x = experiment.timeInfo.slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n trace2_x[i].y = experiment.dataRaw[instance][x_var].slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n trace2_y[i].x = experiment.timeInfo.slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n trace2_y[i].y = experiment.dataRaw[instance][y_var].slice(element[1][2][(i-1)/2][0],element[1][2][(i-1)/2][1]+3);\n }\n }\n let trace2 = [];\n trace2_x.forEach(element_=>trace2.push(element_));\n trace2_y.forEach(element_=>trace2.push(element_));\n let layout = {\n title: instance,\n xaxis: {\n title: x_var,\n titlefont: {\n color: '#a6cee3',\n size: 12,\n family: 'Arial, sans-serif',\n },\n tickfont: {color:'#a6cee3'},\n },\n yaxis: {\n title: y_var,\n titlefont: {\n color: '#cab2d6',\n size: 12,\n family: 'Arial, sans-serif',\n },\n tickfont: {color:'#cab2d6'},\n },\n height: experiment.window_size[0]*0.3,\n width: experiment.window_size[0]*0.3,\n };\n let layout1 = {\n title: instance,\n width: experiment.window_size[0]*0.3,\n height: experiment.window_size[0]*0.2,\n yaxis: {\n title: x_var,\n titlefont: {\n color:'#a6cee3',\n size: 12,\n family: 'Arial, sans-serif',\n },\n tickfont: {color:'#a6cee3'},\n // overlaying: 'y3',\n // side: 'left',\n },\n yaxis2: {\n title: y_var,\n titlefont: {\n color:'#cab2d6',\n family: 'Arial, sans-serif',\n size: 12,\n },\n tickfont: {color:'#cab2d6'},\n overlaying: 'y',\n side: 'right',\n }\n };\n Plotly.newPlot(this.id+index.toString()+'_2',trace,layout);\n Plotly.newPlot(this.id+index.toString()+'_1',trace1,layout);\n Plotly.newPlot(this.id+index.toString()+'_0',trace2,layout1);\n for (let i = 0; i < n_loop; i++) {\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('Loop length: '+(element[1][2][i][1]-element[1][2][i][0]))\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('Product: '+Math.floor(element[1][2][i][2]*100)/100)\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('Convex score: '+Math.floor(element[1][2][i][3]*100)/100)\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('Ratio: '+Math.floor(element[1][2][i][4]*100)/100)\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('Square area: '+Math.floor(element[1][2][i][6]*100)/100)\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('My area: '+Math.floor(element[1][2][i][5]*100)/100)\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('Concave area: '+Math.floor(element[1][2][i][7]*100)/100)\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n d3.select('#'+'myDiv'+index.toString()+'_3')\n .append('p')\n .text('Convex area: '+Math.floor(element[1][2][i][8]*100)/100)\n .attr('style','text-align:right; color:'+experiment.colorList[2*i+1]);\n }\n });\n }", "title": "" }, { "docid": "4462ef9b4c2d64e2bc3a671a06b14757", "score": "0.5286481", "text": "function visualiseData(arr, containerEl) {\n const itemElsSting = arr.map(item => `<i style=\"height: ${item}px\" class=\"data-visualisation-item\" title=\"${item}\"></i>`);\n\n containerEl.innerHTML = itemElsSting.join('');\n }", "title": "" }, { "docid": "a5b8a9293833f3c647b98e12c17d87c0", "score": "0.52831393", "text": "_renderPipeline() {\n\n let svgEl, svgDimensions,\n rightOuterBandPadding = 0.1,\n bandPercentageHeightPadding = 0.1;\n\n if (!this.props.data || this.props.data.length === 0) {\n return\n }\n\n svgEl = React.findDOMNode(this.refs.chartElement);\n\n //empty the SVG element for fresh rendering\n while (svgEl.firstChild) {\n svgEl.removeChild(svgEl.firstChild)\n }\n\n svgDimensions = this._computeDimensions();\n\n // Constructing outer polygon.\n svgEl.appendChild(this._constructOuterPolygon(svgDimensions,\n bandPercentageHeightPadding, rightOuterBandPadding));\n\n // Constructing inner polygon.\n svgEl.appendChild(this._constructInnerPolygon(svgDimensions,\n bandPercentageHeightPadding, rightOuterBandPadding));\n\n // Render partitions\n _.forEach(this._constructPartitions(svgDimensions), function(partition) {\n svgEl.appendChild(partition);\n });\n\n // Render partitions titles\n _.forEach(this._constructPartitionTitles(svgDimensions,\n bandPercentageHeightPadding), function(partitionTitle) {\n svgEl.appendChild(partitionTitle);\n });\n\n // Render inner band values\n _.forEach(this._constructInnerBandValues(svgDimensions),\n function(innerBandValue) {\n svgEl.appendChild(innerBandValue);\n });\n\n // Render outer band labels\n _.forEach(this._constructOuterBandLabels(svgDimensions,\n bandPercentageHeightPadding), function(outerBandLabel) {\n svgEl.appendChild(outerBandLabel);\n });\n\n // Render outer band values\n _.forEach(this._constructOuterBandValues(svgDimensions,\n bandPercentageHeightPadding), function(outerBandValue) {\n svgEl.appendChild(outerBandValue);\n });\n\n // Render outer band secondary values\n _.forEach(this._constructOuterBandSecondaryValues(svgDimensions,\n bandPercentageHeightPadding), function(outerBandValue) {\n svgEl.appendChild(outerBandValue);\n });\n }", "title": "" }, { "docid": "cd4062427981681aee54e5213c64644f", "score": "0.52798396", "text": "renderCompositeView() {}", "title": "" }, { "docid": "e112b507fa2dacefb510102b6bedd5e2", "score": "0.5278442", "text": "display(image) {\n this.chart.display(image, this.randomValues, this.testIndices);\n }", "title": "" }, { "docid": "5b7f2224f590cc698058d1a894281ab1", "score": "0.52747333", "text": "init_vis() {\n // let width = d3v5.select(this.dom).node().getBoundingClientRect().width/1.1;\n let opt = this.opt;\n let width = opt.width; // Fixed width\n\n if (this.board !== null)\n console.error(\"This board has already been initialized.\");\n this.board = tnt.board();\n this.board.allow_drag(false);\n this.board.from(0).to(1000).max(1000).width(width);\n\n let _this = this;\n\n // Initialize tracks\n\n let axis_track = tnt.board.track()\n .id(\"axis\")\n .height(5)\n .display(tnt.board.track.feature.axis().orientation(\"top\"));\n\n let contig_track = tnt.board.track()\n .id(\"contig\")\n .height(10)\n .display(tnt.board.track.feature.block().color(\"#082A46\"));\n\n let gene_track = tnt.board.track()\n .id(\"gene\")\n .height(20)\n .color(\"white\")\n .display(\n tnt.board.track.feature.genome.gene().color(\"#AD9274\") // default color\n .on(\"click\", function(d) {\n console.log(d);\n // This is the place to specify the tooltip\n tnt.tooltip.table()\n .width(300)\n .call(this, {\n header: `Gene: ${d.gene_ID}`,\n rows: [\n {label: \"Gene Strand\", value: d.gene_strand},\n {label: \"RBS Motif\", value: d.gene_rbs_motif},\n {label: \"Type\", value: d.eggnog_X13},\n ]\n });\n })\n );\n // Set fixed \"collapsed\" layout and allow variable height\n // Refer http://bl.ocks.org/emepyc/7c73519ee7a1300eb68a\n gene_track.display().layout()\n .fixed_slot_type(\"collapsed\") //.fixed_slot_type(\"expanded\")\n .keep_slots(false)\n .on_layout_run(function(types, current) {\n // With some extra space\n let needed_height = types.collapsed.needed_slots * types.collapsed.slot_height + 20;\n if (needed_height !== gene_track.height()) {\n gene_track.height(needed_height);\n _this.board.tracks(_this.board.tracks());\n }\n });\n\n let diamond_track = tnt.board.track()\n .id(\"diamond\")\n .height(60)\n .color(\"white\")\n .display(\n tnt.board.track.feature.genome.gene().color(\"green\") // default color\n .on(\"click\", function(d) {\n // Specify the tooltip with link to external website\n console.log(d);\n // ad hoc\n let mapped_to = d.eggnog_pos_X2.split(\".\");\n let taxonomy = mapped_to[0];\n let gene = mapped_to[1];\n taxonomy = `<a target=\"_blank\" href=\"https://www.uniprot.org/taxonomy/${taxonomy}\">${taxonomy}</a>`;\n gene = `<a target=\"_blank\" href=\"https://www.uniprot.org/uniprot/?query=+${gene}\">${gene}</a>`;\n\n tnt.tooltip.table()\n .width(300)\n .call(this, {\n header: `${d.gene_ID} Mapping`,\n rows: [\n {label: \"Taxonomy\", value: taxonomy},\n {label: \"Gene\", value: gene},\n ]\n });\n })\n );\n\n diamond_track.display().layout()\n .fixed_slot_type(\"expanded\")\n .keep_slots(false)\n .on_layout_run(function(types, current) {\n let needed_height = types.expanded.needed_slots * types.expanded.slot_height;\n if (needed_height !== diamond_track.height()) {\n diamond_track.height(needed_height);\n //genome.tracks(genome.tracks());\n _this.board.tracks(_this.board.tracks());\n }\n });\n\n // Bind thd dom\n this.board(this.dom);\n\n // Add tracks\n this.board.add_track(axis_track);\n\n this.board\n .add_track(contig_track)\n .add_track(gene_track)\n .add_track(diamond_track);\n\n // Do not start\n //this.board.start();\n return this;\n }", "title": "" }, { "docid": "9924254748bfb2d21bd67561f81714c7", "score": "0.5268666", "text": "function standart_set_label_preview()\n {\n var row_start = jq('#windows_group_label_row_start').val();\n var num_start = jq('#windows_group_label_number_start').val();\n var row_dir = jq(\"input[name=radio_row_start]:checked\").val();\n var num_dir = jq(\"input[name=radio_number_start]:checked\").val();\n var rows_are = jq(\"input[name=advanced_windows_group_label_rows_are]:checked\").val() ;\n var numbers_are =jq(\"input[name=advanced_windows_group_label_numbers_are]:checked\").val();\n var hallObjAll = sortCoords(createObjectHall(3,3,row_start,1,rows_are, num_start,'inc'),row_dir,num_dir,numbers_are);\n var hallObjOdd = sortCoords(createObjectHall(3,3,row_start,1,rows_are, num_start,'pass_one'),row_dir,num_dir,numbers_are);\n num_start++;\n var hallObjEven = sortCoords(createObjectHall(3,3,row_start,1,rows_are, num_start,'pass_one'),row_dir,num_dir,numbers_are);\n //draw hall with inc of numbers\n var previewHallObjAll = drawPreview(hallObjAll, '.');\n jq('#sim_leb_all').html(previewHallObjAll);\n \n var previewHallObjOdd = drawPreview(hallObjEven,'.');\n jq('#sim_leb_odd').html(previewHallObjOdd);\n \n var previewHallObjEven = drawPreview(hallObjOdd,'.');\n jq('#sim_leb_even').html(previewHallObjEven);\n \n \n }", "title": "" }, { "docid": "62afb52ceca73fd6675a944768251d83", "score": "0.5268506", "text": "function resize_viz(){\n // resize histograms.\n //its fairly similar to the setup of the iris except we need to have different sizes..\n //first we need to delete everything..\n d3.selectAll(\"#scatter#g\").remove();\n // d3.select(\"#brush\").remove();\n // d3.select(\"#currentsituation.parent\").remove();\n setup_iris(setup=false);\n\n if(pause){\n //update the current situation\n compute_new_medians();\n //paint the histogram if there is a change.\n update_histograms(forced=true);\n\n //update the historic historic\n update_scatter();\n brush.update_brush(scatter_plots.xScale);\n\n }\n\n}", "title": "" }, { "docid": "cc7a08b860e5da2f0e3b0fc8f9656c7e", "score": "0.5258353", "text": "function NGLg_prepareImage( data ){\r\n var o = data.comp;\r\n\t\tconsole.log(\"node id ?\",NGLg_current_list[o.name]);\r\n\t\t//use graph.nodes[nlgg_current]\r\n stage.eachRepresentation( function( r ){\r\n r.dispose();\r\n } );\r\n\t\t//selection+beads ?\r\n\t\tif (NGLg_current_list[o.name]!== -1 ){\r\n\t\t\tvar anode = graph.nodes[NGLg_current_list[o.name]];\r\n\t\t\t//use selection, bu, model, current Representation\r\n\t\t\t//do axis/surface if surface\r\n\t\t\t//show beads if on\r\n\t\t\t//show geom if on\r\n\t\t\tconsole.log(\"NGL_ReprensentOne\",o,anode);\r\n\t\t\tNGL_ReprensentOne(o,anode);\r\n\t\t\tconsole.log(\"NGL_ReprensentOnePost\");\r\n\t\t\tNGL_ReprensentOnePost(o,anode);\r\n\t\t}\r\n\t\telse\r\n {\r\n\t\t\tstage.defaultFileRepresentation( o );\r\n }\r\n\t\to.autoView();\r\n\t\tstage.autoView();\r\n\t\tvar pa = o.structure.getPrincipalAxes();\r\n\t\tstage.animationControls.rotate( pa.getRotationQuaternion(), 0 );\r\n\t\treturn data;\r\n}", "title": "" }, { "docid": "059fc688109ce2f222ab119292235605", "score": "0.5258191", "text": "function SimpleShapeView() {}", "title": "" }, { "docid": "f9f863ecb91f7e79ed76ac2f880060c8", "score": "0.5255519", "text": "showCubes() {\n this.opts.visualize = \"cubes\";\n this.drawBoxes();\n this.geometry.isVisible = true;\n }", "title": "" }, { "docid": "8b12a78a37ba62abd0354033f68e783b", "score": "0.52504724", "text": "function makeGraph() {\n \n }", "title": "" }, { "docid": "ae00c4bfa7f7120eeea4868d5eaac267", "score": "0.5246951", "text": "function show_all_line_plots(){\n //TODO if time allows....\n}", "title": "" }, { "docid": "d89c7735747a22dcfb8c6dbd8e052f0d", "score": "0.52465564", "text": "function be_painted_by_other () {}", "title": "" }, { "docid": "e23ae67b6d43a7246258e7176358482c", "score": "0.5245552", "text": "function tooltip_objects(){\n\n// I am setting the mode to custom tool tips\ncvjs_setCustomToolTip(true);\n\n// I am making an API call to the function cvjs_getSpaceObjectIdList()\n// this will give me an array with IDs of all Spaces in the drawing\nvar spaceObjectIds = cvjs_getSpaceObjectIdList();\nvar i=0;\n\nfor (spc in spaceObjectIds)\n{\n\n// We randomly set the status\n\nvar myObject = cvjs_returnSpaceObjectID(spaceObjectIds[spc]);\n\nif ((i % 3) ==0){\n var textString = new Array(\"ID: \"+spaceObjectIds[spc]+\" Type:\"+myObject.type, \"Linked:\"+myObject.linked);\n cvjs_setCustomToolTipValue(spaceObjectIds[spc], textString);\n}\nelse{\n if ((i % 3) == 1){\n var textString = new Array('Hi!', 'second line custom tooltip');\n cvjs_setCustomToolTipValue(spaceObjectIds[spc], textString);\n }\n else{\n var textString = new Array(\"line 1 line 1 line 1 line 1 \", \"line 2 line 2 line 2 line 2\", \"line 3 line 3 line 3 line 3\",\"line4 line4 line 4 line 4\");\n cvjs_setCustomToolTipValue(spaceObjectIds[spc], textString);\n }\n}\ni++;\n}\n}", "title": "" }, { "docid": "f8bffcf0fdca7673cd0ba9ca9645e2a7", "score": "0.52442694", "text": "display() {\n noFill();\n stroke(this.color);\n strokeWeight(this.weight);\n beginShape();\n for (let i = 0; i < (this.num + 1); i++) {\n let amp = random(-this.amplitude, this.amplitude);\n if (this.horizontal) {\n vertex(width/this.num*i, this.pos + amp);\n } else {\n vertex(this.pos + amp, MAP_HEIGHT/this.num*i);\n }\n }\n endShape();\n strokeWeight(1);\n }", "title": "" }, { "docid": "1e9cd934379310416631e70951a43642", "score": "0.52405363", "text": "function createViz(_world) {\n\t\t\t\tvar _3dWorld_ = _3dWorld(container, _world);\n\t\t\t\tif (sizeFeed) { // Even if no measure has been set Lumira sends a \"fake\" measure called \"Measure\" // I'm not sure why but it looks like a bug to me\n\t\t\t\t\t_3dWorld_.setSizeField(sizeFeed);\n\t\t\t\t}\n\t\t\t\tif (colorFeed) {\n\t\t\t\t\t_3dWorld_.setColorField(colorFeed);\n\t\t\t\t}\n\t\t\t\tif (dimensions[0] && dimensions[1]) {\n\t\t\t\t\t_3dWorld_.setData(data);\n\t\t\t\t\t// Called even if no second measure is defined\n\t\t\t\t\t// So the features will be painted with default color\n\t\t\t\t\t// @todo : This could be done directly through css to improve performance I guess\n\t\t\t\t\t_3dWorld_.applyRamp();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "ed7ec0e68811447967f47e6c425103bf", "score": "0.5237358", "text": "function displayFigureParts() {\n let figures = Array.from(figureParts);\n figures[count].style.display = 'block';\n console.log(typeof(figures));\n console.log(figures.length);\n}", "title": "" }, { "docid": "6982001339c7e4efdf4bd83157d4d335", "score": "0.52357274", "text": "function solve_cube(){\n visualize_cube();\n}", "title": "" }, { "docid": "cfa0e34f8e694b12168d945f63fe6506", "score": "0.5235167", "text": "renderNetwork() {\n\n const container = document.getElementById('visual-container');\n\n const tactics = this.convertToArray(this.get('store').peekAll('tactic'));\n const mappings = this.convertToArray(this.get('store').peekAll('mapping'));\n const patterns = this.convertToArray(this.get('store').peekAll('pattern'));\n\n const dataSet = dataConverter.dataToDataset(tactics, patterns, mappings);\n\n const options = {\n height: '400px',\n width: '100%',\n physics: {\n enabled: false,\n },\n manipulation: {\n enabled: false,\n },\n layout: {\n hierarchical: {\n enabled: true,\n sortMethod: 'directed',\n nodeSpacing: 230,\n },\n },\n interaction: {\n dragNodes: false,\n zoomView: false,\n dragView: false,\n },\n\n };\n\n // initialize network\n this.set('network', new vis.Network(container, dataSet, options));\n const network = this.get('network');\n\n // set listeners\n network.on('click', (event) => {\n\n // when node is clicked, the node is moving in center of window\n if (event.nodes.length > 0) {\n this.focusNode(event);\n\n // otherwise the overview of the network is shown\n } else {\n this.unFocusNode();\n }\n\n });\n }", "title": "" }, { "docid": "c2ea800ee9f48b2945fddf434e8ac87b", "score": "0.5234862", "text": "display(){\n this.createLines();\n //this.createaPointsFromCoords();\n //this.createPointsFromPos(100,300);\n this.drawLines();\n \n this.drawPoints();\n this.updatePoints();\n //this.drawAxes();\n this.drawOrigin();\n}", "title": "" }, { "docid": "63442c4df5cecfbf170fe6ceadb87ec6", "score": "0.5232261", "text": "render() {\n this._clear();\n let sizes = this._getSizes();\n\n this._renderHistogramSelection(sizes);\n this._renderHistogram(sizes);\n this._renderTransferFunction();\n\n this._renderColorGradient(sizes);\n this._renderColorGradientOntoCanvas(sizes);\n this._renderAxes(sizes);\n\n //this._renderColorOpacityBitmap();\n }", "title": "" }, { "docid": "c8b0dee2e7f59e90338d993af4026435", "score": "0.52321595", "text": "function boxplotVisual(ecModel, api) {}", "title": "" }, { "docid": "f6ee879650f97a3a21cef7de45c280f2", "score": "0.52173173", "text": "render(model) {\n let metadata = model.metadata[this.mimeType];\n return _renderers__WEBPACK_IMPORTED_MODULE_1__[\"renderSVG\"]({\n host: this.node,\n source: String(model.data[this.mimeType]),\n trusted: model.trusted,\n unconfined: metadata && metadata.unconfined\n });\n }", "title": "" }, { "docid": "92d47ca593dd753f2daac54454a741c8", "score": "0.5209637", "text": "renderedCallback() { }", "title": "" }, { "docid": "452f4db3c25eab80b8237f5b84299950", "score": "0.5205868", "text": "function b$1(t){const{view:a,graphic:n}=t,i=new e$1({graphic:n}),l=j$2(t,i),r=[l,S$1(t,l.visualElement,i),a.maskOccludee(n),a.trackGraphicState(i)];return {visualElement:l.visualElement,remove:()=>r$8(r).remove()}}", "title": "" }, { "docid": "59bfc2f8246ee56a6f3472c153afd3d4", "score": "0.52018195", "text": "display() {\n stroke(255);\n fill(200);\n rect(this.x, this.y, this.w, this.w);\n }", "title": "" }, { "docid": "846e66486b08d1c908f8946b4cf8deef", "score": "0.51878595", "text": "function Displayable() {\n }", "title": "" }, { "docid": "c8aca6a80a4bdc57be93d8c18c8524ac", "score": "0.5187345", "text": "function plotStaticIfVisible() {\n if (plotWindowVisible)\n plotStatic();\n}", "title": "" }, { "docid": "e9e32bd3b9b898fc8c1fe0f3f019a18d", "score": "0.51699615", "text": "function setup() {\r\n //definition des couleurs\r\n normalColor = color(200);\r\n bombColor = color(255, 0, 0);\r\n notBombColor = color(0, 255, 0);\r\n //ensemble de couleur en fonction de la valeur de la case\r\n cellColor = [color(150), color(75, 200, 75), color(36,155,156), color(200, 50, 50), color(150,50,200), color(0), color(100,215,220), color(100, 250,150), color(68,189,147)]\r\n flagColor = color(0, 255, 255);\r\n\r\n //creation du canvas\r\n var canvas = createCanvas(720, 480);\r\n canvas.parent('myContainer');\r\n \r\n //aspect graphique\r\n textSize(16);\r\n textAlign(CENTER, CENTER);\r\n stroke(100);\r\n rectMode(CORNER);\r\n \r\n //creation des cellules\r\n for (j = 0; j < lines; j++) {\r\n\t for (i = 0; i < cols; i++) {\r\n\t\t var cell = new Cell(i, j);\r\n\t\t cells.push(cell);\r\n\t}}\r\n \r\n //numerotation des cellules\r\n for (var i = 0; i < cells.length; i++){\r\n\t var cell = cells[i];\r\n\t if (!cell.bomb) {\r\n\t cell.setNumber()\r\n\t}}\r\n\t\r\n show();\r\n }", "title": "" }, { "docid": "6d2c1b3aea59474966090b62c6149d39", "score": "0.5167678", "text": "init() {\n\t\t\t\t$sel.at('data-clippy', data.key)\n\t\t\t\t\t.style('cursor', 'pointer')\n\t\t\t\t$method = $sel.append('div.title')\n\n $svg = $sel.append('svg.overTime-chart');\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.at('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\t$axis = $g.append('g.g-axis');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g.g-vis');\n // $blocks = $sel.append('div.blocks')\n // $title = $sel.append('text.title')\n // $sub = $sel.append('text.sub')\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "title": "" }, { "docid": "1b89d55cf8d835876f117e60ecc2d85f", "score": "0.5165115", "text": "function init() {\n\n color = d3.scale.threshold()\n .domain([0.02, 0.04, 0.06, 0.08, 0.10])\n .range([\"#f2f0f7\", \"#dadaeb\", \"#bcbddc\", \"#9e9ac8\", \"#756bb1\", \"#54278f\"]);\n\n var target = \"#visualizedata\"\n w1 = canvasSize(target)[0];\n //do i need to add if for undefined height???\n h1 = (canvasSize(target))[1] ? (canvasSize(target)[1]-100) : 700;\n\n svg = d3.select(target)\n .append(\"svg\").attr({\"width\":w1,\"height\":h1}).style(\"z-index\",1)\n .attr(\"class\",\"visualizedata\").style(\"z-index\",1);\n\n d3.selectAll(\".viz\").on(\"click\",function(d) { \n (this.className.split(\" \"))[3] == \"choro\" ? changeViz(\"choropleth\") : changeViz(\"bubble\") \n })\n changeViz(\"choropleth\")\n}//init() ", "title": "" }, { "docid": "99004caad654edb99fb655886e2d483f", "score": "0.5164429", "text": "function setup_visual_transform () {\n if (drawing || svg_signal_pts.length == 0) return;\n \n mode = 1; // entering traverse signal mode\n cleanup_for_mode(mode);\n if (seen_modes >= 1) return;\n seen_modes = 1;\n\n n = 0; k = 1;\n // draw unit circle and plot N discrete points *clockwise* around circle.\n // reverse the array so points are clockwise, not counter-clockwise.\n u_circle = discrete_circle_from_vector(1, 0, N).reverse();\n svg_uc_cont = plot_unit_circle();\n svg_uc_discrete = plot_discrete_points(u_circle);\n\n svg_vec_sample = plot_add_vector([0, 0], [0, 0], col_samp);\n svg_vec_uc = plot_add_vector([0, 0], [0, 0], col_uc);\n if (show_prod)\n svg_vec_product = plot_add_vector([0, 0], [0, 0], col_prod)\n plot_highlight_point_pair();\n}", "title": "" }, { "docid": "1df91e2a65a76f6abfab201927ef5699", "score": "0.5163975", "text": "drawDebug()\n\t\t{\n\t\t\tthis.spectrum = this.fft.analyze();\n\t\t\tnoFill();\n\n\t\t\tlet elementWidth = 400,\n\t\t\t\t\telementHeight = 255;\n\n\t\t\tbackground('#F2F2F2');\n\t\t\tstroke('#1D736A');\n\t\t\ttranslate((width/2)- (elementWidth/2), elementHeight/2);\n\t\t\tbeginShape();\n\n\t\t\tfor (let i = 0; i < this.spectrum.length; i++)\n\t\t\t{\n\t\t\t\tlet x = map(i, 0, this.spectrum.length, -(this.maxX), -(this.maxX) + elementWidth);\n\t\t\t\tvertex(100 + x, -1 * map(this.spectrum[i], 0, 255, 0, elementHeight));\n\t\t\t}\n\t\t\tendShape();\n\t\t}", "title": "" }, { "docid": "f65eea4d4665189290e33a5a7c661905", "score": "0.51632243", "text": "function setup() {\n\tnoLoop();\n\tcreateCanvas(10000, 10000);\n\tpolygons = xml.getChildren('polygon');\n\tendPoints = xmlPoints.getChildren('point');\n\n\tmaxPoint = {\n\t\tx: 0,\n\t\ty: 0\n\t};\n\n\tbuttonVG = createButton('Calculate Visibility Graph');\n\tbuttonVG.position(0, 0);\n\tbuttonVG.mousePressed(calculateVisibiltyGraph);\n\n\tvar noOfVertices = 2;\n\tfor (var i = 0; i < polygons.length; i++) {\n\t\tvar polygon = polygons[i];\n\t\tvar points = polygon.getChildren('point');\n\n\t\tfor (var j = 0; j < points.length; j++) {\n\t\t\tnoOfVertices++;\n\t\t}\n\t}\n\n\tgraph = new Graph(noOfVertices);\n\tvar vertexCount = 2;\n\n\tallPoints.push({\n\t\tnumber: 0,\n\t\tx: endPoints[0].getNum('x'),\n\t\ty: endPoints[0].getNum('y'),\n\t\tpolygon: -1\n\t});\n\tgraph.addVertex(0);\n\n\tallPoints.push({\n\t\tnumber: 1,\n\t\tx: endPoints[1].getNum('x'),\n\t\ty: endPoints[1].getNum('y'),\n\t\tpolygon: -2\n\t});\n\tgraph.addVertex(1);\n\n\tfor (var i = 0; i < polygons.length; i++) {\n\t\tvar polygon = polygons[i];\n\t\tvar points = polygon.getChildren('point');\n\n\t\tvar helpVertexCount = vertexCount;\n\n\t\tfor (var j = 0; j < points.length; j++) {\n\t\t\tallPoints.push({\n\t\t\t\tnumber: vertexCount,\n\t\t\t\tx: points[j].getNum('x'),\n\t\t\t\ty: points[j].getNum('y'),\n\t\t\t\tincidentVertices: [],\n\t\t\t\tpolygon: i\n\t\t\t});\n\t\t\tgraph.addVertex(vertexCount++);\n\t\t}\n\n\t\tfor (var j = 0; j < points.length; j++) {\n\t\t\tif (j == 0) {\n\t\t\t\tallPoints[helpVertexCount].incidentVertices.push(helpVertexCount + 1);\n\t\t\t\tallPoints[helpVertexCount].incidentVertices.push(helpVertexCount - 1 + points.length);\n\t\t\t\thelpVertexCount++;\n\t\t\t} else if (j == points.length - 1) {\n\t\t\t\tallPoints[helpVertexCount].incidentVertices.push(helpVertexCount + 1 - points.length);\n\t\t\t\tallPoints[helpVertexCount].incidentVertices.push(helpVertexCount - 1);\n\t\t\t} else {\n\t\t\t\tallPoints[helpVertexCount].incidentVertices.push(helpVertexCount + 1);\n\t\t\t\tallPoints[helpVertexCount].incidentVertices.push(helpVertexCount - 1);\n\t\t\t\thelpVertexCount++;\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "bf57e0da8073e2c7386b803803ea8646", "score": "0.5157491", "text": "function plotStatic() {\n if (simulationManager.singleMode) {\n plotStaticSingle();\n } else {\n plotStaticMulti();\n }\n}", "title": "" }, { "docid": "9a87883ce3b2449e9567dc4a40053a54", "score": "0.5153934", "text": "function computeBoxes(){\n\n // Put scatter plot A on the left.\n scatterPlotA.box = {\n x: 0,\n y: 0,\n width: container.clientWidth / 2,\n height: container.clientHeight\n };\n\n // Put scatter plot B on the left.\n scatterPlotB.box = {\n x: container.clientWidth / 2,\n y: 0,\n width: container.clientWidth / 2,\n height: container.clientHeight\n };\n }", "title": "" }, { "docid": "aa3ee7b257f1a65b63e1ed036098b39b", "score": "0.5152736", "text": "function render3DVisual() {\n setThreedVisual(\n <ShowVisualization\n data={schemaRaw}\n type={visualizationTypes.threeD}\n // No embed link for 3D for now\n />\n );\n }", "title": "" }, { "docid": "8e9442edd5669ab1f3ea6836be49a6e1", "score": "0.5152282", "text": "function decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function(seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return\r\n }\r\n\r\n var data = seriesModel.getData()\r\n\r\n if (data.hasItemVisual()) {\r\n data.each(function(idx) {\r\n var decal = data.getItemVisual(idx, 'decal')\r\n\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style')\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api)\r\n }\r\n })\r\n }\r\n\r\n var decal = data.getVisual('decal')\r\n\r\n if (decal) {\r\n var style = data.getVisual('style')\r\n style.decal = createOrUpdatePatternFromDecal(decal, api)\r\n }\r\n })\r\n }", "title": "" }, { "docid": "3971bd0f86bc0c1310184d85fcf1ad74", "score": "0.5150233", "text": "showReduced() {\n COMMON_DATA.isShowReduced = true;\n let edge = this.dataContainer.edge;\n let full = COMMON_DATA.groupVertexOption[\"SHOW_FULL_ALWAYS\"];\n let lstVer = [], lstProp = [];\n\n // Filter the vertex effected by show reduced\n lstVer = _.filter(this.dataContainer.vertex, (e) => {\n return full.indexOf(e.vertexType) < 0;\n });\n lstVer.forEach((vertex) => {\n d3.select(`#${vertex.id}`).selectAll('.drag_connect:not(.connect_header)').classed(\"hide\", true);\n d3.select(`#${vertex.id}`).selectAll('.property').classed(\"hide\", true);\n });\n\n // Get vertex and property can display\n edge.forEach((edgeItem) => {\n lstProp.push({\n vert: edgeItem.source.vertexId,\n prop: edgeItem.source.prop\n }, {vert: edgeItem.target.vertexId, prop: edgeItem.target.prop});\n });\n\n lstVer.forEach((vertexItem) => {\n let arrPropOfVertex = [];\n lstProp.forEach((propItem) => {\n if (propItem.vert === vertexItem.id) {\n if (arrPropOfVertex.indexOf(propItem.prop) === -1) {\n arrPropOfVertex.push(propItem.prop);\n }\n }\n });\n d3.select(`#${vertexItem.id}`).classed(\"hide\", false); // Enable Vertex\n arrPropOfVertex.forEach((propItem) => {\n d3.select(`#${vertexItem.id}`).select(\".property[prop='\" + propItem + \"']\").classed(\"hide\", false);\n d3.select(`#${vertexItem.id}`).select(\".property[prop='\" + propItem + \"']\").classed(\"hide\", false);\n });\n this.vertex.updatePathConnect(vertexItem.id); // Re-draw edge\n /* Update Circle */\n this.vertex.updatePositionConnect(arrPropOfVertex, d3.select(`#${vertexItem.id}`), vertexItem.id);\n });\n\n this.vertex.resetSizeVertex(false);\n this.updateHeightBoundary();\n }", "title": "" }, { "docid": "060fbb6e72cdb8831a732d5233140a45", "score": "0.51498485", "text": "function draw() {\n\n var isGridDrawn = false;\n\n if(graph.options.errorMessage) {\n var $errorMsg = $('<div class=\"elroi-error\">' + graph.options.errorMessage + '</div>')\n .addClass('alert box');\n\n graph.$el.find('.paper').prepend($errorMsg);\n }\n\n if(!graph.allSeries.length) {\n elroi.fn.grid(graph).draw();\n }\n\n\n $(graph.allSeries).each(function(i) {\n\n if(!isGridDrawn && graph.seriesOptions[i].type !== 'pie') {\n elroi.fn.grid(graph).draw();\n isGridDrawn = true;\n }\n\n var type = graph.seriesOptions[i].type;\n elroi.fn[type](graph, graph.allSeries[i].series, i).draw();\n\n });\n\n }", "title": "" }, { "docid": "02427eba78c07864d262d920d6a60eaa", "score": "0.5146135", "text": "function visualizeWorkflow (data, canvas) { // eslint-disable-line no-shadow\n // extracted workflow dataset\n dataset = {\n steps: d3.values(data.steps),\n links: [],\n nodes: [],\n name: '',\n annotation: {},\n graph_depth: 0,\n graph_width: 0,\n columns: []\n };\n\n // x scale\n var xscale = d3.scale.linear()\n .domain([0, shapeDim.window.width])\n .range([0, shapeDim.window.width]);\n // y scale\n var yscale = d3.scale.linear()\n .domain([0, shapeDim.window.height])\n .range([0, shapeDim.window.height]);\n\n // zoom behavior (only with ctrl key down)\n zoom = d3.behavior.zoom();\n d3.select('#vis_workflow').select('svg').call(zoom.on('zoom', geometricZoom))\n .on('dblclick.zoom', null)\n .on('mousewheel.zoom', null)\n .on('DOMMouseScroll.zoom', null)\n .on('wheel.zoom', null);\n\n // zoom is allowed with ctrl-key down only\n d3.select('body').on('keydown', function () {\n if (d3.event.ctrlKey) {\n d3.select('#vis_workflow').select('svg')\n .call(zoom.on('zoom', geometricZoom));\n }\n });\n\n // on zoomend, disable zoom behavior again\n zoom.on('zoomend', function () {\n d3.select('#vis_workflow').select('svg').call(zoom.on('zoom', geometricZoom))\n .on('dblclick.zoom', null)\n .on('mousewheel.zoom', null)\n .on('DOMMouseScroll.zoom', null)\n .on('wheel.zoom', null);\n });\n\n // overlay rect for zoom\n canvas.append('g').append('rect')\n .attr('class', 'overlay')\n .attr('x', -shapeDim.window.width)\n .attr('y', -shapeDim.window.height)\n .attr('width', shapeDim.window.width * 4)\n .attr('height', shapeDim.window.height * 4)\n .attr('fill', 'none')\n .attr('pointer-events', 'all');\n\n // force layout definition\n force = d3.layout.force()\n .size(layoutProp.size)\n .linkDistance(layoutProp.linkDistance)\n .linkStrength(layoutProp.linkStrength)\n .friction(layoutProp.friction)\n .charge(layoutProp.charge)\n .theta(layoutProp.theta)\n .gravity(layoutProp.gravity)\n .on('tick', update);\n\n // drag and drop node enabled\n var drag = force.drag()\n .on('dragstart', dragstart)\n .on('dragend', dragend);\n\n // extract links via input connections\n dataset.steps.forEach(\n function (y) {\n if (y.input_connections !== null) {\n d3.values(y.input_connections).forEach(function (x) {\n dataset.links.push({\n source: +x.id, target: +y.id,\n id: ('link_' + x.id + '_' + y.id), highlighted: false\n });\n });\n }\n }\n );\n\n // extract nodes from steps\n dataset.steps.forEach(function (d) {\n if (d3.values(d.input_connections).length === 0) {\n dataset.nodes.push({ id: d.id, fixed: true, type: 'input' });\n } else if (!srcElemInArr(dataset.links, d.id)) {\n dataset.nodes.push({ id: d.id, fixed: true, type: 'output' });\n } else {\n dataset.nodes.push({ id: d.id, fixed: true });\n }\n dataset.nodes[d.id].highlighted = false;\n dataset.nodes[d.id].expanded_out = false;\n dataset.nodes[d.id].expanded_in_con = false;\n dataset.nodes[d.id].visited = false;\n });\n\n // add graph metrics\n inNodes = getInputNodes();\n outNodes = getOutputNodes();\n\n // set columns for nodes\n inNodes.forEach(function (d) {\n d.column = 0;\n d.visited = true;\n });\n\n inNodes.forEach(function (d) {\n calcColumns(d);\n });\n\n setGraphWidth();\n setGraphDepth();\n\n // add column expansion logic\n for (var k = 0; k < dataset.graph_depth; k++) {\n dataset.columns.push({ inputs: 0, outputs: 0 });\t// number of\n // inputs and outputs of nodes expanded initially set to 0\n }\n\n // save subgraph for each node\n dataset.nodes.forEach(function (d, i) {\n var selNodeId = d.id;\n var subgraph = [];\n var graphIndex = -1;\n\n getSubgraphById(selNodeId, subgraph, graphIndex, selNodeId, 0);\n\n if (subgraph.length === 0) {\n dataset.nodes[i].subgraph = [];\n } else {\n dataset.nodes[i].subgraph = subgraph;\n }\n });\n\n // -----------------------------------------------------------------\n // ------------------- GALAXY LAYOUT COORDINATES -------------------\n // -----------------------------------------------------------------\n if (layout === layoutKind.GALAXY) {\n dataset.steps.forEach(function (d) {\n if (d.position !== null) {\n dataset.nodes[d.id].x = xscale(d.position.left);\n dataset.nodes[d.id].y = yscale(d.position.top);\n }\n });\n } else if (layout === layoutKind.REFINERY) {\n // ------------------- REFINERY LAYOUT COORDINATES -------------------\n // init rows for inputs first\n inNodes.forEach(function (d, i) {\n d.row = i;\n });\n\n // set all nodes to unvisited\n dataset.nodes.forEach(function (d) {\n d.visited = false;\n });\n\n // process layout\n for (var iDepth = 0; iDepth < dataset.graph_depth; iDepth++) {\n // for each column\n getNodesByCol(iDepth).forEach(function (cur) { // eslint-disable-line no-loop-func\n // get successors for column nodes\n var succNodes = getSuccNodesByNodeId(cur.id);\n\n // branch -> new rows to add before and after\n if (succNodes.length > 1) {\n // successors already visited\n var visited = getNumberOfVisitedNodesByArr(succNodes);\n var rowShift = parseInt(succNodes.length / 2, 10);\n\n // shift nodes before and after\n // only if there are more than one successor\n if (succNodes.length - visited > 1) {\n shiftNodesByRows(rowShift, cur.column, cur.row);\n shiftNodesByRows(rowShift, cur.column, cur.row + 1);\n }\n\n var succRow = cur.row - rowShift + visited;\n succNodes.forEach(function (succ) {\n if (succNodes.length % 2 === 0 && succRow === cur.row) {\n succRow++;\n }\n\n if (dataset.nodes[succ].visited === false) {\n dataset.nodes[succ].row = succRow;\n dataset.nodes[succ].visited = true;\n succRow++;\n }\n });\n } else {\n succNodes.forEach(function (succ) {\n dataset.nodes[succ].row = dataset.nodes[cur.id].row;\n });\n }\n });\n }\n\n var maxRow = 0;\n dataset.nodes.forEach(function (d) {\n if (d.row > maxRow) {\n maxRow = d.row;\n }\n });\n dataset.graph_rows = maxRow + 1;\n\n // set coordinates for nodes\n for (var i = 0; i < dataset.graph_depth; i++) {\n getNodesByCol(i).forEach(function (cur) { // eslint-disable-line no-loop-func\n cur.x = xscale(shapeDim.margin.left + cur.column * shapeDim.column.width);\n cur.y = yscale(shapeDim.margin.top + cur.row * shapeDim.row.height);\n });\n }\n } else {\n $log.error('ERROR: No layout chosen!');\n }\n\n // -----------------------------------------------------------------\n // ------------------- SVG ELEMENTS --------------------------------\n // -----------------------------------------------------------------\n\n // force layout links and nodes\n var link = canvas.selectAll('.link');\n var node = canvas.selectAll('.node');\n\n // link represented as line\n link = link\n .data(dataset.links)\n .enter()\n .append('path')\n .attr('class', 'link')\n .attr('id', function (d) {\n return 'link_' + d.source + '_' + d.target;\n })\n .attr('stroke', 'gray')\n .attr('stroke-width', 1.5);\n\n // node represented as a group\n node = node\n .data(dataset.nodes)\n .enter()\n .append('g')\n .attr('class', 'node')\n .attr('id', function (d) {\n return 'node_' + d.id;\n })\n .call(drag);\n\n var nodeG = node.append('g').attr('class', 'nodeG');\n\n // node shape\n nodeG.append('rect')\n .attr('class', 'nodeRect')\n .attr('width', shapeDim.node.width)\n .attr('height', shapeDim.node.height)\n .attr('x', -shapeDim.node.width / 2)\n .attr('y', -shapeDim.node.height / 2)\n .attr('rx', 3)\n .attr('ry', 3)\n .attr('fill', 'lightsteelblue')\n .attr('stroke', 'gray')\n .attr('stroke-width', 1.5);\n\n // node title\n nodeG.append('g')\n .attr('transform', function () {\n return 'translate(' + 0 + ',' + parseInt(-shapeDim.node.height / 2, 10) + ')';\n })\n .attr('class', 'nodeTitle')\n .call(nodeTitle);\n\n // create tooltip\n // create d3-tip tooltips\n nodeG.each(function () {\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function (d) {\n return '<span style=\"color:#fa9b30\">' + dataset.steps[d.id].name + '</span>';\n });\n\n // invoke tooltip on dom element\n d3.select(this).call(tip);\n d3.select(this).on('mouseover', tip.show)\n .on('mouseout', tip.hide);\n });\n\n // node inputs\n var nodeInput = node.append('g').attr('transform', function () {\n return 'translate(' + parseInt((shapeDim.node.width / 2), 10) + ',' + 0 + ')';\n }).attr('class', 'nodeInput');\n\n // add groups for title rect pairs\n nodeInput.selectAll('nodeInputG')\n .data(function (d) {\n return d3.values(dataset.steps[d.id].inputs);\n }).enter().append('g')\n .attr('class', 'nodeInputG')\n .attr('id', function (d, m) {\n return 'nodeInputG_' + m;\n });\n\n // create input circle\n var nodeInputCircle = createNodeCircle(\n nodeInputCircle,\n node,\n 'nodeInputCircle',\n 'fileIconInputCircle',\n shapeDim.node.width / 2\n );\n\n // node input_con\n var nodeInputCon = node.append('g').attr('transform', function () {\n return 'translate(' + parseInt((-shapeDim.node.width / 2), 10) + ',' + 0 + ')';\n }).attr('class', 'nodeInputCon');\n\n // add groups for title rect pairs - without the interaction is not possible\n nodeInputCon.selectAll('nodeInputConG')\n .data(function (d) {\n return d3.values(dataset.steps[d.id].input_connections);\n }).enter().append('g')\n .attr('class', 'nodeInputConG').attr('id', function (d, l) {\n return 'nodeInputConG_' + l;\n });\n\n // create input con circle\n var nodeInputConCircle = createNodeCircle(\n nodeInputConCircle,\n node,\n 'nodeInputConCircle',\n 'fileIconInputConCircle',\n -shapeDim.node.width / 2\n );\n\n // node outputs\n var nodeOutput = node.append('g').attr('transform', function () {\n return 'translate(' + parseInt((shapeDim.node.width / 2), 10) + ',' + 0 + ')';\n }).attr('class', 'nodeOutput');\n\n // add groups for title rect pairs\n nodeOutput.selectAll('nodeOutputG')\n .data(function (d) {\n return d3.values(dataset.steps[d.id].outputs);\n })\n .enter()\n .append('g')\n .attr('class', 'nodeOutputG')\n .attr('id', function (d, n) {\n return 'nodeOutputG_' + n;\n });\n\n // create output circle\n var nodeOutputCircle = createNodeCircle(\n nodeOutputCircle,\n node,\n 'nodeOutputCircle',\n 'fileIconOutputCircle',\n shapeDim.node.width / 2\n );\n\n // dye circles when they contain at least one stored output\n node.each(function (d) {\n dyeCircles(d.id);\n });\n\n // remove unused svg elements (node specific)\n node.each(function (d) {\n // remove input svg group from nodes without inputs\n if (d3.values(dataset.steps[d.id].inputs).length === 0) {\n d3.select(this).select('.nodeInputCircle').remove();\n d3.select(this).select('.nodeInput').remove();\n }\n // remove input_cons icons and selectable node path\n if (d3.values(dataset.steps[d.id].input_connections).length === 0) {\n d3.select(this).select('.nodeInputConCircle').remove();\n d3.select(this).select('.nodePath').remove();\n }\n // remove output icons\n if (d3.values(dataset.steps[d.id].outputs).length === 0) {\n d3.select(this).select('.nodeOutputCircle').remove();\n }\n // change node rect for input nodes\n if (d3.values(dataset.steps[d.id].input_connections).length === 0) {\n d3.select(this).select('.nodeRect').attr('fill', 'white');\n }\n });\n\n // -----------------------------------------------------------------\n // ------------------- FORCE LAYOUT START --------------------------\n // -----------------------------------------------------------------\n\n // execute force layout\n // attention: after executing the force layout, link.source and\n // link.target obtain the node data structures instead of simple integer ids\n force.nodes(dataset.nodes).links(dataset.links).start();\n\n // initial fit to window call\n fitWfToWindow(0);\n\n // -----------------------------------------------------------------\n // ------------------- EVENTS --------------------------------------\n // -----------------------------------------------------------------\n\n // -----------------------------------------------------------------\n // ------------------- CLEAR HIGHLIGHTING AND REMOVE TABLE ---------\n // -----------------------------------------------------------------\n var overlayOnClick = function () {\n // remove old table on click\n d3.select('#workflowtbl').remove();\n clearHighlighting(link);\n };\n\n // -----------------------------------------------------------------\n // ------------------- FIT WORKFLOW TO WINDOW ----------------------\n // -----------------------------------------------------------------\n var overlayOnDblclick = function () {\n fitWfToWindow(1000);\n };\n\n // -----------------------------------------------------------------\n // ------------------- CLICK DBLCLICK SEPARATION -------------------\n // -----------------------------------------------------------------\n var firing = false;\n var timer; // eslint-disable-line no-unused-vars\n var overlayAction = overlayOnClick;\t// default action\n\n d3.select('.overlay').on('click', function () {\n // suppress after dragend\n if (d3.event.defaultPrevented) return;\n\n // if dblclick, break\n if (firing) {\n return;\n }\n\n firing = true;\n // function overlayAction is called after a certain amount of time\n timer = setTimeout(function () {\n overlayAction();\t// called always\n\n overlayAction = overlayOnClick; // set back click action to\n // single\n firing = false;\n }, 150); // timeout value\n });\n\n // if dblclick, the single click action is overwritten\n d3.select('.overlay').on('dblclick', function () {\n overlayAction = overlayOnDblclick;\n });\n\n // -----------------------------------------------------------------\n // ------------------- TABLE AND PATH HIGHLIGHTING -----------------\n // -----------------------------------------------------------------\n // update table data with properties of selected node\n node.select('.nodeG').on('click', function (x) {\n // suppress after dragend\n if (d3.event.defaultPrevented) return;\n\n // -----------------------------------------------------------------\n // ------------------- PATH HIGHLIGHTING ---------------------------\n // -----------------------------------------------------------------\n // get selected node\n var selPath = [];\n var selNodeRect = d3.select(this).select('.nodeRect');\n var selPathRect = d3.select(this.parentNode).selectAll('.inputConRect');\n\n x.subgraph.forEach(function (d, j) {\n selPath = selPath.concat.apply(selPath, x.subgraph[j]);\n });\n\n // clear previous highlighting\n overlayOnClick();\n\n if (typeof selPath[0] !== 'undefined') {\n // when path beginning with this node is not highlighted yet\n if (selPath[0].highlighted === false) {\n dyePath(selPath, selNodeRect, selPathRect, 'orange', 5, 'orange', true);\n } else {\n dyePath(selPath, selNodeRect, selPathRect, 'gray', 1.5, 'lightsteelblue', false);\n }\n }\n\n // -----------------------------------------------------------------\n // ------------------- TABLE ---------------------------------------\n // -----------------------------------------------------------------\n createTable(x);\n });\n\n\n // -----------------------------------------------------------------\n // ------------------- INPUT CON FILES -----------------------------\n // -----------------------------------------------------------------\n nodeInputConCircle.on('mouseover', function () {\n d3.select(this).select('.fileIconInputConCircle')\n .attr('stroke', 'steelblue').attr('stroke-width', 2);\n });\n\n nodeInputConCircle.on('mouseout', function () {\n d3.select(this).select('.fileIconInputConCircle')\n .attr('stroke', 'gray').attr('stroke-width', 1.5);\n });\n\n nodeInputConCircle.on('click', nodeInputConCircleEvent);\n\n // -----------------------------------------------------------------\n // ------------------- INPUT CON FILES REMOVE EVENT ----------------\n // -----------------------------------------------------------------\n d3.selectAll('.nodeInputCon').on('click', function (x) {\n x.expanded_in_con = false;\n dataset.columns[x.column].inputs -= 1;\n\n if (dataset.columns[x.column].inputs === 0 && (\n layout === layoutKind.REFINERY || layout === layoutKind.GALAXY\n )) {\n updateColumnTranslation(x.column, layoutTranslation.COLLAPSE_LEFT);\n }\n\n // show input con circle again\n var curNodeId = this.parentNode.__data__.id;\n var nodeCircle = d3.select('#node_' + curNodeId).select('.nodeInputConCircle');\n\n nodeCircle.attr('opacity', 1);\n\n // remove expanded files\n removeGlobalTooltip('#tt_id-' + curNodeId);\n d3.select(this.parentNode).selectAll('.inputConRect').remove();\n d3.select(this.parentNode).selectAll('.inputConRectTitle').remove();\n d3.select(this.parentNode).selectAll('.inputConRectCircle').remove();\n d3.select(this.parentNode).selectAll('.inputConRectCircleG').remove();\n\n force.resume();\n update();\n });\n\n // -----------------------------------------------------------------\n // ------------------- OUTPUT FILES --------------------------------\n // -----------------------------------------------------------------\n nodeOutputCircle.on('mouseover', function () {\n d3.select(this).select('.fileIconOutputCircle')\n .attr('stroke', 'steelblue')\n .attr('stroke-width', 2);\n });\n\n nodeOutputCircle.on('mouseout', function () {\n d3.select(this).select('.fileIconOutputCircle')\n .attr('stroke', 'gray')\n .attr('stroke-width', 1.5);\n });\n\n nodeOutputCircle.on('click', nodeOutputCircleEvent);\n\n // -----------------------------------------------------------------\n // ------------------- OUTPUT FILES REMOVE EVENT -------------------\n // -----------------------------------------------------------------\n d3.selectAll('.nodeOutput').on('click', function (x) {\n x.expanded_out = false;\n dataset.columns[x.column].outputs -= 1;\n\n if (dataset.columns[x.column].outputs === 0 && (\n layout === layoutKind.REFINERY || layout === layoutKind.GALAXY)\n ) {\n updateColumnTranslation(x.column, layoutTranslation.COLLAPSE_RIGHT);\n }\n\n // show output circle again\n var curNodeId = this.parentNode.__data__.id;\n var nodeCircle = d3.select('#node_' + curNodeId).select('.nodeOutputCircle');\n nodeCircle.attr('opacity', 1);\n\n // remove expanded files\n removeGlobalTooltip('#tt_id-' + curNodeId);\n d3.select(this.parentNode).selectAll('.outputRect').remove();\n d3.select(this.parentNode).selectAll('.outRectTitle').remove();\n d3.select(this.parentNode).selectAll('.outRectCircle').remove();\n d3.select(this.parentNode).selectAll('.outRectCircleG').remove();\n\n force.resume();\n update();\n });\n\n // -----------------------------------------------------------------\n // ------------------- INPUT FILES ---------------------------------\n // -----------------------------------------------------------------\n nodeInputCircle.on('mouseover', function () {\n d3.select(this).select('.fileIconInputCircle')\n .attr('stroke', 'steelblue').attr('stroke-width', 2);\n });\n\n nodeInputCircle.on('mouseout', function () {\n d3.select(this).select('.fileIconInputCircle')\n .attr('stroke', 'gray').attr('stroke-width', 1.5);\n });\n\n nodeInputCircle.on('click', nodeInputCircleEvent);\n\n // -----------------------------------------------------------------\n // ------------------- INPUT FILES REMOVE EVENT -------------------\n // -----------------------------------------------------------------\n d3.selectAll('.nodeInput').on('click', function (x) {\n x.expanded_out = false;\n dataset.columns[x.column].outputs -= 1;\n\n if (dataset.columns[x.column].outputs === 0 && (\n layout === layoutKind.REFINERY || layout === layoutKind.GALAXY)\n ) {\n updateColumnTranslation(x.column, layoutTranslation.COLLAPSE_RIGHT);\n }\n\n // show input circle again\n var curNodeId = this.parentNode.__data__.id;\n var nodeCircle = d3.select('#node_' + curNodeId).select('.nodeInputCircle');\n nodeCircle.attr('opacity', 1);\n\n // remove expanded files\n removeGlobalTooltip('#tt_id-' + curNodeId);\n d3.select(this.parentNode).selectAll('.inputRect').remove();\n d3.select(this.parentNode).selectAll('.inputRectTitle').remove();\n d3.select(this.parentNode).selectAll('.inRectCircle').remove();\n d3.select(this.parentNode).selectAll('.inRectCircleG').remove();\n\n force.resume();\n update();\n });\n\n // -----------------------------------------------------------------\n // ------------------- WINDOW RESIZE -------------------------------\n // -----------------------------------------------------------------\n d3.select(window).on('resize', resize);\n }", "title": "" }, { "docid": "fde27390fa778021424b7c6669c42779", "score": "0.5144654", "text": "layoutArticulationMarks(articulations, voiceEntry, graphicalStaffEntry) {\n // uncomment this when implementing:\n // let vfse: VexFlowStaffEntry = (graphicalStaffEntry as VexFlowStaffEntry);\n return;\n }", "title": "" } ]
2ffc5cf31e8a47c4284bf43e331a3501
Base class helpers for the updating state of a component.
[ { "docid": "9e2ffbb9dc9b6ad00b14e721e5ca3914", "score": "0.0", "text": "function Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n // We initialize the default updater but the real one gets injected by the\n // renderer.\n this.updater = updater || ReactNoopUpdateQueue;\n }", "title": "" } ]
[ { "docid": "49771568fab192a8a975a2fd0b4ec27d", "score": "0.70644385", "text": "updateState() {}", "title": "" }, { "docid": "00c97e1f8b2a8ec1527de619a3269979", "score": "0.70267814", "text": "update (){\n // will be implemented in invdividual components\n }", "title": "" }, { "docid": "7e3f828449204da88a348785c6afb236", "score": "0.6753045", "text": "_updateStateValue(prop, v) {\n var c = this._component\n if(c.state && c.state[prop] !== undefined){\n var state = {}\n state[prop] = v\n c.setState(state)\n }else{\n c[prop] = v\n c.forceUpdate()\n }\n }", "title": "" }, { "docid": "ff1ff4c749a723b60a56094fbafae9d4", "score": "0.6681566", "text": "beforeUpdating(props, state) { }", "title": "" }, { "docid": "8db17c5234ac4c725f8b65e61b1c6a74", "score": "0.64622325", "text": "componentDidUpdate(updatedVal) {\n this.setState(updatedVal)\n }", "title": "" }, { "docid": "23b50927300fcc12263b8d9aae93d716", "score": "0.64524955", "text": "updateState(propName,newValue){\n this.data[propName] = newValue; \n this.updateVars(propName);\n this.updateTemplates(propName);\n this.updateIf(propName)\n this.updateChildren();\n }", "title": "" }, { "docid": "e9cb3147e33957afdaa20e407f4e27ef", "score": "0.6446268", "text": "relayValue(component, type, newValue) { //component:string, type:string, value:string\n console.log('component is: ' + component + ', type is: ' + type + ', newValue is ' + newValue)\n this.setState({\n component: component,\n [type]: newValue\n }, () => {\n console.log('state of component updated to ' + this.state.component);\n console.log('state of ' + type + ' updated to ' + this.state[type]);\n });\n }", "title": "" }, { "docid": "2c76c7c0c8d64510b911536c315826e3", "score": "0.6394083", "text": "update (data = {}) {\n this.state = Object.assign(this.state, data);\n this.notify(this.state);\n }", "title": "" }, { "docid": "5ff72852465eb373d15cf580b168b92f", "score": "0.6384914", "text": "updateState(stateChange){\n this.setState(stateChange);\n }", "title": "" }, { "docid": "5ff72852465eb373d15cf580b168b92f", "score": "0.6384914", "text": "updateState(stateChange){\n this.setState(stateChange);\n }", "title": "" }, { "docid": "b7d11bfb33e71821dc2903db1d1af8b7", "score": "0.6311387", "text": "updateSliderState(updateObj) {\n this.setState(updateObj);\n }", "title": "" }, { "docid": "decbb8b8d2ffcf24b0024ef9a35c76b7", "score": "0.63051015", "text": "handler(update) {\n this.setState(update)\n }", "title": "" }, { "docid": "1f83b9ced3705af3f9e81b52c67b9865", "score": "0.62855995", "text": "update() {\n for (let component of Object.values(this._components)) {\n if (component.isActive)\n component.update()\n }\n }", "title": "" }, { "docid": "281521cd63afcd7e23f2ea9568961dbd", "score": "0.6279762", "text": "update(){\r\n\t\t\r\n\t\tfor(let componentIdentification in this.components)\r\n\t\t\tthis.components[componentIdentification].update();\r\n\t}", "title": "" }, { "docid": "eddd6ee101721f5b637cf8bda6387edc", "score": "0.62593156", "text": "componentChanged(component, newProps, newState) {\n\t\tthis.setState({\n\t\t\tfixture: {\n\t\t\t\t...newProps,\n\t\t\t\tstate: newState\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "dd5a506b5278036d41b4918d06bfa062", "score": "0.62352437", "text": "_stateChanged(state) {\n\n }", "title": "" }, { "docid": "6c5a53bf946ffe731fdd062534b8391f", "score": "0.6212409", "text": "selfUpdated() { }", "title": "" }, { "docid": "8965f0f9a7f90f8622f164cd97f9d3d8", "score": "0.61698216", "text": "setState(props) {\n // Shallow merge new properties into state object\n for (let key in props) {\n if (props.hasOwnProperty(key)) {\n this.state.data[key] = props[key];\n }\n }\n // trigger a re-render\n this.render(); // basically updating the UI with the new state, this function is down below.\n }", "title": "" }, { "docid": "2823978e2117b9d799bbf26daa311f72", "score": "0.61462975", "text": "stateChanged(_state) { }", "title": "" }, { "docid": "66ba29baf145f46388700fde685834d0", "score": "0.61284673", "text": "setStateComponent(alias = null, instanceClass = null){\n instanceClass.stateMachine = this;\n this._components[alias] = instanceClass;\n }", "title": "" }, { "docid": "72129d17b40cc2bc8cc43ba3c15bcfcb", "score": "0.60964876", "text": "update() {\n ReactDOM.render(<ComponentUpdates val={this.props.val +1} />,\n document.getElementById('root'))\n }", "title": "" }, { "docid": "a02bfc002fbfeead84e683a68d049f60", "score": "0.608717", "text": "constructor(updateState, state) {\n this._state = state;\n this._updateState = updateState;\n }", "title": "" }, { "docid": "788e2d3608e0334e14fb03791f429c3b", "score": "0.6080611", "text": "get state() { return this.component && this.component.state }", "title": "" }, { "docid": "485ee1b8c9d606fac797a995d20e0caa", "score": "0.6074467", "text": "onComponentChanged() {\n if (this.component) oak.updateSoon();\n }", "title": "" }, { "docid": "83d8c9ecc731b2604982f503971399c8", "score": "0.6057618", "text": "function setState(changes) {\n //console.log(\"setState : \");\n //console.log(changes);\n Object.assign(state, changes);\n \n \n ReactDOM.render(\n React.createElement(ContactView, \n Object.assign({}, state, \n {\n onNewContactChange: updateNewContact,\n onNewContactSubmit: submitNewContact,\n }\n )\n ),\n document.getElementById('divtest2')\n );\n\n}", "title": "" }, { "docid": "0071b173dcf97d222ded049173f8678f", "score": "0.604059", "text": "updateComponent(prop, value) {\n if( !this.connected ){ return; }\n switch(prop){\n case \"href\":\n this.$href.setAttribute('href', this.href);\n break;\n\n case \"icon\":\n this.$icon.innerText = this.icon;\n break;\n\n case \"name\":\n this.$name.innerText = this.name;\n break;\n }\n }", "title": "" }, { "docid": "1c4398cb3d8a1f505373a77f702b5227", "score": "0.6034817", "text": "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n \n }", "title": "" }, { "docid": "d11ea87a3bef0357b9550fa19ccaca51", "score": "0.60237217", "text": "componentDidUpdate(prevProps, prevState) {\n\n let sWho = \"PostsListComponent::componentDidUpdate\"\n\n if( this.props.componentDidUpdateSpy ){\n // You can use this intrusive spy to check on calls to componentDidUpdate, and also to ascertain state...\n this.props.componentDidUpdateSpy({'prevProps': {...prevProps}, 'currProps': {...this.props}, 'prevState': {...prevState}, 'currState': {...this.state}})\n }\n\n // Don't forget to compare props...!\n if (this.props.posts.post_is_editing_id !== prevProps.posts.post_is_editing_id \n ||\n this.props.posts.post_is_editing !== prevProps.posts.post_is_editing \n ){\n this.setState((state,props)=>{\n\n let returno = {\n postIsEditingPost: props.posts.post_is_editing_post ? props.posts.post_is_editing_post : {},\n postIsEditingId: props.posts.post_is_editing_id ? props.posts.post_is_editing_id: -1\n }\n\n logajohn.debug(`${sWho}(): Returning returno = `, returno )\n\n return returno\n })\n }\n }", "title": "" }, { "docid": "6ae4e9ec50af2764befd45e8b273de76", "score": "0.60231197", "text": "static forceRefresh (reactComponent, statePropertiesToUpdate, callBack = null) {\n\n\t\tconst state = reactComponent.state;\n\t\tconst timeStamp = new Date().getTime();\n\t\tlet newState = null;\n\t\tif(statePropertiesToUpdate) \n\t\t\tnewState = { ...state, ...statePropertiesToUpdate, timeStamp };\n\t\telse\n\t\t\tnewState = { ...state, timeStamp };\n\t\treactComponent.setState(newState, callBack ? callBack : undefined);\n\t}", "title": "" }, { "docid": "8dfab8399a753bedb6399570e93a94c9", "score": "0.60057557", "text": "constructor(props){\r\n super(props);\r\n this.state={\r\n forceUpdate:true\r\n }\r\n }", "title": "" }, { "docid": "e6676c505c14d8a40707905e9fd2686c", "score": "0.5994321", "text": "_updateState(dataKey, field, value) {\n if (IsDefined(dataKey) && IsObject(this.dom.state)) {\n if (!IsObject(this.dom.state[dataKey])) {\n this.dom.state[dataKey] = {\n open: false,\n template: this.field.state,\n footer_adjust: this.field.state,\n customLabel: false\n };\n }\n this.dom.state[dataKey][field] = value;\n }\n }", "title": "" }, { "docid": "98b0a5bfb8adfc96127e694a6f93d9c2", "score": "0.59902865", "text": "componentDidUpdate() {\n this.props.onChange(this.state)\n }", "title": "" }, { "docid": "62e615d749d0a997bb8cf442721848e1", "score": "0.59718853", "text": "updateMainState(updateObj, callback) {\n this.setState(updateObj, callback);\n }", "title": "" }, { "docid": "310c7abc71b422e3d0287b24ee42652c", "score": "0.5967696", "text": "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n }", "title": "" }, { "docid": "c9dc687ea01d801dfc44dcea5aebef6d", "score": "0.5963925", "text": "constructor(props){\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tmodifyingStep: false,\n\t\t\tstepBeingModified: -1\n\t\t};\n\t}", "title": "" }, { "docid": "90cf3ecac9467aa2e937a05f4ca75df6", "score": "0.59573954", "text": "constructor(){ //Here constructor is used to define the object and its properties. NO HTML involved.\n super()\n \n const METHODS = [\n \"add\", \n \"less\",\n \"clean\",\n ]\n \n METHODS.forEach((method)=>{ //Use forEach to run across an arrey of methods and assign them a bind()\n this[method]=this[method].bind(this)\n })\n \n this.state={ // State of a component is an object that holds some information that may change over the lifetime of the component\n quantity:0\n }\n }", "title": "" }, { "docid": "74adf7705d44ab0100d05fc4cc43dafd", "score": "0.59516335", "text": "constructor(props) {\n // class components should always call the base constructor with props.\n super(props);\n\n // initial component state\n // lets suppose we got that info from some server-side API\n this.state = {\n user: {\n name: 'John',\n age: 33,\n avatar: 'https://ih0.redbubble.net/image.225771333.5422/flat,800x800,075,t.jpg'\n }\n };\n\n window.updateUserAge = (age) => {\n // we can pass object that will be merged with current state (but merge is shallow)\n // or we can pass a callback\n this.setState((prevState, props) => {\n const prev = prevState.user;\n prev.age = age;\n return prev;\n })\n }\n }", "title": "" }, { "docid": "f9d54a27fd4f12a184571c9797a9ddf0", "score": "0.5942332", "text": "componentDidUpdate(previousProps, previousState) {\n // let statusUpdated = (this.props.status !== previousState.status);\n // console.log('----------------');\n // console.log(this.props);\n // console.log(previousState);\n // console.log(statusUpdated);\n //\n // if (statusUpdated) {\n // console.log('status updated!');\n //\n // this.makeStatusEmpty();\n // }\n // else{\n // console.log('no update');\n // }\n }", "title": "" }, { "docid": "17bda92143dee4ad458530b07b7f442d", "score": "0.5939367", "text": "constructor(props) {\n super(props);\n this.state = {\n itemName: '',\n message: ''\n };\n \n this.handleChange = this.handleChange.bind(this);\n this.updateItem = this.updateItem.bind(this);\n }", "title": "" }, { "docid": "417b08ea5c75b0a891dbe2595cc92c13", "score": "0.59304136", "text": "render(){\n return(\n <InnerComponent\n {...this.props}\n {...this.state}\n update={this.update}\n />\n )\n }", "title": "" }, { "docid": "220b51c4dc6751980b59d2cf2e021f2c", "score": "0.5926295", "text": "componentDidUpdate(){\n if(this.state.start === false){\n if(this.props.categoryId === 8){\n if(this.state.value1 !== \"\" || this.state.value2 !== \"\"){\n this.props.subUpdate(this.state.id, this.state.value1, this.state.value2, \"0\")\n }else {\n this.props.subUpdate(this.state.id, this.state.value1, this.state.value2, \"\")\n }\n }else{\n this.props.subUpdate(this.state.id, this.state.value1, this.state.value2, this.state.value3)\n }\n }\n }", "title": "" }, { "docid": "3a25828857d9bbf53314fdb9ce3a5b74", "score": "0.59256643", "text": "refresh_() {\n // Can be overridden in sub-component.\n }", "title": "" }, { "docid": "7ccd9adf781254115df570e423ab45da", "score": "0.5920801", "text": "changeComponentState(component){\n var userDetails = {};\n userDetails.email = this.state.user.email;\n userDetails.service = this.state.user.service;\n userDetails.token = this.state.user.token;\n\n var componentState = component.props.location.state;\n\n if(componentState){\n componentState.user = userDetails;\n }else{\n componentState = {}\n componentState.user = userDetails;\n component.props.location.state = componentState;\n }\n }", "title": "" }, { "docid": "ff7299517850588aa320699e301458f2", "score": "0.5890826", "text": "stateSetter(params) {\n this.setState({params})\n }", "title": "" }, { "docid": "26d5c13a4faf9b59f3152b1cd7d06a9b", "score": "0.5878652", "text": "componentDidUpdate(){\r\n if (this.props.noteToEdit) this.props.onNoteUpdate();\r\n }", "title": "" }, { "docid": "5ade07eac5e0c4ee32cc46e0533a64a1", "score": "0.5877154", "text": "componentDidUpdate(prevProps, prevState) {\n // setState() can't be invoked from componentDidUpdate()\n console.info(\"componentDidUpdate()\");\n }", "title": "" }, { "docid": "f45fe79b27ccc24ac6013740b2ec7a8c", "score": "0.58727074", "text": "function updateComponent(component) {\n\t\tcontext.component.renderComponent(component);\n\t}", "title": "" }, { "docid": "15682b4f3db4345a11dae8a49b52f261", "score": "0.58726585", "text": "updateState(state, newState) {\n return null;\n }", "title": "" }, { "docid": "8efdfc5225a2efa5b2f42e8b7a8160de", "score": "0.5858473", "text": "function componentDidUpdate(lastProps, lastState) {}", "title": "" }, { "docid": "0f71bff37c746b0c14390a2d043ce2e2", "score": "0.5843981", "text": "updateState() {\n if (!this.isLoaded && !this.hasFailed) {\n this.isLoaded = this.isLoaded_();\n this.element.classList.toggle(\n ELEMENT_LOADED_CLASS_NAME,\n /* force */ this.isLoaded\n );\n }\n\n if (!this.hasFailed && !this.isLoaded) {\n this.hasFailed = this.hasFailed_();\n this.element.classList.toggle(\n ELEMENT_FAILED_CLASS_NAME,\n /* force */ this.hasFailed\n );\n }\n\n if (!this.canBeShown) {\n this.canBeShown = this.canBeShown_() || this.isLoaded;\n this.element.classList.toggle(\n ELEMENT_SHOW_CLASS_NAME,\n /* force */ this.canBeShown\n );\n }\n }", "title": "" }, { "docid": "fbb5bba603a7ee3872880a1f4de5123b", "score": "0.5838193", "text": "handleState(state) {\n let oldHP = this.hp;\n let oldName = this.name;\n\n Object.assign(this, state);\n\n // update the sprite\n if(oldName !== this.name) {\n this.sprite.texture = PIXI.loader.resources.demon.textures[this.name];\n }\n if(oldHP !== this.hp) {\n this.tinted = new Date().getTime();\n this.hpDamageTaken = oldHP - this.hp;\n }\n }", "title": "" }, { "docid": "0bc286ef76afcd2bb193be72ad980ad7", "score": "0.5836832", "text": "update(){\n throw new Error('Update must be implemented');\n }", "title": "" }, { "docid": "d17758e25193f49727800ab98d8584b3", "score": "0.5827346", "text": "componentDidUpdate(){\n console.log(\"component will update because of state change\")\n\n }", "title": "" }, { "docid": "0f29f60c4d536b033bf0e404076a4ecd", "score": "0.58272874", "text": "setState(state) {}", "title": "" }, { "docid": "cbe0b302c190d117aa75718a482b5b67", "score": "0.58200383", "text": "changeValue() {\n this.props.onChange(\n this.props.name,\n this.state,\n this.validate(\n this.state.active,\n this.state.type,\n this.state.step,\n this.state.sides,\n this.state.angles\n )\n );\n }", "title": "" }, { "docid": "e09be4be2d2afc92f1da6a624d2ad2db", "score": "0.58169603", "text": "state (...args) {\n return MVC.ComponentJS(this).state(...args)\n }", "title": "" }, { "docid": "c171ae96c0be61e204ccaeaaaac73edb", "score": "0.5813602", "text": "_renderAsUpdated(newValue, oldValue) {\n if (typeof newValue !== typeof undefined) {\n this._resetRenderMethods();\n }\n }", "title": "" }, { "docid": "65fa4bfc3f93d33dd7fbbc6dbf46375b", "score": "0.5812396", "text": "updateStatus(_status) {\n this.state.status = _status;\n // TODO: component should be updating automatically when state changes and forceUpdate shouldn\"t be needed\n // I am definitely doing something wrong here - should fix\n this.forceUpdate();\n }", "title": "" }, { "docid": "e5ded2c9d16bb3bb9df5dc9af4d10003", "score": "0.580439", "text": "_onChange() {\n // When we passed props to the constructor this.props was autoamtically\n // created and we can access them - with this.props - outside the constructor\n this.setState(stateCallback(this.props));\n }", "title": "" }, { "docid": "2bcbb1294540e8b0254a4d6fbf88e458", "score": "0.580083", "text": "componentWillUpdate(nextProps, nextState) {\n // setState() can't be invoked from componentWillUpdate()\n console.info(\"componentWillUpdate()\");\n }", "title": "" }, { "docid": "671c4684fadd82d7fa71e7a988d53e42", "score": "0.57987416", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n fullMenuList: this.props.model.getFullMenu(),\n fullMenuPrice: this.props.model.getFullMenuPrice()\n });\n }", "title": "" }, { "docid": "7c8fc48e37e9cfea6e1b1b03437b7eac", "score": "0.57979494", "text": "update() {\n if (this.props.detail.isValid(this.state.pokemonRaidBoss)) {\n this.props.onUpdate({\n value: {\n id: this.state.pokemonRaidBoss.hatched\n ? this.state.pokemonRaidBoss.id\n : undefined,\n form: this.state.pokemonRaidBoss.hatched\n ? this.state.pokemonRaidBoss.form\n : undefined,\n level: this.state.pokemonRaidBoss.level,\n hatched: this.state.pokemonRaidBoss.hatched,\n hatches: !this.state.pokemonRaidBoss.hatched\n ? this.state.pokemonRaidBoss.hatches\n : undefined,\n expires: this.state.pokemonRaidBoss.expires,\n },\n });\n } else {\n this.props.onUpdate({ value: undefined });\n }\n }", "title": "" }, { "docid": "91096028f64dd6d581fba0916c0d19c2", "score": "0.5789058", "text": "componentDidUpdate(prevProps, prevState) {\n this.isOpenChanges(prevProps);\n }", "title": "" }, { "docid": "155d64e1c37a18d952c7432de00b5f45", "score": "0.578767", "text": "componentDidUpdate(prevProps, prevState) {\n if (prevProps.unit != this.props.unit) {\n this.setState({\n unit: this.props.unit\n });\n }\n }", "title": "" }, { "docid": "ee09d0b3ff05aaaed09ad32299d2cc10", "score": "0.5786737", "text": "changeState({ oldState, newState } = {}) {\n dispatchEvent('playerstatechange', {\n playerid: this.id,\n oldstate: oldState,\n newstate: newState\n });\n }", "title": "" }, { "docid": "b30914d3760e5b1830fe2e31fc4a00ff", "score": "0.5783761", "text": "setState(name, value) {\n this.state[name] = value;\n }", "title": "" }, { "docid": "ec510b816f5d35892253de80f0a32c73", "score": "0.5780074", "text": "onPropertyChanged(newProp, oldProp) {\n let wrapper = this.getWrapper();\n for (let prop of Object.keys(newProp)) {\n switch (prop) {\n case 'checked':\n this.changeState(newProp.checked);\n break;\n case 'disabled':\n if (newProp.disabled) {\n this.setDisabled();\n this.unWireEvents();\n }\n else {\n this.element.disabled = false;\n wrapper.classList.remove(DISABLED$1);\n wrapper.setAttribute('aria-disabled', 'false');\n this.wireEvents();\n }\n break;\n case 'value':\n this.element.setAttribute('value', newProp.value);\n break;\n case 'name':\n this.element.setAttribute('name', newProp.name);\n break;\n case 'onLabel':\n case 'offLabel':\n this.setLabel(newProp.onLabel, newProp.offLabel);\n break;\n case 'enableRtl':\n if (newProp.enableRtl) {\n wrapper.classList.add(RTL$2);\n }\n else {\n wrapper.classList.remove(RTL$2);\n }\n break;\n case 'cssClass':\n if (oldProp.cssClass) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"removeClass\"])([wrapper], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"addClass\"])([wrapper], newProp.cssClass.split(' '));\n }\n break;\n }\n }\n }", "title": "" }, { "docid": "1b6c930b332deb000f6c353b11e5294e", "score": "0.5774002", "text": "updateState(name, value) {\n if(name === 'cardType')\n this.state.cardType.innerHTML = value;\n else\n this.state[name].value = value;\n\n }", "title": "" }, { "docid": "17a8ceea3d786f5340e13b8f65fe65da", "score": "0.57737195", "text": "update(){\n this.setState({\n a: this.a.refs.input.value,\n b: this.refs.b.value,\n });//this.a works for node but not component as a component can have multiple nodes\n }", "title": "" }, { "docid": "4368a983442fc670f3d9d300ceb73c80", "score": "0.57728434", "text": "componentDidUpdate(){}", "title": "" }, { "docid": "4368a983442fc670f3d9d300ceb73c80", "score": "0.57728434", "text": "componentDidUpdate(){}", "title": "" }, { "docid": "834381088fc393ef8c620006d87e9cd8", "score": "0.5767329", "text": "shouldComponentUpdate () {\n var returnStatus = true\n if (!this.state) {\n returnStatus = false\n }\n console.log('shouldcomponentUpdate ' + returnStatus)\n return returnStatus\n }", "title": "" }, { "docid": "0541d1d13d370b376e604a17118d105a", "score": "0.5762563", "text": "invokeUpdate(tags){\n this.state.tags = tags;\n this.setState(this.state);\n }", "title": "" }, { "docid": "383c82d7c74ac2655ac56c798d1ef300", "score": "0.5759066", "text": "_updateStateButtonPress () {\n this.props.onSetState(this.state.text)\n }", "title": "" }, { "docid": "6f36825fc09ce5da2079701b7cfff352", "score": "0.575668", "text": "_onChange(state) {\n this.setState(state);\n }", "title": "" }, { "docid": "936fabf927b9f157a08f6b2f2ce8de09", "score": "0.57553583", "text": "componentDidUpdate() {\n if (this.formIsValid)\n this.props.parentMethods.setValues({\n name: this.state.name.value,\n email: this.state.email.value,\n phone: this.state.phone.value,\n message: this.state.message.value\n })\n else\n this.props.parentMethods.setValues(null)\n }", "title": "" }, { "docid": "8aa7cfca9eacf189ada97248329839a9", "score": "0.57551116", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n menu: this.props.model.getFullMenu(),\n menuPrice: this.props.model.getTotalMenuPrice()\n })\n }", "title": "" }, { "docid": "d8ea6833586f984884fc0190359fed96", "score": "0.5751981", "text": "update() {\n if (typeof this.props.update !== \"undefined\") {\n this.props.update()\n }\n }", "title": "" }, { "docid": "a608dd2d91897e02652fd59c2e3b6a65", "score": "0.57500017", "text": "_updateField(field,value){\n this.setState({\n [field]: value\n });\n }", "title": "" }, { "docid": "adcaf06fb7b8e11497e45750e26d0e2d", "score": "0.5749273", "text": "componentWillMount() {\n this.update();\n }", "title": "" }, { "docid": "294947b260611aa8198313b3145e2672", "score": "0.57409275", "text": "update() {\n /* nothing to update yet */\n }", "title": "" }, { "docid": "e9bbfd061c4d87f9ad5fb21475714ac0", "score": "0.57353806", "text": "genericSync(event) {\n const { name, value } = event.target;\n this.setState({ [name]: value });\n }", "title": "" }, { "docid": "2810e5feac3c1beb7a311e2324af3229", "score": "0.5734426", "text": "componentWillUpdate(){\n if(this.props.job.OnCompleteNotificationMethod){\n document.querySelector(\"#c\"+this.props.job.OnCompleteNotificationMethod).checked=true;\n if(this.props.job.OnCompleteNotificationMethod===\"Email\"){\n document.querySelector(\"#phone p\").innerHTML=\"Email\";\n document.querySelector(\"#phone input\").value=this.props.job.OnCompleteNotificationEmail;\n }else{\n document.querySelector(\"#phone p\").innerHTML=\"Phone\";\n document.querySelector(\"#phone input\").value=this.props.job.OnCompleteNotificationValue;\n }\n }\n\n if(this.props.job.InProgressNotificationActive!==undefined){\n document.querySelector(\"#e\"+this.props.job.InProgressNotificationActive).checked=true;\n if(this.props.job.InProgressNotificationActive===true){\n document.querySelector(\"#i\"+this.props.job.InProgressNotificationMethod).checked=true;\n document.querySelector(\"#phoneUpdate input\").value=this.props.job.InProgressNotificationValue;\n }else{\n document.querySelector(\"#iMethod\").style.display=\"none\";\n document.querySelector(\"#phoneUpdate\").style.display=\"none\";\n }\n\n }\n }", "title": "" }, { "docid": "9df55d2019a84f845f166cce40967f0e", "score": "0.5732492", "text": "SET_COMPONENTS (state, components) {\n state.components = components\n }", "title": "" }, { "docid": "dc8c688e32adbb80a5030d388f7b3e24", "score": "0.5729699", "text": "componentDidUpdate() {}", "title": "" }, { "docid": "dc8c688e32adbb80a5030d388f7b3e24", "score": "0.5729699", "text": "componentDidUpdate() {}", "title": "" }, { "docid": "4b39b0e77d62015f7eea9f1ddfdb5f41", "score": "0.5728827", "text": "function processChild(element, Component) {\n var publicContext = processContext(Component, context);\n\n var queue = [];\n var replace = false;\n var updater = {\n isMounted: function (publicInstance) {\n return false;\n },\n enqueueForceUpdate: function (publicInstance) {\n if (queue === null) {\n warnNoop(publicInstance, 'forceUpdate');\n return null;\n }\n },\n enqueueReplaceState: function (publicInstance, completeState) {\n replace = true;\n queue = [completeState];\n },\n enqueueSetState: function (publicInstance, currentPartialState) {\n if (queue === null) {\n warnNoop(publicInstance, 'setState');\n return null;\n }\n queue.push(currentPartialState);\n }\n };\n\n var inst = void 0;\n if (shouldConstruct(Component)) {\n inst = new Component(element.props, publicContext, updater);\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n {\n if (inst.state === null || inst.state === undefined) {\n var componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUninitializedState[componentName]) {\n warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');\n didWarnAboutUninitializedState[componentName] = true;\n }\n }\n }\n\n var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);\n\n {\n if (partialState === undefined) {\n var _componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUndefinedDerivedState[_componentName]) {\n warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);\n didWarnAboutUndefinedDerivedState[_componentName] = true;\n }\n }\n }\n\n if (partialState != null) {\n inst.state = _assign({}, inst.state, partialState);\n }\n }\n } else {\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[_componentName2]) {\n warning(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);\n didWarnAboutBadClass[_componentName2] = true;\n }\n }\n }\n inst = Component(element.props, publicContext, updater);\n if (inst == null || inst.render == null) {\n child = inst;\n validateRenderResult(child, Component);\n return;\n }\n }\n\n inst.props = element.props;\n inst.context = publicContext;\n inst.updater = updater;\n\n var initialState = inst.state;\n if (initialState === undefined) {\n inst.state = initialState = null;\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {\n if (typeof inst.componentWillMount === 'function') {\n {\n if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[_componentName3]) {\n lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\\n\\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);\n didWarnAboutDeprecatedWillMount[_componentName3] = true;\n }\n }\n }\n\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n if (typeof Component.getDerivedStateFromProps !== 'function') {\n inst.componentWillMount();\n }\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n inst.UNSAFE_componentWillMount();\n }\n if (queue.length) {\n var oldQueue = queue;\n var oldReplace = replace;\n queue = null;\n replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;\n if (_partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = _assign({}, nextState, _partialState);\n } else {\n _assign(nextState, _partialState);\n }\n }\n }\n inst.state = nextState;\n }\n } else {\n queue = null;\n }\n }\n child = inst.render();\n\n {\n if (child === undefined && inst.render._isMockFunction) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n child = null;\n }\n }\n validateRenderResult(child, Component);\n\n var childContext = void 0;\n if (typeof inst.getChildContext === 'function') {\n var childContextTypes = Component.childContextTypes;\n if (typeof childContextTypes === 'object') {\n childContext = inst.getChildContext();\n for (var contextKey in childContext) {\n !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;\n }\n } else {\n warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');\n }\n }\n if (childContext) {\n context = _assign({}, context, childContext);\n }\n }", "title": "" }, { "docid": "4b39b0e77d62015f7eea9f1ddfdb5f41", "score": "0.5728827", "text": "function processChild(element, Component) {\n var publicContext = processContext(Component, context);\n\n var queue = [];\n var replace = false;\n var updater = {\n isMounted: function (publicInstance) {\n return false;\n },\n enqueueForceUpdate: function (publicInstance) {\n if (queue === null) {\n warnNoop(publicInstance, 'forceUpdate');\n return null;\n }\n },\n enqueueReplaceState: function (publicInstance, completeState) {\n replace = true;\n queue = [completeState];\n },\n enqueueSetState: function (publicInstance, currentPartialState) {\n if (queue === null) {\n warnNoop(publicInstance, 'setState');\n return null;\n }\n queue.push(currentPartialState);\n }\n };\n\n var inst = void 0;\n if (shouldConstruct(Component)) {\n inst = new Component(element.props, publicContext, updater);\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n {\n if (inst.state === null || inst.state === undefined) {\n var componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUninitializedState[componentName]) {\n warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');\n didWarnAboutUninitializedState[componentName] = true;\n }\n }\n }\n\n var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);\n\n {\n if (partialState === undefined) {\n var _componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUndefinedDerivedState[_componentName]) {\n warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);\n didWarnAboutUndefinedDerivedState[_componentName] = true;\n }\n }\n }\n\n if (partialState != null) {\n inst.state = _assign({}, inst.state, partialState);\n }\n }\n } else {\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[_componentName2]) {\n warning(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);\n didWarnAboutBadClass[_componentName2] = true;\n }\n }\n }\n inst = Component(element.props, publicContext, updater);\n if (inst == null || inst.render == null) {\n child = inst;\n validateRenderResult(child, Component);\n return;\n }\n }\n\n inst.props = element.props;\n inst.context = publicContext;\n inst.updater = updater;\n\n var initialState = inst.state;\n if (initialState === undefined) {\n inst.state = initialState = null;\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {\n if (typeof inst.componentWillMount === 'function') {\n {\n if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[_componentName3]) {\n lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\\n\\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);\n didWarnAboutDeprecatedWillMount[_componentName3] = true;\n }\n }\n }\n\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n if (typeof Component.getDerivedStateFromProps !== 'function') {\n inst.componentWillMount();\n }\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n inst.UNSAFE_componentWillMount();\n }\n if (queue.length) {\n var oldQueue = queue;\n var oldReplace = replace;\n queue = null;\n replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;\n if (_partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = _assign({}, nextState, _partialState);\n } else {\n _assign(nextState, _partialState);\n }\n }\n }\n inst.state = nextState;\n }\n } else {\n queue = null;\n }\n }\n child = inst.render();\n\n {\n if (child === undefined && inst.render._isMockFunction) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n child = null;\n }\n }\n validateRenderResult(child, Component);\n\n var childContext = void 0;\n if (typeof inst.getChildContext === 'function') {\n var childContextTypes = Component.childContextTypes;\n if (typeof childContextTypes === 'object') {\n childContext = inst.getChildContext();\n for (var contextKey in childContext) {\n !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;\n }\n } else {\n warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');\n }\n }\n if (childContext) {\n context = _assign({}, context, childContext);\n }\n }", "title": "" }, { "docid": "59a203972282249d22be153d8deb9771", "score": "0.5720714", "text": "componentWillUpdate() {\n\n }", "title": "" }, { "docid": "3a8cf121d260088804770475c4fd6592", "score": "0.57204556", "text": "componentDidUpdate(prevProps, prevState, value){\n console.log(prevProps, prevState, value)\n console.log('Run after update')\n }", "title": "" }, { "docid": "3f60ed3fbce64a51f33ff451ee24ca5e", "score": "0.5715484", "text": "update(){\n this.component.innerHTML = this.label;\n this.mouseover == false ? this.applyStyle(this.componentStyle) : this.applyStyle(this.hoverStyle);\n }", "title": "" }, { "docid": "381da72c4867ad40ab5dc4591c10df84", "score": "0.5711921", "text": "updateLifeCycleState(event, parameters=[], component=App.ComponentName) {\n const newLifeCycle = {\n component,\n event,\n parameters\n };\n\n this.setState({\n lifeCycles: [\n ...this.state.lifeCycles,\n newLifeCycle\n ]\n });\n }", "title": "" }, { "docid": "1e98fa1e32160e2a86f745ce1f91f346", "score": "0.5710784", "text": "constructor()\n {\n super()\n this.state = {\n TempSelectIndex: 1,\n VentSelectIndex: 0,\n TimeSelectIndex: 0,\n Color: \"white\",\n }\n this.updateTempIndex = this.updateTempIndex.bind(this);\n this.updateVentIndex = this.updateVentIndex.bind(this);\n this.updateTimeIndex = this.updateTimeIndex.bind(this);\n this.updateColor = this.updateColor.bind(this);\n }", "title": "" }, { "docid": "e0895e02fb15789c6a9ed66132b6b314", "score": "0.5708368", "text": "updateState(newProps) {\n this.state = { ...this.state, ...newProps };\n return this.state;\n }", "title": "" }, { "docid": "281755e75befe84632d30304d7b041e6", "score": "0.5706714", "text": "update() {\n throw (\"ERROR: N2CellRenderer.update() called.\")\n }", "title": "" }, { "docid": "eaa2036a2cde02b2fde1402c5b3b45a2", "score": "0.57066", "text": "componentWillUpdate(){\n\n }", "title": "" }, { "docid": "1b5e3eb22633d669faeb89637ab64b63", "score": "0.57019544", "text": "update() {\n // ...\n }", "title": "" }, { "docid": "04e6e5ed679a1b260bd990ea5405ff9c", "score": "0.5701952", "text": "constructor(props){ //'constructor' takes in components\n super(props) //This super connects to the parent properties\n this.typing = this.typing.bind(this) //Everything time we make a new method we must use the 'bind'\n this.enter = this.enter.bind(this)\n this.markDone = this.markDone.bind(this)\n this.updatedTodos = this.updatedTodos.bind(this)\n this.state = { //Whatever does get added to state doesn't get remembered...This sets state of component\n newTodo: '', //Refers to the new Todo string\n todos: [], //Refers to the current array status\n } //These are all the things this component knows about itself...These are little variables that the component knows about itself...Metadata\n }", "title": "" }, { "docid": "12d3dceab3255218dd40322f4d8e8870", "score": "0.57003075", "text": "componentWillMount() {\n this.handleUpdate(this.props);\n }", "title": "" }, { "docid": "22eaac4680b523302e8c09e23baa428a", "score": "0.5697336", "text": "constructor(){\n\n super(); // Run the constructor() function of the superclass (parent class: Component)\n\n // state is just an instance variable, always an object:\n // In Vue this was called 'data:'\n this.state = {\n firstNum: 0,\n secondNum: 0\n };\n\n // We need the correct value of 'this' inside the updateFirstNum() event handler,\n // so that we can call 'this.setState()' to update the state to keep track of what\n // was typed into the text field. BUT when you use a function or method as an\n // event handler, it LOSES its original value for 'this' - it becomes 'undefined'\n // and that is core JS behaviour, not React-specific.\n // To force this event handler to remember the correct value of 'this', we have\n // to create a new version of the function using .bind() - the argument you give\n // to bind() becomes the value of 'this' in the new function - here, the current\n // value of 'this' in the constructor function is what we want, so we use 'this'\n // as it is right now - that is the new version of updateFirstNum will see too.\n this.updateFirstNum = this.updateFirstNum.bind( this );\n this.updateSecondNum = this.updateSecondNum.bind( this );\n\n }", "title": "" }, { "docid": "6df10832d60997ffac794da2a48cc2ab", "score": "0.5694827", "text": "function Component(props, context, updater) {\n\t\t\t\t\t\t\t\tthis.props = props;\n\t\t\t\t\t\t\t\tthis.context = context;\n\t\t\t\t\t\t\t\tthis.refs = emptyObject;\n\t\t\t\t\t\t\t\t// We initialize the default updater but the real one gets injected by the\n\t\t\t\t\t\t\t\t// renderer.\n\t\t\t\t\t\t\t\tthis.updater = updater || ReactNoopUpdateQueue;\n\t\t\t\t\t\t\t}", "title": "" } ]
f8bb7c2bc880d0dfbb92cae92af391ff
This function is called when someone finishes with the Login Button. See the onlogin handler attached to it in the sample code below.
[ { "docid": "3afd17b89c2f3aa6540012a19c422b0d", "score": "0.0", "text": "function checkLoginState() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n}", "title": "" } ]
[ { "docid": "c112cafa458999838ab0a4a4f8f8835a", "score": "0.73258066", "text": "function loginComplete() {\n alert(\"you have loged in now\")}", "title": "" }, { "docid": "4785fdddfde8afd2d9b7977ec9abbd85", "score": "0.7165452", "text": "function onSubmit() {\n var loginVal = loginInput.value;\n var passVal = passInput.value;\n\n if (!loginVal) { // An empty login is not allowed\n try {\n new Notification('Empty login', 'error');\n } catch (e) {}\n return;\n }\n\n // To log in\n user.login(loginVal, passVal, function (userObj) {\n if (userObj.checkLogin) {\n changeButtons();\n popupElement.closeElement();\n try {\n new Notification('Login success', 'success');\n } catch (e) {}\n } else {\n try{\n new Notification('Wrong login or password', 'error');\n } catch (e) {}\n }\n });\n }", "title": "" }, { "docid": "70807fffaf03d8cb10e1827088f0b498", "score": "0.71381056", "text": "function onLoginFailed() {\n UIState.unauthenticated();\n alert('Login Failed!');\n }", "title": "" }, { "docid": "d66002c225ae18e6bca2058f618f5fea", "score": "0.70710063", "text": "async handleLogin() {\n\t\tif(await this.getData()){\n\t\t\tthis.props.onDisplayChange(InteractiveMap);\n\t\t}\n\t\telse{\n\t\t\talert(\"Fel Användarnamn eller Lösenord!\");\n\t\t}\n\t}", "title": "" }, { "docid": "29af3265c2522c5555c6744c4d3b304e", "score": "0.69941276", "text": "function loginEvents() {\n\t$('#online-button-login').click(function() {\n\t\tAccountView.showLoginScreen();\n\t});\n\n\t$(\"#close-login-modal\").on('click', function() {\n\t\tclearInterval(intervalGoogleAccount);\n\t\t$(\"#webviewLoginDiv\").html('');\n\n\t\t//$(\"#refresh-login\").click();\n\t\tloginEvents();\n\t});\n}", "title": "" }, { "docid": "682a38ba4e725e2dad191aa9df5d543d", "score": "0.6986726", "text": "handleFirstAccessOver() {\n this.loginCompleted = true;\n }", "title": "" }, { "docid": "34d586d0666332c7033b8b2c0d79a605", "score": "0.6975583", "text": "loginHandler(){\n\n }", "title": "" }, { "docid": "a2bc595d03675387a0f26420aec28875", "score": "0.69743294", "text": "function loginFinishedCallback(authResult) {\n\tif (authResult) {\n\t\tif (authResult['error'] == undefined) {\n\t\t\ttoggleElement('signin-button');\n\t\t\t// Hide the sign-in button after\n\t\t\t// successfully signing in the user.\n\t\t\tgapi.client.setApiKey(apiKey);\n\t\t\tgapi.client.load('plus', 'v1', loadProfile);\n\t\t\t// Trigger request\n\t\t\t// to get the email\n\t\t\t// address.\n\t\t\tgetinfo();\n\t\t} else {\n\t\t\tconsole.log('An error occurred');\n\t\t}\n\t} else {\n\t\tconsole.log('Empty authResult');\n\t\t// Something went wrong\n\t}\n}", "title": "" }, { "docid": "7dd28102739efc558aa151babfc724bc", "score": "0.6972727", "text": "function loginEventHandler() {\n\t$('#login_dive').delegate('#loginbtn', 'click', function() { \n\t\t//alert(\"About to login\");\n\t\tloginUser();\n\t});\n}", "title": "" }, { "docid": "4e66f597b29982c024e537738b2cb875", "score": "0.69679296", "text": "function onLoginFailed() {\n\tUIState.unauthenticated();\n\talert('Login Failed!');\n}", "title": "" }, { "docid": "41c6f6770156d1485459a81522b29079", "score": "0.69514257", "text": "function handleLogin() {\r\n removeModal();\r\n document.querySelector('.modal-accept-button').addEventListener('click', login);\r\n button.removeEventListener('click', null);\r\n}", "title": "" }, { "docid": "ff2461a9f80126c756c59f7660bac8a6", "score": "0.6884748", "text": "function closeLogin() {\n\t\t\t//just in case I forgot to remove the mask somewhere else\n\t\t\tappHelper.toggleMask(false);\n\t\t\tcleanup();\n\t\t\tloginView.hide();\n\t\t\t//make sure never to store password\n\t\t\tpasswordfield.setValue('');\n\t\t\tif(appHelper.isFunction(callback)) {\n\t\t\t\tif(me.isLoggedIn()) {\n\t\t\t\t\tcallback(true, me.getAccount());\n\t\t\t\t} else {\n\t\t\t\t\tcallback(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e98769bbaf030ded08722844ece7e50c", "score": "0.6857816", "text": "function onLogin ()\n {\n window.location.reload();\n }", "title": "" }, { "docid": "9285b3db3391756f6e66cf43509913eb", "score": "0.6843491", "text": "handleLogin() {\n\t\tvar loginRequest = this.getLoginRequest();\n\t\tthis.client.sendRequest(Const.EzyCommand.LOGIN, loginRequest);\n }", "title": "" }, { "docid": "d00ea7865dd009fcd03faa5b844858a3", "score": "0.68370575", "text": "function doLoginBtnClicked() {\n\n blurTextFields();\n\n Parse.User.logIn($.email.value, $.password.value, {\n success : function(user) {\n // Do stuff after successful login.\n console.log(JSON.stringify(user));\n\n args.loginSuccess(user);\n },\n error : function(user, error) {\n // The login failed. Check error to see why.\n console.log(JSON.stringify(error));\n alert(error.message);\n }\n });\n}", "title": "" }, { "docid": "5e5062a0ce4be42d3f2a4bbf70fc659c", "score": "0.6826177", "text": "function postLogIn() {\n console.log(\"in postLogIn\");\n $('#login').hide();\n $('#logout').show();\n $('#logged-out').hide();\n console.log(\"in postLogIn\");\n initApp();\n }", "title": "" }, { "docid": "b0fc204cd39821b1a7d9768151d6106e", "score": "0.68067867", "text": "async continueafterauth() {\n\t\tif(this._tool.twitchapi.isLoggedIn()) {\n\t\t\tthis.logindialog.style.display = 'none'\n\n\t\t\tlet usr = null\n\t\t\ttry {\n\t\t\t\tusr = await this._tool.twitchapi.getUser()\n\t\t\t} catch(e) {\n\t\t\t\tthis._tool.ui.showErrorMessage(e)\n\t\t\t}\n\t\t\tif(usr != null && usr.hasOwnProperty('_id')) {\n\t\t\t\tthis._username = usr.name\n\t\t\t\tthis._userid = usr._id\n\t\t\t\t/**\n\t\t\t\t * Fires when user is sucessfully is logged in\n\t\t\t\t * \n\t\t\t\t * @event TTVLogin#complete\n\t\t\t\t */\n\t\t\t\tthis.emit('complete')\n\t\t\t}\n\t\t} else {\n\t\t\tthis.logindialog.style.display = 'table'\n\t\t}\n\t}", "title": "" }, { "docid": "75b2b78f39a606cd592cc212a4245c25", "score": "0.67424375", "text": "function onLoginSuccess() {\n KandyAPI.Phone.updatePresence(0);\n UIState.authenticated();\n }", "title": "" }, { "docid": "bf3f8d0b638fd45484a4e407ac9eea19", "score": "0.67419994", "text": "function handleLogin() {\n // If the user is logging in for the first time...\n if (okta.token.hasTokensInUrl()) {\n okta.token.parseTokensFromUrl(\n function success(res) {\n // Save the tokens for later use, e.g. if the page gets refreshed:\n okta.tokenManager.add(\"accessToken\", res[0]);\n okta.tokenManager.add(\"idToken\", res[1]);\n\n // Redirect to this user's dedicated room URL.\n window.location = getRoomURL();\n }, function error(err) {\n alert(\"We weren't able to log you in, something horrible must have happened. Please refresh the page.\");\n }\n );\n } else {\n okta.session.get(function(res) {\n\n // If the user is logged in, display the app.\n if (res.status === \"ACTIVE\") {\n\n // If the user is logged in on the home page, redirect to their room page.\n if (!hasQueryString()) {\n window.location = getRoomURL();\n }\n\n return enableVideo();\n }\n\n // If we get here, the user is not logged in.\n\n // If there's a querystring in the URL, it means this person is in a\n // \"room\" so we should display our passive login notice. Otherwise,\n // we'll prompt them for login immediately.\n if (hasQueryString()) {\n document.getElementById(\"login\").style.display = \"block\";\n enableVideo();\n } else {\n showLogin();\n }\n });\n }\n}", "title": "" }, { "docid": "7c7531c6d0d2eebfe029c44fe7b51379", "score": "0.67033845", "text": "function onLogin(session) {\n document.getElementById(\"logintext\").innerText = \"Sign Out\";\n document.getElementById(\"mySign\").className = \"signout\";\n if (!session.error) {\n WL.api({\n path: \"me\",\n method: \"GET\"\n });\n WL.api({ path: \"/me/albums/\", method: \"GET\" }).then(\n getDirectory,\n function (response) {\n console.log(\"Could not access albums, status = \" +\n JSON.stringify(response.error).replace(/,/g, \",\\n\"));\n });\n }\n else {\n console.log(\"Error signing in: \" + session.error_description);\n }\n //Sets the chekNewPhotos every 30 seconds\n setInterval(checkNewPhotos, 30000);\n }", "title": "" }, { "docid": "b634ceeb9609e3cf04bf1765c1cc5087", "score": "0.66651815", "text": "async function onLogin(){\n setLoading(true);\n try{\n await login({email, password});\n navigation.navigate('Home');\n } \n catch (err){\n console.error(err);\n }\n finally{\n setLoading(false);\n }\n }", "title": "" }, { "docid": "f4823c65ff34ebfa0f8286ba54a5c150", "score": "0.6633728", "text": "function onLogin(event) {\n\tconsole.log(\"Logged in!\\n'\");\n\tdocument.getElementById('mainView').style.display = 'none';\n\tdocument.getElementById('roleView').style.display = 'inline';\n\twindow.scrollTo(1, 0);\n}", "title": "" }, { "docid": "235c6899abf334586130c31aab3437df", "score": "0.6633011", "text": "function onLoginSuccess() {\n\tKandyAPI.Phone.updatePresence(0);\n\tUIState.authenticated();\n\t// loadContacts();\n\n\t// Checks every 5 seconds for incoming messages\n\tsetInterval(receiveMessages, 1000);\n\n}", "title": "" }, { "docid": "04da2fa0ed3462b72fab0222ea14007c", "score": "0.662675", "text": "function loginControlHandler() {\n var state;\n\n state = $(\"#loginControl\").text();\n\n if (state == \"Log In\") {\n loadLoginForm();\n }\n else\n {\n logout();\n // reset the frame content on logout\n $(\"#frameContainer\").attr('src', \"\");\n\n var parameter = \"currentUser = \" + \"\";\n // Create a cookie for the current org\n document.cookie = parameter;\n\n\n }\n}", "title": "" }, { "docid": "5ee110b56039d83388727c0a018c6931", "score": "0.6614712", "text": "function org_shaolin_bmdp_adminconsole_page_Login_Login(eventsource,event) {/* Gen_First:org_shaolin_bmdp_adminconsole_page_Login_Login */\n\n var UIEntity = this;\n\n this.Submit_OutFunctionName(eventsource);\n }", "title": "" }, { "docid": "b6fa875015fe48d413d50ba41e69f68e", "score": "0.6614145", "text": "function LoginCallBack(name,requiredLogin){\n }", "title": "" }, { "docid": "c269273dd1a214cdb8f90186dd4cbbf6", "score": "0.6599179", "text": "function handleLogin() {\n\t\t$(\"#login\").removeAttr(\"modalname\").removeClass(\"close-reveal-modal\").off();\n\t\t$(\"#login\").on('click', function() {\n\t\t\t$(\".toolbardialog\").foundation('reveal', 'close');\n\t\t\t$('.logindropdown').slideToggle();\n\t\t});\n\t}", "title": "" }, { "docid": "e82b2e87bf6187ca900245f379ceb48f", "score": "0.6574147", "text": "loginPress() {\n\t\tvar tab = this.selectedTab\n\t\tif (tab === \"login\") {\n\t\t\tthis.serverLogin()\n\t\t} else {\n\t\t\tthis.signup()\n\t\t}\n\n\t}", "title": "" }, { "docid": "9129a4d99e1bd42f749afa0c8368e96a", "score": "0.6561458", "text": "function onLoginSuccessful() {\n\t\t\t// Now, save the token in a cookie\n\t\t\tCookies.set(\"ua_session_token\", UserApp.global.token);\n\t\t\t\n\t\t\t// Redirect the user to the index page\n\t\t\twindow.location.href = \"index.html\";\n\t\t\tshowLoader(false);\n\t\t}", "title": "" }, { "docid": "2785678655edf97d95f8109caf342e66", "score": "0.65555006", "text": "function onLoginSuccess() {\n $('#flash_message').html(\n \"<div class='alert alert-success' role='alert'>\"+\n \"Login successfully\" +\n \"</div>\"\n );\n $('#login').removeClass(\"disabled\")\n $('#username').hide();\n $('#password').hide();\n $('#login').val('Logout');\n isLoggedIn = true;\n}", "title": "" }, { "docid": "8d0778f712e015f7cb6268ecc0348a84", "score": "0.6551217", "text": "function handleLoginButton() {\n $('.login').on('click', function(event) {\n event.preventDefault();\n displayLoginPage();\n });\n}", "title": "" }, { "docid": "7786bc5abada3b7b5f98015bfa20aee6", "score": "0.65380675", "text": "function doLogin() {\r\n Auth.authenticate( vm.oLoginData ).then( function () {\r\n $state.go( 'messageList' );\r\n }, function ( err ) {\r\n //PubSub.publish( 'notifications', {\r\n // msg: err.errorDescription || 'An error occurred, please try again',\r\n // type: 'danger',\r\n // detail: null,\r\n // err: err\r\n //});\r\n $state.go( 'login' );\r\n });\r\n }", "title": "" }, { "docid": "f6d2a47d98700287204bbe3736e855a1", "score": "0.6526468", "text": "onLoginResponse(login) {\n if (login.success) {\n this.player = this.spawnPlayer(login.id, login.x, login.y, login.angle);\n this.game.camera.follow(this.player, Phaser.Camera.FOLLOW_LOCKON, 0.1, 0.1);\n\n this.toggleStars();\n }\n }", "title": "" }, { "docid": "d2105f20c16a31150611f98badf9d656", "score": "0.6519259", "text": "function finishLogin() {\r\n //new one;\r\n userNameString = \"<nobr>Signed in as <strong>\" + userName +\r\n \"</strong>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='about.html' target='_blank'>About</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='docs/index_docs.html' target='_blank'>Docs</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a id='logOutA' href='#' onclick='javascript:wso2.wsf.Util.logout(wso2.wsf.Util.logout[\\\"callback\\\"]); return false;'>Sign Out</a></nobr>\";\r\n document.getElementById(\"meta\").innerHTML = userNameString;\r\n document.getElementById(\"navigation_general\").style.display = \"none\";\r\n document.getElementById(\"navigation_logged_in\").style.display = \"inline\";\r\n document.getElementById(\"content\").style.display = \"inline\";\r\n showHomeMenu();\r\n}", "title": "" }, { "docid": "d983acb33c6e0b877efbcc85094cbd87", "score": "0.65161103", "text": "function onLoginDialogDismiss(reason) {\n\t loginDialog = null;\n\t queue.cancelAll();\n\t redirect();\n\t }", "title": "" }, { "docid": "752d8e52a04a3c23409cfd494f0de889", "score": "0.6509015", "text": "onPressLogin() {\n }", "title": "" }, { "docid": "829da96c96d32a68f64a6cd6e263e390", "score": "0.6504956", "text": "function handleLoginButton() {\n $('.login').on('click', function (event) {\n console.log('Login Clicked');\n event.preventDefault();\n displayLoginPage();\n });\n}", "title": "" }, { "docid": "1b92fbf661a4895f0b632f2ac64be0ad", "score": "0.64973867", "text": "async onLogin() {\n\n storeApp.dispatch({\n type: 'LOGIN',\n payload: { isLogin:true}\n });\n\n showMessage({\n message: \"Berhasil Login\",\n type: 'success',\n icon: 'success',\n });\n }", "title": "" }, { "docid": "15528b4b33cbd0a61e6196d816f084f9", "score": "0.64922535", "text": "async function handleLogin() {\n setLoading(true);\n\n if (isLocalUser()) {\n setAuthenticated(true);\n } else {\n if (!isAuthenticated) {\n try {\n let response = await API.post(\"1xion\", \"/auth/nonce\", {\n body: {\n id: address\n }\n });\n\n let nonce = response.nonce.toString();\n let signed = await signNonce(nonce);\n\n let res = await API.post(\"1xion\", \"/auth/login\", {\n body: {\n address: address,\n signature: signed,\n }\n });\n\n if (res.auth === true) {\n setLocalUser(res.token);\n setAuthenticated(true);\n }\n } catch (e) {\n console.error(e);\n }\n }\n }\n\n setNetwork((await provider.getNetwork(await signer.getChainId())).name);\n setBalance(ethers.utils.formatEther(await signer.getBalance()));\n setEns(await provider.lookupAddress(address));\n\n history.push(\"/private\");\n\n setLoading(false);\n }", "title": "" }, { "docid": "0da41814bd69177b95f5c46dbd2a99eb", "score": "0.6466786", "text": "function check_Login(e) {\n Ti.API.info(\"inside check_Login\");\n // ############# function call of HTTP post req for API #################\n // require('loader').loading($.indexwin);\n require('loder').addloder($.indexwin);\n GoToLoginAPI();\n}", "title": "" }, { "docid": "d21c650d3c7b6b2a12d9afb07d98843a", "score": "0.6461003", "text": "function onLogin(user) {\n customLog('Authentication called. User data: ' + JSON.stringify(user));\n setUser(user);\n}", "title": "" }, { "docid": "f8842d5f3b4996461368f5573b1eb1fe", "score": "0.6446101", "text": "function endLoginProcedure() {\n loginPage.browser.call(\"showMessage\", \"Connexion réussie, veuillez patienter...\");\n API.sleep(3000);\n loginPage.destroy();\n loginPage = null;\n toggleHUD(true);\n}", "title": "" }, { "docid": "6137f7b265cc2a794cfeed123b662bb3", "score": "0.6444149", "text": "function exitClickHandler() {\n var exitPage = window.localStorage.getItem( \"debugExitPage\" );\n debug && console.log( \"Debug.exitClickHandler: Exiting debug page\" );\n if ( exitPage ) {\n window.localStorage.removeItem( \"debugExitPage\" );\n UIFrame.navigateToPage( exitPage, true, null );\n } else {\n UIFrame.loadUrl( \"login.html\" );\n }\n }", "title": "" }, { "docid": "50f633887c2923f829a88a557546678f", "score": "0.64439696", "text": "function login() {\n User.login(self.user, handleLogin);\n }", "title": "" }, { "docid": "248c3142feef0c2051c9a2beb546246e", "score": "0.6437234", "text": "function handleLoginButton(){\n\n $('.js-login').submit(function(e){\n e.preventDefault();\n closeModal()\n let username = $(this).find('#login-username').val();\n let password = $(this).find('#user-password').val();\n CURRENT_SESSION.username = username;\n handleLogin(username, password);\n $(this).find('#login-username').val('');\n $(this).find('#user-password').val('');\n });\n}", "title": "" }, { "docid": "8074e3db589a497a0e19c832a0be5ff4", "score": "0.64307606", "text": "function handleLogin(data) {\n\ttoken = data.authToken;\n\tuserId = data.user.id;\n\tadmin = data.user.admin;\n\t$('.js-search-all-users').hide();\n\tif (admin) {\n\t\t$('.js-search-all-users').show();\n\t}\n\t$('#js-form').hide();\n\t$('.js-back').hide();\n\t$('.js-button-list').show();\n}", "title": "" }, { "docid": "5f2dfdfe48b2ce3ed909c770d6803ff4", "score": "0.6417702", "text": "function at_login() {\r\n\tat_loggedout();\r\n}", "title": "" }, { "docid": "4b1514c328f5c88ffe3f1253796b1859", "score": "0.6392749", "text": "function onLoginButtonClicked() {\n\tvar user = $(\"#login_user\").val();\n\tvar password = $(\"#login_password\").val();\n\t$.jCryption.encrypt(user, keys, function(encrypted) {\n\t\tencryptedUser = encrypted;\n\t\t$.jCryption.encrypt(password, keys, function(encryptedPasswd) {\n\t\t\tencryptedPassword = encryptedPasswd;\n\t\t\t/**\n\t\t\t * As both userName and password are encrypted now Submit login\n\t\t\t */\n\t\t\tsubmitLoginRequest();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "20f1f8d14c14d62ec446c706cbbc1d48", "score": "0.63923657", "text": "function afterlogin() {\n if (localStorage.getItem('userPanel') == 'open') {\n console.log('Update user panel.')\n document.getElementById(\"userinfo\").style.display = \"initial\";\n document.getElementById(\"userimg\").src = localStorage.getItem('userPic');\n document.getElementById(\"username\").innerHTML = localStorage.getItem('userName');\n localStorage.setItem('signed', 'true');\n }\n}", "title": "" }, { "docid": "0ecc2d11cdf64eba8918bcf105fdec23", "score": "0.63905114", "text": "function mainLogin(event) {\n console.log(event);\n event.preventDefault(event);\n console.log(\"mainLogin(event) is running\");\n\n let $elUserEmail = $(\"#inLoginEmail\"),\n $elUserLoginPw = $(\"#inUserPwLogin\"),\n $tmpValUserLoginEmail = $elUserEmail.val().toUpperCase(),\n $tmpValUserLoginPW = $elUserLoginPw.val();\n\n // Check to see if user has signed up\n if (localStorage.getItem('dataKey') == null) {\n window.alert(\"Please Sign Up\");\n\n } else {\n let retrievedData = localStorage.getItem('dataKey');\n let normalizedData = JSON.parse(retrievedData);\n\n if ($tmpValUserLoginEmail === normalizedData['uEmail'] & ($tmpValUserLoginPW === normalizedData['uPassword'])) {\n console.log(\"you should be at the home screen\")\n $(\":mobile-pagecontainer\").pagecontainer(\"change\", \"#pgHome\");\n } else {\n window.alert('Login is incorrect');\n }\n }\n }", "title": "" }, { "docid": "c8fed06a7fcd9c4b25ed184d5d08524e", "score": "0.6388094", "text": "function onLinkedInLogin() {\n linkedinConnectedResponse();\n}", "title": "" }, { "docid": "f879142452ce57b7d2f40d11a46a8c47", "score": "0.63867414", "text": "function checkLoginState() { // Called when a person is finished with the Login Button.\n FB.login(function(response) {\n statusChangeCallback(response);\n });\n}", "title": "" }, { "docid": "e39aeff6a0fba98beea64f1b4f150237", "score": "0.638548", "text": "onLogin(){\n\t\tthis.props.onLogin(this.props.account.id,this.props.account.service);\n\t}", "title": "" }, { "docid": "372ec9df512945fbadd4a86138cad177", "score": "0.6369377", "text": "onShowLoginPage(handler) {\n return this.on(OWebApp.EVT_SHOW_LOGIN, handler);\n }", "title": "" }, { "docid": "54f1155564f29fa7401118050810a369", "score": "0.6362291", "text": "function loginCallBack(response){\n hide_element ('forms_login');\n token = response['data'];\n getStores(token);\n}", "title": "" }, { "docid": "ffd040475161a7642d8256c06ff24e35", "score": "0.6361108", "text": "onLoginButtonClick(){\n\n const login = this[userLoginElement].value;\n const password = this[userPasswordElement].value;\n const hideLoader = this.hideLoader;\n\n if(this.hasError){\n\n this.clearErrors();\n }\n\n this.disableButtons();\n\n Ajax.post('/login_form_validate', {login, password}, this.showLoader).then(function(data){\n\n if(!data.loginSuccessful){\n\n this.showError(data.errorMessage);\n }else{\n\n window.location = `/dashboard?user=${login}`;\n }\n\n hideLoader();\n this.enableButtons();\n }.bind(this));\n }", "title": "" }, { "docid": "0449cda5e90c7eeb482378b5b65f1d63", "score": "0.63585544", "text": "function handleOnLoginPress() {\n AuthorizationStorage.destroy();\n Router.push('initial');\n}", "title": "" }, { "docid": "e43b13b5db88990dd02e89d4f5c65ad5", "score": "0.63519496", "text": "function onLoginResponse() {\n var jsonResponse = JSON.parse(this.response);\n // if successful or guest already logged in redirect to the guest main page\n // otherwise display the response on the guest login page.\n if (jsonResponse.Success) {\n window.location.href = `${urlHostMain}?name=${edtHostName.value}`;\n } else {\n txtHostOutput.innerHTML = jsonResponse.Message;\n }\n}", "title": "" }, { "docid": "3fce8b17fd53d79a1c9a9fd3cda66b34", "score": "0.633939", "text": "function authentication_complete() {\n let container = document.querySelector(\"#session_container\");\n let children = container.querySelectorAll(\"input\");\n let i = 0;\n let key = \"\";\n for(i = 0; i < children.length; i++){\n let child = children[i];\n if(child.checked){\n key = child.value;\n break;\n }\n }\n\n if(lightdm.is_authenticated){\n if(key === \"\"){\n lightdm.login(lightdm.authentication_user, lightdm.default_session);\n }else{\n lightdm.login(lightdm.authentication_user, key);\n }\n }else{\n show_error(\"Authentication Failed\");\n start_authentication(selected_user);\n }\n}", "title": "" }, { "docid": "4772be9db5b0d4d9db1728c3d61663d7", "score": "0.6331992", "text": "onLoggedIn(callback) {\n this.callback = callback;\n }", "title": "" }, { "docid": "92e42f68df7041e0b9d4215b0501401a", "score": "0.6325768", "text": "function loginBtn() {\n $(\"#btnLogin\").on('click', function() {\n login();\n });\n}", "title": "" }, { "docid": "cc3dad5f9215296c5807e98e4dc10060", "score": "0.6309708", "text": "function addLoginEventListener() {\n loginBtn.addEventListener(\"click\", loginUser);\n}", "title": "" }, { "docid": "d929b37a4c08d4704b6a22d9d6ab7e68", "score": "0.6309142", "text": "function monitorLogin() {\n if (token === null ) {\n login.style.display = 'block';\n titleForm.style.display = 'none';\n\n login.addEventListener( 'submit', ( event ) => {\n event.preventDefault();\n let username = document.querySelector('#user_login').value;\n let password = document.querySelector('#user_pass').value;\n console.info(`Username: ${username} Password: ${password}`);\n \n getToken( username, password );\n });\n\n } else {\n logout.style.display = 'block';\n toggleEditForm();\n }\n}", "title": "" }, { "docid": "096e9af363d57911e75b70e830704310", "score": "0.6304839", "text": "function LoginFunc() {\n clearInterval(timerId);\n loginTemplate.innerHTML = login;\n loginId = document.getElementById(\"loginbtn\");\n loginId.addEventListener(\"click\", logToAnimationpage);\n history.pushState({ page: login }, null, \"?login\")\n window.addEventListener(\"popstate\", function (e) {\n if (e.state.page === login) {\n LoginFunc()\n }\n })\n }", "title": "" }, { "docid": "c5b282156c6f33bd6fd0dd99c823a35f", "score": "0.6298957", "text": "function appLoginHandler() {\n\t// login form variable element\n\tvar loginForm = $(\"form.app-login-form\");\n\t// login popup box\n\tvar loginPopupBox = $(\"div#app-login-popup\");\n\t// login button and close button\n\tvar signButton = $(\"button.app-sign-btn\");\n\tvar closeButton = $(\"button.app-close-btn\");\n\n\t// show login popup when sign button clicked\n\tsignButton.click(function() {\n\t\tloginPopupBox.fadeIn(300);\n\t});\n\t// close login popup\n\tcloseButton.click(function() {\n\t\tloginPopupBox.fadeOut(300);\n\t\tloginForm[0].reset();\n\t\t$(\"div.app-login-alert\").hide();\n\t});\n\n\t// login form for prevent default\n\tloginForm.submit(function(e) {\n\t\te.preventDefault();\n\t\t// username and password value\n\t\tvar usernameValue = $(\"input.app-username\").val();\n\t\tvar passwordValue = $(\"input.app-password\").val();\n\n\t\t// submit while value not null\n\t\tif (usernameValue && passwordValue) {\n\t\t// these values will send to server (login controller) using AJAX method\n\t\t\t$.ajax({\n\t\t\t\turl: \"/login\",\t// send data to login handler on server\n\t\t\t\tasync: true,\n\t\t\t\tdata: {\n\t\t\t\t\tusername: usernameValue,\n\t\t\t\t\tpassword: passwordValue\n\t\t\t\t},\n\t\t\t\tsuccess: function(jsonLoginDataAuth) {\n\t\t\t\t\t// jsonLoginDataAuth --> JSON data that sended from login handler AppLogin\n\t\t\t\t\tif (jsonLoginDataAuth.Message) {\n\t\t\t\t\t\twindow.location = jsonLoginDataAuth.Redirect_Url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(\"div.app-login-alert\").html(\"<b>Incorrect username or password!</b><br><br>\");\n\t\t\t\t\t\t$(\"div.app-login-alert\").hide();\n\t\t\t\t\t\t$(\"div.app-login-alert\").fadeIn(\"300\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tloginForm[0].reset(); // reset (clearing) the login form after submit\n\t\t}\n\t});\n}", "title": "" }, { "docid": "154810b69db4cf9334b91ca080eb5dcc", "score": "0.6297444", "text": "handleLogin() {\n notification.success({\n message: 'LMS App',\n description: \"You're successfully logged in.\",\n });\n this.loadCurrentUser();\n this.props.history.push(\"/\");\n }", "title": "" }, { "docid": "a23353fd060f992e80eba7949060c18a", "score": "0.6293167", "text": "function loginexists() {\n meow = firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n LoginPress()\n }\n })\n }", "title": "" }, { "docid": "410a1777cdc05c9073f260a5c8b3146f", "score": "0.62906575", "text": "function login()\n {\n FB.login(function(response)\n {\n if (response.authResponse)\n {\n loggedIn = true;\n switchButton();\n \n calcTime();\n showTime();\n }\n else\n console.log(\"User canceled login or error occurred\");\n \n }, {scope:\"read_stream\"});\n }", "title": "" }, { "docid": "7af99514389d907ba21d7f7b07b12fb3", "score": "0.6289477", "text": "function aLoginHandler() {\n\n //Muestro la pantalla de login\n mostrarPantalla('Login');\n\n document.getElementById('aLogin').style.display = 'none';\n\n document.getElementById('aInicio').style.display = 'block';\n document.getElementById('aRegistrarse').style.display = 'block';\n document.getElementById('msgLogin').innerText = '';\n\n}", "title": "" }, { "docid": "4822635280fbd57adc1782b64691b9d6", "score": "0.62848043", "text": "function login() {\n //om.login is an openMinds_connect.js function\n console.log(\"in login\");\n om.logIn({\n\tappId: APP_ID,\n\tredirectUri: REDIRECT_URI,\n\tcallback: function(accessToken) {\n\t if (accessToken) {\n\t\tconsole.log(\"calling postLogIn\");\n\t\tpostLogIn();\n\t }\n\t}\n });\n\n}", "title": "" }, { "docid": "11a530590d3f817fe03e903b65e2b6f2", "score": "0.6283996", "text": "function login_callback(xmlhttp) {\n\t // No running server detection\n\t if ((xmlhttp.status==503)) {\n\t\t alertify.alert(\"Application server unavailable\", function(){});\n\t }\n\n\t if ((xmlhttp.readyState==4) && (xmlhttp.status != 0)) {\n\t\t var response_data = JSON.parse(xmlhttp.responseText);\n\n\t\t // Login application was successful\n\t\t if(xmlhttp.status==200) {\n var username = document.getElementById(\"username\").value;\n\t\t\t localStorage.setItem(\"username\", username);\n\t\t\t localStorage.setItem(\"token\", response_data['token']);\n localStorage.setItem(\"templogin\", response_data[\"templogin\"]);\n\t\t\t username = '';\n\t\t\t password = '';\n document.body.className = 'vbox viewport';\n\t\t\t window.location.assign(localStorage.getItem(\"interface\"));\n\t\t } else { // Something unexpected happened\n\t\t\t alertify.alert(\"LOGIN ERROR: \" + response_data[\"message\"] + \"\\n(Status: \" + xmlhttp.status + \")\", function(){});\n document.body.className = 'vbox viewport';\n\t\t }\n\t }\n\n if ((xmlhttp.readyState==4) && (xmlhttp.status == 0)) {\n alertify.alert(\"LOGIN Network Error. Please check your connection and try again later!\", function(){});\n document.body.className = 'vbox viewport';\n }\n }", "title": "" }, { "docid": "28e1bad975702535263ab767fcd6903f", "score": "0.62810475", "text": "function handleAuthentication() {\n var signInButton = document.getElementById(\"signIn\");\n var signOutButton = document.getElementById(\"signOut\");\n\n _IdentityManager.default.registerOAuthInfos([new _OAuthInfo.default({\n appId: \"Nrt2ESvH1cqQzSYa\"\n })]);\n\n signInButton.addEventListener(\"click\", function () {\n getCredentials();\n });\n signOutButton.addEventListener(\"click\", function () {\n destroyCredentials();\n });\n }", "title": "" }, { "docid": "c00c996341d7cfce620909c3e790c8f8", "score": "0.6275169", "text": "function onMenuLogin() {\n // confusing: sets the nav to \"Home\" but the content to \"gelemContentLogin\"\n changeMenuAndContentArea(\"nav--home\", gelemContentLogin);\n}", "title": "" }, { "docid": "27c0a3fee1af7cc35c14766dab3236ee", "score": "0.62716526", "text": "_handleAuthenticationLoginRequired()\n {\n Radio.channel('rodan').request(Events.REQUEST__MAINREGION_SHOW_VIEW, {view: new ViewLogin()});\n }", "title": "" }, { "docid": "f293ff516e47613f66c7cecacf617a37", "score": "0.62603503", "text": "function goLogin()\n\t{\n\t\t// Save new current user\n\t\tclass_user.saveCurrentUser(login.currentUser.id);\n\n\t\t// Save login user\n\t\tclass_user.setLoginUser(login.currentUser.id);\n\n\t\t// Show desktop\n\t\tdesktop.init();\n\t}", "title": "" }, { "docid": "f6fa9ddabd890b1050815c871415b8da", "score": "0.62533844", "text": "function onSignin() {\n\tsignin(email, password)\n\t\t.then(res => console.log('res: ', res))\n\t\t.catch(err => console.log('err: ', err.message))\n}", "title": "" }, { "docid": "4dea63429e804d997dfbb667eca9ef84", "score": "0.6251705", "text": "function logoutBtn() {\n $(\"#btnLogout\").on('click', function() {\n login();\n });\n}", "title": "" }, { "docid": "01daf988a37c302b75b2d42bb813dfab", "score": "0.6245326", "text": "function login_on() {\n return {\n type: ACTIONS.LOGIN\n };\n}", "title": "" }, { "docid": "9765ea4ee33c54c8843da27b03ed4577", "score": "0.6237651", "text": "handleLoginSuccess(responseData) {\n }", "title": "" }, { "docid": "7c30a4d6dff9dec8ead6276164180354", "score": "0.62336594", "text": "loginSuccess(details) {\n\t\tthis.props.onLoginSuccess(details);\n\t}", "title": "" }, { "docid": "deb6b513fc7041e42b098cac87b2e9f4", "score": "0.62328243", "text": "function onSuccess(data) {\n logoutButton.removeClass(\"hidden\");\n localStorage.setItem(\"accessToken\", data.accessToken);\n localStorage.setItem(\"user\", user);\n loginModal.trigger(\"accessToken\", [data.accessToken, user]);\n loginModal.modal(\"hide\")\n }", "title": "" }, { "docid": "33333a7106fb4c162329c7f897126ed2", "score": "0.6204456", "text": "function doAppLogin(event) {\n logger.info('doAppLogin - app:login fired');\n Alloy.Globals.resetCookies();\n allowAppSleep(true);\n if ($.appIndex) {\n // moving from appIndex back to index\n switchToIndex().always(function() {\n presentLogin(event);\n });\n } else {\n // during first time startup\n presentLogin(event);\n }\n}", "title": "" }, { "docid": "c06f2f9ef10bbcd259c847574dee4534", "score": "0.6204039", "text": "function doLogin() {\n Ext.getCmp('loginForm').on({\n beforeaction: function() {\n // mask the form, before submitting\n if (Ext.getCmp('loginForm').getForm().isValid()) {\n Ext.getCmp('loginPanel').body.mask();\n Ext.getCmp('statusBar').showBusy('Authenticating ...');\n }\n }\n });\n Ext.getCmp('loginForm').getForm().submit({\n success: function() {\n // redirect to index if login was successful\n Ext.getCmp('loginPanel').getEl().fadeOut({callback: function() {\n window.location = BASE_URL;\n }});\n },\n failure: function(form, action) {\n // if login fails, unmask the form an show an error\n Ext.getCmp('loginPanel').body.unmask();\n Ext.getCmp('statusBar').clearStatus();\n if (action.failureType == 'server') {\n Ext.getCmp('statusBar').setStatus({\n text: 'Invalid username or password!',\n iconCls: 'x-status-error'\n });\n } \n }\n });\n }", "title": "" }, { "docid": "96908561a395d2d3fd6fc8781e0a08bb", "score": "0.6199843", "text": "function handleLoginWithThen(e) {\n e.preventDefault();\n\n login(username, password).then((data) => {\n afterAuth(data);\n });\n }", "title": "" }, { "docid": "52dbd6a1e661de7839f8895f0623c937", "score": "0.6196934", "text": "handleLoginClick(e) {\n\t\tthis.handleLoginSend(e).then((data) => {\n\t\t\tif(data == \"success\"){\n\t\t\t\tthis.setState({\n\t\t\t\t\tincorrectLogin: false //do not show incorrect login message\n\t\t\t\t});\n\t\t\t\tsessionStorage.setItem('loggedIn', this.state.username); //set session variable confirming login\n\t\t\t\twindow.location.href = \"/\";\n\t\t\t}else if(data == \"failure\"){\n\t\t\t\tthis.setState({\n\t\t\t\t\tincorrectLogin: true //show incorrect login message\n\t\t\t\t});\n\t\t\t}\n \t});\n\t}", "title": "" }, { "docid": "3b7f5ae6ab077a5ecd8cc904dfd91b5a", "score": "0.6193652", "text": "function afterLoginEvents(profile, courses) {\n\t$(\"#loading-message\").hide();\n\tvar loginWebviewObject = document.getElementById(\"login-google-services\");\n\tloginWebviewObject.terminate();\n\n\tvar profile = getUserProfile();\n\tvar courses = getCourses();\n\t\n\t/* \n\t * If the user is not administrator then\n\t * don't request for the counter.\n\t */\n\tif (isAdministrator) {\n\t\tvar keys = [\"managers\"];\n\n\t\tchrome.storage.local.get(keys, function(result){\n\t\t\tvar managers = result[\"managers\"];\n\t\t\tvar email = profile.emails[0].value;\n\t\t\t\n\t\t\tif (!managers) {\n\t\t\t\tmanagers = \"\";\n\t\t\t}\n\n\t\t\tmanagers += email + \";\"\n\t\t\tchrome.storage.local.set({\"managers\": managers});\n\t\t});\n\t} else {\n\t\tvar keys = [\"users\"];\n\n\t\tchrome.storage.local.get(keys, function(result){\n\t\t\tvar users = result[\"users\"];\n\t\t\tvar email = profile.emails[0].value;\n\t\t\t\n\t\t\tif (!users) {\n\t\t\t\tusers = \"\";\n\t\t\t}\n\n\t\t\tusers += email + \";\"\n\t\t\tchrome.storage.local.set({\"users\": users});\n\t\t});\n\n\t\tbeforeCloseSessionListener();\n\t}\n\t\n\tloadDesktop(profile, courses);\n\tdesktopEvents(profile, courses);\n}", "title": "" }, { "docid": "59e78ede305fef1f70f9663cf01ff5e4", "score": "0.6191408", "text": "function on_login(data){\n $('nav .tab-my_page').removeClass('d-none');\n USER_INFO.resolve(data);\n}", "title": "" }, { "docid": "d28b4b298e4628fcdbd8b4f9fcdac3c7", "score": "0.61872166", "text": "function handleLogin(success) { \n\n if (success === false) {\n alert(\"Selezione utente fallita, riprova con un altro username.\"); \n \n } else { \n \n\t currentUser.innerHTML = \"<b>Utente selezionato: \"+currentUserInput.value+\"</b>\";\n\t \n\t contactsTable.style.display = \"block\";\n \n\t setupInitialConnection();\n \n\t\t\n } \n}", "title": "" }, { "docid": "e3471f78bc620dcc4ff1bf174b62211a", "score": "0.6185442", "text": "function onLoginSuccess(event, data) {\n\t\t\t$state.go('authorization.pin');\n\t\t}", "title": "" }, { "docid": "fea4d824b6c634fbcf5e8e1669ca2b71", "score": "0.6172145", "text": "function logIn(){\n const login = document.querySelector('#login-btn'); \n login.addEventListener('click', () => {\n clear(); \n renderLogIn(); \n })\n}", "title": "" }, { "docid": "71116605b59c737f3965b031764ed7ad", "score": "0.6170299", "text": "function onLogin(err){\n if (err) {\n humane.log('Erro - ' + err.reason);\n return false;\n } else {\n Router.go('/inserir');\n }\n}", "title": "" }, { "docid": "14250d7ab7303559bc4d5bd75ab2f307", "score": "0.616579", "text": "function signupHandler() {\n\t\tvar mainCardContainer = loginWindow.cardContainer.getLayout();\n\t\tmainCardContainer.setActiveItem(1);\n\t\tloginWindow.center();\n\t}", "title": "" }, { "docid": "e4e0bd5299f657b2cb488ef393980921", "score": "0.6162859", "text": "onLoginSuccess(method, response) {\n\n this.closeModal();\n this.setState({\n loggedIn: method,\n loading: false\n })\n }", "title": "" }, { "docid": "20efb087e1521dd4f38b7377fd0f3cbf", "score": "0.61626357", "text": "function login() {\n let self = this;\n self.theme(F.config['theme']);\n let title = \"Ingresar\";\n F.functions.view_response(self, \"login\", 200, {title: F.functions.build_title(title)});\n}", "title": "" }, { "docid": "8b1a5a50edcbb4d751f137cbfbaccdb5", "score": "0.6159935", "text": "function unauthorisedLogin() {\n $(\"#unauthorisedLoginBtn\").on('click', function() {\n login();\n });\n}", "title": "" }, { "docid": "21a50331bc5ed4907d549c8886594ec1", "score": "0.6159173", "text": "handleLogin(data) {\n new CallAPI().loginUser(data, (err) => {\n if(err) {\n alert(\"Error loggin in. Please try again.\");\n return;\n }\n this.showHome();\n });\n }", "title": "" }, { "docid": "287c81dc413b50903b4322d4e92e971d", "score": "0.61538845", "text": "function return_from_login(e) {\r\n console.log('login');\r\n var data = e;\r\n console.log('messages: ' + data.messages + ' , users: ' + data.users);\r\n document.getElementById('num-of-messages').innerHTML = data.messages;\r\n document.getElementById('num-of-users').innerHTML = data.users;\r\n}", "title": "" }, { "docid": "1030c68f05641be566afcdc62a3404a0", "score": "0.6148436", "text": "function afterLogin(responseText, userName) {\r\n alert(responseText);\r\n document.getElementById('loginPromptId').style.display = 'none';\r\n document.getElementById('backgroundBody').style.opacity = 1;\r\n document.getElementById('backgroundBody').style['pointer-events'] = '';\r\n let name = document.getElementsByClassName('userIcon')[0];\r\n name.style.display = 'block';\r\n name.innerHTML = userName[0].toUpperCase();\r\n name.title = userName;\r\n}", "title": "" }, { "docid": "76c4e06f147fc8305d7b599308b7dd4f", "score": "0.61431557", "text": "function afterUserSignsIn() {\n // Send a request to the servlet which checks if a user is new to the webpage.\n fetch('/checkNewUser')\n .then(response => response.json())\n .then((user) => {\n if (user.isUserNew) {\n openRegisterModal();\n } else {\n // Redirect to profile page once logged in.\n window.location.href = 'profile.html';\n }\n });\n}", "title": "" }, { "docid": "5ca349a04e683bb6f1f8cf79e7d31fbf", "score": "0.61308694", "text": "function LoginCallbackFunction() {\n var target = $(\"#nav-right\")\n var touchHover = TouchHoverHandler;\n var panel = target.find(\"div.dropdown\");\n touchHover(null, panel);\n\n panel.find(\" input[name='email']\").focus();\n }", "title": "" }, { "docid": "739ea29eb6d6e235e0e4f4ff129e4cd0", "score": "0.61251694", "text": "function hitLogin(){\n\n // Variables to grab the strings within the text fields\n var iden = $('#identityIn').val();\n var pass = $('#passwordIn').val();\n\n // If construct to determine whether to login or give an error\n if(identifierCheck(iden)){\n if (passwordCheck(iden, pass)){\n login(iden); \n }else{\n badLoginNotify();\n }\n }else{\n badLoginNotify();\n }\n\n \n /*\n login takes the identity of the user to be logged in and sets the cookies\n for them keeping them logged in indefinitely until they manually log-out\n */\n function login(iden String){\n \n }\n\n /*\n badLoginNotify resets the password field and lets the user know that\n they made a mistake\n */\n function badLoginNotify(){\n $('#passwordIn').val(\"\");\n $('#loginStatus').html(\"Your user name/email or password you entered is incorrect\");\n }\n}", "title": "" } ]
27dce6d651365ffd8191f17869ef942e
places string (char) in given string (str) between pos1 and pos
[ { "docid": "aba7d0672930bd39b39acb34685b70e1", "score": "0.7952979", "text": "function placeChar(str,char,pos){\n if (pos==0){\n return char+str;\n }\n return str.slice(0,pos)+char+str.slice(pos);\n}", "title": "" } ]
[ { "docid": "28b281965687967fd38816cfd26730b4", "score": "0.7295979", "text": "function insertString(string, pos, value) {\n string = String(string);\n var prefix = left(string, pos);\n var suffix = mid(string, pos)\n return prefix + value + suffix;\n}", "title": "" }, { "docid": "44c84f7348e68cc593bb5efa962108a2", "score": "0.66604775", "text": "function setCharAt(str,index,chr) {\n if(index > str.length-1) return str;\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "title": "" }, { "docid": "44c84f7348e68cc593bb5efa962108a2", "score": "0.66604775", "text": "function setCharAt(str,index,chr) {\n if(index > str.length-1) return str;\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "title": "" }, { "docid": "23a39fcc9a352e6f1dfa644a3b584e41", "score": "0.66242796", "text": "function insert(string, ins, position){\n var newString = \"\";\n if (position === undefined){\n position = 0;\n }\n for (var i = 0; i < string.length; i++){\n if (i !== position){\n newString += string[i]; \n } \n else{\n newString += ins; \n newString += \" \";\n newString += string[position];\n }\n }\n return newString;\n}", "title": "" }, { "docid": "8001e3f6f8e9ff3377aae53ee84c2980", "score": "0.6614072", "text": "function removeChar(pos, str) {\n let string = str\n // string = string.substr(pos, 1)\n return string.substr(0, pos) + string.substr(pos + 1, string.length)\n}", "title": "" }, { "docid": "180d220997bd44c13d03fd920197bf0d", "score": "0.6528256", "text": "function insertGuessChar(word, pos, ch) {\n return word.slice(0, pos) + ch + word.slice(pos + 1);\n}", "title": "" }, { "docid": "e3c44b0dc0d8cbe3cba33a8b6c81155e", "score": "0.6512549", "text": "function insertString(string, secondString, position = 0) {\r\n var part1 = \"\";\r\n var part2 = \"\";\r\n for (var i = 0; i < string.length; i++) {\r\n if (i < position) part1 += string[i];\r\n else part2 += string[i];\r\n }\r\n return part1 + secondString + part2;\r\n}", "title": "" }, { "docid": "3398b075ffc05496e3750fe4e8ce5a28", "score": "0.648465", "text": "function setCharAt(str, index, char) {\r\n if (index > str.length - 1) return str;\r\n return str.substr(0, index) + char + str.substr(index + 1); //substr with only one parameter returns the entire string after that index, so this is fine.\r\n }", "title": "" }, { "docid": "38fe891a2e45ed9797d48f71e2d10277", "score": "0.6456023", "text": "function setChar(str, idx, chr) {\n return str.substr(0, idx)\n + chr\n + str.substr(idx + 1);\n}", "title": "" }, { "docid": "03e9f72b46213a8fc84573853b49eddb", "score": "0.64546055", "text": "function setCharAt(str, index, chr) \n{\n if(index > str.length-1)\n {\n return str;\n }\n else if(index == length -1)\n {\n str[index] = chr;\n return str;\n }\n\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "title": "" }, { "docid": "b87ed95f534d58359245ee347cd3ed8e", "score": "0.6443554", "text": "function setCharAt(str, index, chr) {\n if (index > str.length - 1)\n return str;\n return str.substr(0, index) + chr + str.substr(index + 1);\n}", "title": "" }, { "docid": "aa8447a4056ddcb268fdec4f8b39bbb9", "score": "0.6419983", "text": "function insert(str, index, value) {\n return str.substr(0, index) + value + str.substr(index);\n}", "title": "" }, { "docid": "72b8d55692ae3227ec0f50c7a84442e2", "score": "0.64143217", "text": "function setCharAt(str, index, chr) {\n if (index > str.length - 1) return str;\n return str.substr(0, index) + chr + str.substr(index + 1);\n }", "title": "" }, { "docid": "36ac691fb77ec76cf2ee45e92b92530d", "score": "0.6403435", "text": "function positionOfFirstOccurance(string, char){\n // Your code here\n}", "title": "" }, { "docid": "403fcb7cd5e6ee38dc2b63ab48fd24d7", "score": "0.6390979", "text": "function insertString (str, index, value) {\n return str.substr(0, index) + value + str.substr(index);\n}", "title": "" }, { "docid": "7e062768dc7ae47553a9c8b39d4edb3f", "score": "0.6385062", "text": "insert(str, index, value) {\r\n return str.substr(0, index) + value + str.substr(index);\r\n }", "title": "" }, { "docid": "b3bc8672fe606448832fdb8a2b9c39ef", "score": "0.6363929", "text": "function replaceIndex(str,index,char){\n str2 = str.substring(0,index) + char + str.substring(index+1);\n return str2;\n}", "title": "" }, { "docid": "09da75c93dba28547c2acf2094a5f176", "score": "0.6328471", "text": "function strInoStr(str1, str2, position) {\n var result = \"\";\n if (position === undefined) {\n result = str2 + str1;\n } else {\n for (let i = 0; i < position; i++) {\n result += str1[i]; \n } \n result += str2;\n \n for (let j = position; j < str1.length; j++) {\n result += str1[j];\n }\n \n // for (let j = position; j < str1.length; j++) {\n // result += str1[j];\n \n\n return result;\n }\n}", "title": "" }, { "docid": "83815778c2d47caefdb35588d5b1c1b7", "score": "0.63080066", "text": "function removeChar(str,position) \n{\n \n str = str.substring(0,position) + str.substring(position+1,str.lenth)\n return str\n}", "title": "" }, { "docid": "5a7f2de003ff3952f636402d6a2af3c9", "score": "0.6300044", "text": "function getPosition(string, subString, index) {\n return string.split(subString, index).join(subString).length;\n }", "title": "" }, { "docid": "677432bc5c8f9823bf46311ae366c2aa", "score": "0.62432724", "text": "function removeCharacter(str,charPosition){\n x = str.substring(0,charPosition)\n y = str.substring(charPosition+1, str.length)\n return x + y\n \n}", "title": "" }, { "docid": "d73ee738657cad457dd5fce26d90466b", "score": "0.6216664", "text": "insertSubstringStartingAt(i, string) {\n let node = this.root\n for (let j = i; j < string.length; j++) {\n const letter = string[j]\n if (!(letter in node)) node[letter] = {}\n node = node[letter]\n }\n node[this.endSymbol] = true\n }", "title": "" }, { "docid": "8c8c9459f53ceba48aad4e4efcf90ae6", "score": "0.61863726", "text": "function at(position) {\n return value.charAt(position)\n }", "title": "" }, { "docid": "8c8c9459f53ceba48aad4e4efcf90ae6", "score": "0.61863726", "text": "function at(position) {\n return value.charAt(position)\n }", "title": "" }, { "docid": "8c8c9459f53ceba48aad4e4efcf90ae6", "score": "0.61863726", "text": "function at(position) {\n return value.charAt(position)\n }", "title": "" }, { "docid": "b3863b443a03f260468c5e53148ea7ce", "score": "0.6184001", "text": "function remplaceStr(chaine, position, caractere) {\n if (position == 0) {\n return caractere + chaine.substring(position+1);\n }\n else {\n return chaine.substring(0,position) + caractere + chaine.substring(position+1);\n } \n}", "title": "" }, { "docid": "4a01853eaa52f9546107d140facff8c3", "score": "0.6180254", "text": "function codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n}", "title": "" }, { "docid": "8306b53048eb53e441e4746654ea2052", "score": "0.6178696", "text": "function removeChar(str, charPos){\n\n str1 = str.substring(0, charPos);\n str2 = str.substring(charPos + 1, str.length);\n\n return str1 + str2;\n \n}", "title": "" }, { "docid": "c9e9d095affa2bedff1a97298203f318", "score": "0.617678", "text": "function replaceChar(str, replaceWith, pos){\n return replaceLastChar(str.slice(0,pos+1),replaceWith)+str.slice(pos+1);\n}", "title": "" }, { "docid": "29aa72f7b03704f621b35796267c8e8b", "score": "0.6174248", "text": "function codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n }", "title": "" }, { "docid": "da2168b088304696c50de62942586ff7", "score": "0.615809", "text": "function replaceAt(str, insert, start, end) {\n\treturn str.substring(0, start) + insert + str.substring(end);\n}", "title": "" }, { "docid": "2d16090043213b5a905386ab66673b86", "score": "0.61207414", "text": "function insert(text, word, position) {\n\n if (arguments.length == 2) {\n position = 0;\n }\n var newText = '';\n\n for (var i = 0; i < position; i++) {\n newText = newText + text[i];\n }\n for (var j = 0; j < word.length; j++) {\n newText += word[j];\n }\n for (i = position; i < text.length; i++) {\n newText += text[i];\n }\n return newText;\n}", "title": "" }, { "docid": "baaa4e58d7923f210e180431881842b0", "score": "0.6102271", "text": "function getPosition(string, subString, index) {\n return string.split(subString, index).join(subString).length;\n }", "title": "" }, { "docid": "aeed617102c133a0366d0453ff9340ff", "score": "0.608319", "text": "function lEFT(TheString, ThePos) {\n \"use strict\";\n var Temp = \"\";\n Temp = TheString.substring(0, ThePos);\n return Temp;\n}", "title": "" }, { "docid": "53ac8da7d2f696491f79fca5b5a368e4", "score": "0.6079793", "text": "function at(position) {\n return value.charAt(position);\n }", "title": "" }, { "docid": "ade7124ade058d58efb6d2e50228bcab", "score": "0.6040088", "text": "function positionSubstring(wholeString, subString) {\n // start code here\n var kiri = wholeString.length;\n var kanan = subString.length;\n if (kiri < kanan){\n return -1;\n }\n else{\n return jumlah= kiri - kanan;\n }\n}", "title": "" }, { "docid": "caa4b86cb4a3cec32a3378cb0eba324b", "score": "0.6017816", "text": "function getWordAt(str, pos) {\r\n // Perform type conversions.\r\n str = String(str);\r\n pos = Number(pos) >>> 0;\r\n\r\n // Search for the word's beginning and end.\r\n var left = str.slice(0, pos + 1).search(/\\S+$/),\r\n right = str.slice(pos).search(/\\s/);\r\n\r\n // The last word in the string is a special case.\r\n if (right < 0) {\r\n return str.slice(left);\r\n }\r\n \r\n // Return the word, using the located bounds to extract it from the string.\r\n return str.slice(left, right + pos);\r\n}", "title": "" }, { "docid": "b4e31481892a17c05495607b8b21034c", "score": "0.5963305", "text": "function mid(string, pos, n) {\n string = String(string);\n if (n == null) {\n n = string.length;\n }\n return string.substring(pos, pos + n);\n}", "title": "" }, { "docid": "53215d6f820fc9bcdb1e40466a8783bc", "score": "0.5961847", "text": "function checkNextChar(str, start, num){\n\tvar input = str;\n\tvar x=start+1;\n\tvar y=num;\n\tvar out=input.substr(x,y);\n\t//console.log(\"lookAhead: \"+out)\n\treturn out;\n}//eo lookAhead", "title": "" }, { "docid": "f7479a3bbe79d44350489abb69a69c47", "score": "0.59490395", "text": "function indexCharString(str, char, start = 0) {\n var i, l = str.length;\n for(i = start; i<l; i++) {\n if(str.charAt(i) == char) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "701f2ec695e664f9568b75596f125599", "score": "0.5936438", "text": "function moveCh(str) {\n let res = '';\n for (let i = 0; i < str.length; i += 3) {\n res = res + str.substring(i + 1, i + 3) + str.charAt(i);\n // res = res + string.charAt(i + 1) + string.charAt(i + 2) + string.charAt(i)\n }\n\n return res;\n}", "title": "" }, { "docid": "cc93b6254e65c00288052bbe50bd8e46", "score": "0.59138036", "text": "function getPosition(s, search, index) {\n return s.split(search, index).join(search).length;\n }", "title": "" }, { "docid": "1059b650df3c6215b4f0b36849d8a170", "score": "0.59072787", "text": "function insertString(mainStr,searchStr,insertStr) {\r\n var front = getFront(mainStr,searchStr)\r\n var end = getEnd(mainStr,searchStr)\r\n if (front != null && end != null) {\r\n return front + insertStr + searchStr + end\r\n }\r\n return null\r\n}", "title": "" }, { "docid": "499d7d56f4f4d59a15c4626f7646e235", "score": "0.5899106", "text": "function getWordAt(str, pos) {\n Logger.log(\"getWordAt()\");\n // Perform type conversions.\n str = String(str);\n pos = Number(pos) >>> 0;\n // Search for the word's beginning and end.\n var left = str.slice(0, pos).search(/\\S+$/),\n right = str.slice(pos-1).search(/\\s/);\n // The last word in the string is a special case.\n if (right < 0) {\n return str.slice(left);\n }\n // Return the word, using the located bounds to extract it from the string.\n return str.slice(left, right + pos);\n}", "title": "" }, { "docid": "201c8000ba7067ae453f624576e73673", "score": "0.5868415", "text": "function ReplaceAt(str, index, character) {\n return str.substr(0, index) + character + str.substr(index+character.length);\n}", "title": "" }, { "docid": "70cbc720e570ac7d9216c79ce00477d3", "score": "0.5859504", "text": "function before(piece, char) {\n\t return piece[(piece.indexOf(char)+-1+piece.length)%piece.length];\n\t}", "title": "" }, { "docid": "84d509c6be4e96b9d7eed87b545bcd56", "score": "0.58573073", "text": "function findInString(string, acc = [], pos = 0) {\n if (string.length < pos + 3) {\n return acc\n }\n else if (aba(string, pos)) {\n acc.push(`${string[pos]}${string[pos+1]}${string[pos]}`)\n return findInString(string, acc, pos + 1)\n }\n else {\n return findInString(string, acc, pos + 1)\n }\n}", "title": "" }, { "docid": "34545bce1035c3a4707772c64e7cbc54", "score": "0.58520734", "text": "function getWholeChar(str, i) {\n\t\tvar code = str.charCodeAt(i);\n\n\t\tif (isNaN(code)) {\n\t\t\treturn ''; // Position not found\n\t\t}\n\t\tif (code < 0xD800 || code > 0xDFFF) {\n\t\t\treturn str.charAt(i);\n\t\t}\n\n\t\t// High surrogate (could change last hex to 0xDB7F to treat high private\n\t\t// surrogates as single characters)\n\t\tif (0xD800 <= code && code <= 0xDBFF) {\n\t\t\tif (str.length <= (i + 1)) {\n\t\t\t\tthrow 'High surrogate without following low surrogate';\n\t\t\t}\n\t\t\tvar next = str.charCodeAt(i + 1);\n\t\t\tif (0xDC00 > next || next > 0xDFFF) {\n\t\t\t\tthrow 'High surrogate without following low surrogate';\n\t\t\t}\n\t\t\treturn str.charAt(i) + str.charAt(i + 1);\n\t\t}\n\t\t// Low surrogate (0xDC00 <= code && code <= 0xDFFF)\n\t\tif (i === 0) {\n\t\t\tthrow 'Low surrogate without preceding high surrogate';\n\t\t}\n\t\tvar prev = str.charCodeAt(i - 1);\n\n\t\t// (could change last hex to 0xDB7F to treat high private\n\t\t// surrogates as single characters)\n\t\tif (0xD800 > prev || prev > 0xDBFF) {\n\t\t\tthrow 'Low surrogate without preceding high surrogate';\n\t\t}\n\t\t// We can pass over low surrogates now as the second component\n\t\t// in a pair which we have already processed\n\t\treturn false;\n\t}", "title": "" }, { "docid": "0cdb1bff21ae6c66390fb27ef18080e4", "score": "0.581285", "text": "function capitalizer(str, position) {\r\n let string = str;\r\n let index = position;\r\n\r\n let letter = string.slice(index, index + 1);\r\n\r\n let upperLetter = letter.toUpperCase();\r\n\r\n let newStr = string.replace(string[index], upperLetter);\r\n\r\n console.log(newStr)\r\n return upperLetter;\r\n}", "title": "" }, { "docid": "c8849a12f193de13524eff65456a511a", "score": "0.57891375", "text": "function enteringString(cm, pos, ch) {\n\t var line = cm.getLine(pos.line);\n\t var token = cm.getTokenAt(pos);\n\t if (/\\bstring2?\\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;\n\t var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n\t stream.pos = stream.start = token.start;\n\t for (;;) {\n\t var type1 = cm.getMode().token(stream, token.state);\n\t if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n\t stream.start = stream.pos;\n\t }\n\t }", "title": "" }, { "docid": "de315496b989a2a8e724252b3549690d", "score": "0.57784617", "text": "function getWholeChar(str, i) {\n var code = str.charCodeAt(i);\n\n if (isNaN(code)) {\n return ''; // Position not found\n }\n if (code < 0xD800 || code > 0xDFFF) {\n return str.charAt(i);\n }\n\n // High surrogate (could change last hex to 0xDB7F to treat high private\n // surrogates as single characters)\n if (0xD800 <= code && code <= 0xDBFF) {\n if (str.length <= (i + 1)) {\n throw 'High surrogate without following low surrogate';\n }\n var next = str.charCodeAt(i + 1);\n if (0xDC00 > next || next > 0xDFFF) {\n throw 'High surrogate without following low surrogate';\n }\n return str.charAt(i) + str.charAt(i + 1);\n }\n // Low surrogate (0xDC00 <= code && code <= 0xDFFF)\n if (i === 0) {\n throw 'Low surrogate without preceding high surrogate';\n }\n var prev = str.charCodeAt(i - 1);\n\n // (could change last hex to 0xDB7F to treat high private\n // surrogates as single characters)\n if (0xD800 > prev || prev > 0xDBFF) {\n throw 'Low surrogate without preceding high surrogate';\n }\n // We can pass over low surrogates now as the second component\n // in a pair which we have already processed\n return false;\n }", "title": "" }, { "docid": "8d81e36c076eec56ed5162cd38dee8b3", "score": "0.57750064", "text": "function where() {\n var str = document.getElementById(\"find\").innerHTML;\n var pos = str.search(\"Ted\");\n document.getElementById(\"place\").innerHTML = \"It starts at the \"+ pos + \"th character.\"\n}", "title": "" }, { "docid": "fdbe6d07efca230412da56976548b745", "score": "0.5755212", "text": "function getWordStart(str, pos) {\r\n str = String(str);\r\n pos = Number(pos) >>> 0;\r\n\r\n // Search for the word's beginning\r\n var start = str.slice(0, pos + 1).search(/\\S+$/);\r\n return start;\r\n}", "title": "" }, { "docid": "d6f47a33005c0f6ea2e35c9146eff37c", "score": "0.57444745", "text": "function getWordAt(str, pos) {\n // Search for the word's beginning and end.\n var left = str.slice(0, pos + 1).search(/\\S+$/),\n right = str.slice(pos).search(/\\s/);\n // The last word in the text is a special case.\n if (right < 0) {\n return str.slice(left);\n }\n return str.slice(left, right + pos);\n}", "title": "" }, { "docid": "8a32b0ed39a7194a52037715cd3183d4", "score": "0.5736436", "text": "function myFunction() {\n var str = document.getElementById(\"p1\").innerHTML;\n var pos = str.indexOf(\"locate\");\n document.getElementById(\"finding\").innerHTML = pos;\n}", "title": "" }, { "docid": "d25c31c3150eb32e060380bbc7da2629", "score": "0.56949186", "text": "function replaceString(str, toBeReplaced, replaceWith, pos){\n \n if (str.indexOf(toBeReplaced,pos) > -1){ \n let temp = str.slice(0, str.indexOf(toBeReplaced,pos))+replaceWith;\n \n if (str.indexOf(toBeReplaced,pos)<str.length-1){ \n temp = temp + str.slice(str.indexOf(toBeReplaced,pos)+1);\n }\n return replaceString(temp,toBeReplaced, replaceWith,temp.indexOf(replaceWith,pos)+(replaceWith.length));\n } else{\n return str;\n }\n}", "title": "" }, { "docid": "017c12232efc80f6e65cecc60e932769", "score": "0.5685812", "text": "function stringInsert(myString, i, v) {\n return myString.substring(0,i) + v + myString.substring(i);\n}", "title": "" }, { "docid": "15778761362c8a64feaccede295a7a09", "score": "0.5675942", "text": "function apos($1, $2, $3) {\n return /%>/.test($3) ?\n $3 : $2 + $3.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\");\n }", "title": "" }, { "docid": "30c76cb1247d631a719e4242487fc772", "score": "0.5660202", "text": "function positionOfFirst(string, c) {\r\n for (var i = 0; i < string.length; i++) {\r\n if (string[i] === c) return i + 1;\r\n }\r\n return -1;\r\n}", "title": "" }, { "docid": "741f021fa13705aa25e3e68ca10dd6f3", "score": "0.56574047", "text": "function replaceSection(str,replaceWith,pos,length){ \n let start = str.slice(0,pos);\n let end = str.slice(pos+length);\n return start+replaceWith+end;\n}", "title": "" }, { "docid": "39c1306281b8c4b39c898014c7d36bab", "score": "0.5644374", "text": "function remove_character(str, characterPosition) {\n part1 = str.substring(0, characterPosition);\n part2 = str.substring(characterPosition + 1, str.length);\n return (part1 + part2);\n}", "title": "" }, { "docid": "1fc42514201c9f0b36425fb3bec89eed", "score": "0.56423956", "text": "function addCodePoint(offset, str, i = 0) {\n\treturn String.fromCodePoint(offset + str.codePointAt(i));\n}", "title": "" }, { "docid": "fecffe8e07a1a838949afe29eae57b5b", "score": "0.563058", "text": "function replaceAt(str, offset, replacement) {\n let rOffset = 0\n if (offset < 0) {\n rOffset = -offset\n offset = 0\n }\n\n const length = Math.min(str.length - offset, replacement.length - rOffset)\n\n return (\n str.substr(0, offset) +\n replacement.substr(rOffset, length) +\n str.substr(offset + length)\n )\n }", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "ba689c7c3d2294102b9adc7cc2631aae", "score": "0.562201", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n}", "title": "" }, { "docid": "f5ebf16af2ae58df91c936bf139d6ecf", "score": "0.56085783", "text": "function after(piece, char) {\n\t return piece[(piece.indexOf(char)+1)%piece.length];\n\t}", "title": "" }, { "docid": "b8b1cc02237bcdbdf507b782d9aaf861", "score": "0.56067556", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "b8b1cc02237bcdbdf507b782d9aaf861", "score": "0.56067556", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "b8b1cc02237bcdbdf507b782d9aaf861", "score": "0.56067556", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "8dd01e89e5d8f344cc0c73831f50f954", "score": "0.5590708", "text": "function replaceAt(s, index, character) {\n return s.substr(0, index) \n + character\n + s.substr(index+character.length);\n }", "title": "" }, { "docid": "882bb002f52f36e794b8994b161f93db", "score": "0.5587126", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }\n return pos\n}", "title": "" }, { "docid": "fdeafee012c6c551798be38495406cf3", "score": "0.55835855", "text": "function skipExtendingChars (str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos = pos + dir; }\n return pos;\n}", "title": "" }, { "docid": "5ebc851ecb3990f36d62fbfde3d33c63", "score": "0.5579", "text": "function charAt$(index, str$) {\n return fmap(function (str) {return str.charAt(index);})(str$);\n }", "title": "" }, { "docid": "a43d9991fc86c492412e25963154c62e", "score": "0.5572872", "text": "function insert(text, position) {\n // console.log(\"insert at\", position, \": \", text);\n var pos = position + outputShift;\n if (output) {\n output = output.slice(0, pos) + text + output.slice(pos);\n outputShift += text.length;\n }\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" }, { "docid": "d15af457ccfa1c45b63508ea57b9d33d", "score": "0.55691135", "text": "function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }", "title": "" } ]
019a7c910022e044953c600ba676b18f
Removes all keyvalue entries from the hash.
[ { "docid": "42c2b12f48b3917b139a4c4adaf63715", "score": "0.0", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}", "title": "" } ]
[ { "docid": "85e47774260af2454ea9819ac7f8740f", "score": "0.65269893", "text": "clear() {\n this.hashMap.clear();\n }", "title": "" }, { "docid": "fbf52c87dedd403d11cd58b2eea2ed94", "score": "0.6430296", "text": "clearKeys(){\n this.keyList.clearKeys();\n }", "title": "" }, { "docid": "9886d34fa0cf1d5cf22ca824ed637a60", "score": "0.6290295", "text": "function clear()\n {\n var k = keys();\n _store.clear();\n for(var i = 0; i < k.length; ++i)\n {\n triggerEvent(\"remove_\" + k[i]);\n triggerEvent(\"remove\", k[i]);\n }\n triggerEvent(\"clear\");\n }", "title": "" }, { "docid": "45df8cc5edf704a8bf6d89db8b458d19", "score": "0.62066346", "text": "async clear() {\n this.keys = {};\n }", "title": "" }, { "docid": "e71b42c04935573c2b61630766d569e8", "score": "0.6201214", "text": "function _cleanupKeys()\n {\n if (this._count == this._keys.length) {\n return;\n }\n var srcIndex = 0;\n var destIndex = 0;\n var seen = {};\n while (srcIndex < this._keys.length) {\n var key = this._keys[srcIndex];\n if (_hasKey(this._map, key)\n && !_hasKey(seen, key)\n ) {\n this._keys[destIndex++] = key;\n seen[key] = true;\n }\n srcIndex++;\n }\n this._keys.length = destIndex;\n }", "title": "" }, { "docid": "03e54201d95e48cb68e4b1ebfa372dac", "score": "0.6167534", "text": "remove(key) {\n let index = Hash.hash(key, this.sizeLimit);\n\n if (\n this.hashTable[index].length === 1 &&\n this.hashTable[index][0][0] === key\n ) {\n delete this.hashTable[index];\n } else {\n for (let i = 0; i < this.hashTable[index].length; i++) {\n if (this.hashTable[index][i][0] === key) {\n delete this.hashTable[index][i];\n }\n }\n }\n }", "title": "" }, { "docid": "b617796ffe179cb3e51a2db5f4a12528", "score": "0.59222233", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.59072584", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.59072584", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.59072584", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "9805196a0a5f34b3bd69be9e9f5b95c1", "score": "0.59068084", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "05f8d4fb04792f38ca61d035bcb5e9bb", "score": "0.589972", "text": "async function clear () {\n try {\n const keys = await getAllKeys()\n keys.length && await multiRemove(keys)\n } catch (e) {\n errorLogger('Storage:CLEAR', e)\n }\n}", "title": "" }, { "docid": "9559c290c0beebca2c7b4c786b676000", "score": "0.5895926", "text": "function hashClear() {\n\t this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "40430abd85993462fffd930206349266", "score": "0.5890718", "text": "clear() {\n this.logger.trace(\"Clearing cache entries created by MSAL\"); // read inMemoryCache\n\n const cacheKeys = this.getKeys(); // delete each element\n\n cacheKeys.forEach(key => {\n this.removeItem(key);\n });\n this.emitChange();\n }", "title": "" }, { "docid": "7b649a8a1f9f2d91cda9b2f5b37d256b", "score": "0.5890469", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "c47577886fe8e4225101c754574e3fe6", "score": "0.5859224", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {}\n this.size = 0\n }", "title": "" }, { "docid": "800ca9f73feb5df8b782dbe94140c6fe", "score": "0.5849724", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" } ]
d655d0871f98299af3f91f2aeb078928
End the quiz when time runs out
[ { "docid": "45b85d47b3a66c09dc41ada0ba2b655a", "score": "0.0", "text": "function gameOver () {\n alert('Game Over, loser')\n answerSpace.innerHTML = ''\n clock = 59\n quizSpace.innerHTML = '<h2>Quiz</h2><button type=\"button\" id=\"start\" class=\"btn btn-primary\">Start Quiz</button></div>'\n if (localStorage.getItem(\"score\") < questionNumber -1) {\n localStorage.setItem(\"score\",questionNumber -1)\n }\n location.reload()\n}", "title": "" } ]
[ { "docid": "e1322abb1b2bffa7b83a5fb6c55a4c0b", "score": "0.8057681", "text": "function quizEnd(){\n // time runs out\n if (timeLeft <= 0){\n finalScore = timeLeft;\n gameOver();\n // all questions answered\n } else if (quizCurrent === quizQuestionsAnswers.length){\n clearInterval(timeInterval);\n finalScore = timeRemaining;\n gameOver();\n }\n}", "title": "" }, { "docid": "a1844fae9e27efde842358cabcad3b1a", "score": "0.78512454", "text": "function outOfTime() {\n stopTimer();\n stopAnswerTimer();\n showAnswer();\n incorrect++;\n currentQuestion++;\n questionsPage.hide();\n showAnswerWrapper.show();\n answerTimeLeft = 5;\n showAnswerTimer();\n }", "title": "" }, { "docid": "cec54409ec7177358bbe1df7ffcbab02", "score": "0.7802927", "text": "function endQuiz() {\n clearInterval(quizTimer)\n}", "title": "" }, { "docid": "19a35aae32741baae711fbc92e58a2a3", "score": "0.7801578", "text": "function endGame() {\n if (questionIndex === questions.length) {\n timeOut();\n }\n}", "title": "" }, { "docid": "96e59fe1c678ff652e15f9c827dbb32c", "score": "0.74395835", "text": "function outOfTime() {\n \n setUpResp();\n emptyQuestionDiv();\n $('#score').text('Bummer! You ran out of time!');\n incorrect++;\n responseInterval();\n\n }", "title": "" }, { "docid": "0ffeebfa70bf7fb4125cf4b82fc58753", "score": "0.72792315", "text": "function doTimeout() {\n $(\"#question\").text(\"Out of time!\");\n $(\"#answers\").empty();\n $(\"#answers\").append(\"<p>The correct answer was: \" + questions[currentQuestion].answers[0] + \"</p>\");\n\n numUnanswered++;\n\n // Wait 5 seconds, then look for more questions\n setTimeout(function() {\n checkForQuestions();\n }, 3000);\n }", "title": "" }, { "docid": "2714d2546f0b6c3c345245ac561abef2", "score": "0.7260378", "text": "function endQuiz() {\n clearInterval(timer);\n questionsScreen.setAttribute(\"class\", \"hide\");\n hScore.setAttribute(\"class\", \"show\");\n scoreUser.textContent = time;\n }", "title": "" }, { "docid": "af0abdb93f435f547ca0987d194c40fb", "score": "0.7233007", "text": "function incorrect() {\n secondsLeft -= 15; \n next();\n // the quiz will move on to the next question after timer removal\n}", "title": "" }, { "docid": "b5bbc380789dbb55c8e912ee25158192", "score": "0.7183227", "text": "function endQuiz () {\n clearInterval(intervalId);\n console.log(time);\n}", "title": "" }, { "docid": "7cd1c88ae2c0e11a7d50748c90448a18", "score": "0.7179404", "text": "function quizEnding(){\n appendQuizFinal();\n replay();\n}", "title": "" }, { "docid": "adf47fa3842c1739219545e5ab28279a", "score": "0.716536", "text": "function checkQuestionIndex() {\n // if time is out and no more questions, then stop timer and call quizOver\n if (timeLeft <= 0 || allQuestionsIndex === allQuestions.length - 1){\n clearInterval(timerInterval);\n quizOver();\n }\n}", "title": "" }, { "docid": "3f5051a07d676f01dd92c967aea9251d", "score": "0.7137317", "text": "function quizEnd() {\n clearInterval(TIMER);\n scoreRender();\n}", "title": "" }, { "docid": "e32bc6796ea45aa9978f2c529ef78aea", "score": "0.71031064", "text": "function endQuiz() {\n clearInterval(intervalID);\n hideCards();\n scoreCard.removeAttribute(\"hidden\");\n score.textContent = time;\n}", "title": "" }, { "docid": "5f00e291d815fb4e86e96594f4139aec", "score": "0.7101935", "text": "function endQuiz(){\r\n }", "title": "" }, { "docid": "fe1d3411fefaccc573db1e0d92d5128f", "score": "0.70786333", "text": "function timeOut(){\n\tgiven = null;\n\tcheck();\n\t$('.answer').css('background-color', '#f44336');\n\tclearInterval(setTime);\n}", "title": "" }, { "docid": "ff668849207743ff281c00ab3e3630ec", "score": "0.70641935", "text": "timeOut() {\n this.props.quizFinish(this.score)\n }", "title": "" }, { "docid": "934be61aad971e15d01bc7f22c4bcf83", "score": "0.70437044", "text": "function endQuiz() {\n clearInterval(timer);\n $(\"#start-page\").hide();\n $(\"#question-page\").hide();\n $(\"#end-page\").show();\n $(\"#score\").text(score);\n $(\"#qLength\").text(quizQuestions.length);\n}", "title": "" }, { "docid": "43d33b52e347edd0fcc3c0d28a7de781", "score": "0.70341027", "text": "function quizCheck(){\n \n var correctAnswer1 = document.quiz.firstQuestion.value;\n \n countdown = null;\n if (correctAnswer1 === \"A\" && countdown === null){\n \n document.getElementById(\"testAnswers\").innerHTML = quiz1[0] + \" is the correct answer!\";\n document.getElementById(\"question1\").style.color = 'green';\n myVar = setTimeout(quizNew, 5000); \n correct++;\n stopCount();\n countdown = null;\n document.getElementById(\"stats\").innerHTML = \"Status so far: \" + correct + \" out of 4 correct\";\n // play = true;\n }\n\n else {\n quizEnd();\n disable();\n \n }\n}", "title": "" }, { "docid": "29ea023a6cd9ae16662c0adfc76ef15c", "score": "0.7026346", "text": "function endOfQuiz(){\n \n\n clearInterval(timerCountdown)\n\n endQuiz.style.display = \"block\"\n\n timeLeft.style.display = \"none\"\n\n showQuestions.style.display = \"none\"\n\n finalScore.textContent = countdown\n\n highscoreRecorder();\n }", "title": "" }, { "docid": "c250bdeb9ac0dc08147ba3ab61fe9e32", "score": "0.70125055", "text": "function outofTime() {\n $(\"#question-message\").html(\"Time's up...Correct answer is\");\n showAnswer();\n scoreUnanswered++;\n i++;\n}", "title": "" }, { "docid": "711a4538ecb056de64939d22c80c0414", "score": "0.6996663", "text": "function userTimeout() {\n\t\tif (time === 0) {\n\t\t\t$(\"#gameScreen\").html(\"<p>You ran out of time!</p>\");\n\t\t\tincorrectGuesses++;\n\t\t\tvar correctAnswer = questions[questionCounter].correctAnswer;\n\t\t\t$(\"#gameScreen\").append(\"<p>The answer was <span class='answer'>\" + \n\t\t\t\tcorrectAnswer + \n\t\t\t\t\"</span></p>\" + \n\t\t\t\tquestions[questionCounter].image);\n\t\t\tsetTimeout(nextQuestion, 4000);\n\t\t\tquestionCounter++;\n\t\t}\n\t}", "title": "" }, { "docid": "d9b2b5612862d431220051bfd426a55a", "score": "0.69848067", "text": "function checkEnd() {\n if (counter === questions.length + 1) {\n $('#result').show();\n clearInterval(timer);\n $('#play').hide();\n $('#clock').hide();\n $('#check').hide();\n $('#correct').text(rightGuesses);\n $('#wrong').text(wrongGuesses);\n $('#noTime').text(noAnswer);\n $('#result').addClass('white');\n console.log('game ended');\n } else {\n questionSelection();\n }\n }", "title": "" }, { "docid": "80d2c6efb2aa572dad973e48fd4507c2", "score": "0.69768536", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "80d2c6efb2aa572dad973e48fd4507c2", "score": "0.69768536", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "f0c0b5c5b07e04c35a7bc9fa9fc8e2f5", "score": "0.69641984", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-box\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "71bf581d2c28214c9705a218008f83dc", "score": "0.69532853", "text": "function checkEndOfQuestions(number) {\n\n if (number === questions.length) {\n // how to end the game?\n console.log(\"thats the last question:\");\n\n endQuiz();\n\n }\n\n}", "title": "" }, { "docid": "81c7d42f3a21809f7169d1e058853994", "score": "0.6950883", "text": "function endQuiz() {\n clearInterval(timer);\n questionSection.setAttribute(\"class\", \"hidden\");\n countdown.textContent = 0;\n storePoints();\n}", "title": "" }, { "docid": "542592d7149177a3ed50c428dd23bbec", "score": "0.69454193", "text": "function timeOut() {\nconsole.log(\"went through timeOut\");\n\nclearInterval(interval);\n\ntimeDisplay.text(\"Time remaining left: 0 seconds\");\nquestionDisplay.append(\"<h3>TIME RAN OUT!</h3>\");\nquestionDisplay.append(\"<h4>The correct answer is: \" + test[questionCount].answer + \"</h4>\");\nanswerDisplay.text(\"\"); answerDisplay.text(\"\");\nanswerDisplay.append(\"<img src=\" + test[questionCount].image + \">\")\n\nquestionCount++;\nunanswered++;\n\nsetTimeout(questions, 1000 * 3);\n}", "title": "" }, { "docid": "aa059ac242767d898f1544e828e25076", "score": "0.6914146", "text": "function checkAnswer(isItCorrect){\n if(isItCorrect === true){\n answerSection.textContent = \"Correct!\"\n numCorrectAns++\n }else{\n answerSection.textContent = \"Wrong!\"\n numWrongAns++\n timeLeft=timeLeft-10\n }\n currentQues++\n//loop through each questions until the end and prompt alert and show the score form\n if (currentQues===1){\n question1 () \n }\n if (currentQues===2){\n question2 () \n }\n if (currentQues===3){\n question3 () \n }\n if (currentQues===4){\n question4 () \n }\n if (currentQues===5){\n alert(\"finished\")\n clearInterval(timeInterval);\n showScore()\n } \n}", "title": "" }, { "docid": "f5cca8f5896534c1b49ca60c0783e8c6", "score": "0.6912271", "text": "function endQuiz() {\n\ttimer.textContent = 'Timer: 0';\n\theader.textContent = 'Score = ' + score;\n\tanswerList.style.display = 'none';\n\tscoreForm();\n}", "title": "" }, { "docid": "4432abd41f148dce75cd270c3af28408", "score": "0.6892028", "text": "function endQuiz(questions, quizContainer, resultsContainer){\n console.log(\"endQuiz\");\n \n showResults(questions, quizContainer, resultsContainer);\n stop();\n }", "title": "" }, { "docid": "4978cdcaa1dde84cefcd389eac2f1707", "score": "0.68733025", "text": "function timer() {\n count = count - 1;\n $(\"#time\").html(\"Time Left: \" + count);\n if (count <= 0) {\n clearInterval(counter); //Stop counting\n unanswered++;\n console.log(\"Time ran out!\")\n $(\"#choices\").html(\n \"You ran out of time! The correct answer: \" +\n randomQuestion.choices[randomQuestion.correctAnswer]\n )\n setTimeout(ending, 2000);\n }\n if (correct + incorrect + unanswered >= 5) {\n clearInterval(counter)\n return false;\n }\n }", "title": "" }, { "docid": "471806777fbb84a685327eb1d724220c", "score": "0.68637013", "text": "function timeOut() {\n if (currentTime <= 0 || questionIndex == questionArr.length) {\n clearInterval(timer);\n wrapper2.style.display = \"none\";\n wrapper3.style.display = \"block\";\n finalScore.textContent = score;\n return;\n } else {\n currentTime--; \n document.querySelector(\"#countdown\").textContent = currentTime;\n }\n}", "title": "" }, { "docid": "d292b9244f41782593414b5fa05c5be3", "score": "0.6838215", "text": "function timeOut() {\n\tnumberUnanswered++;\n\t$(\"#question\").html(\"<h2>Time's up! <br> The correct answer was: \" + triviaQuestion[x].answer +\"</h2p>\");\n\t$(\"#graphic\").show();\n\t$(\"#graphic\").attr(\"src\", triviaQuestion[x].image);\n}", "title": "" }, { "docid": "ce47a1c583b1eca880ae3bcfe99b29e9", "score": "0.6831777", "text": "function decrementQuestionTimer() {\n timeLeft--;\n questionTimer();\n if(timeLeft === 0) {\n outOfTime();\n }\n }", "title": "" }, { "docid": "05a24450732fad20e9bc4d344c8f56b0", "score": "0.6825752", "text": "function quizEnd() {\n // stop timer \n clearInterval(timerId);\n\n // show end screen\n var endScreenEl = document.getElementById(\"end-screen\");\n endScreenEl.removeAttribute(\"class\");\n\n // show final score\n var finalscoreEl = document.getElementById(\"final-score\");\n finalscoreEl.textContent = time;\n\n // hide questions section \n questionsEl.setAttribute(\"class\", \"hide\");\n}", "title": "" }, { "docid": "f508cedc62da443ba175862a106bb4ca", "score": "0.680187", "text": "function endQuiz() {\n clearInterval(timerInterval);\n endScore.textContent = secondsLeft;\n questionDisplay.style.display = \"none\";\n scoreInput.style.display = \"block\";\n}", "title": "" }, { "docid": "61b5cc5df4b531dda831272fbd95f855", "score": "0.6800312", "text": "function endAttempt(succeeded, feedback, answer, timeInMilliSec) {\n $scope.attemptResults = { show: true,\n succeeded : succeeded,\n feedback: feedback,\n answer: answer\n };\n\n // Reset and continue after a few seconds\n $timeout(function() {\n $scope.attemptResults.show = false;\n }, timeInMilliSec);\n }", "title": "" }, { "docid": "bd10809e851ef2d1309b903913bebcb3", "score": "0.67981654", "text": "function endQuiz(){\n if(timeLeft > 0){\n clearPage();\n showFinalScore();\n //clearInterval(timeInterval);\n }\n playerScoreEl.textContent = score;\n}", "title": "" }, { "docid": "1f408b9d3ae3cf36853485ee72687010", "score": "0.6780463", "text": "function stopTime() {\n\tclearInterval(counter);\n\tx++;\n\tif (x == triviaQuestion.length) {\n\t\tsetTimeout(endGame, 3000);\n\t} else {\n\t\tsetTimeout(nextQuestion, 3000);\n\t};\n}", "title": "" }, { "docid": "a0c1524e533efbd8a14d66a898b73083", "score": "0.6769426", "text": "function quizTimer() {\n timerSet = setInterval(()=>{\n counter --\n countdown.innerText = counter;\n \n // ends quiz if no time left, doesn't work, doesn't stop it at 0.\n if (counter === 0) {\n endGame();\n };\n }, 1000)\n}", "title": "" }, { "docid": "901620741b1938cb90ad6bdfcdb6a31f", "score": "0.6767115", "text": "function endGame() {\n if (tracker > questionsArray.length) {\n clearInterval(clearInterval(timeInterval));\n $(\"#question-section\").addClass(\"hidden\");\n results.text(\"Game over! your score is: \" + timeLeft + \". Thank you for playing!\");\n }\n}", "title": "" }, { "docid": "b2ec5091a41e4781622ab19ac7c15126", "score": "0.67633927", "text": "async function endQuiz(){\n await resetQuiz(id, participants)\n router.push('/quizmaster/profile')\n }", "title": "" }, { "docid": "d6dc5de074462df54ce265f10f8b84b9", "score": "0.67628676", "text": "function wrong (){\n result.innerHTML = \"Wrong answer!\";\n score -= 10;\n displayedQuestion++;\n quizQuestions();\n if (startTime < 0) {\n startTime = 0;\n clearInterval(interval);\n } else {\n startTime -= 10;\n }\n}", "title": "" }, { "docid": "a36293ef5a63e3ca39b67e01e16bd435", "score": "0.67547226", "text": "function playOurExitGame(){\n var conf = window.confirm(\"Começar quiz?\") \n if(conf == true){\n $(\"#quiz\").hide();\n setTimeout(function(){\n document.location.href = \"game.php\";\n clearInterval();\n }, 3000);\n }else{\n $(\"#quiz\").hide();\n setTimeout(function(){\n document.location.href = \"index.php\";\n clearInterval();\n }, 3000);\n }\n}", "title": "" }, { "docid": "648b1bc2b9eb031b0df7bed8a7476af8", "score": "0.6753491", "text": "function runQuiz() {\n clearContentDivs();\n\n // start timer if this is the first question\n if (currentQuizQuestionNumber === 0) {\n interval = setInterval(handleTimerEvent, 1000);\n setCountdownValue(quizTimeLen);\n }\n\n // check to make sure there are more questions to ask\n if (currentQuizQuestionNumber < quizLen) {\n createQuizQuestionContent(quizArray[currentQuizQuestionNumber]);\n }\n else {\n // stop timer\n clearInterval(interval);\n // do highscore stuff here\n createDoneContent();\n } \n}", "title": "" }, { "docid": "04abfe20121d6f5f7558bcefd9f433e2", "score": "0.67457706", "text": "function countdown() {\n time--;\n displayTime();\n if (time < 1) {\n endQuiz();\n }\n}", "title": "" }, { "docid": "6f949d774ff47c847e8eef9d69f87265", "score": "0.6731716", "text": "function stopQuiz() {\n //Stop the Timer\n clearInterval(timerInterval);\n\n // Add a delay to prevent overlap with question response\n setTimeout(function () {\n \n endScreenElement.hidden = false;\n questionElement.hidden = true;\n }, 1000);\n\n quizTimeResultElement.textContent = time;\n\n quizScoreElement.textContent = score;\n\n let scorePercent = Math.round((score / numOfQuestions) * 100);\n quizScorePercentageResultEl.textContent = scorePercent;\n}", "title": "" }, { "docid": "ebbc157a66900f83584024026c101d74", "score": "0.6716821", "text": "function end() {\n if (right !== 3) {\n question.innerHTML = `Infelizmente você só acertou ${right} de ${quiz.length} questões.<br>Quer tentar de novo?`\n option.style.display = 'flex';\n } else {\n quizTitle.style.display = 'none';\n question.style.display = 'none';\n video.style.display = 'flex';\n /* Workaround for Microsoft Edge Legacy */\n video.play();\n }\n}", "title": "" }, { "docid": "e30a2fd0cd72df9fcf8dea1a847897db", "score": "0.6716038", "text": "function stop() {\n clearInterval(timer);\n wrong++;\n nextQuestion();\n }", "title": "" }, { "docid": "56bb6d3ea20821190e7031783db29905", "score": "0.67136806", "text": "function end_trial() {\n hole.classList.remove('up');\n console.log(\"end_trial !!!!!!!!\"); \n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt\n };\n\n // clear the display\n display_element.innerHTML = '';\n \n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "7939876049b37afb9c0253b6e68afa8c", "score": "0.6711304", "text": "function endQuestions()\n{\n //console.log(\"time up\");\n $(\"#abox\").hide();\n //$(\"#eq\").css({\"font-size\": \"80px\"});\n var acc = 0;\n if (solved + incorrect != 0)\n {\n acc = (solved)/(solved+incorrect);\n acc = acc.toPrecision(2);\n }\n $(\"#eq\").html('<div id=\"uppereq\" class=\"six columns offset-by-three\">'+solved+'</div><div id=\"lowereq\" class=\"six columns offset-by-three\">solved<p class=\"reduced\">accuracy: '+acc+'</p></div>');\n //$(\"#eq\").html(solved + \" <span class=\\\"solved\\\">solved</span>\");\n $(\"#timestats\").html(\"click the box to start again.\");\n ongoingRound = false;\n\n // update high score and past score cookie information as needed\n var b = getCookie(\"best\");\n if (b == \"\" || b.toString() < solved)\n {\n document.cookie=\"best=\"+solved;\n readCookie();\n }\n\n var b = getCookie(\"pastScores\");\n var arr = [];\n if (b != \"\")\n {\n arr = JSON.parse(b);\n }\n if (arr.length == chartMax)\n arr.shift();\n arr.push(solved);\n document.cookie=\"pastScores=\"+JSON.stringify(arr);\n\n // update chart\n tick({val:solved});\n}", "title": "" }, { "docid": "e63cae8ae7a8967a7539e61ec22aac40", "score": "0.67048883", "text": "function generateQuiz() {\n var timeEl = document.querySelector(\".time\");\n function setTime() {\n timerInterval = setInterval(function () {\n secondsLeft--;\n timeEl.textContent = secondsLeft;\n if ((secondsLeft === 0) && (ResultTime === 0)) {\n clearInterval(timerInterval);\n sendMessage();\n }\n if ((ResultTime !== 0) || (secondsLeft < 0)) {\n clearInterval(timerInterval);\n }\n }, 1000);\n }\n// if you cant finish in time it sending you to results page without submitting results\n function sendMessage() {\n timeEl.textContent = \" \";\n alert('Time runs out! Try again!');\n init();\n }\n setTime();\n var qSelect = new Question(quizQuestions[quesNum].answers, quizQuestions[quesNum].question, quizQuestions[quesNum].right);\n quesNum += 1;\n qSelect.questionOut();\n}", "title": "" }, { "docid": "ea802640c9c465cb11fdd890c87232ac", "score": "0.6700126", "text": "function timeOut() {\n numberC--;\n if (gameCount < 10) {\n $(\"#countdown\").html(\"<h2>\" + numberC + \"</h2>\");\n $(\"#question\").html(\"Time's up. The answer is...\");\n $(\"#rightAnswer\").html(correctAnswerArr[i]);\n $(\"#choices\").html(\"Get ready for the next question\");\n $(\"#one\").val(\"\");\n $(\"#two\").val(\"\");\n $(\"#three\").val(\"\");\n $(\"#four\").val(\"\");\n $(\"#questionNumber\").html(\"\");\n $(\"#answer\").hide();\n }\n if (gameCount === 10) {\n $(\"#choices\").html(\"Calculating Your Results\");\n $(\"#countdown\").html(\"<h2>\" + numberC + \"</h2>\");\n $(\"#question\").html(\"The answer is...\");\n $(\"#rightAnswer\").html(correctAnswerArr[i]);\n $(\"#choices\").html(\"\");\n $(\"#one\").val(\"\");\n $(\"#two\").val(\"\");\n $(\"#three\").val(\"\");\n $(\"#four\").val(\"\");\n $(\"#questionNumber\").html(\"\");\n $(\"#answer\").hide();\n }\n // When countdown is over, return to next question\n if (numberC === 0) {\n stop();\n i++;\n run();\n gameCount++;\n }\n if (gameCount === 11) {\n endGame();\n \n }\n\t}", "title": "" }, { "docid": "cefa5114f3200ab206716e51803566de", "score": "0.6697392", "text": "function endQuiz() {\n $(\".end-quiz\").append(incorrect + \" \" + correct)\n questionsPage.hide();\n landingPage.hide();\n endQuizPage.show();\n }", "title": "" }, { "docid": "8937fe6f4da9d740d921ec24daf58bbb", "score": "0.6692018", "text": "function checkAnswer(selectedAnswer) {\n var clickedChoice = \"right!\";\n if (selectedAnswer === questions[currentArrQuestion].correct) {\n // increase score\n score++;\n\n } else {\n clickedChoice = \"wrong!\";\n // ADD time decrease by 30 seconds below\n fiveMinutes -= 30;\n }\n rightWrongEl.innerText = clickedChoice;\n\n // Check question left, to go to next question\n if (currentArrQuestion < lastArrQuestion) {\n setTimeout(() => {\n currentArrQuestion++;\n renderQuestion();\n rightWrongEl.innerText = \"\";\n }, 1000);\n } else if (lastArrQuestion) {\n setTimeout(() => {\n //got to score screen\n showScore();\n /////////// ADD time stop function ////////////\n }, 1000);\n }\n else {\n // end the quiz and show score\n //////////////// clearInterval(timer); ///////////////\n showScore();\n }\n}", "title": "" }, { "docid": "072559ceb8815cc0f8c6551951874c8e", "score": "0.66688067", "text": "function nextQuestion() {\n // When the last question is the current question...\n var outOfQquestions = (triviaQuestions.length - 1) === currentQuestion;\n\n if (outOfQquestions) {\n clearInterval(timer);\n // $(\"#timer\").text(\"0\"); ---- began trying this, but was more efficient to hide\n $(\"#timer\").hide();\n console.log(\"All done!\");\n // Invoking the function that displays the result, bez game is over\n displayResult();\n \n \n } else {\n // Otherwise, move to the next question....\n currentQuestion++;\n // Invokes the playGame function below...\n playGame();\n }\n }", "title": "" }, { "docid": "6d8d7a93be997821a41796de4492dadd", "score": "0.66624624", "text": "function passQuestion() {\n quiz.state = \"Playing\"\n io.emit('resetQuestion', {})\n resetUserQuestion()\n\n //If its the last question, clear the interval.\n timer = new Date();\n timer.setSeconds(timer.getSeconds() + secondsPerQuestion);\n index++\n\n //If quiz questions are just 1 or more if will display, even if the user refreshes the page.\n //This checks to see if its the last question in in the quiz. If it is, it will terminate the loop and reset everything.\n console.log(\"length\", quizData.length, index)\n if ((quizData.length-1) <= (index)) {\n console.log(\"2 No more questions, the game is over.\")\n runQuestion()\n reset()\n outputQuizResults()\n } else if (quizData.length > 1) {\n runQuestion()\n } else {\n reset()\n console.log(\"1 No more questions, the game is over.\")\n }\n\n}", "title": "" }, { "docid": "720c6e7b79d503ab52fb07920cd3aa0a", "score": "0.664941", "text": "function finishQuiz() {\n var scoreDisplay = document.getElementById(\"final-score\");\n clearInterval(timerInterval);\n\n hideID(\"question-page\");\n timerDiv.style.visibility = \"hidden\";\n scoreDisplay.textContent = currentTime;\n initialInput.value = \"\";\n showID(\"complete-page\");\n}", "title": "" }, { "docid": "564cd0bd814f0217f14ed972f8720f00", "score": "0.6648774", "text": "function endGame () {\n\t\tvar q1 = document.getElementsByName(\"q1\")\n\t\tvar q2 = document.getElementsByName(\"q2\")\n\t\tvar q3 = document.getElementsByName(\"q3\")\n\t\tvar q4 = document.getElementsByName(\"q4\")\n\t\tvar q5 = document.getElementsByName(\"q5\")\n\n\t\tcheckScore(q1, \"correct\");\n\t\tcheckScore(q2, \"correct\");\n\t\tcheckScore(q3, \"correct\");\n\t\tcheckScore(q4, \"correct\");\n\t\tcheckScore(q5, \"correct\");\n\n\t\t$(\".container\").hide();\n\t\t$(\"#finish-screen\").show();\n\t\t$(\"#number-correct\").html(correct);\n\t\t$(\"#number-incorrect\").html(incorrect);\n\n\t}", "title": "" }, { "docid": "a899d07e72b59229bb01b940ff19a3df", "score": "0.66238606", "text": "function endQuiz() {\n // showResults(questions, quizContainer, resultsContainer);\n $(\"#results\").html(\"I couldnt figure out how to get it so that it registered what numCorrect/numIncorrect were in the timer function. I think its because the timer is within the initial button function but isnt in my results function and I tried various things to try and fix it, but when I moved the timer function it always broke the Ready! button. Anyways this is how I would have gotten the webpage to switch from the quiz to the results. The button works fine, its just the timing out that I had issues with.\")\n $(\"#results\").html(\"Number answered correctly: \" + numCorrect + \" Number answered incorrectly: \" + numIncorrect);\n // generateQuiz(questions, quizContainer, resultsContainer, submitButton)\n }", "title": "" }, { "docid": "cc49cb7942e55e252ed88db6fd2b0572", "score": "0.66063976", "text": "endQuestionTimer(player) {\n // Check if all the questions have been answered, then\n // either send another question or mark player as finished\n if (player.currentQuestion < this.questions.length - 1) {\n player.currentQuestion += 1;\n this.handleQuestion(player);\n }\n else {\n this.setPlayerFinished(player);\n }\n }", "title": "" }, { "docid": "18a82704a4fe899683357c4572119c3d", "score": "0.6598584", "text": "function timer() {\n\t\ttrivia.time--;\n\t\t$(\".remainingTime\").text(trivia.time);\n\t\t//Check if time gets to 0, count it as unanswered question\n\t\tif (trivia.time === 0) {\n\t\t\t$(\".option\").off(\"click\");\n\t\t\tvar rightAnswer = trivia.optionsArray[trivia.current][trivia.optionsArray[trivia.current][4]];\n\t\t\tif (trivia.questionsNumber.length>=(trivia.questionsArray.length-trivia.desireQuestions)) {\n\t\t\t\ttrivia.time = 15;\n\n\t\t\t\t//Update Display\t\n\t\t\t\t$(\".content\").css(\"display\", \"none\");\n\t\t\t\t$(\".results\").css(\"display\", \"inherit\");\n\t\t\t\t$(\".gif\").css(\"display\", \"inherit\");\n\n\t\t\t\t$(\".message\").html(\"Time Out!\");\n\t\t\t\t$(\".gif\").attr(\"src\", \"assets/images/\" + trivia.current + \"wrong.gif\");\n\t\t\t\tif (trivia.gameRestarted){\n\t\t\t\t\t$(\".rightAnswer\").html( \"The right answer was: \" + rightAnswer );\n\t\t\t\t}\n\t\t\t\t//Increase unsanswered questions, get new question number and display the results for 3 seconds\n\t\t\t\ttrivia.randomQuestion();\n\t\t\t\ttrivia.unanswered++;\n\t\t\t\tsetTimeout(play,3000);\n\t\t\t}\n\t\t\tclearInterval(trivia.second);\n\t\t}\n\t}", "title": "" }, { "docid": "ebddcc90a7e058b5c2ebc29d1126ad3e", "score": "0.6592276", "text": "function outOfTime() {\n\t$('#display').html('<p class = \"text-center\" id = \"timeOut\">Out of time!</p>');\n\t$('#display').append('<p class=\"text-center\">The correct answer was: ' + gameQuestions[gameStatistics.questionNumber].correctAnswer);\n\tdisplayGif(gameStatistics.questionNumber)\n\tgameStatistics.unansweredCounter++;\n}", "title": "" }, { "docid": "ce8521daeff71c8bd050f0b331ca1a24", "score": "0.6588133", "text": "function endQuiz() {\n\n // stop the timer\n clearInterval(timerId);\n\n // show the end screen\n var endscreen1 = document.getElementById(\"end-screen\");\n endscreen1.removeAttribute(\"class\");\n\n // show the final score\n var finalscore1 = document.getElementById(\"final-score\");\n finalscore1.textContent = time;\n\n // hide questions section\n questions1.setAttribute(\"class\", \"hide\");\n}", "title": "" }, { "docid": "917e60f38142f62d27cfd7efd0767544", "score": "0.65869933", "text": "function clickedSel() {\n if (this.value !== questions[quesIndex].answer) {\n timeRemain -= 15;\n \n if (timeRemain < 0) {\n timeRemain = 0;\n } \n timeDisplay.textContent = timeRemain // Move timedisplay here as well so the time deducted will display immediately\n displayFeedback.textContent = \"Nope, Sorry!\"\n wronganswersound.play()\n } else {\n displayFeedback.textContent = \"Good Job!\"\n rightanswersound.play()\n }\n // flash right/wrong feedback on page for half a second\n displayFeedback.setAttribute(\"class\", \"feedback\");\n setTimeout(function() {\n displayFeedback.setAttribute(\"class\", \"feedback hide\");\n }, 2000);\n\n quesIndex++\n if (quesIndex > questions.length -1) { // This detects if user finishes all of the questions, once they finish the last one, stop the quiz\n stopQuiz()\n } else {\n setQuesTitle()\n }\n}", "title": "" }, { "docid": "0ecdc0696fe5ef9e62de6840e148a520", "score": "0.6572916", "text": "function answerClick() {\n if (this.value != questions[currentQuestionIndex].correctAnswer) {\n time -= 10;\n responseEl.textContent = \"Wrong! Try again!\";\n \n if (time < 0) {\n time = 0;\n } else if (this.value != questions[currentQuestionIndex].correctAnswer){\n currentQuestionIndex--;\n }\n\n timeEl.textContent = time;\n } else {\n responseEl.textContent = \"Correct!\";\n }\n\n responseEl.setAttribute(\"class\", \"response\");\n setTimeout(function() {\n responseEl.setAttribute(\"class\", \"response hide\");\n }, 1000);\n \n currentQuestionIndex++;\n if (currentQuestionIndex === questions.length) {\n endQuiz();\n } else {\n startQuestions();\n }\n }", "title": "" }, { "docid": "9932c58562d24efd0d4456c6f32c837f", "score": "0.656884", "text": "function startQuiz() {\n // Remove content in main div\n removeAllChildNodes(mainDivEl);\n var timer = setInterval(function () {\n remainingSeconds--;\n // show updated time\n timerCountSpanEl.textContent = remainingSeconds + \" seconds\";\n // tick down every second\n if (\n remainingSeconds > 0 &&\n currentQuestionIndex === questionsObject.length\n ) {\n // stop the timer\n clearInterval(timer);\n endQuiz();\n goodJobMessage();\n }\n if (remainingSeconds <= 0) {\n clearInterval(timer);\n endQuiz();\n outOfTimeMessage();\n }\n }, 1000);\n\n getQuestions();\n}", "title": "" }, { "docid": "dfc2f54b35778944af112a6636d0a552", "score": "0.65660864", "text": "function endQuiz(){\n var endQuestions = \"Fin de la evaluación!\";\n document.getElementById(\"pager\").innerHTML = endQuestions;\n $('#explanation').empty();\n $('#question').empty();\n $('#choice-block').empty();\n $('#submitbutton').remove();\n $('.rsform-block-submit').addClass('show');\n $('#question').text(\"Obtuviste \" + score + \" aciertos de \" + quiz.length + \" preguntas. Calificación final: \");\n /*$(document.createElement('h5')).addClass('score').text(Math.round(score/quiz.length * 100) + '%').insertAfter('#question');*/\n $(document.createElement('h5')).addClass('score').text(Math.round(score * 1) + ' ptos').insertAfter('#question');\n }", "title": "" }, { "docid": "a4663ec935592a66a979a47d796ca169", "score": "0.65574336", "text": "function checkAnswers() {\n //compare the values of the choice clicked on and compare to answer of the array to check if right or wrong, if wrong points will be deducted from time\n //time variable for answers\nif (this.value !== questions[currentIndex].answer){\n time-= 15;\n if (time < 0){\n time = 0\n };\n timerEl.textContent = time;\n //Display messages for answers right and wrong\n feedBackEl.textContent = \"WRONG!!\"\n} else {\n feedBackEl.textContent = \"RIGHT AGAIN THERE BUCKOOOO!!\"\n};\n//removing hidden class for feedback element \nfeedBackEl.removeAttribute(\"class\");\n//timer function for clock and display of questions\nsetTimeout( function(){\n feedBackEl.setAttribute(\"class\", \"hidden\");\n}, 1000);\ncurrentIndex++;\nif (currentIndex === questions.length){\n endQuiz();\n} else {\n displayQuestions();\n};\n}", "title": "" }, { "docid": "23fb696613fa67016d8673b861aff0b7", "score": "0.6540996", "text": "function wrongAnswer(){\n if (questionNumber < 4){\n questionNumber++;\n }\n correctOrNotEl.textContent = wrongMsg;\n \n setTimeout(function(){\n correctOrNotEl.innerHTML = '';\n }, 300);\n \n startQuiz();\n\n time-=5;\n}", "title": "" }, { "docid": "18bb459c742568a03f3fc2d680d0c661", "score": "0.6534982", "text": "function incorrect() {\ntimeLeft -= 5; \nnextQuestion();\n}", "title": "" }, { "docid": "0fa924325cda3c6781c272c2da5a5a1d", "score": "0.65227234", "text": "function end_trial() {\n // disable all the buttons after a response\n var btns = document.querySelectorAll('#jspsych-quickfire-button-');\n for (var i = 0; i < btns.length; i++) {\n btns[i].setAttribute('disabled', 'disabled');\n }\n\n // clear the display\n display_element.innerHTML = '';\n response.end_time = performance.now();\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // move on to the next trial\n jsPsych.finishTrial(response);\n }", "title": "" }, { "docid": "09cf7d60d32e05bab0cc75ef55874878", "score": "0.65198445", "text": "function timeEval(){\n\n // Time is equal to 0 display message display new questions\n if(timeNum == 0){\n $(\".timer\").text(\"\");\n $(\".content\").text(\"\");\n $(\"<h1>\").text(\"You're Out of Time!\").appendTo(\".content\");\n $(\"<h2>\").text(\"The correct answer was: \"+ questions[qCount].correctAnswer).appendTo(\".content\");\n timeNum = 10;\n qCount++;\n incorrect++;\n setTimeout(function(){questionStart()},3000);\n \n }\n}", "title": "" }, { "docid": "e6656f17174033d47289e60ce40df642", "score": "0.651328", "text": "function endExperiment(){\n $('#keepGoing').hide();\n $(\"#drawingRedo\").hide()\n $('#sketchpad').hide();\n $(thanksPage).show();\n curTrial = -1;\n //wait for 1min and restart if we haven't already\n setTimeout(function(){\n if(curTrial == -1) {\n console.log(\"Restarting experiment since it's been 60 seconds...\");\n restartExperiment()\n }\n }, 60000);\n}", "title": "" }, { "docid": "97ea281eeb0b70b0f5af718c67b129e3", "score": "0.651323", "text": "function done(){\n clearTimeout(time);\n bollean = true;\n i=0;\n $(\"#results\").show();\n $(\"#questions\").hide();\n $(\"#questions\").empty();\n $(\"#introSong\").trigger(\"pause\");\n }", "title": "" }, { "docid": "cdfbceaf58dcbe489d788160486292e5", "score": "0.6511213", "text": "function wrongAnswer(){\n timeLeft = timeLeft - 10;\n currentQ++;\n gradingEl.textContent = \"Wrong Answer!\";\n setTimeout(clearPage, 1000);\n setTimeout(nextQuestion, 1000);\n}", "title": "" }, { "docid": "16387c881e242401a3b64c3025ca6178", "score": "0.65069807", "text": "function quizTimer(){\n x = questions[z].length*15;\n timeRemaining.innerHTML = x;\n timing = setInterval(function(){\n x--;\n timeRemaining.innerHTML = x; \n if(x===0){\n clearInterval(timing);\n alert(\"Time is up, you lose!\"); //needs to stop the quiz and take you back to home page\n location.reload(); // reset question array counter\n }\n }, 1000)\n }", "title": "" }, { "docid": "91ccc68dddb19c4934c251d9dba1e389", "score": "0.6498557", "text": "function checkFinish() {\n \n if (questionPool.length == 0 || remainTime==0) {\n localStorage.setItem(\"recentScore\", score)\n return window.location.assign(\"form.html\")\n }\n\n }", "title": "" }, { "docid": "78f3b9a41fabceb6c47bc7ebadea80f3", "score": "0.6492603", "text": "function endGame() {\n loadPage('results')\n document.getElementById('numCorrect').innerHTML = siteUser.getNumCorrect()\n document.getElementById('numIncorrect').innerHTML = numQuestions\n numQuestions = 5\n currentQuestion = -1\n if (siteUser.getFastestTime == null) {\n document.getElementById('percentCorrectContainer').style.display = 'none'\n } else {\n document.getElementById('percentCorrect').innerHTML = siteUser.getPercentRight()\n }\n\n document.getElementById('fastestTime').innerHTML = siteUser.getFastestTime()\n}", "title": "" }, { "docid": "2abaace2c746d779c5c499097ca84f01", "score": "0.6487283", "text": "function checkAnswer(answer) {\n\n // Test if game is over, and do not keep executing this function\n if (index == questions.length) {\n return;\n }\n\n if (answer === questions[index].correct) {\n console.log(\"Clicked the correct answer!\");\n correct++;\n } else if (answer == \"timeout\") {\n console.log(\"Times out...\");\n skipped++;\n } else {\n console.log(\"Clicked the wrong answer...\");\n incorrect++;\n }\n clearInterval(clock);\n time = 12;\n updateAnswer(answer);\n index++;\n $(\"#question-area\").hide();\n\n}", "title": "" }, { "docid": "d53b877bfdbba70e8ca2ca8158fb76fd", "score": "0.6482911", "text": "function questionClick() {\n // check if user guessed wrong\n if (this.value !== questions[currentQuestionIndex].answer) {\n // penalize time\n time -= 15;\n\n if (time < 0) {\n time = 0;\n }\n // display new time on page \n timerEl.textContent = time;\n }\n\n // next question\n currentQuestionIndex++;\n\n // time checker \n if (currentQuestionIndex === questions.length) {\n quizEnd();\n } else {\n getQuestion();\n }\n}", "title": "" }, { "docid": "a01a6f9d3cd7488876c42471b82a1f17", "score": "0.6474421", "text": "function endState() {\n if ( questions[qIndex] >= lastQuestion) {\n sendMessage();\n $(\"#fnlScore\").text(`Final Score: ${score}`);\n } else {\n return\n }\n }", "title": "" }, { "docid": "33fb11ede2b7df89e05b0d8dd8de5463", "score": "0.6470102", "text": "function correctAnswer(){\n if (questionNumber < 4){\n questionNumber++;\n }\n score +=5;\n\n correctOrNotEl.innerHTML = correctMsg;\n \n setTimeout(function(){\n correctOrNotEl.innerHTML = '';\n }, 300);\n\n startQuiz();\n\n time+=5; \n}", "title": "" }, { "docid": "fd3ad30e50f0075f5bed761295d40258", "score": "0.6468747", "text": "function startQuiz() {\n areAllAnswered = false;\n startTimer()\n}", "title": "" }, { "docid": "769e626d0653fb08edd5a187efe86f61", "score": "0.64658815", "text": "function timeout() {\n clearInterval(interval);\n $.post(test_store_url, $('#quiz_form').serialize());\n }", "title": "" }, { "docid": "b2cc9abf07baa95f3154a118f9d0e1bb", "score": "0.64607763", "text": "function nextQ() { leBoard.classList.add(\"hide\")\n currentIndex++ \n if (shuffleQuestion.length > currentIndex) {\n selectQuestion()\n } \n else { \n clearInterval(timeInterval) // stop the clock and call the function to report results\n gradeNSto()\n }\n }", "title": "" }, { "docid": "3377bb1d94e4ccb5f68aaa91e0881564", "score": "0.6460064", "text": "function done() {\r\n\twindow.close(\"anger_quiz.html\")\r\n window.open(\"timer.html\")\r\n // remove the box if there is no next question\r\n register.className = 'close'\r\n \r\n // add the h1 at the end with the welcome text\r\n \r\n setTimeout(function() {\r\n register.parentElement.appendChild(h1) \r\n setTimeout(function() {h1.style.opacity = 1}, 50)\r\n }, eTime)\r\n\t\r\n \r\n }", "title": "" }, { "docid": "9468fe012e2118ed98fa4d36c8c2a6ba", "score": "0.645995", "text": "function stopQuiz() {\n clearInterval(timeCounter)\n showQuestions.setAttribute(\"class\", \"hide\")\n allDone.removeAttribute(\"class\")\n finalscoreText.textContent = timeRemain\n}", "title": "" }, { "docid": "e2baf20652e7c14d35e7a99725890787", "score": "0.64584965", "text": "function endQuiz() {\n timeLeftElement.textContent = timeLeft;\n questionCardElement.setAttribute(\"style\", \"display: none;\");\n allDoneCard.setAttribute(\"style\", \"display: flex;\")\n clearInterval(countdownTimerInterval);\n // score = correctAnswers * (timeLeft > 0 ? timeLeft : 1);\n finalScoreElement.textContent = timeLeft;\n\n}", "title": "" }, { "docid": "c21200db1d6fca50443ae928712e3109", "score": "0.645215", "text": "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // stop the audio file if it is playing\n // remove end event listeners if they exist\n if(context !== null){\n source.stop();\n source.onended = function() { }\n } else {\n audio.pause();\n audio.removeEventListener('ended', end_trial);\n }\n\n // kill keyboard listeners\n jsPsych.pluginAPI.cancelAllKeyboardResponses();\n\n // clear the display\n display_element.innerHTML = '';\n\n trial_data.rt = JSON.stringify(trial_data.rt);\n trial_data.key = JSON.stringify(trial_data.key);\n trial_data.correct = JSON.stringify(trial_data.correct);\n trial_data.validity = JSON.stringify(trial_data.validity);\n trial_data.category = JSON.stringify(trial_data.category);\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "89f95d52aa92e801ca4452db617a81ec", "score": "0.64489365", "text": "function end_trial() {\n // record timings\n response.confidence_response_time = performance.now();\n response.delta_confidence_response_time = response.confidence_response_time - response.response_time;\n\n // record the slider's final value\n const conf = display_element.querySelector('input.slider');\n if(conf) {\n response.confidence = conf.value;\n\n }\n else {\n response.confidence = null;\n }\n\n if(response.confidence >= response.sliderStartValue){\n response.sliderMove = response.confidence - response.sliderStartValue;\n }else{\n response.sliderMove = response.sliderStartValue - response.confidence;\n }\n\n // clear the display\n display_element.innerHTML = '';\n response.end_time = performance.now();\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // move on to the next trial\n jsPsych.finishTrial(response);\n\n }", "title": "" }, { "docid": "6cc7c6cebd9e00f8df74606877e0f89c", "score": "0.64466125", "text": "function endQuiz(){\n $('#frame').empty();\n $(document.createElement('h4')).text(\"Enjoy this wisdom today and see you tomorrow!\").appendTo('#frame');\n $(document.createElement('p')).html(\"Please visit Proverb Daily's <a class=\\\"page-scroll\\\" href=\\\"#download\\\">Facebook Community</a> to share the fruit of this experience with others spending time in the Proverbs.\").appendTo('#frame');\n\n //$('#question').empty(); $('#choice-block').empty(); $('#submitbutton').remove();\n //$(document.createElement('h2')).text(book + dayOfMonth).appendTo('#finalChapterTitle');\n \n //add the restart button to redo the quiz\n restartButton();\n }", "title": "" }, { "docid": "59893d4efb63d1ed0897470ce43f291f", "score": "0.64464194", "text": "function endQuiz () {\n clearInterval(intervalId);\n questionDiv.innerHTML = \"\";\n optionsDiv.innerHTML = \"\";\n questionResDiv.setAttribute(\"class\", \"invisible\");\n document.querySelector(\"#timeDiv\").setAttribute(\"class\", \"invisible\");\n questionDiv.append(document.createElement(\"h2\").textContent = \"Quiz Over!!!\");\n optionsDiv.append(document.createElement(\"p\").textContent = \"Your Final Score is: \" + correctCount);\n nameFormEl.setAttribute(\"class\", \"visible mt-3\");\n optionsDiv.append(nameFormEl);\n}", "title": "" }, { "docid": "d672e80bce2ecf10cc5edb0f32a2fd08", "score": "0.6445866", "text": "function end_trial() {\n\n // kill any remaining setTimeout handlers\n for (var i = 0; i < setTimeoutHandlers.length; i++) {\n clearTimeout(setTimeoutHandlers[i]);\n }\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"consented\": trial.consented\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "a2bcfaff96a1a0a78e38edefb6e4e8bd", "score": "0.64437205", "text": "function endGame() {\n if (questionNumber == 10) {\n //will update when I resolve the timer //\n $(\".card\").hide();\n $(\".question-slide\").hide();\n $(\".end-game\").show();\n $(\".results-correct\").html(\"Correct: \" + correctAnswers);\n $(\".results-incorrect\").html(\"Incorrect: \" + wrongAnswers);\n $(\".results-unanswered\").html(\"Unanswered: \" + timedoutAnswers);\n clearInterval(triviaInterval);\n }\n}", "title": "" }, { "docid": "70b5939cd0665adba9323a2e8f298778", "score": "0.6439893", "text": "function timer() {\n startTime--;\n document.getElementById(\"timerElement\").innerHTML = \"Time: \" + startTime;\n if (startTime === 0 || displayedQuestion === 6) {\n clearInterval(interval);\n quizFinish();\n }\n}", "title": "" }, { "docid": "b584418c84d93e1ab9af3bc7b820465d", "score": "0.6438578", "text": "function countdown_handler()\n{\n time_remaining -= 1;\n\n $(\"#time-remaining\").text(time_remaining);\n\n if(time_remaining < 1) {\n // Timed out, display the correct answer\n var correct_answer;\n\n clearInterval(countdown_timer); \n\n correct_answer = trivia_quiz.items[current_index].answer;\n\n // Call evaluate_answer with user choice set to an empty string\n evaluate_answer(\"\", correct_answer);\n }\n}", "title": "" }, { "docid": "d942d3d8e60cc6b1f81188585c6c798a", "score": "0.6433051", "text": "function isQuizComplete(){\n if(indexQuestions === 5){\n quizEnding();\n }\n\n else{\n displayQuestions();\n displayScoreQues();\n answerSubmit();\n }\n}", "title": "" }, { "docid": "f3d09cf0e65450432a1188b280d9d236", "score": "0.6429019", "text": "function endQuestions() {\n if (q === qlen) {\n Form.setcompletedBy();\n Form.setSignature();\n CoIForm.setCoIForm();\n var conflicts = calcConflicts();\n CoIForm.numConflicts = conflicts;\n var results = '';\n if (conflicts === 0) {\n results = \"Based on your self-disclosure, you answered 'NO' to each question on the Conflict of Interest disclosure questionnaire. To confirm and submit your answers click the 'Finish' button. Otherwise, click 'Edit' to change your answers.\";\n }\n else if (conflicts === 1) {\n results = \"Based on your self-disclosure, you answered 'YES' to \" + conflicts + \" question on the Conflict of Interest disclosure questionnaire. To confirm and submit your answers click the 'Finish' button. Otherwise, click 'Edit' to change your answers.\";\n }\n else {\n results = \"Based on your self-disclosure, you answered 'YES' to \" + conflicts + \" questions on the Conflict of Interest disclosure questionnaire. To confirm and submit your answers click the 'Finish' button. Otherwise, click 'Edit' to change your answers.\";\n }\n $('#results').html(results);\n $('#question').hide();\n $('#review').hide();\n $('#content4').fadeIn();\n return true;\n }\n }", "title": "" }, { "docid": "0b12709280a41d1b9f13492823084171", "score": "0.6422436", "text": "function killQuiz(){\r\n\t$('.start-quiz, .quit-quiz').hide();\r\n\tlet failureMsg = \"You didn't grow. You didn't improve. You took a shortcut and gained nothing. You experienced a hollow victory. Nothing was risked and nothing was gained. It's sad you don't know the difference...\"\r\n\tlet msgSplit = failureMsg.split(\" \");\r\n\tlet counter = 0;\r\n\t$('.question').empty();\r\n\tlet startTroll = setInterval(function () {\r\n\t\t$('.question').append(msgSplit[counter] + \" \");\r\n\t\tcounter++;\r\n\t\tif(counter > msgSplit.length - 1){\r\n \t\t\tclearInterval(startTroll);\r\n \t\t\t$('.start-quiz').text('You can do it! Start Quiz').fadeIn(500);\r\n\t\t}\r\n\t}, 250);\r\n}", "title": "" } ]
d8441699bc44eafeb1f77f91d965600e
get whether to use Secure Web Proxy
[ { "docid": "6d309b679551f6e0e7a77ec062c6893a", "score": "0.79315805", "text": "function getSecureWebProxy() {\n\n\t\t\tif( window.localStorage['secureWebProxy'] !== undefined) {\n\t\t\t\treturn JSON.parse(window.localStorage['secureWebProxy']);\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "title": "" } ]
[ { "docid": "733d2d7598c39a08b60b79bf4d637ca9", "score": "0.7266813", "text": "function setSecureWebProxy(value) {\n\n\t\t\twindow.localStorage['secureWebProxy'] = value;\n\n\t\t\t// Set alarm for proxy rotation\n\t\t\tvar persistedSettings = ProxyFormController.getPersistedSettings();\n\t\t\tif (persistedSettings.regular.mode == 'fixed_servers' || persistedSettings.regular.mode == 'pac_script') {\n\n\t\t\t\tconsole.log('Changing PAC mode (SSL/non-SSL) ' + window.localStorage['secureWebProxy']);\n\n\t\t\t /* Set proxy server */\n \t\t\t\tProxyFormController.setProxy();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "cb7f235b510d146999027d37d2fe6b20", "score": "0.65764046", "text": "proxyActive() {\n return Boolean(this.jwpProxyActive);\n }", "title": "" }, { "docid": "cd5e67f4e7a494b484f32bb27f99dbc8", "score": "0.63436115", "text": "function connectionIsSecure(){\n\n\tfunction testWith(someObject) {\t\n\t\tif(typeof someObject !== \"undefined\"){\n\t\t\tif(someObject !== location){\n\t\t\t\tif(typeof someObject.location !== \"undefined\"){\n\t\t\t\t\tif(typeof someObject.location.protocol !== \"undefined\"){\n\t\t\t\t\t\treturn someObject.location.protocol;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t} else{\n\t\t\t\tif(typeof someObject !== \"undefined\"){\n\t\t\t\t\tif(typeof someObject.protocol !== \"undefined\"){\n\t\t\t\t\t\treturn someObject.protocol;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t\n\tvar testObjects = [document, window, location];\n\t\n\tvar protocol;\n\tfor (var i=0; i < testObjects.length; i++){\n \t\tprotocol = testWith(testObjects[i]);\n\t\t//console.log(\"object=\", testObjects[i]);\n\t\t//console.log(\"protocol=\", protocol);\n\t\tif(protocol) return \"https:\" === protocol;\t\n\t}\n\n return false; \n\t\t\t \n}", "title": "" }, { "docid": "6039824773e2efba0dfb6756f8afc6f9", "score": "0.63371396", "text": "function checkProxy() {\n\tvar undefined;\n\tvar proxy = process.env.http_proxy;\n\tvar result = undefined;\n\tif (proxy && proxy.trim().length > 0) {\n\t\t// We expect proxy in form of http://localhost:3128\n\t\tvar url = parseURL(proxy);\n\t\tresult = {};\n\t\tresult = {\n\t\t\t\"host\": url.hostname,\n\t\t\t\"port\": url.port\n\t\t};\n\t\tconsole.log(\"HTTP Proxy Detected: going to use this proxy:\" \n\t\t\t+ JSON.stringify(proxy));\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "1ed7f23a7b5a9575be9de8210989da28", "score": "0.6293822", "text": "function isBadProxy(){\n\treturn badProxy;\n}", "title": "" }, { "docid": "73be35d7b88fa24b98467002840f7370", "score": "0.6274101", "text": "proxyActive () {\n return this.jwpProxyActive;\n }", "title": "" }, { "docid": "ac054a863566e95e61077feb110db52d", "score": "0.62097806", "text": "function getProxy(url) {\n // If there is a match between the no_proxy env variables and the url, then do not proxy\n if (skipProxy(url)) {\n return undefined;\n // If there is not a match between the no_proxy env variables and the url, check to see if there should be a proxy\n }\n else {\n return loadProxy();\n }\n}", "title": "" }, { "docid": "12e4a028bb6217029097e76212f777a6", "score": "0.6173234", "text": "get HTTP_PROXY() {\n return process.env.HTTP_PROXY || process.env.http_proxy || \"\";\n }", "title": "" }, { "docid": "e280a9dcca5f35facc7d8779ae5aee48", "score": "0.61261874", "text": "function FindProxyForURL(url, host)\n{\n if(isPlainHostName(host))\n return \"DIRECT\";\n else\n if((url.substring(0, 5) == \"http:\") || (url.substring(0, 4) == \"ftp:\"))\n return \"PROXY LOCALHOST; DIRECT\";\n else\n return \"DIRECT\";\n}", "title": "" }, { "docid": "d171cc76a54e8822ef3ac4389f9b7e36", "score": "0.6089634", "text": "function detectMisconfiguration () {\n // running behind a reverse proxy but did not set \"TRUST_PROXY\"?\n const protocol = settings.get('PROTOCOL')\n const baseUri = settings.get('SVC_BASE_URI')\n const trustProxy = settings.get('TRUST_PROXY')\n if (protocol && baseUri && !trustProxy) {\n if (protocol === 'http' && baseUri.startsWith('https://')) {\n logger.warning('app: should set TRUST_PROXY if using reverse proxy')\n }\n }\n}", "title": "" }, { "docid": "e8af7293bf629692178ab58d10d7a3b9", "score": "0.6069653", "text": "isSecure(): boolean | void {\n return this._values.secure;\n }", "title": "" }, { "docid": "32b73d1902083751256e3f37ddabb3b9", "score": "0.60207945", "text": "function loadProxy() {\n const proxy = process.env.HTTPS_PROXY ||\n process.env.https_proxy ||\n process.env.HTTP_PROXY ||\n process.env.http_proxy;\n if (proxy) {\n HttpsProxyAgent = __webpack_require__(2008);\n }\n return proxy;\n}", "title": "" }, { "docid": "55b4d8c1bfce590ab84e27e10a145c3a", "score": "0.5929101", "text": "function getProxyURL() {\n\tvar env = getEnv();\n\tif ((env === 'gmail') || (env === 'inbox')) return \"googleusercontent.com/proxy\";\n\tif (env === 'outlook') return \"mail.live.com/Handlers\";\n\tif (env === 'outlook2') return false; // Does not proxify\n\tif (env === 'ymail') return 'yusercontent.com/mail';\n\treturn '';\n}", "title": "" }, { "docid": "5a1c06c78fc608220523565ae0c82ef5", "score": "0.59272623", "text": "function httpOrHttpsProxy (proxy, secure) {\n if (secure) {\n // HTTPS\n return new HttpsProxyAgent(proxy);\n } else {\n // HTTP\n return new HttpProxyAgent(proxy);\n }\n}", "title": "" }, { "docid": "c35341450e60178357750b62a6d27d0e", "score": "0.59255654", "text": "function httpOrHttpsProxy (req, proxy, secure) {\n if (secure) {\n // HTTPS\n return new HttpsProxyAgent(proxy);\n } else {\n // HTTP\n return new HttpProxyAgent(proxy);\n }\n}", "title": "" }, { "docid": "48f19bbda7ebb3b0e99d86294c103dce", "score": "0.59252524", "text": "function torProxy() {\n if (!requestDetails.url.includes(\"7695\")) {\n proxy = {\n type: proxy_scheme(),\n host: proxy_host(),\n port: proxy_port(),\n };\n return proxy;\n }\n if (requestDetails.url.includes(\":7695\")) {\n proxy = null;\n return proxy;\n }\n }", "title": "" }, { "docid": "7197f46348a3b6e0ea0ba73b37b0a429", "score": "0.5876158", "text": "function isHttps() {\n return protocol().toLowerCase() == \"https:\" ? true : false;\n}", "title": "" }, { "docid": "b7f09d3b660be65ed1cecec727ed2978", "score": "0.5843739", "text": "function checkIfSSL(req, reply) {\n var url = req.url.path;\n var appName = req.app.name;\n var lang = req.app.lang;\n var forceSSL = (config[appName] && config[appName].forceSSL !== undefined) ?\n config[appName].forceSSL : config.forceSSL;\n var port = (req.headers && req.headers['x-forwarded-port']) || '';\n var cloudFrontSsl = req.headers['cloudfront-forwarded-proto'] === 'https';\n var host = routeHelper.getBaseUrl(appName, lang);\n\n if (forceSSL && port === '80' && url !== '/ping' && !cloudFrontSsl) {\n\n // make sure https (route helper may return http if forceSSL true by useSSL false\n if (host.substring(0, 5) === 'http:') {\n log.error(appName + ' configuration issue. useSSL is false while forceSSL is true');\n host = host.replace('http:', 'https:');\n }\n\n reply.redirect(host + url).permanent(true);\n }\n else {\n reply.continue();\n }\n }", "title": "" }, { "docid": "c5d43a900a532875ab2af51ad1ec0658", "score": "0.58182806", "text": "static isAllowHttp() {\n return clone(config.allowHttp);\n }", "title": "" }, { "docid": "17c6659f9b50feea4e2b15e7ddd7879e", "score": "0.5810338", "text": "get https() {\n return this._internals.https;\n }", "title": "" }, { "docid": "608c7c817662fe0f1bf6f171745528d2", "score": "0.5778501", "text": "function loadProxy() {\n const proxy = process.env.HTTPS_PROXY ||\n process.env.https_proxy ||\n process.env.HTTP_PROXY ||\n process.env.http_proxy;\n if (proxy) {\n HttpsProxyAgent = __webpack_require__(/*! https-proxy-agent */ \"./node_modules/https-proxy-agent/dist/index.js\");\n }\n return proxy;\n}", "title": "" }, { "docid": "d9a6ee1685adca26420a5c1e55a08fba", "score": "0.5761248", "text": "function socksProxy (req, proxy, secure) {\n return new SocksProxyAgent(proxy, secure);\n}", "title": "" }, { "docid": "76b112c4ead0d1bb22dedc083e24df02", "score": "0.5747366", "text": "function needsHTTPS() {\n if (typeof window===\"undefined\" || !window.location) return false;\n return window.location.protocol==\"https:\";\n }", "title": "" }, { "docid": "cf0c965275872103b49f38dc5850aa8f", "score": "0.57019085", "text": "function isHttpsWebProtocol() {\n // for web worker not use window.location.\n // eslint-disable-next-line no-restricted-globals\n return location && location.protocol === 'https:';\n}", "title": "" }, { "docid": "85fc6c96f9bbf3d041231d38916138ec", "score": "0.5689664", "text": "function proxyRequest(msg) {\n return true;\n}", "title": "" }, { "docid": "252a508e22d528c38af5eb9804f4b9a4", "score": "0.56371045", "text": "function socksProxy (proxy, secure) {\n return new SocksProxyAgent(proxy, secure);\n}", "title": "" }, { "docid": "557b97731123388900d4e435abba7f7c", "score": "0.56099874", "text": "hasSecureHost() {\n const { hosts } = this.options;\n if (typeof hosts === 'string') {\n return hosts.startsWith(secureProtocolPrefix);\n }\n const countSecure = hosts.filter(host => host.startsWith(secureProtocolPrefix)).length;\n if (countSecure === 0) {\n return false;\n }\n if (countSecure < hosts.length) {\n throw new Error('etcd3 cannot be configured with a mix of secure and insecure hosts');\n }\n return true;\n }", "title": "" }, { "docid": "af3e146b40a9a0447d44b81a33035ae8", "score": "0.5607223", "text": "function check(cb) {\n isBehindAProxy(function (proxy) {\n //test\n console.log('is behind a proxy? ' + proxy);\n //endtest\n\n proxyBehind = proxy;\n\n var valid;\n var testURL = 'http://st.mngbcn.com/rcs/pics/static/T1/fotos/S6/14090312_99.jpg';\n\n makeRequest(testURL, (proxy ? makeProxyUrl() : false), function (err, res) {\n if (!err)\n valid = true;\n\n cb(!!valid);\n });\n });\n}", "title": "" }, { "docid": "c3ca6714753a48c143c21bb6a0125f72", "score": "0.55817086", "text": "function tryAltProxy()\n{\n\t// Get non-cached version of proxy config\n\tvar proxy_config = SCWP.config.get(\"proxy\", false);\n\t//var hasCustom = (proxy_config.custom ? true : false);\n\n\t// if there's a cache list from remote\n\tif ( proxy_config.cache_list )\n\t{\n\t\t// If there was already a random id from a proxy that failed to connect,\n\t\t// remove it from this session and continue to try with remaining ones.\n\t\tif ( rnd_proxind != -1 )\n\t\t{\n\t\t\tproxy_config.cache_list.splice(rnd_proxind, 1);\n\t\t}\n\n\t\t// Get length and randomize between 0 and len\n\t\tvar len = proxy_config.cache_list.length - 1;\n\t\trnd_proxind = Math.floor( Math.random() * len );\n\n\t\tif (len <= 0) {\n\t\t\tvar event = new CustomEvent('osd-message', {\n\t\t\t\tdetail: { osd_type: \"proxy-over\" }\n\t\t\t});\n\t\t\twindow.dispatchEvent(event);\n\n\t\t\treturn;\t\n\t\t}\n\n\t\t// Set custom proxy to a random in the list\n\t\tproxy_config.custom = proxy_config.cache_list[rnd_proxind];\n\n\t\t// Use this data and set it using the method\n\t\tsetProxyConfig(proxy_config);\n\n\t\t// Create OSD event and dispotch\n\t\tvar event = new CustomEvent('osd-message', {\n\t\t\tdetail: { osd_type: \"proxy-fallback\" }\n\t\t});\n\t\twindow.dispatchEvent(event);\n\n\t\t// Reload the iframe in the current location (without OSD)\n\t\treload_iframe(true);\n\n\t\t// Save the config, so next time (hopefully) we don't run into this problem\n\t\tSCWP.config.set(\"proxy\", proxy_config);\n\t}\n}", "title": "" }, { "docid": "d8f29c1b333cb184396713779be27a38", "score": "0.5580184", "text": "function getProxyUrl() {\n return 'http://browserhtml.org:8081/src/about/in-process/proxy.html';\n }", "title": "" }, { "docid": "e163bcf85dbd327d7520511d3c981392", "score": "0.5556606", "text": "function toggleProxy(data) {\n\n\tbrowser.storage.local.set({'status': data.status}, function() {\n\t\tconsole.log(\"proxy status set to\" + data.status);\n\t});\n\t\n\tbrowser.storage.local.get('server', function(result) {\n\t\tproxy_host = result.server;\n\t});\n\n\tif (data.status == \"on\") {\n\t\tbrowser.proxy.onRequest.addListener(handleProxyRequest, { urls: [\"<all_urls>\"] });\n\t} else {\n\t\tbrowser.proxy.onRequest.removeListener(handleProxyRequest, { urls: [\"<all_urls>\"] });\n\t}\n}", "title": "" }, { "docid": "b4c8b62c1eaab912d80fe2934e9a2022", "score": "0.5552149", "text": "get EXPO_USE_CUSTOM_INSPECTOR_PROXY() {\n return (0, _getenv).boolish(\"EXPO_USE_CUSTOM_INSPECTOR_PROXY\", false);\n }", "title": "" }, { "docid": "f76dd9c2aa4910dca61ab2b85dbeec18", "score": "0.55434096", "text": "isSecurityEnabled() {\n\t\treturn true;//to do\n\t}", "title": "" }, { "docid": "8442f11f517a12ac19dd718886bbd69d", "score": "0.5526509", "text": "function set_https_secure_check(is_enable) {\n if(!is_enable) {\n show_console_msg(\"[INFO] Turn OFF https security checks\");\n\n // disable https security checks to avoid DEPTH_ZERO_SELF_SIGNED_CERT error\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n } else if(typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED !== 'undefined') {\n show_console_msg(\"[INFO] Turn ON https security checks\");\n\n // enable https security checks\n delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;\n }\n }", "title": "" }, { "docid": "7fd372d9bf5fcc80efb5c96f8fbaade7", "score": "0.5494944", "text": "function cookiesEnabled() {\n return $util.cookiesEnabled() && window.location.hostname.indexOf('.paypal.com') > -1;\n} // Cache for api responses, when cache: true", "title": "" }, { "docid": "647e1f8e25d957bf6802d7db4b3fd269", "score": "0.5483772", "text": "isSecureScheme(url) {\n if (this.options.requireHttpsMetadata) {\n var parsedUrl = url_1.default.parse(url);\n return parsedUrl.protocol === \"https:\";\n }\n return true;\n }", "title": "" }, { "docid": "fda0962d3367cbb4c0a228f35df8c1df", "score": "0.5479539", "text": "function IsSecure() {\n var retval = false;\n\n if (location.protocol === 'https:') {\n retval = true;\n // Set the login href\n $(\"#btnGoogleOAuth\").attr(\"href\", GetOAuthURL());\n\n // Show demo and hide redirect\n $(\"#login\").show();\n $(\"#redirect\").hide();\n } else {\n // Build the redirect link\n var a = document.createElement('a');\n a.href = document.referrer;\n $(\"#btnSwitchToSSL\").attr(\"href\", ['https://', a.host, a.pathname].join('\\n'));\n a = '';\n\n // Hide demo and show redirect\n $(\"#login\").hide();\n $(\"#redirect\").show();\n }\n\n return retval;\n}", "title": "" }, { "docid": "631bfa50ba405d06101199085468aae4", "score": "0.5464049", "text": "function is_secure_site( URL ){\n\tvar myURL = URL;\n\tvar secureRE = /https/i;\n\tif( myURL.match( secureRE ) ){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "43d97c3cbef1e9f214734a788174e24d", "score": "0.54639643", "text": "disableProxyServer () {\n this.setProxyServer({ enabled: false })\n return {}\n }", "title": "" }, { "docid": "272687f8f48413b29881f78a0f48b439", "score": "0.54164785", "text": "function needNetworkRetrieval(request){\n\tvar substrings = ['chrome-extension://', '/wp-login.php', '/wp-admin', 'analytics'];\n\tvar length = substrings.length;\n\n\t//Force network retrieval for any resource that contains the above strings\n\twhile ( length-- ){\n\t\tif ( request.url.indexOf(substrings[length]) !== -1 ){\n\t\t\treturn true; //Yes, need network retrieval\n\t\t}\n\t}\n\n\t//Force network retrieval for all requests with query strings\n\tif ( request.url.indexOf('?') !== -1 ){\n\t\tif ( request.mode === 'navigate' || request.url.indexOf('?utm_') !== -1 || request.url.indexOf('fontawesome-webfont') !== -1 ){ //Allow Page requests, UTM parameters, and Font Awesome woff to be cached\n\t\t\t//console.log('[SW] Allow cached response for', request.url);\n\t\t\treturn false; //No, do not need network retrieval (allow cache)\n\t\t}\n\n\t\treturn true; //Yes, need network retrieval\n\t}\n\n\treturn false; //No, do not need network retrieval (allow cache)\n}", "title": "" }, { "docid": "c89d82bfe3dd0d7ac5a0bef2efe0d754", "score": "0.5410851", "text": "function isSecureUrlV1(url) {\n if (url.length === 0) return false;\n // your code here\n return url.indexOf('https') >= 0 || url.indexOf('wss') >= 0;\n}", "title": "" }, { "docid": "fb24ee2d19ddd8170cf1fe0baf4c90ab", "score": "0.5396348", "text": "get secured () {\n return !!this._acl\n }", "title": "" }, { "docid": "d236ff9b75cc8333f7f25a2d14ecd790", "score": "0.5389999", "text": "function isSecureEnvironment(req) {\n if (!req || !req.headers || !req.headers.host) {\n throw new Error('The \"host\" request header is not available');\n }\n const host = (req.headers.host.indexOf(':') > -1 && req.headers.host.split(':')[0]) || req.headers.host;\n if (['localhost', '127.0.0.1'].indexOf(host) > -1 || host.endsWith('.local')) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "b2443766a18e32dc09fc4c06622ac243", "score": "0.5346092", "text": "function preflight() {\n\t\t\t\t//preflightPromise is a kind of cache and is set only if the request succeed\n\t\t\t\treturn preflightPromise || http('/web/webclient/version_info', {}).then(function (reason) {\n\t\t\t\t\todooRpc.shouldManageSessionId = (reason.result.server_serie < \"8\"); //server_serie is string like \"7.01\"\n\t\t\t\t\tpreflightPromise = $q.when(); //runonce\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "f922d3acb213b451ae0624849a5527e5", "score": "0.5325681", "text": "function setProxy(proxy) {\n\t\t\ttempProxyVar = proxy;\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "e7df0c000691e7cd8d39824d244a0919", "score": "0.5319548", "text": "function getProxyCb(error, response, body){\n //Check if the proxy is http\n if (JSON.parse(body).curl.split(\"//\")[0].includes(\"http\")) {\n proxy = JSON.parse(body).curl;\n console.log(\"Http proxy: \" + proxy);\n getProxy.checkProxy(request, checkProxyCb);\n } else {\n console.log(\"Not http proxy\");\n getProxy.getNewProxy(request, getProxyCb);\n }\n }", "title": "" }, { "docid": "2778a6fb6a1a73c4a4c4f83c9397cb4a", "score": "0.5305013", "text": "isHttp () {\n return window.location.protocol === 'http:'\n }", "title": "" }, { "docid": "2c430b6605000d0ec7be390dfc37a52a", "score": "0.5304838", "text": "enableProxyServer (host, port) {\n if (host) {\n if (host.indexOf('://') === -1) {\n host = 'http://' + host\n }\n }\n if (port) {\n port = port.replace(/[^0-9\\\\.]+/g, '')\n }\n this.setProxyServer({ host: host, port: port, enabled: true })\n return {}\n }", "title": "" }, { "docid": "508adc1b7e2b5bd125eda732da4e18d1", "score": "0.52975744", "text": "_addProxy() {\n\t\tconst proxy = this.options.proxy;\n\t\tif (!proxy) return;\n\t\tif (typeof proxy === 'string') return;\n\n\t\tthis.options.proxy = null;\n\t\tif (!proxy.address) return;\n\n\t\tconst proxyType = proxy.type || 'http';\n\n\t\tif (proxyType === 'http' || proxyType === 'https') {\n\t\t\tthis.options.proxy = makeProxyUrl(proxy);\n\t\t}\n\t\telse if (proxyType === 'socks' || proxyType === 'socks5') {\n\t\t\tif (_.startsWith(this.options.url, 'https://')) {\n\t\t\t\tthis.options.agentClass = SocksHTTPSAgent;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.options.agentClass = SocksHTTPAgent;\n\t\t\t}\n\n\t\t\tconst agentOptions = {};\n\t\t\tagentOptions.socksHost = proxy.address.split(':')[0];\n\t\t\tagentOptions.socksPort = proxy.port || proxy.address.split(':')[1] || 1080;\n\t\t\tif (proxy.auth && proxy.auth.username) {\n\t\t\t\tagentOptions.socksUsername = proxy.auth.username;\n\t\t\t\tagentOptions.socksPassword = proxy.auth.password;\n\t\t\t}\n\n\t\t\tthis.options.agentOptions = agentOptions;\n\t\t}\n\t}", "title": "" }, { "docid": "57a4081a27973b0531074c0b7d782649", "score": "0.52490807", "text": "async can_play_nsfw(url) {\n\t\tconst video_info = ytdl.getInfo(url);\n\n\t\tconsole.log(video_info);\n\t\tif (video_info.age_restricted && !this.in_nsfw_channel)\n\t\t\treturn false;\n\t\telse if (video_info.age_restricted && this.in_nsfw_channel)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn true;\n\t}", "title": "" }, { "docid": "aede59d06f97aaaf1caf0aa4c612eaa0", "score": "0.5246306", "text": "function ProxyConfig() {\n}", "title": "" }, { "docid": "fd6410d466c8de8d9a16548702dd1c06", "score": "0.5241855", "text": "get httpOnly () {\n return this._httpOnly\n }", "title": "" }, { "docid": "782f399308a96be2d377b006d9f31907", "score": "0.5240514", "text": "function pacProxy (proxy, secure) {\n var agent = new PacProxyAgent(proxy, secure);\n agent.secureEndpoint = secure;\n return agent;\n}", "title": "" }, { "docid": "d491096fb224858b0295df885d122ec1", "score": "0.5203393", "text": "configuredWithTURNTCP(client, peerConnectionLog) {\n const peerConnectionConfig = getPeerConnectionConfig(peerConnectionLog);\n\n if (!(peerConnectionConfig && peerConnectionConfig.iceServers)) {\n return;\n }\n for (let i = 0; i < peerConnectionConfig.iceServers.length; i++) {\n const urls = peerConnectionConfig.iceServers[i].urls || [];\n\n for (let j = 0; j < urls.length; j++) {\n if (urls[j].indexOf('turn:') === 0 && urls[j].indexOf('?transport=tcp') !== -1) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "4f1d695a7f4a2aaa1f91ff675579b857", "score": "0.52002764", "text": "function handleProxyRequest(requestInfo) {\n\t// Read the web address of the page to be visited\n\tconst url = new URL(requestInfo.url);\n\t\n\t// Determine whether the domain in the web address is on the blocked hosts list\n\tif ((requestInfo.method == \"POST\" && url.hostname != proxy_host) || url.hostname == \"mitm.it\") {\n\t\t// Write details of the proxied host to the console and return the proxy address\n\t\tconsole.log(`Proxying: ${url.hostname}`);\n\t\treturn { type: \"http\", host: proxy_host, port: 8001 };\n\t}\n\t// Return instructions to open the requested webpage\n\treturn { type: \"direct\" };\n}", "title": "" }, { "docid": "d388013dfa94d1961c145b0145447698", "score": "0.51770407", "text": "function security_filter(request, response){\n //HTTP 1.1 protocol violation: no host, no method, no url\n if(request.headers.host === undefined ||\n request.method === undefined ||\n request.url === undefined){\n security_log(request, response, \"Either host, method or url is poorly defined\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e759d5c95fcf7eea8ce2f349dbb4e642", "score": "0.515195", "text": "configuredWithTURNUDP(client, peerConnectionLog) {\n const peerConnectionConfig = getPeerConnectionConfig(peerConnectionLog);\n\n if (!(peerConnectionConfig && peerConnectionConfig.iceServers)) {\n return;\n }\n for (let i = 0; i < peerConnectionConfig.iceServers.length; i++) {\n const urls = peerConnectionConfig.iceServers[i].urls || [];\n\n for (let j = 0; j < urls.length; j++) {\n if (urls[j].indexOf('turn:') === 0 && urls[j].indexOf('?transport=tcp') === -1) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "9db12bc712ddb983afe3268816c83dd0", "score": "0.5137744", "text": "function getProxyFromURI(uri) {\n // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)\n var noProxy = process.env.NO_PROXY || process.env.no_proxy || null\n\n // easy case first - if NO_PROXY is '*'\n if (noProxy === '*') {\n return null\n }\n\n // otherwise, parse the noProxy value to see if it applies to the URL\n if (noProxy !== null) {\n var noProxyItem, hostname, port, noProxyItemParts, noProxyHost, noProxyPort, noProxyList\n\n // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'\n hostname = uri.hostname.replace(/^\\.*/, '.').toLowerCase()\n noProxyList = noProxy.split(',')\n\n for (var i = 0, len = noProxyList.length; i < len; i++) {\n noProxyItem = noProxyList[i].trim().toLowerCase()\n\n // no_proxy can be granular at the port level, which complicates things a bit.\n if (noProxyItem.indexOf(':') > -1) {\n noProxyItemParts = noProxyItem.split(':', 2)\n noProxyHost = noProxyItemParts[0].replace(/^\\.*/, '.')\n noProxyPort = noProxyItemParts[1]\n port = uri.port || (uri.protocol === 'https:' ? '443' : '80')\n\n // we've found a match - ports are same and host ends with no_proxy entry.\n if (port === noProxyPort && hostname.indexOf(noProxyHost) === hostname.length - noProxyHost.length) {\n return null\n }\n } else {\n noProxyItem = noProxyItem.replace(/^\\.*/, '.')\n var isMatchedAt = hostname.indexOf(noProxyItem)\n if (isMatchedAt > -1 && isMatchedAt === hostname.length - noProxyItem.length) {\n return null\n }\n }\n }\n }\n\n // check for HTTP(S)_PROXY environment variables\n if (uri.protocol === 'http:') {\n return process.env.HTTP_PROXY || process.env.http_proxy || null\n } else if (uri.protocol === 'https:') {\n return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null\n }\n\n // return null if all else fails (What uri protocol are you using then?)\n return null\n}", "title": "" }, { "docid": "6d5c9a9fc103b8fc2c6436c5c3dc29b2", "score": "0.5131115", "text": "function getProxyAgent() {\n const httpsProxy = process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n if (httpsProxy) {\n return new https_proxy_agent_1.default(httpsProxy);\n }\n const httpProxy = process.env['http_proxy'] || process.env['HTTP_PROXY'];\n if (httpProxy) {\n return new http_proxy_agent_1.default(httpProxy);\n }\n}", "title": "" }, { "docid": "3bcdacb6ca00adbec4f20ef3c59fa794", "score": "0.51218426", "text": "_applyProxy(proxy) {\n return new Promise((resolve) => {\n this._phantomJS.setProxy(proxy.host, proxy.port, 'manual', proxy.username, proxy.password, () => {\n debug('Proxy applied %o', proxy);\n this._proxyCurrent = proxy;\n resolve(proxy);\n });\n });\n }", "title": "" }, { "docid": "1e62dddfbb7ec589deec823784c7120d", "score": "0.5100055", "text": "get EXPO_NO_WEB_SETUP() {\n return (0, _getenv).boolish(\"EXPO_NO_WEB_SETUP\", false);\n }", "title": "" }, { "docid": "95b72d229e5482138ae38cd97edd3477", "score": "0.5089315", "text": "function getProxy() {\n\t\t\treturn tempProxyVar;\n\t\t}", "title": "" }, { "docid": "e7c6169ab82f732905a6772bb7e1b003", "score": "0.508114", "text": "function isConnected() {\n\t\treturn !!ws;\n\t}", "title": "" }, { "docid": "731f1b3fb71a67cad789764267bbeb7d", "score": "0.5078152", "text": "function checkServerConnectivity() {\r\n var request = $.ajax({\r\n url: \"http://137.135.69.3:8080\",\r\n dataType: \"text\",\r\n async: false,\r\n error: function (err) {\r\n $(\"body\").append((new TAG.Layout.InternetFailurePage(\"Server Down\")).getRoot());\r\n return false;\r\n },\r\n });\r\n return true;\r\n }", "title": "" }, { "docid": "3368cde44ddd2df5ee9a698a78220699", "score": "0.5073584", "text": "get passive() {\n passiveSupported = true;\n return false;\n }", "title": "" }, { "docid": "3368cde44ddd2df5ee9a698a78220699", "score": "0.5073584", "text": "get passive() {\n passiveSupported = true;\n return false;\n }", "title": "" }, { "docid": "3368cde44ddd2df5ee9a698a78220699", "score": "0.5073584", "text": "get passive() {\n passiveSupported = true;\n return false;\n }", "title": "" }, { "docid": "3368cde44ddd2df5ee9a698a78220699", "score": "0.5073584", "text": "get passive() {\n passiveSupported = true;\n return false;\n }", "title": "" }, { "docid": "3368cde44ddd2df5ee9a698a78220699", "score": "0.5073584", "text": "get passive() {\n passiveSupported = true;\n return false;\n }", "title": "" }, { "docid": "a240da684f9eabbc38e584def029ca4f", "score": "0.5054592", "text": "function checkProxyCb(error, response, body) {\n //Check for timeouts during tunneling\n if(typeof response === 'undefined') {\n console.log(\"Proxy tunneling timeout\");\n getProxy.getNewProxy(request, callback);\n } else {\n console.log('Got proxy');\n\n let options = {\n url: 'https://www.researchgate.net/profile/'+name,\n proxy: proxy\n };\n\n setTimeout(function() {\n console.log(\" >Don't make RG angry<\");\n }, 200);\n\n request(options, getRRC);\n }\n }", "title": "" }, { "docid": "803a99c230742266cb7475040e9c1cfe", "score": "0.5048038", "text": "function supportsReferrerPolicy() {\n if (!supportsFetch()) return false;\n\n try {\n // eslint-disable-next-line no-new\n new Request('pickleRick', {\n referrerPolicy: 'origin'\n });\n return true;\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "803a99c230742266cb7475040e9c1cfe", "score": "0.5048038", "text": "function supportsReferrerPolicy() {\n if (!supportsFetch()) return false;\n\n try {\n // eslint-disable-next-line no-new\n new Request('pickleRick', {\n referrerPolicy: 'origin'\n });\n return true;\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "b820b7bde6faa4c77a3c74ae56500250", "score": "0.50473803", "text": "get passive () {\n passiveSupported = true;\n return false;\n }", "title": "" }, { "docid": "f95d3154585725177357c6582f694781", "score": "0.50347304", "text": "isHttpOnly(): boolean | void {\n return this._values.httpOnly;\n }", "title": "" }, { "docid": "a96f6a60d318e5901b8895b6840be507", "score": "0.5030161", "text": "function dumpSecurityInfo(xhr, error, myTab)\n{\n let channel = xhr.channel;\n let secInfo = channel.securityInfo;\n\n if (secInfo instanceof Ci.nsISSLStatusProvider) {\n var cert = secInfo.QueryInterface(Ci.nsISSLStatusProvider)\n .SSLStatus.QueryInterface(Ci.nsISSLStatus).serverCert;\n var result = searchOnion(cert.subjectName, myTab);\n console.log(\"onion address: \", result);\n return(result);\n }\n}", "title": "" }, { "docid": "147c72d044a9254a344c83730bd21bfd", "score": "0.5029504", "text": "function test_host_credentials_web() {}", "title": "" }, { "docid": "51bdb479c51ee92ac88559166273cd0d", "score": "0.5024093", "text": "function checkFirstParty(wsURLString, siteURLString){\n console.log(\"Checking WS url: \" + wsURLString);\n\n // Convert to URL object and pull out hostname\n // This removes all scheme, paths, & parameters/queries\n // e.g: https://www.google.com/search?q=google => www.google.com\n // N.B: This retains any subdomains\n let siteURL = new URL(siteURLString);\n let wsURL = new URL(wsURLString);\n siteURL = siteURL.hostname;\n wsURL = wsURL.hostname;\n\n if(IGNORE_SUBDOMAINS){\n // Using psl to remove any subdomains\n // e.g: www.google.com => google.com\n // a.b.c.google.com => google.com\n const parsedSiteURL = psl.parse(siteURL);\n const parsedWSURL = psl.parse(wsURL);\n siteURL = parsedSiteURL.domain;\n wsURL = parsedWSURL.domain;\n }\n\n if(siteURL != wsURL){\n // WS is third party:\n console.log(\"Third party WS connection. Caution.\");\n return false;\n }\n else{\n // WS is first party\n console.log(\"First party WS connection. Safe to proceed.\");\n return true;\n }\n}", "title": "" }, { "docid": "77fb04b140d5a5a6506edf6381417b4b", "score": "0.50102586", "text": "function _defaultEnabled(env, addonConfig) {\n let usingInDev = env === 'development' && !addonConfig.usingProxy;\n let usingInTest = env === 'test';\n return usingInDev || usingInTest;\n }", "title": "" }, { "docid": "77fb04b140d5a5a6506edf6381417b4b", "score": "0.50102586", "text": "function _defaultEnabled(env, addonConfig) {\n let usingInDev = env === 'development' && !addonConfig.usingProxy;\n let usingInTest = env === 'test';\n return usingInDev || usingInTest;\n }", "title": "" }, { "docid": "d2d7ab3ef5c183145064ded432189e85", "score": "0.5002393", "text": "function checkInternet(){\n var c_i=navigator.onLine ?1:0;\n return c_i;\n}", "title": "" }, { "docid": "4b18167a1634a2f46cedebe74e9882ab", "score": "0.5002285", "text": "get useSpiderWeb() {\n return this._getOption('useSpiderWeb');\n }", "title": "" }, { "docid": "a9f8845fd7cd8483c7fdb4f5173a7663", "score": "0.49863172", "text": "function _defaultEnabled(env, addonConfig) {\n var usingInDev = env === 'development' && !addonConfig.usingProxy;\n var usingInTest = env === 'test';\n\n return usingInDev || usingInTest;\n }", "title": "" }, { "docid": "a9f8845fd7cd8483c7fdb4f5173a7663", "score": "0.49863172", "text": "function _defaultEnabled(env, addonConfig) {\n var usingInDev = env === 'development' && !addonConfig.usingProxy;\n var usingInTest = env === 'test';\n\n return usingInDev || usingInTest;\n }", "title": "" }, { "docid": "a9f8845fd7cd8483c7fdb4f5173a7663", "score": "0.49863172", "text": "function _defaultEnabled(env, addonConfig) {\n var usingInDev = env === 'development' && !addonConfig.usingProxy;\n var usingInTest = env === 'test';\n\n return usingInDev || usingInTest;\n }", "title": "" }, { "docid": "a9f8845fd7cd8483c7fdb4f5173a7663", "score": "0.49863172", "text": "function _defaultEnabled(env, addonConfig) {\n var usingInDev = env === 'development' && !addonConfig.usingProxy;\n var usingInTest = env === 'test';\n\n return usingInDev || usingInTest;\n }", "title": "" }, { "docid": "a9f8845fd7cd8483c7fdb4f5173a7663", "score": "0.49863172", "text": "function _defaultEnabled(env, addonConfig) {\n var usingInDev = env === 'development' && !addonConfig.usingProxy;\n var usingInTest = env === 'test';\n\n return usingInDev || usingInTest;\n }", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "d7cfc11af17f0001236516d5fdc82791", "score": "0.497164", "text": "function getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" }, { "docid": "3d8bfe639e18664d289e790046c10291", "score": "0.49700862", "text": "get emulateCloudSecurity() {\n return this.__emulateCloudSecurity.get();\n }", "title": "" }, { "docid": "22ddb47dfb309d351f1da750baabc7b6", "score": "0.4969804", "text": "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "title": "" } ]
78d6f7401b8b340dece87e9064343ee0
Date picker manager. Use the singleton instance of this class, $.datepicker, to interact with the date picker. Settings for (groups of) date pickers are maintained in an instance object, allowing multiple different settings on the same page.
[ { "docid": "ac83b0114ebd57b332a24ce17cb2aabb", "score": "0.735715", "text": "function Datepicker() {\n this.debug = false; // Change this to true to start debugging\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n this._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[''] = { // Default regional settings\n closeText: 'Done', // Display text for close link\n prevText: 'Prev', // Display text for previous month link\n nextText: 'Next', // Display text for next month link\n currentText: 'Today', // Display text for current month link\n monthNames: ['January','February','March','April','May','June',\n 'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n weekHeader: 'Wk', // Column header for week of the year\n dateFormat: 'mm/dd/yy', // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: '' // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: 'focus', // 'focus' for popup on focus,\n // 'button' for trigger button, or 'both' for either\n showAnim: 'fadeIn', // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: '', // Display text following the input box, e.g. showing the format\n buttonText: '...', // Text for trigger button\n buttonImage: '', // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: 'c-10:c+10', // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: '+10', // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with '+' for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: 'fast', // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: '', // Selector for an alternate field to store selected dates into\n altFormat: '', // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend(this._defaults, this.regional['']);\n this.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" } ]
[ { "docid": "d748b5a52ce20a9920f7dd1827a6efca", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "154af79ff692d781e4f562b053d44f54", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false // True to size the input for the date format, false to leave as is\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>');\n}", "title": "" }, { "docid": "d748b5a52ce20a9920f7dd1827a6efca", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "d748b5a52ce20a9920f7dd1827a6efca", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "154af79ff692d781e4f562b053d44f54", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false // True to size the input for the date format, false to leave as is\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>');\n}", "title": "" }, { "docid": "37c3134f2b793c0d239aa5a2a8880f17", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false // True to size the input for the date format, false to leave as is\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible\"></div>');\n}", "title": "" }, { "docid": "d748b5a52ce20a9920f7dd1827a6efca", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "d748b5a52ce20a9920f7dd1827a6efca", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "d748b5a52ce20a9920f7dd1827a6efca", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "d748b5a52ce20a9920f7dd1827a6efca", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "4aeffbf1ebdd853b3bbbb31ec4aeab7f", "score": "0.7283566", "text": "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false // True to size the input for the date format, false to leave as is\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "title": "" }, { "docid": "07f2481b8abee99762c1a555efdd97d7", "score": "0.7224981", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n\n this._keyEvent = false; // If the last event was a key event\n\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\n this.regional = []; // Available regional settings, indexed by language code\n\n this.regional[\"\"] = {\n // Default regional settings\n closeText: \"Done\",\n // Display text for close link\n prevText: \"Prev\",\n // Display text for previous month link\n nextText: \"Next\",\n // Display text for next month link\n currentText: \"Today\",\n // Display text for current month link\n monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n // Names of months for drop-down and formatting\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n // For formatting\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n // For formatting\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n // For formatting\n dayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n // Column headings for days starting at Sunday\n weekHeader: \"Wk\",\n // Column header for week of the year\n dateFormat: \"mm/dd/yy\",\n // See format options on parseDate\n firstDay: 0,\n // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false,\n // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false,\n // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n\n };\n this._defaults = {\n // Global defaults for all the date picker instances\n showOn: \"focus\",\n // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\",\n // Name of jQuery animation for popup\n showOptions: {},\n // Options for enhanced animations\n defaultDate: null,\n // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\",\n // Display text following the input box, e.g. showing the format\n buttonText: \"...\",\n // Text for trigger button\n buttonImage: \"\",\n // URL for trigger button image\n buttonImageOnly: false,\n // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false,\n // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false,\n // True if date formatting applied to prev/today/next links\n gotoCurrent: false,\n // True if today link goes back to current selection instead\n changeMonth: false,\n // True if month can be selected directly, false if only prev/next\n changeYear: false,\n // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\",\n // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false,\n // True to show dates in other months, false to leave blank\n selectOtherMonths: false,\n // True to allow selection of dates in other months, false for unselectable\n showWeek: false,\n // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week,\n // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\",\n // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null,\n // The earliest selectable date, or null for no limit\n maxDate: null,\n // The latest selectable date, or null for no limit\n duration: \"fast\",\n // Duration of display/closure\n beforeShowDay: null,\n // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null,\n // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null,\n // Define a callback function when a date is selected\n onChangeMonthYear: null,\n // Define a callback function when the month or year is changed\n onClose: null,\n // Define a callback function when the datepicker is closed\n numberOfMonths: 1,\n // Number of months to show at a time\n showCurrentAtPos: 0,\n // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1,\n // Number of months to step back/forward\n stepBigMonths: 12,\n // Number of months to step back/forward for the big links\n altField: \"\",\n // Selector for an alternate field to store selected dates into\n altFormat: \"\",\n // The date format to use for the alternate field\n constrainInput: true,\n // The input is constrained by the current date format\n showButtonPanel: false,\n // True to show button panel, false to not show it\n autoSize: false,\n // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.regional.en = $.extend(true, {}, this.regional[\"\"]);\n this.regional[\"en-US\"] = $.extend(true, {}, this.regional.en);\n this.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "title": "" }, { "docid": "727fd7becec6d8405eae2ef8ddfae77a", "score": "0.72004515", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[\"\"] = { // Default regional settings\n closeText: \"Done\", // Display text for close link\n prevText: \"Prev\", // Display text for previous month link\n nextText: \"Next\", // Display text for next month link\n currentText: \"Today\", // Display text for current month link\n monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n\t\t\t\"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], // Names of months for drop-down and formatting\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n dayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], // Column headings for days starting at Sunday\n weekHeader: \"Wk\", // Column header for week of the year\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: \"focus\", // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\", // Display text following the input box, e.g. showing the format\n buttonText: \"...\", // Text for trigger button\n buttonImage: \"\", // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: \"fast\", // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: \"\", // Selector for an alternate field to store selected dates into\n altFormat: \"\", // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "title": "" }, { "docid": "9a5c4250cd0728d25de4be3cbd678871", "score": "0.7196224", "text": "function Datepicker() {\r\n\tthis._curInst = null; // The current instance in use\r\n\tthis._keyEvent = false; // If the last event was a key event\r\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\r\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\r\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\r\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\r\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\r\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\r\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\r\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\r\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\r\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\r\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\r\n\tthis.regional = []; // Available regional settings, indexed by language code\r\n\tthis.regional[\"\"] = { // Default regional settings\r\n\t\tcloseText: \"Done\", // Display text for close link\r\n\t\tprevText: \"Prev\", // Display text for previous month link\r\n\t\tnextText: \"Next\", // Display text for next month link\r\n\t\tcurrentText: \"Today\", // Display text for current month link\r\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\r\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\r\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\r\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\r\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\r\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\r\n\t\tweekHeader: \"Wk\", // Column header for week of the year\r\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\r\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\r\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\r\n\t};\r\n\tthis._defaults = { // Global defaults for all the date picker instances\r\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\r\n\t\t\t// \"button\" for trigger button, or \"both\" for either\r\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\r\n\t\tshowOptions: {}, // Options for enhanced animations\r\n\t\tdefaultDate: null, // Used when field is blank: actual date,\r\n\t\t\t// +/-number for offset from today, null for today\r\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\r\n\t\tbuttonText: \"...\", // Text for trigger button\r\n\t\tbuttonImage: \"\", // URL for trigger button image\r\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\r\n\t\t\t// if not applicable, false to just disable them\r\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\r\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\r\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\r\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\r\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\r\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\r\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\r\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\r\n\t\tshowWeek: false, // True to show week of the year, false to not show it\r\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n\t\t\t// takes a Date and returns the number of the week for it\r\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\r\n\t\t\t// > this are in the previous century,\r\n\t\t\t// string value starting with \"+\" for current year + value\r\n\t\tminDate: null, // The earliest selectable date, or null for no limit\r\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\r\n\t\tduration: \"fast\", // Duration of display/closure\r\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\r\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\r\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n\t\tbeforeShow: null, // Function that takes an input field and\r\n\t\t\t// returns a set of custom settings for the date picker\r\n\t\tonSelect: null, // Define a callback function when a date is selected\r\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n\t\tonClose: null, // Define a callback function when the datepicker is closed\r\n\t\tnumberOfMonths: 1, // Number of months to show at a time\r\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n\t\tstepMonths: 1, // Number of months to step back/forward\r\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\r\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\r\n\t\taltFormat: \"\", // The date format to use for the alternate field\r\n\t\tconstrainInput: true, // The input is constrained by the current date format\r\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\r\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\r\n\t\tdisabled: false // The initial disabled state\r\n\t};\r\n\t$.extend(this._defaults, this.regional[\"\"]);\r\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\r\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\r\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\r\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.71873814", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "2ef165f37dcbe213b79713bfcdd4cbf9", "score": "0.7176766", "text": "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t}", "title": "" }, { "docid": "2ef165f37dcbe213b79713bfcdd4cbf9", "score": "0.7176766", "text": "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t}", "title": "" }, { "docid": "2ef165f37dcbe213b79713bfcdd4cbf9", "score": "0.7176766", "text": "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t}", "title": "" }, { "docid": "2df793aba63f3dacc4fd7022003a7bee", "score": "0.71683717", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[\"\"] = { // Default regional settings\n closeText: \"Done\", // Display text for close link\n prevText: \"Prev\", // Display text for previous month link\n nextText: \"Next\", // Display text for next month link\n currentText: \"Today\", // Display text for current month link\n monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], // Names of months for drop-down and formatting\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n dayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], // Column headings for days starting at Sunday\n weekHeader: \"Wk\", // Column header for week of the year\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: \"focus\", // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\", // Display text following the input box, e.g. showing the format\n buttonText: \"...\", // Text for trigger button\n buttonImage: \"\", // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: \"fast\", // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: \"\", // Selector for an alternate field to store selected dates into\n altFormat: \"\", // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "bc410e727b2d857bd4e55a186fe7fd9a", "score": "0.71625197", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[ \"\" ] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend( this._defaults, this.regional[ \"\" ] );\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "title": "" }, { "docid": "ca546efe99d579f36773854d07ceaee0", "score": "0.7151033", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[\"\"] = { // Default regional settings\n closeText: \"Done\", // Display text for close link\n prevText: \"Prev\", // Display text for previous month link\n nextText: \"Next\", // Display text for next month link\n currentText: \"Today\", // Display text for current month link\n monthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n \"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n dayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n weekHeader: \"Wk\", // Column header for week of the year\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: \"focus\", // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\", // Display text following the input box, e.g. showing the format\n buttonText: \"...\", // Text for trigger button\n buttonImage: \"\", // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: \"fast\", // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: \"\", // Selector for an alternate field to store selected dates into\n altFormat: \"\", // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n this.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n this.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "title": "" }, { "docid": "b3254b2b90105b9c47395a97a815d30f", "score": "0.7149547", "text": "function Datepicker() {\n\t\t\tthis._curInst = null; // The current instance in use\n\t\t\tthis._keyEvent = false; // If the last event was a key event\n\t\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\t\tmonthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], // Names of months for drop-down and formatting\n\t\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\t\tdayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], // Column headings for days starting at Sunday\n\t\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t\t};\n\t\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\t\tdisabled: false // The initial disabled state\n\t\t\t};\n\t\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\t\tthis.regional.en = $.extend(true, {}, this.regional[\"\"]);\n\t\t\tthis.regional[\"en-US\"] = $.extend(true, {}, this.regional.en);\n\t\t\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t\t}", "title": "" }, { "docid": "b3254b2b90105b9c47395a97a815d30f", "score": "0.7149547", "text": "function Datepicker() {\n\t\t\tthis._curInst = null; // The current instance in use\n\t\t\tthis._keyEvent = false; // If the last event was a key event\n\t\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\t\tmonthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], // Names of months for drop-down and formatting\n\t\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\t\tdayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], // Column headings for days starting at Sunday\n\t\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t\t};\n\t\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\t\tdisabled: false // The initial disabled state\n\t\t\t};\n\t\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\t\tthis.regional.en = $.extend(true, {}, this.regional[\"\"]);\n\t\t\tthis.regional[\"en-US\"] = $.extend(true, {}, this.regional.en);\n\t\t\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t\t}", "title": "" }, { "docid": "08a188e353706f129176df102616a6b1", "score": "0.7143962", "text": "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[ \"\" ] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend( this._defaults, this.regional[ \"\" ] );\n\t\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\t\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\t\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n\t}", "title": "" }, { "docid": "ea905084d995837efe3e8680102af0e2", "score": "0.7126374", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[ \"\" ] = { // Default regional settings\n closeText: \"Done\", // Display text for close link\n prevText: \"Prev\", // Display text for previous month link\n nextText: \"Next\", // Display text for next month link\n currentText: \"Today\", // Display text for current month link\n monthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n \"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n monthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n dayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n dayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n dayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n weekHeader: \"Wk\", // Column header for week of the year\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: \"focus\", // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\", // Display text following the input box, e.g. showing the format\n buttonText: \"...\", // Text for trigger button\n buttonImage: \"\", // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: \"fast\", // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: \"\", // Selector for an alternate field to store selected dates into\n altFormat: \"\", // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend( this._defaults, this.regional[ \"\" ] );\n this.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n this.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n this.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n }", "title": "" }, { "docid": "54915d0bf1f5a8154c155c7cfd8eb2c6", "score": "0.7084351", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[\"\"] = {\n closeText: \"Done\",\n prevText: \"Prev\",\n nextText: \"Next\",\n currentText: \"Today\",\n monthNames: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n monthNamesShort: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ],\n dayNames: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ],\n dayNamesShort: [\n \"Sun\",\n \"Mon\",\n \"Tue\",\n \"Wed\",\n \"Thu\",\n \"Fri\",\n \"Sat\"\n ],\n dayNamesMin: [\n \"Su\",\n \"Mo\",\n \"Tu\",\n \"We\",\n \"Th\",\n \"Fr\",\n \"Sa\"\n ],\n weekHeader: \"Wk\",\n dateFormat: \"mm/dd/yy\",\n firstDay: 0,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = {\n showOn: \"focus\",\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\",\n showOptions: {},\n defaultDate: null,\n // +/-number for offset from today, null for today\n appendText: \"\",\n buttonText: \"...\",\n buttonImage: \"\",\n buttonImageOnly: false,\n hideIfNoPrevNext: false,\n // if not applicable, false to just disable them\n navigationAsDateFormat: false,\n gotoCurrent: false,\n changeMonth: false,\n changeYear: false,\n yearRange: \"c-10:c+10\",\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false,\n selectOtherMonths: false,\n showWeek: false,\n calculateWeek: this.iso8601Week,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\",\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null,\n maxDate: null,\n duration: \"fast\",\n beforeShowDay: null,\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null,\n // returns a set of custom settings for the date picker\n onSelect: null,\n onChangeMonthYear: null,\n onClose: null,\n numberOfMonths: 1,\n showCurrentAtPos: 0,\n stepMonths: 1,\n stepBigMonths: 12,\n altField: \"\",\n altFormat: \"\",\n constrainInput: true,\n showButtonPanel: false,\n autoSize: false,\n disabled: false // The initial disabled state\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.regional.en = $.extend(true, {}, this.regional[\"\"]);\n this.regional[\"en-US\"] = $.extend(true, {}, this.regional.en);\n this.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "title": "" }, { "docid": "56f924f9d3162bd5fa329f96fe0806fd", "score": "0.704643", "text": "function Datepicker() {\n this._curInst = null;\n // The current instance in use\n this._keyEvent = false;\n // If the last event was a key event\n this._disabledInputs = [];\n // List of date picker inputs that have been disabled\n this._datepickerShowing = false;\n // True if the popup picker is showing , false if not\n this._inDialog = false;\n // True if showing within a \"dialog\", false if not\n this._mainDivId = 'ui-datepicker-div';\n // The ID of the main datepicker division\n this._inlineClass = 'ui-datepicker-inline';\n // The name of the inline marker class\n this._appendClass = 'ui-datepicker-append';\n // The name of the append marker class\n this._triggerClass = 'ui-datepicker-trigger';\n // The name of the trigger marker class\n this._dialogClass = 'ui-datepicker-dialog';\n // The name of the dialog marker class\n this._disableClass = 'ui-datepicker-disabled';\n // The name of the disabled covering marker class\n this._unselectableClass = 'ui-datepicker-unselectable';\n // The name of the unselectable cell marker class\n this._currentClass = 'ui-datepicker-current-day';\n // The name of the current day marker class\n this._dayOverClass = 'ui-datepicker-days-cell-over';\n // The name of the day hover marker class\n this.regional = [];\n // Available regional settings, indexed by language code\n this.regional[''] = {\n closeText: 'Done',\n prevText: 'Prev',\n nextText: 'Next',\n currentText: 'Today',\n monthNames: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ],\n monthNamesShort: [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec'\n ],\n dayNames: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday'\n ],\n dayNamesShort: [\n 'Sun',\n 'Mon',\n 'Tue',\n 'Wed',\n 'Thu',\n 'Fri',\n 'Sat'\n ],\n dayNamesMin: [\n 'Su',\n 'Mo',\n 'Tu',\n 'We',\n 'Th',\n 'Fr',\n 'Sa'\n ],\n weekHeader: 'Wk',\n dateFormat: 'mm/dd/yy',\n firstDay: 0,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: ''\n };\n this._defaults = {\n showOn: 'focus',\n showAnim: 'fadeIn',\n showOptions: {},\n defaultDate: null,\n appendText: '',\n buttonText: '...',\n buttonImage: '',\n buttonImageOnly: false,\n hideIfNoPrevNext: false,\n navigationAsDateFormat: false,\n gotoCurrent: false,\n changeMonth: false,\n changeYear: false,\n yearRange: 'c-10:c+10',\n showOtherMonths: false,\n selectOtherMonths: false,\n showWeek: false,\n calculateWeek: this.iso8601Week,\n shortYearCutoff: '+10',\n minDate: null,\n maxDate: null,\n duration: 'fast',\n beforeShowDay: null,\n beforeShow: null,\n onSelect: null,\n onChangeMonthYear: null,\n onClose: null,\n numberOfMonths: 1,\n showCurrentAtPos: 0,\n stepMonths: 1,\n stepBigMonths: 12,\n altField: '',\n altFormat: '',\n constrainInput: true,\n showButtonPanel: false,\n autoSize: false,\n disabled: false\n };\n $.extend(this._defaults, this.regional['']);\n this.regional.en = $.extend(true, {}, this.regional['']);\n this.regional['en-US'] = $.extend(true, {}, this.regional.en);\n this.dpDiv = datepicker_bindHover($('<div id=\\'' + this._mainDivId + '\\' class=\\'ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\\'></div>'));\n }", "title": "" }, { "docid": "780c2db8b8dd1d49e0a007e61ed0bfbc", "score": "0.6946614", "text": "function d(){this._curInst=null,// The current instance in use\nthis._keyEvent=!1,// If the last event was a key event\nthis._disabledInputs=[],// List of date picker inputs that have been disabled\nthis._datepickerShowing=!1,// True if the popup picker is showing , false if not\nthis._inDialog=!1,// True if showing within a \"dialog\", false if not\nthis._mainDivId=\"ui-datepicker-div\",// The ID of the main datepicker division\nthis._inlineClass=\"ui-datepicker-inline\",// The name of the inline marker class\nthis._appendClass=\"ui-datepicker-append\",// The name of the append marker class\nthis._triggerClass=\"ui-datepicker-trigger\",// The name of the trigger marker class\nthis._dialogClass=\"ui-datepicker-dialog\",// The name of the dialog marker class\nthis._disableClass=\"ui-datepicker-disabled\",// The name of the disabled covering marker class\nthis._unselectableClass=\"ui-datepicker-unselectable\",// The name of the unselectable cell marker class\nthis._currentClass=\"ui-datepicker-current-day\",// The name of the current day marker class\nthis._dayOverClass=\"ui-datepicker-days-cell-over\",// The name of the day hover marker class\nthis.regional=[],// Available regional settings, indexed by language code\nthis.regional[\"\"]={// Default regional settings\ncloseText:\"Done\",// Display text for close link\nprevText:\"Prev\",// Display text for previous month link\nnextText:\"Next\",// Display text for next month link\ncurrentText:\"Today\",// Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],// Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],// For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],// For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],// For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],// Column headings for days starting at Sunday\nweekHeader:\"Wk\",// Column header for week of the year\ndateFormat:\"mm/dd/yy\",// See format options on parseDate\nfirstDay:0,// The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:!1,// True if right-to-left language, false if left-to-right\nshowMonthAfterYear:!1,// True if the year select precedes month, false for month then year\nyearSuffix:\"\"},this._defaults={// Global defaults for all the date picker instances\nshowOn:\"focus\",// \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\",// Name of jQuery animation for popup\nshowOptions:{},// Options for enhanced animations\ndefaultDate:null,// Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\",// Display text following the input box, e.g. showing the format\nbuttonText:\"...\",// Text for trigger button\nbuttonImage:\"\",// URL for trigger button image\nbuttonImageOnly:!1,// True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:!1,// True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:!1,// True if date formatting applied to prev/today/next links\ngotoCurrent:!1,// True if today link goes back to current selection instead\nchangeMonth:!1,// True if month can be selected directly, false if only prev/next\nchangeYear:!1,// True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\",// Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:!1,// True to show dates in other months, false to leave blank\nselectOtherMonths:!1,// True to allow selection of dates in other months, false for unselectable\nshowWeek:!1,// True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week,// How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\",// Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null,// The earliest selectable date, or null for no limit\nmaxDate:null,// The latest selectable date, or null for no limit\nduration:\"fast\",// Duration of display/closure\nbeforeShowDay:null,// Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null,// Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null,// Define a callback function when a date is selected\nonChangeMonthYear:null,// Define a callback function when the month or year is changed\nonClose:null,// Define a callback function when the datepicker is closed\nnumberOfMonths:1,// Number of months to show at a time\nshowCurrentAtPos:0,// The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1,// Number of months to step back/forward\nstepBigMonths:12,// Number of months to step back/forward for the big links\naltField:\"\",// Selector for an alternate field to store selected dates into\naltFormat:\"\",// The date format to use for the alternate field\nconstrainInput:!0,// The input is constrained by the current date format\nshowButtonPanel:!1,// True to show button panel, false to not show it\nautoSize:!1,// True to size the input for the date format, false to leave as is\ndisabled:!1},a.extend(this._defaults,this.regional[\"\"]),this.regional.en=a.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=a.extend(!0,{},this.regional.en),this.dpDiv=e(a(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "09ce158d02cc7661e6ada51abdfd713e", "score": "0.69167465", "text": "function Datepicker(){this._curInst=null;// The current instance in use\nthis._keyEvent=false;// If the last event was a key event\nthis._disabledInputs=[];// List of date picker inputs that have been disabled\nthis._datepickerShowing=false;// True if the popup picker is showing , false if not\nthis._inDialog=false;// True if showing within a \"dialog\", false if not\nthis._mainDivId=\"ui-datepicker-div\";// The ID of the main datepicker division\nthis._inlineClass=\"ui-datepicker-inline\";// The name of the inline marker class\nthis._appendClass=\"ui-datepicker-append\";// The name of the append marker class\nthis._triggerClass=\"ui-datepicker-trigger\";// The name of the trigger marker class\nthis._dialogClass=\"ui-datepicker-dialog\";// The name of the dialog marker class\nthis._disableClass=\"ui-datepicker-disabled\";// The name of the disabled covering marker class\nthis._unselectableClass=\"ui-datepicker-unselectable\";// The name of the unselectable cell marker class\nthis._currentClass=\"ui-datepicker-current-day\";// The name of the current day marker class\nthis._dayOverClass=\"ui-datepicker-days-cell-over\";// The name of the day hover marker class\nthis.regional=[];// Available regional settings, indexed by language code\nthis.regional[\"\"]={// Default regional settings\ncloseText:\"Done\",// Display text for close link\nprevText:\"Prev\",// Display text for previous month link\nnextText:\"Next\",// Display text for next month link\ncurrentText:\"Today\",// Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],// Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],// For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],// For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],// For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],// Column headings for days starting at Sunday\nweekHeader:\"Wk\",// Column header for week of the year\ndateFormat:\"mm/dd/yy\",// See format options on parseDate\nfirstDay:0,// The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:false,// True if right-to-left language, false if left-to-right\nshowMonthAfterYear:false,// True if the year select precedes month, false for month then year\nyearSuffix:\"\"// Additional text to append to the year in the month headers\n};this._defaults={// Global defaults for all the date picker instances\nshowOn:\"focus\",// \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\",// Name of jQuery animation for popup\nshowOptions:{},// Options for enhanced animations\ndefaultDate:null,// Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\",// Display text following the input box, e.g. showing the format\nbuttonText:\"...\",// Text for trigger button\nbuttonImage:\"\",// URL for trigger button image\nbuttonImageOnly:false,// True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:false,// True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:false,// True if date formatting applied to prev/today/next links\ngotoCurrent:false,// True if today link goes back to current selection instead\nchangeMonth:false,// True if month can be selected directly, false if only prev/next\nchangeYear:false,// True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\",// Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:false,// True to show dates in other months, false to leave blank\nselectOtherMonths:false,// True to allow selection of dates in other months, false for unselectable\nshowWeek:false,// True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week,// How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\",// Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null,// The earliest selectable date, or null for no limit\nmaxDate:null,// The latest selectable date, or null for no limit\nduration:\"fast\",// Duration of display/closure\nbeforeShowDay:null,// Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null,// Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null,// Define a callback function when a date is selected\nonChangeMonthYear:null,// Define a callback function when the month or year is changed\nonClose:null,// Define a callback function when the datepicker is closed\nnumberOfMonths:1,// Number of months to show at a time\nshowCurrentAtPos:0,// The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1,// Number of months to step back/forward\nstepBigMonths:12,// Number of months to step back/forward for the big links\naltField:\"\",// Selector for an alternate field to store selected dates into\naltFormat:\"\",// The date format to use for the alternate field\nconstrainInput:true,// The input is constrained by the current date format\nshowButtonPanel:false,// True to show button panel, false to not show it\nautoSize:false,// True to size the input for the date format, false to leave as is\ndisabled:false// The initial disabled state\n};$.extend(this._defaults,this.regional[\"\"]);this.regional.en=$.extend(true,{},this.regional[\"\"]);this.regional[\"en-US\"]=$.extend(true,{},this.regional.en);this.dpDiv=datepicker_bindHover($(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));}", "title": "" }, { "docid": "ebc0201c6b4afcfd7f5d22fb921f2d2a", "score": "0.6813874", "text": "function Datepicker() {\n this._defaults = {\n pickerClass: '', // CSS class to add to this instance of the datepicker\n showOnFocus: true, // True for popup on focus, false for not\n showTrigger: null, // Element to be cloned for a trigger, null for none\n showAnim: 'show', // Name of jQuery animation for popup, '' for no animation\n showOptions: {}, // Options for enhanced animations\n showSpeed: 'normal', // Duration of display/closure\n popupContainer: null, // The element to which a popup calendar is added, null for body\n alignment: 'bottom', // Alignment of popup - with nominated corner of input:\n // 'top' or 'bottom' aligns depending on language direction,\n // 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'\n fixedWeeks: false, // True to always show 6 weeks, false to only show as many as are needed\n firstDay: 0, // First day of the week, 0 = Sunday, 1 = Monday, ...\n calculateWeek: this.iso8601Week, // Calculate week of the year from a date, null for ISO8601\n monthsToShow: 1, // How many months to show, cols or [rows, cols]\n monthsOffset: 0, // How many months to offset the primary month by;\n // may be a function that takes the date and returns the offset\n monthsToStep: 1, // How many months to move when prev/next clicked\n monthsToJump: 12, // How many months to move when large prev/next clicked\n useMouseWheel: true, // True to use mousewheel if available, false to never use it\n changeMonth: true, // True to change month/year via drop-down, false for navigation only\n yearRange: 'c-10:c+10', // Range of years to show in drop-down: 'any' for direct text entry\n // or 'start:end', where start/end are '+-nn' for relative to today\n // or 'c+-nn' for relative to the currently selected date\n // or 'nnnn' for an absolute year\n shortYearCutoff: '+10', // Cutoff for two-digit year in the current century\n showOtherMonths: false, // True to show dates from other months, false to not show them\n selectOtherMonths: false, // True to allow selection of dates from other months too\n defaultDate: null, // Date to show if no other selected\n selectDefaultDate: false, // True to pre-select the default date if no other is chosen\n minDate: null, // The minimum selectable date\n maxDate: null, // The maximum selectable date\n dateFormat: 'mm/dd/yyyy', // Format for dates\n autoSize: false, // True to size the input field according to the date format\n rangeSelect: false, // Allows for selecting a date range on one date picker\n rangeSeparator: ' - ', // Text between two dates in a range\n multiSelect: 0, // Maximum number of selectable dates, zero for single select\n multiSeparator: ',', // Text between multiple dates\n onDate: null, // Callback as a date is added to the datepicker\n onShow: null, // Callback just before a datepicker is shown\n onChangeMonthYear: null, // Callback when a new month/year is selected\n onSelect: null, // Callback when a date is selected\n onClose: null, // Callback when a datepicker is closed\n altField: null, // Alternate field to update in synch with the datepicker\n altFormat: null, // Date format for alternate field, defaults to dateFormat\n constrainInput: true, // True to constrain typed input to dateFormat allowed characters\n commandsAsDateFormat: false, // True to apply formatDate to the command texts\n commands: this.commands // Command actions that may be added to a layout by name\n };\n this.regional = {\n '': { // US/English\n monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n dateFormat: 'mm/dd/yyyy', // See options on formatDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n renderer: this.defaultRenderer, // The rendering templates\n prevText: '<Prev', // Text for the previous month command\n prevStatus: 'Show the previous month', // Status text for the previous month command\n prevJumpText: '<<', // Text for the previous year command\n prevJumpStatus: 'Show the previous year', // Status text for the previous year command\n nextText: 'Next>', // Text for the next month command\n nextStatus: 'Show the next month', // Status text for the next month command\n nextJumpText: '>>', // Text for the next year command\n nextJumpStatus: 'Show the next year', // Status text for the next year command\n currentText: 'Current', // Text for the current month command\n currentStatus: 'Show the current month', // Status text for the current month command\n todayText: 'Today', // Text for the today's month command\n todayStatus: 'Show today\\'s month', // Status text for the today's month command\n clearText: 'Clear', // Text for the clear command\n clearStatus: 'Clear all the dates', // Status text for the clear command\n closeText: 'Close', // Text for the close command\n closeStatus: 'Close the datepicker', // Status text for the close command\n yearStatus: 'Change the year', // Status text for year selection\n monthStatus: 'Change the month', // Status text for month selection\n weekText: 'Wk', // Text for week of the year column header\n weekStatus: 'Week of the year', // Status text for week of the year column header\n dayStatus: 'Select DD, M d, yyyy', // Status text for selectable days\n defaultStatus: 'Select a date', // Status text shown by default\n isRTL: false // True if language is right-to-left\n }\n };\n $.extend(this._defaults, this.regional['']);\n this._disabled = [];\n }", "title": "" }, { "docid": "8a9e49f02878942ef482e1301891d28c", "score": "0.677015", "text": "function e(){this._curInst=null,// The current instance in use\nthis._keyEvent=!1,// If the last event was a key event\nthis._disabledInputs=[],// List of date picker inputs that have been disabled\nthis._datepickerShowing=!1,// True if the popup picker is showing , false if not\nthis._inDialog=!1,// True if showing within a \"dialog\", false if not\nthis._mainDivId=\"ui-datepicker-div\",// The ID of the main datepicker division\nthis._inlineClass=\"ui-datepicker-inline\",// The name of the inline marker class\nthis._appendClass=\"ui-datepicker-append\",// The name of the append marker class\nthis._triggerClass=\"ui-datepicker-trigger\",// The name of the trigger marker class\nthis._dialogClass=\"ui-datepicker-dialog\",// The name of the dialog marker class\nthis._disableClass=\"ui-datepicker-disabled\",// The name of the disabled covering marker class\nthis._unselectableClass=\"ui-datepicker-unselectable\",// The name of the unselectable cell marker class\nthis._currentClass=\"ui-datepicker-current-day\",// The name of the current day marker class\nthis._dayOverClass=\"ui-datepicker-days-cell-over\",// The name of the day hover marker class\nthis.regional=[],// Available regional settings, indexed by language code\nthis.regional[\"\"]={// Default regional settings\ncloseText:\"Done\",// Display text for close link\nprevText:\"Prev\",// Display text for previous month link\nnextText:\"Next\",// Display text for next month link\ncurrentText:\"Today\",// Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],// Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],// For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],// For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],// For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],// Column headings for days starting at Sunday\nweekHeader:\"Wk\",// Column header for week of the year\ndateFormat:\"mm/dd/yy\",// See format options on parseDate\nfirstDay:0,// The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:!1,// True if right-to-left language, false if left-to-right\nshowMonthAfterYear:!1,// True if the year select precedes month, false for month then year\nyearSuffix:\"\"},this._defaults={// Global defaults for all the date picker instances\nshowOn:\"focus\",// \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\",// Name of jQuery animation for popup\nshowOptions:{},// Options for enhanced animations\ndefaultDate:null,// Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\",// Display text following the input box, e.g. showing the format\nbuttonText:\"...\",// Text for trigger button\nbuttonImage:\"\",// URL for trigger button image\nbuttonImageOnly:!1,// True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:!1,// True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:!1,// True if date formatting applied to prev/today/next links\ngotoCurrent:!1,// True if today link goes back to current selection instead\nchangeMonth:!1,// True if month can be selected directly, false if only prev/next\nchangeYear:!1,// True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\",// Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:!1,// True to show dates in other months, false to leave blank\nselectOtherMonths:!1,// True to allow selection of dates in other months, false for unselectable\nshowWeek:!1,// True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week,// How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\",// Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null,// The earliest selectable date, or null for no limit\nmaxDate:null,// The latest selectable date, or null for no limit\nduration:\"fast\",// Duration of display/closure\nbeforeShowDay:null,// Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null,// Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null,// Define a callback function when a date is selected\nonChangeMonthYear:null,// Define a callback function when the month or year is changed\nonClose:null,// Define a callback function when the datepicker is closed\nnumberOfMonths:1,// Number of months to show at a time\nshowCurrentAtPos:0,// The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1,// Number of months to step back/forward\nstepBigMonths:12,// Number of months to step back/forward for the big links\naltField:\"\",// Selector for an alternate field to store selected dates into\naltFormat:\"\",// The date format to use for the alternate field\nconstrainInput:!0,// The input is constrained by the current date format\nshowButtonPanel:!1,// True to show button panel, false to not show it\nautoSize:!1,// True to size the input for the date format, false to leave as is\ndisabled:!1},a.extend(this._defaults,this.regional[\"\"]),this.regional.en=a.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=a.extend(!0,{},this.regional.en),this.dpDiv=f(a(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "4f3791a10981d23e0013708ff2abfb8c", "score": "0.66845137", "text": "function Datepicker() {\n\tthis._defaults = {\n\t\tpickerClass: '', // CSS class to add to this instance of the datepicker\n\t\tshowOnFocus: true, // True for popup on focus, false for not\n\t\tshowTrigger: null, // Element to be cloned for a trigger, null for none\n\t\tshowAnim: 'show', // Name of jQuery animation for popup, '' for no animation\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tshowSpeed: 'normal', // Duration of display/closure\n\t\tpopupContainer: null, // The element to which a popup calendar is added, null for body\n\t\talignment: 'bottom', // Alignment of popup - with nominated corner of input:\n\t\t\t// 'top' or 'bottom' aligns depending on language direction,\n\t\t\t// 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'\n\t\tfixedWeeks: false, // True to always show 6 weeks, false to only show as many as are needed\n\t\tfirstDay: 0, // First day of the week, 0 = Sunday, 1 = Monday, ...\n\t\tcalculateWeek: this.iso8601Week, // Calculate week of the year from a date, null for ISO8601\n\t\tmonthsToShow: 1, // How many months to show, cols or [rows, cols]\n\t\tmonthsOffset: 0, // How many months to offset the primary month by\n\t\tmonthsToStep: 1, // How many months to move when prev/next clicked\n\t\tmonthsToJump: 12, // How many months to move when large prev/next clicked\n\t\tuseMouseWheel: true, // True to use mousewheel if available, false to never use it\n\t\tchangeMonth: true, // True to change month/year via drop-down, false for navigation only\n\t\tyearRange: 'c-10:c+10', // Range of years to show in drop-down: 'any' for direct text entry\n\t\t\t// or 'start:end', where start/end are '+-nn' for relative to today\n\t\t\t// or 'c+-nn' for relative to the currently selected date\n\t\t\t// or 'nnnn' for an absolute year\n\t\tshortYearCutoff: '+10', // Cutoff for two-digit year in the current century\n\t\tshowOtherMonths: false, // True to show dates from other months, false to not show them\n\t\tselectOtherMonths: false, // True to allow selection of dates from other months too\n\t\tdefaultDate: null, // Date to show if no other selected\n\t\tselectDefaultDate: false, // True to pre-select the default date if no other is chosen\n\t\tminDate: null, // The minimum selectable date\n\t\tmaxDate: null, // The maximum selectable date\n\t\tdateFormat: 'mm/dd/yyyy', // Format for dates\n\t\tautoSize: false, // True to size the input field according to the date format\n\t\trangeSelect: false, // Allows for selecting a date range on one date picker\n\t\trangeSeparator: ' - ', // Text between two dates in a range\n\t\tmultiSelect: 0, // Maximum number of selectable dates, zero for single select\n\t\tmultiSeparator: ',', // Text between multiple dates\n\t\tonDate: null, // Callback as a date is added to the datepicker\n\t\tonShow: null, // Callback just before a datepicker is shown\n\t\tonChangeMonthYear: null, // Callback when a new month/year is selected\n\t\tonSelect: null, // Callback when a date is selected\n\t\tonClose: null, // Callback when a datepicker is closed\n\t\taltField: null, // Alternate field to update in synch with the datepicker\n\t\taltFormat: null, // Date format for alternate field, defaults to dateFormat\n\t\tconstrainInput: true, // True to constrain typed input to dateFormat allowed characters\n\t\tcommandsAsDateFormat: false, // True to apply formatDate to the command texts\n\t\tcommands: this.commands // Command actions that may be added to a layout by name\n\t};\n\tthis.regional = {\n\t\t'': { // US/English\n\t\t\tmonthNames: ['January', 'February', 'March', 'April', 'May', 'June',\n\t\t\t'July', 'August', 'September', 'October', 'November', 'December'],\n\t\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n\t\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n\t\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\t\t\tdayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n\t\t\tdateFormat: 'mm/dd/yyyy', // See options on formatDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\trenderer: this.defaultRenderer, // The rendering templates\n\t\t\tprevText: '&lt;Prev', // Text for the previous month command\n\t\t\tprevStatus: 'Show the previous month', // Status text for the previous month command\n\t\t\tprevJumpText: '&lt;&lt;', // Text for the previous year command\n\t\t\tprevJumpStatus: 'Show the previous year', // Status text for the previous year command\n\t\t\tnextText: 'Next&gt;', // Text for the next month command\n\t\t\tnextStatus: 'Show the next month', // Status text for the next month command\n\t\t\tnextJumpText: '&gt;&gt;', // Text for the next year command\n\t\t\tnextJumpStatus: 'Show the next year', // Status text for the next year command\n\t\t\tcurrentText: 'Current', // Text for the current month command\n\t\t\tcurrentStatus: 'Show the current month', // Status text for the current month command\n\t\t\ttodayText: 'Today', // Text for the today's month command\n\t\t\ttodayStatus: 'Show today\\'s month', // Status text for the today's month command\n\t\t\tclearText: 'Clear', // Text for the clear command\n\t\t\tclearStatus: 'Clear all the dates', // Status text for the clear command\n\t\t\tcloseText: 'Close', // Text for the close command\n\t\t\tcloseStatus: 'Close the datepicker', // Status text for the close command\n\t\t\tyearStatus: 'Change the year', // Status text for year selection\n\t\t\tmonthStatus: 'Change the month', // Status text for month selection\n\t\t\tweekText: 'Wk', // Text for week of the year column header\n\t\t\tweekStatus: 'Week of the year', // Status text for week of the year column header\n\t\t\tdayStatus: 'Select DD, M d, yyyy', // Status text for selectable days\n\t\t\tdefaultStatus: 'Select a date', // Status text shown by default\n\t\t\tisRTL: false // True if language is right-to-left\n\t\t}};\n\t$.extend(this._defaults, this.regional['']);\n\tthis._disabled = [];\n}", "title": "" }, { "docid": "b31c529b54c54503cd1bb2a0646224fb", "score": "0.6591659", "text": "function DatePicker(picker, settings) {\n\n var calendar = this,\n element = picker.$node[0],\n elementValue = element.value,\n elementDataValue = picker.$node.data('value'),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function () {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle(picker.$root[0]).direction == 'rtl';\n };\n\n calendar.settings = settings;\n calendar.$node = picker.$node;\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n\n // The component's item object.\n };calendar.item = {};\n\n calendar.item.clear = null;\n calendar.item.disable = (settings.disable || []).slice(0);\n calendar.item.enable = -function (collectionDisabled) {\n return collectionDisabled[0] === true ? collectionDisabled.shift() : -1;\n }(calendar.item.disable);\n\n calendar.set('min', settings.min).set('max', settings.max).set('now');\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if (valueString) {\n calendar.set('select', valueString, { format: formatString });\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.set('select', null).set('highlight', calendar.item.now);\n }\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function () {\n return isRTL() ? -1 : 1;\n }, // Right\n 37: function () {\n return isRTL() ? 1 : -1;\n }, // Left\n go: function (timeChange) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date(highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange);\n calendar.set('highlight', targetDate, { interval: timeChange });\n this.render();\n }\n\n // Bind some picker events.\n };picker.on('render', function () {\n picker.$root.find('.' + settings.klass.selectMonth).on('change', function () {\n var value = this.value;\n if (value) {\n picker.set('highlight', [picker.get('view').year, value, picker.get('highlight').date]);\n picker.$root.find('.' + settings.klass.selectMonth).trigger('focus');\n }\n });\n picker.$root.find('.' + settings.klass.selectYear).on('change', function () {\n var value = this.value;\n if (value) {\n picker.set('highlight', [value, picker.get('view').month, picker.get('highlight').date]);\n picker.$root.find('.' + settings.klass.selectYear).trigger('focus');\n }\n });\n }, 1).on('open', function () {\n var includeToday = '';\n if (calendar.disabled(calendar.get('now'))) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')';\n }\n picker.$root.find('button' + includeToday + ', select').attr('disabled', false);\n }, 1).on('close', function () {\n picker.$root.find('button, select').attr('disabled', true);\n }, 1);\n }", "title": "" }, { "docid": "b31c529b54c54503cd1bb2a0646224fb", "score": "0.6591659", "text": "function DatePicker(picker, settings) {\n\n var calendar = this,\n element = picker.$node[0],\n elementValue = element.value,\n elementDataValue = picker.$node.data('value'),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function () {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle(picker.$root[0]).direction == 'rtl';\n };\n\n calendar.settings = settings;\n calendar.$node = picker.$node;\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n\n // The component's item object.\n };calendar.item = {};\n\n calendar.item.clear = null;\n calendar.item.disable = (settings.disable || []).slice(0);\n calendar.item.enable = -function (collectionDisabled) {\n return collectionDisabled[0] === true ? collectionDisabled.shift() : -1;\n }(calendar.item.disable);\n\n calendar.set('min', settings.min).set('max', settings.max).set('now');\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if (valueString) {\n calendar.set('select', valueString, { format: formatString });\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.set('select', null).set('highlight', calendar.item.now);\n }\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function () {\n return isRTL() ? -1 : 1;\n }, // Right\n 37: function () {\n return isRTL() ? 1 : -1;\n }, // Left\n go: function (timeChange) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date(highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange);\n calendar.set('highlight', targetDate, { interval: timeChange });\n this.render();\n }\n\n // Bind some picker events.\n };picker.on('render', function () {\n picker.$root.find('.' + settings.klass.selectMonth).on('change', function () {\n var value = this.value;\n if (value) {\n picker.set('highlight', [picker.get('view').year, value, picker.get('highlight').date]);\n picker.$root.find('.' + settings.klass.selectMonth).trigger('focus');\n }\n });\n picker.$root.find('.' + settings.klass.selectYear).on('change', function () {\n var value = this.value;\n if (value) {\n picker.set('highlight', [value, picker.get('view').month, picker.get('highlight').date]);\n picker.$root.find('.' + settings.klass.selectYear).trigger('focus');\n }\n });\n }, 1).on('open', function () {\n var includeToday = '';\n if (calendar.disabled(calendar.get('now'))) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')';\n }\n picker.$root.find('button' + includeToday + ', select').attr('disabled', false);\n }, 1).on('close', function () {\n picker.$root.find('button, select').attr('disabled', true);\n }, 1);\n }", "title": "" }, { "docid": "8e82c9c2b0b12a929fcf6c6396eed2f0", "score": "0.65653014", "text": "function DatePicker( picker, settings ) {\n\n var calendar = this,\n element = picker.$node[ 0 ],\n elementValue = element.value,\n elementDataValue = picker.$node.data( 'value' ),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function() {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle( picker.$root[0] ).direction == 'rtl'\n }\n\n calendar.settings = settings\n calendar.$node = picker.$node\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n }\n\n // The component's item object.\n calendar.item = {}\n\n calendar.item.clear = null\n calendar.item.disable = ( settings.disable || [] ).slice( 0 )\n calendar.item.enable = -(function( collectionDisabled ) {\n return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1\n })( calendar.item.disable )\n\n calendar.\n set( 'min', settings.min ).\n set( 'max', settings.max ).\n set( 'now' )\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if ( valueString ) {\n calendar.set( 'select', valueString, { format: formatString })\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.\n set( 'select', null ).\n set( 'highlight', calendar.item.now )\n }\n\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function() { return isRTL() ? -1 : 1 }, // Right\n 37: function() { return isRTL() ? 1 : -1 }, // Left\n go: function( timeChange ) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )\n calendar.set(\n 'highlight',\n targetDate,\n { interval: timeChange }\n )\n this.render()\n }\n }\n\n\n // Bind some picker events.\n picker.\n on( 'render', function() {\n picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )\n }\n })\n picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )\n }\n })\n }, 1 ).\n on( 'open', function() {\n var includeToday = ''\n if ( calendar.disabled( calendar.get('now') ) ) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')'\n }\n picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )\n }, 1 ).\n on( 'close', function() {\n picker.$root.find( 'button, select' ).attr( 'disabled', true )\n }, 1 )\n\n}", "title": "" }, { "docid": "8e82c9c2b0b12a929fcf6c6396eed2f0", "score": "0.65653014", "text": "function DatePicker( picker, settings ) {\n\n var calendar = this,\n element = picker.$node[ 0 ],\n elementValue = element.value,\n elementDataValue = picker.$node.data( 'value' ),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function() {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle( picker.$root[0] ).direction == 'rtl'\n }\n\n calendar.settings = settings\n calendar.$node = picker.$node\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n }\n\n // The component's item object.\n calendar.item = {}\n\n calendar.item.clear = null\n calendar.item.disable = ( settings.disable || [] ).slice( 0 )\n calendar.item.enable = -(function( collectionDisabled ) {\n return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1\n })( calendar.item.disable )\n\n calendar.\n set( 'min', settings.min ).\n set( 'max', settings.max ).\n set( 'now' )\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if ( valueString ) {\n calendar.set( 'select', valueString, { format: formatString })\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.\n set( 'select', null ).\n set( 'highlight', calendar.item.now )\n }\n\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function() { return isRTL() ? -1 : 1 }, // Right\n 37: function() { return isRTL() ? 1 : -1 }, // Left\n go: function( timeChange ) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )\n calendar.set(\n 'highlight',\n targetDate,\n { interval: timeChange }\n )\n this.render()\n }\n }\n\n\n // Bind some picker events.\n picker.\n on( 'render', function() {\n picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )\n }\n })\n picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )\n }\n })\n }, 1 ).\n on( 'open', function() {\n var includeToday = ''\n if ( calendar.disabled( calendar.get('now') ) ) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')'\n }\n picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )\n }, 1 ).\n on( 'close', function() {\n picker.$root.find( 'button, select' ).attr( 'disabled', true )\n }, 1 )\n\n}", "title": "" }, { "docid": "8e82c9c2b0b12a929fcf6c6396eed2f0", "score": "0.65653014", "text": "function DatePicker( picker, settings ) {\n\n var calendar = this,\n element = picker.$node[ 0 ],\n elementValue = element.value,\n elementDataValue = picker.$node.data( 'value' ),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function() {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle( picker.$root[0] ).direction == 'rtl'\n }\n\n calendar.settings = settings\n calendar.$node = picker.$node\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n }\n\n // The component's item object.\n calendar.item = {}\n\n calendar.item.clear = null\n calendar.item.disable = ( settings.disable || [] ).slice( 0 )\n calendar.item.enable = -(function( collectionDisabled ) {\n return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1\n })( calendar.item.disable )\n\n calendar.\n set( 'min', settings.min ).\n set( 'max', settings.max ).\n set( 'now' )\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if ( valueString ) {\n calendar.set( 'select', valueString, { format: formatString })\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.\n set( 'select', null ).\n set( 'highlight', calendar.item.now )\n }\n\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function() { return isRTL() ? -1 : 1 }, // Right\n 37: function() { return isRTL() ? 1 : -1 }, // Left\n go: function( timeChange ) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )\n calendar.set(\n 'highlight',\n targetDate,\n { interval: timeChange }\n )\n this.render()\n }\n }\n\n\n // Bind some picker events.\n picker.\n on( 'render', function() {\n picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )\n }\n })\n picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )\n }\n })\n }, 1 ).\n on( 'open', function() {\n var includeToday = ''\n if ( calendar.disabled( calendar.get('now') ) ) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')'\n }\n picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )\n }, 1 ).\n on( 'close', function() {\n picker.$root.find( 'button, select' ).attr( 'disabled', true )\n }, 1 )\n\n}", "title": "" }, { "docid": "8e82c9c2b0b12a929fcf6c6396eed2f0", "score": "0.65653014", "text": "function DatePicker( picker, settings ) {\n\n var calendar = this,\n element = picker.$node[ 0 ],\n elementValue = element.value,\n elementDataValue = picker.$node.data( 'value' ),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function() {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle( picker.$root[0] ).direction == 'rtl'\n }\n\n calendar.settings = settings\n calendar.$node = picker.$node\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n }\n\n // The component's item object.\n calendar.item = {}\n\n calendar.item.clear = null\n calendar.item.disable = ( settings.disable || [] ).slice( 0 )\n calendar.item.enable = -(function( collectionDisabled ) {\n return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1\n })( calendar.item.disable )\n\n calendar.\n set( 'min', settings.min ).\n set( 'max', settings.max ).\n set( 'now' )\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if ( valueString ) {\n calendar.set( 'select', valueString, { format: formatString })\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.\n set( 'select', null ).\n set( 'highlight', calendar.item.now )\n }\n\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function() { return isRTL() ? -1 : 1 }, // Right\n 37: function() { return isRTL() ? 1 : -1 }, // Left\n go: function( timeChange ) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )\n calendar.set(\n 'highlight',\n targetDate,\n { interval: timeChange }\n )\n this.render()\n }\n }\n\n\n // Bind some picker events.\n picker.\n on( 'render', function() {\n picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )\n }\n })\n picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )\n }\n })\n }, 1 ).\n on( 'open', function() {\n var includeToday = ''\n if ( calendar.disabled( calendar.get('now') ) ) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')'\n }\n picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )\n }, 1 ).\n on( 'close', function() {\n picker.$root.find( 'button, select' ).attr( 'disabled', true )\n }, 1 )\n\n}", "title": "" }, { "docid": "8e82c9c2b0b12a929fcf6c6396eed2f0", "score": "0.65653014", "text": "function DatePicker( picker, settings ) {\n\n var calendar = this,\n element = picker.$node[ 0 ],\n elementValue = element.value,\n elementDataValue = picker.$node.data( 'value' ),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function() {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle( picker.$root[0] ).direction == 'rtl'\n }\n\n calendar.settings = settings\n calendar.$node = picker.$node\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n }\n\n // The component's item object.\n calendar.item = {}\n\n calendar.item.clear = null\n calendar.item.disable = ( settings.disable || [] ).slice( 0 )\n calendar.item.enable = -(function( collectionDisabled ) {\n return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1\n })( calendar.item.disable )\n\n calendar.\n set( 'min', settings.min ).\n set( 'max', settings.max ).\n set( 'now' )\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if ( valueString ) {\n calendar.set( 'select', valueString, { format: formatString })\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.\n set( 'select', null ).\n set( 'highlight', calendar.item.now )\n }\n\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function() { return isRTL() ? -1 : 1 }, // Right\n 37: function() { return isRTL() ? 1 : -1 }, // Left\n go: function( timeChange ) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )\n calendar.set(\n 'highlight',\n targetDate,\n { interval: timeChange }\n )\n this.render()\n }\n }\n\n\n // Bind some picker events.\n picker.\n on( 'render', function() {\n picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )\n }\n })\n picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )\n }\n })\n }, 1 ).\n on( 'open', function() {\n var includeToday = ''\n if ( calendar.disabled( calendar.get('now') ) ) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')'\n }\n picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )\n }, 1 ).\n on( 'close', function() {\n picker.$root.find( 'button, select' ).attr( 'disabled', true )\n }, 1 )\n\n}", "title": "" } ]
28d56e4274e730461cccacf081f60615
any classes will be as attribute of container for every title
[ { "docid": "3dc1116c450029d0a77ef4a8b4868af4", "score": "0.0", "text": "tpl(data) {\n return '<span class=\"cyCompartmentLumen\" >' + data.name + '</span>'; // your html template here \n }", "title": "" } ]
[ { "docid": "924a2d12b04252d9d8c635a250603026", "score": "0.6411159", "text": "addSpecialClasses() {\n this._containerMain.querySelector(this._menuItemSelector).classList.add(this._switchClass);\n this._containerMain.querySelector(this._titleSelector).classList.add(this._redTitleClass);\n }", "title": "" }, { "docid": "b92b9412dd0043cacf502539bc3d81d4", "score": "0.62696636", "text": "function iterateBuild (title, className) {\n for (let i = -1; i < 7; i++) {\n const itemBox = document.createElement('div');\n const itemPara = document.createElement('p');\n itemBox.classList.add(`${className}`);\n itemPara.setAttribute('id',`${className}-${i}`); \n itemBox.appendChild(itemPara);\n forecastGrid.appendChild(itemBox);\n };\n document.getElementById(`${className}--1`).innerText = `${title}`; //Make the first box (-1) the Title\n }", "title": "" }, { "docid": "6447703659484dc9b2ae711e7797aaa9", "score": "0.60273737", "text": "setMainTitleBox() {\n\n const box = document.createElement('div');\n box.className = 'accordion-container__main-title';\n\n const title = document.createElement('span');\n title.innerText = this.mainTitle;\n title.className = 'title';\n\n box.appendChild(title);\n document.getElementById(this.container).appendChild(box);\n }", "title": "" }, { "docid": "a3e6badc303a74c1ec743958b0830cf8", "score": "0.6020099", "text": "function requestTitle() {\n console.log('Appel de la function pour afficher les titres');\n var titleContainer = catalogueTitle.children('h3');\n console.log(titleContainer);\n for(var i= 0; i < categories.length; i++ ){\n var categorie = categories[i];\n titleContainer.eq(i).text(categorie);\n }\n}", "title": "" }, { "docid": "563a97d13eaeb38f120bf1c757da17e7", "score": "0.6016902", "text": "getclassname() {\n return \"Container\";\n }", "title": "" }, { "docid": "563a97d13eaeb38f120bf1c757da17e7", "score": "0.6016902", "text": "getclassname() {\n return \"Container\";\n }", "title": "" }, { "docid": "3743452c24856ce9a9c8253a3e350932", "score": "0.5999829", "text": "function createItemContainerTitle(title) {\n var itemContainerTitle = document.createElement(\"span\");\n itemContainerTitle.innerHTML = title;\n itemContainerTitle.classList.add(\"record-title\");\n return itemContainerTitle;\n }", "title": "" }, { "docid": "edffb2788b73f55832161ba30813961a", "score": "0.5884204", "text": "function renderTitles() {\n currentTitle = 0;\n\n slideShowObject[currentCategory].titles.forEach(function (title) {\n var elem = titleTemplate.replace(':title:', title);\n\n var $elem = $(elem);\n $titlesList.append($elem);\n });\n }", "title": "" }, { "docid": "2e1860e436847bf6e152be632673d08e", "score": "0.58445853", "text": "function titleLoadLine(){\n\n if($('.title-page').length){\n $('.title-page').addClass('active');\n }\n\n }", "title": "" }, { "docid": "7e81f9427b3309713e96af91fced23c1", "score": "0.5813088", "text": "getTitleStyles() {\n return {\n color:'black',\n opacity:'0.35',\n fontSize:'40px',\n textAlign:'center',\n fontFamily:'Marmelad',\n }\n }", "title": "" }, { "docid": "9f36c2333e2422f698ade06d20f52875", "score": "0.5802006", "text": "static getclassname() {\n return \"Container\";\n }", "title": "" }, { "docid": "71326294f775296c39f4f6095eceb055", "score": "0.57501805", "text": "function getClassNames(classes) {\n $.each(classes, function () {\n var tipClass = /^Tip\\-(.+)/.exec(this);\n var uiClass = /^ui\\-(.+)/.exec(this);\n addTourClass(tipClass);\n addTourClass(uiClass);\n });\n }", "title": "" }, { "docid": "1a809185ebf525933069dece4bbaf1e6", "score": "0.5726205", "text": "function makeSpecialTitlesBigger() {\n let specialItems = document.getElementsByClassName('special-title');\n for (let i = 0; i < specialItems.length; i++) {\n specialItems[i].style.fontSize = '2rem';\n }\n }", "title": "" }, { "docid": "9501e75475f277f92a7f29facc2b570d", "score": "0.5720391", "text": "setClassOnContainer() {\n document.getElementById(this.container).className = 'accordion-container';\n }", "title": "" }, { "docid": "fca794d73548405be9f15b0bbf7a8e03", "score": "0.56869704", "text": "function collect() {\n\t\tvar title, oldDuration, style;\n\n\t\tforEach(element, function (child) {\n\t\t\tif (child.classList.contains('title')) {\n\t\t\t\ttitle = child;\n\t\t\t\ttitle._accordionInit = false;\n\t\t\t\ttitles.push(title);\n\t\t\t} else if (child.classList.contains('content')) {\n\t\t\t\tif (title) {\n\t\t\t\t\ttitle._accordionContent = child;\n\t\t\t\t\tif (!child.classList.contains('active')) {\n\t\t\t\t\t\tstyle = getComputedStyle(child);\n\t\t\t\t\t\tchild.classList.add('noanim');\n\t\t\t\t\t\tchild.style.height = 0;\n\t\t\t\t\t\tchild.classList.remove('noanim');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "37b3fd6183883ed4ae5f1d3a514b92be", "score": "0.56392133", "text": "function titleizeClass(className) {\n return className.split('-').map(function(s) {\n return s[0].toUpperCase() + s.slice(1);\n }).join('');\n}", "title": "" }, { "docid": "24f091b28e78dcca9ea3f45dbec18f6f", "score": "0.5620801", "text": "getClasses() {\n return this.html.className;\n }", "title": "" }, { "docid": "c8accbd293999594f95393393b4c0fb8", "score": "0.5576261", "text": "show() {\n this.global_title.classList.remove('out-left');\n this.continent_title.classList.add('out-right');\n }", "title": "" }, { "docid": "428d6660bacb4d9ef4ee404c66f89bab", "score": "0.557372", "text": "function Classes() {\n return (\n <div>\n <Head>\n <title>Classes | Grandis Library</title>\n </Head>\n <HeaderImage imageUrl={HeaderImageUrl.verdel}/>\n <div>\n <Page.Title>Classes</Page.Title>\n <Page.Subtitle>Explorers</Page.Subtitle>\n <ClassGroupContainer classes={classes.explorers} classGroup=\"explorers\"/>\n <Page.Subtitle>Cygnus Knights</Page.Subtitle>\n <ClassGroupContainer classes={classes.cygnusKnights} classGroup=\"cygnus-knights\"/>\n <Page.Subtitle>Heroes</Page.Subtitle>\n <ClassGroupContainer classes={classes.heroes} classGroup=\"heroes\"/>\n <Page.Subtitle>Resistance</Page.Subtitle>\n <ClassGroupContainer classes={classes.resistance} classGroup=\"resistance\"/>\n <Page.Subtitle>Nova</Page.Subtitle>\n <ClassGroupContainer classes={classes.nova} classGroup=\"nova\"/>\n <Page.Subtitle>Sengoku</Page.Subtitle>\n <ClassGroupContainer classes={classes.sengoku} classGroup=\"sengoku\"/>\n <Page.Subtitle>Flora</Page.Subtitle>\n <ClassGroupContainer classes={classes.flora} classGroup=\"flora\"/>\n <Page.Subtitle>Other</Page.Subtitle>\n <Page.Caption>Classes here only share Cash Shop Inventories with their own class - they do not share with each other</Page.Caption>\n <ClassGroupContainer classes={classes.other} classGroup=\"other\"/>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "1941feb226da232475af02948be3fa3a", "score": "0.55729175", "text": "buildTitleTopBar() {\n let titleTopBar = document.querySelector('.title-top')\n if (titleTopBar) {\n titleTopBar.remove();\n }\n titleTopBar = document.createElement('div');\n titleTopBar.classList.add('title-top');\n const divTitle = document.createElement('div');\n const title = \"Assemblage\";\n divTitle.innerHTML = title.toUpperCase();\n divTitle.classList.add(\"title-font\");\n const divBoxName = document.createElement('div');\n divBoxName.innerHTML = \"Box Name : \";\n divBoxName.id = 'box-name';\n const divGlobalProgress = document.createElement('div');\n divGlobalProgress.id = \"global-progress\";\n titleTopBar.append(divBoxName, divTitle, divGlobalProgress)\n document.querySelector('.module').appendChild(titleTopBar);\n }", "title": "" }, { "docid": "f56d015f42117f430c8805df22746952", "score": "0.5549379", "text": "function catAnotherTitleHandler(event) {\n var bottomHeight = document.getElementsByClassName('last-content-head')[0];\n if (bottomHeight !== undefined) {\n bottomHeight.className = '';\n }\n event.target.className = 'last-content-head';\n}", "title": "" }, { "docid": "f8ed9b7be0a0e1c83802b226dd456de1", "score": "0.5539983", "text": "function slideText() {\r\n\t/* if you do all don't need to array*/\r\n\tcontainers.forEach(function(container) {\r\n\t\tcontainer.classList.toggle(\"active\")\r\n\t});\r\n}", "title": "" }, { "docid": "106837d18858742ba46bd8f95c1794e1", "score": "0.5534984", "text": "function createTitleElement() {\n var rowEl = document.createElement(\"div\");\n rowEl.setAttribute(\"class\", \"row\");\n rowEl.style.fontWeight = \"bold\";\n\n var colEl = document.createElement(\"div\");\n colEl.setAttribute(\"class\", \"col-sm\");\n instructionEl.appendChild(rowEl);\n}", "title": "" }, { "docid": "2a43c94676ee110c2eb90b89401a2b27", "score": "0.55335283", "text": "function makeContainers(){\n const mainContent = grabElement(\"main\");\n const familyContainer = makeElement(\"div\");\n familyContainer.setAttribute(\"class\", \"family-container\");\n const titleContainer = makeElement(\"div\");\n titleContainer.setAttribute(\"class\", \"title-container\");\n const quarterInfo = makeElement(\"div\");\n quarterInfo.setAttribute(\"class\", \"quarter-info\");\n mainContent.appendChild(quarterInfo);\n mainContent.insertBefore(familyContainer, quarterInfo);\n mainContent.insertBefore(titleContainer, familyContainer);\n}", "title": "" }, { "docid": "dafd59bfcc998ed930d62ec27708539d", "score": "0.55222756", "text": "function juggleTitles()\n {\n if(contents.children.length)\n {\n title.style.opacity = 0.0;\n smallTitle.style.opacity = 1.0;\n }\n else\n {\n title.style.opacity = 1.0;\n smallTitle.style.opacity = 0.0;\n }\n }", "title": "" }, { "docid": "81857459ec38ecb9130cd97cb5414fb9", "score": "0.5521781", "text": "function accordionInit() {\n Array.prototype.forEach.call(this.element.children, e => {\n e.classList.add('block');\n e.children[0].classList.add('title');\n e.children[1].classList.add('content');\n });\n}", "title": "" }, { "docid": "d6f0c3e47ebf63228b3cdbdc5840b836", "score": "0.5505822", "text": "function addClassToMany(container, item, cls, sym){\n container.innerHTML = \n\t`<${item} class=\"${cls}\"> ${sym} </${item}>\n\t <${item} class=\"${cls}\"> ${sym} </${item}>\n\t <${item} class=\"${cls}\"> ${sym} </${item}>`;\n}", "title": "" }, { "docid": "693f0de7b11c32d3485538b1f145e323", "score": "0.54999894", "text": "function asTitle(value){return value instanceof Title?value:new Title(value);}", "title": "" }, { "docid": "69c68580bf09b6b279f39a54b33bd9ef", "score": "0.54978657", "text": "function displayTitle() {\n\t\t$(\"[data-nbnav]\").each(function(){\n\t\t\tif ($(this).attr(\"data-nbnav\") == $(\"#rail img:first\").attr(\"data-nb\")){\n\t\t\t\t$(this).removeClass(\"fa-circle-o\");\n\t\t\t\t$(this).addClass(\"fa-circle\");\n\t\t\t}else{\n\t\t\t\t$(this).removeClass(\"fa-circle\");\n\t\t\t\t$(this).addClass(\"fa-circle-o\");\n\t\t\t}\n\t\t});\n\t\t$('.title').text($(\"#rail img:first\").attr(\"data-title\"));\n\t\t$('.desc').text($(\"#rail img:first\").attr(\"data-desc\"));\n\t\t\n\t\t$('.info').animate({\n\t\t\tmarginTop: \"-=150\"\n\t\t}, \"fast\", function() {\n\t\t\t$('.info').css({\n\t\t\t\ttextShadow: \"3px 2px rgba(0,0,0,0.5)\"\n\t\t\t});\n\t\t\t$('.navigator').css({\n\t\t\t\tdisplay: \"block\"\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "5acbc51031becb2afbff353c8020e515", "score": "0.5489423", "text": "function createTitle()\n {\n var self = this;\n \n // Destroy previous title element, if present\n if(self.elements.title !== null) self.elements.title.remove();\n \n // Create title element\n self.elements.title = $(document.createElement('div'))\n .addClass(self.options.style.classes.title)\n .css( jQueryStyle(self.options.style.title, true) )\n .html(self.options.content.title.text)\n .prependTo(self.elements.contentWrapper);\n \n // Create title close buttons if enabled\n if(self.options.content.title.button !== false\n && typeof self.options.content.title.button == 'string')\n {\n var button = $(document.createElement('a'))\n .attr('href', '#')\n .css({ 'float': 'right', position: 'relative' })\n .addClass(self.options.style.classes.button)\n .html(self.options.content.title.button)\n .prependTo(self.elements.title)\n .click(self.hide);\n }\n }", "title": "" }, { "docid": "9c8c9366030060ceda2db0661e43a953", "score": "0.5485052", "text": "function displayContentTitle(contentList, item){ \n $( \".navTitle\" ).remove();\n $content.append('<div class = navTitle >' + '<p>' + item + '</p>');\n \tfor (var i = 0; i < contentList.items.length; i++) {\n if(contentList.items[i].navigation.indexOf(item)>-1 && contentList.items[i].navigation != \"home\"){\n \t\tvar $container = $('<div class = ' + '\"'+ contentList.items[i].navigation + '\"'+ '>' + '<p id=' + \"headerContent\" +'>' + contentList.items[i].topic + '</p>'+'<p>'+ contentList.items[i].displayText1+'</p>' + '<p>'+ contentList.items[i].displayText2 + '</p>'+'</div>');\n $content.append($container);\n } \n }\n}", "title": "" }, { "docid": "7a864ef9f04850ea9532817e5bc5bdb8", "score": "0.54787487", "text": "function loadTitleText() {\n var textArray = document.getElementsByClassName('Img_Text');\n for (let i=0; i < ImgList.length; i++) {\n textArray[i].innerHTML = ImgList[i].getAttribute('data-title');\n console.log(ImgList[i].getAttribute('data-title'));\n /* ThumbList[i].innerHTML = ImgList[i].getAttribute('data-title'); Loads title to thumbnails in portfolio */\n }\n}", "title": "" }, { "docid": "23ef7b23bb50e1747152154ca761ed11", "score": "0.5474996", "text": "function classNames(){for(var arg,classes=\"\",i=0;i<arguments.length;i++)if(arg=arguments[i])if(\"string\"==typeof arg||\"number\"==typeof arg)classes+=\" \"+arg;else if(\"[object Array]\"===Object.prototype.toString.call(arg))classes+=\" \"+classNames.apply(null,arg);else if(\"object\"==typeof arg)for(var key in arg)arg.hasOwnProperty(key)&&arg[key]&&(classes+=\" \"+key);return classes.substr(1)}", "title": "" }, { "docid": "1bd9cc67640a9fd71dc5ac0a565574e7", "score": "0.5468502", "text": "function renderTitle(data) {\n var titleContent = \"\";\n for(i = 0; i < data.length; i++){\n titleContent += `<li class=\"infos\" data-imageref=\"${data[i].Image}\" id=\"${data[i].ID}\">${data[i].Name}</li>`;\n }\n return titleContent;\n }", "title": "" }, { "docid": "5954580ca0587605e3bf82651d58e9ff", "score": "0.54624295", "text": "function TitleBackground() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "dacdb75f6d0c4b666f096eb53c4c7e57", "score": "0.54597455", "text": "function nameItems(){\n items = frame.children('div');\n num_elements = items.size();\n items.each(function(i){\n var elem = $(this);\n elem.attr('id','colcarou-item-'+i);\n elem.toggleClass('colcarou-item');\n elem.children('img').toggleClass('colcarou-image');\n\n var textbox = elem.children('div');\n textbox.toggleClass('colcarou-textbox');\n textbox.children('h2').toggleClass('colcarou-title');\n textbox.children('p').toggleClass('colcarou-text');\n textbox.children('a').toggleClass('colcarou-button');\n });\n\n }", "title": "" }, { "docid": "7fba7601c2f122a3be8852085a58848a", "score": "0.5454256", "text": "function bringContent(obj) {\n //creat the section that will contain the informations(p,h)\n $(\"#whiteSpace\").append(\"<div>\"+\".\"+\"</div>\");\n $(\"#whiteSpace div\").addClass(\"info\");\n\n //take the title and append it\n var title = obj.title;\n $(\".info\").append(\"<h1>\"+title+\"</h1>\");\n $(\".info h1\").addClass(\"subjHeader\");\n\n \t//loop at the obj to set the paragrah to the page exapt title and color no need\n \tfor(var key in obj) {\n\n \t\tif(key === \"title\" || key === \"clicked\" || key === \"example\")\n \t\t\tcontinue;\n \t\telse {\n \t\t\t//incase we have secound title to give it the title decoration \n \t\t\tif(key === \"title2\" || key === \"title3\" || key === \"title4\" || key === \"title5\")\n \t\t\t{$(\".info\").append(\"<h2>\"+obj[key]+\"</h2>\");//apend the h2 with sub tiltels\n $(\".info h2\").css(\"color\",\"red\")\n }\n /* if(key === \"example\"){\n $(\".info\").append(\"<p class=\"example\"> <XMP>\"+obj[key]+\"</XMP> </p>\");\n \n $(\".example\").css(\"color\",\"red\");\n\n }*/\n \telse\n \t\t\t$(\".info\").append(\"<p> <XMP>\"+obj[key]+\"</XMP> </p>\");\t\n \t\t} \t\n }}//the end of function bring content", "title": "" }, { "docid": "19a6e1c2711dc3c67bcaa7ce626edea7", "score": "0.5434783", "text": "function onClickTabTitle(event) {\n // Set only clicked tab to active\n const tabTitles = container.querySelectorAll('.tabs > ul > li');\n tabTitles.forEach((el) => {\n el.classList.remove('is-active');\n });\n event.currentTarget.classList.add('is-active');\n\n // Set only corresponding tab content to active\n const tabContents = container.querySelectorAll('.tabs-content > *');\n tabContents.forEach((el) => {\n el.classList.remove('is-active');\n });\n const clickedTab = event.currentTarget.getAttribute('data-tab');\n const activeContentContainer = container.querySelector(`div[data-content=\"${clickedTab}\"]`);\n activeContentContainer.classList.add('is-active');\n }", "title": "" }, { "docid": "bd520438a942b6643f4b5239bf3a9c81", "score": "0.5409921", "text": "setTitle(title) {\r\n this.title_ = title;\r\n }", "title": "" }, { "docid": "74cabef14c86b0159ade457e5a3280c9", "score": "0.5400078", "text": "function initFrom(title, options) {\n\t if (options.text !== void 0) {\n\t title.text = options.text;\n\t }\n\t if (options.icon !== void 0) {\n\t title.icon = options.icon;\n\t }\n\t if (options.closable !== void 0) {\n\t title.closable = options.closable;\n\t }\n\t if (options.className !== void 0) {\n\t title.className = options.className;\n\t }\n\t }", "title": "" }, { "docid": "3194d5d005613ebd0f4097a6a8566469", "score": "0.5392963", "text": "function observeTitle() {\n const body = select('body')\n observeElement(\n 'title',\n () => {\n if (!body.classList.contains('overlay-enabled')) init()\n },\n titleOptions\n )\n}", "title": "" }, { "docid": "779faf52ca7af00514cf382343d95b19", "score": "0.5392435", "text": "function titleDisplaySetup()\n{\n titleDisplay('listMenuRoot', 'listMenuTitles');\n // ADD DIFFERENT TITLE AREAS HERE! Each must have a 'target' area in your page.\n //titleDisplay('otherMenuRoot', 'otherMenuTitles');\n}", "title": "" }, { "docid": "3ea151c5b0c8306a0e003bf39b117e16", "score": "0.5373205", "text": "static getClassName() {\n return 'PageContainer';\n }", "title": "" }, { "docid": "763860b4b628369fcb809d8db17d4b8e", "score": "0.53675985", "text": "renderTitle() { }", "title": "" }, { "docid": "a427d76a1e226e5628c0fe1f6e26ad3e", "score": "0.536473", "text": "function setHeaderTitle()\n {\n $('.perc-ellipsis').each(function()\n {\n $(this).attr('title', $(this).text());\n });\n }", "title": "" }, { "docid": "c5f3693181e25a8c58b669c7d7c5fc48", "score": "0.5359487", "text": "get classNamesArray() { return ['codicon', 'codicon-' + this.id]; }", "title": "" }, { "docid": "c167719044fc15eeb9c3f5c88e61c41a", "score": "0.5359477", "text": "_setClasses($ele, classes) {\n $ele.addClass(classes);\n }", "title": "" }, { "docid": "9a7dd97b6af23b2f22f6162f45bd274f", "score": "0.5352743", "text": "function title(object) {\r\n return $('<div class=\"title\">' + '<h3>' + object.title + '</h3>' + '<p>' +\r\n 'by ' + '<br>' + object.principalOrFirstMaker + '</p>' + '</div>');\r\n }", "title": "" }, { "docid": "9733f2b1781272ad085776cd80cbb6f1", "score": "0.53449804", "text": "set title(newtitle) {\n this.setAttribute('title',newtitle);\n }", "title": "" }, { "docid": "1b2b21798c8493f1a04f610a63b1ec78", "score": "0.5343145", "text": "function createTitles(wordsEnter) {\n wordsEnter.append('title')\n .attr('class', _titleWordCssClass)\n .text(function(d) { return d.title; });\n }", "title": "" }, { "docid": "1abc9e8c4367c0b69f5eb4be878686bf", "score": "0.532665", "text": "function setTitleText(txt) {\n\tt = document.querySelector('.titleClass');\n\tif (t == null) return;\n\tif (isVisible(t)) {\n\t\tt.innerText = txt;\n\t\treturn;\n\t}\n\tt = document.querySelectorAll('div.titleSpanClass');\n\tif (t.length == 0) return;\n\tfor (var i = 0; i < t.length; i++) {\n\t\tt[i].textContent = txt;\n\t}\n}", "title": "" }, { "docid": "246a2b71cc5d8d5fea3664c4249e8b63", "score": "0.53119075", "text": "render() {\n let title = this.props.title;\n return (\n <h1 className='title'>\n {title}\n </h1>\n );\n }", "title": "" }, { "docid": "0863a26897e8982909ed2f153283b91a", "score": "0.52927035", "text": "function containerCreate() {\n //Add cat name to DOM\n const h1 = document.querySelector(\".name\");\n h1.innerText = this.innerText;\n //Add cat image to DOM\n for (let k = 0; k < catList.length; k++) {\n if (this.innerText === catList[k].name) {\n img.setAttribute(\"src\", catList[k].image + \".jpg\");\n counter.innerText = \"\";\n clicks();\n }\n }\n}", "title": "" }, { "docid": "835ce09f7f1e639cf42a07b8b3f1caaf", "score": "0.5289336", "text": "get titles() {\n }", "title": "" }, { "docid": "de2cc59bb352a1cc1cdb8d4c40568788", "score": "0.528835", "text": "function getItemClasses(grid) {\n // @ts-ignore\n return itemClassNames.map(function (className) {\n return grid._settings[className];\n });\n }", "title": "" }, { "docid": "75fe2514b3681db47238657a4496fc7d", "score": "0.5272773", "text": "function C(e,c){e.className=\"w \"+c}", "title": "" }, { "docid": "50c6c358c1b6d459cb531d35b1d5f511", "score": "0.52721727", "text": "render({ size, delay, href, children }, { open }) {\n\n let content;\n let classes = [style.mut_title, 'mut_item'];\n\n switch (size) {\n case 'small':\n classes.push(style.mut_small_title);\n break;\n case 'med':\n classes.push(style.mut_med_title);\n break;\n case 'large':\n classes.push(style.mut_large_title);\n break;\n case 'big':\n classes.push(style.mut_big_title);\n break;\n }\n\n if (!!href) {\n content = (<a href={href} target='_blank' ref={s => this.span = s}>{children}</a>);\n } else {\n content = (<span ref={s => this.span = s}>{children}</span>);\n }\n\n if (open === true) {\n classes.push(style.mut_title_ready);\n }\n\n return (\n <div class={classes.join(' ')} style={`transition-delay: ${delay}`}>\n {children}\n {content}\n </div>\n );\n\n }", "title": "" }, { "docid": "0292ce4d18c6ee6d9709c4deedd4e421", "score": "0.52708286", "text": "addCssClass(classe) {\n this.htmlBox.addClass(classe);\n }", "title": "" }, { "docid": "97b7a485cbf8fa457ac6830eb9b116dd", "score": "0.5265749", "text": "get className() {\n return this.attributes.className;\n }", "title": "" }, { "docid": "e350673f29ca5025fc56dcd953cef44a", "score": "0.5249532", "text": "function addTitle(titleName) {\n let titleDiv = document.createElement(\"div\");\n titleDiv.className = \"title\";\n\n let innertext = document.createElement(\"p\");\n innertext.textContent = titleName;\n\n titleDiv.appendChild(innertext);\n return titleDiv;\n}", "title": "" }, { "docid": "461846c9e34b61935578ef1887eca987", "score": "0.5247081", "text": "function addClass(elTop, nameEL){\n elTop.forEach( (x, y) => {\n if(x === 0){\n nameEL[y][1].children[0].classList.add('anmtnDesc');\n nameEL[y][1].children[1].classList.add('anmtn');\n nameEL[y][1].children[2].classList.add('anmtnH');\n nameEL[y][1].children[3].classList.add('anmtnPrice');\n }\n });\n}", "title": "" }, { "docid": "5d1917a953406cea75edc3299d5d6be0", "score": "0.5242576", "text": "updateClassName(newClassName) {\n this._options.className = newClassName;\n // Defaults are different on Macs\n if (platform.isMacintosh) {\n this._options.className += ' mac';\n }\n this._domNode.className = 'monaco-scrollable-element ' + this._options.className;\n }", "title": "" }, { "docid": "e121fe3beed67aae2d0c963e6edfad28", "score": "0.5239796", "text": "function renderClasses(classes) {\n var container = $(\"#classes\");\n container.empty();\n\n for (var i = 0; i < classes.length; i++) {\n var c = classes[i];\n var cloned = template.clone();\n cloned.find(\".name\").html(c.name);\n cloned.find(\".category\").html(c.category);\n cloned.find(\".date\").html(c.dateCreated);\n cloned.find(\".remove\").attr(\"id\", i);\n cloned.find(\".edit\").attr(\"id\", i);\n container.append(cloned);\n }\n}", "title": "" }, { "docid": "18bc4753c93f2610db76133494e2c95a", "score": "0.523706", "text": "function addTitle() {\n var dispTitle = getSetting('_mapTitleDisplay');\n\n if (dispTitle !== 'off') {\n var title = '<h3 class=\"pointer\">' + getSetting('_mapTitle') + '</h3>';\n var subtitle = '<h5>' + getSetting('_mapSubtitle') + '</h5>';\n\n if (dispTitle == 'topleft') {\n $('div.leaflet-top').prepend('<div class=\"map-title leaflet-bar leaflet-control leaflet-control-custom\">' + title + subtitle + '</div>');\n } else if (dispTitle == 'topcenter') {\n $('#map').append('<div class=\"div-center\"></div>');\n $('.div-center').append('<div class=\"map-title leaflet-bar leaflet-control leaflet-control-custom\">' + title + subtitle + '</div>');\n }\n\n $('.map-title h3').click(function() { location.reload(); });\n }\n }", "title": "" }, { "docid": "348fdb7e0115b3e57829984405129d06", "score": "0.52174455", "text": "addClass(className) {\n for (const c of words(className))\n this._el.classList.add(c);\n }", "title": "" }, { "docid": "dd454a4b4c6594a27829394da2c27948", "score": "0.520906", "text": "function editMiniTimegridTitles() {\n $(\".timegrid-event\").each(function (i, obj) {\n\tif ($(\"#schedule-details-layer\").css(\"visibility\") != \"visible\") {\n\t\tvar title = $(obj).attr(\"title\");\n\t\ttitle = title.split(\"-\")[0];\n\t\tvar child = $(obj).find(\"div\");\n\t\tchild.html(title);\n\t\tchild.css(\"font-size\", \"10px\");\n\t} else {\n\t\tvar child = $(obj).find(\"div\");\n\t\tvar title = $(obj).attr(\"title\");\n\t\tchild.html(title);\n\t\tchild.css(\"font-size\", \"12px\");\n\t}\n });\n toggleUnitAdder();\n}", "title": "" }, { "docid": "d56976316e1da53f371fb2ebba89879e", "score": "0.5204764", "text": "applyRenderAttributes() {\n let me = this,\n container = Neo.getComponent(me.containerId),\n cls = container && container.cls;\n\n if (!container) {\n Neo.logError('layout.Fit: applyRenderAttributes -> container not yet created', me.containerId);\n }\n\n _util_Array_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].add(cls || [], 'neo-layout-fit');\n\n container.cls = cls;\n }", "title": "" }, { "docid": "add234c74921483c45549276d9301712", "score": "0.51936966", "text": "function showTitle() {\n // Hide\n d3.selectAll('.d3-tip-sales').remove();\n d3.selectAll('.d3-tip-bars').remove();\n d3.selectAll('.d3-tip-grid').remove();\n // Hide closed img\n d3.select('#patrice_img')\n .transition()\n .duration(600)\n .attr('opacity', 0);\n\n // Show\n g.selectAll('.covid-title')\n .transition()\n .duration(600)\n .attr('opacity', 1.0);\n }", "title": "" }, { "docid": "971d6e642e09be227bd58a5dda6f965b", "score": "0.5188104", "text": "function renderTitle(movieObj, card) {\n let movieTitle = document.createElement(\"div\");\n movieTitle.classList.add(\"is-size-4\")\n movieTitle.innerText = movieObj.title;\n card.appendChild(movieTitle);\n}", "title": "" }, { "docid": "609e7b9b0dc205a2d84740c083c2aaf5", "score": "0.5187497", "text": "buildButton(title,cssClass){\r\n const mainDiv = document.querySelector('.inputContainer');\r\n const btn = document.createElement('div');\r\n btn.innerHTML='<div><button class=\"'+cssClass+'\">'+title+'</button></div>';\r\n btn.classList.add('col');\r\n mainDiv.appendChild(btn);\r\n }", "title": "" }, { "docid": "9206ea8de23b3c31a9ebeb18658a731d", "score": "0.5184664", "text": "function createMovieContainer(movies, title = '') {\n const movieTemplate = `\n <h3>${title}</h3>\n <section class='movie-list'>\n <div class='image-list'>\n ${generateImg(movies)}\n </div>\n <button class='left'><i class=\"fas fa-chevron-left\"></i></button>\n <button class='right'><i class=\"fas fa-chevron-right\"></i></button>\n </section>\n <div id=\"movieInfoContainer\" class='movie-info-container'>\n <p class=\"close-movie-info\"><i class=\" close-movie-btn far fa-times-circle\"></i></p>\n <div class='movie-info-wrapper'>\n <div class='backdrop-overlay'></div>\n <div class='movie-info'></div>\n </div>\n </div>\n `;\n\n return movieTemplate;\n}", "title": "" }, { "docid": "0195f4736b57e1736a7dc6d3085e1286", "score": "0.5181352", "text": "function createContainer(name,classNames) {\n let container = document.createElement(name);\n container.setAttribute('class', classNames);\n return container;\n}", "title": "" }, { "docid": "010543dec584596c117e93de89d327fc", "score": "0.5171138", "text": "function Title(props) {\r\n // change color of title (h6 component) depending on whether red or yellow turn\r\n const color = props.turnColor === 0 ? \"white-turn\" : \"black-turn\";\r\n\r\n const titleClassName = \"title \";\r\n\r\n let message;\r\n\r\n // message to display in h6 component based on state of game\r\n\r\n // if game has been won\r\n if (props.winner !== -1) {\r\n const winner = props.winner === 0 ? \"Player White, \" : \"Player Black, \";\r\n message = winner + \"You Have Won!\";\r\n }\r\n\r\n // if game is still going on\r\n else {\r\n const player = props.turnColor === 0 ? \"Player White, \" : \"Player Black, \";\r\n message = player + \"It Is Your Turn\";\r\n }\r\n\r\n return (\r\n <div className={titleClassName}>\r\n <div className=\"titleTop\">\r\n <FontAwesomeIcon className=\"picture\" icon={faChessRook} />\r\n <h3>CHESS</h3>\r\n <FontAwesomeIcon className=\"picture\" icon={faChessRook} />\r\n </div>\r\n <h6 className={color}>{message}</h6>\r\n </div>\r\n );\r\n}", "title": "" }, { "docid": "04ea5f73d554e368d307db01adf83a4e", "score": "0.51697", "text": "updateAttributes() {\n const { em, model, $el } = this;\n const attr = model.get('attributes') || {};\n const title = em && em.t && em.t(`panels.buttons.titles.${model.id}`);\n $el.attr(attr);\n title && $el.attr({ title });\n\n this.updateClassName();\n }", "title": "" }, { "docid": "ed75ca0266b384114af16e638f7d4d1c", "score": "0.5169618", "text": "function defaultTooltTipForAllTitle()\n{\n $('[title]').each(function()\n {\n toolTip(this, $(this).attr('title'));\n });\n}", "title": "" }, { "docid": "a1584f8bc8a9ad456f578d1041b3bf46", "score": "0.51678777", "text": "function updateGridTitles() {\n var $titles = $('.grid-view:visible .title');\n var width = parseInt(($titles.parent().width() * 0.9), 10);\n var resizeTo = fitText.resize($titles, width, [24, 22, 20, 17, 14, 12]);\n $titles.css('font-size', resizeTo);\n }", "title": "" }, { "docid": "27f62a5b0597963ea359a2e28d30d5d1", "score": "0.5161698", "text": "getRootClassName() {\n var classes = {};\n classes[this.props.basename] = true;\n classes[this.props.theme] = this.props.theme.length;\n classes[this.props.animatedState] = this.state.animate;\n return classes;\n }", "title": "" }, { "docid": "b1c1199aab36c0c11cd3ff41b6e20841", "score": "0.51563203", "text": "function getTitle(title, style, width) {\n var titleCollection = [];\n\n switch (style.textOverflow) {\n case 'Wrap':\n titleCollection = textWrap(title, width, style);\n break;\n\n case 'Trim':\n titleCollection.push(textTrim(width, title, style));\n break;\n\n default:\n titleCollection.push(title);\n break;\n }\n\n return titleCollection;\n }", "title": "" }, { "docid": "cb98dae084975695db2d16453229b230", "score": "0.5156065", "text": "function Title({ appName }) {\r\n return <h1 className=\"title is-1\">{appName}</h1>;\r\n}", "title": "" }, { "docid": "9b7a5757e8bb7bdab6726d1c165bf59f", "score": "0.5155668", "text": "function addTwitterBSClass(thisObj) {\n var title = jQuery(thisObj).attr('title');\n if (title) {\n var titles = title.split(' ');\n if (titles[0]) {\n var num = parseInt(titles[0]);\n if (num > 0)\n \tjQuery(thisObj).addClass('label label-default');\n if (num == 2)\n jQuery(thisObj).addClass('label label-info');\n if (num > 2 && num < 4)\n jQuery(thisObj).addClass('label label-success');\n if (num >= 5 && num < 10)\n jQuery(thisObj).addClass('label label-warning');\n if (num >=10)\n jQuery(thisObj).addClass('label label-important');\n }\n }\n else\n \tjQuery(thisObj).addClass('label');\n return true;\n}", "title": "" }, { "docid": "9b7a5757e8bb7bdab6726d1c165bf59f", "score": "0.5155668", "text": "function addTwitterBSClass(thisObj) {\n var title = jQuery(thisObj).attr('title');\n if (title) {\n var titles = title.split(' ');\n if (titles[0]) {\n var num = parseInt(titles[0]);\n if (num > 0)\n \tjQuery(thisObj).addClass('label label-default');\n if (num == 2)\n jQuery(thisObj).addClass('label label-info');\n if (num > 2 && num < 4)\n jQuery(thisObj).addClass('label label-success');\n if (num >= 5 && num < 10)\n jQuery(thisObj).addClass('label label-warning');\n if (num >=10)\n jQuery(thisObj).addClass('label label-important');\n }\n }\n else\n \tjQuery(thisObj).addClass('label');\n return true;\n}", "title": "" }, { "docid": "8dd0f848dca0839d68e22c0063bfa10e", "score": "0.51523095", "text": "setClasses() {\n this.sliderEl.classList.add('dulas-row');\n this.slideTrack.classList.add('dulas-track');\n\n this.newSlides.forEach(slide => {\n slide.classList.add('dulas-slide');\n });\n }", "title": "" }, { "docid": "c763b582d605c4dce43157f59de25280", "score": "0.5150634", "text": "applyRenderAttributes() {\n let me = this,\n container = Neo.getComponent(me.containerId),\n cls = container && container.cls;\n\n if (!container) {\n Neo.logError('layout.Card: applyRenderAttributes -> container not yet created', me.containerId);\n }\n\n _util_Array_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].add(cls || [], 'neo-layout-card');\n\n container.cls = cls;\n }", "title": "" }, { "docid": "46c190fe507d8dff3edfd40281065e49", "score": "0.5141884", "text": "function priorityClass(){\n let itemsList=document.getElementsByClassName(\"todo-container\");\n for(let item of itemsList){\n item.classList.remove(\"p1\",\"p2\",\"p3\",\"p4\",\"p5\");\n }\n for(let item of itemsList){\n item.classList.add(\"p\"+item.querySelector(\".todo-priority\").innerText)\n }\n\n}", "title": "" }, { "docid": "305c3ad77aeef8378613cf199b8e749e", "score": "0.51358944", "text": "function onTitleClick(e) {\n\t\tvar activeTitle;\n\n\t\te.preventDefault();\n\n\t\tif (this.classList.contains('active')) {\n\t\t\tcloseTitle(this);\n\t\t} else {\n\t\t\tif (!options.allowMultiOpen) {\n\t\t\t\tif (activeTitle = element.querySelector('.active.title')) {\n\t\t\t\t\tcloseTitle(activeTitle);\n\t\t\t\t}\n\t\t\t}\n\t\t\topenTitle(this);\n\t\t}\n\t}", "title": "" }, { "docid": "4216ade012ad645af0f1ab537afff56f", "score": "0.51351845", "text": "function resize() {\n\n // Set margin for container based on content\n\n data.style.paddingTop = ( (title.offsetHeight / 2) + 50 ) + 'px';\n\n // Position Content\n\n var contentPosition = ( title.offsetHeight / 2 ) + 'px'\n title.style.transform = 'translateY(' + contentPosition + ')';\n\n }", "title": "" }, { "docid": "a3008d62691ca5e6fc5f2e1e0c9621b9", "score": "0.51330924", "text": "function addTwitterBSClass(thisObj) {\n var title = $(thisObj).attr('title');\n if (title) {\n var titles = title.split(' ');\n if (titles[0]) {\n var num = parseInt(titles[0]);\n if (num > 0)\n \t$(thisObj).addClass('label');\n if (num == 2)\n $(thisObj).addClass('label notice');\n if (num > 2 && num < 4)\n $(thisObj).addClass('label success');\n if (num >= 5 && num < 10)\n $(thisObj).addClass('label warning');\n if (num >=10)\n $(thisObj).addClass('label important');\n }\n }\n else\n \t$(thisObj).addClass('label');\n return true;\n}", "title": "" }, { "docid": "d8dcca642be0717fdf36003b669a6a43", "score": "0.5131072", "text": "function classes() {\n var classes = [];\n $scope.analysis.result.forEach(function (node) {\n var scalar;\n\n if ($scope.analysis.analysis == \"wordcloudop\") {\n scalar = node.frequency;\n }\n classes.push({packageName: \"\", className: node.term, value: scalar + shift});\n });\n return {children: classes};\n }", "title": "" }, { "docid": "15aded461de41c27b755f31914040d40", "score": "0.5127815", "text": "getClasses(classes = []) {\n return classes.map((c,i) => {\n let styles = this.getPercentage(c, this.courseData.start, this.height);\n styles.backgroundColor = c.color;\n return (\n <div onClick={this.showCourse}\n onMouseEnter={this.showCourse}\n data-for={`courseData-${c.crn}${this.props.day}`}\n data-tip=\"course\"\n data-crn={c.crn}\n className=\"day-class\"\n key={i}\n style={styles}>\n <div className=\"class-section\">\n {c.department}:{c.class}-{c.section}\n </div>\n <div className=\"class-instructor\">{c.instructors.join(\" \")}</div>\n { this.state.showData === c.crn ? this.getTooltip(c.crn, c.start, c.end) : \"\" }\n <div className=\"is-hidden-desktop\">\n {this.getSection(this.getCourseInfo(c.crn), c.start, c.end)}\n </div>\n </div>\n );\n });\n }", "title": "" }, { "docid": "50f0ceb97d7807cb54f03fbd618db2b5", "score": "0.51274383", "text": "function tag_classes(p) {\n\t var s = '';\n\t for (var i in p.tags) {\n\t s += ' tag-' + i;\n\t if (p.tags[i] !== '*') {\n\t s += ' tag-' + i + '-' + p.tags[i];\n\t }\n\t }\n\t return s;\n\t }", "title": "" }, { "docid": "021212bdeea14f26831da12df56f015a", "score": "0.5127367", "text": "title(title) {\n return this.clone({\n title,\n id: getStructureNodeId(title, this.spec.id)\n });\n }", "title": "" }, { "docid": "504d43db762968df10a288c07e48891d", "score": "0.5124507", "text": "addclass(classname) {\n if (!elation.html.hasclass(this, classname)) {\n elation.html.addclass(this, classname);\n }\n }", "title": "" }, { "docid": "504d43db762968df10a288c07e48891d", "score": "0.5124507", "text": "addclass(classname) {\n if (!elation.html.hasclass(this, classname)) {\n elation.html.addclass(this, classname);\n }\n }", "title": "" }, { "docid": "5aebfd51944f62268f71e421749fc85d", "score": "0.5121348", "text": "function setuptitles()\n{\n var logopener=\"----entering setuptitles----\";\n console.log(logopener);\n\n //get the title H1 tags\n var maintitleline1 = document.getElementById(\"maintitleline1\");\n var maintitleline2 = document.getElementById(\"maintitleline2\");\n\n //set them with desired values.\n let titleline1 = \"bari basic tutorial demo app\";\n let titleline2 = \"built using HTML, CSS and JS plus Bootstrap only\";\n\n maintitleline1.innerHTML = titleline1;\n maintitleline2.innerHTML = titleline2;\n\n var logcloser=\"----leaving setuptitles----\";\n console.log(logcloser);\n}", "title": "" }, { "docid": "6cbc0029018465460771e6ba78638083", "score": "0.51209325", "text": "function asTitle(value) {\n return value instanceof Title ? value : new Title(value);\n }", "title": "" }, { "docid": "6813528e99bd2fb48d208639cf32fd96", "score": "0.51174057", "text": "function collapseTitles() {\n const collapseHeaders = document.querySelectorAll(\".collapsible\");\n collapseHeaders.forEach(hideContent);\n}", "title": "" }, { "docid": "e2e56d306fcdfeee3eeeb6eb95dc468f", "score": "0.51144314", "text": "function wrapDivTitleBox() {\n var $boxs = $('.acs-title-box');\n if ($boxs.length) {\n var $wrap = $(\"<div class='acs-title-box-wrap'><div class='acs-content'></div></div>\");\n $boxs.each(function () {\n $wrap.css({\n 'width': $(window).width() + 'px',\n 'margin-left': -$(this).offset().left + 'px'\n });\n $(this).wrap($wrap);\n });\n }\n }", "title": "" }, { "docid": "d7b558a4006277afe18230dfa9162f95", "score": "0.51106334", "text": "get getTitle() {\n return $('h3');\n }", "title": "" }, { "docid": "624548f6190b5c05f3a5f68d6f6b7487", "score": "0.51087046", "text": "function addclassesToElements() {\n let insertBlock = document.getElementById('insertBlock');\n let notes = document.getElementById('notes');\n let titletrash = document.getElementById('titleTrashBin');\n insertBlock.classList.add('d-none');\n notes.classList.add('notesTop');\n titletrash.classList.remove('d-none');\n}", "title": "" }, { "docid": "faaaebe49b4d875ef1c921110ccb7ae5", "score": "0.51080865", "text": "function wrapTitleVertical() {\n const itemHeight = $('.js-title_categories').height();\n const titleAbsolut = $('.js-title_absolute').height();\n $('.js-title_absolute').css('top', (itemHeight - titleAbsolut) / 2);\n }", "title": "" }, { "docid": "7905f4ddec73b23100237c652af73dff", "score": "0.5106904", "text": "getclassname() {\n return \"Elements\";\n }", "title": "" } ]
d4c08229045caedc39ce2b66f193b398
Called ONLY from within css_defaultDisplay
[ { "docid": "be794a09a5627e040a6d311d6d3224af", "score": "0.64257556", "text": "function actualDisplay(name, doc) {\n var elem = jQuery(doc.createElement(name)).appendTo(doc.body),\n display = jQuery.css(elem[0], \"display\");\n elem.remove();\n return display;\n }", "title": "" } ]
[ { "docid": "dbf6e4b0bbb28e687669cd94f6c34474", "score": "0.69851434", "text": "_initDisplay (value) {\n }", "title": "" }, { "docid": "dbf6e4b0bbb28e687669cd94f6c34474", "score": "0.69851434", "text": "_initDisplay (value) {\n }", "title": "" }, { "docid": "a66c33b10f3a1d2593a9e491dada6bdb", "score": "0.6694034", "text": "_replaceDisplay (value) {\n }", "title": "" }, { "docid": "a66c33b10f3a1d2593a9e491dada6bdb", "score": "0.6694034", "text": "_replaceDisplay (value) {\n }", "title": "" }, { "docid": "bc49395f477d2ce600c525c23b037f5b", "score": "0.6552104", "text": "function actualDisplay(name, doc) {\n\t var elem = jQuery(doc.createElement(name)).appendTo(doc.body), display = jQuery.css(elem[0], 'display');\n\t elem.remove();\n\t return display;\n\t }", "title": "" }, { "docid": "1d6eed163024fd1beca5bc0388037485", "score": "0.6507806", "text": "function defaultDisplay(){\n displayNone(\"footer\");\n displayNone(\"div.lnb_home\");\n displayNone(\"div.section_scroll_m\");\n displayNone(\"a.page_fast2\");\n}", "title": "" }, { "docid": "ca4f40b7cce383880d8dae225e2cbbd5", "score": "0.64753944", "text": "function actualDisplay(name, doc) {\n\t\t\tvar elem = jQuery(doc.createElement(name)).appendTo(doc.body),\n\t\t\t display = jQuery.css(elem[0], \"display\");\n\t\t\telem.remove();\n\t\t\treturn display;\n\t\t}", "title": "" }, { "docid": "d3fe049187fc108e4d543f512ffd99ee", "score": "0.64529365", "text": "function actualDisplay( name, doc ) {\n var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n display = jQuery.css( elem[0], \"display\" );\n elem.remove();\n return display;\n }", "title": "" }, { "docid": "d742edf64e8b8abe277dac8271b5f9cc", "score": "0.64123774", "text": "function css_defaultDisplay(nodeName) {\n\t var doc = document, display = elemdisplay[nodeName];\n\t if (!display) {\n\t display = actualDisplay(nodeName, doc);\n\t // If the simple way fails, read from inside an iframe\n\t if (display === 'none' || !display) {\n\t // Use the already-created iframe if possible\n\t iframe = (iframe || jQuery('<iframe frameborder=\\'0\\' width=\\'0\\' height=\\'0\\'/>').css('cssText', 'display:block !important')).appendTo(doc.documentElement);\n\t // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\n\t doc.write('<!doctype html><html><body>');\n\t doc.close();\n\t display = actualDisplay(nodeName, doc);\n\t iframe.detach();\n\t }\n\t // Store the correct default display\n\t elemdisplay[nodeName] = display;\n\t }\n\t return display;\n\t }", "title": "" }, { "docid": "53ace4e4a64549616a9b98ad62a795b3", "score": "0.63866854", "text": "function actualDisplay(name, doc) {\r\n var elem = jQuery(doc.createElement(name)).appendTo(doc.body),\r\n\t\tdisplay = jQuery.css(elem[0], \"display\");\r\n elem.remove();\r\n return display;\r\n }", "title": "" }, { "docid": "16bfd97b57326386cca841a825b68b7d", "score": "0.6340591", "text": "_onUpdateDisplay () {\n }", "title": "" }, { "docid": "16bfd97b57326386cca841a825b68b7d", "score": "0.6340591", "text": "_onUpdateDisplay () {\n }", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "b8e553ce14a506f7dc12d5c51505373f", "score": "0.63332194", "text": "function actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}", "title": "" }, { "docid": "7652b031e2615d2a4f533de9106fb46c", "score": "0.6322114", "text": "function actualDisplay(name, doc) {\n var elem = jQuery(doc.createElement(name)).appendTo(doc.body), display = jQuery.css(elem[0], 'display');\n elem.remove();\n return display;\n }", "title": "" }, { "docid": "a29ac0549b5d9330a1febd03a3107f73", "score": "0.63082993", "text": "function MM_displayLayers() {\nvar i,p,v,obj,args=MM_displayLayers.arguments;\n for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];\n if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }\n\t//if (checkIt('mac')&&v=='visible') obj.pixelTop = obj.pixelTop ;\n obj.display=v; }\n}", "title": "" }, { "docid": "f81ee947d97bd310eb8df101c53fc22d", "score": "0.62976503", "text": "function aboo() {\n var $e = $(this);\n $e.css({\n display: $e.data(me + \"-display\"),\n visibility: $e.data(me + \"-visibility\")\n });\n $e.removeData(me + \"-display\");\n $e.removeData(me + \"-visibility\");\n }", "title": "" }, { "docid": "339394a1cc53bcee0b69826b2db06a05", "score": "0.6289107", "text": "function update_display() { }", "title": "" }, { "docid": "ef0f9a36d1ba5c69a8b219cda7a12f05", "score": "0.62698776", "text": "function css_defaultDisplay(nodeName) {\n\t\t\tvar doc = document,\n\t\t\t display = elemdisplay[nodeName];\n\n\t\t\tif (!display) {\n\t\t\t\tdisplay = actualDisplay(nodeName, doc);\n\n\t\t\t\t// If the simple way fails, read from inside an iframe\n\t\t\t\tif (display === \"none\" || !display) {\n\t\t\t\t\t// Use the already-created iframe if possible\n\t\t\t\t\tiframe = (iframe || jQuery(\"<iframe frameborder='0' width='0' height='0'/>\").css(\"cssText\", \"display:block !important\")).appendTo(doc.documentElement);\n\n\t\t\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\t\t\tdoc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\n\t\t\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\t\t\tdoc.close();\n\n\t\t\t\t\tdisplay = actualDisplay(nodeName, doc);\n\t\t\t\t\tiframe.detach();\n\t\t\t\t}\n\n\t\t\t\t// Store the correct default display\n\t\t\t\telemdisplay[nodeName] = display;\n\t\t\t}\n\n\t\t\treturn display;\n\t\t}", "title": "" }, { "docid": "87c3e66974c147dc9296eaabfb2c8cd0", "score": "0.62353307", "text": "function actualDisplay( name, doc ) {\n var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n display = jQuery.css( elem[0], \"display\" );\n elem.remove();\n return display;\n}", "title": "" }, { "docid": "3385375f1e9f494d4b4b5cd4ebf4e9a7", "score": "0.62293607", "text": "if ( elem.style.display === \"\" && isHidden( elem ) ) {\n\t\t\t\tvalues[ index ] = jQuery._data( elem, \"olddisplay\", jss_defaultDisplay(elem.nodeName) );\n\t\t\t}", "title": "" }, { "docid": "6317846056303a57bea31971c1442cee", "score": "0.6225964", "text": "function css_defaultDisplay(nodeName) {\n var doc = document,\n display = elemdisplay[nodeName];\n\n if (!display) {\n display = actualDisplay(nodeName, doc);\n\n // If the simple way fails, read from inside an iframe\n if (display === \"none\" || !display) {\n // Use the already-created iframe if possible\n iframe = (iframe || jQuery(\"<iframe frameborder='0' width='0' height='0'/>\").css(\"cssText\", \"display:block !important\")).appendTo(doc.documentElement);\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay(nodeName, doc);\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n }\n\n return display;\n }", "title": "" }, { "docid": "c235469fd009b14e7f457ef309c52505", "score": "0.6195087", "text": "function setDisplay(displayPass){\n\tdisplay = displayPass;\n}", "title": "" }, { "docid": "a904a7bdb5a8c7fb57d1fbf03049415a", "score": "0.6194687", "text": "function css_defaultDisplay(nodeName) {\n var doc = document, display = elemdisplay[nodeName];\n if (!display) {\n display = actualDisplay(nodeName, doc);\n // If the simple way fails, read from inside an iframe\n if (display === 'none' || !display) {\n // Use the already-created iframe if possible\n iframe = (iframe || jQuery('<iframe frameborder=\\'0\\' width=\\'0\\' height=\\'0\\'/>').css('cssText', 'display:block !important')).appendTo(doc.documentElement);\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\n doc.write('<!doctype html><html><body>');\n doc.close();\n display = actualDisplay(nodeName, doc);\n iframe.detach();\n }\n // Store the correct default display\n elemdisplay[nodeName] = display;\n }\n return display;\n }", "title": "" }, { "docid": "e5deb83e6fd9db1bcaaa2ad58c978ab7", "score": "0.61918443", "text": "function actualDisplay( name, doc ) {\n var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n display = jQuery.css( elem[0], \"display\" );\n elem.remove();\n return display;\n}", "title": "" }, { "docid": "01ae290f8564dae6034b0f2891457c80", "score": "0.6181154", "text": "function css_defaultDisplay(nodeName) {\r\n var doc = document,\r\n\t\tdisplay = elemdisplay[nodeName];\r\n\r\n if (!display) {\r\n display = actualDisplay(nodeName, doc);\r\n\r\n // If the simple way fails, read from inside an iframe\r\n if (display === \"none\" || !display) {\r\n // Use the already-created iframe if possible\r\n iframe = (iframe ||\r\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\r\n\t\t\t\t.css(\"cssText\", \"display:block !important\")\r\n\t\t\t).appendTo(doc.documentElement);\r\n\r\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\r\n doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\r\n doc.write(\"<!doctype html><html><body>\");\r\n doc.close();\r\n\r\n display = actualDisplay(nodeName, doc);\r\n iframe.detach();\r\n }\r\n\r\n // Store the correct default display\r\n elemdisplay[nodeName] = display;\r\n }\r\n\r\n return display;\r\n }", "title": "" }, { "docid": "3de319ea0e261c60a8a7ba512298069c", "score": "0.61198854", "text": "function css_defaultDisplay(nodeName) {\r\r\n if (elemdisplay[nodeName]) {\r\r\n return elemdisplay[nodeName];\r\r\n }\r\r\n\r\r\n var elem = jQuery(\"<\" + nodeName + \">\").appendTo(document.body),\r\r\n display = elem.css(\"display\");\r\r\n elem.remove();\r\r\n\r\r\n // If the simple way fails,\r\r\n // get element's real default display by attaching it to a temp iframe\r\r\n if (display === \"none\" || display === \"\") {\r\r\n // Use the already-created iframe if possible\r\r\n iframe = document.body.appendChild(\r\r\n iframe || jQuery.extend(document.createElement(\"iframe\"), {\r\r\n frameBorder: 0,\r\r\n width: 0,\r\r\n height: 0\r\r\n })\r\r\n );\r\r\n\r\r\n // Create a cacheable copy of the iframe document on first call.\r\r\n // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML\r\r\n // document to it; WebKit & Firefox won't allow reusing the iframe document.\r\r\n if (!iframeDoc || !iframe.createElement) {\r\r\n iframeDoc = (iframe.contentWindow || iframe.contentDocument).document;\r\r\n iframeDoc.write(\"<!doctype html><html><body>\");\r\r\n iframeDoc.close();\r\r\n }\r\r\n\r\r\n elem = iframeDoc.body.appendChild(iframeDoc.createElement(nodeName));\r\r\n\r\r\n display = curCSS(elem, \"display\");\r\r\n document.body.removeChild(iframe);\r\r\n }\r\r\n\r\r\n // Store the correct default display\r\r\n elemdisplay[nodeName] = display;\r\r\n\r\r\n return display;\r\r\n }", "title": "" }, { "docid": "d8b39aa6c280214c5c1c1f6f579e65dc", "score": "0.6069863", "text": "function css_defaultDisplay( nodeName ) {\n var doc = document,\n display = elemdisplay[ nodeName ];\n\n if ( !display ) {\n display = actualDisplay( nodeName, doc );\n\n // If the simple way fails, read from inside an iframe\n if ( display === \"none\" || !display ) {\n // Use the already-created iframe if possible\n iframe = ( iframe ||\n jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css( \"cssText\", \"display:block !important\" )\n ).appendTo( doc.documentElement );\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay( nodeName, doc );\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[ nodeName ] = display;\n }\n\n return display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" }, { "docid": "575b411f6746087e2c8f51d5189209c1", "score": "0.60574037", "text": "function css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}", "title": "" } ]
15dd29c29947e97fc9fcba590dceb19d
format date using native date object
[ { "docid": "f40e74c36bfb5cca0a9408de1e4deb0e", "score": "0.0", "text": "function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate()\n }\n\n format = expandFormat(format, m.localeData())\n formatFunctions[format] =\n formatFunctions[format] ||\n makeFormatFunction(format)\n\n return formatFunctions[format](m)\n }", "title": "" } ]
[ { "docid": "6eba55e654070a28047bd4442b23aa8a", "score": "0.7389412", "text": "formatDate(date) {\n const d = new Date(date);\n let dd = d.getDate();\n if (dd < 10) dd = '0' + dd;\n\n let mm = d.getMonth() + 1;\n if (mm < 10) mm = '0' + mm;\n\n let yy = d.getFullYear();\n\n return dd + '.' + mm + '.' + yy;\n }", "title": "" }, { "docid": "e8caa73f6aca1571b48c4bcba35e6e46", "score": "0.7371435", "text": "function formatdate(date) {\n return new Date(date).toLocaleDateString();\n }", "title": "" }, { "docid": "fec8426e78480cd7b8249d49215f4932", "score": "0.7344133", "text": "formatDate(date, format) {\n if (!date) {\n return '';\n }\n\n let iFormat;\n const lookAhead = (match) => {\n const matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);\n if (matches) {\n iFormat++;\n }\n return matches;\n },\n formatNumber = (match, value, len) => {\n let num = '' + value;\n if (lookAhead(match)) {\n while (num.length < len) {\n num = '0' + num;\n }\n }\n return num;\n },\n formatName = (match, value, shortNames, longNames) => {\n return (lookAhead(match) ? longNames[value] : shortNames[value]);\n };\n let output = '';\n let literal = false;\n\n if (date) {\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === '\\'' && !lookAhead('\\'')) {\n literal = false;\n } else {\n output += format.charAt(iFormat);\n }\n } else {\n switch (format.charAt(iFormat)) {\n case 'd':\n output += formatNumber('d', this.props.utc ? date.getUTCDate() : date.getDate(), 2);\n break;\n case 'D':\n output += formatName('D', this.props.utc ? date.getUTCDay() : date.getDay(), this.props.locale.dayNamesShort, this.props.locale.dayNames);\n break;\n case 'o':\n if (this.props.utc) {\n output += formatNumber('o',\n Math.round((\n new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()).getTime() -\n new Date(date.getUTCFullYear(), 0, 0).getTime()) / 86400000), 3);\n } else {\n output += formatNumber('o',\n Math.round((\n new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() -\n new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);\n }\n break;\n case 'm':\n output += formatNumber('m', (this.props.utc ? date.getUTCMonth() : date.getMonth()) + 1, 2);\n break;\n case 'M':\n output += formatName('M', this.props.utc ? date.getUTCMonth() : date.getMonth(), this.props.locale.monthNamesShort, this.props.locale.monthNames);\n break;\n case 'y':\n output += (lookAhead('y') ? (this.props.utc ? date.getUTCFullYear() : date.getFullYear()) :\n ((this.props.utc ? date.getUTCFullYear() : date.getFullYear()) % 100 < 10 ? '0' : '') +\n (this.props.utc ? date.getUTCFullYear() : date.getFullYear()) % 100);\n break;\n case '@':\n output += date.getTime();\n break;\n case '!':\n output += date.getTime() * 10000 + this.ticksTo1970;\n break;\n case '\\'':\n if (lookAhead('\\'')) {\n output += '\\'';\n } else {\n literal = true;\n }\n break;\n default:\n output += format.charAt(iFormat);\n }\n }\n }\n }\n return output;\n\t}", "title": "" }, { "docid": "ed348a9446516d58a0d6ca589edd4111", "score": "0.73283625", "text": "function format(date) \n {\n date = new Date(date); \n var day = ('0' + date.getDate()).slice(-2);\n var month = ('0' + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear();\n return year + '-' + month + '-' + day;\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.7292591", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.7292591", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "49741f79a55d46958cd16bf94903d7fd", "score": "0.7257251", "text": "function dateFormatter (date, format) {\n //return moment(new Date(date)).format(format);\n return date; // TODO\n }", "title": "" }, { "docid": "cb15e277cb3365b812dedea19c0fa935", "score": "0.7245657", "text": "function formatDate(date, format) {\n\t\tvar dd = date.getDate();\n\t\tvar mm = date.getMonth() + 1; //Jan = 0\n\t\tvar yyyy = date.getFullYear();\n\t\t\n\t\tif (dd < 10) {\n\t\t\tdd = '0' + dd;\n\t\t}\n\t\t\n\t\tif (mm < 10) {\n\t\t\tmm = '0' + mm;\n\t\t}\n\t\t\n\t\tif (format === 'display') {\n\t\t\treturn mm + '/' + dd + '/' + yyyy;\n\t\t}\n\t\t\n\t\treturn yyyy + '-' + mm + '-' + dd;\n\t}", "title": "" }, { "docid": "063752124628e76dbad57b668ce61196", "score": "0.72040653", "text": "function formatDate(date) {\n return date.toLocaleDateString();\n }", "title": "" }, { "docid": "643b492b3370374f1c6034381eb0537e", "score": "0.71712565", "text": "function formatDate(date) {\n\t\t\t\treturn new Intl.DateTimeFormat('en-US').format(date)\n\t\t\t}", "title": "" }, { "docid": "d5160ef9f85da8b83287909c77514a4c", "score": "0.71641886", "text": "function formatDate(date, format) {\n return date.format(format);\n }", "title": "" }, { "docid": "634e575c60bfa12b11ba04fbaa77635f", "score": "0.7162969", "text": "function formatDate(date) {\n return getTwoDigitsDate(date.getDate()) + '.' + getTwoDigitsDate(date.getMonth() + 1) + '.' + date.getFullYear() + ' ' + date.getHours() + ':' + getTwoDigitsDate(date.getMinutes());\n }", "title": "" }, { "docid": "1fb3c8a9eb185dab5fea01428aa024f4", "score": "0.7145033", "text": "static formatDate(date) {\n return moment_1.default(date).format(CLOCKIFY_DATE_FORMAT);\n }", "title": "" }, { "docid": "4eeeaca5024c18b1698ad446c38b0f31", "score": "0.71390396", "text": "function formatDate(date) {\n const dateObj = new Date(date);\n\n const dateString = dateObj.toLocaleDateString();\n\n return dateString\n}", "title": "" }, { "docid": "10afc74e0960fc419460e42df1c4728c", "score": "0.7130555", "text": "function formatDate(date){\n var dd = date.getDate();\n var mm = date.getMonth()+1;\n var yyyy = date.getFullYear();\n if(dd<10) {dd='0'+dd}\n if(mm<10) {mm='0'+mm}\n date = yyyy + '-' + mm +'-' + dd;\n return date\n }", "title": "" }, { "docid": "b587756b729237c30cfd82954fa01ea5", "score": "0.71117294", "text": "function formatDate(\n date = null // The date to format as YYYY-MM-DD, given as Date object\n)\n{\n var month = date.getUTCMonth() + 1; //months from 1-12\n var day = date.getUTCDate();\n var year = date.getUTCFullYear();\n date = year + \"-\" + \"0\"+month + \"-\" + day;\n return date;\n}", "title": "" }, { "docid": "d1ee90248587e2ca6fa2da196a85d812", "score": "0.71066177", "text": "function formatDate(date) {\n\n var dd = date.getDate(); \n if (dd < 10) dd = '0' + dd;\n\n var mm = date.getMonth() + 1; \n if (mm < 10) mm = '0' + mm;\n\n var yy = date.getFullYear(); \n\n return dd + '.' + mm + '.' + yy;\n}", "title": "" }, { "docid": "aa3a0134179f4246685e5cc44424b821", "score": "0.70885515", "text": "function formatDate(date) {\r\n var newDate = stringifyDate(date);\r\n if (newDate) {\r\n return newDate;\r\n }\r\n else {\r\n return date;\r\n }\r\n}", "title": "" }, { "docid": "ea03d52358b8fabcf7f2f712c56922c0", "score": "0.7084443", "text": "dateCustomFormat(date) {\n let stringDate = '';\n if (date) {\n stringDate += this.isNumber(date.month) ? this.padNumber(date.month) + '/' : '';\n stringDate += this.isNumber(date.day) ? this.padNumber(date.day) + '/' : '';\n stringDate += date.year;\n }\n return stringDate;\n }", "title": "" }, { "docid": "fc002b6821a4b497a5b23560f6546f73", "score": "0.7069754", "text": "_convertDateObjToString(obj){let date=\"\";if(obj&&obj.day&&obj.month&&obj.year){let month=obj.month+\"\",day=obj.day+\"\",year=obj.year+\"\";if(2>month.length){month=\"0\"+month}if(2>day.length){day=\"0\"+day}if(4>year.length){for(var l=4-year.length,i=0;i<l;i++){year=\"0\"+year}}date=year+\"-\"+month+\"-\"+day}return date}", "title": "" }, { "docid": "53500fea8c55a4a69909b24b3c7df8ae", "score": "0.70640457", "text": "formatDate(datenow){\n var date = new Date(datenow);\n var options = {\n year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric'\n };\n var result = date.toLocaleDateString('en', options);\n return result;\n }", "title": "" }, { "docid": "c1cdb2d96cce9103ff4a3fb69e104339", "score": "0.7064029", "text": "function formatDate(date) {\n\tvar dd = date.getDate();\n\tvar mm = date.getMonth() + 1;\n\tvar yyyy = date.getFullYear();\n\tif (dd < 10) {\n\t\tdd = '0' + dd;\n\t}\n\tif (mm < 10) {\n\t\tmm = '0' + mm;\n\t}\n\tdate = yyyy + '-' + mm + '-' + dd;\n\n\treturn date;\n}", "title": "" }, { "docid": "05ed2b7c5db85f2df515f94540b063d4", "score": "0.70579183", "text": "function formatDate(date) {\r\n date = new Date(date);\r\n\r\n let month = '' + (date.getMonth() + 1);\r\n let day = date.getDate() + '';\r\n let year = date.getFullYear();\r\n\r\n month = month.length < 2 ? '0' + month : month;\r\n day = day.length < 2 ? '0' + day : day;\r\n\r\n return `${year}-${month}-${day}`\r\n }", "title": "" }, { "docid": "d88825407455d59a48d8d1c3ea08701c", "score": "0.70449007", "text": "function formatDate(date){\n\t\t \t\t\t\tvar year = date.getFullYear().toString().slice(-2);\n\t\t \t\t\t\tvar time = date.toTimeString().slice(0,8);\n\t\t \t\t\t\treturn (date.getMonth()+1) + \"/\" + date.getDate() + \"/\" + year + \" \" +time;\n\t\t \t\t\t}", "title": "" }, { "docid": "8c2f00cdf9a2cab460ebcc7095500ef3", "score": "0.7040074", "text": "function formatDate(dateObj){\r\n\tvar months = new Array(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\");\r\n\tvar month = months[dateObj.getMonth()];\r\n\tvar day = padString(dateObj.getDate(),2);\r\n\t\r\n//\treturn hours + \":\" + minutes + \":\" + seconds + meridian;\r\n\treturn month + \". \" + day;\r\n}", "title": "" }, { "docid": "153b0e529d033df9cf87c2c7f1bf0a6f", "score": "0.7039222", "text": "function formatDate(date) {\n return date.toLocaleDateString();\n}", "title": "" }, { "docid": "5de77b5d9419f495ca037db57d878335", "score": "0.7031887", "text": "function formatDate(date) {\n return format({\n value: date,\n type: formatter.Type.DATE\n });\n }", "title": "" }, { "docid": "6fb72b2b2df39391b28ac74e11292244", "score": "0.7031037", "text": "_turnDateToString(date){\n date = date.toLocaleDateString();\n return date;\n }", "title": "" }, { "docid": "d668d6abef7c13ccf1260a1b6c9328b4", "score": "0.69975114", "text": "function formatDate(date) {\n const d = new Date(date)\n const options = { year: 'numeric', month: 'long', day: 'numeric' }\n return (\n `${d.toLocaleDateString('en-US', options)}`\n )\n }", "title": "" }, { "docid": "b5342dcda80a9f02d04fe781d4f9bae5", "score": "0.69866616", "text": "static formatDate(date, format) {\n if (!format) {\n format = DateUtil.defaultFormat\n }\n if (date) {\n if (date instanceof Date) {\n return moment(date.getTime()).format(format);\n } else if (date instanceof moment) {\n return date.format(format);\n }\n } else {\n return undefined;\n }\n }", "title": "" }, { "docid": "2e9227e4568a4ef145b401a69b92ffbe", "score": "0.69866395", "text": "function format(d) {\n\t\treturn d.getUTCFullYear() + '-' + pad(1 + d.getUTCMonth()) + '-' + pad(d.getUTCDate());\n\t}", "title": "" }, { "docid": "17131cad5cab3a4e748bf12ab4deba16", "score": "0.69807124", "text": "function formatDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n return dd + '/' + mm + '/' + yyyy;\n}", "title": "" }, { "docid": "b56467ef15ff3426b93f8d41b43478c0", "score": "0.6977076", "text": "formatDate() {\n let d = new Date(), formatDateVal = [this.formatNumber(d.getFullYear()), this.formatNumber(('' + (d.getMonth() + 1))), this.formatNumber(('' + d.getDate()))], formatTimeval = [this.formatNumber(('' + d.getHours())), this.formatNumber(('' + d.getMinutes())), this.formatNumber(('' + d.getSeconds()))];\n return formatDateVal.join('-') + ' ' + formatTimeval.join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6972984", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6972984", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6972984", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "149391b3e22fa5d490a882ebf4b2b59d", "score": "0.69693923", "text": "function getFormattedDate(date){\r\n\treturn \"'\"+date.getFullYear()+'-'+ (date.getMonth()+1)+'-'+date.getDate()+\"'\";\r\n}", "title": "" }, { "docid": "a25196e6a644ad46167886fdf8789f83", "score": "0.6965176", "text": "function formatDate(date, format, utc) {\n var MMMM = [\"\\x00\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var MMM = [\"\\x01\", \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n var dddd = [\"\\x02\", \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n var ddd = [\"\\x03\", \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\n function ii(i, len) {\n var s = i + \"\";\n len = len || 2;\n while (s.length < len) s = \"0\" + s;\n return s;\n }\n\n var y = utc ? date.getUTCFullYear() : date.getFullYear();\n format = format.replace(/(^|[^\\\\])yyyy+/g, \"$1\" + y);\n format = format.replace(/(^|[^\\\\])yy/g, \"$1\" + y.toString().substr(2, 2));\n format = format.replace(/(^|[^\\\\])y/g, \"$1\" + y);\n\n var M = (utc ? date.getUTCMonth() : date.getMonth()) + 1;\n format = format.replace(/(^|[^\\\\])MMMM+/g, \"$1\" + MMMM[0]);\n format = format.replace(/(^|[^\\\\])MMM/g, \"$1\" + MMM[0]);\n format = format.replace(/(^|[^\\\\])MM/g, \"$1\" + ii(M));\n format = format.replace(/(^|[^\\\\])M/g, \"$1\" + M);\n\n var d = utc ? date.getUTCDate() : date.getDate();\n format = format.replace(/(^|[^\\\\])dddd+/g, \"$1\" + dddd[0]);\n format = format.replace(/(^|[^\\\\])ddd/g, \"$1\" + ddd[0]);\n format = format.replace(/(^|[^\\\\])dd/g, \"$1\" + ii(d));\n format = format.replace(/(^|[^\\\\])d/g, \"$1\" + d);\n\n var H = utc ? date.getUTCHours() : date.getHours();\n format = format.replace(/(^|[^\\\\])HH+/g, \"$1\" + ii(H));\n format = format.replace(/(^|[^\\\\])H/g, \"$1\" + H);\n\n var h = H > 12 ? H - 12 : H == 0 ? 12 : H;\n format = format.replace(/(^|[^\\\\])hh+/g, \"$1\" + ii(h));\n format = format.replace(/(^|[^\\\\])h/g, \"$1\" + h);\n\n var m = utc ? date.getUTCMinutes() : date.getMinutes();\n format = format.replace(/(^|[^\\\\])mm+/g, \"$1\" + ii(m));\n format = format.replace(/(^|[^\\\\])m/g, \"$1\" + m);\n\n var s = utc ? date.getUTCSeconds() : date.getSeconds();\n format = format.replace(/(^|[^\\\\])ss+/g, \"$1\" + ii(s));\n format = format.replace(/(^|[^\\\\])s/g, \"$1\" + s);\n\n var f = utc ? date.getUTCMilliseconds() : date.getMilliseconds();\n format = format.replace(/(^|[^\\\\])fff+/g, \"$1\" + ii(f, 3));\n f = Math.round(f / 10);\n format = format.replace(/(^|[^\\\\])ff/g, \"$1\" + ii(f));\n f = Math.round(f / 10);\n format = format.replace(/(^|[^\\\\])f/g, \"$1\" + f);\n\n var T = H < 12 ? \"AM\" : \"PM\";\n format = format.replace(/(^|[^\\\\])TT+/g, \"$1\" + T);\n format = format.replace(/(^|[^\\\\])T/g, \"$1\" + T.charAt(0));\n\n var t = T.toLowerCase();\n format = format.replace(/(^|[^\\\\])tt+/g, \"$1\" + t);\n format = format.replace(/(^|[^\\\\])t/g, \"$1\" + t.charAt(0));\n\n var tz = -date.getTimezoneOffset();\n var K = utc || !tz ? \"Z\" : tz > 0 ? \"+\" : \"-\";\n if (!utc) {\n tz = Math.abs(tz);\n var tzHrs = Math.floor(tz / 60);\n var tzMin = tz % 60;\n K += ii(tzHrs) + \":\" + ii(tzMin);\n }\n format = format.replace(/(^|[^\\\\])K/g, \"$1\" + K);\n\n var day = (utc ? date.getUTCDay() : date.getDay()) + 1;\n format = format.replace(new RegExp(dddd[0], \"g\"), dddd[day]);\n format = format.replace(new RegExp(ddd[0], \"g\"), ddd[day]);\n\n format = format.replace(new RegExp(MMMM[0], \"g\"), MMMM[M]);\n format = format.replace(new RegExp(MMM[0], \"g\"), MMM[M]);\n\n format = format.replace(/\\\\(.)/g, \"$1\");\n\n return format;\n}", "title": "" }, { "docid": "91c9f72d1ead2857a0795ca0c34eb18a", "score": "0.6964773", "text": "function format_date(date, format)\n{\n\tif (!date)\n\t{\n\t\treturn ''\n\t}\n\n\treturn moment(date).format(format)\n}", "title": "" }, { "docid": "454a222039505bbfb42789c07f4917e5", "score": "0.69600445", "text": "function formatDate(date) {\n console.log(date);\n const d = new Date(date);\n console.log(d);\n const formattedDate = `${d.getMonth() + 1}/${d.getDate()}/${d.getFullYear()}`;\n return formattedDate;\n}", "title": "" }, { "docid": "5b5797da18d6ed105bbb4881b9dcb4da", "score": "0.69550544", "text": "function _date(obj) {\n return exports.PREFIX.date + ':' + obj.toISOString();\n}", "title": "" }, { "docid": "c74a23f2f45dc42fafbf56e21456b425", "score": "0.69536996", "text": "function formatDate(date) \r\n{\r\n var d = new Date(date),\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n\r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n\r\n return [year, month, day].join('-');\r\n}", "title": "" }, { "docid": "27faff1a9adffa6307b254d882b4e299", "score": "0.6931034", "text": "function formatDate(date) {\r\n if (!date) {\r\n return '';\r\n }\r\n var month = date.getMonth() + 1;\r\n var year = date.getFullYear();\r\n var day = date.getDate();\r\n month = (month < 10) ? \"0\" + month : month;\r\n day = (day < 10) ? \"0\" + day : day;\r\n return year + \"-\" + month + \"-\" + day;\r\n}", "title": "" }, { "docid": "a35aea1642736b3771fdfd8455040deb", "score": "0.69235456", "text": "function formatDate(d) {\n date = new Date(d)\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n if (dd < 10) { dd = '0' + dd }\n if (mm < 10) { mm = '0' + mm };\n return d = yyyy + '-' + mm + '-' + dd;\n}", "title": "" }, { "docid": "175c95c3fc4cf64819044867c3ca8cdc", "score": "0.69220716", "text": "function formatDate(date) {\n let yyyy = date.getFullYear();\n let mm = date.getMonth()+1;\n if (mm<10) {\n mm = \"0\" + mm;\n }\n let dd = date.getDate();\n if (dd<10) {\n dd = \"0\" + dd;\n }\n let formattedDate = yyyy + \"-\" + mm + \"-\" + dd;\n return formattedDate;\n}", "title": "" }, { "docid": "9726bf51cf7b7975b6f118b2f2c7e1d0", "score": "0.6920367", "text": "function formatDate(date) {\n // var d = new Date(date);\n //console.log(Object.values(date));\n var split = date.toString().split(\"-\");\n var month = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n var m = month[split[1] - 1];\n var dateFormat = m + \" \" + split[2] + \", \" + split[0];\n return dateFormat;\n}", "title": "" }, { "docid": "56c7bce60e458db7e6f85a51007e1baa", "score": "0.69144744", "text": "function formatDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n if(dd<10){\n dd='0'+dd;\n }\n if(mm<10){\n mm='0'+mm;\n }\n var dstr = yyyy+'-'+mm+'-'+dd;\n return dstr;\n}", "title": "" }, { "docid": "b7c53f78bcf4805e5bad02f971422bcd", "score": "0.6909679", "text": "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 }", "title": "" }, { "docid": "d0df702b22854536628817491872bd80", "score": "0.69089824", "text": "static formatDateForOutput(date) {\n\n const dateObject = this.getDateAsObjectOfStrings(date);\n\n return dateObject.day + \"-\" +\n dateObject.month + \"-\" +\n dateObject.year + \" \" +\n dateObject.hours + \":\" +\n dateObject.minutes;\n }", "title": "" }, { "docid": "d0168c7c4d4d98a812743c3d4d88c8d1", "score": "0.6907174", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n month = '0' + month;\n }\n if (day.length < 2) {\n day = '0' + day;\n }\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "06236f4fe2ed2038ca21c40a86ef1468", "score": "0.6906871", "text": "function formattedDate(date) {\n return moment(date).format(\"DD.MM.YYYY\");\n}", "title": "" }, { "docid": "697e8acf42ca01fb33099aa108ff5ef7", "score": "0.6905836", "text": "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "6a391e43335e8060a72a821213d89081", "score": "0.6904495", "text": "function getFormattedDate(date) {\n let year = date.getFullYear();\n let month = (1 + date.getMonth()).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n\n return month + '/' + day + '/' + year;\n}", "title": "" }, { "docid": "77969297e5e1e39589e6c2a65081e2d9", "score": "0.68957996", "text": "function getFormatedDate(date) {\n var day = date.getDate();\n day = day < 10 ? '0' + day : day;\n var month = date.getMonth() + 1;\n var year = date.getFullYear();\n\n return `${day}-${month}-${year}`;\n}", "title": "" }, { "docid": "54dd350a13f2b9f6fe6907a4353b1948", "score": "0.6884217", "text": "function formatDate(date) {\n let dd = String(date.getDate()). padStart(2, '0');\n let mm = String(date.getMonth() + 1). padStart(2, '0'); //January is 0!\n let yyyy = date.getFullYear();\n let formattedDate = yyyy + mm + dd;\n return formattedDate;\n}", "title": "" }, { "docid": "1350a2da48e52ad700b12e651af09bd8", "score": "0.68775845", "text": "function formatDate (date) { \n if (typeof date === 'string') {\n return date.slice(0, 10)\n } else if (typeof date === 'object') {\n return date.toISOString().slice(0, 10)\n } else {\n throw new Error('unknown date type')\n }\n}", "title": "" }, { "docid": "6315df1f562ca23be0c64a9deff26bdd", "score": "0.6872405", "text": "function getFormattedDate(date = new Date()) {\r\n const dd = String(date.getDate()).padStart(2, '0');\r\n const mm = String(date.getMonth() + 1).padStart(2, '0'); // January is 0!\r\n const yyyy = date.getFullYear();\r\n const getFormattedDate = `${dd}/${mm}/${yyyy}`;\r\n \r\n return getFormattedDate;\r\n }", "title": "" }, { "docid": "a55a6db6ae9801afb1cc32fc1bc647c5", "score": "0.6864739", "text": "function formatDate(date) {\n function formatNum(num) {\n if (num < 10) return '0' + num;\n return String(num);\n }\n return formatNum(date.getDate()) + '/' + formatNum(date.getMonth() + 1) + '/' + date.getFullYear();\n }", "title": "" }, { "docid": "5ac85ae948e78812debc0a7ded190b62", "score": "0.6842265", "text": "format_date_api() {\n let date = this.state.date;\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let dt = date.getDate();\n\n if (dt < 10) {\n dt = \"0\" + dt;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n let changed_date = year + \"-\" + month + \"-\" + dt;\n\n return changed_date;\n }", "title": "" }, { "docid": "9ed9f629a6da3d11f6afdd0dc3c9c58c", "score": "0.68405765", "text": "function formatDate(date) {\n const input = new Date(date);\n const day = input.getDate();\n const month = input.getMonth() + 1;\n const year = input.getFullYear();\n // if day or month value is less than 10 add 0 in front\n return `${day <= 9 ? '0' + day : day}/${month <= 9 ? '0' + month : month}/${year}`;\n}", "title": "" }, { "docid": "9a61e9d840951f2f72f13ced89964184", "score": "0.68389064", "text": "function formatDate(date, formatStr) {\n\t\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n\t}", "title": "" }, { "docid": "2d7de51d16440bf9c4120a120c26289c", "score": "0.6837495", "text": "function formatDate(date){\n return moment(date, 'YYYY/MM/DD');\n}", "title": "" }, { "docid": "131becd669c9792993880795fdcf88cf", "score": "0.6830544", "text": "function formatDate(d){\n function addZero(n){\n return n < 10 ? '0' + n : '' + n;\n }\n return addZero(d.getMonth()+1)+\"/\"+ addZero(d.getDate()) + \"/\" + d.getFullYear() + \" \" + \n addZero(d.getHours()) + \":\" + addZero(d.getMinutes());\n }", "title": "" }, { "docid": "f403b580e4f61e80e00a268386bd8260", "score": "0.6827385", "text": "function formatDate(d){\n function addZero(n){\n return n < 10 ? '0' + n : '' + n;\n }\n return addZero(d.getMonth()+1)+\"/\"+ addZero(d.getDate()) + \"/\" + d.getFullYear() + \" \" + \n addZero(d.getHours()) + \":\" + addZero(d.getMinutes());\n }", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "b6d14ef1dd2b354629eea0d9d7bde709", "score": "0.68231", "text": "format(attrs) {\n return this.fixDates(attrs);\n }", "title": "" }, { "docid": "b9855dabe71ec1d6f135e44cb7d905bf", "score": "0.6820978", "text": "function formatDate(date) {\r\n\tvar month=date.getMonth()+1;\r\n\tvar year=date.getFullYear();\r\n\tvar day=date.getDate()\r\n\tmonth=(month<10)?\"0\"+month:month;\r\n\tday=(day<10)?\"0\"+day:day;\r\n\treturn year + \"-\" + month + \"-\" + day;\r\n}", "title": "" }, { "docid": "c73daf6143102f3d305c0ab89a6e717b", "score": "0.6818612", "text": "static format(date) {\n\t\tconst months = [\n\t\t\t'01',\n\t\t\t'02',\n\t\t\t'03',\n\t\t\t'04',\n\t\t\t'05',\n\t\t\t'06',\n\t\t\t'07',\n\t\t\t'08',\n\t\t\t'09',\n\t\t\t'10',\n\t\t\t'11',\n\t\t\t'12',\n\t\t]\n\t\tconst hours = [\n\t\t\t'01',\n\t\t\t'02',\n\t\t\t'03',\n\t\t\t'04',\n\t\t\t'05',\n\t\t\t'06',\n\t\t\t'07',\n\t\t\t'08',\n\t\t\t'09',\n\t\t\t'10',\n\t\t\t'11',\n\t\t\t'12',\n\t\t\t'13',\n\t\t\t'14',\n\t\t\t'15',\n\t\t\t'16',\n\t\t\t'17',\n\t\t\t'18',\n\t\t\t'19',\n\t\t\t'20',\n\t\t\t'21',\n\t\t\t'22',\n\t\t\t'23',\n\t\t\t'24',\n\t\t]\n\t\tlet result =\n\t\t\tdate.getUTCFullYear() +\n\t\t\t'-' +\n\t\t\tmonths[date.getUTCMonth()] +\n\t\t\t'-' +\n\t\t\tdate.getUTCDate() +\n\t\t\t'-T' +\n\t\t\thours[date.getUTCHours()] +\n\t\t\t':' +\n\t\t\tthis.pad(date.getUTCMinutes()) +\n\t\t\t':' +\n\t\t\tthis.pad(date.getUTCSeconds()) +\n\t\t\t'.' +\n\t\t\tthis.pad(date.getUTCMilliseconds()) +\n\t\t\t'000+0000'\n\t\treturn result\n\t}", "title": "" }, { "docid": "b433a68f409a48c8436e8d694b2496b5", "score": "0.68113256", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "b433a68f409a48c8436e8d694b2496b5", "score": "0.68113256", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "1529ab643a144e92d2bf34af0fad0aee", "score": "0.6808913", "text": "format_date_display() {\n let date = this.state.date;\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let dt = date.getDate();\n let return_str = \"\";\n if (dt < 10) {\n dt = \"0\" + dt;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return dt + \"-\" + month + \"-\" + year;\n }", "title": "" }, { "docid": "5cb63ebc4e4b6b86839d5aaf3cb499e5", "score": "0.6807339", "text": "function FormatDate(date) {\n try {\n var new_date = new Date(date);\n\n //refactor date provided to make it suitable (mm-dd)\n var day = ('0' + new_date.getDate()).slice(-2);\n var month = ('0' + (new_date.getMonth() + 1)).slice(-2);\n\n new_date = new_date.getFullYear() + \"-\" + (month) + \"-\" + (day);\n return new_date\n } catch(error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "b1911795d581a812e22dd51829940772", "score": "0.6806193", "text": "function formatDate(date) {\n var fullDate = new Date(date);\n var dd = fullDate.getDate();\n var mm = fullDate.getMonth() + 1; //January is 0!\n var yyyy = fullDate.getFullYear();\n if (dd < 10) dd = '0' + dd\n if (mm < 10) mm = '0' + mm\n fullDate = mm + '/' + dd + '/' + yyyy;\n return fullDate;\n}", "title": "" }, { "docid": "6153f3de18659592df06818e77262cb5", "score": "0.68041766", "text": "formatDate(date) {\n\t\tlet d = new Date(date);\n\n\t\tlet month = '' + (d.getMonth() + 1);\n\t\tlet day = '' + d.getDate();\n\t\tlet year = d.getFullYear();\n\t\tlet hour = d.getHours();\n\t\tlet min = ('0'+d.getMinutes()).slice(-2);\n\n\t\tif (month.length < 2)\n\t\t\tmonth = '0' + month;\n\t\tif (day.length < 2)\n\t\t\tday = '0' + day;\n\n\t\tlet res = [year, month, day].join('-');\n\t\tres = res.concat(' ');\n\t\tres = res.concat(hour.toString());\n\t\tres = res.concat(':');\n\t\tres = res.concat(min.toString());\n\n\t\treturn res;\n\t}", "title": "" }, { "docid": "bddf2b6b0fc80e29bc5cb7758a8d40ee", "score": "0.68012434", "text": "function formatDate(date) {\n let day = date.getDate().toString();\n let month = (date.getMonth() + 1).toString();\n const year = date.getFullYear().toString();\n\n // append zero to single digits day and month\n if (day.length === 1) day = \"0\" + day;\n if (month.length === 1) month = \"0\" + month;\n\n return `${day}-${month}-${year}`;\n}", "title": "" }, { "docid": "82475fae7fb5941a26b2ceebd1a222b1", "score": "0.6801231", "text": "function formatDate (d) {\n let day = d.getDate();\n\n // Adding 0 to dates up to 9. (01, 02, 03 etc:)\n if (day < 10) {\n day = '0' + day;\n }\n// adding 1 to month so its not 0-11 but 1-12\n let month = d.getMonth() + 1;\n if (month < 10) {\n month = '0' + month;\n }\n\n let year = d.getFullYear();\n\n // Returns date formatted with forward slashes\n return day + ' / ' + month + ' / ' + year;\n\n}", "title": "" }, { "docid": "9a11996e3ef12f22cc409ca98da4128a", "score": "0.6800204", "text": "function formatDate(date) {\n let dateStr = date.getUTCFullYear() + '-' +\n pad(date.getUTCMonth() + 1) + '-' +\n pad(date.getUTCDate() + 1)\n return dateStr;\n }", "title": "" }, { "docid": "13bae9e4dce16f4fe0862d1a6001c927", "score": "0.6799291", "text": "function formatDate(date, format, options) {\r\n\treturn formatDates(date, null, format, options);\r\n}", "title": "" }, { "docid": "39f537527c46fdb3d37e1d74e6192adf", "score": "0.67978036", "text": "formatDate(date) {\n const splittedDate = date.split('-')\n\n return `${splittedDate[2]}/${splittedDate[1]}/${splittedDate[0]}`\n }", "title": "" }, { "docid": "e87bce4efc68da9a48f7cd220dc99ee6", "score": "0.67937064", "text": "function getFormattedDate(date) {\n\treturn date.getFullYear()\n\t+ \"-\"\n\t+ (\"0\" + (date.getMonth() + 1)).slice(-2)\n\t+ \"-\"\n\t+ (\"0\" + date.getDate()).slice(-2);\n}", "title": "" }, { "docid": "4deacab12fd60d846f71070d5dab2eaa", "score": "0.6792987", "text": "function formatDate(date) {\r\n var d = new Date(date),\r\n month = '' + (d.getMonth()),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n\r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n\r\n return [year, month, day].join('-');\r\n}", "title": "" }, { "docid": "a5b34e67c964428cbecac63d2819fe44", "score": "0.67841005", "text": "formatDate( date ) {\n if ( !date ) { return null; }\n\n return moment( date ).format( this.getConfig( 'date_format' ) );\n }", "title": "" }, { "docid": "f55d784f9d59326c4b12e0affb2bafec", "score": "0.678409", "text": "function Get_FormatDate(date,format)\n{\n var curr_date = date.getDate();\n var curr_month = date.getMonth();\n var curr_year = date.getFullYear();\n \n var dateStr\n \n switch(format)\n {\n case \"MMM d, yyyy\":\n dateStr = m_names[curr_month] + \" \" + curr_date + \", \" + curr_year;\n break;\n \n case \"yyyy/MM/dd\":\n dateStr = curr_year + \"/\" + String(Get_2figureNumber(curr_month+1)) + \"/\" + Get_2figureNumber(curr_date);\n break;\n \n case \"yyyy-MM-dd\":\n dateStr = curr_year + \"-\" + String(Get_2figureNumber(curr_month+1)) + \"-\" + Get_2figureNumber(curr_date);\n break;\n \n default:\n break;\n }\n \n return dateStr;\n}", "title": "" }, { "docid": "3493012255dc7d133178dafc8f7204aa", "score": "0.67780566", "text": "function formatDate(date) {\n return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()\n } ${date.getDate()}${months[date.getMonth()]}${date.getFullYear()}`;\n}", "title": "" }, { "docid": "02adc2b66de5ccb6e60cf5c126f7b7df", "score": "0.6776852", "text": "function formatDate(date) {\n\n\n\tif (date.getDate() < 10){\n\t\tvar day = '0'+ date.getDate();\n\t}\n\n\tif(date.getMonth() + 1 < 10){\n\t\tvar month = '0'+ (date.getMonth() +1);\n\t}\n\n return day + \"/\" + month +\n \"/\" + date.getFullYear();\n}", "title": "" }, { "docid": "8bfeb43557211e2b6921e7b57589dd9a", "score": "0.6769254", "text": "function setFormatoDate(data) {\n\n let dd = (\"0\" + (data.getDate())).slice(-2);\n let mm = (\"0\" + (data.getMonth() + 1)).slice(-2);\n let yyyy = data.getFullYear();\n return dd + '/' + mm + '/' + yyyy;\n}", "title": "" }, { "docid": "f0698daa29325ae81f03c346c14bfaa9", "score": "0.67663825", "text": "function formatDate($dt) {\n $year = $dt.getUTCFullYear();\n if ($year < 1000) {\n $year += 1900;\n }\n return ($dt.getUTCDate() + \"-\" + ($dt.getUTCMonth() + 1) + \"-\" + $year);\n }", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6763993", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" } ]
b09aa705afc66e6a1e9ae4b9c327439a
counts up how many polaroids can fit the gallery
[ { "docid": "9e2bc492ea2e7ee10e3b7b9a0a66769d", "score": "0.7322331", "text": "function galleryCount() {\n count = Math.floor(($('.gallery-wrapper').width()-15) / $('.polaroid').width()) || 1;\n $.each( $('.polaroid'), function() {\n $(this).css({'margin' : '0px', 'display' : 'none'});\n })\n for(var i=0, l=$('.polaroid').length; i<l; i++) {\n if (i<count) {\n $('.polaroid').eq(i).css({'transform' : 'rotate(' + (Math.floor(Math.random() * 10) + -5) + 'deg) scale(1)', 'display' : 'inline-block'});\n $('.polaroid').eq(i).attr({'shown' : 'yes'});\n }\n else {\n $('.polaroid').eq(i).css({'transform' : 'rotate(0deg) scale(0)', 'margin' : '0px -200px 0px 0px', 'display' : 'none'});\n $('.polaroid').eq(i).attr({'shown' : 'no'});\n }\n }\n}", "title": "" } ]
[ { "docid": "6a781256044b2f44be93ba57e175ab89", "score": "0.60807866", "text": "function getNumTilesInCarousel(){\n\t\t\n\t\tvar width = getCarouselWidth();\n\t\t\n\t\tvar numTiles = getNumTilesInSpace(width);\n\t\t\n\t\treturn(numTiles);\n\t}", "title": "" }, { "docid": "efc6a67fa99ecb8547a2bc2dea624868", "score": "0.60703623", "text": "get length() {\n let count = this.points.length;\n if (this.divided) {\n for (var child of this.children) {\n count += child.length;\n }\n }\n return count;\n }", "title": "" }, { "docid": "6263d30f717184c435b551aaa655d1be", "score": "0.6059409", "text": "numFigures(){\n for (let row of this.fields) {\n for (let field of row) {\n if (!field.isOccupied){\n this.numEmptyFields++;\n }\n }\n }\n }", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.594038", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.594038", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "4f8c407ba433d8bccdc286003a333f74", "score": "0.5938206", "text": "function countTotalImages(){\n var numberImagesLoad = gallery.getNumberImagesLoad();\n if(gallery.images.length < gallery.totalImagesload + numberImagesLoad){\n gallery.totalImagesload = gallery.images.length;\n }else{\n gallery.totalImagesload += numberImagesLoad; \n }\n}", "title": "" }, { "docid": "73761dd99b176f24cd97e9492fc91249", "score": "0.57712084", "text": "function count_rarity() {\n let numCommons = 0;\n let numUncommons = 0;\n let numRares = 0;\n let numMythics = 0;\n for (var card in collection) {\n if (card !== \"count\") {\n let count = collection[card].count;\n for (var i = 0; i < count; i++) {\n if (collection[card].rarity === \"Common\") {\n numCommons++;\n } else if (collection[card].rarity === \"Uncommon\") {\n numUncommons++;\n } else if (collection[card].rarity === \"Rare\") {\n numRares++;\n } else if (collection[card].rarity === \"Mythic\") {\n numMythics++;\n }\n }\n }\n }\n $(\"#common-count\").text(`${numCommons}`);\n $(\"#uncommon-count\").text(`${numUncommons}`);\n $(\"#rare-count\").text(`${numRares}`);\n $(\"#mythic-count\").text(`${numMythics}`);\n}", "title": "" }, { "docid": "73761dd99b176f24cd97e9492fc91249", "score": "0.57712084", "text": "function count_rarity() {\n let numCommons = 0;\n let numUncommons = 0;\n let numRares = 0;\n let numMythics = 0;\n for (var card in collection) {\n if (card !== \"count\") {\n let count = collection[card].count;\n for (var i = 0; i < count; i++) {\n if (collection[card].rarity === \"Common\") {\n numCommons++;\n } else if (collection[card].rarity === \"Uncommon\") {\n numUncommons++;\n } else if (collection[card].rarity === \"Rare\") {\n numRares++;\n } else if (collection[card].rarity === \"Mythic\") {\n numMythics++;\n }\n }\n }\n }\n $(\"#common-count\").text(`${numCommons}`);\n $(\"#uncommon-count\").text(`${numUncommons}`);\n $(\"#rare-count\").text(`${numRares}`);\n $(\"#mythic-count\").text(`${numMythics}`);\n}", "title": "" }, { "docid": "64126b656e8ff763528051afc2f6a8a6", "score": "0.5749458", "text": "function totalSlides(){\n\t\t\treturn parseInt( $el.find('.space-slide').length );\n\t\t}", "title": "" }, { "docid": "ad806438e0c5fbec6fdfcb6f486fe2c8", "score": "0.57403725", "text": "_getGroupCenterLength(group, center){\n let count = 0;\n if(center){\n const col_i = center[0];\n const row_i = center[1];\n count += group.col_gems.filter(spot=>spot[0]===col_i).length;\n count += group.row_gems.filter(spot=>spot[1]===row_i).length;\n return count-1;\n }else{\n return group.col_gems.length ? group.col_gems.length : group.row_gems.length;\n }\n }", "title": "" }, { "docid": "357572850eff8d854ff3e98de056de9a", "score": "0.57313883", "text": "function getPolaroidSizeTest(resolution) {\n const polaroidSizes = [\n {\n width: 4,\n height: 4.1,\n area: 16.4\n },\n {\n width: 3.5,\n height: 4.2,\n area: 14.7\n }\n ];\n\n const isAround = (n, target, threshold = 0.1) => {\n return target * (1 - threshold) < n && n < target * (1 + threshold);\n };\n\n const isRightSized = ({area, width, height}, target) => {\n const targetArea = target.area * resolution ** 2;\n const targetAspectRatio = target.width / target.height;\n return (\n isAround(area, targetArea) && isAround(width / height, targetAspectRatio)\n );\n };\n\n return (datum) => {\n for (const size of polaroidSizes) {\n if (isRightSized(datum, size)) {\n return true;\n }\n }\n\n return false;\n };\n}", "title": "" }, { "docid": "7585b73699382d18725ee2636e5f9051", "score": "0.56824946", "text": "function countingValleys(n, originPath) {\r\n const path = originPath.split(\"\").map(step => (step === \"U\" ? 1 : -1));\r\n\r\n const hikingInfo = path.reduce(\r\n (acc, step) => {\r\n const startingValley = acc.altitude === 0 && step < 0;\r\n startingValley && acc.valleyCount++;\r\n\r\n acc.altitude += step;\r\n\r\n return acc;\r\n },\r\n { altitude: 0, valleyCount: 0 }\r\n );\r\n\r\n return hikingInfo.valleyCount;\r\n}", "title": "" }, { "docid": "c004bd72aae2243ad1901fa12a9e2990", "score": "0.56366545", "text": "getPlantTotal () {\n return this.generations.reduce((gacc, g) => {\n return gacc + g.filter((p) => p.state === '#').length\n }, 0)\n }", "title": "" }, { "docid": "fe074c9829a2c662edfbf276508b7d13", "score": "0.56152135", "text": "getNbJoueurs() {\n\t\tlet count = 0;\n\t\tGestionJoueur.forEach(function(j){\n\t\t\tcount+=(j.pion.axe === this.axe && j.pion.position === this.pos)?1:0;\n\t\t},this);\n\t\treturn count;\n\t}", "title": "" }, { "docid": "9e23d5b8b5b57b7f20b934be36aa8710", "score": "0.5614075", "text": "function tiles_count() {\n var t = 0;\n for(var x in pieces){\n t = t + pieces[x].amount;\n }\n return t;\n}", "title": "" }, { "docid": "fb17af7b1a7832451cc0f4f1ee17099d", "score": "0.5595698", "text": "countPages() {\n let count = 0;\n this.sections.forEach((n) => (count += n.count));\n return count;\n }", "title": "" }, { "docid": "fb17af7b1a7832451cc0f4f1ee17099d", "score": "0.5595698", "text": "countPages() {\n let count = 0;\n this.sections.forEach((n) => (count += n.count));\n return count;\n }", "title": "" }, { "docid": "90608bb1014584be4498de2bbd22cb83", "score": "0.5586113", "text": "function numGuides(direction) {\n\tvar guides = app.activeDocument.guides;\n\tvar counter = 0;\n\tfor (var i = 0; i < guides.length; ++i) {\n\t\tif (guides[i].direction == direction) {\n\t\t\tcounter++;\n\t\t}\n\t}\n\treturn counter;\n}", "title": "" }, { "docid": "11c2fe7ce1f17596cd8d3c1ce39453fe", "score": "0.5577877", "text": "get pageCount() {\n return Math.ceil(this.regions_info.roi_count_on_current_plane/\n this.regions_info.roi_page_size)\n }", "title": "" }, { "docid": "7928665f8a00c8fa532f1e9be4787bcc", "score": "0.55657923", "text": "function fitPOT(count) {\n let size = 1;\n while (size * size < count) {\n size *= 2;\n }\n return size;\n}", "title": "" }, { "docid": "f6fb5771f24ef385b8652f4f8f705d13", "score": "0.55301857", "text": "function truethemes_circle_loader_counter($this) {\n \"use strict\";\n jQuery($this).css('opacity', '1');\n var $max = parseFloat(jQuery($this).find('.vision-circle-number').text());\n jQuery($this).find('.vision-circle-number').countTo({\n from: 0,\n to: $max,\n speed: 1500,\n refreshInterval: 50\n })\n}", "title": "" }, { "docid": "5369b4f2de44fd1e165775c24734b017", "score": "0.5523773", "text": "function getIlgis(){\n var x=$(\".patiekaloWraper .patiekalas\").length;\n return x;\n}", "title": "" }, { "docid": "edc68613009a5b9557575357c24a5835", "score": "0.5501433", "text": "function getCount(objects) {\n \n let n = 0\n const func = (ar)=> {\n if(ar.x === ar.y){\n return n = n + 1;\n }else {\n return n\n }\n }\n objects.forEach(func)\n return n;\n}", "title": "" }, { "docid": "64a6b1645d578542217297f4f8d47d7a", "score": "0.54715097", "text": "function numCirclePoints(lineWidth) {\n return SECTORS_IN_CIRCLE + 1;\n}", "title": "" }, { "docid": "64a6b1645d578542217297f4f8d47d7a", "score": "0.54715097", "text": "function numCirclePoints(lineWidth) {\n return SECTORS_IN_CIRCLE + 1;\n}", "title": "" }, { "docid": "76c9fe6367a1e39aa5f1a46d131295f0", "score": "0.54672205", "text": "function somaImgs() {\n const todasImgs = document.querySelectorAll('img');\n let soma = 0;\n todasImgs.forEach((item) => {\n soma = soma + item.offsetWidth;\n });\n console.log('soma é: ' + soma);\n}", "title": "" }, { "docid": "003167b0dbe04e9dca10eb2c44777291", "score": "0.54655087", "text": "function countTotalPoints() {\r\n var total = 0 ;\r\n for (i=1; i<= 10; i++) {\r\n var two_potential_value = Math.pow(2,i);\r\n eval(\"var points\"+i+\" = \"+two_potential_value+\"* $(\\\"div.tile-\"+two_potential_value+\":not([class~='tile-merged'])\\\").size();\");\r\n eval(\"total += points\"+i+\";\");\r\n }\r\n return total;\r\n}", "title": "" }, { "docid": "3560e626fb0c8aae0310851e2db6b750", "score": "0.54598993", "text": "function countSlide(n) {\n showSlidesCrazyWaves(crazyWavesslideIndex += n);\n}", "title": "" }, { "docid": "5055ca6a36e308eb834741cca1e70c04", "score": "0.5444071", "text": "function circleSize(mag) {\r\n return mag * 7;\r\n }", "title": "" }, { "docid": "e0bbf6e12f89e5761aca79b12b4faef9", "score": "0.54278827", "text": "get_count_for_crate(parent, sensors, crate_id) {\n\n let count = 0;\n //iterate over the sensor (circles) array\n for (let i = 0; i < sensors.length; i++) {\n\n let sensor = sensors[i];\n //acquire x/y positions for a sensor\n let point = [sensor.cx.baseVal.value, sensor.cy.baseVal.value];\n //if sensor is within a crate\n if (parent.point_in_crate(crate_id, point)) {\n count++;\n }\n\n }\n return count;\n }", "title": "" }, { "docid": "d1a5ef540e920cdd438f046ff25d9679", "score": "0.5426273", "text": "function count_pixels(grid) {\n return grid.reduce(\n function (t, l) {return t.concat(l);}\n ).filter(\n function (c) {return c;}\n ).length\n}", "title": "" }, { "docid": "4ff41040b60c75db9359989a43b43385", "score": "0.5421068", "text": "function calcularCantidadHijosRamaBMas(rama)\n{\n\tvar cantidadHijos=0;\n\tvar id=rama.id;\n\t$(\"#\"+id).find(\"div\").each(function(i){\n\t\t\tvar idActual=$(this).attr(\"id\");\n\t\t\tvar primerPosicion=idActual[0];\n\t\t\tif(primerPosicion==\"N\")\n\t\t\t{\n\t\t\t\tvar divParcial=document.getElementById(idActual);\n\t\t\t\tif(divParcial.childNodes.length == 1)\n\t\t\t\t{\n\t\t\t\t\tcantidadHijos=cantidadHijos +1;\n\t\t\t\t}\n\t\t\t}\n });\n\treturn cantidadHijos;\n}", "title": "" }, { "docid": "7532cbe35b39bc1101bc2b6f2dc888bd", "score": "0.54202944", "text": "function getCount$1(arrs) {\n\t return arrs.length;\n\t}", "title": "" }, { "docid": "c650c0ecaa257fd4549c82ff6f5ee34c", "score": "0.5417896", "text": "function getNumberOfRooms(){\r\n roomLen = inputRoom.rooms[0].length; // along z\r\n roomBre = inputRoom.rooms.length; // along x\r\n roomList = [];\r\n for (var l = 0 ; l < roomLen; l++){\r\n for(var b = 0; b < roomBre; b++) {\r\n if( Number.isInteger(inputRoom.rooms[b][l]) ) {\r\n if( !roomList.includes(inputRoom.rooms[b][l]) ){\r\n roomList.push(inputRoom.rooms[b][l]);\r\n }\r\n }\r\n // get portals along with it\r\n if( inputRoom.rooms[b][l] == \"p\"){\r\n // console.log(\"p @: \" + b + \" \" + l);\r\n portals.push([\r\n //Right face\r\n [(b+1)*wallBredth-deltaBre, 0, l*wallLength-deltaLen],\r\n [(b+1)*wallBredth-deltaBre, 0, (l+1)*wallLength-deltaLen],\r\n [(b+1)*wallBredth-deltaBre, 1, (l+1)*wallLength-deltaLen],\r\n [(b+1)*wallBredth-deltaBre, 1, l*wallLength-deltaLen],\r\n //LeftFace\r\n [b*wallBredth-deltaBre, 0, l*wallLength-deltaLen],\r\n [b*wallBredth-deltaBre, 0, (l+1)*wallLength-deltaLen],\r\n [b*wallBredth-deltaBre, 1, (l+1)*wallLength-deltaLen],\r\n [b*wallBredth-deltaBre, 1, l*wallLength-deltaLen]\r\n ]);\r\n }\r\n }\r\n }\r\n // console.log(portals);\r\n return roomList.length;\r\n}", "title": "" }, { "docid": "ef5742e6fd005a0893a7975dfc6b623a", "score": "0.53892887", "text": "function countVotes() {\n for(var k in Pic.allPictures) {\n picVotes[k] = Pic.allPictures[k].countClick;\n }\n}", "title": "" }, { "docid": "b2aad3471504f621f59df3fe91f1408d", "score": "0.5380394", "text": "function shapeArea(n) {\n var nInit = 0;\n var nCount = 0;\n while (nCount < n) {\n nInit = nInit + (4 * nCount);\n if (nInit == 0) {\n nInit = 1;\n }\n nCount++;\n console.log(nInit);\n }\n return nInit\n}", "title": "" }, { "docid": "e7590da7c66ecaa64956faff5afd426b", "score": "0.53603727", "text": "size() {\n return sumBy(this.resources, (resource) => size(resource.items));\n }", "title": "" }, { "docid": "646c7c7181769a38b4bcce0a59ee0119", "score": "0.53530395", "text": "count() {\n let n = 0;\n for (const list of this.lists) {\n n += list.group.elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "646c7c7181769a38b4bcce0a59ee0119", "score": "0.53530395", "text": "count() {\n let n = 0;\n for (const list of this.lists) {\n n += list.group.elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "85d74aba90be833fd4ba8a7e0cd94b91", "score": "0.5347758", "text": "get numberOfVampiresFromOriginal() {\n let numVampire = 0;\n\n if (this.creator !== null) {\n let creator = this.creator;\n while (creator !== null) {\n numVampire++;\n creator = creator.creator;\n }\n }\n return numVampire;\n }", "title": "" }, { "docid": "37d589eebb749baf3b49750b25431887", "score": "0.534373", "text": "function countLoadedImages()\n {\n var nCompleted = 0;\n for(var i = 0; i < 2 * nImages; i++)\n {\n if(imgArrField[i].complete)\n {\n nCompleted++;\n } //else alert(imgArrField[i].src);\n }\n\n for(var i = 0; i < 4; i++)\n {\n if(imgArrStartStop[i].complete)\n {\n nCompleted++;\n } //else alert(imgArrStartStop[i].src);\n }\n\n for(var i = 0; i < 4; i++)\n {\n if(imgArrPlusMinus[i].complete)\n {\n nCompleted++;\n } //else alert(imgArrPlusMinus[i].src);\n }\n\n for(var i = 0; i < 11; i++)\n {\n if(imgArrNumber[i].complete)\n {\n nCompleted++;\n } //else alert(imgArrNumber[i].src);\n }\n return nCompleted;\n }", "title": "" }, { "docid": "ff8d6c11dc795b0988591f87b8d3b8a5", "score": "0.5338176", "text": "function howManyAreThere(floorNum){\r\n //console.log(\"howManyAreThere\");\r\n var z = 0;\r\n _.each(elevators, function(elevator){\r\n if(elevator.currentFloor() === floorNum){\r\n z+= 1;\r\n }//close if\r\n });//close each\r\n return z;\r\n }", "title": "" }, { "docid": "2f0c6ff6a679d49e65d1ec16078dba00", "score": "0.53308207", "text": "function calculateNumberofSlides() {\n\n // This will only run after the ng-repeat has rendered its things to the DOM\n setTimeout(function() {\n //console.log('calculate number of slides');\n\n if ($body.hasClass(mobileDevice)) {\n maxNumberOfItems = 6;\n //console.log('mobile device - set max number of items to ' + maxNumberOfItems);\n } else if ($body.hasClass(tabletDevice)) {\n maxNumberOfItems = 9;\n //console.log('tablet device - set max number of items to ' + maxNumberOfItems);\n } else if ($body.hasClass(desktopDevice)) {\n maxNumberOfItems = 12;\n //console.log('desktop device - set max number of items to ' + maxNumberOfItems);\n }\n\n numberOfSlides();\n\n return;\n \n }, 500); // wait...\n\n }", "title": "" }, { "docid": "7193f264acbc66f83068cc76da20cdef", "score": "0.5330636", "text": "function CountActiveCircle() {\n return d3.selectAll('.activeCircle').size();\n }", "title": "" }, { "docid": "d75025b7f6814d273c9b040c37030163", "score": "0.5326107", "text": "function somaImagens() {\nconst imagens = document.querySelectorAll('img');\nlet soma =0\n\nimagens.forEach((imagem) => { // como deve somar cada imagem, usar um forEach\n soma += imagem.offsetWidth\n});\n console.log(soma);\n}", "title": "" }, { "docid": "be2ad2d694d7b7087f2c6cbbbecd8432", "score": "0.5317322", "text": "function getItemsCount() {\n if ((uniFlatItems == null) || (uniFlatFirstItem == null) || (uniFlatContent == null)) {\n return 0;\n }\n\n var cols = uniFlatItems.width() / uniFlatFirstItem.outerWidth(true) | 0;\n var rows = uniFlatContent.height() / uniFlatFirstItem.outerHeight(true) | 0;\n return cols * rows;\n}", "title": "" }, { "docid": "8a7386212ed70e041ea49c68c7d49dab", "score": "0.53151906", "text": "function loadCount(){\t\n\t\t\n\t\tloaded++;\n\t\tif(loaded >= arrImgs.length){\n\t\t\tfl.show(event, 300, 250, FC_CLOSE_ON_OUTSIDE_CLICK | FC_AUTO_POSITION_CENTER | FC_CLOSE_ON_ESC);\n\t\t}\n\t}", "title": "" }, { "docid": "732ed7e9e21cd03e1c588edc8102acd8", "score": "0.5314635", "text": "function countTimesShown() {\n for (var j in Pic.allPictures) {\n picShow[j] = Pic.allPictures[j].countShow;\n }\n}", "title": "" }, { "docid": "3469f78a9aeb6e9bc1d168cd34b42334", "score": "0.52914095", "text": "get count () {\n const tagsAreaChildren = this.shadowRoot.querySelectorAll(\"#tags-area > div.tag\");\n return tagsAreaChildren.length;\n }", "title": "" }, { "docid": "9c21364e150a2767d266bc293a341ebf", "score": "0.52897775", "text": "function checkCurrentImageCount() {\n var imageBoxesLength = document.getElementsByClassName(\"imageBox\").length;\n currentImageCount = imageBoxesLength;\n return imageBoxesLength;\n}", "title": "" }, { "docid": "fc23254956f679ba14ad4031259c8e19", "score": "0.52824044", "text": "function getRatio(p, width, height, numRoutes){\n\tlet count = 1;\n\tlet product = 1;\n\tlet widthNum = count;\n\tlet heightNum = count;\n\twhile(product < numRoutes){\n\t\tlet products = [];\n\t\tcount++;\n\t\t//add one to width\n\t\tproductA = count*(count-1);\n\t\t//add one to height\n\t\tproductB = (count-1)*count;\n\t\t//add one to both\n\t\tproductC = count*count;\n\t\tif(productA >= numRoutes){\n\t\t\tproducts.push(productA);\n\t\t}\n\t\tif(productB >= numRoutes){\n\t\t\tproducts.push(productB);\n\t\t}\n\t\tif(productC >= numRoutes){\n\t\t\tproducts.push(productC);\n\t\t}\n\t\tif(products.length>0){\n\t\t\tproduct = Math.min.apply(Math, products);\n\t\t\twidthNum = count;\n\t\t\theightNum = count;\n\t\t\tif(product==productA){\n\t\t\t\twidthNum = count;\n\t\t\t\theightNum = count-1;\n\t\t\t}\n\t\t\telse if(product==productB){\n\t\t\t\twidthNum = count-1;\n\t\t\t\theightNum = count;\n\t\t\t}\n\t\t}\n\t}\n\treturn [widthNum, heightNum];\n}", "title": "" }, { "docid": "e3aed492f8c792202db1cf99af99004e", "score": "0.5281509", "text": "get countSides() {\n // console.log(\"this.arr.length\", this.arr.length)\n // this.arr.length 3\n // that returns the number of sides of the polygon\n return this.arr.length\n }", "title": "" }, { "docid": "4688c0a90cfd5186c7343ae19b436061", "score": "0.5281228", "text": "function inicio()\n{\n var count = 0;\n $(\"#preguntas\").children().each(function(){\n \n if( $(this).attr('id') != 'preg0')\n {\n $(this).hide();\n }\n count++;\n });\n \n \n $(\"#fin\").hide();\n ocultaAlertaVotos();\n insertaVotos();\n \n return count/3;\n}", "title": "" }, { "docid": "034c2a377823486ce9b2d7c3caec9a44", "score": "0.5280462", "text": "function somaImagens() {\n const imgs = document.querySelectorAll(\"img\") //pegou todas as imagens\n let soma = 0\n imgs.forEach((imagem) => {//pegou a largura de CADA imagem \n soma =+ imagem.offsetWidth\n });\n console.log(soma)\n}", "title": "" }, { "docid": "ac228746a7bcaf16a6e3d8ba503e092e", "score": "0.52606934", "text": "function getNumTilesInSpace(space){\n\t\t\n\t\tvar numItems = g_functions.getNumItemsInSpace(space, g_temp.tileWidth, g_options.carousel_space_between_tiles)\n\t\t\t\t\n\t\treturn(numItems);\n\t}", "title": "" }, { "docid": "13f19fbe1ca9244408f5c8a8c3e05453", "score": "0.52597", "text": "function showTotalLikes(){\n let numberTotalLikes = 0;\n let totalLikes;\n allmedia.forEach( elmt => {\n if(elmt.image){\n numberTotalLikes += elmt.likes;\n }\n });\n totalLikes = elmtFactory('article', {class: 'totalLikes'},\n elmtFactory('section', { class: 'totalLikes_section', value: numberTotalLikes}, numberTotalLikes.toString(),\n elmtFactory('img', { src: './public/coeur.svg', id: 'totalLikes_img', alt: 'likes'})),\n elmtFactory('section', { class: 'totalLikes_section_price'}, pricePhotograph.toString() + '€ / jour'),\n );\n photographerHead.appendChild(totalLikes);\n}", "title": "" }, { "docid": "fadcbf47060771fac7de1afce8476887", "score": "0.5255649", "text": "getWheelsCount() {\n return this.wheels;\n }", "title": "" }, { "docid": "3d655ae0ca16e1cd9b0a1c541d2cdc14", "score": "0.5255543", "text": "function lyricLineCount()\n { var count =0;\n var i=0;\n while (i < ARRlines.length)\n {\n if (lineType(ARRlines[i])== \"lyric\"){count =count+1;}\n i = i+1;\n } \n return count;\n }", "title": "" }, { "docid": "5ee79dfdd579988a80b33b9bb24d23e3", "score": "0.5254387", "text": "get numberOfVampiresFromOriginal() {\n let distance = 0;\n let currentVamp = this;\n\n while (currentVamp.creator) {\n\n currentVamp = currentVamp.creator;\n distance++;\n // console.log('num vamps from orig: ', distance)\n }\n return distance;\n }", "title": "" }, { "docid": "8527ffceb77c9547f125f7f10164509a", "score": "0.52506703", "text": "function fillNumDigits(){\r\n\tvar imgs=document.getElementsByTagName('img');\r\n\tfor(i=0;i<imgs.length;i++){\r\n\t\tvar img=imgs[i];\r\n\t\tvar parent = img.parentNode;\r\n\t\tif(img.alt==img.title&&img.alt.indexOf(\".jpg\")!=-1){\r\n\t\t\tnumDigits=img.alt.length-4;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "aa78cb44a0d749ce9e8b357e4e684098", "score": "0.52445", "text": "get totalDimensionsAndGoals () {\n let total = store.dimensionsList.selection.length + store.dimensionsGoalsList.selection.length\n return total\n }", "title": "" }, { "docid": "8eb6ae803ea9a6c94c0a474481d0cd19", "score": "0.5242975", "text": "function numVaccinesFromBoxes(pfizer, moderna) {\n return (pfizer * pfizerBox) + (moderna * modernaBox);\n }", "title": "" }, { "docid": "ee3fd0f3232f2a3d5aae50852e80594a", "score": "0.52424926", "text": "function getFloorCount () {\n\t\tfloorCount = Math.ceil((height - floorOffsetHeight - gameUiHeight)/floorHeight);\n\t\treturn floorCount;\n\t}", "title": "" }, { "docid": "273b337806e9656529285de24df646a0", "score": "0.52393126", "text": "hematologyCount() {\n return Obs.find({ 'resource.code.coding.0.code': { $in: labGroups.hematology.all } }).fetch().length\n }", "title": "" }, { "docid": "70dd107d6e2326c9c4b33ee61b7c640d", "score": "0.52382714", "text": "function photoSize(){\nif(this.radius <= max_radius && this.radius >35){\n return \"images/usr\" + (this.id%8) + \"/l.jpg\";\n} else if (this.radius<=35 && this.radius >15){\n return \"images/usr\" + (this.id%8) + \"/m.jpg\";\n} else if (this.radius<=15 && this.radius >min_radius){\n return \"images/usr\" + (this.id%8) + \"/s.jpg\";\n} else return \"\";\n}", "title": "" }, { "docid": "e6052e95e8ca5cd0f62eea3ec213a9c7", "score": "0.5237346", "text": "function area()\r\n{\tvar area=0;\r\n\tfor(let i=0;i<totalBubbles.length;i++)\r\n\t{\r\n\t\tarea+=Math.PI*totalBubbles[i].radius*totalBubbles[i].radius;\r\n\t}\r\n\tarea=area/1127424;\r\n\treturn area;\r\n}", "title": "" }, { "docid": "38c893bf1940fc510cf604f0256add7d", "score": "0.52347696", "text": "function getCount(objects) {\n var count = 0;\n for (var i = 0; i < objects.length; i++) {\n if (objects[i].x == objects[i].y) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "0d4fd8f5ff4e52c4ee5acef81d34898d", "score": "0.5234674", "text": "function countSheeps(r) {\n let x = []\n let y = r.filter((i) => i == true)\n return y.length\n}", "title": "" }, { "docid": "ce39eb633596adc864cbf70574b794be", "score": "0.5215126", "text": "agg(km) {\n const sizes = [5000, 1250, 156, 39.1, 4.89, 1.22, 0.153, 0.038, 0.004];\n\n let level = 0;\n let base = 1000;\n sizes.map((item, index) => {\n const temp2 = km / item - 8;\n if (Math.abs(temp2) < base) {\n base = Math.abs(temp2);\n level = index + 1;\n }\n });\n return level;\n }", "title": "" }, { "docid": "61041e5121e8c8155aea2081a6e30b9a", "score": "0.5209532", "text": "function PuntiDiSincronia() {\r\n return PuntiSincronia.length;\r\n}", "title": "" }, { "docid": "7ba364cf5c0c43e1bae92a24767639ac", "score": "0.5204594", "text": "function updateSlimeCountTable() {\n\t$('.slimeCountTableRow').each(function (index) {\n\t\tif ($(this).attr('id') === 'slimeCountTableRowTemplate') return true;\n\t\tvar slimeName = $(this).attr('id');\n\t\tslimeName = slimeName.slice(6);\n\n\t\tvar numberOfCorrals = 0;\n\t\t$.each(plots, function (key, value) {\n\t\t\tif (value.occupied === true && (value.type === 'corral' || value.type === 'freerange')) {\n\t\t\t\tif (value.firstItem === slimeName || value.secondItem === slimeName) numberOfCorrals++;\n\t\t\t}\n\t\t});\n\n\t\t$(this).find('.SlimeCountNumber').text(numberOfCorrals);\n\t});\n}", "title": "" }, { "docid": "9c4baf43409f674f36d5b275fb72916e", "score": "0.5200582", "text": "function getStars() {\n stars = document.querySelectorAll('.stars li');\n starCount = 0;\n for (star of stars) {\n if (star.style.display !== 'none') {\n starCount++;\n }\n }\n // console.log(starCount); // TESTING. Should show 2.\n return starCount;\n}", "title": "" }, { "docid": "b141514cae99e20f3e822123b4de598b", "score": "0.5193349", "text": "function getDivisorsCnt(n){\n var numOfDivisorsArr = [];\n for (var i = 0; i <= n; i++){\n if(n % i === 0){\n numOfDivisorsArr.push(i);\n }\n }\n return numOfDivisorsArr.length;\n}", "title": "" }, { "docid": "f0159e1f1b55bbe65f22c63436d9447a", "score": "0.51908976", "text": "function countPieces() {\n var pieceCount = new Array(10);\n for (var i = 0; i < 10; ++i) {\n pieceCount[i] = 0;\n }\n for (var i = 50; i < 88; ++i) {\n if (Board[i].piece != null) {\n ++pieceCount[Board[i].piece.type];\n }\n }\n return pieceCount;\n}", "title": "" }, { "docid": "9a19dc4aab54e926293121ea62a464d8", "score": "0.51892585", "text": "function getStars() {\n\tstars = document.querySelectorAll('.stars li');\n\tstarCount = 0;\n\tfor (star of stars) {\n\t\tif (star.style.display !== 'none') {\n\t\t\tstarCount++;\n\t\t}\n\t}\n\tconsole.log(starCount); // 2\n\treturn starCount;\n}", "title": "" }, { "docid": "69d166d2e20ba9c81b821eed7a48e904", "score": "0.5185005", "text": "get n() {\n return this.magicCarpet.length\n }", "title": "" }, { "docid": "c61cbe6223d97e22e2ef4b4a39391bdc", "score": "0.5184579", "text": "function getNumPerScreen() {\n\t\t\t// Get dimensions on demand to account for screen resizes\n\t\t\tvar visibleWidth = element[0].offsetWidth;\n\t\t\tvar items = scope.items;\n\n\t\t\tfor (var i=0; i<items.length; i++) {\n\t\t\t\tif (getItemOffset(i) + items[i].offsetWidth > visibleWidth) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "28619b1ad4a3561691cfdb15c7f6324f", "score": "0.51815605", "text": "get numberOfVampiresFromOriginal() {\n let distance = 0;\n let currentVamp = this;\n while (currentVamp.creator) {\n currentVamp = currentVamp.creator;\n distance++;\n }\n return distance;\n }", "title": "" }, { "docid": "3eb321aa5341920ad926c06dbe5a20b3", "score": "0.51807123", "text": "function getCount(objects) {\n return objects.filter(i => i.x == i.y).length;\n}", "title": "" }, { "docid": "0d98334da5397f38401d70511bdac191", "score": "0.5180483", "text": "function calcNumRows(){\n \tvar map = document.getElementById('map');\n \tif(map != null){\n \t\tvar height = map.naturalHeight; //calculate the height of the map\n \t\n \theight -= boxWidth;\n \theight = height / (boxWidth + gridWidth);\n \tvar temp = [];\n\t\t\tfor(var i = 0; i < height; i++)\n\t\t\t\ttemp.push(i+1);\n \t\n \tif(temp.length != 0){\n \t\t$interval.cancel(rowTimer); //cancel $interval timer\n \t\t$scope.rows = temp;\n \t}\n \t}\n }", "title": "" }, { "docid": "07e206cf9f184313f7cbbae4a0d84e6d", "score": "0.5180372", "text": "get length() {\n let result = 0;\n\n for (let i = 0; i < this.sections.length; i += 2) result += this.sections[i];\n\n return result;\n }", "title": "" }, { "docid": "afc21623f34a4002879845533ee66b3a", "score": "0.5180242", "text": "function testSize() {\n for (i = 0; i < 1; i++) {\n if ((y += skip) >= dHeight - (skip / 2)) {\n y = skip / 2;\n yCountT++;\n if ((x += skip) >= offSet - (skip / 2)) x = skip / 2;\n xCount++;\n //print('Y count = ' + yCount); // prints to consolde for testing\n }\n }\n}", "title": "" }, { "docid": "1961b88e5bc76388ee8a018e19338b2b", "score": "0.5178515", "text": "function countSquares() {\n var countNo = $('#square-no > .hc-square').length;\n var countUnclear = $('#square-unclear > .hc-square').length;\n var countYes = $('#square-yes > .hc-square').length;\n\n // change count text to square count per column\n $('#hc-count-no').text(countNo);\n $('#hc-count-unclear').text(countUnclear);\n $('#hc-count-yes').text(countYes);\n }", "title": "" }, { "docid": "d8ed4406a623fe20b54a3ae83559135a", "score": "0.5177347", "text": "area() {\n return this.size ** 2\n }", "title": "" }, { "docid": "64e7a9aac486a73418bf11860c2af703", "score": "0.5176677", "text": "function countDomElements() {\n nb = wrap.getElementsByTagName(\"*\").length;\n displayNbInRes();\n }", "title": "" }, { "docid": "ac90c18866ac6473889b798f21f48d68", "score": "0.517502", "text": "function widthOf(grid) {\n if (heightOf(grid) === 0) {\n return 0;\n }\n return (grid[0]).length;\n}", "title": "" }, { "docid": "618fd261324bf5d3e56d0e6647b64886", "score": "0.51715904", "text": "function testSize() {\n for (i =0; i<1; i++){\n if ( (y += skip) >= height-(skip/2)) {\n y = skip/2; yCountT ++;\n if ( (x += skip) >= offSet-(skip/2)) x = skip/2; xCount++; \n //print('Y count = ' + yCount); // prints to consolde for testing\n }\n }\n}", "title": "" }, { "docid": "01515b5563a7eeeb644d7de740e82901", "score": "0.5171326", "text": "function showImage() {\n var result = [];\n\n for (let i = 0; i < questions.length; i++) {\n if (questions[i][\"power\"]) {\n questions[i][\"counter\"]++;\n result.push(questions[i]);\n }\n if (questions[i][\"cape\"]) {\n questions[i][\"counter\"]++;\n console.log(\"counter\");\n result.push(questions[i]);\n }\n if (questions[i][\"weather\"]) {\n questions[i][\"counter\"]++;\n result.push(questions[i]);\n }\n if (questions[i][\"money\"]) {\n questions[i][\"counter\"]++;\n result.push(questions[i]);\n }\n return getHighestCounter(result);\n \n }\n\n // Gets object with highest counter\n function getHighestCounter(data) {\n return data.reduce(\n (max, data) => (data.counter > max ? data.counter : max),\n data[0]\n );\n }\n}", "title": "" }, { "docid": "6795186a2d27c5c4ee508246e2e2f5be", "score": "0.517021", "text": "function getMarkerSize(numberOfPoems) {\n\treturn 40+(40*(numberOfPoems*0.7));\n}", "title": "" }, { "docid": "d4ed8f28097e7f68b74127419f545765", "score": "0.5164396", "text": "function get_pixel_count() {\n\treturn imageData.data.length / 4;\n}", "title": "" }, { "docid": "35697365e268090ce4bd5df71a1f6d1d", "score": "0.51635337", "text": "function calculateReduceCount( ware, count ) {\n if( count ) {\n return unwrap( ware.isDivisible ) ? count / Number( unwrap( ware.phPackSize ) ) : count === undefined ? 1 : count;\n } else {\n return count === undefined ? 1 : count;\n }\n }", "title": "" }, { "docid": "d1acbab36c3254d2c44156f31006d9dc", "score": "0.51634973", "text": "countPages() {\n let sc = this.document.sections;\n let count = 0;\n for (let index = 0; index < sc.section.length; index++) {\n count += sc.section[index].count;\n }\n return count;\n }", "title": "" }, { "docid": "d1acbab36c3254d2c44156f31006d9dc", "score": "0.51634973", "text": "countPages() {\n let sc = this.document.sections;\n let count = 0;\n for (let index = 0; index < sc.section.length; index++) {\n count += sc.section[index].count;\n }\n return count;\n }", "title": "" }, { "docid": "113f5de3f74e2409480b21754bb74adb", "score": "0.51605654", "text": "function realSize(arrays) {\n let count = 0;\n function helper(arrays) {\n for (let array of arrays) {\n if (Array.isArray(array)) {\n helper(array);\n } else if (typeof array === 'number') count++;\n }\n }\n helper(arrays);\n return count;\n}", "title": "" }, { "docid": "4b12adf993ace8f51f86ba2f0e3003c3", "score": "0.5159897", "text": "function calculateLength() {\n\t\tvar length = $(window).width()-$('#steps').width()-75;\n\t\treturn length;\n\t}", "title": "" }, { "docid": "8015b76a34364fbf590285772e893012", "score": "0.51587856", "text": "get numberOfVampiresFromOriginal() {\n let numberOfVamps = 0;\n let currentVamp = this;\n\n while (currentVamp.creator) {\n currentVamp = currentVamp.creator;\n numberOfVamps++;\n }\n\n return numberOfVamps;\n }", "title": "" }, { "docid": "d89ddb60cb21f1349b2bf9833f028333", "score": "0.51524603", "text": "function countO() {\n\tnumO = 0;\n\tfor (var i = 1; i <= 9; i++) {\n\t\tif (boxNumID(i).innerText == \"O\") {\n\t\t\tnumO++\n\t\t}\n\t}\n}", "title": "" }, { "docid": "11acc677018ad62a24816513a64e1280", "score": "0.5150199", "text": "function metaphorScale(count){\n\tvar size = 14+(count)/3;\n\treturn size;\n}", "title": "" }, { "docid": "c98c84efc278edf0f83ebc7d2578cda7", "score": "0.51482576", "text": "get numberOfVampiresFromOriginal() {\n let distance = 0;\n let currentVampire = this;\n\n while (currentVampire.creator) {\n distance++;\n currentVampire = currentVampire.creator;\n }\n return distance;\n }", "title": "" }, { "docid": "1af194415d9ba8e2eb722101a6e150f8", "score": "0.51479715", "text": "function updateCounts() {\n forEach(countEls, function (el) {\n var checkboxes = getCheckboxes(document.querySelector(el.getAttribute('data-context'))),\n count = checkboxes.reduce(function (sum, el) {\n return sum + el.checked;\n }, 0);\n el.textContent = count + ' of ' + checkboxes.length;\n });\n }", "title": "" } ]
365a517acda445b395b01c07a8423406
For the selected organism, update the annotation listing
[ { "docid": "c0e2860d4ec947d1d142f27c800c2ee3", "score": "0.5198775", "text": "function updateAnnotList(){\n var orgg_id;//= getSelected(document.getElementById(\"orgg\")); // Find the selected organism group\n var oversion_id=getSelected(document.getElementById(\"organism\")); // Find the selected organism \n var url; var xmlHttp;\n xmlHttp= init_XmlHttpObject();\n var curDateTime = new Date(); var curHour = curDateTime.getHours();\n var curMin = curDateTime.getMinutes(); var curSec = curDateTime.getSeconds();\n var date =curHour+\":\"+curMin+\":\"+curSec;\n if (xmlHttp==null)\n {\n alert (\"Your browser does not support AJAX!\");\n return;\n }\n url=\"getOrganismList.php?o=\"+orgg_id+\"&ov=\"+oversion_id+\"&t=1&sid=\"+Math.random()+\"&data=\"+date;\n xmlHttp.onreadystatechange= function(){\n if (xmlHttp.readyState==4)\n {\n if (xmlHttp.status == 200){\n document.getElementById(\"filter\").innerHTML = xmlHttp.responseText;\n }\n else {\n alert('There was a problem with the request.');\n }\n }\n }\n\n \n xmlHttp.open(\"GET\",url,true);\n xmlHttp.setRequestHeader(\"If-Modified-Since\",\"Sat, 1 Jan 2000 00:00:00 GMT\");\n var t = curDateTime.getTime();\n var thetimestring=t.toString(10);\n xmlHttp.send(thetimestring);\n delete curDateTime;\n\n\n}", "title": "" } ]
[ { "docid": "b0324573a852c95f37e414f7473ede46", "score": "0.60833937", "text": "function updateAnnotationDisplay() {\n //console.log(\"Updating annotation\");\n\n let annotations = PM.getCurrentSong().annotations;\n let annotationBar = $(\".annotations-bar\").empty();\n let duration = PM.getDuration();\n if(!annotations || !annotations.length) {\n return;\n }\n let lastTimestamp = duration;\n\n for(let i = annotations.length - 1; i >= 0; i--) {\n let annotation = annotations[i];\n let start = annotation.start;\n let end = annotation.end;\n lastTimestamp = addGapSegmentIfNeeded(start, end, lastTimestamp, duration, annotationBar);\n lastTimestamp = addAnnotationSegment(start, lastTimestamp, duration, annotationBar, annotation.color);\n }\n }", "title": "" }, { "docid": "7d50d64d63449ae11ccb2cfda1418f51", "score": "0.5914538", "text": "function updateAnnotations() {\n var newAnnotations = {};\n\n lodash.forEach(ctrl.annotations, function (annotation) {\n if (!annotation.ui.isFormValid) {\n $rootScope.$broadcast('change-state-deploy-button', { component: annotation.ui.name, isDisabled: true });\n }\n newAnnotations[annotation.name] = annotation.value;\n });\n lodash.set(ctrl.version, 'metadata.annotations', newAnnotations);\n ctrl.onChangeCallback();\n }", "title": "" }, { "docid": "58dd1eb44cdb946346bbb7a749e4cf9c", "score": "0.5891464", "text": "function updateAnnotationListAfterSave(annotation, newlyCreated, doNotTriggerEvent) {\n console.log('updateAnnotationListAfterSave()');\n\n /**\n * This section of code is used to replace the existing annotation object when user edits an annotation like\n * moving its located, resizing it, or editing comments associated to this annotation.\n *\n * This can be placed inside the success block of the ajax call to save annotation to server if\n * Default.SAVE_ALL_ANNOTATIONS_ONE_TIME is false.\n */\n var replaced = false;\n for (var i=0; i<annotations.length; i++) {\n if (annotations[i].id == annotation.id) {\n annotations.splice(i, 1, annotation);\n replaced = true;\n break;\n }\n }\n\n if ((annotation.id <= 0 || (annotation.id > 0 && (!annotation.audio && !annotation.audioAvailable))) &&\n annotation.annotationType == Annotation.TYPE_AUDIO)\n {\n showPlayer(annotation);\n }\n\n if (!replaced) annotations.push(annotation);\n\n if (annotation.annotationType == Annotation.TYPE_TEXT)\n $('#texts').attr('id', 'texts' + annotation.id);\n else if (annotation.isSelectableTextType()) {\n // Save to server and get returned id and assign id to all div elements where id=highlight\n $('#pageContainer' + (annotation.pageIndex + 1) + ' .canvasWrapper').children('div[id=\"highlight\"]').each(function() {\n $(this).attr('id', 'highlight' + annotation.id);\n });\n }\n /**\n * Reset the last tracked positions once saved so that these will be assigned values\n * when they will be used again.\n */\n else if (annotation.annotationType == Annotation.TYPE_ARROW || annotation.annotationType == Annotation.TYPE_MEASUREMENT_DISTANCE) {\n for (var i=0; i<annotation.drawingPositions.length; i++) {\n annotation.drawingPositions[i].lastX = -1;\n annotation.drawingPositions[i].lastY = -1;\n }\n }\n\n // Update the reference to annotations in Angular JS\n refreshAnnotationList();\n\n // If annotation is TYPE_STICKY_NOTE, show popu comment form if default option is true.\n if (newlyCreated && Default.ANNOTATION_STICKY_NOTE_POPUP_ON_CREATE &&\n annotation.annotationType == Annotation.TYPE_STICKY_NOTE)\n {\n $.contextMenu('destroy', '#' + canvasIdName + (annotation.pageIndex + 1));\n editAnnotation(annotation, 'edit');\n }\n\n if (Default.CREATE_ANNOTATION_EVENTS && !doNotTriggerEvent)\n createAnnotationEvent(annotation);\n}", "title": "" }, { "docid": "b6b2810d8824655e289b7014c32a93ef", "score": "0.5886232", "text": "submitAnnotationEdit(){\n\t\t\t// let index = this.selected.props.index;\n\t\t\t// let theChannels = this.state.annotationObjects[this.selected.props.channel];\n\t\t\t// //update the annotation that is selected, by creating a new collection of annotations and modifying it\n\t\t\t// //this.state.annotationObjects[index].annotation = this.newAnnotationText\n\t\t\t//;\n\t\t\t// let newAnnotationObjects = Object.create(theChannel);\n\t\t\t// newAnnotationObjects[index].annotation = this.newAnnotationText\n\t\t\t//;\n\t\t\tlet newAnnotationMap = new annotationMap(this.state.annotationObjects).editAnnotation(this.selected.props.channels, this.selected.props.quote, this.annotation.value);\n\t\t\tthis.updateState({\n\t\t\t\tannotationObjects: newAnnotationMap,\n });\n\t\t\tthis.newAnnotationChannels = newAnnotationMap.keysAsArray();\n\t\t\tthis.prevOperation = this.operation;\n\t\t\tthis.operation = \"edit\";\n\t\t\tthis.switchAnnotationStyle();\n\t\t}", "title": "" }, { "docid": "ceba6927127480ed6c81e3c879a68454", "score": "0.58317214", "text": "function setAnnotation()\n{\n var tipo;\n var tipo2;\n var attr;\n numAnnTot++;\n \n //in base al tipo di annotazione si inseriscono i dati relativi\n if ($('#inserimentocommento').css('display') === 'block') {\n tipo = 'hasComment';\n tipo2 = 'commento';\n attr = $('#insertcomment').val();\n } else if ($('#inserimentoretorica').css('display') === 'block') {\n tipo = 'denotesRhetoric';\n tipo2 = 'retorica';\n attr = $('#insertreth option:selected').text();\n } else if ($('#inserimentoautore2').css('display') === 'block') {\n if ($('#selectauthor2 option:selected').val() !== \"nothing\") \n {\n attr = $(\"#selectauthor2 option:selected\").val();\n tipo = 'hasAuthor';\n tipo2 = 'autore';\n }\n else {\n attr = $('#insertauthor2').val();\n //nuova istanza di Autore\n tipo = 'hasAuthor';\n tipo2 = 'nuovoAutore';\n }\n // tipo = 'autore';\n } else if ($('#inserimentotitolo2').css('display') === 'block') {\n tipo = 'hasTitle';\n tipo2 = 'titolo';\n attr = $('#inserttitle2').val();\n } else if ($('#inserimentopubblicazione2').css('display') === 'block') {\n tipo = 'hasPublicationYear';\n tipo2 = 'pubblicazione';\n attr = $('#insertpubb2').val();\n } else if ($('#inserimentodoi2').css('display') === 'block') {\n tipo = 'hasDOI';\n tipo2 = 'doi';\n attr = $('#insertdoi2').val();\n } else if ($('#inserimentourl2').css('display') === 'block') {\n tipo = 'hasURL';\n tipo2 = 'url';\n attr = $('#inserturl2').val();\n }\n \n var escapeAttr = attr.replace(/(['\"&;])/g, ''); // Replace di virgolette singole, doppie e caratteri speciali con un escape\n \n setSpanAttributes(escapeAttr, tipo, time, email, username, true, 'Heisenberg');\n \n arrayAnnotazioni.push({\n code : numeroAnnotazioni,\n username : username.trim(),\n email : email.trim(),\n id : id,\n start : startFrag,\n end : endFrag,\n type : tipo2.trim(),\n content : attr.trim(),\n date : time\n });\n databaseAnnotations.push({\n code : numeroAnnotazioni,\n username : username.trim(),\n email : email.trim(),\n id : id,\n start : startFrag,\n end : endFrag,\n type : tipo2.trim(),\n content : attr.trim(),\n date : time\n });\n\n if (tipo === 'hasAuthor') {\n if (istanzeAutori.indexOf(attr) === -1)\n istanzeAutori.push(attr);\n }\n\n $('.badgeAnnOnDocument').text(numAnnTot + \" Totali\");\n \n //ora che l'annotazione esiste, è possibile legargli l'ascoltatore che la evidenzia in caso di hovering\n onHover();\n}", "title": "" }, { "docid": "aa7ce5ed311565aa8be787cad0b998bd", "score": "0.5779884", "text": "function addSelectedAnnotation(annotation, fromAngular) {\n if (fromAngular) {\n for (var i=0; i<annotations.length; i++) {\n annotations[i].selected = false;\n }\n\n // In case user selected annotations from different pages, re-draw all pages to make them displayed as not\n // selected\n resetVar();\n }\n\n annotation.selected = true;\n for (var i=0; i<annotations.length;i++){\n if (annotation.id == annotations[i].id) {\n annotations[i].selected = annotation.selected;\n break;\n }\n }\n\n selectedAnnotations.push(annotation);\n\n if (fromAngular) {\n for (var p in pages) {\n if (pages[p].pageIndex == annotation.pageIndex) {\n for (var i=0; i<pages[p].canvasAnnotations.length; i++) {\n if (pages[p].canvasAnnotations[i].id == annotation.id) {\n pages[p].canvasAnnotations[i].selected = annotation.selected;\n break;\n }\n }\n pages[p].invalidate();\n break;\n }\n }\n }\n else {\n refreshAnnotationList();\n scrollToAnnotationInList(annotation);\n }\n}", "title": "" }, { "docid": "5b93e5235722ac4ea45cdf468d84a9ff", "score": "0.5727177", "text": "function updateDisplayNum(){\n var totalCount = 0; // total numver of qualified anatomy annotations\n var matchCount = 0; // total matched number of filtered anatomy annotations\n var item = null;\n\n for(var i = 0; i < vm.annotationModels.length; i++){\n item = vm.annotationModels[i];\n totalCount = item.svgID && item.groupID ? totalCount + 1 : totalCount;\n if(filterAnnotations(item)){\n matchCount += 1;\n item.isShow = true;\n }\n else{\n item.isShow = false;\n }\n }\n\n vm.totalCount = totalCount;\n vm.matchCount = matchCount;\n }", "title": "" }, { "docid": "e90d72ab8dd003d8f25695df36022ea3", "score": "0.55976343", "text": "function saveAnnotation(self, isComment) {\n if (isComment) self.base.restoreSelection();\n var range = MediumEditor.selection.getSelectionRange(self.document);\n var selectedParentElement = self.base.getSelectedParentElement();\n\n // Determine selection and context\n self.base.selectedDocument = self.document;\n self.base.selection = MediumEditor.selection.getSelectionHtml(\n self.base.selectedDocument\n );\n\n var exact = self.base.selection;\n var selectionState = MediumEditor.selection.exportSelection(\n selectedParentElement,\n self.document\n );\n var start = selectionState.start;\n var end = selectionState.end;\n var prefixStart = Math.max(0, start - contextLength);\n var prefix = selectedParentElement.textContent.substr(\n prefixStart,\n start - prefixStart\n );\n prefix = htmlEntities(prefix);\n // prefix = prefix.trim();\n\n var suffixEnd = Math.min(\n selectedParentElement.textContent.length,\n end + contextLength\n );\n var suffix = selectedParentElement.textContent.substr(end, suffixEnd - end);\n suffix = htmlEntities(suffix);\n // suffix = suffix.trim();\n\n // assume annotation service is following endpoint (TODO: Change so user can choose endpoint)\n let annotationService = \"https://vanhoucke.me/sparql-2\";\n\n // Listing here only includes one link, so will simplify the program for now\n // (real-life implementations need to collect a list which contains these links)\n // (not used for now)\n let listing_location =\n \"https://vanhoucke.me/sparql-2/annotations/website?url=http://www.example.org/blog/1.html\";\n\n // information to be collected from GUI\n let title = \"Lukas Vanhoucke created an annotation.\";\n let creator = \"https://lukas.vanhoucke.me/profile/card#me\";\n let source = window.location.href.split(\"#\")[0];\n\n let annotation = {\n creator: creator,\n title: title,\n source: source,\n exact: exact,\n prefix: prefix,\n suffix: suffix\n };\n\n if (isComment) annotation.body = self.getInput().value.trim();\n\n request\n .post(annotationService)\n .send(annotation)\n .then(function(res) {\n var url = JSON.parse(res.text).url;\n console.log(\"Annotation was saved at \" + url);\n\n // TODO: POST notification to inbox of webpage (ldp:inbox in RDFa)\n // This step is skipped for now. In future, it should announce the endpoint to collect annotations to the inbox.\n // notifyInbox(inbox_location, url);\n\n let classApplier = isComment\n ? getCommentClassApplier(self.getInput().value.trim())\n : highlightClassApplier;\n classApplier.toggleSelection(); // toggle highlight\n })\n .catch(function(err) {\n // do something with the error\n console.log(err);\n });\n\n self.base.checkContentChanged();\n if (isComment) self.doFormSave();\n}", "title": "" }, { "docid": "1f3aa1c4e1420fccb5447c2f2949c060", "score": "0.5586724", "text": "function _addAnnotationToList(items){\n var groupID,\n i,\n svgID,\n row,\n obj;\n\n // HACK: For mapping the id of human anatomy\n // mouse id vs human id... (one is used in the url, the other in the svg file)\n var dict = {\n \"EHDAA2:0028494\": \"EMAPA:27697\",\n \"EHDAA2:0027681\": \"EMAPA:27681\",\n \"EHDAA2:0027605\": \"EMAPA:27605\",\n \"EHDAA2:0027678\": \"EMAPA:27678\",\n \"EHDAA2:0027621\": \"EMAPA:27621\",\n \"EHDAA2:0018679\": \"EMAPA:18679\"\n };\n for(i = 0; i < items.length; i++){\n groupID = items[i].groupID;\n svgID = items[i].svgID;\n\n // TODO why osd viewer is sending this event?\n if(svgID === \"NEW_SVG\" || groupID === \"NEW_GROUP\"){\n continue;\n }\n\n // TODO how can this happen? does it makes sense?\n if(vm.annotationModels.find(function (item) { return item.groupID === groupID})){\n continue;\n }\n\n /* HACK: This is done for the demo, the all ids are not available currently.\n Also the encodeURI is the same as ERMrest's _fixedEncodeURIComponent_. Since it\n is still not clear what will be th format of id.*/\n var metadata = groupID.split(',');\n var name, ermrestID, id;\n if (metadata.length == 1) {\n if (metadata[0].indexOf(':') !== -1) {\n id = dict[metadata[0]] ? dict[metadata[0]] : metadata[0];\n } else {\n name = metadata[0];\n }\n } else {\n for (var j = 0; j < metadata.length ; j++ ){\n if (metadata[j].indexOf(':') !== -1) {\n id = dict[metadata[j]] ? dict[metadata[j]] : metadata[j];\n } else {\n name = metadata[j];\n }\n }\n }\n\n // TOOD should be more systematic\n var contextHeaderParams = ConfigUtils.getContextHeaderParams();\n var url = \"/chaise/record/#\" + context.catalogID;\n url += \"/\" + UriUtils.fixedEncodeURIComponent(annotConfig.annotated_term_table_schema_name) + \":\" + UriUtils.fixedEncodeURIComponent(annotConfig.annotated_term_table_name);\n url += \"/\" + UriUtils.fixedEncodeURIComponent(annotConfig.annotated_term_id_column_name) + \"=\" + UriUtils.fixedEncodeURIComponent(id);\n url += \"?pcid=\" + contextHeaderParams.cid + \"&ppid=\" + contextHeaderParams.pid;\n\n // default values for new anatomy's annotation\n obj = {\n groupID : groupID,\n svgID : svgID,\n anatomy : items[i].anatomy,\n description : items[i].description,\n isSelected : false,\n isDrawing : false,\n isDisplay: true,\n isNew : false,\n isStoredInDB: false,\n isShow : true,\n name: name,\n id: id,\n url: url,\n tuple: null,\n stroke: Array.isArray(items[i].stroke) ? items[i].stroke : []\n };\n\n row = $rootScope.annotationTuples.find(function (tuple, index) {\n return tuple.data && tuple.data[annotConfig.annotated_term_column_name] === id;\n });\n\n // if row with same anatomy id exists in the viewer model -> update it\n if(row){\n obj.isStoredInDB = true;\n obj.tuple = row;\n obj.canUpdate = row.canUpdate;\n obj.canDelete = row.canDelete;\n\n obj.logStackNode = logService.getStackNode(\n logService.logStackTypes.ANNOTATION,\n row.reference.table,\n row.reference.filterLogInfo\n );\n } else {\n obj.logStackNode = logService.getStackNode(\n logService.logStackTypes.ANNOTATION,\n null,\n {\"file\": 1}\n );\n }\n\n vm.annotationModels.push(obj);\n\n }\n }", "title": "" }, { "docid": "deb25b6171198712bf10c3e2ecd49c08", "score": "0.55835104", "text": "function onSearchPopupValueChange(columnModel, tuple) {\n if (columnModel.column.name !== annotConfig.annotated_term_visible_column_name) {\n return true;\n }\n\n var item = vm.editingAnatomy,\n data = tuple.data;\n\n // allow itself to be selected, but there's no reason to update the info\n if (data[idColName] === item.id) {\n return true;\n }\n\n // manually make sure the ID doesn't exist in the list,\n // because some of the annotations might not be stored in the database\n if(vm.annotationModels.find(function (row) { return row.id === data[idColName]})){\n return {error: true, message: \"An annotation already exists for this Anatomy, please select other terms.\"};\n }\n\n // Update the new Anatomy name and ID at openseadragon viewer\n AnnotationsService.changeGroupInfo({\n svgID : item.svgID,\n groupID : item.groupID,\n newGroupID : data[idColName] + \",\" + data[nameColName],\n newAnatomy : data[nameColName] + \" (\" + data[idColName] + \")\"\n });\n\n // TODO should be part of a prototype (this is done twice)\n var contextHeaderParams = ConfigUtils.getContextHeaderParams();\n var url = \"/chaise/record/#\" + context.catalogID;\n url += \"/\" + UriUtils.fixedEncodeURIComponent(annotConfig.annotated_term_table_schema_name) + \":\" + UriUtils.fixedEncodeURIComponent(annotConfig.annotated_term_table_name);\n url += \"/\" + UriUtils.fixedEncodeURIComponent(annotConfig.annotated_term_id_column_name) + \"=\" + UriUtils.fixedEncodeURIComponent(data[idColName]);\n url += \"?pcid=\" + contextHeaderParams.cid + \"&ppid=\" + contextHeaderParams.pid;\n\n item[\"anatomy\"] = data[nameColName] + \" (\" + data[idColName] + \")\";\n item[\"groupID\"] = data[idColName] + \",\" + data[nameColName];\n item[\"name\"] = data[nameColName];\n item[\"id\"] = data[idColName];\n item[\"url\"] = url;\n return true;\n }", "title": "" }, { "docid": "d77793fc4533c7b35ce38116b1c199d6", "score": "0.554412", "text": "refresh() {\n\t\tthis._selection._updateMarkers();\n\t\tthis._selection._updateAttributes( false );\n\t}", "title": "" }, { "docid": "b5651be1a5f9675d1ee41c31dd67b938", "score": "0.55273914", "text": "displayAnnotation (isPrimary) {\n\n // Check the viewer not clised.\n if ($('#numPages', window.document).text() === '') {\n return\n }\n\n const colorMap = annoUI.labelInput.getColorMap()\n\n let annotations = []\n let primaryIndex = -1\n\n // Primary annotation.\n if (isPrimary) {\n $('#dropdownAnnoPrimary a').each((index, element) => {\n let $elm = $(element)\n if ($elm.find('.fa-check').hasClass('no-visible') === false) {\n let annoPath = $elm.find('.js-annoname').text()\n\n const annoFile = window.annoPage.getAnnoFile(annoPath)\n if (!annoFile) {\n console.log('ERROR')\n return\n }\n primaryIndex = 0\n annotations.push(annoFile.content)\n\n let filename = annoFile.name\n localStorage.setItem('_pdfanno_primary_annoname', filename)\n console.log('filename:', filename)\n }\n })\n }\n\n // Reference annotations.\n if (!isPrimary) {\n $('#dropdownAnnoReference a').each((index, element) => {\n let $elm = $(element)\n if ($elm.find('.fa-check').hasClass('no-visible') === false) {\n let annoPath = $elm.find('.js-annoname').text()\n\n const annoFile = window.annoPage.getAnnoFile(annoPath)\n\n if (!annoFile) {\n console.log('ERROR')\n return\n }\n annotations.push(annoFile.content)\n }\n })\n }\n\n // Create import data.\n let paperData = {\n primary : primaryIndex,\n annotations,\n colorMap\n }\n\n // Import annotations to Viewer.\n window.annoPage.importAnnotation(paperData, isPrimary)\n }", "title": "" }, { "docid": "140f511a017c5304c7d21b63b4538e85", "score": "0.55244905", "text": "function updateAnnotationToCanvas(annotation) {\n if (!annotation)\n return;\n\n if (typeof annotation === 'string')\n annotation = Annotation.createFromJSON(annotation);\n\n if (annotation.modified == 'update') {\n for (var a in annotations) {\n var updateCanvasAnnotations = false;\n /**\n * For the first condition, if annotation.oldId property != 0, then it means the annotation was saved to\n * the server and an id was returned. So update this annotation's id.\n *\n * The second condition means annotation already has a database generated id, so just updated its\n * properties.\n */\n if (annotations[a].id == annotation.oldId || annotations[a].id == annotation.id)\n updateCanvasAnnotations = true;\n\n if (updateCanvasAnnotations) {\n annotations[a] = annotation;\n var page = pages[canvasIdName + (annotation.pageIndex + 1)];\n for (var c in page.canvasAnnotations) {\n if (page.canvasAnnotations[c].id == annotation.id) {\n page.canvasAnnotations[c] = annotation;\n\n if (annotation.isSelectableTextType()) {\n if (annotation.oldId <= 0) {\n $('#pageContainer' + (annotation.pageIndex + 1) + ' .canvasWrapper').\n children('div[id=\"highlight' + annotation.oldId + '\"]').\n each(function()\n {\n $(this).attr('id', 'highlight' + annotation.id);\n });\n }\n }\n else\n page.invalidate();\n\n break;\n }\n }\n break;\n }\n }\n }\n else if (annotation.modified == 'delete') {\n deleteAnnotation(annotation, false, true);\n }\n else if (annotation.modified == 'insert') {\n var page = pages[canvasIdName + (annotation.pageIndex + 1)];\n var index = getAnnotationById(annotation);\n\n var page = pages[canvasIdName + (annotation.pageIndex + 1)];\n\n switch (annotation.annotationType) {\n case Annotation.TYPE_TEXT_HIGHLIGHT:\n case Annotation.TYPE_TEXT_UNDERLINE:\n case Annotation.TYPE_TEXT_STRIKE_THROUGH:\n var pageView = PDFViewerApplication.pdfViewer.getPageView(annotation.pageIndex);\n page.highlightText(annotation.annotationType, annotation.pageIndex, rotateAngle,\n PDFViewerApplication.pdfViewer.currentScale, pageView, annotation,\n annotation.getHighlightTextColor());\n\n $('#pageContainer' + (annotation.pageIndex + 1) + ' .canvasWrapper').children('div[id=\"highlight\"]').each(function() {\n $(this).attr('id', 'highlight' + annotation.id);\n });\n\n annotations.push(annotation);\n updateAnnotationListAfterSave(annotation, false, true);\n break;\n case Annotation.TYPE_TEXT:\n page.addText(rotateAngle, annotation, true, true, true);\n break;\n default:\n page.addAnnotation(annotation, rotateAngle, PDFViewerApplication.pdfViewer.currentScale, false, true, true);\n page.invalidate();\n break;\n }\n }\n}", "title": "" }, { "docid": "98021daeeff2ebb95d1cb6172b3e8a85", "score": "0.55126834", "text": "function populateSpan(){ \n if (annotation[$('.card-panel:visible').attr('id').substr(-1)].annotations.length == 0) {\n Materialize.toast(\"Non ci sono annotazioni\", 2000);\n return false;\n }\n $('#annotationContents').html('')\n\n var annotations = annotation[$('.card-panel:visible').attr('id').substr(-1)].annotations\n for(var i=0; i < annotations.length; i++){\n if(annotations[i]){\n try{\n spanColor(annotations[i].list[0].type) \n var classes = '.span-'+i+'.'+color\n $('#annotationContents').append('<div class=\"info span-'+i+' '+color+'\"></div>')\n var div = $('#annotationContents >' +classes)\n \n div.append('<h6>Annotation\\'s type: <a href=\"#\" onclick=\"removeAnnotation(this)\"><i class=\"fa fa-trash right\" title=\"rimuovi\"></i></a> <a href=\"#\" onclick=\"editAnnotation(this)\"><i class=\"fa fa-pencil-square-o right\" title=\"modifica\"></i></a></h6><p class=\"annotaType\">'+annotations[i].list[0].label.capitalize()+'</p>')\n div.append('<h6>Label: <a href=\"#\" onclick=\"modifyFields(this)\"><i class=\"fa fa-pencil-square-o right\" title=\"modifica\"></i></a></h6><p class=\"annotaLabel\" contenteditable=\"true\">' + annotations[i].list[0].body.label + '</p>')\n if (annotations[i].list[0].type == 'cites'){\n div.append('<h6>Link citated is</h6><p blue-text><p class=\"annotaLink\" contenteditable=\"true\">'+annotations[i].list[0].body.object+'</p>')\n }\n div.append('<h6>Created by</h6><p blue-text><i>'+annotations[i].list[0].provenance.author.name+', '+annotations[i].list[0].provenance.time+'</i></p>')\n } \n catch (e) { console.log(e) }\n }\n }\n \n $(\"#annotationInfo\").openModal({\n dismissible:true,\n complete: function() { $('#annotationContents').html(''); }\n });\n}", "title": "" }, { "docid": "1c30556f89423e09223c15de7083ebb7", "score": "0.54959613", "text": "function updateAnnotationComment(annotation) {\n console.log('updateAnnotationComment()');\n\n root:\n for (var p in pages) {\n if (pages[p].pageIndex == annotation.pageIndex) {\n for (var i=0; i<pages[p].canvasAnnotations.length; i++) {\n if (pages[p].canvasAnnotations[i].id == annotation.id) {\n pages[p].canvasAnnotations[i].comments = annotation.comments;\n break root;\n }\n }\n }\n }\n\n for (var a in annotations) {\n if (annotations[a].id == annotation.id) {\n annotations[a].comments = annotation.comments;\n annotations[a].modified = annotation.modified;\n break;\n }\n }\n\n if (Default.CREATE_ANNOTATION_EVENTS)\n createAnnotationEvent(annotation, 'comment_update');\n}", "title": "" }, { "docid": "37ca804f99bc98f7344b173a6f37ab17", "score": "0.5409156", "text": "static update(id, annotation){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tkparams.annotation = annotation;\n\t\treturn new kaltura.RequestBuilder('annotation_annotation', 'update', kparams);\n\t}", "title": "" }, { "docid": "1fea1e1b14d6d946a676ddbe6de24bfc", "score": "0.5408323", "text": "function edit_update(evt) {\n evt.preventDefault();\n var dlg = $('#editdialog'),\n id = dlg.attr('annotation-id'),\n annotation = layer.annotationById(id),\n opt = annotation.options(),\n type = annotation.type(),\n typeMatch = new RegExp('(^| )(' + type + '|all)( |$)'),\n newopt = {style: {}, labelStyle: {}},\n error;\n\n // Validate form values\n $('.form-group[annotation-types]').each(function () {\n var ctl = $(this),\n key = $('[option]', ctl).attr('option'),\n format = $('[option]', ctl).attr('format'),\n value, oldvalue;\n if (!ctl.attr('annotation-types').match(typeMatch)) {\n return;\n }\n value = $('[option]', ctl).val();\n switch (format) {\n case 'angle':\n if (/^\\s*[.0-9eE]+\\s*$/.exec(value)) {\n value += 'deg';\n }\n break;\n }\n switch (key) {\n case 'textScaled':\n if (['true', 'on', 'yes'].indexOf(value.trim().toLowerCase()) >= 0) {\n value = map.zoom();\n }\n break;\n }\n value = layer.validateAttribute(value, format);\n switch ($('[option]', ctl).attr('optiontype')) {\n case 'option':\n oldvalue = opt[key];\n break;\n case 'label':\n oldvalue = (opt.labelStyle || {})[key];\n break;\n default:\n oldvalue = opt.style[key];\n break;\n }\n if (value === oldvalue || (oldvalue === undefined && value === '')) {\n // don't change anything\n } else if (value === undefined) {\n error = $('label', ctl).text() + ' is not a valid value';\n } else {\n switch ($('[option]', ctl).attr('optiontype')) {\n case 'option':\n newopt[key] = value;\n break;\n case 'label':\n newopt.labelStyle[key] = value;\n break;\n default:\n newopt.style[key] = value;\n break;\n }\n }\n });\n if (error) {\n $('#edit-validation-error', dlg).text(error);\n return;\n }\n annotation.name($('[option=\"name\"]', dlg).val());\n annotation.label($('[option=\"label\"]', dlg).val() || null);\n annotation.description($('[option=\"description\"]', dlg).val() || '');\n annotation.options(newopt).draw();\n\n dlg.modal('hide');\n // Refresh the annotation list\n handleAnnotationChange();\n}", "title": "" }, { "docid": "f419758c098f9cca0670f32ce4bdc54c", "score": "0.53922474", "text": "newAnnotation(){\n\t\t let newAnnotation = {\n\t\t \tquote: this.state.quote,\n\t\t\t\tannotation: this.annotation.value,\n\t\t\t\tchannels: this.newAnnotationChannels\n\t\t\t};\n\t\t\tlet newAnnotationMap = new annotationMap(this.state.annotationObjects).add(newAnnotation.channels, newAnnotation);\n this.selected = {\n \tprops: newAnnotation\n\t\t\t};\n\t\t\tconsole.log(\"newAnnotationMap: \" + newAnnotationMap);\n this.setState({\n annotationObjects: newAnnotationMap\n });\n this.newAnnotationChannels = newAnnotationMap.keysAsArray();\n this.prevOperation = this.operation;\n this.operation = \"new\";\n console.log(\"new annotation added\");\n\t\t}", "title": "" }, { "docid": "23373aa0c2ce2961c9189bfd87455b86", "score": "0.5352112", "text": "function editAnnotation(region) {\n var form = document.forms.edit;\n form.style.opacity = 1;\n (form.elements.start.value = Math.round(region.start * 10) / 10),\n (form.elements.end.value = Math.round(region.end * 10) / 10);\n form.elements.note.value = region.data.note || '';\n form.onsubmit = function(e) {\n e.preventDefault();\n region.update({\n start: form.elements.start.value,\n end: form.elements.end.value,\n data: {\n note: form.elements.note.value\n }\n });\n form.style.opacity = 0;\n };\n form.onreset = function() {\n form.style.opacity = 0;\n form.dataset.region = null;\n };\n form.dataset.region = region.id;\n}", "title": "" }, { "docid": "727e3ef31fd7188ee2b8e71c1e7559a2", "score": "0.5349397", "text": "function editAnnotation(region) {\n let form = document.forms.edit;\n form.style.opacity = 1;\n (form.elements.start.value = Math.round(region.start * 100) / 100),\n (form.elements.end.value = Math.round(region.end * 100) / 100);\n (form.elements.attributes.value = region.attributes),\n form.elements.note.value = region.data.note || '';\n form.elements.skeleton.value = region.data.skeleton || '';\n\n form.onsubmit = function (e) {\n e.preventDefault();\n region.update({\n start: form.elements.start.value,\n end: form.elements.end.value,\n attributes: form.elements.attributes.value,\n data: {\n note: form.elements.note.value,\n skeleton: form.elements.skeleton.value\n }\n });\n form.style.opacity = 0;\n };\n form.onreset = function () {\n form.style.opacity = 0;\n form.dataset.region = null;\n };\n form.dataset.region = region.id;\n}", "title": "" }, { "docid": "7494eff1cdf8a15710ef9f548c8057b1", "score": "0.5348739", "text": "function editAnnotation (region) {\n var form = document.forms.edit;\n form.style.opacity = 1;\n form.elements.start.value = Math.round(region.start * 10) / 10,\n form.elements.end.value = Math.round(region.end * 10) / 10;\n form.elements.note.value = region.data.note || '';\n form.onsubmit = function (e) {\n e.preventDefault();\n region.update({\n start: form.elements.start.value,\n end: form.elements.end.value,\n data: {\n note: form.elements.note.value\n }\n });\n form.style.opacity = 0;\n };\n form.onreset = function () {\n form.style.opacity = 0;\n form.dataset.region = null;\n };\n form.dataset.region = region.id;\n}", "title": "" }, { "docid": "8e0ee40c919fb99a073296b549c9f087", "score": "0.53486866", "text": "function update_citations(annotation) {\n var name_re = new RegExp('a name=\"zotero-([^\"]+)\"', 'gm');\n var matches = [], found, item_id;\n\n // if annotation includes citations, scan for zotero ids\n // and attach additional data to the annotation\n if (has_citations(annotation.text)) {\n // list of promises, one for each api request to be done\n var promises = [];\n\n // Look for name anchors like those created by adding\n // citations in order to find all possible citation ids\n while (found = name_re.exec(annotation.text)) {\n matches.push(found[1]); // 0 is full match, 1 is first group\n }\n\n // retrieve & store the tei citation information as extra data\n // on the annotation\n\n // clear out any stored citations to ensure content and tei\n // citations stay in sync\n annotation.citations = [];\n for(var i = 0; i < matches.length; i++) {\n // get tei record for full metadata & easy export\n // NOTE: tei record includes zotero item id, so not\n // fetching or storing id separately\n item_id = matches[i];\n\n\n promises.push(new Promise(function(resolve, reject) {\n zotero.get_item(item_id, 'tei', '', function(data) {\n // zotero returns the citation wrapped in a listBibl\n // element that we don't need; just extract the biblitself\n\n // NOTE: if an error occurs, still mark the promise\n // as resolved, because we want the annotation\n // to be saved even if something goes wrong\n try {\n var tei_data = $($.parseXML(data)).find(\"biblStruct\");\n } catch(err) {\n // if xml parsing fails, we get an exception\n console.warn('Error parsing TEI response for ' + item_id);\n resolve();\n return;\n }\n // in some cases, zotero doesn't return a\n // tei biblStruct\n if (tei_data.length == 0) {\n console.warn('TEI citation not found for ' + item_id);\n resolve();\n return;\n }\n\n var tei_bibl = tei_data.get(0).outerHTML;\n // don't duplicate an entry (could happen due to delayed processing)\n if (annotation.citations.indexOf(tei_bibl) == -1) {\n annotation.citations.push(tei_bibl);\n }\n // resolve the promise after the api request is processed\n resolve();\n });\n\n }));\n } // for loop on matches\n\n\n // return a promise that will resolve when all promises resolve,\n // so annotator will wait to save the annotation until\n // all citations are processed and data is added\n\n } // has citations\n\n return Promise.all(promises);\n }", "title": "" }, { "docid": "819a6b33ba76c14918e552361ae84fe4", "score": "0.531913", "text": "function selectAnnotation(id) {\n let query = \"[data-aid='\"+id+\"']\";\n let annotationElements = document.querySelectorAll(query);\n selectElementContents(annotationElements);\n selectedAnnotation = id;\n }", "title": "" }, { "docid": "bbe70f14cf16c642cd0eb5c0e586cedc", "score": "0.5294555", "text": "function updateCandelaDisplay() { \n\n\n fillAttributeSelector();\n\n d3.select(\"#geojs_attribute\")\n .on(\"change\", updateOccurrencePointColors);\n //geojs_addBaseLayer();\n //candela_resize();\n candela_addGeoDots(phylomap.selectedOccurrences);\n}", "title": "" }, { "docid": "4a069565e7ad34f4c28ce464f9ccfce3", "score": "0.52762514", "text": "add(state, { annotation, layerId }) {\n // Loop over the annotation lists\n // If a list contains a layer which id's equals to layerId,\n // Prepend the new annotation to the list\n Object.keys(state.lists).forEach(uid => {\n const list = state.lists[uid].layers[layerId]\n if (list) {\n Vue.set(list, list.length, annotation)\n }\n })\n }", "title": "" }, { "docid": "b796305a6b22dd91e3b4956d8dd6a07a", "score": "0.5265849", "text": "situationChanged (updatedSituation, currentSituation) {\n console.log(`situation changed`);\n let id = updatedSituation._id;\n let marker = SituationMarkers[id];\n\n if (!!marker) {\n let newll = updatedSituation.latLng\n , oldll = currentSituation.latLng\n ;\n //console.log(JSON.stringify(updatedActor));\n if ( MapUtilities.shouldUpdatePosition(newll, oldll) ) {\n marker.setLatLng(newll);\n }\n // update bling (iif perf issues, then consider a change check)\n marker.setIcon ( MapUtilities.situationIcon(updatedSituation) );\n marker.options.situation = updatedSituation;\n marker.options.currentLatLng = newll;\n }\n }", "title": "" }, { "docid": "3455ecb9511a09a4957665a2bf3f8d1a", "score": "0.52062863", "text": "function updateList(av){\n\t//clear artwork items except first (title)\n\t$(\"#artwork\").children('option:not(:first)').remove();\n\t//add according to global 2d array \"artworks[][]\"\n\tfor(index in artworks[av][0]){\n\t\t//skip 0 (title)\n\t\tvar artVal = parseInt(index) + 1;\n\t\t//appends <option> tags with appropriate values\n\t\t$(\"#artwork\").append('<option value=\"' + artVal + '\">' + artworks[av][0][index] + '</option>');\n\t}\n\t//once populated bring artwork back to title (becuase of bugs)\n\t$(\"#artwork\").val(0);\n\t$(\"#sbtn\").addClass(\"disabled\");\n}", "title": "" }, { "docid": "57f51cc13f3468c6ff96b1afbce9d8ac", "score": "0.5202542", "text": "function newAnnotation(type) {\n \n updateAutori();\n //ricavo il testo selezionato\n selezione = selection();\n \n //differenza tra selezione e fragmentselection: per operare sui nodi serve il primo, poichè è sostanzialmente\n //un riferimento all'interno del documento; il secondo invece estrapola dallo stesso il contenuto selezionato ogni\n //volta che viene rilasciato il tasto sinistro del mouse. dal secondo non si può risalire ai nodi, o almeno non si\n //può con il metodo utilizzato sotto. tuttavia, usando selezione è impossibile detectare se \"esiste\" la selezione\n //stessa o se è vuota, poichè jQuery per qualche motivo non riesce a confrontare l'oggetto con \"\", '', null o \n //undefined; allo stesso tempo, è molto più difficile visualizzare selezione nel modale di inserimento annotazioni.\n //per questo motivo, viene più comodo e semplice usare due variabili separate che prelevano la stessa cosa e che \n //la gestiscono in modo diverso e in momenti diversi.\n if (fragmentselection === '') {\n avviso(\"Attenzione! Nessun frammento selezionato.\");\n } \n else {\n registerAnnotation(type);\n }\n}", "title": "" }, { "docid": "a1dacd3947aa4196e106f1101844f948", "score": "0.51878494", "text": "function markerCalloutClicked(earthquakesListIndex) {\n setActiveEarthquake(earthquakesList[earthquakesListIndex]);\n}", "title": "" }, { "docid": "58e0d052cfd9fd3c522787e31c26ec2c", "score": "0.5176799", "text": "editAnnotation(annotation) {\n\t\tif(annotation.target) {\n\t\t\tthis.setState({\n\t\t\t\tshowAnnotationModal: true,\n\t\t\t\tannotationTarget: annotation.target,\n\t\t\t\tactiveAnnotation: annotation\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "f0785e8e2b6abd0cadc975a45f4bf8eb", "score": "0.5152993", "text": "function editAnnotation(xval)\n{\n var id = g_state.annotations[xval][0];\n var text = prompt(\"Annotation string:\", g_state.annotations[xval][1]);\n if (text != null) {\n g_state.annotations[xval][1] = text;\n updateAnnotation(id, xval, text);\n showAnnotations(true);\n }\n}", "title": "" }, { "docid": "7750f9b27823f870c3df7bdd3c1a0f8d", "score": "0.514402", "text": "function server_annotate(key, list){\n //send ajax call to server\n //update the annotation\n console.log(key, list);\n $.post(\"/\", {key: key, indices: JSON.stringify(list)}, function(){\n\t$(\"ul[key=\"+ key+ \"]\").find(\".word\").removeClass(\"ui-selectee\").addClass(\"annotated\");\n })\n\n selected_indices = [];//empty it for the next round of annotation\n}", "title": "" }, { "docid": "b6da0f2524eca54d4849a926b41558ee", "score": "0.51120865", "text": "function reloadAnnotations() {\n for (var p in pages) {\n loadAnnotations(pages[p].pageIndex);\n }\n\n if ($('#sidebarContainerRight').length > 0) {\n angular.element($('#sidebarContainerRight')).scope().annotations = annotations;\n angular.bootstrap(document.getElementById('sidebarContainerRight'), ['annotationList']);\n }\n}", "title": "" }, { "docid": "11c879ba5f8cd9bb219dfa04766130e1", "score": "0.50979894", "text": "function displayAnnotation(annotation) {\n note.innerHTML = annotation;\n}", "title": "" }, { "docid": "11c879ba5f8cd9bb219dfa04766130e1", "score": "0.50979894", "text": "function displayAnnotation(annotation) {\n note.innerHTML = annotation;\n}", "title": "" }, { "docid": "7ca232e3ceb226197fd2b9d047b33c3d", "score": "0.5057155", "text": "function ct_annotate_mouseUp(e) {\n\tct_annotate.userDrew = true;\n\tct_annotate.drag = false;\n\tct_annotate.all_rects.push([ ct_annotate.curr_rect.start_x, ct_annotate.curr_rect.start_y, \n\t\t\t\tct_annotate.curr_rect.size_width, ct_annotate.curr_rect.size_height ]);\n\tct_annotate_draw();\n\tct_annotate_createMenuItems();\n\t// Notify of new annotation\n\tct_annotate.canvas.dispatchEvent(new Event('annotationChanged'));\n}", "title": "" }, { "docid": "0cec7c42b746737f9c5d5e62413689ef", "score": "0.5049345", "text": "function updateAllOrganisations(orgArray, value) {\n for (const i in orgArray) {\n orgArray[i].checked = value;\n }\n return orgArray;\n}", "title": "" }, { "docid": "9da337af0dbdf8a4627a7b54a7bf619d", "score": "0.5048788", "text": "function updateFeature() {\n $scope.selectedFeature.properties.forEach(function(prop) {\n $scope.selectedFeature.feature.properties[prop.key] = prop.value;\n });\n MapHandler.updateOnlyProperties($scope.selectedFeature);\n }", "title": "" }, { "docid": "76594a7a12291dfbfe5085009f44bae5", "score": "0.50483215", "text": "changeMarker() {\n\t\t_.forEach(this.markers, (a) => a.style.display = this.saved ? 'inline' : '');\n\t}", "title": "" }, { "docid": "32edd8316b15e2f0e5df608f797c83e3", "score": "0.50478846", "text": "updateInfoFields() {\n $('#alg-name').text(this.name);\n $('#alg-about').text(this.about);\n $('#alg-best').text(this.best);\n $('#alg-avg').text(this.avg);\n $('#alg-worst').text(this.worst);\n $('#alg-place').text(this.inPlace == true ? 'yes' : 'no');\n $('#alg-stable').text(this.stable == true ? 'yes' : 'no');\n }", "title": "" }, { "docid": "3f0bfe58ecaa907122e0d7022af2a3bf", "score": "0.5037165", "text": "function onInit() {\n var annotations = lodash.get(ctrl.version, 'metadata.annotations', []);\n\n ctrl.annotations = lodash.map(annotations, function (value, key) {\n return {\n name: key,\n value: value,\n ui: {\n editModeActive: false,\n isFormValid: true,\n name: 'annotation'\n }\n };\n });\n }", "title": "" }, { "docid": "0ca843a19fc5d911a1a52540cd832580", "score": "0.50143623", "text": "toggleOrganism( org, toggleOn ){\n let orgId = getId( org );\n let orgIds = this.syncher.get('organisms') || [];\n let has = orgIds.find( id => id === orgId );\n\n if( toggleOn === undefined ){\n toggleOn = !has;\n }\n\n if( toggleOn ){\n if( has ){\n return Promise.resolve();\n } else {\n let update = this.syncher.push('organisms', orgId);\n\n this.emit('toggleorganism', orgId, toggleOn);\n this.emit('localtoggleorganism', orgId, toggleOn);\n\n return update;\n }\n } else {\n if( has ){\n let update = this.syncher.pull('organisms', orgId);\n\n this.emit('toggleorganism', orgId, toggleOn);\n this.emit('localtoggleorganism', orgId, toggleOn);\n\n return update;\n } else {\n return Promise.resolve();\n }\n }\n }", "title": "" }, { "docid": "e2fb55376029a740772aac90636f51ae", "score": "0.49996623", "text": "function change(newTrait) {\n //Current selection values\n position = metaparsed[0].indexOf(newTrait);\n var selectedDat = [];\n //Creates an array just with the selected trait\n for (i=0;i<metaparsed.length; i++){\n selectedDat.push(metaparsed[i][position])\n }\n //delete the trait names\n selectedDat.shift()\n drawAnnotate(position,selectedDat);\n }", "title": "" }, { "docid": "19c61f68f503adb662bc37d64c26ece9", "score": "0.4995012", "text": "function showAnnotationsInfoPanel(e) {\n e.preventDefault();\n \n $(\".annotation-info\").toggleClass(\"visible\");\n }", "title": "" }, { "docid": "73f10c099fdcd56ab708ba29019f7a87", "score": "0.49927157", "text": "_updateAutoHighlight(info) {\n for (const layer of this.getSubLayers()) {\n layer.updateAutoHighlight(info);\n }\n }", "title": "" }, { "docid": "c1f9a172e8d0c912dc0bbb28f65db788", "score": "0.49833167", "text": "function updateInfo(oneWorldCup) {\n\n d3.select(\"#edition\").text(retrieveDataForDimension(oneWorldCup, DIMENSION_TITLE));\n d3.select(\"#host\").text(retrieveDataForDimension(oneWorldCup, DIMENSION_HOST));\n d3.select(\"#winner\").text(retrieveDataForDimension(oneWorldCup, DIMENSION_WINNER));\n d3.select(\"#silver\").text(retrieveDataForDimension(oneWorldCup, DIMENSION_SILVER));\n\n var teams = retrieveDataForDimension(oneWorldCup, DIMENSION_TEAM_NAMES);\n var teamList = d3.select(\"#teams\").selectAll(\"li\").data(teams);\n\n teamList.exit().remove();\n\n teamList = teamList.enter()\n .append(\"li\")\n .merge(teamList);\n\n teamList.sort().text(function(d, i) {\n return d;\n });\n}", "title": "" }, { "docid": "8eea5e64c0bcdc1182f7860c7e76a869", "score": "0.49528012", "text": "function getAnnotation(){\n\t\tvar lang = $(\"#lang\").val();\n\t\tvar annotation = $(\"#annotation\").val();\n\t\tvar canvas = imageArray[currentIndex][\"id\"];\n\n\t\t// Get and scale bounding box\n\t\tvar sc = scaleCoords(jcrop_api.tellSelect()); // scaled coordinates\n\t\tvar tc = translateCoords(sc);\n\t\tvar xywh = tc.x.toString() + \",\"+ tc.y.toString()+\",\"+tc.w.toString()+\",\"+tc.h.toString();\n\n\t\t// Generate IDs\n\t\tvar id1 = currentID++;\n\t\tvar id2 = currentID++;\n\n\t\t$(\"#id\").val(currentID);\n\n\t\t// Concat\n\t\tif (firstNote !== 0){\n\t\t\toutput += \",\\n\"\n\t\t} else firstNote = 1;\n\t\toutput += \"{\\n\\\n\t\\\"@id\\\": \\\"\"+id1+\"\\\",\\n\\\n\t\\\"@type\\\": \\\"oa:Annotation\\\",\\n\\\n\t\\\"motivation\\\": \\\"sc:painting\\\",\\n\\\n\t\\\"resource\\\": {\\n\\\n\t\t\\\"@id\\\": \\\"\"+id2+\"\\\",\\n\\\n\t\t\\\"@type\\\": \\\"cnt:ContentAsText\\\",\\n\\\n\t\t\\\"format\\\": \\\"text/html\\\",\\n\\\n\t\t\\\"chars\\\": \\\"\"+annotation+\"\\\",\\n\\\n\t\t\\\"language\\\": \\\"\"+lang+\"\\\"\\n\\\n\t\\},\\n\\\n\t\\\"on\\\": \\\"\"+canvas+\"#\"+xywh+\"\\\"\\n\\\n\\}\"\n\t\t$(\"#output\").val(output);\n\n\t}", "title": "" }, { "docid": "8e65a6accf559bf7c64efccdfdcde1fd", "score": "0.49430108", "text": "designerUpdatesSelectedUpdateFeatureNarrativeTo(newNarrative, expectation){\n server.call('testDesignUpdateComponents.updateSelectedFeatureNarrative', newNarrative, 'gloria', ViewMode.MODE_EDIT, expectation);\n }", "title": "" }, { "docid": "a6b049179e38be23b712f360a5bf4dfa", "score": "0.49371645", "text": "editAnnotation(element){\n //clear prior newAnnotationText HTML <input> field\n this.annotation.innerHTML = \"\";\n this.prevOperation = this.operation;\n this.operation = \"pre-edit\";\n\t\t\tthis.switchAnnotationStyle();\n\t\t}", "title": "" }, { "docid": "7cc13c00af727dd575261a59f5049e3b", "score": "0.49334145", "text": "function addNewAnnotation(event) {\n $timeout(function () {\n if (ctrl.annotations.length < 1 || lodash.last(ctrl.annotations).ui.isFormValid) {\n ctrl.annotations.push({\n name: '',\n value: '',\n ui: {\n editModeActive: true,\n isFormValid: false,\n name: 'annotation'\n }\n });\n\n $rootScope.$broadcast('change-state-deploy-button', { component: 'annotation', isDisabled: true });\n event.stopPropagation();\n }\n }, 50);\n }", "title": "" }, { "docid": "9f88d0156ef01cdf02c09e04e12c7cc6", "score": "0.49321705", "text": "function setIndex( i ) {\n\n\t\t//console.log('setIndex called: ' + i);\n\t\tindex = i;\n\n\t\t// Set the Id in the DOM\n\t\tvar thisId = \"annotation-\" + index;\n\t\tdomAnnotation.setAttribute(\"id\", thisId);\n\n\t}", "title": "" }, { "docid": "448d4d0db5a84e44e31198c1a2b1bee4", "score": "0.49256316", "text": "function update_ambulance_inc_ext_map(){\n \n $ExtendMapWindow.$infoExtMapWindows= [];\n \n if($ExtendMapWindow.$ambExtMarkersGroups != null){\n $ExtendMapWindow.$ExtendMap.removeObject($ambExtMarkersGroups);\n $ExtendMapWindow.$ambExtMarkersGroups = null;\n }\n $ExtendMapWindow.$ambExtMarkersGroups = new $ExtendMapWindow.H.map.Group();\n \n //console.log($ambMapMarkers);\n $ExtendMapWindow.$ExtendMap.addObject($ExtendMapWindow.$ambExtMarkersGroups);\n \n //var $ExtmarkerBounds = new $ExtendMapWindow.google.maps.LatLngBounds();\n \n //mark selected ambulance \n var $SelectedAmbulance=[];\n if(jQuery(\"#SelectedAmbulance input.selected_ambu_input\").length >= 1 ){\n jQuery(\"#SelectedAmbulance input.selected_ambu_input\").each(function(){\n var amb_id = $(this).attr('data-amb_id');\n $SelectedAmbulance[$SelectedAmbulance.length] = amb_id;\n });\n }\n\n var $StandbyAmbulance=[];\n if(jQuery(\"#StandbyAmbulance input.standby_ambu_input\").length >= 1 ){\n jQuery(\"#StandbyAmbulance input.standby_ambu_input\").each(function(){\n var amb_id = $(this).attr('data-amb_id');\n $StandbyAmbulance[$StandbyAmbulance.length] = amb_id;\n });\n }\n var inc_lat = $('#add_inc_details #lat').val();;\n var inc_lng = $('#add_inc_details #lng').val();;\n // $ExtmarkerBounds.extend({lat: parseFloat(inc_lat), lng: parseFloat(inc_lng) });\n \n $('.inc_ambu_list .searched_ambu_item').each( function() {\n \n var amb_obj = this;\n var amb_id = $(this).attr('data-amb_id');\n var amb_lat = $(this).attr('data-lat');\n var amb_lng = $(this).attr('data-lng');\n var amb_title = $(this).attr('data-title');\n var amb_rto_no = $(this).attr('data-rto-no');\n var amb_status = $(this).attr('data-amb_status');\n var amb_details = $(this).find('.ambu_pin_info').html();\n var amb_type = $(this).attr('data-amb_type');\n var amb_map_pin = $MapPins[amb_status];\n \n if($.inArray(amb_id,$SelectedAmbulance) > -1 ){\n if(amb_type == 2){\n amb_map_pin = map_102_pin_image;\n }else{\n amb_map_pin = map_pin_image_hover;\n }\n \n }\n if($.inArray(amb_id,$StandbyAmbulance) > -1 ){\n if(amb_type == 2){\n amb_map_pin = map_102_pin_image;\n }else{\n amb_map_pin = stand_map_pin_image_hover;\n } \n }\n \n var markerLatLng = {lat: parseFloat(amb_lat), lng: parseFloat(amb_lng) };\n \n var $amb_icon = new $ExtendMapWindow.H.map.Icon(amb_map_pin, {size: {w: 21, h: 21}});\n //$ExtmarkerBounds.extend(markerLatLng); \n \n var $ext_marker = new $ExtendMapWindow.H.map.Marker(markerLatLng,{icon: $amb_icon});\n \n $ext_marker.addEventListener('pointerenter', function(evt){\n\n var infowindow = new $ExtendMapWindow.H.ui.InfoBubble(markerLatLng, {\n content: amb_details\n });\n\n //remove infobubbles\n $ExtendMapWindow.$ExtendMapUI.getBubbles().forEach(bub => $ExtendMapWindow.$ExtendMapUI.removeBubble(bub));\n $ExtendMapWindow.$ExtendMapUI.addBubble(infowindow);\n\n }, false);\n \n $ext_marker.addEventListener('tap', function(evt){\n $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_check_box').click();\n return false;\n });\n \n $ext_marker.addEventListener('dbltap', function(evt){\n $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_stand_check_box').click();\n return false;\n });\n \n $ExtendMapWindow.$ambExtMarkersGroups.addObject($ext_marker);\n \n \n //if( amb_status == 11 || amb_status == 12 || amb_status == 41 || amb_status == 42 ){ \n \n// marker.addListener('click', function() {\n// $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_check_box').click();\n// return false;\n// });\n//\n// marker.addListener('dblclick', function() {\n// $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_stand_check_box').click();\n// return false;\n// });\n// \n// // }\n// \n// var infowindow = new $ExtendMapWindow.google.maps.InfoWindow({\n// content: amb_details\n// });\n// $ExtendMapWindow.$infoExtMapWindows.push(infowindow); \n//\n// marker.addListener('mouseover', function() {\n// for (var i=0;i<$ExtendMapWindow.$infoExtMapWindows.length;i++) {\n// $ExtendMapWindow.$infoExtMapWindows[i].close();\n// }\n// infowindow.open($ExtendMapWindow.$ambExtMapMarkers, marker);\n// });\n//\n// $ExtendMapWindow.$ambExtMapMarkers[amb_id] = marker; \n \n });\n \n //$ExtendMapWindow.$ExtendMap.fitBounds($ExtmarkerBounds);\n // $ExtendMapWindow.$ExtendMap.setCenter({lat: parseFloat(inc_lat), lng: parseFloat(inc_lng) });\n \n //show checked ambulance direction on extended map\n\n jQuery('.searched_ambu_item .amb_check_box:checked').each(function(){\n \n jQuery(this).click();\n });\n\n}", "title": "" }, { "docid": "cef8f1a4606a5ebe9b0408735ec79b1d", "score": "0.4924846", "text": "function updateInfo(oneWorldCup) {\n\n // ******* TODO: PART III *******\n\n selectedData = allWorldCupData.slice(oneWorldCup, oneWorldCup+1);\n\n\n\n var edition = d3.select('#edition').data(selectedData)\n edition = edition.text( function (d) {\n return d.EDITION;\n })\n\n var host = d3.select('#host').data(selectedData);\n host = host.text( function(d) {\n return d.host\n });\n\n var winner = d3.select('#winner').data(selectedData);\n winner = winner.text( function(d) {\n return d.winner\n });\n\n var silver = d3.select('#silver').data(selectedData);\n silver = silver.text( function(d) {\n return d.runner_up\n });\n\n var teams = d3.select('#teams').data(selectedData)\n\n teams=teams.selectAll('li')\n .data(function (d) {\n return d.teams_names\n });\n\n teams.enter().append('li')\n .merge(teams)\n .text( function (d) {\n return d\n })\n\n teams.exit().remove();\n // Update the text elements in the infoBox to reflect:\n // World Cup Title, host, winner, runner_up, and all participating teams that year\n\n // Hint: For the list of teams, you can create an list element for each team.\n // Hint: Select the appropriate ids to update the text content.\n\n}", "title": "" }, { "docid": "3742adbd5df42328fb1903f94819bcf3", "score": "0.491297", "text": "function changeAllAnnotationsVisibility(){\n vm.isDisplayAll = !vm.isDisplayAll;\n vm.annotationModels.forEach(function(item){\n item.isDisplay = vm.isDisplayAll;\n });\n AnnotationsService.changeAllAnnotationVisibility({\n isDisplay : vm.isDisplayAll\n });\n\n var action = vm.isDisplayAll ? logService.logActions.VIEWER_ANNOT_DISPLAY_ALL : logService.logActions.VIEWER_ANNOT_DISPLAY_NONE;\n AnnotationsService.logAnnotationClientAction(action);\n }", "title": "" }, { "docid": "b9683153e23aa9b6d9c009ef43d9a5da", "score": "0.48908523", "text": "function fillSelect(selectListItems)\n { \n var organismlist= selectListItems.split(\",\"); //list of all the organs for a given organism\n\tvar selLength = organismlist.length;var i;\n clearSelect(document.getElementById(\"organism\")); // clear the previous organs list\n if(organismlist[0] !=\"\"){\n\t for(i=0; i<selLength; ++i){\n var organslist=organismlist[i].split(\":\");\n var org_name=organslist[1]+\"(\"+organslist[2]+\")\"; \n\t addOption(document.getElementById(\"organism\"), org_name,organslist[2]);\n\t }\n\t }\n }", "title": "" }, { "docid": "22453edb36a79031380c919b49ad55c0", "score": "0.4890524", "text": "updatePinsToDisplay () {\n // get labels of selected categories\n let selectedCategories = []\n for (let i = 0; i < this.categories.length; i++) {\n if (this.categories[i].selected === true) {\n selectedCategories.push(this.categories[i].label)\n }\n }\n\n // get ids of pins to display\n let pinsToDisplay = []\n for (let i = 0; i < this.pins.length; i++) {\n if (selectedCategories.includes(this.pins[i].category)) {\n pinsToDisplay.push(this.pins[i].id)\n }\n }\n\n console.log('selectedCategories', selectedCategories)\n console.log('pinsToDisplay', pinsToDisplay)\n\n // update visibility\n for (let i = 0; i < this.T.balloons.length; i++) {\n if (pinsToDisplay.includes(this.T.balloons[i].name)) {\n this.T.balloons[i].visible = true\n } else {\n this.T.balloons[i].visible = false\n }\n }\n }", "title": "" }, { "docid": "1822992171ad3c83d6c91875ebb48a95", "score": "0.48905107", "text": "addAnnotation(annotations,uri,offsetStart,offsetEnd,id,type,rgba,tags){\n if(typeof rgba === \"string\"){\n rgba = rgba.split(',');\n }\n let annotation = \n {\n \"id\":id,\n \"uri\":uri,\n \"offsetStart\":offsetStart,\n \"offsetEnd\":offsetEnd,\n \"type\":type,\n \"rgba\":rgba,\n \"tags\":tags\n };\n annotations.push(annotation);\n if(type != null) {\n //store new parent annotations in localstorage\n let storedAnnots = this.annots.loadStorage(\"annots\");\n storedAnnots.annotations = storedAnnots.annotations.filter(annotation => annotation.id != id);\n storedAnnots.annotations.push(annotation);\n this.annots.saveStorage(\"annots\",storedAnnots);\n }\n }", "title": "" }, { "docid": "c9e5c219e397e1313be3e571604e7579", "score": "0.48840073", "text": "function watchOrganization() {\n $scope.$watchCollection(function() {return vm.selOrganization.array;}, function(newVal, oldVal) {\n if (angular.isArray(newVal) && newVal.length > 0) {\n vm.currentBioMarker.name = newVal[0].name;\n vm.masterCopyOfMarkerNameFromCadsr=angular.copy(newVal[0].name);\n vm.currentBioMarker.cadsr_marker_id = newVal[0].id;\n vm.currentBioMarker.record_status=\"Active\";\n vm.currentBioMarker.status_alert=true;\n vm.selOrganization = {name: vm.currentBioMarker[\"po_name\"], array: []};\n }\n });\n }", "title": "" }, { "docid": "90dbe05c2f4fddd2502266124248abd6", "score": "0.48778525", "text": "function removeAnnotationsUponLoad() {\n // We don't actually need to remove the individual spans because we\n // just overwrite the whole HTML.\n annotationChanges = 0\n}", "title": "" }, { "docid": "7fbe93cba2041a9a9ab11a554f85a43b", "score": "0.48714033", "text": "updateInfo(oneWorldCup) {\n\n // ******* TODO: PART III *******\n\n // Update the text elements in the infoBox to reflect:\n // World Cup Title, host, winner, runner_up, and all participating teams that year\n\n // Hint: For the list of teams, you can create an list element for each team.\n // Hint: Select the appropriate ids to update the text content.\n\n //Set Labels\n let info = d3.select('#details');\n info.select('#edition').text(oneWorldCup.EDITION);\n info.select('#host').text(oneWorldCup.host);\n info.select('#winner').text(oneWorldCup.winner);\n info.select('#silver').text(oneWorldCup.runner_up);\n\n //all participating teams\n //unordered HTML list\n info.select('#teams').select('ul').remove();\n let teams = info.select('#teams')\n .append('ul')\n .selectAll('li')\n .data(oneWorldCup.teams_names);\n\n teams.enter()\n .append('li')\n .text(function (d) {return d}); \n\n }", "title": "" }, { "docid": "9376710d0086fe5c896f0a945e47dce7", "score": "0.48617575", "text": "onRightAnnotationTapped(rightAnnot) {\n for(var i = 0; i < this.state.annotations.length; i++) {\n var currVenue = this.state.annotations[i];\n if(currVenue.id === rightAnnot.id) {\n if(currVenue._id) {\n this.eventEmitter.emit('annotationTapped', { venue: currVenue });\n break;\n } else {\n fetch(config.serverURL+'/api/venues', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n title: currVenue.title,\n foursquareID: currVenue.id,\n description: currVenue.description,\n address: currVenue.address,\n latitude: currVenue.latitude,\n longitude: currVenue.longitude,\n creator: this.state.user,\n ratings: {},\n datetime: new Date().toISOString()\n })\n })\n .then(response => response.json())\n .then(json => {\n this.eventEmitter.emit('annotationTapped', { venue: json});\n })\n .then(() => this.setState({searchPins: []}))\n .then(() => this.setState({venuePins: [], annotations: []}))\n .then(() => this._venueQuery(config.serverURL + '/api/venues', true))\n .catch(function(err) {\n console.log('error');\n console.log(newVenue);\n console.log(err);\n });\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "18823f6281777227ccd7d15f1328b596", "score": "0.48604453", "text": "function updateShopsMarkers (){\n // Lorsque les magasins ne sont pas sélectionnés, on supprime tous les markers de la carte.\n if (!$scope.$parent.toggleMarkers){\n $scope.$parent.shopMarkers.forEach(function (element) {\n var currentMarker = element;\n currentMarker.setMap(null);\n google.maps.event.clearInstanceListeners(currentMarker, 'click');\n });\n }\n // Lorsque les magasins sont sélectionnés, on ajoute un marker par magasin.\n else {\n $scope.$parent.shopMarkers.forEach(function (element) {\n var currentMarker = element;\n currentMarker.setIcon(constants.markerRed);\n currentMarker.setAnimation(google.maps.Animation.DROP);\n\n var infowindow = new google.maps.InfoWindow({\n content: currentMarker.title\n });\n\n attachListener(currentMarker, infowindow);\n currentMarker.setMap(map);\n });\n }\n }", "title": "" }, { "docid": "591b529ed15996b028a7a9a0e06a99d1", "score": "0.48490804", "text": "function runUpdateMarkers(){\n\tupdateMarkers();\n}", "title": "" }, { "docid": "9713b4758b6626dbb5d2264f7323ccd9", "score": "0.48485518", "text": "function N(){if(0<y.annos.length){if(y.annos.length=0,c)for(var e=0;e<c.length;e++)c[e]._grips.clear(),c[e]._paper.forEach(C),c[e]._paper._trash.remove(),c[e]._paper._trash.clear(),c[e]._paper._annos.remove(),c[e]._paper._annos.clear();l.trigger({type:\"annotationscleared\"})}}", "title": "" }, { "docid": "7f7f28b741f56a5e0c5ffd6a67c5dcda", "score": "0.4842072", "text": "function updateCustomMarkers() {\n\n // get map object\n if ($scope.schema == 'parties') return;\n var map = $scope.map;\n var tempImage = new Image();\n // go through all of the images\n for (var x in map.dataProvider.images) {\n // get MapImage object\n tempImage = new Image();\n if (map.dataProvider.images[x].logo_s)\n tempImage.src = map.dataProvider.images[x].logo_s;\n if (map.dataProvider.images[x].imgURL)\n tempImage.src = map.dataProvider.images[x].imgURL;\n var image = map.dataProvider.images[x];\n\n if (map.dataProvider.images[x].label && map.dataProvider.images[x].label === 'EU' || map.dataProvider.images[x].label && map.dataProvider.images[x].label === ' ') continue;\n // check if it has corresponding HTML element\n if ('undefined' == typeof image.externalElement) {\n image.externalElement = generateMarker(x);\n }\n\n if ('undefined' !== typeof image.externalElement) {\n // reposition the element accoridng to coordinates\n image.externalElement.style.top = map.latitudeToY(image.latitude) + 'px';\n image.externalElement.style.left = map.longitudeToX(image.longitude) + 'px';\n }\n } //for\n\n $scope.map.addListener(\"positionChanged\", updateCustomMarkers);\n $scope.map.addListener(\"clickMapObject\", function(event) {\n var id = event.mapObject.id;\n if (event.mapObject.id === 'GL') {\n $scope.map.clickMapObject(getMapObject('DK'));\n id = 'DK';\n }\n });\n } //updateCustomMarkers", "title": "" }, { "docid": "2bb399a3aa2c87dead56d4a1c84d967c", "score": "0.4837689", "text": "function setInfos(){\n\torgans[0].setInformations(\"The esophagus commonly known as the food pipe or gullet, is an organ in vertebrates through which food passes, aided by peristaltic contractions, from the pharynx to the stomach.\");\n\torgans[1].setInformations(\"In vertebrates the gallbladder (also gall bladder, biliary vesicle or cholecyst) is a small organ where bile (a fluid produced by the liver) is stored and concentrated before it is released into the small intestine.</br> Humans can live without a gallbladder.\");\n\torgans[2].setInformations(\"The heart is a muscular organ in humans and other animals, which pumps blood through the blood vessels of the circulatory system.</br> Blood provides the body with oxygen and nutrients, as well as assists in the removal of metabolic wastes.</br> The heart is located between the lungs, in the middle compartment of the chest.\");\n\torgans[3].setInformations(\"The kidneys are two bean-shaped organs found on the left and right sides of the body in vertebrates. They filter the blood in order to make urine, to release and retain water, and to remove waste. They also control the ion concentrations and acid-base balance of the blood. Each kidney feeds urine into the bladder by means of a tube known as the ureter.\");\n\torgans[4].setInformations(\"The large intestine, or the large bowel, is the last part of the gastrointestinal tract and of the digestive system in vertebrates. Water is absorbed here and the remaining waste material is stored as feces before being removed by defecation.\")\n\torgans[5].setInformations(\"The liver is a vital organ of vertebrates and some other animals. In the human, it is located in the upper right quadrant of the abdomen, below the diaphragm. The liver has a wide range of functions, including detoxification of various metabolites, protein synthesis, and the production of biochemicals necessary for digestion.\")\n\torgans[6].setInformations(\"The lungs are the primary organs of respiration in humans and many other animals including a few fish and some snails. In mammals and most other vertebrates, two lungs are located near the backbone on either side of the heart. Their function in the respiratory system is to extract oxygen from the atmosphere and transfer it into the bloodstream, and to release carbon dioxide from the bloodstream into the atmosphere, in a process of gas exchange.\")\n\torgans[7].setInformations(\"The pancreas is a glandular organ in the digestive system and endocrine system of vertebrates. In humans, it is located in the abdominal cavity behind the stomach. It is an endocrine gland producing several important hormones, including insulin, glucagon, somatostatin, and pancreatic polypeptide which circulate in the blood. The pancreas is also a digestive organ, secreting pancreatic juice containing digestive enzymes that assist digestion and absorption of nutrients in the small intestine.\")\n\torgans[8].setInformations(\"The small intestine or small bowel is the part of the gastrointestinal tract between the stomach and the large intestine, and is where most of the end absorption of food takes place. The small intestine has three distinct regions – the duodenum, jejunum, and ileum. The duodenum receives bile and pancreatic juice through the pancreatic duct, controlled by the sphincter of Oddi. The primary function of the small intestine is the absorption of nutrients and minerals from food.\")\n\torgans[9].setInformations(\"The stomach is a muscular, hollow, dilated part of the gastrointestinal tract that functions as an important organ in the digestive system. The stomach is present in many animals including vertebrates, echinoderms, insects (mid-gut), and molluscs. In humans and many other vertebrates it is involved in the second phase of digestion, following mastication (chewing).\")\n\torgans[10].setInformations(\"The spleen is an organ found in virtually all vertebrates. Similar in structure to a large lymph node, it acts primarily as a blood filter.</br>The spleen plays important roles in regard to red blood cells (also referred to as erythrocytes) and the immune system. It removes old red blood cells and holds a reserve of blood, which can be valuable in case of hemorrhagic shock, and also recycles iron. As a part of the mononuclear phagocyte system, it metabolizes hemoglobin removed from senescent red blood cells (erythrocytes). The globin portion of hemoglobin is degraded to its constitutive amino acids, and the heme portion is metabolized to bilirubin, which is removed in the liver.\")\n}", "title": "" }, { "docid": "c772f8e392b137b58faea997ed0175d4", "score": "0.48366463", "text": "function updateAffList(results) {\r\n //create a empty affiliates list array\r\n var affListArry = new Array();\r\n //get the select element for affiliates list\r\n var pickAff = document.getElementById(\"aff_type\");\r\n //create a new option element for the select \r\n pickAff.options.length = 0;\r\n var optAff = new Option(\"All\");\r\n pickAff.options[pickAff.options.length] = optAff;\r\n\r\n for (var i = 0, len = results.features.length; i < len; i++) {\r\n var affAttributes = results.features[i].attributes;\r\n for (attribute in affAttributes) {\r\n var index = affListArry.indexOf(affAttributes.Affiliatio);\r\n if (index == -1) {\r\n affListArry.push(affAttributes.Affiliatio);\r\n }\r\n }\r\n }\r\n \r\n //sort the order in the affiliation list array\r\n affListArry.sort();\r\n\r\n //affListArry.unshift(\"All\");\r\n \r\n //write the affiliation list array to the pulldown menu list\r\n for (var j = 0; j < affListArry.length; j++) {\r\n var optAff = new Option(affListArry[j], affListArry[j]);\r\n pickAff.options[pickAff.options.length] = optAff;\r\n }\r\n pickAff.options[0].selected = \"selected\";\r\n //console.log(pickAff.selectedIndex);\r\n }", "title": "" }, { "docid": "c8cee10b18b493565dde37c4c118d9a6", "score": "0.4835298", "text": "addAnnotation (annotation) {\n window.annotationContainer.add(annotation)\n }", "title": "" }, { "docid": "31f4c0258915df37782ad37080d81788", "score": "0.48330954", "text": "function updateMarkers() {\n\t\tlet searchOnly = isSearchOnly();\n\t\t// Remove all markers.\n\t\tfor(let [k, v] of markersOnMap.entries()) {\n\t\t\tmap.removeOverlay(v.marker);\n\t\t\tmarkersOnMap.delete(k);\n\t\t}\n\t\t// Add needed markers.\n\t\tfor(let [k, v] of markers.entries()) {\n\t\t\tif(!searchOnly || (searchOnly && searchResults.has(k))) {\n\t\t\t\tmap.addOverlay(v.marker);\n\t\t\t\tmarkersOnMap.set(k, v);\n\t\t\t}\n\t\t}\n\t\t// Center if necessary.\n\t\tif(centerOnLoad) {\n\t\t\tcenterOnLoad = false;\n\t\t\tview.setCenter(ol.proj.transform(hydro.StationMarker.selected.pos, 'EPSG:4326',\n\t\t\t\t'EPSG:3857'));\n\t\t}\n\t\t// Move selected to top.\n\t\thydro.StationMarker.selectedToTop();\n\t}", "title": "" }, { "docid": "13221829a62d6e17bb9d35c506ecb30d", "score": "0.4829227", "text": "function updateMarkers() {\n //create some labels\n var labels = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n //clear current markers\n if(markerCluster != undefined) {\n markerCluster.clearMarkers();\n }\n\n //create array of markers\n/*old way that works for clustering but no info box\n var markers = aqData.map(function(measure, i) {\n var lat = aqData[i].coordinates.latitude;\n var lon = aqData[i].coordinates.longitude;\n return new google.maps.Marker({\n position: new google.maps.LatLng(lat,lon),\n label: labels[i % labels.length]\n });\n });\n*/\n\n/*new way including info box*/\nvar infowindow = new google.maps.InfoWindow();\n var markers = $rootScope.measurements.map(function(measure, i) {\n var lat = $rootScope.measurements[i].coordinates.latitude;\n var lon = $rootScope.measurements[i].coordinates.longitude;\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(lat,lon),\n label: labels[i % labels.length]\n });\n marker.addListener('mouseover', function() {\n infowindow.setContent($rootScope.measurements[i].parameter + \": \" + $rootScope.measurements[i].value + $rootScope.measurements[i].unit);\n infowindow.open(map, marker);\n //console.log(\"opened info box\");\n });\n marker.addListener('mouseout', function() {\n infowindow.close();\n //console.log(\"closed info box\");\n });\n return marker;\n });\n/*new way including info box*/\n\n\n\n\n //add marker clusterer to manage the markers\n markerCluster = new MarkerClusterer(map, markers, {imagePath: \"images/m\"});\n } //updateMarkers", "title": "" }, { "docid": "219b9aec313c3dc8f1a2bd726ee94a37", "score": "0.48254424", "text": "updateOrg (json: jsonUpdate, callback: mixed){\n\t\tconsole.log(\"Kall til updateOrg: \");\n\t\tlet val = [json.organizationnumber, json.name, json.email, json.tel, json.org_id];\n\t\tconsole.log(\"val: \", val);\n\t\tsuper.query(\n\t\t\t\"update Organization set organizationnumber = ?, name = ?, email = ?, tel = ? where org_id = ?\",\n\t\t\tval,\n\t\t\tcallback\n\t\t);\n\t}", "title": "" }, { "docid": "138af0cb3886764de390dd7dc45a88ee", "score": "0.48129418", "text": "function updateShopsMarkers (){\n if (!$scope.$parent.checked){\n $scope.$parent.shopMarkers.forEach(function (marker) {\n var currentMarker = marker;\n currentMarker.setMap(null);\n google.maps.event.clearInstanceListeners(currentMarker, 'click');\n });\n }\n else {\n $scope.$parent.shopMarkers.forEach(function (marker) {\n var currentMarker = marker;\n currentMarker.setAnimation(google.maps.Animation.DROP);\n\n var infowindow = new google.maps.InfoWindow({\n content: currentMarker.title\n });\n\n attachListener(currentMarker, infowindow);\n currentMarker.setMap(map);\n });\n }\n }", "title": "" }, { "docid": "6569fae1f3670c8d11d51128f66f9d85", "score": "0.48015004", "text": "function update_ambulance_inc_map(){\n \n // alert('kkk')\n if( jQuery('#inc_map_address').length < 1 ){\n return false;\n }\n \n $('#SelectedAmbulance').html('');\n \n //$ambMapMarkers = {};\n $infoWindows = [];\n //var $markerBounds = new google.maps.LatLngBounds();\n if($ambMapMarkers != null){\n $callIncidentMap.removeObject($ambMapMarkers);\n $ambMapMarkers = null;\n }\n $ambMapMarkers = new H.map.Group();\n \n //console.log($ambMapMarkers);\n $callIncidentMap.addObject($ambMapMarkers);\n \n var inc_lat = $('#add_inc_details #lat').val();\n var inc_lng = $('#add_inc_details #lng').val();\n\n //$markerBounds.extend({lat: parseFloat(inc_lat), lng: parseFloat(inc_lng) });\n\n $('.inc_ambu_list .searched_ambu_item').each( function() {\n \n // alert('hhhhh')\n var amb_obj = this;\n var amb_id = $(this).attr('data-amb_id');\n var amb_lat = $(this).attr('data-lat');\n var amb_lng = $(this).attr('data-lng');\n var amb_title = $(this).attr('data-title');\n var amb_rto_no = $(this).attr('data-rto-no');\n var amb_status = $(this).attr('data-amb_status');\n var amb_details = $(this).find('.ambu_pin_info').html();\n\n console.log(amb_details);\n \n var markerLatLng = {lat: parseFloat(amb_lat), lng: parseFloat(amb_lng) };\n var $amb_icon = new H.map.Icon($MapPins[amb_status], {size: {w: 21, h: 21}});\n console.log(markerLatLng);\n var $marker = new H.map.Marker(markerLatLng,{icon: $amb_icon});\n //$marker.setData(amb_details);\n \n $marker.addEventListener('pointerenter', function(evt){\n\n var infowindow = new H.ui.InfoBubble(markerLatLng, {\n content: amb_details\n });\n\n //remove infobubbles\n $callIncidentMapUI.getBubbles().forEach(bub => $callIncidentMapUI.removeBubble(bub));\n $callIncidentMapUI.addBubble(infowindow);\n\n }, false);\n \n \n $marker.addEventListener('tap', function(evt){\n $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_check_box').click();\n return false;\n });\n \n $marker.addEventListener('dbltap', function(evt){\n $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_stand_check_box').click();\n return false;\n });\n \n $ambMapMarkers.addObject($marker);\n\n });\n \n //$callIncidentMap.fitBounds($markerBounds);\n $callIncidentMap.setCenter({lat: parseFloat(inc_lat), lng: parseFloat(inc_lng) });\n //console.log('123');\n \n\n \n if(jQuery(\"#DefaultSelectedAmb\").length >= 1 ){\n var DefaultSelectedAmb = JSON.parse(jQuery(\"#DefaultSelectedAmb\").val());\n \n jQuery.each(DefaultSelectedAmb,function(){\n var amb_id = $('.inc_ambu_list .searched_ambu_item[data-rto-no=\"'+this+'\"]').attr('data-amb_id');\n //google.maps.event.trigger($ambMapMarkers[amb_id] , 'click');\n $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_check_box').click();\n });\n \n }else{\n // Select First ambulance by default \n var amb_id = $('.inc_ambu_list .searched_ambu_item').filter('[data-amb_status=\"41\"]').eq(0).attr('data-amb_id');\n if(typeof amb_id == 'undefined'){\n var amb_id = $('.inc_ambu_list .searched_ambu_item').filter('[data-amb_status=\"11\"]').eq(0).attr('data-amb_id');\n }\n //google.maps.event.trigger($ambMapMarkers[amb_id] , 'click');\n $('.searched_ambu_item#Search_Amb_'+amb_id+' .amb_check_box').click();\n }\n \n if($isExtendedMapOpened){\n update_ambulance_inc_ext_map();\n }\n \n}", "title": "" }, { "docid": "7347afaed32ca8ece4c89e5e9fa99234", "score": "0.47978604", "text": "function loadOrganizations() {\n \n }", "title": "" }, { "docid": "f1641b16e729ec421a05de68ca042b35", "score": "0.47939456", "text": "doAdd(annotation) {\n if (typeof annotation.destination !== 'undefined') {\n let layout = new PdfStringLayouter();\n let layoutResult = layout.layout(annotation.text, annotation.font, annotation.stringFormat, new SizeF((annotation.bounds.width), 0), false, new SizeF(0, 0));\n let lastPosition = annotation.bounds.y;\n if (layoutResult.lines.length === 1) {\n let size = annotation.font.measureString(layoutResult.lines[0].text);\n annotation.bounds = new RectangleF(new PointF(annotation.bounds.x, lastPosition), size);\n annotation.text = layoutResult.lines[0].text;\n //Draw Annotation Text.\n this.page.graphics.drawString(annotation.text, annotation.font, null, annotation.brush, annotation.bounds.x, annotation.bounds.y, annotation.bounds.width, annotation.bounds.height, null);\n //Add annotation to dictionary.\n annotation.setPage(this.page);\n this.setColor(annotation);\n this.internalAnnotations.add(new PdfReferenceHolder(annotation));\n this.lists.push(annotation);\n }\n else {\n for (let i = 0; i < layoutResult.lines.length; i++) {\n let size = annotation.font.measureString(layoutResult.lines[i].text);\n if (i === 0) {\n annotation.bounds = new RectangleF(annotation.bounds.x, lastPosition, size.width, size.height);\n annotation.text = layoutResult.lines[i].text;\n //Draw Annotation Text.\n this.page.graphics.drawString(annotation.text, annotation.font, null, annotation.brush, annotation.bounds.x, lastPosition, size.width, size.height, null);\n //Add annotation to dictionary.\n annotation.setPage(this.page);\n this.setColor(annotation);\n this.internalAnnotations.add(new PdfReferenceHolder(annotation));\n this.lists.push(annotation);\n //Update y for drawing next line of the text.\n lastPosition += annotation.bounds.height;\n }\n else {\n let annot = annotation.clone();\n annot.bounds = new RectangleF(new PointF(annotation.bounds.x, lastPosition), size);\n annot.text = layoutResult.lines[i].text;\n //Draw Annotation Text.\n this.page.graphics.drawString(annot.text, annot.font, null, annot.brush, annot.bounds.x, annot.bounds.y, annot.bounds.width, annot.bounds.height, null);\n //Add annotation to dictionary.\n annot.setPage(this.page);\n this.setColor(annot);\n this.internalAnnotations.add(new PdfReferenceHolder(annot));\n this.lists.push(annot);\n //Update y for drawing next line of the text.\n lastPosition += annot.bounds.height;\n }\n }\n }\n }\n else {\n annotation.setPage(this.page);\n this.internalAnnotations.add(new PdfReferenceHolder(annotation));\n return this.lists.push(annotation);\n }\n }", "title": "" }, { "docid": "4ff46a9397052a01e418accf95f0797a", "score": "0.47898078", "text": "function attachListener (marker, infowindow){\n google.maps.event.addListener( marker, 'click', function(){\n // Dans le cas où on on veut afficher des infos sur le marker.\n if (!$scope.$parent.selectShops){\n map.panTo(marker.getPosition());\n infowindow.open(map,marker);\n }\n // Dans le cas où on veut créer notre liste pour un itinéraire.\n else {\n var id = marker.getZIndex();\n var index = $scope.$parent.selectedShops.indexOf(id);\n if (index === -1){\n marker.setIcon(constants.markerBlue);\n $scope.$parent.selectedShops.push(id);\n }\n else {\n marker.setIcon(constants.markerRed);\n $scope.$parent.selectedShops.splice(index,1);\n }\n }\n });\n }", "title": "" }, { "docid": "444875722f40b9fd20cd1cdc913b0c2b", "score": "0.47883832", "text": "function assignLyricSectionToArtist(artistAttributions) {\n artistAttributions.map(artist => {\n const found = ARTISTS_TABLE.some(el => el.artistName === artist);\n if (!found) {\n // create a new entry for this artist\n let obj = {\n artistName: artist,\n lyricSectionLength: 1,\n };\n\n ARTISTS_TABLE.push(obj);\n } else {\n ARTISTS_TABLE.map((el) => {\n if (el.artistName === artist) {\n el.lyricSectionLength++;\n }\n });\n }\n })\n // console.log(ARTISTS_TABLE);\n sortArtistsBySectionTotals(ARTISTS_TABLE);\n}", "title": "" }, { "docid": "4db07b4962252f0c4f7a3d369063e889", "score": "0.4786961", "text": "function populateUserList() {\r\n var editorIds = new Object();\r\n for (var seg in wazeModel.segments.objects) {\r\n var segment = wazeModel.segments.get(seg);\r\n var updatedBy = segment.attributes.updatedBy;\r\n if (editorIds[updatedBy] == null) {\r\n var user = wazeModel.users.get(updatedBy);\r\n if (user == null || user.userName.match(/^world_|^usa_/) != null) {\r\n continue;\r\n }\r\n editorIds[updatedBy] = user.userName;\r\n }\r\n }\r\n populateOption(highlightEditor.getSelectId(), editorIds);\r\n}", "title": "" }, { "docid": "4db07b4962252f0c4f7a3d369063e889", "score": "0.4786961", "text": "function populateUserList() {\r\n var editorIds = new Object();\r\n for (var seg in wazeModel.segments.objects) {\r\n var segment = wazeModel.segments.get(seg);\r\n var updatedBy = segment.attributes.updatedBy;\r\n if (editorIds[updatedBy] == null) {\r\n var user = wazeModel.users.get(updatedBy);\r\n if (user == null || user.userName.match(/^world_|^usa_/) != null) {\r\n continue;\r\n }\r\n editorIds[updatedBy] = user.userName;\r\n }\r\n }\r\n populateOption(highlightEditor.getSelectId(), editorIds);\r\n}", "title": "" }, { "docid": "4db07b4962252f0c4f7a3d369063e889", "score": "0.4786961", "text": "function populateUserList() {\r\n var editorIds = new Object();\r\n for (var seg in wazeModel.segments.objects) {\r\n var segment = wazeModel.segments.get(seg);\r\n var updatedBy = segment.attributes.updatedBy;\r\n if (editorIds[updatedBy] == null) {\r\n var user = wazeModel.users.get(updatedBy);\r\n if (user == null || user.userName.match(/^world_|^usa_/) != null) {\r\n continue;\r\n }\r\n editorIds[updatedBy] = user.userName;\r\n }\r\n }\r\n populateOption(highlightEditor.getSelectId(), editorIds);\r\n}", "title": "" }, { "docid": "db47f2053ddffe104be56a9f449eeefd", "score": "0.47709155", "text": "updateResult() {\n if (self.result) {\n self.result.area.setValue(self);\n } else {\n if (self.perregion) {\n const area = self.annotation.highlightedNode;\n\n if (!area) return null;\n area.setValue(self);\n } else {\n self.annotation.createResult({}, { choices: self.selectedValues() }, self, self.toname);\n }\n }\n }", "title": "" }, { "docid": "c9731a8b608d9803010baafb4e433a5b", "score": "0.47694975", "text": "add(annotation) {\n // this.SetPrint(annotation);\n this.doAdd(annotation);\n }", "title": "" }, { "docid": "4925210c874c929238300f9029046c0b", "score": "0.47686905", "text": "function orgSuccess(data,textStatus,xhr) {\nvar counter;\nvar counter2;\nvar counter3;\njsonOrgs = data;\nvar queryOrgs = data[\"queryorgs\"];\nvar refOrgs = data[\"reforgs\"];\nvar outgroups = data[\"outgroups\"];\noutgrInfo = [];\nfor (counter3 = 0; counter3<queryOrgs.length; counter3++) {\n var queryInfo = queryOrgs[counter3];\n $('#speciessel').append(\"<option value='\"+queryInfo.id+\"' data-title='(U) \"+ queryInfo.orgname + \" (detected genus: \"+ queryInfo.genusname +\")\"+\"' id='\" + queryInfo.id +\"' data-genusid='\"+queryInfo.genusid+\"' data-genusname='\"+queryInfo.genusname+\"' data-familyid='\"+queryInfo.familyid+\"' data-familyname='\"+queryInfo.familyname+\"' data-orderid='\"+queryInfo.orderid + \"' data-ordername='\"+queryInfo.ordername+\"' data-phylid='\"+queryInfo.phylid+\"' data-phylname='\"+queryInfo.phylname+\"'> (U) \"+queryInfo.orgname+ \" (detected genus: \"+ queryInfo.genusname+\") </option>\");\n}\nfor (counter = 0; counter<refOrgs.length; counter++) {\n var orgInfo = refOrgs[counter];\n typestr = (orgInfo.typestrain) ? orgInfo.typestrain : \"false\";\n if (typestr == true) {\n $('#speciessel').append(\"<option value='\"+orgInfo.id+\"' data-title='(T) \"+ orgInfo.orgname + \" (mean distance: \"+ parseFloat(orgInfo.dist).toFixed(3)+\")\"+\"' id='\" + orgInfo.id + \"' data-genusid='\"+orgInfo.genusid+\"' data-genusname='\"+orgInfo.genusname+\"' data-familyid='\"+orgInfo.familyid+\"' data-familyname='\"+orgInfo.familyname+\"' data-orderid='\"+orgInfo.orderid + \"' data-ordername='\"+orgInfo.ordername+\"' data-phylid='\"+orgInfo.phylid+\"' data-phylname='\"+orgInfo.phylname+\"'>(T) \"+orgInfo.orgname+ \" (mean distance: \"+ parseFloat(orgInfo.dist).toFixed(3)+\") </option>\");\n } else {\n $('#speciessel').append(\"<option value='\"+orgInfo.id+\"' data-title='\"+ orgInfo.orgname + \" (mean distance: \"+ parseFloat(orgInfo.dist).toFixed(3)+\")\"+\"' id='\" + orgInfo.id +\"' data-genusid='\"+orgInfo.genusid+\"' data-genusname='\"+orgInfo.genusname+\"' data-familyid='\"+orgInfo.familyid+\"' data-familyname='\"+orgInfo.familyname+\"' data-orderid='\"+orgInfo.orderid + \"' data-ordername='\"+orgInfo.ordername+\"' data-phylid='\"+orgInfo.phylid+\"' data-phylname='\"+orgInfo.phylname+\"'>\"+orgInfo.orgname+ \" (mean distance: \"+ parseFloat(orgInfo.dist).toFixed(3)+\") </option>\");\n }\n }\nfor (counter2 = 0; counter2<outgroups.length; counter2++) {\n outgrInfo[counter2] = outgroups[counter2]; //add entries to object; outgroup multiselect is later populated by outgroupPick\n //$('#outgrsel').append(\"<option value='\"+outgrInfo[counter2].id+\"' data-title='\"+ outgrInfo[counter2].orgname + \" (mean distance: \"+ parseFloat(outgrInfo[counter2].dist).toFixed(3)+\")\"+\"' id='\" + outgrInfo[counter2].id +\"' data-genusid='\"+outgrInfo.genusid+\"' data-genusname='\"+outgrInfo.genusname+\"' data-familyid='\"+outgrInfo.familyid+\"' data-familyname='\"+outgrInfo[counter2].familyname+\"' data-orderid='\"+outgrInfo[counter2].orderid + \"' data-ordername='\"+outgrInfo[counter2].ordername+\"' data-phylid='\"+outgrInfo[counter2].phylid+\"' data-phylname='\"+outgrInfo[counter2].phylname+\"'>\"+outgrInfo[counter2].orgname+ \" (mean distance: \"+ parseFloat(outgrInfo[counter2].dist).toFixed(3)+\") </option>\");\n\n}\nif (data[\"selspecies\"] && data[\"seloutgroups\"]) {\n var selectedSpecies = data[\"selspecies\"];\n var selectedOutgroups = data[\"seloutgroups\"];\n loadSelected('#speciessel','#specieslist',selectedSpecies);\n outgroupPick();\n loadSelected('#outgrsel','#outgrlist',selectedOutgroups);\n} else {\n loadDefaults('#speciessel','#specieslist',50);\n outgroupPick();\n loadDefaults('#outgrsel','#outgrlist',1);\n}\n}", "title": "" }, { "docid": "35e225c8d834001de2cf322acd2cf7e7", "score": "0.47632283", "text": "function addInfo() {\n getInstructors();\n}", "title": "" }, { "docid": "ef07979c2057b0afb2b6622247a2716a", "score": "0.47629356", "text": "function processAnnotations() {\n console.log('process annoations');\n\n CSE.res = JSON.parse(CSE.req.responseText);\n CSE.unreadCount += CSE.res.length;\n\n if (CSE.unreadCount > 0) {\n chrome.browserAction.setBadgeBackgroundColor({\n color: [255, 0, 0, 255]\n });\n chrome.browserAction.setBadgeText({text: '' + CSE.unreadCount});\n }\n CSE.annotations = CSE.res.concat(CSE.annotations);\n displayAnnotations();\n }", "title": "" }, { "docid": "714c9eb048d559149711f2ffdd7491a8", "score": "0.47535512", "text": "function displayAnnotation(annotation) {\n document.getElementById('message').innerHTML = annotation;\n}", "title": "" }, { "docid": "be2c7f228ebf60c26555677aae237f39", "score": "0.47522673", "text": "function updateMap() {\n // Use D3 to select the dropdown menu\n var dropdownMenu = d3.select(\"#selectYear\");\n // Assign the value of the dropdown menu option to a variable\n var yearset = dropdownMenu.property(\"value\");\n\n // console.log(yearset);\n //variable for refresh\n let yearlist = [] ;\n\n for (var i = 0; i < data.features.length; i++) {\n if (data.features[i].properties.archiveyear == yearset) {\n // push to a layer to draw\n let fire = L.circle([data.features[i].geometry.coordinates[1], data.features[i].geometry.coordinates[0]], {\n fillOpacity: 0.4,\n color: \"orange\",\n fillColor: \"orange\",\n // Setting our circle's radius to equal the output of our markerSize() function:\n radius: markerSize(data.features[i].properties.acresburned)\n }).bindPopup(`<h4>Name: ${data.features[i].properties.firename}</h4><h5>Duration (Days): ${data.features[i].properties.duration}<br>Acres Burnt: ${data.features[i].properties.acresburned}</h5>`)\n //push to make a layer for display\n yearlist.push(fire);\n }\n else {\n };\n };\n // refresh with new selection\n myMap.removeLayer(blanky);\n blanky=L.layerGroup(yearlist);\n blanky.addTo(myMap);\n }", "title": "" }, { "docid": "addd8c0613d03e7370b351e9bea24c8d", "score": "0.47520247", "text": "updateInfo(oneWorldCup) {\n\n // ******* TODO: PART III *******\n\n // Update the text elements in the infoBox to reflect:\n // World Cup Title, host, winner, runner_up, and all participating teams that year\n document.getElementById(\"host\").innerHTML = oneWorldCup.host;\n document.getElementById(\"winner\").innerHTML = oneWorldCup.winner;\n document.getElementById(\"silver\").innerHTML = oneWorldCup.runner_up;\n let teams = oneWorldCup.teams_names;\n let teamSpace = document.getElementById(\"teams\");\n teamSpace.innerHTML = \"\";\n teamSpace.innerHTML += \"<ul>\";\n for(let i=0; i < teams.length; i++) {\n teamSpace.innerHTML += \"<li>\"+teams[i]+\"</li>\";\n }\n teamSpace.innerHTML += \"</ul>\";\n\n //console.log(yest);\n // Hint: For the list of teams, you can create an list element for each team.\n // Hint: Select the appropriate ids to update the text content.\n\n //Set Labels\n\n }", "title": "" }, { "docid": "6736753efc5db7ab93b3483386187908", "score": "0.47473314", "text": "enterAnnotationList(ctx) {\n\t}", "title": "" }, { "docid": "75f3b7a2ab4a1ea5a6d8e8268c762aab", "score": "0.4746968", "text": "function setGenotypeUsed() {\n\t\t\tconsole.log(\"setGenotypeUsed()\");\n\n if (vm.apiDomain.isInSitu == true) {\n if (vm.apiDomain.specimens[vm.selectedSpecimenIndex].genotypeKey == \"\") {\n return;\n }\n }\n else {\n if (vm.apiDomain.gelLanes[vm.selectedGelLaneIndex].genotypeKey == \"\") {\n return;\n }\n }\n\n var genotypeKey = \"\";\n if (vm.apiDomain.isInSitu == true) {\n genotypeKey = vm.apiDomain.specimens[vm.selectedSpecimenIndex].genotypeKey;\n }\n else {\n genotypeKey = vm.apiDomain.gelLanes[vm.selectedGelLaneIndex].genotypeKey;\n }\n\n // iterate thru genotypeLookup\n\t\t\tfor(var i=0;i<vm.genotypeLookup.length; i++) {\n var id = \"genotypeTerm-\" + i;\n\n if (vm.genotypeLookup[i].objectKey == genotypeKey) {\n document.getElementById(id).style.backgroundColor = \"rgb(252,251,186)\";\n document.getElementById(id).scrollIntoView({ behavior: 'auto', block: 'nearest', inline: 'nearest' });\n }\n else {\n document.getElementById(id).style.backgroundColor = \"rgb(238,238,238)\";\n }\n }\n }", "title": "" }, { "docid": "9e598aaea5eadfd53e1d53254ac6973e", "score": "0.474371", "text": "function changeSelectingAnnotation(item){\n\n if(!item){ return; }\n\n if(vm.selectedItem == item){\n vm.selectedItem.isSelected = false;\n vm.selectedItem = null;\n }\n else{\n if(vm.selectedItem){\n vm.selectedItem.isSelected = false;\n }\n item.isSelected = !item.isSelected;\n vm.selectedItem = item;\n }\n }", "title": "" }, { "docid": "f5fa0b57dd4ebe600a67b386acae950b", "score": "0.4738705", "text": "function update_map(){\n\n //Information to show and variables to calculate before any event takes place\n var name_prov_selected = splom_data.find(element => element[\"Codigo\"]==selected_id)[\"Provincia\"];\n $(\"#who\").text(\"\");\n domain = get_domain(selected_id);\n for(i=1;i<51;i++){\n value = splom_data.find(element => element[\"Codigo\"]==selected_id)[i];\n if (value == domain [0]) label_min = nombres_provincias.find(element => element[\"id\"] == i)[\"nm\"];\n if (value == domain [1]) label_max = nombres_provincias.find(element => element[\"id\"] == i)[\"nm\"];\n }\n ylabels = [label_min, label_max];\n barchar_data = [domain[0], domain[1]];\n linColor.domain(domain);\n if (type ==\"flow\") {\n total = get_total(selected_id);\n $(\"#where\").text(\"People from \" +name_prov_selected+\" moving away: \"+ total);\n }\n if (type ==\"net\") {\n value = splom_data.find(element => element[\"Codigo\"]==selected_id)[\"net\"];\n $(\"#where\").text(\"net \"+name_prov_selected+\" = \"+value);\n }\n if (type==\"urbanizacion\") {\n var rural=splom_data.find(element => element[\"Codigo\"]==selected_id)[\"Ruralidad\"];\n switch (rural) {\n case \"PU\": \n rural_text = \"primarily urban\";\n break;\n case \"PR\": \n rural_text = \"primarily rural\";\n break;\n case \"IN\": \n rural_text = \"intermidiate\";\n break;\n }\n $(\"#where\").text(name_prov_selected +\" is \" + rural_text + \".\");\n }\n\n //Describe, for each map mode, how to style the map and what happens when an event occurs\n svg.selectAll(\"path\")\n .data(provincias.features)\n //CLICK\n .on(\"click\",function(d){\n //Update the map with the new selected origin province \n selected_id=d[\"properties\"][\"cod_prov\"];\n update_map();\n update_splom(splom_size,splom_padding);\n if (type ==\"flow\") {\n var name_prov_selected = splom_data.find(element => element[\"Codigo\"]==selected_id)[\"Provincia\"];\n total = get_total(selected_id);\n $(\"#where\").text(\"People from \" +name_prov_selected+\" moving away: \"+ total);\n }\n })\n //HOVER\n .on(\"mouseover\",function(d) {\n if (type ==\"flow\"){\n var name_prov_selected = splom_data.find(element => element[\"Codigo\"]==selected_id)[\"Provincia\"];\n var name_destino = d[\"properties\"][\"name\"]; \n var province_id = d[\"properties\"][\"cod_prov\"];\n var numEmigrants = splom_data.find(element => element[\"Codigo\"]==selected_id)[province_id];\n d3.select(this)\n .style(\"fill\",\"#222831\");\n $(\"#who\").text(\"People from \"+name_prov_selected+\" to \"+name_destino+\": \"+numEmigrants);\n update_barchart(numEmigrants, name_destino);\n }\n if (type==\"net\"){\n try {\n num_prov= d[\"properties\"][\"cod_prov\"];\n name_province= d[\"properties\"][\"name\"];\n value = splom_data.find(element => element[\"Codigo\"]==num_prov)[\"net\"];\n } catch (error) {\n }\n d3.select(this)\n .style(\"fill\",\"#222831\");\n $(\"#where\").text(\"net \"+name_province+\" = \"+value);\n }\n if (type==\"urbanizacion\"){\n var province_id = d[\"properties\"][\"cod_prov\"];\n try {\n var rural=splom_data.find(element => element[\"Codigo\"]==province_id)[\"Ruralidad\"]\n }\n catch(error) {\n console.log(error)\n }\n switch (rural) {\n case \"PU\": \n rural_text = \"primarily urban\";\n break;\n case \"PR\": \n rural_text = \"primarily rural\";\n break;\n case \"IN\": \n rural_text = \"intermidiate\";\n break;\n }\n d3.select(this)\n .style(\"fill\",\"#222831\");\n var name_hover = splom_data.find(element => element[\"Codigo\"]==province_id)[\"Provincia\"];\n $(\"#where\").text(name_hover +\" is \" + rural_text + \".\");\n }\n })\n //MOUSE OUT\n .on(\"mouseout\",function(d){\n if (type == \"flow\"){\n var name_prov_selected = splom_data.find(element => element[\"Codigo\"]==selected_id)[\"Provincia\"];\n var name_destino = d[\"properties\"][\"name\"]\n var province_id = d[\"properties\"][\"cod_prov\"]\n var numEmigrants = splom_data.find(element => element[\"Codigo\"]==selected_id)[province_id]\n d3.select(this)\n .style(\"fill\",function(d){\n if (province_id==selected_id)\n return \"black\"\n if (selecting&selected_provinces.indexOf(parseInt(province_id))==-1){\n return \"white\"\n }\n if (province_id <51){\n return linColor(splom_data.find(element => element[\"Codigo\"]==selected_id)[province_id])\n }\n });\n $(\"#who\").text(\"People from \"+name_prov_selected+\" to \"+name_destino+\": \"+numEmigrants);\n }\n if (type ==\"urbanizacion\"){\n d3.select(this)\n .style(\"fill\",function(d){\n var province_id = d[\"properties\"][\"cod_prov\"];\n try {\n var rural=splom_data.find(element => element[\"Codigo\"]==province_id)[\"Ruralidad\"]\n }\n catch(error) {\n console.error(d[\"properties\"][\"cod_prov\"]);\n console.log(error)\n }\n var province_id = d[\"properties\"][\"cod_prov\"];\n if (selecting&selected_provinces.indexOf(parseInt(province_id))==-1)\n return \"white\";\n return catColors(rural)\n })\n }\n if (type == \"net\"){\n d3.select(this)\n .style(\"fill\",function(d){\n num_prov= d[\"properties\"][\"cod_prov\"];\n try {\n value = splom_data.find(element => element[\"Codigo\"]==num_prov)[\"net\"];\n } catch (error) {\n }\n var province_id = d[\"properties\"][\"cod_prov\"];\n if (selecting&selected_provinces.indexOf(parseInt(province_id))==-1)\n return \"white\";\n return scaleColor(value)\n })\n } \n })\n .transition()\n //Define the color of each province, according to the color scales previously defined\n .style(\"fill\", function(d){\n var province_id = d[\"properties\"][\"cod_prov\"];\n if (type==\"urbanizacion\"){\n try {\n var rural=splom_data.find(element => element[\"Codigo\"]==province_id)[\"Ruralidad\"]\n }\n catch(error) { \n }\n if (selecting&selected_provinces.indexOf(parseInt(province_id))==-1){\n return \"white\"\n }\n return catColors(rural)\n }\n if(type==\"flow\"){\n if (province_id==selected_id)\n return \"black\";\n if (selecting&selected_provinces.indexOf(parseInt(province_id))==-1)\n return \"white\";\n if (province_id <51){\n return linColor(splom_data.find(element => element[\"Codigo\"]==selected_id)[province_id])\n }\n }\n if (type==\"net\"){\n try {\n value = splom_data.find(element => element[\"Codigo\"]==province_id)[\"net\"];\n } catch (error) {\n }\n if (selecting&selected_provinces.indexOf(parseInt(province_id))==-1)\n return \"white\";\n return scaleColor(value)\n }\n });\n\n //Remove old legend and draw the new one\n $(\".legend\").remove(); \n $(\"#myGradient\").remove();\n draw_legend(domain,type);\n\n //Draw bar chart if 'Migration Flow' mode is selected\n draw_barchart(\"splom\");\n}", "title": "" }, { "docid": "5cdb31102f48d113695176dfeb49ecfa", "score": "0.47333494", "text": "function updateMarkers(){\n clearMarkers();\n\n var count = 1;\n\n for(var key in places){\n if(places[key].day.replace(/\\s/g, '') == trip_days[day].replace(/\\s/g, '')){\n data = {color: visits_color, icon: getIcon(places[key][\"poi_type\"])};\n createMarker(places[key], data, \"visits\", 'green', count);\n count++;\n }\n }\n\n for(var key in hotels){\n if(hotels[key].day.replace(/\\s/g, '') == trip_days[day].replace(/\\s/g, '')){\n data = {color: visits_color, icon: getIcon(hotels[key][\"poi_type\"])};\n createMarker(hotels[key], data, \"visits\", 'yellow', 'H');\n }\n }\n\n for(var key in suggested_places){\n data = {color: suggested_visits_color, icon: getIcon(suggested_places[key][\"poi_type\"])};\n createMarker(suggested_places[key], data, \"suggestions\", 'blue', 'I');\n }\n\n /* Markers clustering */\n markerCluster = new MarkerClusterer(map, markers,\n {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});\n \n /* update itinerary */\n loadItinerary();\n}", "title": "" }, { "docid": "b9f15405b109676f076657d838cea611", "score": "0.47301084", "text": "async function callToUpdate(newAnnotation) {\n\n update = await fetch('http://tinydev.rerum.io/app/update', {\n method: \"PUT\",\n headers: {\n \"Content_Type\": \"application/kson; charset=utf-8\",\n },\n body: JSON.stringify(newAnnotation),\n })\n\n let updatedJSON = await update.json();\n let updatedAnnotObj = updatedJSON.new_obj_state;\n\n return updatedAnnotObj;\n}", "title": "" }, { "docid": "bb7b81c804e22141f6477d92012e0c2a", "score": "0.47217053", "text": "onSelectAnnotation(indexOfAnnotation, isPreviousAnnotation) {\n //Don't allow an annotation to be selected if there's one in progress,\n //otherwise it gets confusing.\n if (isPreviousAnnotation && this.context.googleLogger) {\n this.context.googleLogger.logEvent({ type: 'click-previous-annotation' });\n }\n\n if (this.props.annotationInProgress === null) {\n this.props.dispatch(selectAnnotation(indexOfAnnotation, isPreviousAnnotation));\n }\n }", "title": "" }, { "docid": "0b0dbd0a0a6a9b72fe9f9be8eaeb7eca", "score": "0.47109511", "text": "function change() {\n\n\t \t\tmarkerLayer.setGeoJSON({\n\t \t\t\ttype: \"FeatureCollection\",\n\t \t\t\tfeatures: [{\n\t \t\t\t type: \"Feature\",\n\t \t\t\t geometry: location,\n\t \t\t\t properties: {\n\t \t\t\t \t\"id\": \"post office\",\n\t \t\t\t \t\"name\": properties.name,\n\t \t\t\t \t\"address\": properties.streetname,\n\t \t\t\t \t\"city\": properties.city,\n\t \t\t\t \t\"housenum\": properties.housenum\n\t \t\t\t }\n\t \t\t\t}]\n\t \t\t})\n\n\t \t\tvar features = markerLayer.getGeoJSON()\n\t \t\tconsole.log(features)\n\n\t \t\tvar on = [];\n\t \t\tfor (var i = 0; i < checkboxes.length; i++) {\n\t \t\t\tif (checkboxes[i].checked) on.push(checkboxes[i].value);\n\t \t\t\tconsole.log(on)\n\t \t }\n\n\t \t markerLayer.setFilter(function (f) {\n\t \t \tconsole.log(f.properties)\n\t \t \t// return on.indexOf(f.properties['id']) !== -1;\n\t \t })\n\t \t return false;\n\t \t}", "title": "" }, { "docid": "d9735f4420939dde1014742f28c72843", "score": "0.46874866", "text": "function AdjustOrganism()\n{\n\tvar words = $(\"qorganism\").value.split(\" (taxid\");\n\t$(\"qorganism\").value = words[0];\t\t\n}", "title": "" }, { "docid": "542800e03d0528e533bd162c33426120", "score": "0.46831837", "text": "drawMarker(anno) {\n this.toolbar_c.fetchAnnotations(annos => {\n var size = annos.length;\n this.osd_c.drawMarker(size, new Annotation(anno));\n });\n }", "title": "" }, { "docid": "89061aca2dcec65d0b8f8677f2ee3c3d", "score": "0.46808812", "text": "function prepareAnnotationMode(){\n\t\n\tvar colorIndex = 0;\n\tvar docArea = document.getElementById('docarea');\n\tvar hltr = new TextHighlighter(docArea, {\n onBeforeHighlight: function (range) {\n //console.log('Selected text: ' + range + '\\nReally highlight?');\n if (inAnnotatorMode && selectExistingElement()){\n \tconsole.log(\"inAnnotatoreMode e selectExistingElement()\");\n \t$('#annotation-modal').modal('toggle');\n\t\t\t\t/* not using the library function */\n \treturn false;\n }\n /* determining if a user can make a highlighted selection on the text */\n else if (inAnnotatorMode && checkSelection()){\n console.log(\"Valid selection\");\n \t$('#annotation-modal').modal('toggle');\n \treturn true;\n }\n else {\n \tif (!inAnnotatorMode) console.log(\"First you must click on the switch...\");\n \telse console.log(\"Selection not valid\");\n \treturn false;\n }\n },\n onAfterHighlight: function (range, highlights) {\n\n \t/* update hightlighting color*/\n \tcolorIndex = (colorIndex + 1) % 5;\n \thltr.setColor(annotationColors[colorIndex]);\n\n },\n onRemoveHighlight: function (hl) {\n //return window.confirm('Are you sure you don\\'t want to annotate this text anymore? \"' + hl.innerText + '\"');\n }\n });\n\t\n\t/* when the annotation modal is closed and no comment is submitted, modifications on text are discarded */\n\t\n\n}", "title": "" }, { "docid": "58e18369057e0f2e95d974d4bc648c06", "score": "0.46747223", "text": "function select_annotation(evt) {\n select_button(evt.target);\n }", "title": "" } ]
919bc37c6cd2c7553ccb9baa21890821
Helper function to allow the creation of anonymous functions which do not have .name set to the name of the variable being assigned to.
[ { "docid": "6d6045bf5bb9a486fbc0bd15e5f6ae0a", "score": "0.0", "text": "function identity(fn) {\n\t\t\t\treturn fn;\n\t\t\t}", "title": "" } ]
[ { "docid": "c0df5dc465690f927b46abdf799e1b93", "score": "0.63816047", "text": "function outer (name) {\n return function (){\n return name; \n }\n}", "title": "" }, { "docid": "052d965191a6107b1c01c2e9d0f6baa7", "score": "0.60148007", "text": "function _nom(fun) {\n var src = fun.toString();\n src = src.substr('function '.length);\n var n = src.substr(0, src.indexOf('('));\n\n if (!L.isFunction(fun)) fail(\"Cannot derive the name of a non-function.\");\n if (fun.name && (fun.name === n)) return fun.name;\n if (n) return n;\n fail(\"Anonymous function has no name.\");\n }", "title": "" }, { "docid": "67b8e1f3921815e3ae5f777326fadbc1", "score": "0.5825665", "text": "function $name(name) {\r\n return new Function(\"return '\" + name + \"'\");\r\n }", "title": "" }, { "docid": "828581b2a0014bedfc9c5d54354ef311", "score": "0.57939464", "text": "function namedFunction(){\n}", "title": "" }, { "docid": "e9b9e716fd35b6a56b3edf593b53a067", "score": "0.5735203", "text": "function namedFunc(){// here we name the new function 'namedFunc'\n console.log('this function has a name');\n }", "title": "" }, { "docid": "26d528407652ee9bc9a3048939f81197", "score": "0.57351714", "text": "function test3(name) {\n //let name = \"Test4\";\n return function (value) {\n return value + ' ' + name;\n }\n}", "title": "" }, { "docid": "e6d37e97d6707ddb17a8e51e30185bb1", "score": "0.5692281", "text": "Identifier(f, name) { f(name) }", "title": "" }, { "docid": "a8945a2f0985392ceb87c88f75f764b4", "score": "0.5690089", "text": "function makeEmptyFunction(arg){return function(){return arg;};}", "title": "" }, { "docid": "a8945a2f0985392ceb87c88f75f764b4", "score": "0.5690089", "text": "function makeEmptyFunction(arg){return function(){return arg;};}", "title": "" }, { "docid": "a8945a2f0985392ceb87c88f75f764b4", "score": "0.5690089", "text": "function makeEmptyFunction(arg){return function(){return arg;};}", "title": "" }, { "docid": "00feeea10dfc143789f8a8073bdc98f5", "score": "0.56812423", "text": "function makeFunc() {\n var name = 'Mozilla';\n function displayName() {\n alert(name);\n }\n return displayName;\n }", "title": "" }, { "docid": "47355cedb00872a8620781de1ca2ea25", "score": "0.5674898", "text": "function outerFn() {\n return myName;\n}", "title": "" }, { "docid": "fe91167f08fb711544fd0cbd40b2a484", "score": "0.566627", "text": "function name_pp(fn) {\n\t\tvar fnname;\n\n\t\tif (fn === undefined) {\n\t\t\tfnname = \"undefined\";\n\t\t} else {\n\t\t\tfnname = (fn.name === \"\") ? \"anonymous\" : fn.name;\n\t\t}\n\t\treturn fnname;\n\t}", "title": "" }, { "docid": "9604ff6bbc9cda48054d7d78eff42cc6", "score": "0.5593891", "text": "function weird(param) {\n return function () {\n this.myField = param;\n }\n}", "title": "" }, { "docid": "51623e8881af059c353c8ce8ade46e5a", "score": "0.55853164", "text": "function n(e){return function(){return e}}", "title": "" }, { "docid": "51623e8881af059c353c8ce8ade46e5a", "score": "0.55853164", "text": "function n(e){return function(){return e}}", "title": "" }, { "docid": "8e97db582b39652ed1694cee34cf26d9", "score": "0.55517703", "text": "function f(greeting = function () { }) {\n console.log(greeting.name);\n}", "title": "" }, { "docid": "5d1d5124778298223d49501d8f7d3bed", "score": "0.55390066", "text": "function d(a){return function(){return a}}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.5470533", "text": "function dummy() {}", "title": "" }, { "docid": "aaacdc2ed599c2c6befac457a619853a", "score": "0.5437535", "text": "function callMeByMyName(name) {\n\n return function() {\n console.log(name, name, name, name, name);\n };\n}", "title": "" }, { "docid": "89034306a0958153043d713ab2818178", "score": "0.5425722", "text": "function makeFunc() {\n var name = \"Some Name\";\n function displayName() {\n console.log(name);\n }\n return displayName;\n}", "title": "" }, { "docid": "cdc015c67aacda656e927014da0f9efd", "score": "0.54028386", "text": "function example() {\n console.log(named); // => undefined\n \n named(); // => TypeError named is not a function\n \n var named = function named() {\n console.log('named');\n };\n }", "title": "" }, { "docid": "b175ec2c36b9b4b61f713bb32879e23e", "score": "0.5397468", "text": "name(){\"no name\";}", "title": "" }, { "docid": "54ce1fd54485b967d7eaea90776cb26a", "score": "0.5396727", "text": "function foo() {\n var bar = \"bar\";\n\n return function() {\n console.log(\"bar\");\n };\n}", "title": "" }, { "docid": "aa210409346c9ce3595bf20e2a46528a", "score": "0.53799975", "text": "function wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}", "title": "" }, { "docid": "aa210409346c9ce3595bf20e2a46528a", "score": "0.53799975", "text": "function wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}", "title": "" }, { "docid": "aa210409346c9ce3595bf20e2a46528a", "score": "0.53799975", "text": "function wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}", "title": "" }, { "docid": "aa210409346c9ce3595bf20e2a46528a", "score": "0.53799975", "text": "function wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}", "title": "" }, { "docid": "aa79d1f3bd7d0035ffb27b2259a3712b", "score": "0.5378854", "text": "function greetingMaker() {\n function closure(name) {\n return salutation + \", \" + name\n }\n}", "title": "" }, { "docid": "4aa52e3dfb818b6c393c09ecbb8024ee", "score": "0.53630364", "text": "function makeEmptyFunction(arg) {\n\treturn function() {\n\t\treturn arg\n\t}\n}", "title": "" }, { "docid": "655887b8f38f4914b35320fbf97f7f79", "score": "0.5359481", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "655887b8f38f4914b35320fbf97f7f79", "score": "0.5359481", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "655887b8f38f4914b35320fbf97f7f79", "score": "0.5359481", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "09e986a9c8ddfe355d3f02e365e352ad", "score": "0.5357936", "text": "function dummy(x) {}", "title": "" }, { "docid": "861f3b4847628e635a30c994037b4e28", "score": "0.535594", "text": "function makeEmptyFunction(arg) {\n\t return function() {\n\t return arg;\n\t };\n\t }", "title": "" }, { "docid": "7916ad073e8afb76673dca8137d63db4", "score": "0.5352306", "text": "function noop$x() {}", "title": "" }, { "docid": "850251eb8fbdc9dd2e55c23afc1861df", "score": "0.53520775", "text": "function makeEmptyFunction(arg) {\n\t return function () {\n\t return arg;\n\t };\n\t }", "title": "" }, { "docid": "8a34de679fdffcbdf1100f31e0af15c8", "score": "0.5339269", "text": "function makeEmptyFunction(arg) {\r\n\t return function() {\r\n\t return arg;\r\n\t };\r\n\t}", "title": "" }, { "docid": "1a4776325ab540aec94b87d6e13062e2", "score": "0.5332347", "text": "function example() {\n console.log(named); // => undefined\n\n named(); // => TypeError named is not a function\n\n var named = function named() {\n console.log('named');\n }\n}", "title": "" }, { "docid": "7edfaa8f39a5253deaa5aa06aa5941fc", "score": "0.5327251", "text": "function makeSafeName(name)\n{\n return name;\n}", "title": "" }, { "docid": "9b4ba5105766f41ae4fa1497fc5fe1ae", "score": "0.5324522", "text": "function nameFunction(name, body) {\n return {\n [name](...args) {\n return body(...args);\n }\n }[name];\n}", "title": "" }, { "docid": "d2ac4d1690e22017030560986305ba9d", "score": "0.5309532", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "d2ac4d1690e22017030560986305ba9d", "score": "0.5309532", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "d2ac4d1690e22017030560986305ba9d", "score": "0.5309532", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "472f9527679a5e59824abba0b5521178", "score": "0.5306274", "text": "function hello(){\n var myName = 'k2';\n this.myName = \"\";\n // console.log(myName)\n // this.fullName = new function(){\n // this.myName = \"Ravi\"\n // console.log(myName);\n // console.log(myName + this.myName)\n // }\n this.newName = (function(){\n this.myName = \"Ravi\"\n console.log(myName);\n console.log(myName + this.myName)\n })()\n }", "title": "" }, { "docid": "cd4c50857bdb05f531a45df64e80b173", "score": "0.5302617", "text": "function dummyFunc() {\n let dummyVar = 1;\n}", "title": "" }, { "docid": "87fd7be8c0dfbc781db3d12b93c73401", "score": "0.52999765", "text": "function makeEmptyFunction(arg) {\r\n\t\t return function () {\r\n\t\t return arg;\r\n\t\t };\r\n\t\t}", "title": "" }, { "docid": "2486940572e34a16af7c590b36f64da6", "score": "0.52991515", "text": "function makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n }", "title": "" }, { "docid": "df72339277c9ddbc447823b0bbc99948", "score": "0.5294739", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "df72339277c9ddbc447823b0bbc99948", "score": "0.5294739", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "title": "" }, { "docid": "17d55f6c098f367165902c0708f0dd60", "score": "0.52780503", "text": "function c(obj, mname) { return function (event) { obj[mname](event) } }", "title": "" }, { "docid": "a388b9e1e2c3799ace77a7c40f8fb7d6", "score": "0.52777845", "text": "function makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n }", "title": "" }, { "docid": "bfa19c62018c4cdaeb2651c00a2085df", "score": "0.52724636", "text": "function makeEmptyFunction(arg) {\n\t\t\t\treturn function() {\n\t\t\t\t\treturn arg;\n\t\t\t\t};\n\t\t\t}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" }, { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.52593124", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" } ]
dd596eaa2bac9686fce0007ee0d8a9a6
Iterate through all players in the instance of the game and call each individual's update function, which will send client data back to the user.
[ { "docid": "585b3fa94200501dc8dbabb840d583c6", "score": "0.8617225", "text": "onUpdate() {\n let game = this;\n for (let player in this.players) {\n this.getClientData(player).then(data => {\n if (game.players[player].update)\n game.players[player].update(data)\n }).catch(err => {\n logger.error(err);\n });\n }\n }", "title": "" } ]
[ { "docid": "dbfb47df343efcb48e98aa9a4431a9b9", "score": "0.858744", "text": "updatePlayers(){\n var players = this.getAllPlayers();\n for(var i = 0; i < players.length; i++){\n var player = players[i];\n player.update();\n }\n }", "title": "" }, { "docid": "74ff633c4b55e3ea6fe23b0a1855d0f5", "score": "0.758997", "text": "function update(){\n scoreboard.update();\n redTeam.forEach(player => player.update());\n blueTeam.forEach(player => player.update());\n\n}", "title": "" }, { "docid": "2f7aeee95e75bfadfbf25fc676a57592", "score": "0.7414787", "text": "function updateAllGameVisuals () {\n /* update all opponents */\n for (var i = 1; i < players.length; i++) {\n updateGameVisual (i);\n }\n}", "title": "" }, { "docid": "6101684180c433035548d025b3764d09", "score": "0.72761", "text": "CallUpdates()\n {\n this.Debug(\">START CallUpdates\");\n\n for(var i = 0; i < this.gameObjects.length; i++)\n {\n this.Debug(\"Updating: \" + this.gameObjects[i].object.type);\n \n this.gameObjects[i].object.UpdateGameObject();\n }\n \n for(var i = 0; i < this.scripts.length; i++)\n {\n this.scripts[i].Update();\n }\n\n for(var i = 0; i < this.interface.length; i++)\n {\n this.interface[i].UpdateGameObject();\n }\n\n this.level.Update();\n\n this.Debug(\">END CallIpdates\");\n }", "title": "" }, { "docid": "5e436f7ba68cd079baa6f61aea51a9a3", "score": "0.7232323", "text": "function updatePlayers(listOfPlayers) {\n allPlayers = listOfPlayers;\n}", "title": "" }, { "docid": "5e6ca9c3b30df846d3ef6138848b8009", "score": "0.7186913", "text": "update () {\n for (let objectName in this.gameObjects) {\n this.gameObjects[objectName].update();\n }\n }", "title": "" }, { "docid": "44a69ecccd3276dc8d1d94cd8c41229b", "score": "0.7174092", "text": "function serverUpdate(updates) { \n Object.keys(updates.positions).map(function(player) {\n var update = updates.positions[player]\n\n // local player\n if (player === self.playerID) {\n self.onServerUpdate(update)\n // other players\n } else {\n self.updatePlayerPosition(player, update)\n }\n })\n }", "title": "" }, { "docid": "aeb9cb828133f55b73bf22b974f57ff5", "score": "0.7037514", "text": "sendPlayerUpdates() {\n\t\t// console.log(\"Sending player updates\");\n\t\tlet update = this.stage.getUpdatedStageState();\n\n\t\tlet updatedState = JSON.stringify({\n\t\t\ttype: \"stage-update\",\n\t\t\tplayerActors: update.players,\n\t\t\tbulletActors: update.bullets,\n\t\t\tenvironmentActors: update.environment,\n\t\t\tnumAlive: update.numAlive,\n\t\t\thasEnded: update.hasEnded\n\t\t});\n\t\tthis.wss.broadcastToLobby(updatedState, this.gameId);\n\t}", "title": "" }, { "docid": "b54b3ae72cbb5350f5eac851b277b847", "score": "0.7025303", "text": "function update(){\n\t\tsetTimeout(function(){\n\t\t\taddPlayer();\n\t\t\tupdatePlayer();\n\t\t\tchecks();\n\t\t\t$('#roomPlayers').children('.player').each(function(){\n\t\t\t\tvar playerID = $(this).attr('player-id');\n\t\t\t\tcheckPlay(playerID);\n\t\t\t\tplayerChecks(playerID);\n\t\t\t});\n\t\tupdate();\n\t\t}, 1000);\n\t}", "title": "" }, { "docid": "64a9c5bac87264acbc34ec76e181d34c", "score": "0.70097363", "text": "update() {\n for (var i in Player.list) {\n this.takenByEnemy(Player.list[i]);\n }\n }", "title": "" }, { "docid": "fb723cca09fc6362d5ec1d7be3aca1ae", "score": "0.69726515", "text": "function update() {\n //Update gameObjects\n for (const goID in sp.gameObjects) {\n let obj = sp.gameObjects[goID];\n\n //Update the object\n obj.update();\n //Apply collisions and all things that might keep the player in the air\n obj.applyPlatformCollision(sp.platforms);\n //If the player shoud get gravity, apply it. Collisions can disable gravity for a frame\n if (obj.shouldGetGravity) {\n obj.applyGravity(sp.gravity);\n }\n }\n }", "title": "" }, { "docid": "c33d7b46fe5641256b73690e040ecc55", "score": "0.69713044", "text": "updateGame(){\n //Update state of objectives\n this.isObjectiveTaken();\n //Update if game is over \n this.isOver();\n\n //check whether game is over\n if(!this.gameOver){\n //updates all players data\n this.updatePlayers();\n }\n }", "title": "" }, { "docid": "81c3f8caf1233532c656a7491cd098f3", "score": "0.694353", "text": "onUpdate() {\r\n const server = this; //Set a reference to 'this' (the 'Server' class)\r\n\r\n //Update each lobby\r\n for (const id in server.lobbys) {\r\n server.lobbys[id].onUpdate(); //Run the update method for the lobby. The functionality of this can vary depending on the type of lobby.\r\n }\r\n }", "title": "" }, { "docid": "98b414bbcf8d588bf0987473ba57e5c3", "score": "0.6858914", "text": "function runUpdate(){\n people.forEach(function(element){\n element.update();\n });\n }", "title": "" }, { "docid": "af87d6bb494855e80bb0c5b89e68881a", "score": "0.6825628", "text": "function update() \r\n{\r\n\tball.update();\r\n\tplayer1.update();\r\n\tplayer2.update();\r\n}", "title": "" }, { "docid": "0500d4ff4c576c50d90a661de7f79bd2", "score": "0.6796532", "text": "update() {\r\n if(!this.player.alive && this.respawn) {\r\n this.reloadEngine = true;\r\n this.reloadController = true;\r\n this.respawn = false;\r\n this.alive = true\r\n this.player = new Player(100,100,32);\r\n this.entities.unshift(this.player);\r\n }\r\n\r\n // Update all walls\r\n for (let wall of this.walls) {\r\n wall.update();\r\n }\r\n\r\n\r\n // Update entities\r\n for (let i = 0; i<this.entities.length; i++) {\r\n let entity = this.entities[i];\r\n entity.update(this.entities);\r\n if(!entity.alive) {\r\n entity = null;\r\n this.entities.splice(i,1);\r\n }\r\n }\r\n\r\n // Update bullets\r\n for (let i = 0; i<this.bullets.length; i++) {\r\n let bullet = this.bullets[i];\r\n bullet.update(this.walls,this.bullets,this.entities);\r\n if(!bullet.alive) {\r\n bullet = null;\r\n this.bullets.splice(i,1);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ea6227dc33deebb28ddd80a8bcaa8050", "score": "0.6793386", "text": "allPlayers() {\n let client = this;\n this.socket.on('allplayers', function(data) {\n if (client.ID != null) {\n for (var i = 0; i < data.length; i++) {\n addNewPlayer(data[i].id, data[i].x, data[i].y);\n }\n client.move();\n }\n });\n }", "title": "" }, { "docid": "7e216e54023b5eec29fed411ae639065", "score": "0.67728657", "text": "function update() {\n player.update(gameInput.inputs);\n\n render();\n}", "title": "" }, { "docid": "92b81ff60c406e4f299e198fea6fe31c", "score": "0.6757774", "text": "function updateAllPlayers() {\n // // UPDATE SPECTATORS STATUS (IMPORTANT TO HAVE THIS AVOVE PLAYERS STATUS, ELSE IT WILL OVERRIDE)\n for (var i = 0; i < spectators.length; i++) {\n if (spectators[i].clientId === clientId) {\n spectators[i].bet = theClient.bet;\n theClient = spectators[i];\n }\n } // // UPDATE PLAYERS STATUS\n\n\n for (var _i16 = 0; _i16 < players.length; _i16++) {\n if (players[_i16].clientId === clientId) {\n players[_i16].bet = theClient.bet;\n theClient = players[_i16];\n } // Keep the values for game array in sync, so when a player joins mid game, everything will display correctly.\n // for(let g = 0; g < game.players.length; g++) {\n // game.players[g].cards = players[i].cards\n // }\n\n } // UPDATE STYLE ON TABLE\n\n\n for (var _i17 = 0; _i17 < playerSlotHTML.length; _i17++) {\n if (playerSlotHTML[_i17] === clientId) clientId = playerSlotHTML[_i17];\n\n for (var x = 0; x < players.length; x++) {\n if (players[x].clientId === playerSlotHTML[_i17]) {\n z = playerSlotHTML.indexOf(playerSlotHTML[_i17]);\n if (playerSlot[z].firstElementChild.nextElementSibling.classList.contains(\"empty-slot\")) playerSlot[z].firstElementChild.nextElementSibling.remove();\n playerSlot[z].firstElementChild.nextElementSibling.classList.remove(\"hide-element\");\n playerSlot[z].firstElementChild.nextElementSibling.nextElementSibling.nextElementSibling.classList.remove(\"hide-element\");\n playerSlot[z].firstElementChild.nextElementSibling.nextElementSibling.innerHTML = players[x].sum;\n\n if (players[x].sum > 21) {\n $(\".player-result:eq(\" + z + \")\").removeClass(\"hide-element\");\n $(\".player-result:eq(\" + z + \")\").addClass(\"result-lose\");\n $(\".player-result:eq(\" + z + \")\").text(\"BUST\");\n }\n }\n }\n } // Update Dealer Sum\n\n\n dealerSlot.firstElementChild.nextElementSibling.innerHTML = dealer.sum; // Update player\n\n player = players[currentPlayer]; // Keep user style balance in sync\n\n if (theClient.blackjack === false) $(\"#balance\").text(theClient.balance);\n} // Keep game.(property) in sync with the actual game, so when a new client joins mid game, all \"LOGIC\" will syn.", "title": "" }, { "docid": "42912f4777ea34b784cce9ba1b0bdacf", "score": "0.6743984", "text": "update() {\n let newPlayers = this.api.fetchPlayers();\n newPlayers.forEach(player => {\n var current_player = this.players.find(p => {\n return p.id == player.id;\n })\n if (current_player != null) {\n current_player.Update(player, this.viewport)\n } else {\n this.players.push(new Player(\n player.id,\n player.posX,\n player.posY,\n player.name,\n ))\n }\n });\n\n let self = this;\n let index = 0;\n this.players.forEach(player => {\n var current_player = newPlayers.find(p => {\n return p.id == player.id;\n })\n if (current_player == null) {\n $(\"#\"+player.id).remove();\n self.players.splice(index, 1);\n }\n index++;\n });\n }", "title": "" }, { "docid": "73adf875e781e12b0dcf28aa4b46279a", "score": "0.67177874", "text": "function tick () {\n // update all other player's data\n tickOtherPlayers();\n\n // update this clients player data\n OasisPlayer.tick();\n\n // update the game camera\n OasisCamera.tick();\n}", "title": "" }, { "docid": "131b4072ef774d208dddf9d46fca7446", "score": "0.66539156", "text": "mutate() {\n for (var i =1; i<this.pop_size; i++) {\n this.players[i].mutate();\n }\n }", "title": "" }, { "docid": "3b8a96bdd63aab9c210f47dbd1eec6df", "score": "0.6639862", "text": "function renderPlayers(){\n for( var key in shipPlayers){\n shipPlayers[key].renderShip();\n }\n }", "title": "" }, { "docid": "58c350a0ce4f961081bd3e1641dbfaec", "score": "0.65999126", "text": "function update() {\n player1.update();\n player2.update();\n ball.update();\n}", "title": "" }, { "docid": "be27e812b21d6f9fe5ba8673e8efbb9a", "score": "0.6595157", "text": "update() {\r\n this.moveEnemy();\r\n // player human collision\r\n for (let activePlayer of gGameEngine.players) {\r\n if (this.detectPlayerCollision({\r\n x: activePlayer.bmp.x,\r\n y: activePlayer.bmp.y\r\n })) {\r\n activePlayer.alive = false;\r\n activePlayer.animate('dead');\r\n }\r\n }\r\n // playerAI collision\r\n if (this.detectPlayerAICollision({\r\n x: gGameEngine.playerAI.bmp.x,\r\n y: gGameEngine.playerAI.bmp.y\r\n })) {\r\n gGameEngine.playerAI.alive = false;\r\n gGameEngine.playerAI.animate('dead');\r\n }\r\n }", "title": "" }, { "docid": "a43e065a29eaeb9ff69f3fb91895dfb9", "score": "0.65911984", "text": "function updatePoints() {\n for (var i = 0; i < players.length; i++) {\n getPoints(i);\n document.getElementById('points_' + i).innerHTML = players[i].Points;\n }\n}", "title": "" }, { "docid": "5cbe168207eab90dd5743e2545c1bce9", "score": "0.6585715", "text": "function update() {\n ball.update();\n player.update();\n ai.update();\n}", "title": "" }, { "docid": "8fde9cf085658a9a6f388e7181bf3b47", "score": "0.65783536", "text": "function update() { \n ball.update();\n player.update();\n ai.update();\n}", "title": "" }, { "docid": "ccd4441eede5819e27143c7cdcec206b", "score": "0.65716124", "text": "update(spacePressed, players) {\n if (!spacePressed) return;\n players.forEach((player) => {\n this.teleport(player, this.positions[0], this.positions[1])\n this.teleport(player, this.positions[1], this.positions[0])\n })\n this.resetPositions();\n\n }", "title": "" }, { "docid": "fd9a7ae3a59d59cf03b9c06edccc9cfc", "score": "0.65701026", "text": "function updateClients(elapsedTime) {\n for (let clientId in activeClients) {\n let client = activeClients[clientId];\n let update = {\n type: 'update-self',\n clientId: clientId,\n lastMessageId: client.lastMessageId,\n momentum: client.player.momentum,\n direction: client.player.direction,\n position: client.player.position,\n username: client.player.username,\n score: client.player.score,\n hyperspaceJump: client.player.reportHyperspaceJump,\n crashed: client.player.crashed,\n updateWindow: elapsedTime,\n };\n if (client.player.reportUpdate) {\n client.socket.emit('message', update);\n\n update.type = 'update-other';\n\n //\n // Notify all other connected clients about every\n // other connected client status...but only if they are updated.\n for (let otherId in activeClients) {\n if (otherId !== clientId) {\n activeClients[otherId].socket.emit('message', update);\n }\n }\n }\n if (client.player.crashed){ client.player.crashed = false; } //reset crashed after it was sent\n }\n\n for (let clientId in activeClients) {\n activeClients[clientId].player.reportUpdate = false;\n activeClients[clientId].player.reportHyperspaceJump = false;\n }\n lastUpdateTime = present();\n}", "title": "" }, { "docid": "94d60a9dc7a6fff945c731aef216ecce", "score": "0.6568778", "text": "_updatePlayerList (players) {\n // add all new players, including host, to playersData\n Object.keys(players).forEach(playerId => {\n if (!this.playersData[playerId]) {\n players[playerId].name = playerId;\n players[playerId].color = this.playerColorCodes.shift();\n\n let playerDetails = new Player(players[playerId]);\n this.playersData[playerId] = playerDetails;\n\n this.uiService.updatePlayerList(playerDetails);\n }\n });\n }", "title": "" }, { "docid": "15b314b89b7ca1908717bf94646c0e35", "score": "0.6556021", "text": "clientsUpdate() {\n for (var name in this.players) {\n this.getPlayerFromName(name).updateClientStateFromRoomState(this);\n }\n return true;\n }", "title": "" }, { "docid": "1bfc82b998a1f0d62b098c8c5dcd6935", "score": "0.6550545", "text": "function update() {\n if (localPlayer.update(keys)) {\n socket.emit('move player', {\n x: localPlayer.getX(),\n y: localPlayer.getY(),\n });\n }\n}", "title": "" }, { "docid": "4340f6e89dabe9b0503478d26833b6e1", "score": "0.65133137", "text": "update() {\n this.weapons.forEach(weapon => {\n weapon.update();\n });\n }", "title": "" }, { "docid": "acb7e3619b298eb6d54160b28aa250d4", "score": "0.64774585", "text": "function update() {\n\t/**\n\t * Flickers player when he's invincible\n\t */\n\tif (invincible && new Date().getTime() - gracePeriodFlickerTime > 250) {\n\t\tif (gracePeriodAlpha) {\n\t\t\tplayer.alpha = 0.1;\n\t\t\tgracePeriodAlpha = false;\n\t\t\tgracePeriodFlickerTime = new Date().getTime();\n\t\t} else {\n\t\t\tplayer.alpha = 1;\n\t\t\tgracePeriodAlpha = true;\n\t\t\tgracePeriodFlickerTime = new Date().getTime();\n\t\t}\n\t}\n\n\t/**\n\t * Moves all penguins\n\t */\n\tif (started) {\n\t\tpenguinsLEFT.forEach((el, i) => {\n\t\t\tel.body.velocity.x = boundingWidth * modus.penguinConfig.speed * -1;\n\t\t});\n\t\tpenguinsRIGHT.forEach((el, i) => {\n\t\t\tel.body.velocity.x = boundingWidth * modus.penguinConfig.speed;\n\t\t});\n\t}\n\n\t/**\n\t * Debug code which enables cursors for testing\n\t */\n\tif (!gyroscope && alive) {\n\t\t/**\n\t\t * When pressing left button\n\t\t */\n\t\tif (cursors.left.isDown && !cursors.right.isDown) {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = boundingWidth * -0.3;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('left' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: true,\n\t\t\t\t\tdirection: -1\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning || beforePlayerData.direction !== newPlayerData.direction) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t\t\tdirection: -1,\n\t\t\t\t\t\t\tstatus: 'movement',\n\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);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * When pressing right button\n\t\t\t */\n\t\t} else if (cursors.right.isDown) {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = boundingWidth * 0.3;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('right' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: true,\n\t\t\t\t\tdirection: 1\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning || beforePlayerData.direction !== newPlayerData.direction) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t\t\tdirection: 1,\n\t\t\t\t\t\t\tstatus: 'movement',\n\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);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// player.anims.play('right', true);\n\t\t} else {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = 0;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('turn' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: false,\n\t\t\t\t\tdirection: 0\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: false,\n\t\t\t\t\t\t\tdirection: 0,\n\t\t\t\t\t\t\tstatus: 'movement',\n\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);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// player.anims.play('turn');\n\t\t}\n\n\t\t/**\n\t\t * When player is not touching the floor\n\t\t */\n\t\tif (!player.body.touching.down) {\n\t\t\t//Disable crop for normal state\n\t\t\tplayer.isCropped = false;\n\t\t\tplayer.height = 359;\n\n\t\t\t//Play correct animation\n\t\t\tif (player.body.velocity.x === 0) {\n\t\t\t\tplayer.anims.play('turnJump' + avatars.indexOf(avatar));\n\t\t\t} else {\n\t\t\t\tif (player.body.velocity.x > 0) player.anims.play('rightJump' + avatars.indexOf(avatar));\n\t\t\t\tif (player.body.velocity.x < 0) player.anims.play('leftJump' + avatars.indexOf(avatar));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * When the up button is being pressed -> jump\n\t\t */\n\t\tif (cursors.up.isDown && player.body.touching.down) {\n\t\t\t//Set velocity\n\t\t\tplayer.body.velocity.y = (boundingHeight / 2) * 1.5 * -1;\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisJumping: true\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isJumping !== newPlayerData.isJumping) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisJumping: true,\n\t\t\t\t\t\t\tstatus: 'movement',\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);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/**\n\t\t * When player is not touching the floor\n\t\t */\n\t\tif (!player.body.touching.down) {\n\t\t\t//Disable crop for normal state\n\t\t\tplayer.isCropped = false;\n\t\t\tplayer.height = 359;\n\n\t\t\t//Play correct animation\n\t\t\tif (player.body.velocity.x === 0) {\n\t\t\t\tplayer.anims.play('turnJump' + avatars.indexOf(avatar));\n\t\t\t} else {\n\t\t\t\tif (player.body.velocity.x > 0) player.anims.play('rightJump' + avatars.indexOf(avatar));\n\t\t\t\tif (player.body.velocity.x < 0) player.anims.play('leftJump' + avatars.indexOf(avatar));\n\t\t\t}\n\t\t} else {\n\t\t\t//Player is touching the floor -> send update if multiplayer\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisJumping: false\n\t\t\t\t};\n\t\t\t\t//Check if not duplicate\n\t\t\t\tif (beforePlayerData.isJumping !== newPlayerData.isJumping) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisJumping: false,\n\t\t\t\t\t\t\tstatus: 'movement',\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);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If client is host and game has started -> spawn new objects\n\t */\n\tif ((host || !multiplayer) && started) {\n\t\t/**\n\t\t * Randomize when an object is being spawned\n\t\t */\n\t\tlet random = Math.random() * (modus.maxSpawnTime - modus.minSpawnTime) + modus.minSpawnTime;\n\t\tif (new Date().getTime() - lastTimeSpawn > random) {\n\t\t\t/**\n\t\t\t * 80% chance for icicle\n\t\t\t * 20% chance for penguin\n\t\t\t */\n\t\t\tlet spawnChance = Math.random();\n\t\t\tif (spawnChance <= modus.icicleChance) {\n\t\t\t\t/**\n\t\t\t\t * Spawn icicle\n\t\t\t\t */\n\n\t\t\t\t//Randomize spawn location\n\t\t\t\tlet x =\n\t\t\t\t\tMath.random() *\n\t\t\t\t\t\t(((width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85) * modus.icicleConfig.maxSpawnOffset - ((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset) +\n\t\t\t\t\t((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset;\n\n\t\t\t\t//Add sprite to the canvas\n\t\t\t\tice = this.physics.add.sprite(x, -1 * (boundingHeight * 0.4), 'icicle');\n\t\t\t\tice.scaleY = ice.scaleX = boundingWidth / 6000;\n\n\t\t\t\t//Set custom gravity (Icicle speed)\n\t\t\t\tice.setGravityY(gravity * modus.icicleConfig.gravity);\n\n\t\t\t\t//Icicle should always be on top of player\n\t\t\t\tice.setDepth(1000);\n\t\t\t\tice.setOrigin(0.5, 0);\n\n\t\t\t\t//Add the Icicle to the enemies list\n\t\t\t\tenemies.push(ice);\n\n\t\t\t\t//If alive addScore\n\t\t\t\tif (alive) addScore();\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, -1 * (boundingHeight * 0.4));\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newEnemy',\n\t\t\t\t\t\t\ttype: 'icicle',\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (spawnChance <= modus.penguinChance + modus.icicleChance) {\n\t\t\t\t/**\n\t\t\t\t * Spawn penguin\n\t\t\t\t */\n\t\t\t\tlet x;\n\t\t\t\tlet list;\n\t\t\t\tlet flip = true;\n\n\t\t\t\t//Randomize left/right\n\t\t\t\tif (Math.random() <= 0.5) {\n\t\t\t\t\tx = (width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85;\n\t\t\t\t\tlist = penguinsLEFT;\n\t\t\t\t\tflip = false;\n\t\t\t\t} else {\n\t\t\t\t\tx = (width - boundingWidth * 0.85) / 2;\n\t\t\t\t\tlist = penguinsRIGHT;\n\t\t\t\t}\n\n\t\t\t\t//Add penguin to the canvas\n\t\t\t\tlet penguin = this.physics.add.sprite(x, height - height * 0.2, 'penguin');\n\n\t\t\t\t//Scaling\n\t\t\t\tpenguin.scaleY = penguin.scaleX = boundingWidth / 16500;\n\n\t\t\t\t//Penguin should be flipped when going to the left\n\t\t\t\tpenguin.flipX = flip;\n\t\t\t\tpenguin.setOrigin(0.5, 0);\n\n\t\t\t\t//Set gravity\n\t\t\t\tpenguin.setGravityY(gravity);\n\n\t\t\t\tpenguin.setDepth(1000);\n\n\t\t\t\tpenguin.body.bounce.x = 0.5;\n\t\t\t\tpenguin.body.bounce.y = 0.5;\n\n\t\t\t\t//Penguins should be able to stand on the platform not fall through it\n\t\t\t\tthis.physics.add.collider(penguin, platforms);\n\n\t\t\t\t//Add penguin to enemy list\n\t\t\t\tenemies.push(penguin);\n\n\t\t\t\t//Add penguin to the list if it should go right or left\n\t\t\t\tlist.push(penguin);\n\n\t\t\t\t//Add score if still alive\n\t\t\t\tif (alive) addScore();\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, height - height * 0.2);\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newEnemy',\n\t\t\t\t\t\t\ttype: 'penguin',\n\t\t\t\t\t\t\tflip: flip,\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Spawn healthPowerup\n\t\t\t\t */\n\n\t\t\t\t//Randomize spawn location\n\t\t\t\tlet x =\n\t\t\t\t\tMath.random() *\n\t\t\t\t\t\t(((width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85) * modus.icicleConfig.maxSpawnOffset - ((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset) +\n\t\t\t\t\t((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset;\n\n\t\t\t\t//Add sprite to the canvas\n\t\t\t\tlet health = this.physics.add.sprite(x, -1 * (boundingHeight * 0.4), 'heart');\n\t\t\t\thealth.scaleY = health.scaleX = boundingWidth / 22000;\n\n\t\t\t\t//Set gravity\n\t\t\t\thealth.setGravityY(gravity);\n\n\t\t\t\t//HealthPowerup should always be on top of player\n\t\t\t\thealth.setDepth(1000);\n\t\t\t\thealth.setOrigin(0.5, 0);\n\t\t\t\thealth.name = ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));\n\n\t\t\t\t//HealthPowerup should stand on the platform, not fall through\n\t\t\t\tthis.physics.add.collider(health, platforms);\n\n\t\t\t\t//Add the HealthPowerup to the powerup list\n\t\t\t\thealthPowerups.push(health);\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, -1 * (boundingHeight * 0.4));\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newPowerup',\n\t\t\t\t\t\t\ttype: 'health',\n\t\t\t\t\t\t\tid: health.name,\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Update when an enemy has spawned\n\t\t\tlastTimeSpawn = new Date().getTime();\n\t\t}\n\t}\n\n\t/**\n\t * When multiplayer -> update player position\n\t */\n\tif (multiplayer && otherPlayerData.alive && otherPlayer !== undefined) {\n\t\t/**\n\t\t * If running to the left\n\t\t */\n\t\tif (otherPlayerData.isRunning && otherPlayerData.direction == -1) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = boundingWidth * -0.3;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('left' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If running to the right\n\t\t\t */\n\t\t} else if (otherPlayerData.isRunning && otherPlayerData.direction == 1) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = boundingWidth * 0.3;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('right' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If standing still\n\t\t\t */\n\t\t} else {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = 0;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('turn' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * If other player is jumping\n\t\t */\n\t\tif (!otherPlayer.body.touching.down) {\n\t\t\t//Play animation\n\t\t\tif (otherPlayer.body.velocity.x === 0) otherPlayer.anims.play('turnJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayer.body.velocity.x > 0) otherPlayer.anims.play('rightJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayer.body.velocity.x < 0) otherPlayer.anims.play('leftJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.isCropped = false;\n\t\t\t\totherPlayer.height = 359;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * If the other player is about to jump\n\t\t */\n\t\tif (otherPlayerData.isJumping && otherPlayer.body.touching.down) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.y = (boundingHeight / 2) * 1.5 * -1;\n\n\t\t\t//Set jumping to false so the player won't jump twice\n\t\t\totherPlayerData.isJumping = false;\n\t\t}\n\t}\n\n\t/**\n\t * If player fell of the platform -> hit\n\t */\n\tif (player.body.y > height) {\n\t\thit();\n\t}\n\n\t/**\n\t * Update highscore missions\n\t */\n\n\tif (leaderboard !== undefined) {\n\t\tif (leaderboard.length !== 0) {\n\t\t\tlet lowestScoreToBeat;\n\t\t\tlet position = 1;\n\t\t\tleaderboard.forEach((el, i) => {\n\t\t\t\tif ((el.score < lowestScoreToBeat && el.score > score) || lowestScoreToBeat === undefined) {\n\t\t\t\t\tlowestScoreToBeat = el.score;\n\t\t\t\t\tposition = i + 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\thighscorePositionObject.innerHTML = `${position}e`;\n\t\t\thighscoreScoreObject.innerHTML = lowestScoreToBeat;\n\t\t} else {\n\t\t\thighscorePositionObject.innerHTML = `1e`;\n\t\t\thighscoreScoreObject.innerHTML = 0;\n\t\t}\n\t} else {\n\t\thighscorePositionObject.innerHTML = `1e`;\n\t\thighscoreScoreObject.innerHTML = 0;\n\t}\n}", "title": "" }, { "docid": "02d83de65b2ef174d48d85f30b48e846", "score": "0.64710873", "text": "togglePlayerTimers() {\n this.players.forEach(p => p.updateTimer());\n }", "title": "" }, { "docid": "68aa01c67686ffdf8ac7ed23e85ce039", "score": "0.64686966", "text": "updatePlayersData() {\n\n this.playersData = [];// Reinicia el array\n\n GameElements.players.forEach(player => {\n if (!player.isDead) {\n if (player.isStunt) {\n player.stunningTime--;\n if (player.stunningTime == 0) {\n player.isStunt = false;\n }\n }\n //Si el juegador no esta mareado puede ...\n else {\n if (player.canKickBomb) {\n player.kickBomb();\n }\n player.updatePosition(player.speed);\n player.pickItem();\n }\n }\n //Si el jugador esta muerto, se hace la animacion de la muerte\n else {\n if (player.deathAnimationTime > 0) {\n player.deathAnimation();\n player.deathAnimationTime--;\n }\n\n }\n //Se agrega al array la informacion de cada jugador \n let playerData = this.getUpdatedPlayerData(player);\n this.playersData.push(playerData);\n });\n }", "title": "" }, { "docid": "93777090e81b3def67480c951f3d2e95", "score": "0.64516634", "text": "update()\n {\n let entitiesCount = this.entities.length;\n\n for (let i = 0; i < entitiesCount; i++)\n {\n let entity = this.entities[i];\n\n entity.update();\n }\n }", "title": "" }, { "docid": "4e2d5ee7ca41119efbdaf9be3050f181", "score": "0.6450326", "text": "_update() {\n this._tick++;\n\n // Move every snake in the shard\n _.forEach(this._players, (player) => {\n if (player.isAlive) {\n this._move(player);\n }\n });\n\n // Regenerate food that was eaten or blocked\n var diff = this.foodLimit - this.foodCount;\n var blockers = internals.createBlockersGrid(this._grid.width, this._grid.height, this._players);\n for (var i = 0; i < diff; i++) {\n internals.createFood(this._grid, this._grid.merge(blockers));\n }\n\n // Update the grid of every player\n _.forEach(this._players, (player) => {\n this._updatePlayer(player, false);\n });\n }", "title": "" }, { "docid": "fbb43cf25303e0c4bdea2a2dd677b4cd", "score": "0.6437072", "text": "function update() {\n // Only send position when it's updated\n var playerUpdate = JSON.stringify(Global.player.properties());\n if (playerUpdate !== lastPlayerUpdate) {\n lastPlayerUpdate = playerUpdate;\n socket.emit('update player', Global.player.properties());\n }\n }", "title": "" }, { "docid": "0c87d070f0af399de61ca746b1847aa1", "score": "0.6437063", "text": "update() {\n\n //--if its not running or pause, skip game loop--//\n if (!this._running || Game.isPause) return;\n\n //--run ball update--//\n this._ball.update();\n\n //--loop through players, run their update function and check for collision with ball--//\n for (let i = 0; i < this._players.length; i++) {\n this._players[i].update();\n //-player ball collision--//\n if (Game.collideOBB(this._players[i]._view, this._ball._view)) {\n this._ball.dx = -this._ball.dx;\n }\n //--player top and bottom collision--//\n if (this._players[i].y - this._players[i].hei * 0.5 < -Game.view.height * 0.5) {\n this._players[i].y = -Game.view.height * 0.5 + this._players[i].hei * 0.5;\n }\n else if (this._players[i].y + this._players[i].hei * 0.5 > Game.view.height * 0.5) {\n this._players[i].y = Game.view.height * 0.5 - this._players[i].hei * 0.5;\n }\n }\n\n //--\"A.I.\" logic--//\n if (this._ball.y > this._opponent.y) this._opponent.dy = this._opponent.moveSpeed;\n else if (this._ball.y < this._opponent.y) this._opponent.dy = -this._opponent.moveSpeed;\n }", "title": "" }, { "docid": "f70fb4c26557b48104f5bdcbb8ae652f", "score": "0.6433257", "text": "function drawAllPlayers(playerList){\n myCanvas.drawBoard();\n for (let i = 0; i<playerList.length; i++){playerList[i].drawPlayer()};\n}", "title": "" }, { "docid": "f7cce3796a8add6b9a84840e460b339d", "score": "0.6429098", "text": "function update(){\n//stuff to update\nbearer.update();\nshield.update();\n\n// update Backscatter Buster Shots\nfor(var index = 0; index < playerPro.length; index++){\n playerPro[index].update();\n\n // splice to remove projectile if dead\n if(playerPro[index].dead){\n playerPro.splice(index,1);\n }\n}\n\n// update enemies\nfor(var index = 0; index < enemies.length; index++){\n enemies[index].update();\n\n // splice to remove enemy if dead\n if(enemies[index].dead){\n enemies.splice(index,1);\n }\n}\n\n// update enemy projectiles\nfor (var index = 0; index < enemyPro.length; index++){\n enemyPro[index].update();\n\n // splice to remove projectile if dead\n if(enemyPro[index].dead){\n enemyPro.splice(index,1);\n }\n}\n}", "title": "" }, { "docid": "2b6c87007fd604be7874ecdc4ca51738", "score": "0.64242065", "text": "function update() {\n\t\t\t\tplayer.update();\n\t\t\t\tcomputer.update(ball);\n\t\t\t\tball.update(player.paddle, computer.paddle);\n\t\t\t\tdocument.getElementById(\"pongScore\").innerHTML = \"Score = \" + score;\n\t\t\t}", "title": "" }, { "docid": "3836ea1109fe41a00e2639697129b26a", "score": "0.6424182", "text": "play(){\r\n form.hide()\r\n\r\n Player.getPlayerInfo()\r\n \r\n if(allPlayers !== undefined){\r\n var index = 0\r\n var x = 0\r\n var y\r\n\r\n for(var p in allPlayers){\r\n\r\n console.log(\"hello\")\r\n\r\n index = index + 1\r\n x = x + 200\r\n y = displayHeight - allPlayers[p].distance\r\n\r\n cars[index - 1].x = x\r\n cars[index - 1].y = y\r\n }\r\n }\r\n\r\n if(keyDown(UP_ARROW) && player.index !== null){\r\n player.distance = player.distance + 50\r\n player.update()\r\n }\r\n\r\n drawSprites()\r\n }", "title": "" }, { "docid": "450435cbbd56b20b574ded4b517c1938", "score": "0.64194214", "text": "function updateAll() {\r\n //Update each position by substituting its object in updateObj() method\r\n updateObj( star );\r\n updateObj( bullet );\r\n updateObj( enemyBullet );\r\n updateObj( enemy );\r\n updateObj( explosion );\r\n if ( !gameOver ) {\r\n jiki.update();//Update the sprite position\r\n }\r\n}", "title": "" }, { "docid": "4a63cb61d57a6669dc4f7e17f632a364", "score": "0.64169836", "text": "update(delta){\n\n if(level == 1 || level == 2 || level == 3 && !gameOver && !win){ //conditions for the levels\n ost.play(); //play the song only in game\n //for loop to loop through the array of objects \n for(let i = 0; i < this.objects.length; ++i){\n\n //Calling the general update function incase no specific object has been called\n this.objects[i].update(delta, goblin, dragon, powerUp, boss, bossBullet);\n\n }\n }\n \n \n }", "title": "" }, { "docid": "ae70c7f7af13d8cf2cc2e50749630d73", "score": "0.63992184", "text": "sendPos()\n {\n for(const playerId in this.players)\n {\n const data = []\n const player = this.players[playerId]\n data.push({\n name: player.name,\n color: player.color,\n position: player.engineObject.position,\n musicInfo: player.musicInfo\n })\n for(const nearPlayer of player.getNearPlayers(300))\n {\n data.push({\n id: nearPlayer.id,\n name: nearPlayer.name,\n color: nearPlayer.color,\n position: nearPlayer.engineObject.position,\n musicInfo: nearPlayer.musicInfo,\n energy: nearPlayer.energy\n })\n }\n player.socket.emit('updatePlayer', data)\n }\n }", "title": "" }, { "docid": "579a31dbcc31183b604e48144c32a3a0", "score": "0.6396795", "text": "aiUpdate(){\n ai.updateCurrentTargetList(player);\n }", "title": "" }, { "docid": "6c320bbf8fffd3db78697178d377c86b", "score": "0.6385124", "text": "function updateAllClocks() {\n\n // Loop through clocks\n var clockCount = clocks.length;\n for (var i = 0; i < clockCount; i++) {\n\n // Update clock\n clocks[i].update();\n }\n}", "title": "" }, { "docid": "887c990a28f7f0a351762bab70d741b3", "score": "0.6378874", "text": "function sendLobbyPlayerlistUpdate() {\n if (!g_IsController || !Engine.HasXmppClient()) return;\n\n // Extract the relevant player data and minimize packet load\n let minPlayerData = [];\n for (let playerID in g_GameAttributes.settings.PlayerData) {\n if (+playerID == 0) continue;\n\n let pData = g_GameAttributes.settings.PlayerData[playerID];\n\n let minPData = { Name: pData.Name, Civ: pData.Civ };\n\n if (g_GameAttributes.settings.LockTeams) minPData.Team = pData.Team;\n\n if (pData.AI) {\n minPData.AI = pData.AI;\n minPData.AIDiff = pData.AIDiff;\n minPData.AIBehavior = pData.AIBehavior;\n }\n\n if (g_Players[playerID].offline) minPData.Offline = true;\n\n // Whether the player has won or was defeated\n let state = g_Players[playerID].state;\n if (state != \"active\") minPData.State = state;\n\n minPlayerData.push(minPData);\n }\n\n // Add observers\n let connectedPlayers = 0;\n for (let guid in g_PlayerAssignments) {\n let pData =\n g_GameAttributes.settings.PlayerData[g_PlayerAssignments[guid].player];\n\n if (pData) ++connectedPlayers;\n else\n minPlayerData.push({\n Name: g_PlayerAssignments[guid].name,\n Team: \"observer\"\n });\n }\n\n Engine.SendChangeStateGame(\n connectedPlayers,\n playerDataToStringifiedTeamList(minPlayerData)\n );\n}", "title": "" }, { "docid": "c03e3011e6049a449c8c96b88d9c07d9", "score": "0.6372631", "text": "function updateAll() {\n paddle.handleMoveAction()\n ball.move()\n drawer.draw()\n}", "title": "" }, { "docid": "9760ba85a43fd21f2c3a3722254c1080", "score": "0.6365691", "text": "function updateGamePhysics(){\n for (let playerKey in players){\n players[playerKey].update();\n }\n for (let aMissileKey in missiles){\n missiles[aMissileKey].update();\n }\n\n}", "title": "" }, { "docid": "8fe3ac24ab1907f4967cf8a2021fa2ac", "score": "0.63483167", "text": "function update() {\n for (modInd--;modInd>=0;modInd--) {\n updateAction(modPart[modInd][0], modPart[modInd][1]);\n }\n modInd = 0;\n if (showPlayer)\n try { updatePlayer(); } catch (e) { }\n draw();\n setTimeout(update, gameSpeed);\n }", "title": "" }, { "docid": "4e5fbec235878035f6bcd5070c308b1d", "score": "0.63464004", "text": "function drawPlayer () {\n\n for (var i = 0; i < playerList.length; i++) { playerList[i].draw(); }\n}", "title": "" }, { "docid": "67791d8d57be8d1512c4f2eac8051537", "score": "0.6339526", "text": "update(game, view) {\n var gamePids, i, len, newPlayer, player, ref, ref1, ref2, sid, updatedPlayerList, viewPids, viewPlayer;\n // Process player disconnects\n viewPids = {};\n gamePids = {};\n ref = view.players;\n for (sid in ref) {\n viewPlayer = ref[sid];\n viewPids[viewPlayer.pid] = true;\n }\n updatedPlayerList = [];\n ref1 = game.players;\n for (i = 0, len = ref1.length; i < len; i++) {\n player = ref1[i];\n if (!viewPids[player.pid]) {\n console.log(`Nono[${game.owner}] Player ${player.pid} (${player.name}) left.`);\n continue;\n }\n updatedPlayerList.push(player);\n gamePids[player.pid] = true;\n }\n game.players = updatedPlayerList;\n ref2 = view.players;\n // Process player connects\n for (sid in ref2) {\n viewPlayer = ref2[sid];\n if (!gamePids[viewPlayer.pid]) {\n newPlayer = {\n pid: viewPlayer.pid,\n owner: false\n };\n if (viewPlayer.tag != null) {\n newPlayer.name = viewPlayer.tag;\n if (game.owner === viewPlayer.tag) {\n newPlayer.owner = true; // They can do anything they want!\n }\n } else {\n newPlayer.name = \"Anonymous\";\n }\n game.players.push(newPlayer);\n console.log(`Nono[${game.owner}] Player ${newPlayer.pid} ${newPlayer.name} joined.`);\n }\n }\n return game.players.sort(function(a, b) {\n return a.pid - b.pid;\n });\n }", "title": "" }, { "docid": "a4db108f025ce728e260089461075371", "score": "0.6336478", "text": "update() {\n this.moveShip(this.ship1, 1);\n this.moveShip(this.ship2, 2);\n this.moveShip(this.ship3, 3);\n\n this.background.tilePositionY -= 0.5; //decrease position of the texture of the background\n this.movePlayerManager(); //calls a function to control the player's ship\n\n //if the user presses the spacebar, something will occur\n //in this case, \"Fire\" will show up in the console (NOT on screen)\n if (Phaser.Input.Keyboard.JustDown(this.spacebar)) {\n if (this.player.active) {\n this.shootBeam(); //call the function\n }\n }\n\n //iterate through each element of the projectile group\n //this will run through the update of each beam\n for (var i=0; i < this.projectiles.getChildren().length; i++) {\n var beam = this.projectiles.getChildren()[i];\n beam.update();\n }\n }", "title": "" }, { "docid": "bd28f90a0681eb08b605f8e4a5cedb70", "score": "0.6326628", "text": "function update() {\n playerMove();\n cooldowns.call(this);\n moveEnemies();\n // this.cameras.main.centerOn(player.x, player.y);\n}", "title": "" }, { "docid": "7a1fc2f3a6735058a489c0589ea4b8c2", "score": "0.6310348", "text": "updatePlayersList(players) {\n if (players.length > 0) {\n const updatedPlayersList = [];\n players.forEach(player => {\n updatedPlayersList.push(player);\n });\n this.PLAYERS_LIST = updatedPlayersList;\n } else {\n this.PLAYERS_LIST = null;\n }\n }", "title": "" }, { "docid": "405fe6a58ad87869af079535dcbc6ca2", "score": "0.6309681", "text": "update() {\n\n \n this.movePlayerManager();\n\n\n \n\n }", "title": "" }, { "docid": "4618c18b5f9bb6f540f41aad5d8c7866", "score": "0.6305852", "text": "function updatePing(players) {\n\tjQuery.each(players, function (i, val) {\n\t\t$('#playerlist tr:not(.heading)').each(function () {\n\t\t\t$(this).find('td:nth-child(2):contains(' + val.id + ')').each(function () {\n\t\t\t\t$(this).parent().find('td').eq(2).html(val.ping);\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "a6facd23315c8a0a56163edf92a5876c", "score": "0.6289754", "text": "static update()\n {\n // Update game timer if there's a current game\n if (RPM.game)\n {\n RPM.game.playTime.update();\n }\n\n // Update songs manager\n RPM.songsManager.update();\n\n // Repeat keypress as long as not blocking\n let continuePressed;\n for (let i = 0, l = RPM.keysPressed.length; i < l; i++)\n {\n continuePressed = RPM.onKeyPressedRepeat(RPM.keysPressed[i]);\n if (!continuePressed)\n {\n break;\n }\n }\n\n // Update the top of the stack\n RPM.gameStack.update();\n }", "title": "" }, { "docid": "2cdf85a8c5e4b89ff6ca2b3e59e59915", "score": "0.6285945", "text": "function pingClients() {\n\tvar length = players.length;\n\tfor(var i = 0; i < length; i++) {\n\t\tif (players[i].id) {\n\t\t\tpings[players[i].id] = { time: Date.now(), ping: 0 };\n\t\t\t//console.log('Ping? '+ players[i].id); //log filler\n\t\t\tgame.sockets[players[i].id].emit('ping');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b2ae6c6bab0776e834a8712cbda7194a", "score": "0.6285299", "text": "function update() {\n updaters.forEach(function (f) { f(); });\n }", "title": "" }, { "docid": "8942e3c5016ede87e57eb1122a05d676", "score": "0.6273842", "text": "function tick() {\n tick.count = tick.count || 0; //using count as a static variable, it should only be set to 0 if it hasn't been set before\n tick.count++;\n for (var i = playerStack.length - 1; i >= 0; i--) {\n game_1.updatePlayer(playerStack[i]); // Update everything to with each player\n }\n // Only send updates to the clients every 5 server ticks\n if (tick.count === 5) {\n tick.count = 0;\n io.emit('Update Players', playerStack);\n }\n}", "title": "" }, { "docid": "8341e605eecf1ea39ac4faf3d131b247", "score": "0.62716776", "text": "function update() {\n updatePaddle();\n updatePuck();\n checkPaddle();\n checkBricks();\n }", "title": "" }, { "docid": "b837d520717aa689b0d33621b1b7d802", "score": "0.62702245", "text": "function update(){\r\n // Call the \"Update Critter\" function\r\n critter.update();\r\n // Call the \"Update Foreground\" Function\r\n foreground.update();\r\n // Call the \"Update Woods\" Function\r\n woods.update();\r\n}", "title": "" }, { "docid": "72904a82435fb727d33be151ccf66def", "score": "0.626689", "text": "function update() {\n // Call the custom update function if it is defined\n if (_this.customUpdate) {\n _this.customUpdate(_this.FPS, _this.canvas);\n }\n // Update all of the GameObjects and handle GameObject deletion\n Object.keys(_this.gameObjects).forEach(function (type) {\n _this.gameObjects[type].forEach(function (obj) {\n obj.update(_this.FPS);\n handleDelete(obj, type);\n });\n });\n }", "title": "" }, { "docid": "ae645229ce2836963a9ed7e5230267ea", "score": "0.62567014", "text": "updateState(update) {\n\t\t// console.log(\"Fetching player updates\");\n\n\t\t// Get the ID of the player who triggered this update\n\t\tlet pid = update.pid;\n\t\tlet player = this.stage.getPlayer(pid);\n\n\t\t// Only clients with a player that is still alive can make updates\n\t\tif (player) {\n\t\t\tif (update.type == \"move\") {\n\t\t\t\tplayer.setMovementDirection(update.x, update.y);\n\t\t\t} else if (update.type == \"cursor\") {\n\t\t\t\tplayer.setCursorDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"click\") {\n\t\t\t\tplayer.setFiringDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"weapon-toggle\") {\n\t\t\t\tplayer.setWeapon(update.toggle);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "986e22145f0a36c4e4b0f013d1d4acfe", "score": "0.6245162", "text": "function updateSkins() {\r\n\tvar skins = players.map(player => {\r\n\t\treturn {\r\n\t\t\tskin: player.skin,\r\n\t\t\tid: player.id\r\n\t\t}\r\n\t});\r\n\tsendToAll('game_event', {\r\n\t\ttype: 'skin_update',\r\n\t\tskins: skins\r\n\t});\r\n}", "title": "" }, { "docid": "f6ed5c0c58c9f1f491e3b4b31dd53449", "score": "0.62439615", "text": "function update()\n{\n\t// Ensure looping behaviour.\n\trequestAnimationFrame(update);\n\n\t// Whatever we want to happen in the loop.\n\tif(isplaying)\n\t{\n\t\t// Update the player\n\t\tP_Controller.Update();\n\t\t// Make the camera follow the player\n\t\tFollowPosition(P_Controller.gameobject.position, cameraOffset, camera);\n\t\tcamera.position.x = 0;\n\t\t// Make the floor follow the player\n\t\tFollowPosition(P_Controller.gameobject.position, floorOffset, plane);\n\t\tplane.position.x = 0;\n\t\t\n\n\t\t// Handle the obstacles\n\t\tfor(var i = 0; i < numberOfObstacles; i++)\n\t\t{\n\t\t\tobstacleArray[i].update(P_Controller.currentLane, player.position.z);\n\t\t}\n\t}else\n\t{\n\n\t}\n\t\t\n\t// Re-render the scene.\n\trenderer.render(scene,camera);\n}", "title": "" }, { "docid": "477cf10820d213e9939f9a8515c2d5b4", "score": "0.6240332", "text": "function sendCanvasUpdate() {\n for (user in users) {\n sendTo(users[user], {\n type: \"canvasUpdate\",\n avatars: room.avatars,\n name: \"SERVER\"\n });\n }\n}", "title": "" }, { "docid": "e408be6010935a71534c2a0e519ec252", "score": "0.6234055", "text": "function update() {\n for(var i=0;i<bullet_array.length;i++) {\n var bullet = bullet_array[i];\n bullet.x += bullet.speed_x;\n bullet.y += bullet.speed_y;\n\n // Check if this bullet is close enough to hit any player\n for(var id in players) {\n if(bullet.owner_id != id) {\n // And your own bullet shouldn't kill you\n var dx = players[id].x - bullet.x;\n var dy = players[id].y - bullet.y;\n var dist = Math.sqrt(dx * dx + dy * dy);\n\n if(dist < 70) {\n // x: Math.floor(Math.random() * 700) + 50,\n // y: Math.floor(Math.random() * 500) + 50,\n // io.emit('disconnect',id);\n io.emit('player-hit',id); // Tell everyone this player got hit\n players[id].x = Math.floor(Math.random() * config.phaser.width);\n players[id].y = Math.floor(Math.random() * config.phaser.height);\n io.emit('update_players_shot', players,bullet.owner_id,id);\n\n // io.broadcast.emit('playerMoved', players[id]);\n io.emit('playerMoved', players[id]);\n // io.emit('currentPlayers', players);\n\n // socket.emit('currentPlayers', players);\n // io.broadcast.emit('newPlayer', players[socket.id]);\n updateKD(players[bullet.owner_id].username, players[id].username,bullet.owner_id,id);\n }\n }\n }\n // Remove if it goes too far off screen\n if(bullet.x < -10 || bullet.x > 1000 || bullet.y < -10 || bullet.y > 1000) {\n bullet_array.splice(i,1);\n i--;\n }\n }\n // Tell everyone where all the bullets are by sending the whole array\n io.emit(\"bullets-update\",bullet_array);\n}", "title": "" }, { "docid": "d7d8f449f494fa9284d083a0192b0905", "score": "0.62285924", "text": "function updateWorld() {\n\n // update player data\n\n TemplateService.inject( Templates.STATS_DISPLAY, container, {\n money: Player.money,\n radius: Player.radius\n });\n\n // retrieve all venues\n\n police = [], banks = [], gas = [];\n\n // a bit of a Promise pyramid which could benefit from async - await !\n\n FourSquareService.API.venues( Locations.POLICE )\n .then(( policeData ) => {\n police = policeData.venues;\n\n FourSquareService.API.venues( Locations.BANK, Categories.BANK )\n .then(( bankData ) => {\n banks = bankData.venues;\n\n FourSquareService.API.venues( Locations.GAS )\n .then(( gasData ) => {\n\n gas = gasData.venues;\n\n // flush existing markers and render the new list\n // not entirely low on overhead with regards to reusable\n // resource, but we're in a rush ;)\n\n PubSub.publishSync( Actions.FLUSH_MARKERS );\n PubSub.publishSync( Actions.CREATE_MARKERS, { police, banks, gas });\n });\n })})\n .catch(( error ) => PubSub.publish( Actions.SHOW_ERROR, { message: error }));\n}", "title": "" }, { "docid": "f46bf9d96ffa64b9058a68183405aba9", "score": "0.6224671", "text": "function executeClient() {\n\t\trequest('BrixApi.newPlayer', [], function(response) {\n\t\t\tplayer = new Player(response.value, 400, 400, randomColor());\n\t\t\tmap.addPlayer(player, function() {\n\t\t\t\tplayer.takeControl(map);\n\t\t\t});\n\t\n\t\t\t/*\n\t\t\tstreamRequest('BrixApi.getHitPoints', [], function(response) {\n\t\t\t\tplayer_hitpoints.set(response, 100);\n\t\t\t}, 150);\n\t\t\t*/\n\t\t\tsubscriptionRequest('BrixApi.getPlayers', [], function(response) {\n\t\t\t\tfor(var i in response.value) {\n\t\t\t\t\tvar found = false;\n\t\t\t\t\tfor(var j in playerManager.list) {\n\t\t\t\t\t\tif(response.value[i].state == 4) {\n\t\t\t\t\t\t\t// Player has disconnected\n\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.fadeOut('slow', function() {\n\t\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.remove();\n\t\t\t\t\t\t\t\tplayerManager.remove(playerManager.list[j].id);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else \tif(response.value[i].id == playerManager.list[j].id) {\n\t\t\t\t\t\t\t// Player has data to change\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tif(response.value[i].id != player.id && playerManager.list[j].state > PLAYER_STATES.ETHEREAL) {\n\t\t\t\t\t\t\t\t// Player is not you\n\t\t\t\t\t\t\t\tplayerManager.list[j].dom.animate({\n\t\t\t\t\t\t\t\t\tleft: response.value[i].x,\n\t\t\t\t\t\t\t\t\ttop: response.value[i].y\n\t\t\t\t\t\t\t\t}, 150);\n\t\t\t\t\t\t\t\t\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(!found) {\n\t\t\t\t\t\tif(response.value[i].x == 0) {\n\t\t\t\t\t\t\tvar x = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar x = response.value[i].x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(response.value[i].y == 0) {\n\t\t\t\t\t\t\tvar y = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar y = response.value[i].y;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar newPlayer = new Player(response.value[i].id, x, y, randomColor()); \n\t\t\t\t\t\tplayerManager.add(newPlayer);\n\t\t\t\t\t\tmap.addPlayer(newPlayer, function() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 150);\n\t\t});\n\t}", "title": "" }, { "docid": "58eeca1410b02e9ad38dda793616d225", "score": "0.6219045", "text": "update() {\n // On every win\n win();\n // If player goes outside\n this.outsideCanvas();\n }", "title": "" }, { "docid": "674aaebe7d594e1e5ab6926dfd13e046", "score": "0.62133205", "text": "function onStateUpdate(nState) {\n for (var pid in state.players) {\n if (!(pid in nState.players)) // player vanishes\n onPlayerQuit(pid);\n }\n\n for (var pid in nState.players) {\n if (pid == ws._id) continue; // skip ourself\n\n if (!(pid in state.players)) { // player appears\n onPlayerJoin(pid, nState.players[pid]);\n }\n\n var p = nState.players[pid];\n if (p.state == 'player') { // update non-ghost\n onPlayerUpdate(pid, p);\n }\n }\n}", "title": "" }, { "docid": "c9a5275e6ab0867e3abfd77d0a58d334", "score": "0.6210488", "text": "function updatePlayers(){\n\t//empty div\n\tplayers.empty();\n\t//repopulate div with new list from database\n\tfor(var j=0; j<addOn_db.length; j++){\n\t\tvar player = addOn_db[j];\n\t\tvar row = create_Row(player);\n\t\tplayers.append(row);\n\t}\n}", "title": "" }, { "docid": "67d5e599c41a0bef3a88427c509f196d", "score": "0.6197899", "text": "function updateGame() {\n if (game_play) {\n clearCanvas();\n enemy_check_collision();\n player_check_collision();\n let check = check_border();\n if (check === true) {\n direction *= -1;\n invaders.forEach(function (element) {\n element.y += 5\n })\n }\n draw_player();\n draw_bullets();\n draw_enemy_bullets();\n invaders.forEach(function (element) {\n element.x += direction;\n element.update()\n });\n }\n}", "title": "" }, { "docid": "e4e161b98840358e9a48c22cd6c726d8", "score": "0.6183033", "text": "function updatePlayerInfo() {\n\t\tdocument.getElementById(\"player1name\").innerText = `Name: ${player1.name}`;\n\t\tdocument.getElementById(\"player2name\").innerText = `Name: ${player2.name}`;\n\t\tdocument.getElementById(\n\t\t\t\"player1score\"\n\t\t).innerText = `Score: ${player1.getScore()}`;\n\t\tdocument.getElementById(\n\t\t\t\"player2score\"\n\t\t).innerText = `Score: ${player2.getScore()}`;\n\t\tdocument.getElementById(\"current-player\").innerText = `Current Player: ${\n\t\t\tgameFlow.getCurrentPlayer().name\n\t\t} (${gameFlow.getCurrentPlayer().sign})`;\n\t}", "title": "" }, { "docid": "dda1939c2026ab0904f8852498c2fee6", "score": "0.6162223", "text": "function updatePlayers(){\n \n database.ref().set({\n players: {\n player1, \n player2,\n gameOver},\n \n });\n }", "title": "" }, { "docid": "8bac73fedbae658c52dadfac374349ab", "score": "0.61517894", "text": "updatePlayers(players) {\n this.setState({players})\n }", "title": "" }, { "docid": "36c29bfdaee53a80167a0a9a0ab4c144", "score": "0.61458784", "text": "function gamePlay() {\n //draw the grid\n drawMap();\n\n //Update and display player and check for input\n player.display();\n player.handleInput();\n //Check for collisions with trash and handle scoring\n player.handleScoring(trash);\n //Display trash\n trash.display();\n //Check the score of the player to determine if they've won yet\n checkScores();\n\n //Call all display and movement functions for kids in the kids array\n for (let i = 0; i < kids.length; i++) {\n kids[i].update();\n kids[i].display();\n kids[i].handleDamage(player)\n }\n\n}", "title": "" }, { "docid": "cd4cb6c1cc571fb0f826c39b702a6339", "score": "0.6136279", "text": "function draw() {\n // clear canvas every time\n context.clearRect(0, 0, canvas.width, canvas.height);\n\n localPlayer.draw(context);\n\n for (var i = 0; i < remotePlayers.length; i++) {\n remotePlayers[i].draw(context);\n };\n}", "title": "" }, { "docid": "1fea266ae0ec325f1194ff4ae1fcafcf", "score": "0.61332065", "text": "function update() {\n for (i of allSprites) {\n if (i.type == \"wall\") {\n // console.log(i)\n if (player1.collideWith(i)) {\n if (player1.dx == 1) {\n player1.dy = 0;\n player1.x = i.x - player1.w;\n }\n else if (player1.dx == -1) {\n // player1.dy = 0;\n player1.x = i.x - i.w;\n }\n else if (player1.dy == 1) {\n // player1.dx = 0;\n player1.y = i.y - player1.h;\n }\n else if (player1.dy == -1) {\n // player1.dx = 0;\n player1.y = i.y +i.h;\n }\n // console.log(\"player collided with walls\")\n console.log(\"player1 dx is:\" + player1.dx);\n }\n }\n }\n player1.update();\n\n // oneSquare.update();\n // twoSquare.update();\n}", "title": "" }, { "docid": "ef1fdb5a3c9b709978f992f1e31b030b", "score": "0.613118", "text": "function update() {\n if (game.state !== state.STOP && game.state !== state.END) {\n updateBalls();\n updatePlayers();\n updateColliders();\n checkBallsColliders();\n checkBallsTriggers();\n }\n}", "title": "" }, { "docid": "d1d20c864ed49244da9f18e3ea08c6ba", "score": "0.6125911", "text": "update() {\n this.emit('fetch');\n if (this.guilds > 0 && this.users > 0) {\n if (!config.beta) {\n dogstatsd.gauge('musicbot.guilds', this.guilds);\n dogstatsd.gauge('musicbot.users', this.users);\n }\n let requestOptions = {\n headers: {\n Authorization: config.discord_bots_token\n },\n url: `https://bots.discord.pw/api/bots/${config.bot_id}/stats`,\n method: 'POST',\n json: {\n 'server_count': this.guilds\n }\n };\n request(requestOptions, (err, response, body) => {\n if (err) {\n return this.emit('error', err);\n }\n this.emit('info', 'Stats Updated!');\n this.emit('info', body);\n });\n if (!config.beta) {\n let requestOptionsCarbon = {\n url: 'https://www.carbonitex.net/discord/data/botdata.php',\n method: 'POST',\n json: {\n 'server_count': this.guilds,\n 'key': config.carbon_token\n }\n };\n request(requestOptionsCarbon, (err, response, body) => {\n if (err) {\n return this.emit('error', err)\n }\n this.emit('info', 'Stats Updated Carbon!');\n this.emit('info', body);\n });\n }\n }\n }", "title": "" }, { "docid": "06865815e785845bec9df7a36cd311dd", "score": "0.61251956", "text": "function drawUpdate() {\n field.draw();\n for (let moveable of moveables) {\n moveable.draw();\n }\n // Check the playerstatus (player/spareplayer) \n for (let player of allPlayers) {\n player.checkState();\n }\n }", "title": "" }, { "docid": "4e0c7eb83a48cd6b18c18e1e5fd4972d", "score": "0.61170727", "text": "function update(dt) {\n allEnemies.forEach(function(enemy) {\n enemy.update(dt);\n });\n player.update();\n }", "title": "" }, { "docid": "ed75627d0f611fffe69e6d7eba436668", "score": "0.61100405", "text": "function updateAll()\n{\n\twindow.clearTimeout( timeID );\n\tgetUserList();\n\tsetTimers();\n}", "title": "" }, { "docid": "6a354a1510827e60e846a08e6a7b52ab", "score": "0.61088634", "text": "updateScorePlayer1(){\n this.game.updateScorePlayer1();\n this.socket.emit('pointPlayer2');\n }", "title": "" }, { "docid": "75120f770fe0f1615b3ed5bc3a757213", "score": "0.61064225", "text": "update(delta) {\n // create possition update message\n // it will look like { playerID : positionVector }\n const result = {};\n for (let id in this.players) {\n const player = this.players[id];\n result[id] = {\n position: player.getPosition(),\n quaternion: player.getQuaternion()\n };\n }\n // send it to the server.\n this._broadcast(COM.MSG.POSITION_UPDATE, result);\n }", "title": "" }, { "docid": "c8af6ee8d8e4c110a9d0c65bb7ab5fd1", "score": "0.6101686", "text": "function update(){\r\n bird.update();\r\n fg.update();\r\n pipes.update();\r\n}", "title": "" }, { "docid": "938e189f2050fd8aaf8d8bd8c6b56c73", "score": "0.6100193", "text": "function update(elapsedTime) {\n missilesHandler.update(elapsedTime);\n updateClientsAboutMissiles(elapsedTime);\n asteroidsHandler.update(elapsedTime);\n updateClientsAboutAsteroids(elapsedTime);\n ufosHandler.update(elapsedTime);\n updateClientsAboutUFOs(elapsedTime);\n powerupHandler.update(elapsedTime);\n updateClientsAboutPowerups(elapsedTime);\n for (let clientId in activeClients) {\n activeClients[clientId].player.update(elapsedTime, false);\n }\n updateClients(elapsedTime);\n collisionHandler.handleCollisions(elapsedTime);\n}", "title": "" }, { "docid": "fa0011a074bdcf04f4035350db544490", "score": "0.60877556", "text": "update() {\n\n // if destroyed, then ignore\n if (this._state == Actor.DESTROYED) return;\n\n // update additional script\n this.update_before(this);\n\n // update skeleton of limbs of sprites\n this.skeleton.update();\n\n // update additional script\n this.update_more(this);\n }", "title": "" }, { "docid": "cf52ce88278aefd4129acd73341caa89", "score": "0.6085915", "text": "function refreshPlayerInfo() {\r\n if (player.gameState === GameState.Night) {\r\n setNightPlayerInfo();\r\n }\r\n else {\r\n setDayPlayerInfo();\r\n }\r\n}", "title": "" }, { "docid": "31ee92cabefcaf29621ec77d94d58d95", "score": "0.60824317", "text": "update() {\n // did player collide with enemy?\n for (let enemy of allEnemies) {\n // collision? from http://blog.sklambert.com/html5-canvas-game-2d-collision-detection/#d-collision-detection\n if (this.x < enemy.x + enemy.collisionWidth && this.x + this.collisionWidth > enemy.x && this.y < enemy.y + enemy.collisionHeight && this.y + this.collisionHeight > enemy.y) {\n // if yes change score and reset to start\n this.restart();\n hearts.reduceHearts();\n this.blink();\n }\n }\n // item collected?\n for (let item of allItems) {\n if (item != player) {\n if (this.x < item.x + item.collisionWidth && this.x + this.collisionWidth > item.x && this.y < item.y + item.collisionHeight && this.y + this.collisionHeight > item.y) { \n item.xPointShow = item.x;\n item.yPointShow = item.y;\n item.collision = true;\n item.add();\n item.disappear();\n } \n }\n }\n }", "title": "" }, { "docid": "61c3c401a60ca1910863660975a43368", "score": "0.60793364", "text": "function updateAllObjectsFromServer()\n{\n // send comms request\n serverGet(getPanelObjectsToUpdate());\n}", "title": "" }, { "docid": "a2ef031eee6d8ce1cc656a14dfabdc1f", "score": "0.60701907", "text": "update() {\n for(let i=0; i<Simulation.speed; i++) {\n globalUpdateCount += 1\n this.fields.forEach(f => f.update())\n this.sender.auto()\n this.sender.update()\n this.updateR()\n this.chart.update(this.fields, this.sender)\n }\n }", "title": "" }, { "docid": "587ef6f6a9ba974bba5d88b463a75cdc", "score": "0.6059719", "text": "function updateAllStats(){\n wantedLevelChange()\n updateMaxHeld()\n}", "title": "" } ]
079d4ecf1c02bad2219f1088786d9235
About 1.5x faster than the twoarg version of Arraysplice().
[ { "docid": "3dc6390b89b8a615cf910ce5d74ae403", "score": "0.0", "text": "function spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)\n list[i] = list[k];\n list.pop();\n}", "title": "" } ]
[ { "docid": "d7b37008f0bfdd218dd8e91600878713", "score": "0.68144435", "text": "function applySplice(array, index, item1, item2) {\n array.splice(index, 2, item1, item2);\n return array;\n}", "title": "" }, { "docid": "741748e6d58bebd160327772220b7ac7", "score": "0.6685957", "text": "function arraySpliceIn(mutate, at, v, arr) {\n var len = arr.length;\n if (mutate) {\n var _i = len;\n while (_i >= at) {\n arr[_i--] = arr[_i];\n }\n arr[at] = v;\n return arr;\n }\n var i = 0, g = 0;\n var out = new Array(len + 1);\n while (i < at) {\n out[g++] = arr[i++];\n }\n out[at] = v;\n while (i < len) {\n out[++g] = arr[i++];\n }\n return out;\n}", "title": "" }, { "docid": "4ed487b76c416a7992d1197e0416ebda", "score": "0.6657123", "text": "function splice(arr, start, deleteCount) {\n var newArr = [];\n start = Math.min(start, arr.length);\n deleteCount = Math.min(deleteCount, arr.length - start);\n\n argLength = arguments.length - 3;\n\n // Manage deletion\n\n for (var i = start; i < start + deleteCount; i++) {\n newArr[newArr.length] = arr[i];\n }\n\n for (var i = start; i < arr.length; i++) {\n arr[i] = arr[i + deleteCount];\n }\n\n arr.length = arr.length - deleteCount;\n console.log(`Arr is ${arr} with ${arr.length}`)\n\n // Insert the element if it exists\n if (argLength > 0) {\n for (var i = arr.length + argLength - 1; i >= start; i--) {\n arr[i + argLength] = arr[i];\n }\n\n for (var i = start; i < start + argLength; i++) {\n arr[i] = arguments[3 + i - start];\n }\n }\n\n arr.length = arr.length - argLength;\n return newArr;\n}", "title": "" }, { "docid": "bcdd03cf57a7ed41c8c16fe669cf6277", "score": "0.6621636", "text": "function frankenSplice(arr1, arr2, n) {\n let localArr = arr2.slice();\n localArr.splice(n, 0, ...arr1);\n return localArr;\n}", "title": "" }, { "docid": "3949fbcdb19c31ca72115433728ef0fa", "score": "0.6549604", "text": "function splice(array, start, deleteCount, ...elements) {\n start = Math.min(start, array.length);\n \n let returnArray = array.slice(start, start + deleteCount);\n let decapitatedArray = array.slice(start);\n array.length = start;\n\n surgeryOnHead(decapitatedArray, deleteCount);\n decapitatedArray.unshift(...elements);\n array.push(...decapitatedArray);\n\n return returnArray;\n}", "title": "" }, { "docid": "ff480f93cec5bea00359c5dcd4f710a8", "score": "0.6525269", "text": "function getSpliceEquivalent ( length, methodName, args ) {\n\tswitch ( methodName ) {\n\t\tcase 'splice':\n\t\t\tif ( args[0] !== undefined && args[0] < 0 ) {\n\t\t\t\targs[0] = length + Math.max( args[0], -length );\n\t\t\t}\n\n\t\t\tif ( args[0] === undefined ) { args[0] = 0; }\n\n\t\t\twhile ( args.length < 2 ) {\n\t\t\t\targs.push( length - args[0] );\n\t\t\t}\n\n\t\t\tif ( typeof args[1] !== 'number' ) {\n\t\t\t\targs[1] = length - args[0];\n\t\t\t}\n\n\t\t\t// ensure we only remove elements that exist\n\t\t\targs[1] = Math.min( args[1], length - args[0] );\n\n\t\t\treturn args;\n\n\t\tcase 'sort':\n\t\tcase 'reverse':\n\t\t\treturn null;\n\n\t\tcase 'pop':\n\t\t\tif ( length ) {\n\t\t\t\treturn [ length - 1, 1 ];\n\t\t\t}\n\t\t\treturn [ 0, 0 ];\n\n\t\tcase 'push':\n\t\t\treturn [ length, 0 ].concat( args );\n\n\t\tcase 'shift':\n\t\t\treturn [ 0, length ? 1 : 0 ];\n\n\t\tcase 'unshift':\n\t\t\treturn [ 0, 0 ].concat( args );\n\t}\n}", "title": "" }, { "docid": "567e52cea0bdab3387d1ba0ae235690f", "score": "0.6507463", "text": "splice (dimension, index, count, ...elements) {\n return this.spliceArray(dimension, index, count, elements)\n }", "title": "" }, { "docid": "7d8d7745556872beb09500964ec600a6", "score": "0.65035063", "text": "function frankenSplice(arr1, arr2, n) {\n\tlet newArray = [...arr2];\n \tnewArray.splice(n, 0, ...arr1);\n return newArray;\n}", "title": "" }, { "docid": "94b0c0e942839323a1807493c26d1302", "score": "0.64876974", "text": "function getSpliceEquivalent(array, methodName, args) {\n \tswitch (methodName) {\n \t\tcase \"splice\":\n \t\t\tif (args[0] !== undefined && args[0] < 0) {\n \t\t\t\targs[0] = array.length + Math.max(args[0], -array.length);\n \t\t\t}\n\n \t\t\twhile (args.length < 2) {\n \t\t\t\targs.push(0);\n \t\t\t}\n\n \t\t\t// ensure we only remove elements that exist\n \t\t\targs[1] = Math.min(args[1], array.length - args[0]);\n\n \t\t\treturn args;\n\n \t\tcase \"sort\":\n \t\tcase \"reverse\":\n \t\t\treturn null;\n\n \t\tcase \"pop\":\n \t\t\tif (array.length) {\n \t\t\t\treturn [array.length - 1, 1];\n \t\t\t}\n \t\t\treturn [0, 0];\n\n \t\tcase \"push\":\n \t\t\treturn [array.length, 0].concat(args);\n\n \t\tcase \"shift\":\n \t\t\treturn [0, array.length ? 1 : 0];\n\n \t\tcase \"unshift\":\n \t\t\treturn [0, 0].concat(args);\n \t}\n }", "title": "" }, { "docid": "94b0c0e942839323a1807493c26d1302", "score": "0.64876974", "text": "function getSpliceEquivalent(array, methodName, args) {\n \tswitch (methodName) {\n \t\tcase \"splice\":\n \t\t\tif (args[0] !== undefined && args[0] < 0) {\n \t\t\t\targs[0] = array.length + Math.max(args[0], -array.length);\n \t\t\t}\n\n \t\t\twhile (args.length < 2) {\n \t\t\t\targs.push(0);\n \t\t\t}\n\n \t\t\t// ensure we only remove elements that exist\n \t\t\targs[1] = Math.min(args[1], array.length - args[0]);\n\n \t\t\treturn args;\n\n \t\tcase \"sort\":\n \t\tcase \"reverse\":\n \t\t\treturn null;\n\n \t\tcase \"pop\":\n \t\t\tif (array.length) {\n \t\t\t\treturn [array.length - 1, 1];\n \t\t\t}\n \t\t\treturn [0, 0];\n\n \t\tcase \"push\":\n \t\t\treturn [array.length, 0].concat(args);\n\n \t\tcase \"shift\":\n \t\t\treturn [0, array.length ? 1 : 0];\n\n \t\tcase \"unshift\":\n \t\t\treturn [0, 0].concat(args);\n \t}\n }", "title": "" }, { "docid": "32bca73244d7dedb2ffe7b0bee0867b3", "score": "0.64662147", "text": "function arraySplice(array, index, count) {\n var length = array.length - count;\n\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n\n while (count--) {\n array.pop(); // shrink the array\n }\n }", "title": "" }, { "docid": "ebccf60686047571435e56a9c96f100c", "score": "0.6460247", "text": "function arraySpliceOut(mutate, at, arr) {\n var len = arr.length;\n var i = 0, g = 0;\n var out = arr;\n if (mutate) {\n i = g = at;\n }\n else {\n out = new Array(len - 1);\n while (i < at) {\n out[g++] = arr[i++];\n }\n ++i;\n }\n while (i < len) {\n out[g++] = arr[i++];\n }\n return out;\n}", "title": "" }, { "docid": "4d7fc03f2fd531a22e7143346da3295b", "score": "0.6448074", "text": "function arraySplice(array, index, count) {\n var length = array.length - count;\n\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n\n while (count--) {\n array.pop(); // shrink the array\n }\n }", "title": "" }, { "docid": "4d7fc03f2fd531a22e7143346da3295b", "score": "0.6448074", "text": "function arraySplice(array, index, count) {\n var length = array.length - count;\n\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n\n while (count--) {\n array.pop(); // shrink the array\n }\n }", "title": "" }, { "docid": "766dbcf2697f122a58f8ace4242bb1a2", "score": "0.64368606", "text": "arraySplice(array, startIndex, deleteCount, ...items) {\n const change = new ArraySpliceChange(array, startIndex, deleteCount, items);\n this.changes.push(change);\n change.apply();\n }", "title": "" }, { "docid": "00fde355edfc8a2c7958cb4e65cee30f", "score": "0.6436156", "text": "function frankenSplice3(arr1, arr2, n) {\n let newArr = arr2.slice()\n newArr.splice(n, 0, ...arr1)\n console.log(newArr)\n return newArr\n }", "title": "" }, { "docid": "9ab7a5d5888dbbd6035339d19b8a00ab", "score": "0.6434789", "text": "function frankenSplice(arr1, arr2, n) {\n // It's alive. It's alive!\n let newarr = arr2.slice();\n newarr.splice(n,0,...arr1);\n return newarr;\n }", "title": "" }, { "docid": "9eaff3952d87c007eb64ecbe90b92f8b", "score": "0.6418484", "text": "function frankenSplice(arr1, arr2, n) {\n let newArray = arr2.slice();\n newArray.splice(n, 0, ...arr1);\n return newArray;\n}", "title": "" }, { "docid": "41848ba1bfb3a5d014e3109380dd358f", "score": "0.6398676", "text": "function frankenSplice(arr1, arr2, n) {\n const arr = [...arr2];\n arr.splice(n, 0, ...arr1);\n return arr;\n}", "title": "" }, { "docid": "b8a9a96adbeebc0245d1c0e44e597600", "score": "0.6389786", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr = [...arr2]\n newArr.splice(n, 0, ...arr1)\n return newArr;\n}", "title": "" }, { "docid": "a033a3a113516c24d3cf2a78dff1d871", "score": "0.6380655", "text": "function spliceInArray(giveArray, recvArray, length, offset){\n for(var i = 0; i < length; i++){\n recvArray[i+offset] = giveArray[i];\n }\n}", "title": "" }, { "docid": "303852ef03d957dcfc8283eea5db5980", "score": "0.6376315", "text": "splice() {\n let ret;\n const arr = utils.isMongooseArray(this) ? this.__array : this;\n\n this._markModified();\n _checkManualPopulation(this, Array.prototype.slice.call(arguments, 2));\n\n if (arguments.length) {\n let vals;\n if (this[arraySchemaSymbol] == null) {\n vals = arguments;\n } else {\n vals = [];\n for (let i = 0; i < arguments.length; ++i) {\n vals[i] = i < 2 ?\n arguments[i] :\n this._cast(arguments[i], arguments[0] + (i - 2));\n }\n }\n\n ret = [].splice.apply(arr, vals);\n this._registerAtomic('$set', this);\n }\n\n return ret;\n }", "title": "" }, { "docid": "1437dc0c644485c0ee46a46dac4bc58c", "score": "0.6352817", "text": "function doubleTrouble(arr) {\n for(var i = 0; i < arr.length; i++) {\n arr.splice(i, 0, arr[i]);\n i++;\n }\n return arr;\n}", "title": "" }, { "docid": "d2cc69d77cd4f3ea2a2bed830df135f4", "score": "0.6352817", "text": "function frankenSplice(arr1, arr2, n) {\n\n let arr2Copy = arr2.slice() //if no numbers are entered in range slice(start, end) then the whole array is selected\n\n arr2Copy.splice(n, 0, ...arr1); // use spread syntax ... instead of a for loop to iterate**\n\n return arr2Copy\n\n}", "title": "" }, { "docid": "fe9badc0f46f5ba0cb78bd26c27a11f3", "score": "0.633668", "text": "splice (...args) {\n const {length} = this\n const ret = super.splice(...args)\n\n // #16\n // If no element removed, we might still need to move comments,\n // because splice could add new items\n\n // if (!ret.length) {\n // return ret\n // }\n\n // JavaScript syntax is silly\n // eslint-disable-next-line prefer-const\n let [begin, deleteCount, ...items] = args\n\n if (begin < 0) {\n begin += length\n }\n\n if (arguments.length === 1) {\n deleteCount = length - begin\n } else {\n deleteCount = Math.min(length - begin, deleteCount)\n }\n\n const {\n length: item_length\n } = items\n\n // itemsToDelete: -\n // itemsToAdd: +\n // | dc | count |\n // =======-------------============\n // =======++++++============\n // | il |\n const offset = item_length - deleteCount\n const start = begin + deleteCount\n const count = length - start\n\n move_comments(this, this, start, count, offset, true)\n\n return ret\n }", "title": "" }, { "docid": "fe9badc0f46f5ba0cb78bd26c27a11f3", "score": "0.633668", "text": "splice (...args) {\n const {length} = this\n const ret = super.splice(...args)\n\n // #16\n // If no element removed, we might still need to move comments,\n // because splice could add new items\n\n // if (!ret.length) {\n // return ret\n // }\n\n // JavaScript syntax is silly\n // eslint-disable-next-line prefer-const\n let [begin, deleteCount, ...items] = args\n\n if (begin < 0) {\n begin += length\n }\n\n if (arguments.length === 1) {\n deleteCount = length - begin\n } else {\n deleteCount = Math.min(length - begin, deleteCount)\n }\n\n const {\n length: item_length\n } = items\n\n // itemsToDelete: -\n // itemsToAdd: +\n // | dc | count |\n // =======-------------============\n // =======++++++============\n // | il |\n const offset = item_length - deleteCount\n const start = begin + deleteCount\n const count = length - start\n\n move_comments(this, this, start, count, offset, true)\n\n return ret\n }", "title": "" }, { "docid": "e08eb0acbdc7a5ffd1ac5b4e1a603980", "score": "0.6333975", "text": "function slasher (arr, howMany) {\n return arr.splice(howMany)\n}", "title": "" }, { "docid": "71983a337c287ce2b41a33a49e47c252", "score": "0.63228154", "text": "function frankenSplice(arr1, arr2, n) {\n\n const newArr = arr2.slice();\n newArr.splice(n, 0, ...arr1);\n return newArr;\n}", "title": "" }, { "docid": "275cb61a17a2c303347e939cc042c12b", "score": "0.63148004", "text": "function arraySplice(array, index, count) {\n const length = array.length - count;\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n while (count--) {\n array.pop(); // shrink the array\n }\n}", "title": "" }, { "docid": "275cb61a17a2c303347e939cc042c12b", "score": "0.63148004", "text": "function arraySplice(array, index, count) {\n const length = array.length - count;\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n while (count--) {\n array.pop(); // shrink the array\n }\n}", "title": "" }, { "docid": "bc863e0f36fab90fb6e878a83fad86c8", "score": "0.6309993", "text": "function arrcp( arr1, arr2Destroy, start ) {\n\n\tarr2Destroy.unshift( start, arr2Destroy.length );\n\tarr1.splice.apply( arr1, arr2Destroy );\n}", "title": "" }, { "docid": "b79d058b6c5246e273da6c48bc911e20", "score": "0.6297238", "text": "function frankenSplice(arr1, arr2, n) {\n let arr3 = arr2.map(x=>x);\n arr3.splice(n, 0,...arr1)\n \n return arr3;\n}", "title": "" }, { "docid": "e57b47746687f3fb8739199c97090fde", "score": "0.6293278", "text": "function slasher(arr, howMany) {\n // it doesn't always pay to be first\n var removed = arr.splice(0, howMany);\n return arr;\n}", "title": "" }, { "docid": "786894091ca9a538bb98f0b104842617", "score": "0.6289937", "text": "function slasher(arr, howMany) {\n // it doesn't always pay to be first\n newArr = arr.splice(0, howMany);\n\n return arr;\n}", "title": "" }, { "docid": "5e20d0f3cc4cbf5d67ae8b2d67ef9721", "score": "0.62873423", "text": "function frankenSplice(arr1, arr2, n) {\n let container = arr2.slice();\n container.splice(n, 0, ...arr1);\n return container;\n}", "title": "" }, { "docid": "12c72af8f2cef6174e793f67b7f38b8f", "score": "0.6287182", "text": "splice() {\n const ret = ArrayMethods.splice.apply(this, arguments);\n\n _updateParentPopulated(this);\n\n return ret;\n }", "title": "" }, { "docid": "5a5d95ed0c75e5b852023e2297931823", "score": "0.62806326", "text": "function orderedRemoveItemAt(array,index){// This seems to be faster than either `array.splice(i, 1)` or `array.copyWithin(i, i+ 1)`.\nfor(var i=index;i<array.length-1;i++){array[i]=array[i+1];}array.pop();}", "title": "" }, { "docid": "3bab95c1c126b6dd25e028e88ff06fba", "score": "0.6274812", "text": "function frankenSplice(arr1, arr2, n) {\n const arr2Copy = [...arr2] // as the input arrays should remain the same after the function runs.\n arr2Copy.splice(n, 0, ...arr1);\n return arr2Copy\n}", "title": "" }, { "docid": "04b7b626ffef1cd986dd8770a05d9174", "score": "0.6224029", "text": "function splicer(arr, starting, deleteCount, elements) {\n if (arguments.length === 1) {\n return arr;\n }\n starting = Math.max(starting, 0);\n deleteCount = Math.max(deleteCount, 0);\n elements = elements || [];\n\n const newSize = arr.length - deleteCount + elements.length;\n const splicedArray = new arr.constructor(newSize);\n\n splicedArray.set(arr.subarray(0, starting));\n splicedArray.set(elements, starting);\n splicedArray.set(arr.subarray(starting + deleteCount), starting + elements.length);\n return splicedArray;\n}", "title": "" }, { "docid": "57eb10126e01d44b638929aa724cbb8e", "score": "0.6211668", "text": "function frankenSplice(arr1, arr2, n) {\n // Step 1: Create a copy of arr2 to keep the orginal arr2 when slice method applied to the arr2 then assign to a new variable (arr2Copy), Note: no need to set parameters on slice\n let arr2Copy = arr2.slice(); // or using function rest parameter [...arr2]\n // Step 2: Each item should be splice into a arr2Copy using the index (n)\n arr2Copy.splice(n, 0, ...arr1);\n // Step 3: Return the arr2Copy\n return arr2Copy;\n}", "title": "" }, { "docid": "3853a0ccb71694a2f5a12732bd418dc9", "score": "0.62055707", "text": "function splice(array, start, deleteCount, ...values) {\n if (start > array.length) {\n start = array.length;\n }\n\n if (deleteCount > array.length - start) {\n deleteCount = array.length - start;\n }\n\n let spliced = [];\n\n for (let index = start; spliced.length < deleteCount; index += 1) {\n spliced.push(array[index]);\n if (values.length === 0) {\n array[index] = array[index + deleteCount];\n } else {\n array[index] = values[index - start];\n }\n }\n\n let newLength = array.length - deleteCount + values.length;\n array.length = newLength;\n\n return spliced;\n}", "title": "" }, { "docid": "4d9486dc2bda6b19577c54131054ac69", "score": "0.61821115", "text": "function ArrayElementMove(arr, from, to) { arr.splice(to, 0, arr.splice(from, 1)[0]); }", "title": "" }, { "docid": "871d230b1c36e17222914cc131f03990", "score": "0.6175176", "text": "function replaceInNativeArray(array, start, deleteCount, items) {\n arrayContentWillChange(array, start, deleteCount, items.length);\n\n if (items.length <= CHUNK_SIZE) {\n array.splice.apply(array, [start, deleteCount].concat(items));\n } else {\n array.splice(start, deleteCount);\n\n for (var i = 0; i < items.length; i += CHUNK_SIZE) {\n var chunk = items.slice(i, i + CHUNK_SIZE);\n array.splice.apply(array, [start + i, 0].concat(chunk));\n }\n }\n\n arrayContentDidChange(array, start, deleteCount, items.length);\n }", "title": "" }, { "docid": "54759dfb72d1ca4c57ec7169dce34247", "score": "0.6173068", "text": "function frankenSplice (arr1, arr2, n) {\n let combinedArrays = arr2.slice()\n combinedArrays.splice(n,0, ...arr1)\n \n return combinedArrays;\n}", "title": "" }, { "docid": "0513636b2660b79c0fc67dd881d41bc1", "score": "0.6167319", "text": "function doubleTrouble(arr) {\n for (var i = 0; i < arr.length; i += 2) {\n arr.splice(i, 0, arr[i]);\n }\n return arr;\n}", "title": "" }, { "docid": "8fe69894887e3eed0691ab50e0f51db3", "score": "0.61642534", "text": "function destroyer(arr){\n let newArr=[];\n if(arguments.length<=1){\n newArr=[...arr];\n }else{\n let copyArr=arr.slice();\n for(let i=1; arguments.length>i;i++){\n for(let j=0; copyArr.length>j;j++){\n if(arr[j]==arguments[i]){\n arr.splice(j,1);\n j--; //Decrementing the index variable so it does not skip the next item in the array.\n }\n }\n }\n } \n\n return newArr=[...arr];\n}", "title": "" }, { "docid": "b9ca85ad79945e01630983ff83e3d479", "score": "0.6151118", "text": "function removeAt(array, idx) {\n if (idx >= array.length || idx < 0) return array;\n return array.slice(0, idx).concat(array.slice(idx + 1));\n }", "title": "" }, { "docid": "65217c9ac1e86ab86e4d9374c01d1384", "score": "0.61434853", "text": "function slasher(arr, howMany) {\n arr.splice(0 , howMany);\n return arr;\n}", "title": "" }, { "docid": "17b05ee6aeb6c686caaf3c4d87e0f53e", "score": "0.61400926", "text": "function unsafeRemove(i, a, l) {\n\t var b = new Array(l);\n\t var j = undefined;\n\t for (j = 0; j < i; ++j) {\n\t b[j] = a[j];\n\t }\n\t for (j = i; j < l; ++j) {\n\t b[j] = a[j + 1];\n\t }\n\t\n\t return b;\n\t }", "title": "" }, { "docid": "1fdf132778e2d061be7646100287fbd6", "score": "0.6139084", "text": "function frankenSplice(arr1, arr2, n) {\n\n let arr2Copy = [];\n arr2.forEach(e => arr2Copy.push(e));\n\n let arr2Right = arr2Copy.splice(n);\n\n for (let i = 0; i < arr1.length; i++) {\n arr2Copy.push(arr1[i]);\n }\n\n for (let i = 0; i < arr2Right.length; i++) {\n arr2Copy.push(arr2Right[i]);\n }\n return arr2Copy;\n}", "title": "" }, { "docid": "b2336881a17ddef5a8a134aaebc62815", "score": "0.61283046", "text": "function spliceBulk(array, insert, at) {\n const nLength = insert.length,\n tailEnd = array.length;\n array.length += nLength;\n rcopy(array, array, at + nLength, at, tailEnd);\n rcopy(array, insert, at, 0, insert.length);\n}", "title": "" }, { "docid": "e304ae68a9e5f11a8276903f404a4e1a", "score": "0.6120023", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr = arr2.slice()\n for (let i = 0; i < arr1.length; i++) {\n newArr.splice(n, 0, arr1[i]);\n n++;\n }\n return newArr\n}", "title": "" }, { "docid": "a6a63c58d672d431a0d35cc501b38d61", "score": "0.61085695", "text": "function slasher(arr, howMany) {\n arr.splice(0, howMany);\n return arr;\n}", "title": "" }, { "docid": "5b71506e5e031816de36834b57a34e5f", "score": "0.60971177", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr = arr2.slice();\n for (let i = 0; i < arr1.length; i++) {\n newArr.splice(n, 0, arr1[i]);\n n++;\n }\n return newArr;\n}", "title": "" }, { "docid": "61bee28c02fca5f710da069191cc9888", "score": "0.6094925", "text": "function replaceInNativeArray(array, start, deleteCount, items) {\n arrayContentWillChange(array, start, deleteCount, items.length);\n\n if (items.length <= CHUNK_SIZE) {\n array.splice(start, deleteCount, ...items);\n } else {\n array.splice(start, deleteCount);\n\n for (var i = 0; i < items.length; i += CHUNK_SIZE) {\n var chunk = items.slice(i, i + CHUNK_SIZE);\n array.splice(start + i, 0, ...chunk);\n }\n }\n\n arrayContentDidChange(array, start, deleteCount, items.length);\n }", "title": "" }, { "docid": "fe438f35b9db43cc699ce7b029ba4d92", "score": "0.60833293", "text": "function slasher(arr, howMany) {\n arr.splice(0, howMany);\n return arr;\n}", "title": "" }, { "docid": "fe438f35b9db43cc699ce7b029ba4d92", "score": "0.60833293", "text": "function slasher(arr, howMany) {\n arr.splice(0, howMany);\n return arr;\n}", "title": "" }, { "docid": "b1b7e7e0ad7a8dcfad86f18d73392986", "score": "0.6078093", "text": "function removeAt(array, idx) {\n if (idx >= array.length || idx < 0) return array;\n return array.slice(0, idx).concat(array.slice(idx + 1));\n}", "title": "" }, { "docid": "b1b7e7e0ad7a8dcfad86f18d73392986", "score": "0.6078093", "text": "function removeAt(array, idx) {\n if (idx >= array.length || idx < 0) return array;\n return array.slice(0, idx).concat(array.slice(idx + 1));\n}", "title": "" }, { "docid": "667d174a9a25d240afaa64e900a0c240", "score": "0.6077875", "text": "function unsafeRemove(i, a, l) {\n var b = new Array(l);\n var j = void 0;\n for (j = 0; j < i; ++j) {\n b[j] = a[j];\n }\n for (j = i; j < l; ++j) {\n b[j] = a[j + 1];\n }\n\n return b;\n }", "title": "" }, { "docid": "ea0bb015fdbe0ba814db828a9a2cb2af", "score": "0.60691166", "text": "function move(array,from,to){array.splice(to,0,array.splice(from,1)[0]);}", "title": "" }, { "docid": "60dc60284c963f724de4dee3a64320d9", "score": "0.60576576", "text": "function slasher(arr, n) {\n arr.splice(0, n)\n return arr\n}", "title": "" }, { "docid": "897a710260fb8f875077809695dbc0a9", "score": "0.6055649", "text": "function slasher(arr, howMany) {\n // it doesn't always pay to be first\n arr.splice(0, howMany);\n return arr;\n}", "title": "" }, { "docid": "01440f5ea6a0797e98d8cd7c8b4ba5b6", "score": "0.6054966", "text": "function remove(arr, index) {\n //no changes, using slice only\n var newArr = arr.slice(0, index).concat(arr.slice(index + 1));\n //another way is to use loop and push to new array\n // the following won't work,splice is destructive\n // someArray.slice(0, x).concat(someArray.slice(-x));\n // var newArr = arr;\n // newArr.splice(index, 1); // remove from the index and one item\n\n return newArr; // complete this statement\n}", "title": "" }, { "docid": "7e1cdd4baa8d49eff4ede1f4aa0feda1", "score": "0.60499513", "text": "function seekAndDestroy(arr, ...args){\r\n let newArr = []\r\n arr.forEach(element => {\r\n const index = args.indexOf(element)\r\n if(index == -1){\r\n newArr.push(element)\r\n } \r\n });\r\n\r\n return newArr\r\n}", "title": "" }, { "docid": "91301529064b114c026e81b7cf4fb1b6", "score": "0.6046583", "text": "function arrayMove(arr, fromIndex, toIndex) {\r\n var element = arr[fromIndex];\r\n arr.splice(fromIndex, 1);\r\n arr.splice(toIndex, 0, element);\r\n}", "title": "" }, { "docid": "d608f8e115eb2fe78c0c695b3ba2cb22", "score": "0.6037184", "text": "function slasher(arr, howMany) {\n return (arr.splice(0, howMany));\n}", "title": "" }, { "docid": "b38c74dfdd039afbd2dafb14b53da30a", "score": "0.6027032", "text": "function arrayRemove(a, from, to) {\n\tvar rest = a.slice((to || from) + 1 || a.length);\n\ta.length = from < 0 ? a.length + from : from;\n\treturn a.push.apply(a, rest);\n}", "title": "" }, { "docid": "c35de2fa54e91be6557cc12f696e2b0f", "score": "0.60033536", "text": "function frankenSplice(arr1, arr2, n) {\n let container = arr2.slice();\n for (let i = 0; i < arr1.length; i++) {\n container.splice(n, 0, arr1[i]);\n n++;\n }\n return container;\n}", "title": "" }, { "docid": "9a638a57b18e138bc378e13916b11bf9", "score": "0.6002294", "text": "function frankenSplice(arr1, arr2, n) {\n let newArr1 = arr1.slice(0);\n let newArr2 = arr2.slice(0);\n for (let i = newArr1.length-1;i>=0;i--){\n newArr2.splice(n,0,newArr1[i]);\n }\n return newArr2;\n}", "title": "" }, { "docid": "20dea2892469d6714e99667db9f37d2d", "score": "0.60017097", "text": "function slasher(arr, howMany) {\n\tvar tArray = [];\n\n\tif (howMany < arr.length && howMany !== 0){\n\t\ttArray = arr.splice(0,2);\n\t\treturn arr;\n\t}\n\n\tif (howMany > arr.length) {\n\t\treturn tArray;\n\t}\n\n\t return arr;\n}", "title": "" }, { "docid": "1c5c73572b5cb90dcc91fb506d188f3f", "score": "0.5967681", "text": "function arrayMove(array, from, to) {\r\n array.splice(to, 0, array.splice(from, 1)[0]);\r\n }", "title": "" }, { "docid": "48daad20f3a0b8fe5da2d7bd9b088127", "score": "0.59628314", "text": "function unsafeRemove(i, a, l) {\n var b = new Array(l);\n var j;\n for (j = 0; j < i; ++j) {\n b[j] = a[j];\n }\n for (j = i; j < l; ++j) {\n b[j] = a[j + 1];\n }\n return b;\n }", "title": "" }, { "docid": "298bfb6e031b6ffee593c50e1d39fb39", "score": "0.59384996", "text": "function enQ(arr, item){\n\tarr.splice(0, 0, item);\n}", "title": "" }, { "docid": "2b2f7c1f5c556ec4fee354b2562f83b7", "score": "0.5932554", "text": "function arrayMove(arr, fromIndex, toIndex) {\n let element = arr[fromIndex];\n arr.splice(fromIndex, 1);\n arr.splice(toIndex, 0, element);\n}", "title": "" }, { "docid": "cf4f53610f4ddcd69a044761e69c079c", "score": "0.5922738", "text": "function unsafeRemove(i, a, l) {\n var b = new Array(l);\n var j = undefined;\n for (j = 0; j < i; ++j) {\n b[j] = a[j];\n }\n for (j = i; j < l; ++j) {\n b[j] = a[j + 1];\n }\n\n return b;\n }", "title": "" }, { "docid": "4ad7f7d8ce825e38ba335a52305b05a2", "score": "0.590611", "text": "function arrayMove(array, from, to) {\r\n array.splice(to, 0, array.splice(from, 1)[0]);\r\n }", "title": "" }, { "docid": "37cb970cf9b4689efc62fe4c8743d078", "score": "0.5901551", "text": "function frankenSplice(arr1, arr2, n) {\n let result = [];\n\n result.push(...arr2.slice(0, n));\n result.push(...arr1);\n result.push(...arr2.slice(n, arr2.length));\n\n return result;\n }", "title": "" }, { "docid": "60aa2de5c8406f109d6e84bcc1026efa", "score": "0.589934", "text": "function frankenSplice(arr1, arr2, n) {\n // Step 1: Create a copy of arr2 to keep the orginal arr2 when slice method applied to the arr2 then assign to a new variable (arr2Copy)\n let arr2Copy = arr2.slice();\n\n // Step 2: Loop through the arr1, each item should be splice into a arr2Copy using the index (n), then increment the given index (n) after doing splice\n for (let i = 0; i < arr1.length; i++) {\n arr2Copy.splice(n, 0, arr1[i]);\n n++;\n }\n // Step 3: Return the arr2Copy\n return arr2Copy;\n}", "title": "" }, { "docid": "6ddaafd42fa6ff169fdca910dd2dce68", "score": "0.58952856", "text": "function removeDoArray(item, indice, array){\n\tarray.splice(indice, 1);\n}", "title": "" }, { "docid": "bfd720c0cf91d7054ebc3027fc260ab7", "score": "0.58811295", "text": "function spliceOne(list, index) {\n\t for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)\n\t list[i] = list[k];\n\t list.pop();\n\t}", "title": "" }, { "docid": "6d0350cef4f246c82dfb5b3c96df3184", "score": "0.5869448", "text": "function nonMutatingSplice(cities){\n\treturn cities.splice(0, 3);\n}", "title": "" }, { "docid": "42a94aaed833dee46d963f2096a3b127", "score": "0.58634156", "text": "static arraycopy(src, srcPos, dest, destPos, length) {\n // TODO: better use split or set?\n let i = srcPos;\n let j = destPos;\n let c = length;\n while (c--) {\n dest[j++] = src[i++];\n }\n }", "title": "" }, { "docid": "7760bfecbc11d995d5429072d1602d34", "score": "0.5860022", "text": "function insertSlice(arr, subArr, index) {\n [].splice.apply(\n arr, [index, 0].concat(subArr)\n );\n }", "title": "" }, { "docid": "7760bfecbc11d995d5429072d1602d34", "score": "0.5860022", "text": "function insertSlice(arr, subArr, index) {\n [].splice.apply(\n arr, [index, 0].concat(subArr)\n );\n }", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.58579266", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.58579266", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.58579266", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "a890c0638464a01e25c3b3c35f9805a4", "score": "0.58579266", "text": "function fnArraySwitch( aArray, iFrom, iTo )\n{\n\tvar mStore = aArray.splice( iFrom, 1 )[0];\n\taArray.splice( iTo, 0, mStore );\n}", "title": "" }, { "docid": "8d57726142884d23bfc702467fe3cb11", "score": "0.58539134", "text": "function spliceElement(someArr, index) {\n return someArr.splice(0, index)\n}", "title": "" }, { "docid": "84044feaaf7374e97aec5cc8b086edef", "score": "0.58499706", "text": "function arrayRemove(array, from, to) {\n var rest = array.slice((to || from) + 1 || array.length);\n array.length = from < 0 ? array.length + from : from;\n return array.push.apply(array, rest);\n }", "title": "" }, { "docid": "d0541cd5a8016af980d191ca1aecae19", "score": "0.58452046", "text": "function getNewIndices ( length, methodName, args ) {\n\tvar newIndices = [];\n\n\tvar spliceArguments = getSpliceEquivalent( length, methodName, args );\n\n\tif ( !spliceArguments ) {\n\t\treturn null; // TODO support reverse and sort?\n\t}\n\n\tvar balance = ( spliceArguments.length - 2 ) - spliceArguments[1];\n\n\tvar removeStart = Math.min( length, spliceArguments[0] );\n\tvar removeEnd = removeStart + spliceArguments[1];\n\tnewIndices.startIndex = removeStart;\n\n\tvar i;\n\tfor ( i = 0; i < removeStart; i += 1 ) {\n\t\tnewIndices.push( i );\n\t}\n\n\tfor ( ; i < removeEnd; i += 1 ) {\n\t\tnewIndices.push( -1 );\n\t}\n\n\tfor ( ; i < length; i += 1 ) {\n\t\tnewIndices.push( i + balance );\n\t}\n\n\t// there is a net shift for the rest of the array starting with index + balance\n\tif ( balance !== 0 ) {\n\t\tnewIndices.touchedFrom = spliceArguments[0];\n\t} else {\n\t\tnewIndices.touchedFrom = length;\n\t}\n\n\treturn newIndices;\n}", "title": "" }, { "docid": "38a6756605fbedce7ae59e61990021d7", "score": "0.584141", "text": "function removeAt2(arr, idx){\n var result = arr[idx]\n for(let i = idx; i < arr.length-1; i++){\n arr[i] = arr[i + 1]\n }\n arr.length--\n return result\n}", "title": "" }, { "docid": "83f0ce52bce732379cdcac72d1ec590a", "score": "0.5834175", "text": "function destroyer(arr) {\n for(var i=1; i<arguments.length; i++) {\n while(arr.indexOf(arguments[i]) !== -1)\n arr.splice(arr.indexOf(arguments[i]), 1);\n }\n return arr;\n}", "title": "" }, { "docid": "a416361b2405c1b8f96f333023d43dba", "score": "0.5833827", "text": "function arrayMove(array, from, to) {\n array.splice(to, 0, array.splice(from, 1)[0]);\n}", "title": "" }, { "docid": "1d590423fc1073109d6f5d75a8aeaebe", "score": "0.5818079", "text": "function spliceOne(list, index) {\n\t for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n\t list[i] = list[k];\n\t }\n\t\n\t list.pop();\n\t}", "title": "" }, { "docid": "b9d2ced504caa12920c8f1adcb82ccbc", "score": "0.5812826", "text": "function spliceOne(list, index) {\n\t for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n\t list[i] = list[k];\n\t }\n\n\t list.pop();\n\t}", "title": "" }, { "docid": "b9d2ced504caa12920c8f1adcb82ccbc", "score": "0.5812826", "text": "function spliceOne(list, index) {\n\t for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n\t list[i] = list[k];\n\t }\n\n\t list.pop();\n\t}", "title": "" }, { "docid": "b9d2ced504caa12920c8f1adcb82ccbc", "score": "0.5812826", "text": "function spliceOne(list, index) {\n\t for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n\t list[i] = list[k];\n\t }\n\n\t list.pop();\n\t}", "title": "" }, { "docid": "b9d2ced504caa12920c8f1adcb82ccbc", "score": "0.5812826", "text": "function spliceOne(list, index) {\n\t for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n\t list[i] = list[k];\n\t }\n\n\t list.pop();\n\t}", "title": "" }, { "docid": "bdba3a1438ff79eadb4f6045f34a0100", "score": "0.5807759", "text": "splice(start, deleteCount = this.#value.length - start, ...items) {\n if (start > this.#value.length) {\n throw new RangeError(`Out of bounds assignment: tried to assign to index ${start}, but array length was only ${this.#value.length}. Sparse arrays are not allowed. Consider using .push() instead.`);\n }\n this.#adjustIndices(start, deleteCount, items);\n const reactiveItems = makeNonPrimitiveItemsReactive(items, this);\n const deletedItems = this.#value.splice(start, deleteCount, ...reactiveItems);\n this.#dispatchUpdateEvents(start, deleteCount, reactiveItems);\n return deletedItems;\n }", "title": "" } ]
d8366bd234e50494dff41f74fe2447d6
() (5) (fmt, 5) (fmt) (true) (true, 5) (true, fmt, 5) (true, fmt)
[ { "docid": "7131a8f77525453130c96b56d47d6bfc", "score": "0.0", "text": "function listWeekdaysImpl (localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (typeof format === 'number') {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (typeof format === 'number') {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 7; i++) {\n out[i] = get(format, (i + shift) % 7, field, 'day');\n }\n return out;\n}", "title": "" } ]
[ { "docid": "b06a719b7a7a14813a8d7195259f3fac", "score": "0.54556084", "text": "function t(e){return RegExp(\"(\\\\()\"+e+\"(?=[\\\\s\\\\)])\")}// booleans and numbers", "title": "" }, { "docid": "d50e6ce2926e161957a6f3143cafb711", "score": "0.51782024", "text": "static format(groups, state) {\n if (!groups || groups.length === 0) return false;\n\n let width = 0;\n for (let i = 0; i < groups.length; ++i) {\n const group = groups[i];\n group.preFormat();\n width += group.getWidth();\n }\n\n state.left_shift += width;\n return true;\n }", "title": "" }, { "docid": "02759967fb98b1fa34661840ff7a05b6", "score": "0.5175677", "text": "function t$g(t,...n){let o=\"\";for(let r=0;r<n.length;r++)o+=t[r]+n[r];return o+=t[t.length-1],o}", "title": "" }, { "docid": "2f9a34e2af3c1d811ee7da4273644d46", "score": "0.51169324", "text": "function i(e,t){return e?t?4:3:t?3:2}", "title": "" }, { "docid": "e1fb74a55c23fb472a1ac612cbf2d731", "score": "0.5034417", "text": "function test5(a, ...b) { }", "title": "" }, { "docid": "1d6dc1eee744cded860e22cc9df94f0d", "score": "0.49953532", "text": "function show() {\n return x => x + arguments[0];\n}", "title": "" }, { "docid": "c1ff8658d6ca78a07d401de1eebac579", "score": "0.49230403", "text": "function foo() {\n print('first');\n print('second'); print('third'); print(\"fourth\");\n print('fifth'); print('sixth');\n}", "title": "" }, { "docid": "fd26393254d505f71e3441da727ed4a0", "score": "0.49097207", "text": "function tag(strings, ...values){\n if(values[0]<20){\n values[1]='awake';\n }\n console.log(values);\n console.log(strings);\n return `${strings[0]} ${values[0]} ${strings[1]} ${values[1]}`\n}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "5406d2f86de3da8705730aee93cfe31c", "score": "0.4909677", "text": "function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}", "title": "" }, { "docid": "d1f49f5515c3a6d4dd18991e80924099", "score": "0.48849726", "text": "function a(x,y,z) {\n console.log(arguments); \n console.log(x === arguments[0]);\n console.log(arguments[4]);\n console.log(arguments[7]());\n}", "title": "" }, { "docid": "2b46d9300f2e5cbd7eb0ff632b742ce7", "score": "0.48707765", "text": "0(arg) {}", "title": "" }, { "docid": "849b925de0897e55566eabda4306dc1a", "score": "0.48614407", "text": "function genTernaryExp(el){\nreturn altGen?\naltGen(el,state):\nel.once?\ngenOnce(el,state):\ngenElement(el,state);\n}", "title": "" }, { "docid": "d824a0bb263e6536a0fa9e268a23f12c", "score": "0.48575968", "text": "set format(value) {}", "title": "" }, { "docid": "749f45c1cc6a8e4de7f5ef916edf3fc9", "score": "0.48517042", "text": "function bubba(strings , ...expressions) { //bubba() will receive an array of strings and an array of exprssions which we expand using spread operator\n console.log(strings.length);\n console.log(expressions.length);\n console.log(strings); //counts two empty strings..one before expression and one after expression\n console.log(expressions); //logs ${item} value\n\n return `Thanks for playing tagged template literals ` +expressions \n}", "title": "" }, { "docid": "9a7beba03d46687274bdfffa5fe017e8", "score": "0.4850936", "text": "prettyPrintCallback( cb ) {\n // get rid of \"function gen\" and start with parenthesis\n // const shortendCB = cb.toString().slice(9)\n const cbSplit = cb.toString().split('\\n')\n const cbTrim = cbSplit.slice( 3, -2 )\n const cbTabbed = cbTrim.map( v => ' ' + v ) \n \n return cbTabbed.join('\\n')\n }", "title": "" }, { "docid": "60e046dd2d9ff4a44f04645b967aa897", "score": "0.48463467", "text": "function assert(count, name, test){\n if(!count || !Array.isArray(count) || count.length !== 2) {\n count = [0, '*'];\n } else {\n count[1]++;\n }\n\n let pass = 'false';\n let errMsg = null;\n try {\n if (test()) {\n pass = ' true';\n count[0]++;\n }\n } catch(e) {\n errMsg = e;\n }\n console.log(' ' + (count[1] + ') ').slice(0,5) + pass + ' : ' + name);\n if (errMsg !== null) {\n console.log(' ' + errMsg + '\\n');\n }\n }", "title": "" }, { "docid": "a40c8b95acdcbb79342b8cbbc0546f39", "score": "0.48395038", "text": "function barTaggedLiterals(strings,...values) {\n console.log(\"Non interpolated strings :\" + strings);\n console.log(\"Interpolated strings as values:\" + values);\n}", "title": "" }, { "docid": "31738aa2dd4990e4246efbd0b990efdd", "score": "0.48144662", "text": "function print(...value) { console.log(...value) }", "title": "" }, { "docid": "393b3011ac0c88ee571716a62e3e29f5", "score": "0.4804459", "text": "function tag(strings, ...values) {\n\tconsole.log(strings); // [ 'It\\'s ', 'I\\'m sleepy' ]\n\tconsole.log(values); // [ 15 ]\n\n\tif (values[0] < 20) {\n\t\tvalues[1] = 'awake';\n\t}\n\treturn `${strings[0]}${values[0]}${strings[1]}${values[1]}`;\n\n}", "title": "" }, { "docid": "f9ff7b7ca0d0f02e7b28c52002eba701", "score": "0.47943684", "text": "function Prelude__Monad__TParsec__Result___64_Prelude__Monad__Monad_36_Result_32_e_58__33__62__62__61__58_0($_0_arg, $_1_arg, $_2_arg, $_3_arg, $_4_arg){\n \n if(($_3_arg.type === 0)) {\n return $_3_arg;\n } else if(($_3_arg.type === 1)) {\n return $_3_arg;\n } else {\n return $_4_arg($_3_arg.$1);\n }\n}", "title": "" }, { "docid": "13ad4412270232b7995002c031f806b4", "score": "0.47812366", "text": "parseCallish(node) {\n this.expect(types.parenL);\n node.arguments = this.parseCallExpressionArguments(types.parenR, false);\n return true;\n }", "title": "" }, { "docid": "20a53612c8ee2d35739a7d3ffda6c6c0", "score": "0.47714782", "text": "function ex04_6() {\n // comment here\n const value1 = true;\n const value2 = 4 > 2;\n\n // (or), finds the first trutlhy values\n console.log(` 1. or = ${value1 || value2 || check()}`);\n\n // (or), finds the first falsy values\n console.log(` 2. and = ${value1 && value2 && check()}`);\n\n // often used to compress long if-statement\n // nullableObject && nullableObject.something\n\n // if nullableObject != null) {\n // nullableObject.something;\n // }\n\n\n function check() {\n for (let i = 0; i < 5; i++) {\n // wasting time\n console.log('😱');\n }\n return true;\n }\n\n // ! (not) ... reverse value\n console.log(!value1);\n}", "title": "" }, { "docid": "554c955c6949593d73d09a203fb90234", "score": "0.47668275", "text": "function Prelude__Applicative__Control__Monad__State___64_Prelude__Applicative__Applicative_36_StateT_32_stateType_32_f_58__33__60__42__62__58_0($_0_arg, $_1_arg, $_2_arg, $_3_arg, $_4_arg, $_5_arg, $_6_arg, $_7_st){\n \n return $_4_arg.$2(null)(null)($_5_arg($_7_st))($partial_2_3$Prelude__Applicative___123_Control__Monad__State___64_Prelude__Applicative__Applicative_36_StateT_32_stateType_32_f_58__33__60__42__62__58_0_95_lam_95_5277_125_($_4_arg, $_6_arg));\n}", "title": "" }, { "docid": "2ab3c881b349de1258ac15536aeb8921", "score": "0.4760862", "text": "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "title": "" }, { "docid": "2ab3c881b349de1258ac15536aeb8921", "score": "0.4760862", "text": "function genTernaryExp(el){return altGen?altGen(el,state):el.once?genOnce(el,state):genElement(el,state);}", "title": "" }, { "docid": "f230f7291406ca117b7f4d146a83193d", "score": "0.4760718", "text": "function parse(strings, ...values) {\n console.log(strings);\n console.log(values);\n\n if (values[0] > 20) {\n strings[1] = \"and I am awake\";\n }\n return `${strings[0]} ${values[0]} ${strings[1]} ${values[1]} ${strings[2]}`\n}", "title": "" }, { "docid": "f9e091145857a0e0cd4ff40bb7b55a44", "score": "0.47588122", "text": "function f21({x}) { { function x() { return 2 } } return x; }", "title": "" }, { "docid": "4ab1a0ba7518ea2e3fb13c283a386d95", "score": "0.47586042", "text": "function Prelude__Applicative__Control__Monad__State___64_Prelude__Applicative__Applicative_36_StateT_32_stateType_32_f_58__33__60__42__62__58_0($_0_arg, $_1_arg, $_2_arg, $_3_arg, $_4_arg, $_5_arg, $_6_arg, $_7_st){\n \n return $_4_arg.$2(null)(null)($_5_arg($_7_st))($partial_2_3$Prelude__Applicative___123_Control__Monad__State___64_Prelude__Applicative__Applicative_36_StateT_32_stateType_32_f_58__33__60__42__62__58_0_95_lam_95_5974_125_($_4_arg, $_6_arg));\n}", "title": "" }, { "docid": "62ebc04b06fa76972d7593648c9ba1f5", "score": "0.47404155", "text": "function Prelude__Applicative__Control__Monad__State___64_Prelude__Applicative__Applicative_36_StateT_32_stateType_32_f_58__33__60__42__62__58_0($_0_arg, $_1_arg, $_2_arg, $_3_arg, $_4_arg, $_5_arg, $_6_arg, $_7_st){\n \n return $_4_arg.$2(null)(null)($_5_arg($_7_st))($partial_2_3$Prelude__Applicative___123_Control__Monad__State___64_Prelude__Applicative__Applicative_36_StateT_32_stateType_32_f_58__33__60__42__62__58_0_95_lam_95_6118_125_($_4_arg, $_6_arg));\n}", "title": "" }, { "docid": "84323b4f4bc3b77d15866fa9d4414737", "score": "0.47339046", "text": "function tb(a, b) {\n var d, e;\n if (1 === b.length && c(b[0]) && (b = b[0]), !b.length) return sb();\n for (d = b[0], e = 1; e < b.length; ++e) b[e].isValid() && !b[e][a](d) || (d = b[e]);\n return d\n }", "title": "" }, { "docid": "45db583bf4f1170aaaa45729fa184897", "score": "0.47190854", "text": "function displayAT(t)\n{ if(!(t instanceof Array))\n { write(t);\n }\n else if(t.length == 2)\n { write('(');displayAT(t[0]);write(', ');displayAT(t[1]);write(')');\n }\n else alert('***ERROR: displayAT given an array of length '+t.length);\n}", "title": "" }, { "docid": "9106e02e0d37ea85294cae1de4cf1f50", "score": "0.47075406", "text": "function FORMAT_FUNCTION_IN(time, funcName, args){ return \"[\" + time + \"] >> \" + funcName + \"(\"+args+\")\"; }// params: timestamp string, function name, function arguments", "title": "" }, { "docid": "b14b87f1ed6e376e606a9636c9c66fd6", "score": "0.46901512", "text": "function sum5(a) {\n let sumx = (b) => sum(a+b);\n sumx.toString = () => a;\n return sumx;\n}", "title": "" }, { "docid": "b0101cdc22a45c38a9af7449996c7d07", "score": "0.4672559", "text": "function ejemplo(x,y) {\n ((a,b) => {\n console.log( arguments );\n })();\n}", "title": "" }, { "docid": "6a6383e7268cbd4818c3de368610452c", "score": "0.46699223", "text": "function addTogether() {\n //checks for extra parenthesis\n let arg1 = arguments[0];\n let arg2 = arguments[1]; \n let oneArg = arguments.length <= 1;\n let validNum1 = Number.isInteger(arguments[0]);\n // checks if argument 1 is valid or not, all calls are supplied with at least one argument\n if(!validNum1){\n return console.log(undefined);\n }\n //executed if more than one argument is supplied\n if (!oneArg) {\n //checks if any of arguments is not a number\n if (Number.isInteger(arg1) === false || Number.isInteger(arg2) === false) { \n return console.log(undefined); \n //check if both arguments are valid numbers \n } else if (Number.isInteger(arg1) === true && Number.isInteger(arg2) === true) {\n return console.log(arg1 + arg2);\n }\n }\n //executed if one or less arguments supplied\n return function (arg) {\n return Number.isInteger(arg) === false ? console.log(undefined) : console.log(arg + arg1);\n }\n\n}", "title": "" }, { "docid": "5aa51db2756050eab61ab319955fb6c6", "score": "0.46682388", "text": "function validSequence1(braces) {\n // Write code here\n let count = 0;\n for (let i = 0; i < braces.length; i++) {\n braces[i] === \"(\" ? count++ : count--;\n if (count < 0) {\n return false;\n }\n }\n return count === 0;\n}", "title": "" }, { "docid": "1df70812df3e9ef9ce557dbf367eebf3", "score": "0.4665503", "text": "function saySomethingTrue(fn) {\n console.log(\"it is true that: \", fn());\n\n}", "title": "" }, { "docid": "10abc8f365d69cff46399a87e40e7073", "score": "0.46642044", "text": "function fourth() {\n console.log(\"#\")\n console.log(\"##\");\n console.log(\"###\");\n console.log(\"####\");\n console.log(\"#####\");\n console.log(\"######\");\n console.log(\"#######\");\n}", "title": "" }, { "docid": "f2e18548be11a01f3d7689102d6e7c36", "score": "0.466229", "text": "function TStylingTupleSummary() { }", "title": "" }, { "docid": "4858d523348785be963854c9adf0d2df", "score": "0.4661804", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += firstLast6(true, false);\n document.getElementById(\"output\").innerHTML += has23(true, false);\n document.getElementById(\"output\").innerHTML += fix_23(true, false);\n document.getElementById(\"output\").innerHTML += countYZ(true, false);\n document.getElementById(\"output\").innerHTML += endOther(true, false);\n document.getElementById(\"output\").innerHTML += starOut(true, false);\n document.getElementById(\"output\").innerHTML += getSandwich(true, false);\n document.getElementById(\"output\").innerHTML += canBalance(true, false);\n document.getElementById(\"output\").innerHTML += countClumps(true, false);\n document.getElementById(\"output\").innerHTML += evenlySpaced(true, false);\n}", "title": "" }, { "docid": "6a3006edbf25b1c5e6700eb013955687", "score": "0.4648819", "text": "function isFive(input) {\n\n}", "title": "" }, { "docid": "9d78c98a95695248a9a3adff7411d238", "score": "0.4647496", "text": "init() {\n return `(${this.operand()} ${this.operator()} ${this.operand()})`;\n }", "title": "" }, { "docid": "bae55950fe56836f15444c18a1981b79", "score": "0.46456394", "text": "function wt(t,e){return null===t||!1===t||void 0===t?C[e]:(\"number\"===typeof t&&(t=String(t)),t=r.format.from(t),t=_.toStepping(t),!1===t||isNaN(t)?C[e]:t)}", "title": "" }, { "docid": "94fd4267de2f4d6abb31c1980afb9c13", "score": "0.4643547", "text": "function gr(e,t){0}", "title": "" }, { "docid": "7123a8fbc807fee1df7000df12efa09f", "score": "0.46420416", "text": "function parensValid(){\n\n}", "title": "" }, { "docid": "fded890cd958583ff4619b08a4be726e", "score": "0.46380296", "text": "function regularBracketSequence1(sequence) {\n\n var balance = 0;\n for (var i = 0; i < sequence.length; i++) {\n if (sequence[i] === '(') {\n balance++;\n }\n else {\n balance--;\n }\n if (balance < 0) {\n return false;\n }\n }\n if (balance) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "9ba94de3bb28871ce90e50d5eab41bcf", "score": "0.46350193", "text": "function g(){return u()&&(T||D.length>0)}", "title": "" }, { "docid": "7c19cc82e6e30f3be2b38fb3c04fab3c", "score": "0.4629283", "text": "function funct(...args) {\n return \"args \" + args\n}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.46287015", "text": "function n(e,t){0}", "title": "" }, { "docid": "d11216371d427a7dc09eda9d6a2c47db", "score": "0.46274078", "text": "compound () {\n return this.beat.ternary()\n }", "title": "" }, { "docid": "8b0a84280dd7c6ab4a1e344b2e843c96", "score": "0.46218586", "text": "function printState() {\n for (var r = 0; r < 4; ++r) {\n var str = \"\";\n var ri = r*4;\n for (var c = 0; c < 4; ++c) {\n var value = state[ri + c];\n if (value < 10) {\n str += \" \";\n }\n str += \" \" + state[ri + c];\n }\n print(str);\n }\n }", "title": "" } ]
264552cfee501531a5f73d54d4d1b271
find the method or method name by looking at the appropriate attributes and domData
[ { "docid": "6042d127cd4403bb3d991be5bfa9ccce", "score": "0.66498864", "text": "function findMethod(originalElement, root, eventName) {\n var method, owner, parentAttribute, contextElement,\n attr = \"data-\" + eventName,\n key = prefix + eventName,\n keyParent = prefixParent + eventName,\n attrParent = \"data-\" + eventName + \"-parent\";\n\n while (!method && originalElement && originalElement !== root) {\n if (originalElement.nodeType === 1 && !originalElement.disabled) {\n if (parentAttribute) {\n method = ko.utils.domData.get(originalElement, keyParent);\n if (method) {\n method = parentAttribute === \"true\" ? method : method[parentAttribute];\n owner = ko.dataFor(originalElement);\n }\n }\n else {\n method = (originalElement.getAttribute(attr) || ko.utils.domData.get(originalElement, key));\n if (!method) {\n // set a flag that indicates that we need to find a method on the appropriate parent\n parentAttribute = originalElement.getAttribute(attrParent);\n if (parentAttribute) {\n // we need this element later to pass the appropriate data\n contextElement = originalElement;\n }\n }\n }\n }\n\n if (!method) {\n originalElement = originalElement.parentNode;\n }\n }\n\n if (method) {\n return {\n method: method,\n element: contextElement || originalElement,\n owner: owner\n };\n }\n }", "title": "" } ]
[ { "docid": "3ced4eab032c2f35b25aaec2e67d26db", "score": "0.56455636", "text": "function findMethodFromParent(callback, originalElement, root, eventName) {\n var attr = \"data-\" + eventName + \"-parent\";\n\n // locate the element containing the data-<eventName>-parent attribute\n while (originalElement && originalElement.nodeType === 1 && !originalElement.disabled && !originalElement.hasAttribute(attr)) {\n originalElement = originalElement !== root ? originalElement.parentNode : null;\n }\n\n if (!originalElement){\n return;\n }\n\n var methodName = originalElement.getAttribute(attr),\n method = methodName === \"true\" ? callback : callback[methodName];\n\n if (method && (typeof method === \"function\")) {\n return {\n method: method,\n element: originalElement,\n owner: ko.dataFor(root)\n };\n }\n }", "title": "" }, { "docid": "98ab9bffa574efd924a5a048f509ec0a", "score": "0.5597755", "text": "getAttribute(name){return this.attributes[name];}", "title": "" }, { "docid": "4e3cb4afad580d7007fd3e7a1b716c9f", "score": "0.55205864", "text": "function getMethodName(exp) {\n if (exp.ref.type === 'var') {\n return exp.ref.name;\n }\n if (exp.ref.type !== 'ref') {\n return '';\n }\n return getPropName(exp.ref);\n}", "title": "" }, { "docid": "4e3cb4afad580d7007fd3e7a1b716c9f", "score": "0.55205864", "text": "function getMethodName(exp) {\n if (exp.ref.type === 'var') {\n return exp.ref.name;\n }\n if (exp.ref.type !== 'ref') {\n return '';\n }\n return getPropName(exp.ref);\n}", "title": "" }, { "docid": "40b80dcbb067fa516c1925d093e42723", "score": "0.5362275", "text": "function iDOMMethod(method, _ref) {\n var opts = _ref.opts;\n var file = _ref.file;\n\n var prefix = opts.prefix || \"\";\n if (prefix) {\n return (0, _toReference2.default)(prefix + \".\" + method);\n }\n\n var binding = file.scope.getBinding(method);\n if (binding) {\n return binding.identifier;\n }\n\n return (0, _toReference2.default)(method);\n }", "title": "" }, { "docid": "4165fda44ddfa443b73dbc5397fb6e9a", "score": "0.53361475", "text": "get method(){\n return this._getRawDataItem('method');\n }", "title": "" }, { "docid": "7bc70849d15aabd38b242e77696c91f8", "score": "0.5221892", "text": "function getName(elem){return elem.name;}", "title": "" }, { "docid": "a437083e960f2efb4f0a34d0629786bc", "score": "0.5202611", "text": "function decideMethodName( base, model, name ) {\n let methodName;\n if (base[ name ])\n methodName = name;\n else {\n const mapped = model.$methodMap[ name ];\n if (mapped)\n methodName = mapped;\n }\n if (!methodName)\n throw new Error( 'Invalid method: ' + name );\n\n return methodName;\n}", "title": "" }, { "docid": "02acee007b33696a617b73eb025ffdab", "score": "0.5181067", "text": "function swithname(attr) {\r\n if (attr == \"cost\") {\r\n return \"area\";\r\n } else if (attr == \"area\") {\r\n return \"cost\";\r\n }\r\n}", "title": "" }, { "docid": "9ac95cfce8bb9daf44f9da2a2db723bd", "score": "0.5129831", "text": "function getOverloadedMethodName (\n methodName, \n rowData\n) {\n var moduleId = getModuleId (methodName);\n var result = methodName;\n \n if (moduleId != null && DEPLOYMENT_METHODS[moduleId].methods[methodName] !== undefined) {\n var module = DEPLOYMENT_METHODS[moduleId];\n var method = module.methods[methodName];\n \n if (method.overloadTest !== undefined) {\n result = method.overloadTest (rowData);\n } else if (method.overloadedMethodName !== undefined) {\n result = method.overloadedMethodName;\n }\n }\n \n return result;\n}", "title": "" }, { "docid": "8548f037a624004aa581fcb8f340fa2d", "score": "0.5083605", "text": "function findSelectorAndAttributes(start, template, state, name, extensiable) {\r\n let selector = '', \r\n attributeName = '',\r\n attributeValue = '',\r\n attributes = [],\r\n listeners = [],\r\n statesInAttributes = [],\r\n quotesCounter = 0,\r\n braceCounter = 0,\r\n nameComplete = false,\r\n valueComplete = false,\r\n selectorComplete = false,\r\n wasGap = false,\r\n i = start\r\n\r\n for (;; i++) {\r\n const char = template[i]\r\n if (char === '>' || char === '/') {\r\n if (attributeName) attributes.push([attributeName, true])\r\n\r\n return [{\r\n selector,\r\n attributes,\r\n listeners,\r\n statesInAttributes,\r\n children: selectorIsEmpty(selector) ? [] : [''] \r\n }, char === '>' ? i + 1 : i + 2]\r\n }\r\n \r\n if (!selectorComplete) {\r\n if (char === ' ') selectorComplete = true\r\n else selector += char\r\n } else if (!nameComplete) {\r\n if (char === '=') {\r\n nameComplete = true\r\n } else if (!charIsGapOrLineBreak(char)) {\r\n if (wasGap) {\r\n if (!charIsQuotes(char)) {\r\n attributes.push([attributeName, true])\r\n nameComplete = false\r\n attributeName = char\r\n } else {\r\n nameComplete = true\r\n }\r\n wasGap = false\r\n } else {\r\n attributeName += char\r\n }\r\n } else if (attributeName.length) {\r\n wasGap = true\r\n }\r\n } else if (!valueComplete) {\r\n if (charIsQuotes(char)) {\r\n if (++quotesCounter === 2) {\r\n if (~attributeName.indexOf('*')) {\r\n setFrameworkMethod(attributeName.slice(1), attributeValue, listeners, attributes)\r\n } else {\r\n attributes.push([attributeName, attributeValue])\r\n }\r\n attributeName = attributeValue = ''\r\n nameComplete = valueComplete = false\r\n quotesCounter = 0\r\n }\r\n } else if (charIsBrace(char)) {\r\n if (++braceCounter === 2) {\r\n const isFrameworkMethod = ~attributeName.indexOf('*')\r\n const foundState = findState(0, attributeValue + char, state, name, extensiable, isFrameworkMethod ? attributeName.slice(1) : attributeName)\r\n\r\n if (isFrameworkMethod) {\r\n setFrameworkMethod(attributeName.slice(1), foundState.text, listeners, attributes, foundState.state, foundState.key)\r\n } else {\r\n attributes.push([attributeName, foundState.text])\r\n }\r\n \r\n statesInAttributes.push(foundState.link)\r\n attributeName = attributeValue = ''\r\n nameComplete = valueComplete = false\r\n braceCounter = 0\r\n }\r\n\r\n } else {\r\n if (attributeValue.length || !charIsGapOrLineBreak(char)) attributeValue += char\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "5cb9799d1ff0117cd1e61706887fcb4a", "score": "0.50773686", "text": "function _getDataRule(el, method) {\n var fn = trim(attr(el, DATA_RULE + '-' + method));\n\n if (fn && (fn = new Function('return ' + fn)())) {\n return _getRule(fn);\n }\n }", "title": "" }, { "docid": "f957c979f1b74efe282c8a2a0703b59f", "score": "0.5060634", "text": "function get_name (element) {\n return element.getAttribute('name');\n}", "title": "" }, { "docid": "5cc70c83312d54bf35ed7e0433dee7de", "score": "0.50542057", "text": "function getCustomMethod(){\n\t\t\n\t\t\tvar method = self.action;\n\n\t\t\t_.each(self.drilldowns, function(drilldown){\n\t\t\t\tmethod = method + self.ucfirst(drilldown);\n\t\t\t});\n\t\t\tmethod = method + self.ucfirst(self.metric);\n\t\t\n\t\t\treturn method;\n\t\n\t\t}", "title": "" }, { "docid": "45ddbc713e28bc0c0e7f1f1969aaaa30", "score": "0.50520706", "text": "function processAttr(container,attr){\n\n var exprName = attr === 'id' ? 'idlocation' : attr + 'expr'; //the conditional is for send/@id vs. send/@idlocation. all others are just attr + 'expr'\n\n if(container[exprName]){\n var fnName = generateAttributeExpression(container, exprName);\n return generateFnCall(fnName);\n }else if(container[attr]){\n return JSON.stringify(container[attr]);\n }else{\n return null;\n }\n }", "title": "" }, { "docid": "ee3eeb47a37f93b61cb93cd88afefa06", "score": "0.5048231", "text": "static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:\"string\"==typeof n?n:\"string\"==typeof e?e.toLowerCase():void 0}", "title": "" }, { "docid": "1be1124ce7492643d0a23fe67f94f3be", "score": "0.5030765", "text": "function iAtt(tag,name) {\n return( \n tag.getAttribute( name ) ||\n tag.getAttribute( name.toUpperCase() ) ||\n tag.getAttribute( name.toLowerCase() )) ;\n }", "title": "" }, { "docid": "08cc25a7c6398d7bf84bb75f067a09bb", "score": "0.50263053", "text": "function domGetAttribute(node, name) {\n return node.getAttribute(name);\n}", "title": "" }, { "docid": "91993669d5c11b12133484b52fe7c36e", "score": "0.49718332", "text": "function getFunctionName(fn){try{if(!fn||typeof fn!=='function'){return defaultFunctionName;}return fn.name||defaultFunctionName;}catch(e){// Just accessing custom props in some Selenium environments\n// can cause a \"Permission denied\" exception (see raven-js#495).\nreturn defaultFunctionName;}}", "title": "" }, { "docid": "aae4449d091bc580d2125296f0e5e9af", "score": "0.49526215", "text": "operateAttribute(eventLabel, attr, attrValue, isData = false) {\n const finalAttr = isData ? `data-${attr}` : attr;\n const finalAttrValueParam = attrValue !== undefined ? `, '${attrValue}'` : '';\n if (eventLabel === 'set' || eventLabel === 'remove') {\n this.helpForEach((el, _index) => {\n eval(`el.${eventLabel}Attribute('${finalAttr}'${finalAttrValueParam})`);\n });\n return this;\n }\n else if (eventLabel === 'get') {\n return eval(`this.getFirstEl()?.${eventLabel}Attribute('${finalAttr}'${finalAttrValueParam})`);\n }\n else {\n console.log('error in operateAttribute');\n }\n }", "title": "" }, { "docid": "c0d5dd689d35a7e6a682f41f2045d1d8", "score": "0.49476197", "text": "function getElemName(tag)\n{\n return demicm.elemDic[tag];\n}", "title": "" }, { "docid": "6a0609f9c1245264407ed17d37519b13", "score": "0.49289006", "text": "getMethodName(action, possession) {\n return action.toLowerCase()\n + possession.charAt(0).toUpperCase()\n + possession.slice(1).toLowerCase();\n }", "title": "" }, { "docid": "2e9dcdea7090299d93b1d15b08a0292f", "score": "0.49285138", "text": "attributeChanged (name, type) {\n console.log(`${this.localName} + '#' + ${this.id} + ' attribute ' + ${name} + ' was changed to ' + ${this.getAttribute(name)}`);\n }", "title": "" }, { "docid": "f0dc1baeacb07ec0ec1dbfc84fb0626d", "score": "0.49223205", "text": "get name() {\n\t\treturn this.hasAttribute('name') ? this.attributes['name'].value : null;\n\t}", "title": "" }, { "docid": "305ddbeb05a598f733207ff094286881", "score": "0.49015105", "text": "function getAttrStr(xmlData,startIndex,lineNum){\n for (var i = startIndex; i < xmlData.length && xmlData[i] !== \">\"; i++);\n if(xmlData[i] === \">\"){\n var attrStr = xmlData.substring(startIndex,i);\n //attrStr = attrStr.trim();\n if(attrStr.length > 4){ //a=\"\"\n var attrs = getListOfAttrsName([],attrStr,attrsRegx1,startIndex,lineNum);\n attrs = getListOfAttrsName(attrs,attrStr,attrsRegx2,startIndex,lineNum);\n\n var matches = getAllMatches(attrStr,attrNamesRegx);\n for (i = 0; i < matches.length; i++) {\n var attrName = matches[i][1].trim();\n if(!attrs[attrName])\n throw new InvalidXmlException(\"Invalid arguments at \" + lineNum +\":\"+ startIndex);\n }\n }\n return attrStr;\n }else{\n throw new InvalidXmlException(\"Not closing tag at \" + lineNum +\":\"+ startIndex);\n }\n \n}", "title": "" }, { "docid": "4f11675b9a3ad9e3763e68d249f30b93", "score": "0.4883924", "text": "function getAttr(tag,attrname){if(tag.hasAttribute()){\t\treturn tag.getAttribute(attrname);}\treturn false;}", "title": "" }, { "docid": "55d3808113ae98e5d34fecdd021ae18a", "score": "0.48725972", "text": "getAttribute(name) {\n return this._attribs[name];\n }", "title": "" }, { "docid": "0edaab4122e493a195ff412ffde5227e", "score": "0.48652783", "text": "function getAttribute(node, attrName) {\n attrName = attrName.toLowerCase();\n return node && node.open.attributes.find((attr) => attr.name.value.toLowerCase() === attrName);\n}", "title": "" }, { "docid": "6e6eb2a8b700a998fc25df487b7f2496", "score": "0.4861416", "text": "function nameInsideElement (d) {\n return d.nameInsideElement;\n }", "title": "" }, { "docid": "faeaa67f765eb030d8561195563daf8f", "score": "0.4854458", "text": "_method(method) {\n return `<input type=\"hidden\" name=\"_method\" value=\"${method.toUpperCase()}\">`;\n }", "title": "" }, { "docid": "3b12429c3c383f3e5cdbca46e3c5abfc", "score": "0.48299927", "text": "function getMethodSignature(languageSignature, methodDescriptor)\n{\n var methodInfo = \"\";\n var methodCall = \"\";\n var throwsCall = \"\";\n var argumentsString=\"\";\n var exceptionsString = \"\";\n var bConstructor = false;\n var bPublic = false;\n\n if(languageSignature && methodDescriptor)\n {\n // get the method template\n for (var i=0 ; i < methodDescriptor.attributes.length; i++)\n {\n if (methodDescriptor.attributes[i].name == \"constructor\")\n {\n if (methodDescriptor.attributes[i].value == \"true\")\n {\n bConstructor = true;\n }\n else\n {\n bConstructor = false;\n }\n }\n else if (methodDescriptor.attributes[i].name == \"public\")\n {\n if (methodDescriptor.attributes[i].value == \"true\")\n {\n bPublic = true;\n }\n } \n }\n\n // we are only interested in showing public methods...\n if(bPublic == false)\n return methodInfo;\n \n methodCall = getMethodTemplate(languageSignature, bConstructor);\n // get the throwsSignature\n throwsCall = languageSignature.Throws;\n\n // get info about the method template\n var signatureInfo = getMethodSignatureInfo(methodCall);\n\n // replace $$METHODNAME token with the type\n var methodNamePattern = /\\$\\$METHODNAME/g;\n var methodName = methodDescriptor.name;\n methodCall = methodCall.replace(methodNamePattern, methodName);\n\n // iterate through child nodes\n if(methodDescriptor.hasChildNodes())\n {\n for(var i = 0;i < methodDescriptor.childNodes.length; i++)\n {\n if(methodDescriptor.childNodes[i].tagName == \"RETURNTYPE\")\n {\n if(signatureInfo.hasReturn)\n {\n // replace $$RETURNTYPE token with the type\n var returnTypePattern = /\\$\\$RETURNTYPE/g;\n var returnType = getTypeSignature(languageSignature, methodDescriptor.childNodes[i].childNodes[0]);\n methodCall = methodCall.replace(returnTypePattern, returnType);\n }\n }\n else if (methodDescriptor.childNodes[i].tagName == \"ARGUMENTS\")\n {\n if(signatureInfo.hasArgs)\n {\n var argNodes = methodDescriptor.childNodes[i].childNodes;\n for(var j = 0; j < argNodes.length; j++)\n {\n var argNode = argNodes[j];\n if(argNode.hasChildNodes())\n {\n var argsType = getTypeSignature(languageSignature, argNode.childNodes[0]);\n if (argumentsString.length)\n {\n argumentsString += signatureInfo.argSeparator;\n }\n argumentsString += argsType;\n }\n var argAttrLen = argNode.attributes.length;\n for (var k=0 ; k < argAttrLen; k++)\n {\n if (argNode.attributes[k].name == \"name\")\n {\n argumentsString += \" \";\n argumentsString += argNode.attributes[k].value;\n break;\n }\n }\n }\n }\n }\n else if (methodDescriptor.childNodes[i].tagName == \"EXCEPTIONS\")\n {\n if(signatureInfo.hasExceptions)\n {\n var exceptionNodes = methodDescriptor.childNodes[i].childNodes;\n for(var j = 0; j < exceptionNodes.length; j++)\n {\n var exceptionType = exceptionNodes[j].name;\n if (exceptionsString && exceptionsString.length)\n {\n exceptionsString += signatureInfo.exceptionSeparator;\n }\n exceptionsString+= exceptionType;\n }\n }\n }\n }\n\n if(signatureInfo.hasArgs)\n {\n // replace $$ARGUMENT tokens\n var firstArgIndex = methodCall.indexOf(\"$$ARGUMENT\");\n var lastArgIndex = methodCall.lastIndexOf(\"$$ARGUMENT\");\n if(argumentsString && argumentsString.length)\n {\n var tempstr = methodCall.substring(0,firstArgIndex);\n tempstr += argumentsString;\n tempstr += methodCall.substring(lastArgIndex + 10, methodCall.length);\n methodCall = tempstr;\n }\n else\n {\n var tempstr = methodCall.substring(0,firstArgIndex);\n tempstr += methodCall.substring(lastArgIndex + 10, methodCall.length);\n methodCall = tempstr;\n }\n }\n\n if(signatureInfo.hasExceptions)\n {\n // replace $$EXCEPTION tokens\n var firstExceptionIndex = methodCall.indexOf(\"$$EXCEPTION\");\n var lastExceptionIndex = methodCall.lastIndexOf(\"$$EXCEPTION\");\n if(exceptionsString && exceptionsString.length)\n {\n var tempstr = methodCall.substring(0,firstExceptionIndex);\n tempstr += exceptionsString;\n tempstr += methodCall.substring(lastExceptionIndex + 11, methodCall.length);\n methodCall = tempstr;\n var throwPattern = /\\$\\$THROWS/g;\n methodCall = methodCall.replace(throwPattern, throwsCall);\n }\n else\n {\n var tempstr = methodCall.substring(0, firstExceptionIndex - 1);\n tempstr += methodCall.substring(lastExceptionIndex + 11, methodCall.length);\n methodCall = tempstr;\n // replace $$THROWS token with the type\n var throwPattern = / \\$\\$THROWS/g;\n methodCall = methodCall.replace(throwPattern, \"\");\n }\n }\n }\n else\n {\n // replace $$ARGUMENT tokens\n if(signatureInfo.hasArgs)\n {\n var firstArgIndex = methodCall.indexOf(\"$$ARGUMENT\");\n var lastArgIndex = methodCall.lastIndexOf(\"$$ARGUMENT\");\n var tempstr = methodCall.substring(0,firstArgIndex);\n tempstr += methodCall.substring(lastArgIndex + 10, methodCall.length);\n methodCall = tempstr;\n }\n\n if(signatureInfo.hasExceptions)\n {\n // replace $$EXCEPTION tokens\n var firstExceptionIndex = methodCall.indexOf(\"$$EXCEPTION\");\n var lastExceptionIndex = methodCall.lastIndexOf(\"$$EXCEPTION\");\n var tempstr = methodCall.substring(0, firstExceptionIndex - 1);\n tempstr += methodCall.substring(lastExceptionIndex + 11, methodCall.length);\n methodCall = tempstr;\n // replace $$THROWS token with the type\n var throwPattern = / \\$\\$THROWS/g;\n methodCall = methodCall.replace(throwPattern, \"\");\n //return methodCall;\n }\n }\n }\n\n if(bPublic)\n methodInfo = \"public \";\n methodInfo += methodCall; \n return methodInfo;\n}", "title": "" }, { "docid": "d3ce9cd4ee9dd4ee0721578e6fbc06fd", "score": "0.48291364", "text": "resolveAttribute(name,callback){this.__symbol.resolveAttribute(name,data=>{TcHmi.Callback.callSafeEx(callback,this,data)})}", "title": "" }, { "docid": "03018c68bc7ea24512e5e02e541aadae", "score": "0.48236343", "text": "function getMethod( name ) {\n const methods = _methods.get( this );\n return methods.get( name );\n}", "title": "" }, { "docid": "4af8745828df81625c38046c5bec0aa5", "score": "0.4822587", "text": "function getRestMethodDirectActivity(method)\n{\n return method.nextSibling;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.48222136", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.48222136", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8631665908e84a56486a431335dd462b", "score": "0.4814659", "text": "function callMethod() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var method = args[0];\n var cmp = args[1]; // Remove first argument event name\n\n args.shift(); //console.warn(cmp.tag, method, cmp.props)\n\n var directivesKeyValue = extractDirectivesFromProps(cmp);\n\n var _defined = function _defined(key) {\n var keyArgumentsValues = [];\n var keyArguments = {};\n var originKey = key;\n\n if (key.indexOf('-') !== -1) {\n keyArgumentsValues = key.split('-');\n key = keyArgumentsValues[0];\n keyArgumentsValues.shift();\n }\n\n var directiveObj = data.directives[key]; //console.log(method, directiveObj)\n //if (directiveObj)\n //console.warn(method, directiveObj[method])\n\n if (directiveObj && typeof directiveObj[method] === 'function') {\n // Clone args object\n var outArgs = Object.assign([], args); // Add directive value\n\n outArgs.push(directivesKeyValue[originKey]);\n\n var _defined3 = function _defined3(keyArg, i) {\n return keyArguments[keyArg] = keyArgumentsValues[i];\n };\n\n var _defined4 = directiveObj._keyArguments;\n\n for (var _i4 = 0; _i4 <= _defined4.length - 1; _i4++) {\n _defined3(_defined4[_i4], _i4, _defined4);\n }\n\n outArgs.push(keyArguments);\n directiveObj[method].apply(directiveObj, outArgs);\n }\n };\n\n var _defined2 = Object.keys(directivesKeyValue);\n\n for (var _i2 = 0; _i2 <= _defined2.length - 1; _i2++) {\n _defined(_defined2[_i2], _i2, _defined2);\n }\n}", "title": "" }, { "docid": "b8982947188ce6d629b6ff4a04d5867c", "score": "0.48137274", "text": "function callMethod() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var method = args[0];\n var cmp = args[1];\n\n // Remove first argument event name\n args.shift();\n //console.warn(cmp.tag, method, cmp.props)\n\n var directivesKeyValue = extractDirectivesFromProps(cmp);\n\n var _defined = function _defined(key) {\n\n var keyArgumentsValues = [];\n var keyArguments = {};\n var originKey = key;\n\n if (key.indexOf('-') !== -1) {\n keyArgumentsValues = key.split('-');\n key = keyArgumentsValues[0];\n keyArgumentsValues.shift();\n }\n\n var directiveObj = data.directives[key];\n //console.log(method, directiveObj)\n //if (directiveObj)\n //console.warn(method, directiveObj[method])\n if (directiveObj && typeof directiveObj[method] === 'function') {\n // Clone args object\n var outArgs = Object.assign([], args);\n // Add directive value\n outArgs.push(directivesKeyValue[originKey]);\n\n var _defined3 = function _defined3(keyArg, i) {\n return keyArguments[keyArg] = keyArgumentsValues[i];\n };\n\n var _defined4 = directiveObj._keyArguments;\n\n for (var _i4 = 0; _i4 <= _defined4.length - 1; _i4++) {\n _defined3(_defined4[_i4], _i4, _defined4);\n }\n\n outArgs.push(keyArguments);\n directiveObj[method].apply(directiveObj, outArgs);\n }\n };\n\n var _defined2 = Object.keys(directivesKeyValue);\n\n for (var _i2 = 0; _i2 <= _defined2.length - 1; _i2++) {\n _defined(_defined2[_i2], _i2, _defined2);\n }\n}", "title": "" }, { "docid": "a49b8575a09c5dd2f04c4f1730fc1e8c", "score": "0.4806746", "text": "function applyMethodToTarget(method) {\n\t\tvar $target = $('#' + method + '-target');\n\t\t$target[method](widget_html);\n\t\t$target.parent().data('method', method);\n\t}", "title": "" }, { "docid": "bbeaded061e543289acddd85fda12dcb", "score": "0.48020056", "text": "function identify() {\n\treturn this.name.toUpperCase();\n}", "title": "" }, { "docid": "91507334832c432b22c0eb2598343548", "score": "0.4795839", "text": "function elementPath(clickedElement,numParents,currentNode){\r\nvar attrString = \"\";\r\n for(i=0;i<=numParents;i++){\r\n \t \r\n \t//if (currentNode.attr(\"id\") != \"\"){\r\n //\t attrString = \"#\" + attrTrimSplitter(currentNode.attr(\"id\")) + \" \" + attrString;\r\n \t//}\r\n \tif (currentNode.attr(\"class\") != \"\"){\r\n \tattrString = \".\" + attrTrimSplitter(currentNode.attr(\"class\")) + \" \" + attrString;\r\n \t}\r\n\tif((currentNode.get(0).tagName == \"P\") || (currentNode.get(0).tagName == \"H1\") || \r\n\t(currentNode.get(0).tagName == \"H2\")|| (currentNode.get(0).tagName == \"H3\")|| (currentNode.get(0).tagName == \"EM\") ||\r\n\t(currentNode.get(0).tagName == \"SPAN\")){\r\n \t\tattrString = attrTrimSplitter(currentNode.get(0).tagName) + \" \" + attrString; \r\n\t\tattrString.stopPropagation; \r\n\t}\r\n currentNode = currentNode.parent();\r\n }\t\r\n\treturn attrString;\r\n}", "title": "" }, { "docid": "00f433266d50e375020bfd80c7660146", "score": "0.47893372", "text": "function find(attr,successCB,errorCB)\n {\n var rpc = webinos.rpcHandler.createRPC(this, \"find\", [ attr ]);\n //RPCservicename,\n // function\n webinos.rpcHandler.executeRPC(rpc, function(params)\n {\n successCB(params);\n }, function(error)\n {\n if (typeof(errorCB) !== 'undefined')\n errorCB(error);\n });\n }", "title": "" }, { "docid": "de0faef3dad6ed6794f20c574a2d3142", "score": "0.4777872", "text": "function getData(node, name) {\n\t var id = node[exp], store = id && data[id]\n\t if (name === undefined) return store || setData(node)\n\t else {\n\t if (store) {\n\t if (name in store) return store[name]\n\t var camelName = camelize(name)\n\t if (camelName in store) return store[camelName]\n\t }\n\t return dataAttr.call($(node), name)\n\t }\n\t }", "title": "" }, { "docid": "de0faef3dad6ed6794f20c574a2d3142", "score": "0.4777872", "text": "function getData(node, name) {\n\t var id = node[exp], store = id && data[id]\n\t if (name === undefined) return store || setData(node)\n\t else {\n\t if (store) {\n\t if (name in store) return store[name]\n\t var camelName = camelize(name)\n\t if (camelName in store) return store[camelName]\n\t }\n\t return dataAttr.call($(node), name)\n\t }\n\t }", "title": "" }, { "docid": "6db7225c5833559830483571a6f9ea8f", "score": "0.47704124", "text": "getMethodSignature(name) {\n return this.contract._jsonInterface.find((f) => (f.name == name ) ).signature;\n }", "title": "" }, { "docid": "46958f58cad833265658c17c337e0020", "score": "0.4753844", "text": "function fn_selector( func, elem, i, match ) {\n var a = match[3] || jq_elemUrlAttr()[ ( elem.nodeName || '' ).toLowerCase() ] || '';\n \n return a ? !!func( elem.getAttribute( a ) ) : FALSE;\n }", "title": "" }, { "docid": "205260b9fd50d6e9e04517109eceb6cf", "score": "0.4748564", "text": "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ? undefined : typeof attribute === 'string' ? attribute : typeof name === 'string' ? name.toLowerCase() : undefined;\n }", "title": "" }, { "docid": "3cdaa439a89a12bc19a36acaf8295cf9", "score": "0.4745934", "text": "static newPropName() {\n return DATA.HTMLAttributes.indexOf(name.toLowerCase()) === -1\n }", "title": "" }, { "docid": "52fd69871da62ce65fd9e674f3b4a9a6", "score": "0.4744512", "text": "findByName(name) {\r\n return this.find(`[name=\"${FormNode.namable(name)}\"]`);\r\n }", "title": "" }, { "docid": "3ef8e03a6ecd4880cbb979a0db5cb1f2", "score": "0.4737232", "text": "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ? undefined : typeof attribute === 'string' ? attribute : typeof name === 'string' ? name.toLowerCase() : undefined;\n }", "title": "" }, { "docid": "3ef8e03a6ecd4880cbb979a0db5cb1f2", "score": "0.4737232", "text": "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ? undefined : typeof attribute === 'string' ? attribute : typeof name === 'string' ? name.toLowerCase() : undefined;\n }", "title": "" }, { "docid": "724a7d3f5eb8e1277c8fc86f9a9e8300", "score": "0.47250137", "text": "function attrGetter(type, name) {\nreturn Object.getOwnPropertyDescriptor(type.$$.prototype, name).get;\n}", "title": "" }, { "docid": "af58b82cae5859ea587568eab418af37", "score": "0.471878", "text": "function event_getterEventHandlerIDLAttribute(thisObj, name) {\n /**\n * 1. Let eventTarget be the result of determining the target of an event\n * handler given this object and name.\n * 2. If eventTarget is null, then return null.\n * 3. Return the result of getting the current value of the event handler\n * given eventTarget and name.\n */\n var eventTarget = event_determineTheTargetOfAnEventHandler(thisObj, name);\n if (eventTarget === null)\n return null;\n return event_getTheCurrentValueOfAnEventHandler(eventTarget, name);\n}", "title": "" }, { "docid": "9b9e9185185cf57a15d31dc9a07d7804", "score": "0.47162837", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "100631531d1f278310ac760b95f43128", "score": "0.47103506", "text": "function getAttr(e) {\n if (e.target.getAttribute('data') !== null) {\n setPath(e.target.getAttribute('data'));\n }\n }", "title": "" }, { "docid": "d86bb95618885049a4b3ebae9dd9506c", "score": "0.47069454", "text": "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }", "title": "" }, { "docid": "d86bb95618885049a4b3ebae9dd9506c", "score": "0.47069454", "text": "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }", "title": "" }, { "docid": "d86bb95618885049a4b3ebae9dd9506c", "score": "0.47069454", "text": "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }", "title": "" }, { "docid": "8c5af5b95d2b4c549fefce3a5ee962f1", "score": "0.47040394", "text": "function getData(node,name)\n {\n var id = node[exp],store = id && data[id]\n if(name === undefined) return store || setData(node)\n else\n {\n if(store)\n {\n if(name in store) return store[name]\n var camelName = camelize(name)\n if(camelName in store) return store[camelName]\n }\n return dataAttr.call($(node),name)\n }\n }", "title": "" }, { "docid": "50a0f1c559a98bee398626a477e4acbc", "score": "0.47007617", "text": "function getData(node, name) {\n var id = node[exp], store = id && data[id]\n if (name === undefined) return store || setData(node)\n else {\n if (store) {\n if (name in store) return store[name]\n var camelName = camelize(name)\n if (camelName in store) return store[camelName]\n }\n return dataAttr.call($(node), name)\n }\n }", "title": "" }, { "docid": "bd1e2951e016a9084603edf96022a9ec", "score": "0.46924198", "text": "function getData(node, name) {\n var id = node[exp],\n store = id && data[id];\n if (name === undefined) return store || setData(node);else {\n if (store) {\n if (name in store) return store[name];\n var camelName = camelize(name);\n if (camelName in store) return store[camelName];\n }\n return dataAttr.call($(node), name);\n }\n }", "title": "" }, { "docid": "246ff29396f7fa791556163b591207b2", "score": "0.46868312", "text": "runLifeCycleMethod(name, dom) {\n this[name] && this[name](dom)\n }", "title": "" }, { "docid": "76dbcc59841a3596c054e688556610d3", "score": "0.46818775", "text": "function extractPropertyFromGetterOrSetter(method, jsdocAnn, document) {\n // TODO(43081j): remove this when static properties are supported\n if (babel.isClassMethod(method) && method.static) {\n return null;\n }\n if (method.kind !== 'get' && method.kind !== 'set') {\n return null;\n }\n // TODO(43081j): use getPropertyName, see\n // https://github.com/Polymer/polymer-analyzer/pull/867\n const name = getPropertyName(method);\n if (name === undefined) {\n return null;\n }\n let type;\n let description;\n let privacy = 'public';\n let readOnly = false;\n if (jsdocAnn) {\n const ret = getReturnFromAnnotation(jsdocAnn);\n type = ret ? ret.type : undefined;\n description = jsdoc.getDescription(jsdocAnn);\n privacy = getOrInferPrivacy(name, jsdocAnn);\n readOnly = jsdoc.hasTag(jsdocAnn, 'readonly');\n }\n return {\n name,\n astNode: { language: 'js', node: method, containingDocument: document },\n type,\n jsdoc: jsdocAnn,\n sourceRange: document.sourceRangeForNode(method),\n description,\n privacy,\n warnings: [],\n readOnly,\n };\n}", "title": "" }, { "docid": "7e475a01e270643a69db8466968187ef", "score": "0.46689993", "text": "function parseMethodName(parts, argsNames) {\r\n /**\r\n * argsName could be in different case from that\r\n * of function's name.\r\n */\r\n const argsNamesLower = argsNames.map(arg => arg.toLowerCase())\r\n /**\r\n * Suppresses HTTP method if exists\r\n */\r\n if(keysMethods.indexOf(parts[0].toLowerCase()) >= 0)\r\n parts = parts.slice(1)\r\n /**\r\n * Converts each method part into route path \r\n */\r\n return parts.reduce((prev, curr) => {\r\n if(keywordsMaps[curr]) prev += keywordsMaps[curr] \r\n else {\r\n if(prev.slice(-1) != '/') prev += '/'\r\n const index = argsNamesLower.indexOf(curr.toLowerCase())\r\n if(index >= 0) {\r\n prev += ':'\r\n prev += argsNames[index] // Preserve argument Case\r\n } else {\r\n prev += curr\r\n }\r\n }\r\n return prev\r\n }, '')\r\n}", "title": "" }, { "docid": "b708cf0992f2cf32d5b12e0cebbad5ed", "score": "0.4661701", "text": "function printattr(raph,fulltext) {\n\t\tvar i;\n\t\tvar ret=\"\";\n\t\tif (raph.name == \"invoke\"){\n\t\t\tfor ( i= 0, ii = raph.attributesList.length; i < ii; i++)\n\t\t\t\tif (raph.attributesList[i].attributeName == \"servicename\")\n\t\t\t\t\tbreak;\n\t\t\tif (i != raph.attributesList.length){\n\t\t\t\tret = raph.attributesList[i].attributeValue;\n\t\t\t\tif((ret.length > widthofrect/rectfontwidth) && !fulltext){\n\t\t\t\t\tret = \"\\n\"+ret[0]+ret[1]+ret[2]+\"...\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (raph.name == \"case\" ){\n\t\t\tfor ( i = 0, ii = raph.attributesList.length; i < ii; i++)\n\t\t\t\tif (raph.attributesList[i].attributeName == \"condition\")\n\t\t\t\t\tbreak;\n\t\t\tif (i != raph.attributesList.length){\n\t\t\t\tret = raph.attributesList[i].attributeValue;\n\t\t\t\tif((ret.length > widthofrect/rectfontwidth) && !fulltext){\n\t\t\t\t\tret = \"\\n\"+ret[0]+ret[1]+ret[2]+\"...\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tret = \"\\n\"+ret;\n\t\t}\n\t\telse if (raph.name == \"while\" ){\n\t\t\tfor ( i = 0, ii = raph.attributesList.length; i < ii; i++)\n\t\t\t\tif (raph.attributesList[i].attributeName == \"condition\")\n\t\t\t\t\tbreak;\n\t\t\tif (i != raph.attributesList.length){\n\t\t\t\tret = raph.attributesList[i].attributeValue;\n\t\t\t\tif((ret.length > widthofrect/rectfontwidth) && !fulltext){\n\t\t\t\t\tret = raph.name;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tret = \"\\n\"+ret;\n\t\t}\n\t\telse if (raph.name ==\"reply\"){\n\t\t\tfor ( i = 0, ii = raph.attributesList.length; i < ii; i++)\n\t\t\t\tif (raph.attributesList[i].attributeName == \"name\")\n\t\t\t\t\tbreak;\n\t\t\tif (i != raph.attributesList.length){\n\t\t\t\tret = raph.attributesList[i].attributeValue;\n\t\t\t\tif((ret.length > widthofrect/ellipsefontwidth) && !fulltext){\n\t\t\t\t\tret = \"\\n\"+ret[0]+ret[1]+ret[2]+\"...\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tret = \"\\n\"+ret;\n\t\t\t}\n\t\t\treturn \"Reply\"+ret;\n\t\t}\n\t\telse \n\t\t\treturn raph.name;\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "e568842e65ed63bec7cec94ed729fcec", "score": "0.4649011", "text": "function getName(method) {\n return _.upperFirst(_.camelCase(method.tags[0].replace(/(-rest)?-controller/, \"\")));\n}", "title": "" }, { "docid": "0224d0051f9902f9e3b7a1ae8974778f", "score": "0.4638771", "text": "function getName(data) {\n console.log(\"function with parameter: \",data);\n }", "title": "" }, { "docid": "6a3c3d7f8f2ad84aa38596ec7359f58b", "score": "0.4638505", "text": "_testMethodsContent() {\n const endpoints = this.__getAmfEndpointPaths();\n if (!endpoints || !endpoints.length) {\n return;\n }\n const ns = amfHelper.ns;\n for (let i = 0; i < endpoints.length; i++) {\n const path = endpoints[i];\n const operations = this.__getAmfMethodForPath(path);\n const methods = this.__getRamlMethodForPath(path);\n if (!(operations && operations.length) && !(methods && methods.length)) {\n continue;\n }\n if (!operations || !operations.length) {\n let msg = `RAML ${path} has methods but AMF `;\n msg += `operations are undefined`;\n this.reportError(new Error(msg));\n continue;\n }\n if (!methods || !methods.length) {\n let msg = `AMF ${path} has operations but RAML `;\n msg += `methods are undefined`;\n this.reportError(new Error(msg));\n continue;\n }\n for (let i = 0, len = operations.length; i < len; i++) {\n const operation = operations[i];\n const methodName = amfHelper.getValue(operation,\n ns.w3.hydra.core + 'method');\n const method = endpointsHelper.findMethodByName(methodName, methods);\n if (!method) {\n let msg = `AMF ${path} has method ${methodName} `;\n msg += `which is undefined in RAML model`;\n this.reportError(new Error(msg));\n continue;\n }\n this._compareMethods(path, operation, method);\n }\n }\n }", "title": "" }, { "docid": "6238b9e28494cdb0c5beb7d27e58e3f8", "score": "0.46312886", "text": "function findColumnDefinitionForName(nodedata, attrname) {\n var columns = nodedata.columnDefinitions;\n for (var i = 0; i < columns.length; i++) {\n if (columns[i].attr === attrname) return columns[i];\n }\n return null;\n}", "title": "" }, { "docid": "76728f1247c5d47ebaff2c1d0237435d", "score": "0.46250358", "text": "function attrParser(attrName) {\n var fn, controllerScope = Object.prototype.toString.call($parse(attrName)(scope)),\n controllerAsScope = Object.prototype.toString.call($parse(attrName)(scope.$parent));\n\n if ((controllerScope === \"[object Function]\") || (controllerScope === \"[object Object]\")) {\n fn = $parse(attrName)(scope);\n } else if ((controllerAsScope === \"[object Function]\") || (controllerAsScope === \"[object\" +\n \" Object]\")) {\n fn = $parse(attrName)(scope.$parent);\n }\n return fn;\n }", "title": "" }, { "docid": "786e5eb801d023e21f2c0a96d5e55b84", "score": "0.4624803", "text": "_click(e) {\n e.preventDefault();\n const type = this.cel.getAttribute('data-type');\n\n this[type]();\n }", "title": "" }, { "docid": "18a8f1464bf9b0672d3c69514f2ac884", "score": "0.46207795", "text": "function searchEl(dataName) {\n return master_container + ' [data-search=\"' + dataName + '\"]';\n }", "title": "" }, { "docid": "e18df1348b4c63aef7bcfb323c22c61a", "score": "0.4620685", "text": "function getAttribute([node], attrName) {\n if (!node) { return undefined; }\n return node.attributes[attrName];\n}", "title": "" }, { "docid": "70961b73c42d181a52d354ca1ec3246f", "score": "0.46155784", "text": "handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n if (prefix === '.') {\n const committer = new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"PropertyCommitter\"](element, name.slice(1), strings);\n return committer.parts;\n }\n if (prefix === '@') {\n return [new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"EventPart\"](element, name.slice(1), options.eventContext)];\n }\n if (prefix === '?') {\n return [new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"BooleanAttributePart\"](element, name.slice(1), strings)];\n }\n const committer = new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"AttributeCommitter\"](element, name, strings);\n return committer.parts;\n }", "title": "" }, { "docid": "70961b73c42d181a52d354ca1ec3246f", "score": "0.46155784", "text": "handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n if (prefix === '.') {\n const committer = new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"PropertyCommitter\"](element, name.slice(1), strings);\n return committer.parts;\n }\n if (prefix === '@') {\n return [new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"EventPart\"](element, name.slice(1), options.eventContext)];\n }\n if (prefix === '?') {\n return [new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"BooleanAttributePart\"](element, name.slice(1), strings)];\n }\n const committer = new _parts_js__WEBPACK_IMPORTED_MODULE_0__[\"AttributeCommitter\"](element, name, strings);\n return committer.parts;\n }", "title": "" }, { "docid": "3f7216418dc77129be1b666e5bc25618", "score": "0.4610004", "text": "function determineSelectorMethod() {\n\t\t// compatiable selector engines in order of CSS3 support\n\t\tvar selectorEngines = {\n\t\t\t\"NW\" : \"*.Dom.select\",\n\t\t\t\"DOMAssistant\" : \"*.$\", \n\t\t\t\"Prototype\" : \"$$\",\n\t\t\t\"YAHOO\" : \"*.util.Selector.query\",\n\t\t\t\"MooTools\" : \"$$\",\n\t\t\t\"Sizzle\" : \"*\", \n\t\t\t\"jQuery\" : \"*\",\n\t\t\t\"dojo\" : \"*.query\"\n\t\t}, method;\n\t\t\n\t\tforEach(selectorEngines, function (engine, value) {\n\t\t\tif (win[engine] && !method && (method = eval(value.replace(\"*\", engine)))) {\n\t\t\t\tENGINE = engine;\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn method;\n\t}", "title": "" }, { "docid": "cbc6c136de4d3e7d3a419db1439abcc7", "score": "0.46038166", "text": "static __attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }", "title": "" }, { "docid": "0d5147f33cff8e207d0b14b57dd5ef0f", "score": "0.45985183", "text": "function getDataElementByName(dataElementName) {\n var returnedDataElement = null;\n $localStorage.dataSetDataElements.forEach(function (dataElement) {\n if (dataElement.name.toLowerCase() == dataElementName.toLowerCase()) {\n returnedDataElement = dataElement;\n }\n });\n return returnedDataElement;\n }", "title": "" }, { "docid": "3f5576d825f8850089a19974371c2e96", "score": "0.45912904", "text": "static resolveAttribute(expression,name,callback){let s=new Symbol(expression);s.resolveAttribute(name,data=>{TcHmi.Callback.callSafeEx(callback,this,data),s.destroy(),s=null})}", "title": "" }, { "docid": "f8899798cce3904dc73d69678fb9efa5", "score": "0.45869818", "text": "_detectNameOfExposedMethod(perimeter, method) {\n if (isPerimeter(perimeter)) {\n return find((perimeter.expose || []), (m) => perimeter[m] === method);\n }\n\n throw new Error(\n 'German governess can only be used within sandbox.'\n );\n }", "title": "" }, { "docid": "629673ea15ecbe7ea57f76126d5dbdc6", "score": "0.45797026", "text": "function makeAttrEventHandler(method, containerElem) {\n\t\treturn function(e) {\n\t\t\t// build request\n\t\t\trequest = extractRequest(e.currentTarget, containerElem);\n\t\t\trequest.method = method;\n\n\t\t\t// move the params into the body if not a GET\n\t\t\t// (extractRequest would have used the wrong method to judge this)\n\t\t\tif (/GET/i.test(method) === false && !request.body) {\n\t\t\t\trequest.body = request.query;\n\t\t\t\tdelete request.query;\n\t\t\t}\n\n\t\t\t// dispatch request event\n\t\t\tif (request) {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tdispatchRequestEvent(e.target, request);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "7169b980b16f39dd60d1ba0243553882", "score": "0.45732036", "text": "function method(){\n click ++;//button click counter\n var input = $(this).text();//get text value from button or method clicked\n $('#method').append(input);//add method symbol to dom\n $('span').toggleClass(\"input\");//toggle class on span so second set of numbers in different span\n\n if (click === 2) {\n $('#total').text('ERROR: only one operation allowed!');//error if clicked more than once\n $('span').toggleClass(\"input\");//toggle class on span so second set of numbers in different span\n click=0;\n } else if ($(this).data('name')==='add'){\n calcMethod = 'add';\n } else if ($(this).data('name')==='subtract'){\n calcMethod = 'subtract';\n } else if ($(this).data('name')==='multiply'){\n calcMethod = 'multiply';\n } else {\n calcMethod = 'divide';\n }\nreturn calcMethod;//return math opertor method to use in calcFunc\n}", "title": "" }, { "docid": "6728aef5606d9607170bbeecc7427e4f", "score": "0.45714328", "text": "function walkAttributes(html, fn) {\n\t var m,\n\t re = /([-\\w]+) ?= ?(?:\"([^\"]*)|'([^']*)|({[^}]*}))/g\n\n\t while ((m = re.exec(html))) {\n\t fn(m[1].toLowerCase(), m[2] || m[3] || m[4])\n\t }\n\t}", "title": "" }, { "docid": "eb7857495c8b0c2c30e9278af605bce8", "score": "0.4570874", "text": "getAttribute(name) {\n return this.root.getAttribute(name);\n }", "title": "" }, { "docid": "eb7857495c8b0c2c30e9278af605bce8", "score": "0.4570874", "text": "getAttribute(name) {\n return this.root.getAttribute(name);\n }", "title": "" }, { "docid": "987983b9e6bd4a5ac7efc54b2381da06", "score": "0.45706135", "text": "handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n if (prefix === '.') {\n const committer = new __WEBPACK_IMPORTED_MODULE_0__parts_js__[\"f\" /* PropertyCommitter */](element, name.slice(1), strings);\n return committer.parts;\n }\n if (prefix === '@') {\n return [new __WEBPACK_IMPORTED_MODULE_0__parts_js__[\"d\" /* EventPart */](element, name.slice(1), options.eventContext)];\n }\n if (prefix === '?') {\n return [new __WEBPACK_IMPORTED_MODULE_0__parts_js__[\"c\" /* BooleanAttributePart */](element, name.slice(1), strings)];\n }\n const committer = new __WEBPACK_IMPORTED_MODULE_0__parts_js__[\"a\" /* AttributeCommitter */](element, name, strings);\n return committer.parts;\n }", "title": "" }, { "docid": "1f43a2206d749a31660baa35332bbb73", "score": "0.45579517", "text": "function callMethod() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var method = args.shift();\n var oKeys = data.directivesKeys; // Object.keys(data.directives);\n\n var callback; // Search for a possible callback\n\n for (var i = 0; i < args.length; i++) {\n if (typeof args[i] === 'function') {\n callback = args[i];\n break;\n }\n }\n\n for (var _i = 0; _i < oKeys.length; _i++) {\n var key = oKeys[_i];\n\n if (data.directives[key]\n /*!== undefined*/\n ) {\n //if (typeof data.directives[key][method] === 'function') {\n if (data.directives[key][method]\n /*!== undefined*/\n ) {\n //console.log(method)\n var res = data.directives[key][method].apply(data.directives[key], args); // If res returns something, fire the callback\n\n if (res !== undefined && callback) callback(res);\n }\n }\n }\n}", "title": "" }, { "docid": "9eb6f10f1c635f69c197bd00831784ce", "score": "0.45548794", "text": "function toScannedMethod(node, sourceRange, document) {\n const parsedJsdoc = jsdoc.parseJsdoc(getAttachedComment(node) || '');\n const description = parsedJsdoc.description.trim();\n const maybeName = objectKeyToString(node.key);\n const warnings = [];\n if (!maybeName) {\n warnings.push(new model_1.Warning({\n code: 'unknown-method-name',\n message: `Could not determine name of method from expression of type: ` +\n `${node.key.type}`,\n sourceRange: sourceRange,\n severity: model_1.Severity.INFO,\n parsedDocument: document\n }));\n }\n let type = closureType(node.value, sourceRange, document);\n const typeTag = jsdoc.getTag(parsedJsdoc, 'type');\n if (typeTag) {\n type = doctrine.type.stringify(typeTag.type) || type;\n }\n if (type instanceof model_1.Warning) {\n warnings.push(type);\n type = 'Function';\n }\n const name = maybeName || '';\n const scannedMethod = {\n name,\n type,\n description,\n sourceRange,\n warnings,\n astNode: node,\n jsdoc: parsedJsdoc,\n privacy: getOrInferPrivacy(name, parsedJsdoc)\n };\n const value = node.value;\n if (value.type === 'FunctionExpression' ||\n value.type === 'ArrowFunctionExpression') {\n const paramTags = new Map();\n if (scannedMethod.jsdoc) {\n for (const tag of (scannedMethod.jsdoc.tags || [])) {\n if (tag.title === 'param' && tag.name) {\n paramTags.set(tag.name, tag);\n }\n else if (tag.title === 'return' || tag.title === 'returns') {\n scannedMethod.return = {};\n if (tag.type) {\n scannedMethod.return.type = doctrine.type.stringify(tag.type);\n }\n if (tag.description) {\n scannedMethod.return.desc = tag.description;\n }\n }\n }\n }\n scannedMethod.params = (value.params || []).map((nodeParam) => {\n let name;\n let defaultValue;\n let rest;\n if (nodeParam.type === 'Identifier') {\n // Basic parameter: method(param)\n name = nodeParam.name;\n }\n else if (nodeParam.type === 'RestElement' &&\n nodeParam.argument.type === 'Identifier') {\n // Rest parameter: method(...param)\n name = nodeParam.argument.name;\n rest = true;\n }\n else if (nodeParam.type === 'AssignmentPattern' &&\n nodeParam.left.type === 'Identifier' &&\n nodeParam.right.type === 'Literal') {\n // Parameter with a default: method(param = \"default\")\n name = nodeParam.left.name;\n defaultValue = escodegen.generate(nodeParam.right);\n }\n else {\n // Some AST pattern we don't recognize. Hope the code generator does\n // something reasonable.\n name = escodegen.generate(nodeParam);\n }\n let type;\n let description;\n const tag = paramTags.get(name);\n if (tag) {\n if (tag.type) {\n type = doctrine.type.stringify(tag.type);\n }\n if (tag.description) {\n description = tag.description;\n }\n }\n const param = { name, type, defaultValue, rest, description };\n return param;\n });\n }\n return scannedMethod;\n}", "title": "" }, { "docid": "92f3de08a53fe68d1cd215b79c29243e", "score": "0.45524484", "text": "function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n }\n catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}", "title": "" }, { "docid": "92f3de08a53fe68d1cd215b79c29243e", "score": "0.45524484", "text": "function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n }\n catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}", "title": "" }, { "docid": "92f3de08a53fe68d1cd215b79c29243e", "score": "0.45524484", "text": "function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n }\n catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}", "title": "" }, { "docid": "92f3de08a53fe68d1cd215b79c29243e", "score": "0.45524484", "text": "function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n }\n catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}", "title": "" }, { "docid": "92f3de08a53fe68d1cd215b79c29243e", "score": "0.45524484", "text": "function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n }\n catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}", "title": "" }, { "docid": "8fef6d0b7c3daeb1e650d7fff1c8a42c", "score": "0.45480517", "text": "isReflectMethod(methodName) {\n return (methodName === \"reflectJSValue\") && (this.clsName == \"com.javapoly.Main\");\n }", "title": "" }, { "docid": "2dcf1139608aa9c5831325fc5e898914", "score": "0.45426446", "text": "get name() {\n return this.attrs.name;\n }", "title": "" }, { "docid": "567018c70c286acdf4c8a1f03ca0742f", "score": "0.45400566", "text": "function _buildJsonRpcRequestMethod(data) {\n var method = data instanceof Array && typeof data[0] === 'string' ? data[0].toUpperCase() : undefined;\n transmission.method = method;\n return method;\n }", "title": "" }, { "docid": "5198e5b67d22a4c30f3877cee49672c9", "score": "0.45231345", "text": "function updateMethodCallFont(methodName){\n var impl_id = \"#method-impl-\" + methodName + \"-id\";\n var call_id = \"#method-call-\" + methodName + \"-id\";\n if(!$(impl_id).is(\":block\")){\n $(call_id).css(\"color\", \"yellow\");\n }\n}", "title": "" }, { "docid": "a50b924a3358242a3837bad8a5427f7d", "score": "0.45203206", "text": "getAttribute(attr) {\n return this.customAttributes[attr];\n }", "title": "" }, { "docid": "a5d2a6881b6fd47acd6056624bffb7fe", "score": "0.4518664", "text": "[[\n `CallExpression[callee.object.callee.name=expect][callee.property.name=toHaveAttribute][arguments.0.type=/Literal/][arguments.1.callee.object.name=expect][arguments.1.callee.property.name=stringContaining]`,\n `CallExpression[callee.object.callee.name=expect][callee.property.name=toHaveProperty][arguments.0.type=/Literal/][arguments.1.callee.object.name=expect][arguments.1.callee.property.name=stringContaining]`,\n ].join(\",\")](node) {\n const matcher = node.callee.property;\n const [classArg, classValue] = node.arguments;\n const classValueArg = classValue.arguments[0];\n\n const classNameValue = context\n .getSourceCode()\n .getText(classArg)\n .slice(1, -1);\n if (\n (matcher.name === \"toHaveAttribute\" && classNameValue !== \"class\") ||\n (matcher.name === \"toHaveProperty\" && classNameValue !== \"className\")\n ) {\n return;\n }\n\n const { isDTLQuery } = getQueryNodeFrom(\n context,\n node.callee.object.arguments[0]\n );\n if (!isDTLQuery) return;\n\n context.report({\n node: matcher,\n messageId,\n fix(fixer) {\n return [\n fixer.replaceText(matcher, \"toHaveClass\"),\n fixer.replaceText(\n classArg,\n context.getSourceCode().getText(classValueArg)\n ),\n fixer.removeRange([classArg.range[1], classValue.range[1]]),\n ];\n },\n });\n }", "title": "" }, { "docid": "a6856fd3204edb60f805b33041f192bd", "score": "0.45168006", "text": "function getAttribute(source, name) {\n if (!source) return undefined;\n if (!source.attr(name)) return undefined;\n return source.attr(name);\n }", "title": "" } ]
22420a5b9ecc9f47a8e66553fb24332f
| | Works only one time once page refresh |
[ { "docid": "31f7435734e139ab6bb07874c5a3c72c", "score": "0.0", "text": "async componentDidMount() {\n const { match } = this.props;\n const productId = match && match.params && match.params.id ? match.params.id : 1\n const requestUrl = apiDomain + productDetailMethod;\n const store_id = localStorage.getItem(\"storeId\");\n const product_id = productId;\n const inputData = {\n mod: \"GET_DETAIL\",\n data_arr: {\n store_id,\n product_id\n },\n };\n this.setState({ loading: true });\n let productInfo;\n const { data } = await postApi(requestUrl, inputData);\n if (data && data.data && data.data.success) {\n productInfo = await this.constructApiData(data.data);\n this.constructApiData(data);\n } else {\n // alert(error);\n const response = sampleApi.data;\n productInfo = await this.constructApiData(response);\n }\n this.setState({ productInfo });\n}", "title": "" } ]
[ { "docid": "aca11f1823854e7f92d529e5e44348b1", "score": "0.67201006", "text": "function startover() {\n location.reload();\n}", "title": "" }, { "docid": "41f2fe3309cdb8db0698dfb15090585c", "score": "0.66152513", "text": "function refresh() {\n return;\n }", "title": "" }, { "docid": "5fdfdd61398de2cb6ad7ca6ba6acef3a", "score": "0.6591743", "text": "function firstPage() {\n location.reload()\n}", "title": "" }, { "docid": "273b89d1e4fe3d936a2357e8ddee2a38", "score": "0.65804785", "text": "function reSet() {\n location.reload();\n}", "title": "" }, { "docid": "7bd496840cd770711b6a23492adf2243", "score": "0.6557998", "text": "function refreshPage() {\n if(refresh){\n setRefresh(false);\n }else{\n setRefresh(true);\n }\n }", "title": "" }, { "docid": "45db702427f7ff6c4a50334e8da2d675", "score": "0.6549404", "text": "function refresh() {\n refreshPending = true;\n}", "title": "" }, { "docid": "7b4a42a625619623dbf7a703ec975014", "score": "0.6534421", "text": "function onReset() {\n\t\twindow.location.reload()\n\t}", "title": "" }, { "docid": "1c4f9e7d3ef854099ce28dbefadfc5c3", "score": "0.6457732", "text": "function refresh() {\n\t\t\t\t\tlocation.reload(true);\n\t\t\t\t}", "title": "" }, { "docid": "a51e8a9483646cbb3f6cf7547a165623", "score": "0.6421842", "text": "onUpdated() {\n\t\tconsole.log('updated');\n\t\tlocation.reload();\n\t}", "title": "" }, { "docid": "8108670de87ce42b0d55b2d2b2ba9a48", "score": "0.64141464", "text": "function reInitialize() {\n\t\tdocument.location.reload();\n\t}", "title": "" }, { "docid": "7576a82e1990c49f0bb47f3a6d8495f4", "score": "0.63943106", "text": "function suicide(){\n location.reload(); // refresh page\n }", "title": "" }, { "docid": "bc9cb82e44d622f90742c34b1a2292f4", "score": "0.6380074", "text": "function reLoad() {\n\tlocation.reload();\n}", "title": "" }, { "docid": "4cc88470c02465ed99bd68b5cd5d3e7b", "score": "0.6361553", "text": "async onAfterRefresh() { }", "title": "" }, { "docid": "01df763c6ec82f4e78fdbd3e5c9f7cfe", "score": "0.6317014", "text": "async onBeforeRefresh() { }", "title": "" }, { "docid": "3c9a1f3dfff866069b4ac26841b9439f", "score": "0.6299159", "text": "function runClear() {\n location.reload();\n}", "title": "" }, { "docid": "02c1225ddf8c8014f47c4ca3851c67ac", "score": "0.6266854", "text": "function refreshPage() {\n onChangeBody(\"\");\n onChangeTitle(\"\");\n setLoaded({ loaded: false });\n keyID = newPostKey();\n photoUploaded = false;\n }", "title": "" }, { "docid": "5faa19a3048445b02392993de03e4b60", "score": "0.62091666", "text": "function reloadme(){\n\t\tlocation.reload(true);\n\t}", "title": "" }, { "docid": "89f26fa73a9aae1baf4ca312f88a2daf", "score": "0.620492", "text": "function refresh() {}", "title": "" }, { "docid": "a4e8e6fa9ec7bf71a91a298287424403", "score": "0.6175545", "text": "function pageHashChanged(){\n\t\t\t\t\tif(location.hash === '#home-view' || location.hash === '#statistics-view'){\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "b4707b8f673e9c53ab218bbec10ef5f2", "score": "0.6131716", "text": "function refreshPage()\n\t{\n\t\tvar c = fgetCookie(\"friendster_reload\");\n\t\tvar bool=false;\n\t\tvar loc = window.location.href;\n\t\t\n\t\tif(c) \n\t\t\tbool = c.indexOf(loc)==-1; //if we haven't just reloaded\n\t\telse\n\t\t\tbool=true; //if no cookie reload\n\t\t\t\t\t\t\t\n\t\tif (bool)\n\t\t{\n\t\t\tvar expires = new Date();\n\t\t\texpires.setTime(expires.getTime() + 5000); //expire this cookie in 5 seconds.\n\t\t\tfsetCookie(\"friendster_reload\",null,window.location,expires,null,null);\n\t\t\twindow.location.reload();\n\t\t}\n\t}", "title": "" }, { "docid": "25cfcca5029ec5993bd2e035b311479d", "score": "0.61304474", "text": "function startOver() {\n location.reload();\n }", "title": "" }, { "docid": "fe468e26cf9b171ba4d2960130e1352b", "score": "0.61266613", "text": "function explode(){\n\n location.reload();\n}", "title": "" }, { "docid": "e8950820153d34963ba45841e64e6cba", "score": "0.6119838", "text": "function viderPanier() {\n localStorage.clear();\n location.reload();\n}", "title": "" }, { "docid": "4d97268270b943277b34f4af057168f7", "score": "0.61167675", "text": "function refPage(){\n\tlocation.reload(true);\n}", "title": "" }, { "docid": "3aa66473423115c9d01d0b080c97e3b6", "score": "0.61148834", "text": "function inactivityDetected() {\n location.reload();\n}", "title": "" }, { "docid": "63f662467fc6e1770c5e6ac1b59f7eb8", "score": "0.6114077", "text": "function reinicio() {\n\tlocation.reload()\n}", "title": "" }, { "docid": "1cd6917d764c8acf64bc4a84c0dac9a2", "score": "0.6110361", "text": "function startAgain() {\n clearStorage();\n window.location.reload();\n}", "title": "" }, { "docid": "ebef97d645b85128610f84ad23314fc2", "score": "0.60865813", "text": "function lazyReload() {\n clearInterval(reloadInterval);\n reloadInterval = setInterval(() => {\n if (document.hasFocus()) {\n window.location.reload();\n }\n }, 100);\n}", "title": "" }, { "docid": "a80f4e132562a2b59ac50cecf4cd8298", "score": "0.60727656", "text": "function saveBrowserState() {\n switchUrl($location.path() + '?updated=' + (new Date()).getTime());\n }", "title": "" }, { "docid": "4ee463c4b968f13c64223a3d69643117", "score": "0.60712445", "text": "function init() {\n location.reload();\n}", "title": "" }, { "docid": "bd4d321a764261d8d14860509df312ca", "score": "0.605237", "text": "_onRefresh() {\n this.checkAndLoad();\n }", "title": "" }, { "docid": "e864669c1f6b9084244d97154919fd7f", "score": "0.60455805", "text": "function recharge() {\n window.location.reload();\n return true;\n}", "title": "" }, { "docid": "ad093d5c149fd01816de475249bdaa33", "score": "0.6044746", "text": "function doPreLoad(){\n $('input[name=\"_continue\"]').click();\n $.cookie('django_admin_scroll',$(window).scrollTop());\n }", "title": "" }, { "docid": "25340d2d3d4f5f19f94e8e72dbc410c7", "score": "0.60356253", "text": "function refreshCachedPage()\n\t{\n\t\tif(thisUserAgent==\"isSafari\")\n\t\t\treturn;\n\t\t\n\t\trefreshIfNotYours(); //refresh if you're seeing a page that's not yours.\n\t\trefreshIfChanged(); //refresh the page if its been updated since it last seen.\n\t\taddToCacheList(); //a list of pages that have already been cached.\n\t}", "title": "" }, { "docid": "0cc3d90efe3a32817eeaf219cb887eb0", "score": "0.6032837", "text": "function astra_customizer_refresh_fragments() {\r\n\r\n\tvar cart_hash_key = ast_woocommerce.cart_hash_key;\r\n\twindow.sessionStorage.setItem(cart_hash_key, 'blank');\r\n}", "title": "" }, { "docid": "cf98a8698b894da3770df15d5153e174", "score": "0.6027528", "text": "morePups() {\n window.location.reload(false);\n}", "title": "" }, { "docid": "c5a6d6d6303f4fd4122ee6f21cb54f7a", "score": "0.60180324", "text": "autoLoadNewEntries() {\n if (!this.autoLoadsNewEntries) {\n this.autoLoadsNewEntries = true;\n localStorage.autoLoadsNewEntries = 1;\n } else {\n this.autoLoadsNewEntries = false;\n localStorage.autoLoadsNewEntries = 0;\n }\n }", "title": "" }, { "docid": "926da32fe899fb2088431df40e23cdf7", "score": "0.60043436", "text": "function refreshTab() {\t\t\t\r\n\t\tlocation.reload();\r\n\t}", "title": "" }, { "docid": "4847a5210036a2099b72bba08c8f6ab6", "score": "0.6001671", "text": "function pageRefresh(){\n\t\t\t$('#cboxClose').on(\"click\", function(){\n\t\t\t\tlocation.reload();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "06dc171109296fbb2a36407ef9f310ff", "score": "0.6000296", "text": "function startAgain(){\n location.reload();\n hideForms('#highScores','#welcome');\n }", "title": "" }, { "docid": "f247a795901613e6f096d67a3cd09cf2", "score": "0.5994187", "text": "function refreshPage() {\n window.location.reload(true);\n }", "title": "" }, { "docid": "3da3adbcddd0862d6c7a9a07625c385e", "score": "0.59872174", "text": "function updateLastRefreshTime() {\n localStorage['lastRefresh'] = +new Date();\n}", "title": "" }, { "docid": "530ace053f25ec26ff069f67ce940baa", "score": "0.59838915", "text": "function changeGlazing1(){\nlocalStorage.setItem('glazing', 'None');\nlocation.reload();\n}", "title": "" }, { "docid": "449a3b20ec09b9c9ccd599559d4ee8d0", "score": "0.59793", "text": "function atualizarPagina(){\n\t\twindow.location.reload();\n\t}", "title": "" }, { "docid": "eaa84713b2481a1409e5f6a3781e0373", "score": "0.59792906", "text": "function generate()\n{\n window.location.reload();\n }", "title": "" }, { "docid": "65ceb4f546ffab0dcad36c629977f28e", "score": "0.5978047", "text": "function dbUpdated() {\n photoboothTools.console.log('DB is updated - refreshing');\n //location.reload(true); //Alternative\n photoboothTools.reloadPage();\n}", "title": "" }, { "docid": "46d6dfeaa1d5fafe068ab462d6ace29a", "score": "0.5975143", "text": "function renderOnce() {\n render();\n hashHeader(false);\n }", "title": "" }, { "docid": "51bd8f81e47444216eb67885c3428a14", "score": "0.59736514", "text": "function oneTimeAlert(){\n if(localStorage.getItem('hasBeenVisited') == null){\n localStorage.setItem('hasBeenVisited', 1);\n alert(\"It is suggested to use Chrome (or at least Firefox) to support all features.\");\n }\n }", "title": "" }, { "docid": "632964ef64a19f1c348c0e5fcd2219ee", "score": "0.5971308", "text": "function _doRefresh() {\n var api = getClientApi();\n api.getState(function() {});\n }", "title": "" }, { "docid": "60c45a40b5d2a1782ffbc89537fec7e7", "score": "0.5961712", "text": "function onAfterLocationUpdate() {\n $.fancybox.showLoading();\n location.reload();\n}", "title": "" }, { "docid": "e4f6c8921cf08c51341e312e6d958b8a", "score": "0.5955212", "text": "function AutoRefresh( t ) {\nsetTimeout(\"location.reload(true);\" , t);\n}", "title": "" }, { "docid": "002cdc2deb3d707ae653f6ee2d8849bc", "score": "0.59526974", "text": "function runReset() {\n location.reload();\n}", "title": "" }, { "docid": "6955d1d9d3e945836bafd8c102fa1fa5", "score": "0.59515125", "text": "function refreshLater(){\nconsole.log(\"refresh triggered\");\ngetFileList(currentDir);\ndocument.getElementById(\"uploadFrom\").reset();\ndocument.getElementById(\"statusFrame\").src=\"\";\n}", "title": "" }, { "docid": "c26799461f7d02170f61ce795dc90dea", "score": "0.5941958", "text": "function refresh(){\n localStorage.clear();\n location.reload();\n}", "title": "" }, { "docid": "6af88971fed8426cf6b0570040bd703a", "score": "0.5933857", "text": "refresh() {\n }", "title": "" }, { "docid": "3fb1f62cf1c8127e6b1000f64f75e566", "score": "0.5926666", "text": "function checkFirstVisit() {\n // If this is the first time someone is visiting the page, then create a new session ID for them.\n if (sessionStorage.getItem(\"sessionID\") === null) {\n sessionID = Math.floor(Math.random() * 100000);\n sessionStorage.setItem(\"sessionID\", sessionID);\n }\n}", "title": "" }, { "docid": "d49efcb65003382b0660d3794adbd084", "score": "0.592053", "text": "function refresh(){\n location.reload();\n}", "title": "" }, { "docid": "dcb88108382e85287c3294ac6cf37340", "score": "0.59188956", "text": "function landingPageCounter() {\n if (typeof (Storage) !== \"undefined\") {\n if (localStorage.landingFirstTimeCount) {\n localStorage.landingFirstTimeCount = Number(localStorage.landingFirstTimeCount) + 1;\n } else {\n localStorage.landingFirstTimeCount = 0;\n }\n if (Number(localStorage.landingFirstTimeCount) < 2) {\n $('#squarespaceModal').modal('show');\n }\n } else {\n toastr.error(\"Sorry, your browser does not support web storage...\");\n }\n}", "title": "" }, { "docid": "4955de3de307be78aaec508725988014", "score": "0.59187955", "text": "refreshPage(){\n //this.playNext();\n }", "title": "" }, { "docid": "303ab95161b08a1066b08f687177c92d", "score": "0.59101766", "text": "function refresh() {\n requestData(50);\n }", "title": "" }, { "docid": "1be22510f4ad16a852ecf2a89dee350e", "score": "0.58994573", "text": "refreshPageAction() {\n this.lastTooltip = \"\";\n this.lastPattern = \"\";\n this.updateIcon();\n this.save();\n }", "title": "" }, { "docid": "489351c40c317cde10c8bf00a9e72423", "score": "0.5898452", "text": "function refresh() {\n window.location.reload();\n }", "title": "" }, { "docid": "489351c40c317cde10c8bf00a9e72423", "score": "0.5898452", "text": "function refresh() {\n window.location.reload();\n }", "title": "" }, { "docid": "1802b3569c6e872ff8353bff7c2a7cc9", "score": "0.58965904", "text": "function reset(){\r\n location.reload(true);\r\n}", "title": "" }, { "docid": "03a538bd520b0ddf1d9ca460c04f5664", "score": "0.58908194", "text": "function covidUIResetar() {\n storage.removeAll();\n document.location.reload(true);\n}", "title": "" }, { "docid": "1755a3e8d85eda66f81e81d4c3257bde", "score": "0.5890314", "text": "function statusCheck() {\n //check if any of the two pages have modified the task in any form \n //get from localStorage status of pages: \n if (session.taskModified){\n //something has chaned on the page - renderTasks afresh\n renderTask();\n session.taskModified=false;\n //persist data to local storage and mark as changed\n store.persistData();\n }\n}", "title": "" }, { "docid": "07b20a1dad1ae28406f287f91bb3d1e1", "score": "0.5889222", "text": "function clearSequence() {\n location.reload()\n}", "title": "" }, { "docid": "99183283c733414ae45cac30bf26b2f0", "score": "0.5887621", "text": "function TimeFunction() {\r\n\t setTimeout(function() {\r\n\t\tlocation.reload();\r\n\t},500);\r\n}", "title": "" }, { "docid": "d3c8ae16e86180966094507cf0d20717", "score": "0.58824277", "text": "static initPopStateReload() {\n window.onpopstate = (e) => {\n location.reload()\n }\n }", "title": "" }, { "docid": "1e2b7bff1b36e180214511ab97c63e81", "score": "0.5880236", "text": "function generate(){\n window.location.reload();\n}", "title": "" }, { "docid": "047218d374a551b3de4b96a71aa02ed3", "score": "0.58798575", "text": "function refreshPage(){\n location.reload()\n }", "title": "" }, { "docid": "29d4593547de2ff838adb15424c58bbd", "score": "0.5875725", "text": "function refreshTick()\n{\n if(refreshCancelled == \"0\")\n {\n if(autoRefreshTimer > 0)\n {\n autoRefreshTimer--;\n changeHTMLData(refreshTimerObject, autoRefreshTimer);\n pageReloadTimer = setTimeout(\"refreshTick()\", 1000);\n }\n else\n {\n pageReload();\n }\n }\n}", "title": "" }, { "docid": "c299c5cff3a8f6b960b9014015b5ac71", "score": "0.58663565", "text": "function reload() {\n\tlocation.reload(true);\n}", "title": "" }, { "docid": "575a238ef660b3734a639c65545ab1eb", "score": "0.5859145", "text": "refreshPage() {\n window.location.reload();\n }", "title": "" }, { "docid": "62663e517ada7f3448416dbe9920dce9", "score": "0.5857444", "text": "refreshPage() {\n window.location.reload()\n }", "title": "" }, { "docid": "1d65c664a177324f2361a559a3ef444a", "score": "0.58560663", "text": "function IsReloadPage(){\n if(!isTvinchiPlayerPlayNow)window.location.href=window.location.href;\n}", "title": "" }, { "docid": "a8464ed00afa0b08f078d3179311f163", "score": "0.58428895", "text": "function autoRefresh(t) {\n setTimeout(\"location.reload(true);\", t)\n}", "title": "" }, { "docid": "aa802f8b0e11637bdc787cf0cd4265b1", "score": "0.5839954", "text": "function handleEventRemember() {\n // getNextChunkandFetch();\n var forgotObject = false;\n renderBatchHandler(forgotObject);\n }", "title": "" }, { "docid": "bb4ae41613dac5a30f743ec4bdee7fcd", "score": "0.5838212", "text": "function timer() {\n location.reload();\n}", "title": "" }, { "docid": "9936aa7362ac9678b7117df6c142937e", "score": "0.583311", "text": "function refresh_wl_fragment() {\n\t\t\t\t$.ajax( $fragment_refresh );\n\t\t\t}", "title": "" }, { "docid": "68ec9ee4d7eb2e59d61ae3224e9210ba", "score": "0.5829747", "text": "_uiReload() {\n log2(\"trace\", \"Ui:uiManager:reload\", \"reloading\")();\n location.reload();\n }", "title": "" }, { "docid": "c53431dbd8a0f115b1965bed8f873a2b", "score": "0.58251935", "text": "function _refresh() {\n\n _ajax( 1 ); // Get the first record\n\n } // _refresh", "title": "" }, { "docid": "dadb81ec72f44a98c3f841bbb2945a90", "score": "0.5824595", "text": "function fctReset(){\n document.location.reload(true);\n}", "title": "" }, { "docid": "1adcc1dac81dd761288f119260382c3d", "score": "0.5823985", "text": "function refreshPage() {\n window.location.reload(false)\n}", "title": "" }, { "docid": "08ba0d0ebc0f94088e251a4f4cfb5f4c", "score": "0.5823373", "text": "function refreshPage(){\n\tWindowstorage.set(\"StoredIndex\",document.getElementById('selPList').selectedIndex);\n\twindow.location.reload(true);\n}", "title": "" }, { "docid": "4c4445e3c377144fbdb1f74171abe608", "score": "0.5822534", "text": "reload () {\n if (this.ignoreNextHashChange) {\n this.ignoreNextHashChange = false;\n return;\n }\n\n window.location.href = this.api.router.getEndpoint() + \"/#\" + this.getHash();\n window.location.reload();\n }", "title": "" }, { "docid": "2dea07d5c10fb5bc96bf92a5b58dc49c", "score": "0.5814182", "text": "function generate()\n{\n window.location.reload();\n}", "title": "" }, { "docid": "abccf70bf50c10bcf4e2637ad33f7bdd", "score": "0.5807352", "text": "function refreshPage() {\r\n location.reload();\r\n}", "title": "" }, { "docid": "abccf70bf50c10bcf4e2637ad33f7bdd", "score": "0.5807352", "text": "function refreshPage() {\r\n location.reload();\r\n}", "title": "" }, { "docid": "dda2fd23d2069a69b7da81dc4a726b74", "score": "0.58071196", "text": "function refresh() {\n const d = new Date();\n const s = d.getSeconds();\n \n if (s%10 === 0) {\n window.location.reload();\n } \n}", "title": "" }, { "docid": "bd9689716a6d52576cfb52894b2d1763", "score": "0.5801978", "text": "function reloadPage() {\n window.clearTimeout(refreshTimer);\n var obj = document.getElementById('refresh_rate');\n if(obj) {\n obj.innerHTML = \"<span id='refresh_rate'>page will be refreshed...</span>\";\n }\n\n var newUrl = getCurrentUrl();\n\n if(fav_counter) {\n updateFaviconCounter('Zz', '#F7DA64', true, \"10px Bold Tahoma\", \"#BA2610\");\n }\n\n /* set reload mark in side frame */\n if(window.parent.frames) {\n try {\n top.frames['side'].is_reloading = newUrl;\n }\n catch(err) {\n debug(err);\n }\n }\n\n /*\n * reload new url and replace history\n * otherwise history will contain every\n * single reload\n * and give the browser some time to update refresh buttons\n * and icons\n */\n window.setTimeout(\"window_location_replace('\"+newUrl+\"')\", 100);\n}", "title": "" }, { "docid": "258d14b7c98e6f6862a6d2b8a06ebe48", "score": "0.5797212", "text": "function refreshContent() {\n}", "title": "" }, { "docid": "9b2bb6cfd502b3e6227c393a86d638bf", "score": "0.5794518", "text": "function startOver() {\n location.reload() \n}", "title": "" }, { "docid": "ba8b9be7b4d766aee8d55aacf39a6222", "score": "0.5791498", "text": "function refresh(){\n\tsetSettings();\n\tsetStdTabs();\n\tsetSpkTabs();\n\tshoworhide();\n\tvar smpheaders = get_smpheaders();\n\tvar resheaders = get_resheaders();\n\tsetTable(smpheaders,mydata.json2handson(),'#smptable');\n\tsetTable(resheaders,crunch(),'#restable'); // crunch does all the actual work\n\tlocalStorage.setItem('data',JSON.stringify(mydata.data));\n }", "title": "" }, { "docid": "a1438d49b738fd9f5a552454a51aa0e0", "score": "0.5790364", "text": "function reset() {\r\n location.reload();\r\n }", "title": "" }, { "docid": "d0e56ad198c10e34a9193fbbd71585df", "score": "0.5788445", "text": "function pageUpdated()\n\t{\n\t\t//get page list & current cookie\n\t\tvar value = getDisplayPages(getPath());\n\t\tvar c = fgetCookie(\"friendster_update\");\n\t\tif(c)\n\t\t{\t//append page list to current cookie\n\t\t\tvar tmpStr = c + \",\" + value;\n\t\t\tvar tmpArr = unique(tmpStr.split(\",\")); //remove duplicates\n\t\t\tfsetCookieValue(\"friendster_update\",null,tmpArr.join(\",\"));\n\t\t}\n\t\telse\n\t\t{\t//cookie doesn't exist, create it\n\t\t\tfsetCookieValue(\"friendster_update\",null,value);\n\t\t}\n\t}", "title": "" }, { "docid": "f18b062747b9ad05790ce06d1bc3a700", "score": "0.5779846", "text": "function refreshLoadMeetups() {\n\t\tsetRefreshing(true);\n\t\tsetPage(0);\n\t}", "title": "" }, { "docid": "719c6f1a15f3837527e106014b53a8cf", "score": "0.5779794", "text": "function recallSavedEvent(){\n var savedEvent = JSON.parse(localStorage.getItem(\"eventSave\"))\n if (!savedEvent) {\n savedEvent = {}\n localStorage.setItem(\"eventSave\", JSON.stringify());\n }\n else {\n renderRandomEvent(savedEvent);\n }\n}", "title": "" }, { "docid": "50138412a994a18f77e42a2c3d594cc5", "score": "0.5778081", "text": "function refreshPage () {\n location.reload()\n}", "title": "" }, { "docid": "a3d78f9ba87ee5dff2b9294142688d49", "score": "0.5771251", "text": "function onUpdate() {\n //simulate standard browser behavior and scroll page to top.\n window.scrollTo(0, 0)\n\n // If we have a google Analyitics ID.\n if(Essentials.env === 'production' && config.googleAnalytics != null){\n ReactGA.set({ page: window.location.pathname });\n ReactGA.pageview(window.location.pathname);\n }\n}", "title": "" }, { "docid": "70a2b2647f2a3ca30786875c09b7f689", "score": "0.5767964", "text": "reload() {\n this.refresh.next();\n }", "title": "" } ]
c89b186f7da738a09fe4ee568008ef4a
setting function, determines whether there is anything from the user in local storage and prepopulates it if not.
[ { "docid": "fdf782ba44a2ffc72d712ef40faabbe9", "score": "0.0", "text": "function setTimeBlocks(){\n var setStatus = localStorage.getItem(\"Status\");\n if (setStatus === null){\n //future versions may use a different version of hourArray for tracking.\n for (var i = 0; i < hourArray.length; i++){\n var timeSegment = {hour: hourArray[i], details: \" \"};\n usersTime.push(timeSegment);\n }\n localStorage.setItem(\"Saved Times\", JSON.stringify(usersTime));\n setStatus = \"Saved\";\n localStorage.setItem(\"Status\", setStatus);\n } else{\n usersTime = JSON.parse(localStorage.getItem(\"Saved Times\"));\n }\n\n}", "title": "" } ]
[ { "docid": "a20a3b00b77dced94ef6726f81c5b4d5", "score": "0.7090074", "text": "function setLocalStorageData() {\n if ($.isEmptyObject(localStorage.inUse)) {\n //Set defaults\n localStorage.inUse = 'true';\n localStorage.sounds = 'true';\n localStorage.tracking = 'true';\n localStorage.logggedWorkouts = '[]';\n }\n if ($.isEmptyObject(localStorage.logggedWorkouts)) {\n localStorage.logggedWorkouts = '[]';\n $('#previousworkout-btn').hide();\n } else if (localStorage.logggedWorkouts === '[]') {\n $('#previousworkout-btn').hide();\n }\n if (localStorage.sounds === 'true') {\n $('#flip-alert').val('on');\n } else {\n $('#flip-alert').val('off');\n }\n if (localStorage.tracking === 'true') {\n $('#flip-track').val('on');\n } else {\n $('#flip-track').val('off');\n }\n }", "title": "" }, { "docid": "4807b3f1801fec0daf8e589e5b125a35", "score": "0.70348316", "text": "function setStorage() \r\n\t{\r\n if (typeof(Storage) !== \"undefined\")\r\n\t\t{\r\n if (remember)\r\n\t\t\t{\r\n localStorage.setItem(\"member\", 'true');\r\n if (publicAddr)\r\n localStorage.setItem(\"address\", publicAddr);\r\n } else\r\n\t\t\t{\r\n localStorage.removeItem('member');\r\n localStorage.removeItem('address');\r\n }\r\n } \r\n }", "title": "" }, { "docid": "c8818ec3d381c259bfc9fda43368d1e8", "score": "0.6899649", "text": "function setAndGetItem(value) {\n if (!value) {\n let arr = JSON.parse(localStorage.getItem(\"User\"));\n if (arr && arr.length) {\n studentsArray = arr;\n insertRecord();\n }\n else {\n if (studentsArray && studentsArray.length)\n localStorage.setItem('User', JSON.stringify(studentsArray));\n }\n }\n else {\n localStorage.removeItem(\"User\");\n if (studentsArray && studentsArray.length) {\n localStorage.setItem('User', JSON.stringify(studentsArray));\n insertRecord();\n resetForm();\n }\n else {\n document.getElementById(\"employeeList\").getElementsByTagName('tbody')[0].innerHTML = \"\";\n }\n }\n}", "title": "" }, { "docid": "53bcaea936323a55e003494626dcc878", "score": "0.68678147", "text": "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}", "title": "" }, { "docid": "4fcbf76d17e7eab397410e255f764d16", "score": "0.6857", "text": "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}", "title": "" }, { "docid": "79175c17f2e3131f12540637c7a0bbb9", "score": "0.6819339", "text": "function storeUserLocal(user){\n try\n {\n LocalStorage.setObject(Constants.USER,user);\n return true;\n }\n catch(err)\n {\n return false;\n }\n }", "title": "" }, { "docid": "9c9595173988ee167fb78b0cf2c2342d", "score": "0.67673224", "text": "function settingFunction() {\n\n let allUsersString = JSON.stringify(allUsers);\n localStorage.setItem('allUsers', allUsersString);\n\n}", "title": "" }, { "docid": "798f57373e2178e12adf59303779b1e4", "score": "0.67647207", "text": "function retrieveAndSetPreference(){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n if(localStorage.guddi_ca_xkcd_user_preference){\n var userPreferenceRetrieved = JSON.parse(localStorage.getItem(\"guddi_ca_xkcd_user_preference\"));\n totWords.value = userPreferenceRetrieved[0];\n totSpChars.value = userPreferenceRetrieved[1];\n totNumbers.value = userPreferenceRetrieved[2];\n useSeparator.value = userPreferenceRetrieved[3];\n wordCase.value = userPreferenceRetrieved[4];\n savePreference.checked = userPreferenceRetrieved[5];\n } //End of inner IF\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of outer IF\n }", "title": "" }, { "docid": "4ede3e992bde4a9aa2e7c92e502ef102", "score": "0.67521536", "text": "function setTemp() {\n if (localStorage.getItem(\"userId\") === null) {\n // Create temp user\n var tempUser = {\n name: \"temp\",\n password: \"\"\n };\n localUser.name = tempUser.name;\n console.log(tempUser);\n // User post\n API.createUser(tempUser);\n } else {\n localUser.id = localStorage.getItem(\"userId\");\n API.getFridge(localUser.id);\n }\n}", "title": "" }, { "docid": "4b3a968e2ca1e836951ba19d90dd7582", "score": "0.67088664", "text": "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}", "title": "" }, { "docid": "b14f24125cd5bd5fc3dcd32338b597e9", "score": "0.6681488", "text": "function saveUserPreference(){\n if(savePreference.checked){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n var userPreference = [totWords.value,totSpChars.value,totNumbers.value,useSeparator.value,wordCase.value,savePreference.value];\n localStorage.setItem(\"guddi_ca_xkcd_user_preference\", JSON.stringify(userPreference));\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of inner IF\n } else{\n localStorage.clear();\n } //End of outer IF\n } //End of saveUserPreference() function", "title": "" }, { "docid": "6018f6e0f0d406e854aec6f2edeabb9f", "score": "0.6640863", "text": "function syncUser (newval) {\n storage.set('user', newval);\n}", "title": "" }, { "docid": "0bb20f15ea074ba889d604a73a2771b9", "score": "0.6639387", "text": "function setData() {\n localStorage.setItem('name', username.value);\n localStorage.setItem('email', email.value);\n localStorage.setItem('city', city.value);\n localStorage.setItem('organisation', organisation.value);\n localStorage.setItem('contact', contact.value);\n localStorage.setItem('message', message.value);\n // Reset all the fields.\n username.value = '';\n email.value = '';\n city.value = 'city';\n organisation.value = '';\n contact.value = '';\n message.value = '';\n\n}", "title": "" }, { "docid": "f4c8bc35a3cdb1038a055079a30ed208", "score": "0.6636943", "text": "function storeLocal() {\n const jsonUserData = JSON.stringify(userData);\n localStorage.setItem('fullname', jsonUserData);\n}", "title": "" }, { "docid": "226136e75122bd70b001d750a0462d79", "score": "0.662787", "text": "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "title": "" }, { "docid": "226136e75122bd70b001d750a0462d79", "score": "0.662787", "text": "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "title": "" }, { "docid": "226136e75122bd70b001d750a0462d79", "score": "0.662787", "text": "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "title": "" }, { "docid": "226136e75122bd70b001d750a0462d79", "score": "0.662787", "text": "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "title": "" }, { "docid": "226136e75122bd70b001d750a0462d79", "score": "0.662787", "text": "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "title": "" }, { "docid": "226136e75122bd70b001d750a0462d79", "score": "0.662787", "text": "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "title": "" }, { "docid": "bfa9bdfc80b3210f3e65af531622f5d5", "score": "0.6575272", "text": "function setDataFromLocalStorage() { \t\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setDataFromLocalStorage\");\n \t$(\"#name\").val(gameData.data.player.profile.name);\n \t$(\"#surname\").val(gameData.data.player.profile.surname);\n \t$(\"#age\").val(gameData.data.player.profile.age);\n \t$(\"#sex\").val(gameData.data.player.profile.sex);\n \t$(\"#mobile\").val(gameData.data.player.profile.mobile); \n \t \t \t\n }", "title": "" }, { "docid": "4d7607ece9aa8e4da48b64ba897b3576", "score": "0.655709", "text": "function restoreOptions() {\r\n var user = localStorage[\"user\"];\r\n if(!user) {\r\n return;\r\n }\r\n document.getElementById(\"user\").value = user;\r\n}", "title": "" }, { "docid": "0ca1bce63cfd808cb75f02b44a0f2e9f", "score": "0.65384984", "text": "function checkLocalStorageData() {\n let email = localStorage.getItem('email');\n let firstName = localStorage.getItem('firstName');\n let lastName = localStorage.getItem('lastName');\n let textarea = localStorage.getItem('textarea');\n if (\n email != null &&\n firstName != null &&\n lastName != null &&\n textarea != null\n ) {\n $('#email').val(email);\n $('#firstName').val(firstName);\n $('#lastName').val(lastName);\n $('#taMessage').val(textarea);\n }\n}", "title": "" }, { "docid": "6575e4e9f675cc157e76f96b3d6ffcef", "score": "0.6533187", "text": "function setupStorage(){\n\t\tif(localStorage['addressBook'] === undefined){\n\t\t\tlocalStorage['addressBook'] = '';\n\t\t}\n\t\tif(localStorage['orgBook'] === undefined){\n\t\t\tlocalStorage['orgBook'] = '';\n\t\t}\n\t}", "title": "" }, { "docid": "7ed2f696e7d8573690267b52b8189f70", "score": "0.65114844", "text": "checkStorage () {\n this.createElements()\n if (window.localStorage.getItem('chatCredentials')) {\n this.userName = window.localStorage.getItem('chatCredentials')\n this.setUpChat()\n this.addChatListeners()\n } else {\n this.createUser()\n }\n }", "title": "" }, { "docid": "2c165f6c7e9651b9d35f809e74241bf2", "score": "0.64920855", "text": "function loadValue()\n{\n document.getElementById('nameInput').value = localStorage.getItem('nameInput');\n document.getElementById('emailInput').value = localStorage.getItem('emailInput');\n document.getElementById('msgInput').value = localStorage.getItem('msgInput');\n if (localStorage.getItem('privacyInput') == \"checked\")\n document.getElementById('privacyInput').checked = true;\n else if (localStorage.getItem('privacyInput') == \"unchecked\") document.getElementById('privacyInput').checked = false;\n}", "title": "" }, { "docid": "0dcdb4e835eeb24d080dd65730f7b0b5", "score": "0.64668363", "text": "function usuarioPredeterminado(){\r\n localStorage.setItem('Clave1', 'lider123');\r\n localStorage.setItem('Usuario1', 'lider123');\r\n localStorage.setItem('Genero1', 'Masculino');\r\n localStorage.setItem('Tipo Usuario1', 'Administrador');\r\n localStorage.setItem('Apellido1', 'lider123');\r\n localStorage.setItem('Nombre1', 'lider123');\r\n\r\n localStorage.setItem('Clave2', 'usuario123');\r\n localStorage.setItem('Usuario2', 'usuario123');\r\n localStorage.setItem('Genero2', 'Femenino');\r\n localStorage.setItem('Tipo Usuario2', 'Usuario');\r\n localStorage.setItem('Apellido2', 'usuario123');\r\n localStorage.setItem('Nombre2', 'usuario123');\r\n}", "title": "" }, { "docid": "41a7f64e3e3dce94d3302060575dad29", "score": "0.6460557", "text": "function restore_options() {\r\n var datap = localStorage[\"passwd\"];\r\n if (datap) {\r\n document.getElementById(\"passwd\").value = datap;\r\n }\r\n\r\n var datau = localStorage[\"user\"];\r\n if (datau) {\r\n document.getElementById(\"user\").value = datau;\r\n }\r\n}", "title": "" }, { "docid": "f0ed631a94fab29a5e9da2e3ac44b58a", "score": "0.6450498", "text": "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 }", "title": "" }, { "docid": "5869f9cd7a3666faa62373b1c1f09a91", "score": "0.6447181", "text": "function saveToLocalStorage() { \n\t\n\t\t\t\t\tvar lscount = localStorage.length; \n\t\t\t\t\tvar Userstring=User.toJSONString();\n\t\t\t\t\t\t\tlocalStorage.setItem(\"User_\" + lscount, Userstring); \n\t\t\n}", "title": "" }, { "docid": "5e41eb206797db2df226bacfa81a5a52", "score": "0.64471483", "text": "function set_value_in_local_storage(key,value)\n{\n\tif(key == null || value == null)\n\t{\n\t\treturn false;\n\t}\n\t\n\ttry\n\t{\n\t\tif ($(\"#\"+value).val() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).val();\n\t\t\t\n\t\t}\n\t\telse if($(\"#\"+value).html() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).html();\n\t\t\t\n\t\t}\n\t\t// save value in localStorage Object\n\t\tlocalStorage.setItem(key,value);\n\t\t\n\t\t// update current page cache of var your_name\n\t\tyour_name = get_value_from_local_storage(\"name\");\n\t\tupdate_message('Name Saved as ('+your_name+')','form_ok');\n\t\t\n\t\treturn true;\n\t} catch(e)\n\t{\n\t\treturn false;\n\t\tupdate_message('Failed to Save your name','form_error');\n\t}\n}", "title": "" }, { "docid": "e3a1751cb62994550cf50d557e096f51", "score": "0.64435065", "text": "function fillStorage() {\n var local = {\n uid : uid,\n Time : timeLocal,\n Todos : todos\n }\n localStorage.clear();\n window.localStorage.setItem(`local`,JSON.stringify(local));\n mapping();\n}", "title": "" }, { "docid": "71058c67eba61c4036c3340f5ca23313", "score": "0.63969266", "text": "function setupLocalStroageAfterLogin() {\n Object(_comms_js__WEBPACK_IMPORTED_MODULE_0__[\"fetchJson\"])(\"/user/profile\").then(function (user) {\n localStorage.setItem(\"auth\", true);\n localStorage.setItem(\"navbar_title\", user.firstName);\n });\n} // Function to reset the localStorage", "title": "" }, { "docid": "93e0c20a3b902842ebb1b795e77ed148", "score": "0.63934404", "text": "function rememberUser() {\r\n\tif(localStorage.remember) {\r\n\t\tgetId('name').value = localStorage.name;\r\n\t\tgetId('email').value = localStorage.email;\r\n\t\tgetId('phone').value = localStorage.phone;\r\n\t\tgetId('address').value = localStorage.address;\r\n\t\tgetId('remember').checked = localStorage.remember;\r\n\t}\r\n}", "title": "" }, { "docid": "4420bd3cfcfdfd236580e1ba88011e60", "score": "0.6381069", "text": "function checkStorage() {\n\tvar inputs = $(\".input\");\n\tfor (i = 0; i < inputs.length; i++) {\n\t\tif (localStorage.getItem(inputs[i].dataset.value) != null) {\n\t\t\tinputs[i].value = localStorage.getItem(inputs[i].dataset.value);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "212e656ee65ae5f478250a0969182d13", "score": "0.63674396", "text": "function initval(){\n user = JSON.parse(localStorage.getItem('user'));\n $('#homename').append(user.first_name + ' ' + user.last_name);\n $('#detname').append(user.first_name + ' ' + user.last_name);\n $('#detbirth').append( new Date(user.birth_date).toLocaleString());\n $('#detemail').append(user.email);\n }", "title": "" }, { "docid": "99802b6c694acd69ab73635a7d751e73", "score": "0.636061", "text": "function setProfile() {\n if (profileCheck.checked === true) {\n localStorage.setItem('profileCheck', 'true');\n } else {\n localStorage.setItem('profileCheck', 'false');\n }\n}", "title": "" }, { "docid": "171d3e1ba5dcbef05589f55b43a67375", "score": "0.6360004", "text": "setUserLS(userName) {\n localStorage.setItem('logedUser', userName);\n }", "title": "" }, { "docid": "2dc0e43cf34e053bf173a0e0fcf94066", "score": "0.63455814", "text": "setUsername() {\n var username = document.getElementById(\"username\");\n localStorage.setItem('username', username.value);\n localStorage.setItem('balance', 100);\n localStorage.setItem('round', 0);\n localStorage.setItem('pool', 0);\n }", "title": "" }, { "docid": "72f3b0938917a91449d07da3a8b18723", "score": "0.6342121", "text": "function setFromLocal () {\n _.each(settings, (v, k) => {\n var value = localStorage.getItem(k);\n if (value) {\n settings[k] = JSON.parse(value);\n }\n });\n}", "title": "" }, { "docid": "b323f74f4921d48b5fdf42b5fd97e7a5", "score": "0.63265526", "text": "function localset(key, value) {\r\n try {\r\n var ret = true;\r\n localStorage.setItem(key, escape(JSON.stringify(value)));\r\n }\r\n catch (se) {\r\n // Presume this is a quota exception, so clear and try again\r\n try {\r\n if (clearstorage())\r\n localStorage.setItem(key, escape(JSON.stringify(value)));\r\n else\r\n ret = false;\r\n }\r\n catch (ise) {\r\n ret = false;\r\n }\r\n }\r\n finally {\r\n return ret;\r\n }\r\n }", "title": "" }, { "docid": "3090eff16596628c4511315a396b6ef7", "score": "0.632615", "text": "async function saveUserCredentialsInLocalStorage() {\n if (currentUser) {\n let teamsList = await Team.getTeams();\n\n favName = teamsList.find(function (obj) {\n if (obj[\"id\"] == favTeam) return obj;\n });\n\n localStorage.setItem(\"username\", currentUser.username);\n localStorage.setItem(\"userId\", currentUser.userId);\n localStorage.setItem(\"favTeamId\", favTeam);\n\n //catches error when function is called prior to user setting a favorite team\n try {\n localStorage.setItem(\"favTeamName\", favName.name);\n } catch (err) {\n console.log(\"no favorite team selected\");\n }\n }\n}", "title": "" }, { "docid": "a267ba4b24c309691401cf8f1ba22f24", "score": "0.6313064", "text": "init () {\n if (localStorage.users === undefined || !localStorage.encrypted) {\n // Set default user\n let defaultUser = 'DeekshithShetty'\n let defaultUserSalt = genSalt(defaultUser)\n let defaultUserPass = hashSync('Hydra@12345', defaultUserSalt)\n\n users = {\n [defaultUser]: hashSync(defaultUserPass, salt)\n }\n\n localStorage.users = JSON.stringify(users)\n localStorage.encrypted = true\n } else {\n users = JSON.parse(localStorage.users)\n }\n }", "title": "" }, { "docid": "b311df890fffa34677daccb9aa51cba7", "score": "0.6294543", "text": "function setProfileFromLS() {\n if (\n localStorage.getItem('customer') != null &&\n localStorage.getItem('customer') != 'undefined'\n ) {\n let localST = JSON.parse(localStorage.getItem('customer'))\n $('#validationCustom01').val(localST.firstName)\n $('#validationCustom02').val(localST.lastName)\n $('#validationCustom03').val(localST.email)\n $('#validationCustom04').val('*************')\n $('#validationCustom05').val(localST.number)\n $('#validationCustom06').val(localST.address.street)\n $('#validationCustom07').val(localST.address.city)\n $('#validationCustom08').val(localST.address.zipcode)\n $('#welcomeText').text('Hej ' + localST.firstName + ' ' + localST.lastName)\n $('#welcomeEmail').text(localST.email)\n }\n}", "title": "" }, { "docid": "f4534fc0047f649699c6257d3fcbb30b", "score": "0.6268023", "text": "function clearUserData()\n {\n userData = userDataDefault;\n window.localStorage.setItem(localStorageName, JSON.stringify(userData));\n }", "title": "" }, { "docid": "c273c2eb22c009ed43180115d636afc5", "score": "0.62658036", "text": "function set_user_array(user_array){\n\tif(user_array == null){\n\t\tconsole.log(\"trying to set users to null. Why do that???\");\n\t\treturn false;\n\t}\n\n\ttry{\n\t\tvar users_string = JSON.stringify(user_array);\n\t}catch(err){\n\t\tconsole.log(\"failed to stringify user_array\");\n\t\treturn false;\n\t}\n\n\tlocalStorage['users'] = users_string;\n\treturn true; \n}", "title": "" }, { "docid": "eb976b134c68f2f22c870e23a87e9319", "score": "0.6256532", "text": "autofill() {\n\t\tif (localStorage.getItem(\"lastname\")) {\n\t\t\t$(\"#lastName\").val(localStorage.getItem(\"lastname\"));\n\t\t\t$(\"#firstName\").val(localStorage.getItem(\"firstName\"));\n\t\t}\n\t}", "title": "" }, { "docid": "2d3791810f7b9847741fe3f6aee13258", "score": "0.62465334", "text": "function localAddTestUsersToStorage(){\n let choice = prompt(\"Clear Storage before adding users? Y/N\");\n \n if(choice.toLocaleLowerCase() == \"y\"){\n localStorage.clear();\n }\n \n for(let i = 0; i < localTestUsers.users.length; i++){\n localStorage.setItem(localTestUsers.users[i].email, JSON.stringify(localTestUsers.users[i])); \n }\n}", "title": "" }, { "docid": "20ef29eaa7e446cfd21aa1b563200d62", "score": "0.62389225", "text": "function userSetMode(){\n // remove the sensitive list and add the user list to websiteMap\n removePreloadListFromBlacklist();\n preloadUserSet();\n saveMode(\"userset\")\n}", "title": "" }, { "docid": "f148e97ad22fb6704dcd7b90b3a59bd0", "score": "0.62365633", "text": "function setUser(user) {\n\t\t\tlocalStorage.addLocal('user', user);\n\t\t}", "title": "" }, { "docid": "ae22162f989a18aa4bc1eee199420d5c", "score": "0.6235455", "text": "function setupUser() {\n updateCounts(); //count stuff\n console.log(\"Updated counts - iReport.js\");\n\n var TheTech = localStorage.getItem(\"tech\");\n //alert(\"Welcome: \"+ TheTech);\n //document.getElementById('TechName').innerHTML =localStorage.getItem(\"tech\");\n //var TheTech = localStorage.getItem(\"username\");\n if (TheTech == null || TheTech == '') {\n localStorage.setItem(\"Tech\", \"setup\");\n window.location.replace(\"setup.html\");\n }\n\n\n\n/* 8-16-13 commented out\n function initial_setup() {\n var name = prompt(\"eReport Setup - Please enter your Username\", \"\");\n var pw = prompt(\"eReport Setup - Please enter your Domino Password\", \"\");\n\n if (name != null && name != \"\" && pw != \"\") {\n\n daLogin = doDominoLogin(name, pw); // ajaxLogin.js\n if (daLogin) {\n //alert(\"daLogin succeeded\");\n //Set the tech name based on who is logged in\n localStorage.setItem(\"username\", name);\n localStorage.setItem(\"password\", pw);\n\n //var TheTech = localStorage.getItem(\"tech\");\n //var TheTech = localStorage.getItem(\"username\");\n document.getElementById('TechName').innerHTML = localStorage.getItem(\"Tech\");\n\n //alert(\"hello \" + TheTech);\n show('initSetup');\n }\n\n\n }\n }\n\t*/\n\t\n //see if there is a techname locally \n //var TheTech = localStorage.getItem(\"tech\");\n //alert(TheTech);\n //prompt them for a name\n/*\n if ( TheTech==\"\"){\n hide('daForm');\n show('initSetup');\n //show_prompt();\n }\n */\n\n}", "title": "" }, { "docid": "9b9c5024147e552834a0e0d653457f4a", "score": "0.6217841", "text": "function loadUser(){\n let userLogged = JSON.parse(localStorage.getItem(\"userLogged\"))\n setUser(userLogged)\n }", "title": "" }, { "docid": "030b4d534237ea5db38ad957a046cde4", "score": "0.62068295", "text": "setLocalStorage() {\r\n\tlocalStorage.setItem('userPantry', JSON.stringify(this.state.userIngredients))\r\n }", "title": "" }, { "docid": "404b9302c61c88aa2fd420e326a760ad", "score": "0.6202009", "text": "function store() {\n if (email.value.length == 0 && password.value.length == 0) {\n\n } else {\n localStorage.setItem('firstName', firstName.value);\n localStorage.setItem('lastName', lastName.value);\n localStorage.setItem('age', age.value);\n localStorage.setItem('occupation', occupation.value);\n localStorage.setItem('email', email.value);\n localStorage.setItem('password', password.value);\n location.href = 'https://rowanhorn1412.github.io/frontend2/';\n }\n}", "title": "" }, { "docid": "55279d14b8e2fc49b44b54d51edf542e", "score": "0.6201665", "text": "function setUserLocalStorage(username, email) {\n localStorage.setItem(\"username\", username);\n localStorage.setItem(\"email\", email);\n}", "title": "" }, { "docid": "4cf53bde86f68fe75cce8517a2a91efb", "score": "0.61997336", "text": "function setUserData(name, value) {\n if (window.localStorage) { // eslint-disable-line\n window.localStorage.setItem(name, value) // eslint-disable-line\n } else {\n Cookies.set(name, value, { expires: 7 })\n }\n}", "title": "" }, { "docid": "4fd5cfa3f432ddf396dcb622bc4cf63a", "score": "0.61943495", "text": "function populateStorage() {\r\n // run detection with inverted expression\r\n if (!localStorageSupport) {\r\n // change value to inform visitor of no session storage support\r\n storageQuotaMsg.innerHTML = 'Sorry. No HTML5 session storage support here.';\r\n } else {\r\n try {\r\n localStorage.setItem('bgcolor', document.getElementById('bgcolor').value);\r\n localStorage.setItem('fontfamily', document.getElementById('font').value);\r\n localStorage.setItem('image', document.getElementById('image').value);\r\n localStorage.setItem(\r\n 'fontcolor',\r\n document.querySelector('#fontcolor').value\r\n );\r\n localStorage.setItem('note', document.querySelector('#textArea').value);\r\n setStyles();\r\n } catch (domException) {\r\n domException = new DOMException();\r\n if (\r\n domException.name === 'QUOTA_EXCEEDED_ERR' ||\r\n domException.name === 'NS_ERROR_DOM_QUOTA_REACHED'\r\n ) {\r\n storageQuotaMsg.innerHTML = 'Local Storage Quota Exceeded!';\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6121faacc0e187e90da524913bc3d104", "score": "0.61935246", "text": "function saveCurrentUserinLocalStorage() {\n localStorage.setItem(\"curUserId\", firebase.auth().currentUser.uid);\n localStorage.setItem(\"curUserImgSource\", firebase.auth().currentUser.photoURL);\n}", "title": "" }, { "docid": "d3281fdee1c851bd13b44fb0caa7fa62", "score": "0.61770403", "text": "function checkUserName(){\n if(localStorage.username)\n loadUserInfo();\n else\n loadModal();\n}", "title": "" }, { "docid": "e446a9e9745684cefe57d6527d01aa7b", "score": "0.61696714", "text": "function setupSettings() {\n var showUsername = localStorage.getItem(\"showUsername\");\n var showAccountNumber = localStorage.getItem(\"showAccountNumber\");\n \n $(\"#showUsername\").prop(\"checked\", showUsername == null ? true : showUsername === \"true\");\n $(\"#showAccountNumber\").prop(\"checked\", showAccountNumber == null ? true : showAccountNumber === \"true\");\n \n var maxRows = localStorage.getItem(\"maxRows\");\n maxRows = maxRows == null ? 500 : maxRows; // Default to 500\n $(\"#max-rows\").val(maxRows);\n }", "title": "" }, { "docid": "4cc8aa19dea7bec9f8ed82be6ad700ae", "score": "0.61607444", "text": "firstTimePlay() {\n if (localStorage.getItem(\"playedBefore\") !== \"true\") {\n // User Global Settings\n localStorage.setItem(\"playedBefore\", \"true\");\n\n localStorage.setItem(\"registedInServer\", \"false\");\n localStorage.setItem(\"score\", 0);\n\n localStorage.setItem(\"musicConfig\", JSON.stringify({volume: 0.1, loop: true}));\n localStorage.setItem(\"VFXConfig\", JSON.stringify({volume: 0.1}));\n\n // format: [5, 5, 3, ...] where the first element is respective to chapter 1 and is the level the user has access to\n localStorage.setItem(\"levelsReached\", JSON.stringify([0]));\n\n // levels' scores\n localStorage.setItem(\"levelsScores\", JSON.stringify({}));\n\n // skins that user owns\n localStorage.setItem(\"skins\", JSON.stringify([\"player\"]));\n }\n }", "title": "" }, { "docid": "78497625ba0944a96bfadf54d1d312d8", "score": "0.6154112", "text": "function save() {\r\n const uname = context.user && context.user.username;\r\n const time = new Date().toLocaleTimeString();\r\n const searchValue = value.length > 0 ? value : \"\";\r\n const newData = { uname, searchValue, time };\r\n if (localStorage.getItem(\"data\") === null) {\r\n localStorage.setItem(\"data\", \"[]\");\r\n }\r\n\r\n var oldData = JSON.parse(localStorage.getItem(\"data\"));\r\n oldData.push(newData);\r\n\r\n localStorage.setItem(\"data\", JSON.stringify(oldData));\r\n }", "title": "" }, { "docid": "350164a49372d69af5f2991d0c550ac0", "score": "0.61464995", "text": "function setDefaultLocalStorage() {\n\t\n\tif ($('select').val() === 'soda') {\n\n\t\tlocalStorage.setItem('poison', 'soda');\n\t\tlocalStorage.setItem('brand', 'Coke');\n\t\tlocalStorage.setItem('numPerDay', '3');\n\t\tlocalStorage.setItem('cost', '5.00');\n\t\tlocalStorage.setItem('caffeine', '34');\n\t\tlocalStorage.setItem('sugar', '39');\n\n\t} else if ($('select').val() === 'cigarettes') {\n\t\tlocalStorage.setItem('poison', 'cigarettes');\n\t\tlocalStorage.setItem('brand', 'Marlboro');\n\t\tlocalStorage.setItem('numPerDay', '15');\n\t\tlocalStorage.setItem('cost', '7.50');\n\t\tlocalStorage.setItem('time', '6');\n\t\n\t} \n}", "title": "" }, { "docid": "90c8502e7c0dbfdf07e359447e367104", "score": "0.61464477", "text": "function local_setValue(name, value) { name=\"GMxs_\"+name; if ( ! value && value !=0 ) { localStorage.removeItem(name); return; }\n var str=JSON.stringify(value); localStorage.setItem(name, str );\n }", "title": "" }, { "docid": "34ef39f9ce3df61d5b725b6b3eaf0503", "score": "0.61459446", "text": "function storeSettings() {\n check();\n browser.storage.local.set(f2j(form));\n}", "title": "" }, { "docid": "5860713f8d504abfb3e039352566469a", "score": "0.6145128", "text": "function populateStorage () {\n localStorage.setItem('prop1', 'red')\n localStorage.setItem('prop2', 'blue')\n localStorage.setItem('prop3', 'magenta')\n\n sessionStorage.setItem('prop4', 'cyan')\n sessionStorage.setItem('prop5', 'yellow')\n sessionStorage.setItem('prop6', 'black')\n }", "title": "" }, { "docid": "63e044b36854017a69ec8886c2904a6d", "score": "0.6144178", "text": "function initLocalStorage() {\n\t//\n\tvalue = that.get(key);\n\tif (value == null) {\n\t\tthat.set(key, JSON.stringify([]));\n\t}\n}", "title": "" }, { "docid": "6b16e424630158721e67e7584cc80e95", "score": "0.614102", "text": "function checkIfLocalStorageExists(){\n if (localStorage.getItem(\"p1_presence\") === null) {localStorage.setItem(\"p1_presence\", \"false\");}\n if (localStorage.getItem(\"p2_presence\") === null) {localStorage.setItem(\"p2_presence\", \"false\");}\n if (localStorage.getItem(\"p3_presence\") === null) {localStorage.setItem(\"p3_presence\", \"false\");}\n if (localStorage.getItem(\"p4_presence\") === null) {localStorage.setItem(\"p4_presence\", \"false\");}\n if (localStorage.getItem(\"guests_present\") === null) {localStorage.setItem(\"guests_present\", \"0\");}\n}", "title": "" }, { "docid": "96829e1a263c15c6fe9fa87e7d0a2aaa", "score": "0.61367947", "text": "function storedata(username, jwt) {\r\n if(typeof(Storage) !== \"undefined\") {\r\n if (localStorage.jwt && localStorage.username) {\r\n localStorage.username =username;\r\n localStorage.jwt =jwt;\r\n // alert('done')\r\n } else {\r\n localStorage.username =username;\r\n localStorage.jwt =jwt;\r\n // alert('done add')\r\n }\r\n } else {\r\n alert(\"Sorry, your browser does not support web storage...\");\r\n }\r\n }", "title": "" }, { "docid": "1c54373570e2492ac51a2eddc65a4b62", "score": "0.61317575", "text": "cacheUserID(userID) {\n localStorage.setItem(USER_ID, userID);\n }", "title": "" }, { "docid": "a0587c3ce4529b73069a347b8ed04c28", "score": "0.6117438", "text": "function setStorage(profil) {\n if(profil == 1) {\n localStorage.setItem(\"lectureVocale\", true);\n localStorage.setItem(\"controleVocal\", true);\n localStorage.setItem(\"affichageImages\", false);\n localStorage.setItem(\"isDyslexic\", $('#isDyslexic').is(':checked'));\n localStorage.setItem(\"profil\", profil);\n }\n else if(profil == 2) {\n localStorage.setItem(\"lectureVocale\", false);\n localStorage.setItem(\"controleVocal\", false);\n localStorage.setItem(\"affichageImages\", true);\n localStorage.setItem(\"isDyslexic\", $('#isDyslexic').is(':checked'));\n localStorage.setItem(\"profil\", profil);\n localStorage.setItem(\"fontFamily\", $(\"#selectFontFamily\").val());\n localStorage.setItem(\"fontColor\", $(\"#selectFontColor\").val());\n }\n else {\n localStorage.setItem(\"lectureVocale\", $('#lectureVocale').is(':checked'));\n localStorage.setItem(\"controleVocal\", $('#controleVocal').is(':checked'));\n localStorage.setItem(\"affichageImages\", $('#affichageImages').is(':checked'));\n localStorage.setItem(\"isDyslexic\", $('#isDyslexic').is(':checked'));\n localStorage.setItem(\"profil\", profil);\n localStorage.setItem(\"fontFamily\", $(\"#selectFontFamily\").val());\n localStorage.setItem(\"fontColor\", $(\"#selectFontColor\").val());\n }\n}", "title": "" }, { "docid": "893776e50348693f87c04f74a950f6b2", "score": "0.61149025", "text": "function store() {\n if (email.value===\"\"||confEmail.value===\"\"||pass.value===\"\") {\n alert(\"Por favor llene todos los campos\");\n return;\n } else if (!terms.checked) {\n alert(\"Debe aceptar términos y condiciones\");\n return;\n } else if (email.value!==confEmail.value) {\n alert(\"Los correos deben ser iguales\");\n return;\n }\n localStorage.setItem('email', email.value);\n localStorage.setItem('pass', pass.value);\n window.location.assign('signupsucc.html');\n}", "title": "" }, { "docid": "0be98e041734647e93a79c46aacf1e08", "score": "0.6114729", "text": "function validarNewUser(){\n\t//debugger;\n\tif(localStorage.getItem(\"Usuario_Actual\") === \"Admin\"){\n\t\t$(\"#Hi_user\").append('Admin');\n\t}else{\n\t\t$(\"#New_usuario\").hide();\n\t\t$(\"#Users\").hide();\n\t\t$(\"#Hi_user\").append(localStorage.getItem(\"Usuario_Actual\"));\n\t}\n}", "title": "" }, { "docid": "488ee3e8a345c3db1b6956ba675b0142", "score": "0.6113211", "text": "function persistUserToLS(email){\n \n let blogUser;\n \n if(localStorage.getItem('blogUser') !== null){\n blogUser = JSON.parse(localStorage.getItem('blogUser'))\n }else{\n blogUser = [];\n }\n \n if(blogUser.indexOf(email) === -1){\n blogUser.push(email);\n }\n \n localStorage.setItem('blogUser',JSON.stringify(blogUser));\n }", "title": "" }, { "docid": "10702c6266cc378087bbecd090ee4cf9", "score": "0.61059666", "text": "function setUserInLocalStorage(userData) {\n var localUser = localStorageService.get('currentUser');\n localStorageService.set('currentUser', {\n username: Methods.isNullOrEmpty(userData.username) ? localUser.username : userData.username,\n token : Methods.isNullOrEmpty(userData.token) ? localUser.token : userData.token\n });\n }", "title": "" }, { "docid": "fe05e77c8e093283112204d2a9d89aed", "score": "0.6098476", "text": "function LocalSettingStorage() {\n}", "title": "" }, { "docid": "e55a6098f10a9e3e70f3b29dc9be0c6b", "score": "0.60976815", "text": "function tmpStoreMPW(){\n\t\t// browser.storage.sync.get(\"mpw\").then(function(res){\n\t\t// \tif(res['mpw'] == CryptoJS.SHA512($('#modalInputMPW').val()).toString()){\n\t\t// \t\tSM.setMPW($('#modalInputMPW').val());\n\t\t// \t\t$('#modalMPW').modal('hide');\n\t\t// \t\t// activate checkbox\n\t\t// \t\t$('#pref_autofill_password').prop('checked', true);\n\t\t// \t\tSM.updatePreferences('pref_autofill_password', true);\n\n\t\t// \t}else{\n\t\t// \t\talert(\"Entered password was not correct.\");\n\t\t// \t}\n\t\t// });\n\n\t\tdoChallenge($('#modalInputMPW').val(),\n\t\t\tfunction(){\n\t\t\t\tSM.setMPW($('#modalInputMPW').val());\n\t\t\t\t$('#modalMPW').modal('hide');\n\t\t\t\t// activate checkbox\n\t\t\t\t$('#pref_autofill_password').prop('checked', true);\n\t\t\t\tSM.updatePreferences('pref_autofill_password', true);\n\t\t\t},\n\t\t\tfunction(){\n\t\t\t\talert(\"Entered password was not correct.\");\n\t\t\t}\n\t\t\t);\n\n\t}", "title": "" }, { "docid": "31dd9130f5829a8da56c79b4aa8e4df9", "score": "0.6097007", "text": "function saveUserForm() {\n if (checkUserForm()) {\n // Set up the user object.\n const user = {\n FirstName: $(\"#txtFirstName\").val(),\n LastName: $(\"#txtLastName\").val(),\n Birthdate: $(\"#dateBirthday\").val(),\n PIN: $(\"#txtNewPIN\").val(),\n HoursGoal: $(\"#sldMaxHoursPerDay\").val(),\n };\n\n // Try to save the user object and alert if issues arise.\n try {\n localStorage.setItem(\"user\", JSON.stringify(user));\n alert(\"Saving Information\");\n\n $.mobile.changePage(\"#page-menu\");\n window.location.reload();\n } catch (e) {\n alert(\"Error saving user information to storage.\");\n console.log(e);\n }\n }\n}", "title": "" }, { "docid": "a3d0e51b721373b3ad0ebac94c287454", "score": "0.60934275", "text": "function check_current_user() {\n\tfor (var i=0; i<members_db.length; i++) {\n\t\tif (members_db[i][7] == true) {\n\t\t\tlocalStorage.setItem(\"current_user_id\", i); \n\t\t}\n\t}\n}", "title": "" }, { "docid": "bfaca6a564bf3708062d2d7a10b2fd0c", "score": "0.6088375", "text": "function checkPreAuth() {\r\n console.log(\"checkPreAuth\");\r\n var $form = $(\"#loginForm\");\r\n\r\n if(window.localStorage[\"email\"] != undefined && window.localStorage[\"password\"] != undefined) {\r\n console.log(\"in local storage\");\r\n\r\n $(\"#email\", $form).val(window.localStorage[\"email\"]);\r\n $(\"#password\", $form).val(window.localStorage[\"password\"]);\r\n\r\n // process login\r\n handleLogin();\r\n }\r\n}", "title": "" }, { "docid": "a3b0446c9c7f47bc9922c2cf2599c096", "score": "0.6087932", "text": "function storeGenderSelect(userClick) {\n\tvar userGenderSelect = userClick.trim().toLowerCase();\n\tif(userGenderSelect === \"no preference\") {\n\t\tlocalStorage.removeItem(\"gender\");\n\t} else {\n\t\tlocalStorage.setItem(\"gender\", JSON.stringify(userGenderSelect));\n\t}\n}", "title": "" }, { "docid": "7107a9e40fdb392c5d13a58417e8c544", "score": "0.60840154", "text": "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 }", "title": "" }, { "docid": "3c03b73cffc3a9c493d8e1b8f7942038", "score": "0.6082557", "text": "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}", "title": "" }, { "docid": "761b6393fb54b4df3b88ce011d485e04", "score": "0.6071241", "text": "function setLocalStorage(){\r\n var playerSetter = JSON.stringify(allPlayers);\r\n localStorage.setItem('players', playerSetter);\r\n}", "title": "" }, { "docid": "4adc2352ed841f80e06b2b6acb807ca2", "score": "0.6070254", "text": "createUser(username) {\n var createUser = {\n 'username': username,\n 'password': this.password\n };\n var userdata = [];\n userdata.push(createUser);\n var map = new Map(JSON.parse(localStorage.getItem('userstorage')));\n if (!map.has(this.email)) {\n map.set(this.email, createUser);\n localStorage.setItem('userstorage', JSON.stringify(Array.from(map.entries())));\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "77eb7af4b28dfecfae0ed23549f3fc10", "score": "0.6065619", "text": "function store() {\n localStorage.setItem('name_1', name_1.value);\n localStorage.setItem('pw', pw.value);\n localStorage.setItem('email',email.value )\n}", "title": "" }, { "docid": "7074eeac332a5024ea97db918c822155", "score": "0.60575986", "text": "setUserPreference(key, item) {\n new UserPreference({\n key: key,\n item: item\n }).save(null, {\n success: () => {\n localStorage.setItem(key, item);\n }, \n error: (model, r) => {\n console.error('User preference not saved');\n }\n });\n }", "title": "" }, { "docid": "d0d852b2faa8c6b93bd72cba01f2f2c8", "score": "0.6053784", "text": "function init() {\n vm.misc.authData.emailAdd = localStorage.getItem('emailAdd');\n vm.misc.authData.password = localStorage.getItem('password');\n if(!(vm.misc.authData.emailAdd === undefined || vm.misc.authData.emailAdd === null)\n && !(vm.misc.authData.password === undefined || vm.misc.authData.password === null)) {\n vm.misc.savePassword = true;\n }\n }", "title": "" }, { "docid": "c88a9faf729bea429ca5e0fc3b4b14d5", "score": "0.60529554", "text": "function storeLocalInfo(){\n // IE7 uses cookies\n // Check for IE7 first\n if(ieSeven){\n // Use cookies\n SetCookie('firstName', $(\"fName\").value);\n SetCookie('lastName', $('lName').value);\n SetCookie('email', $('email').value);\n }\n else if (window.localStorage){ // all other browsers\n localStorage.setItem(\"firstName\", $(\"fName\").value);\n localStorage.setItem(\"lastName\", $(\"lName\").value);\n localStorage.setItem(\"email\", $(\"email\").value);\n }\n}", "title": "" }, { "docid": "3e9bff6f88ad3ca0231e8a308d5d3116", "score": "0.60524017", "text": "function store() {\n localStorage.setItem('name1', name1.value);\n localStorage.setItem('pw', pw.value);\n}", "title": "" }, { "docid": "af82da4edf5371394330185d98ee544c", "score": "0.6051428", "text": "function setLocalStorage() {\n var userDetails = JSON.parse(localStorage.getItem(\"userDetails\"));\n var reportFault = new Object();\n reportFault.user = userDetails.userID;\n reportFault.carriage = $('#carNum').val();\n localStorage.setItem('reportFault', JSON.stringify(reportFault));\n}", "title": "" }, { "docid": "0c53b897ad7cae6f47a44c8655679132", "score": "0.604849", "text": "function saveUserData() {\n localStorage.setItem('locallyStored', JSON.stringify(userData))\n}", "title": "" }, { "docid": "0dec0c44773b85baef8a2f64c515c01f", "score": "0.6046984", "text": "function setHome() {\n var homeAddress = $(\"#user-location\").val();\n if (homeAddress == \"\") {\n return;\n } else {\n localStorage.setItem(\"home-address\", JSON.stringify(homeAddress));\n $(\"#user-location\").val(\"\");\n }\n }", "title": "" }, { "docid": "221c3c983cf09f1fcb31fa6ba07b47d5", "score": "0.60462785", "text": "function fillAuthData() {\n var authData = localStorageService.get('authorizationData');\n if (authData) {\n authentication.isAuth = true;\n authentication.userName = authData.userName;\n authentication.roleId = authData.roleId;\n }\n }", "title": "" }, { "docid": "d04f15da6767e13066b5d1d27161173f", "score": "0.6045718", "text": "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}", "title": "" }, { "docid": "f86b5c6a7f6a286121549255a7849b4e", "score": "0.6020687", "text": "function setUserName() {\n let myName = prompt('Please enter your name.');\n if(!myName) {\n setUserName();\n } else {\n localStorage.setItem('name', myName);\n myHeading.textContent = 'Mozilla is cool, ' + myName;\n }\n}", "title": "" }, { "docid": "c0ee5e71a85bdd69599cee0707b37040", "score": "0.6017454", "text": "function setUserDetailsInLocalStorage(user) {\n localStorage.setItem(\"userDetails\", JSON.stringify(user));\n}", "title": "" }, { "docid": "a79cd0af6b33c7fe905a36ca36f58424", "score": "0.6016685", "text": "function init() {\n //check data to the relevant form element and put in the local storage under same title\n if (localStorage['name']) {\n $('#name').val(localStorage['name']);\n }\n if (localStorage['email']) {\n $('#email').val(localStorage['email']);\n }\n if (localStorage['message']) {\n $('#message').val(localStorage['message']);\n }\n }", "title": "" }, { "docid": "1e6cf051f29e21ecadbd32bd458b1a18", "score": "0.6014333", "text": "function loggedIn(){\r\n if(localStorage.getItem(\"loggedIn\")){\r\n loginButton.style.display = \"none\";\r\n signupButton.style.display = \"none\";\r\n console.log(document.getElementById(\"userID\").value);\r\n if(localStorage.getItem(\"userID\") == \"null\"){\r\n localStorage.setItem(\"userID\", document.getElementById(\"userID\").value);\r\n }\r\n userNameDisplay[1].style.display = \"inline\";\r\n savedQuotesButton[0].style.display = \"inline\";\r\n savedQuotesButton[1].style.display = \"inline\";\r\n savedQuotesButton[2].style.display = \"block\";\r\n userNameDisplay[1].textContent = localStorage.getItem(\"userName\");\r\n document.getElementById(\"userID\").value = localStorage.getItem(\"userID\");\r\n }\r\n}", "title": "" }, { "docid": "8bb0b243bf2d97ad4dbaf3309293f358", "score": "0.6011362", "text": "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}", "title": "" }, { "docid": "7dd3fc3099b8688995e370ff126c9a7c", "score": "0.6008146", "text": "function saveUserCredentialsInLocalStorage() {\n console.debug('saveUserCredentialsInLocalStorage');\n if (currentUser) {\n localStorage.setItem('token', currentUser.loginToken);\n localStorage.setItem('username', currentUser.username);\n }\n}", "title": "" } ]
2d15e5362f2c1c42139d3489e16ce38f
Initializes the listener to a function that is provided. The Element, Node, and Document prototypes are then patched to call this listener when DOM APIs are accessed.
[ { "docid": "81f9081eabb1c1cb5ead2d07fe4322c7", "score": "0.58321464", "text": "function addManipulationListener(newListener) {\n listener = _listener;\n savedListener = newListener;\n patchOnePrototype(Element, 'Element');\n patchOnePrototype(Node, 'Node');\n patchOnePrototype(Document, 'Document');\n listener = savedListener;\n}", "title": "" } ]
[ { "docid": "c5a1609be8724dd39d72c29791135c56", "score": "0.632635", "text": "init() {\r\n\t\tthis._addEventListener( this );\r\n\t}", "title": "" }, { "docid": "e692038892d10576d5705276cc64d12a", "score": "0.62621564", "text": "_init() {\n this.element.addEventListener(this.action, this.callback);\n }", "title": "" }, { "docid": "86ba0e22fcaf95ae3a0e62db8c63932f", "score": "0.61253244", "text": "init() {\n this.contextListener();\n this.clickListener();\n this.keyupListener();\n this.resizeListener();\n }", "title": "" }, { "docid": "beb6e8efad4dd2225cd39286215f71ce", "score": "0.6007495", "text": "function initialize(func)\n{\n if (window.addEventListener)\n window.addEventListener('load', func, false);\n else if (window.attachEvent)\n window.attachEvent('onload', func);\n}", "title": "" }, { "docid": "b6cfcabf1ee83dd57ee4267be3d6f9ad", "score": "0.59759766", "text": "initialize(){\n\n this.attachEventListeners();\n }", "title": "" }, { "docid": "4c921d268c0d49cd54e141538c4694d8", "score": "0.5961317", "text": "setupEventListeners() { }", "title": "" }, { "docid": "c24b5fa40ad0754625a909e3d2d0f86c", "score": "0.5931069", "text": "addEventListener(event, func) {\n\t\t\n\t\tif(this.listeners[event] == null){\n\t\t\tthis.listeners[event] = []\n\t\t}\n\n\t\tthis.listeners[event].push(func)\n\t}", "title": "" }, { "docid": "630bb9b82d56fcefdd773af1597f6174", "score": "0.5894703", "text": "_setupListeners() {\n const eventElements = [].slice.call(this.element.querySelectorAll('[s-event]'));\n if (eventElements) {\n eventElements.forEach(element => {\n for (const attribute of element.attributes) {\n if (attribute.name.match('s-event-')) {\n let events = attribute.name.match(/(?<=s-event-)(.*)/g);\n events.forEach(event => {\n element.addEventListener(event, e => {\n if (this[attribute.value]) {\n this[attribute.value](e);\n }\n this._eventCallback();\n })\n })\n }\n }\n })\n }\n }", "title": "" }, { "docid": "412bbf1909826cbbaecc4dc1a9ffb6f9", "score": "0.5878171", "text": "function FunctionListener(method) {\n this.method = method;\n }", "title": "" }, { "docid": "86304ae0e8f36e53de8b843ef7aa0c78", "score": "0.58610445", "text": "function EventListener() {}", "title": "" }, { "docid": "6eaa5f43987d33719f52e597febcf502", "score": "0.58489156", "text": "function FunctionListener(method) {\r\n this.method = method;\r\n }", "title": "" }, { "docid": "6eaa5f43987d33719f52e597febcf502", "score": "0.58489156", "text": "function FunctionListener(method) {\r\n this.method = method;\r\n }", "title": "" }, { "docid": "d35cbd15cbaaf96d40c5ba0366066bcc", "score": "0.5783616", "text": "_addEventListener(event, func) {\n window.addEventListener(event, func);\n }", "title": "" }, { "docid": "9574d73d3e468229be03e26c50e3886c", "score": "0.57768357", "text": "function init() {\n contextListener();\n clickListener();\n keyupListener();\n resizeListener();\n console.log('Init done')\n }", "title": "" }, { "docid": "bd9e4b713000e381affd7663d2de2639", "score": "0.57366174", "text": "addListener(listenerFn) {\n this.listeners.push(listenerFn);\n }", "title": "" }, { "docid": "a5d1521e859ec7bd5f6bb3f0581ad218", "score": "0.5729129", "text": "function resetEventListenerMethod(el) {\n var oldFn = el.addEventListener;\n el.addEventListener = function(type, listener, options, wantsUntrusted) {\n window.EventDocumentCollector.push({\n element: el,\n type: type,\n listener: listener,\n options: options,\n wantsUntrusted: wantsUntrusted\n });\n return oldFn.call(el, type, listener, options, wantsUntrusted);\n };\n }", "title": "" }, { "docid": "e76409750df1bda608face87a04c21fa", "score": "0.56869006", "text": "function initialize() {\n\t\t\t\t\tinitializeEventHandler();\n\t\t\t\t}", "title": "" }, { "docid": "3e898cd76453819c4ad6f64f1399c87d", "score": "0.56710035", "text": "function Listener(elmnt) {\n this.element = elmnt;\n}", "title": "" }, { "docid": "478b6dd2f851fc5305ef5c727b4add68", "score": "0.5623764", "text": "function AddListner(id, func, parm)\r\n{\r\n node = iDoc.getElementById(id);\r\n\r\n if (parm == undefined) node.addEventListener(\"click\", function () { func() }, true);\r\n else node.addEventListener(\"click\", function () { func(parm) }, true);\r\n}", "title": "" }, { "docid": "642fbe43962e3d68f6a225ae1a15d947", "score": "0.56140476", "text": "function AddListener(element, event, f) {\n if(element.attachEvent) {\n element[\"e\" + event + f] = f;\n element[event + f] = function () {\n element[\"e\" + event + f](window.event)\n };\n element.attachEvent(\"on\" + event, element[event + f])\n } else element.addEventListener(event, f, false)\n }", "title": "" }, { "docid": "f20957862847e1c38b9f57eec615a513", "score": "0.55874085", "text": "function initialize() {\n \t\tinitializeEventHandler();\n \t}", "title": "" }, { "docid": "d81fa8f21e114d74b2b35eec92ce526c", "score": "0.55611444", "text": "function addListener( _element, _event_string, _func ) {\n\t// Chrome, FF, O, Safari\n\tif( _element.addEventListener ) _element.addEventListener( _event_string, _func, false );\n\t// IE\n\telse if( _element.attachEvent ) _element.attachEvent( \"on\" + _event_string, _func );\n\t// credit to roxik, Masayuki Kido. roxik.com/cat\n}", "title": "" }, { "docid": "251ab62e1071e00e175e6624d086da02", "score": "0.5551722", "text": "_attachInitNodeListenersToOurEvents(addEventListenerArgs) {\n addEventListenerArgs.forEach((arg, idx) => {\n addEventListenerArgs[idx].nodeListeners = Djaty.initApp.nodeListeners;\n });\n utils.addEventListenerAndSaveIt(addEventListenerArgs);\n }", "title": "" }, { "docid": "79005dba1ae99a53de9ce962f9ca723b", "score": "0.5546226", "text": "function initListeners() {\n\tinitSelectListeners();\n\tinitSearchListeners();\n\tinitFeaturedAmountListeners();\n}", "title": "" }, { "docid": "99228a2f79c10b2c17a4a09d54da0d72", "score": "0.55247253", "text": "function Listener() { }", "title": "" }, { "docid": "fe3da31ce40cc468f7a4cd0f7a5c507e", "score": "0.5521036", "text": "function attachDefaultListeners() {\n var listenerDiv = document.getElementById('listener');\n listenerDiv.addEventListener('load', moduleDidLoad, true);\n listenerDiv.addEventListener('message', handleMessage, true);\n listenerDiv.addEventListener('error', handleError, true);\n listenerDiv.addEventListener('crash', handleCrash, true);\n if (typeof window.attachListeners !== 'undefined') {\n window.attachListeners();\n }\n }", "title": "" }, { "docid": "ea364f427b8b02a5d0cad560cfdc5e9c", "score": "0.55117685", "text": "function add_onload_listener(func)\r\n{\r\n\tif (typeof(window.addEventListener) != 'undefined') {\r\n\t\t// DOM level 2\r\n\t\twindow.addEventListener('load', func, false);\r\n\t} else if (typeof(window.attachEvent) != 'undefined') {\r\n\t\t// IE\r\n\t\twindow.attachEvent('onload', func);\r\n\t} else {\r\n\t\tif (typeof(window.onload) != 'function') {\r\n\t\t\twindow.onload = func;\r\n\t\t} else {\r\n\t\t\tvar oldfunc = window.onload;\r\n\t\t\twindow.onload = function() {\r\n\t\t\t\toldfunc();\r\n\t\t\t\tfunc();\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "649097f06ae673606cf052f414e6a92f", "score": "0.55000013", "text": "function init() {\n\t\t//\t\tcontextListener();\n\t\t$scope.clickListener();\n\t\t$scope.keyupListener();\n\t\t$scope.resizeListener();\n\t}", "title": "" }, { "docid": "89806d6720804d1ab79b34b7c79b6217", "score": "0.549899", "text": "addEventListener() {}", "title": "" }, { "docid": "5f2f7383979c1acf2243cd612fe2f50e", "score": "0.54983413", "text": "function applyEvent(elem, ename, newFunc) {\n\t var events = elem[$currentEventHandlers];\n\t\n\t if (!events) {\n\t events = elem[$currentEventHandlers] = {};\n\t }\n\t\n\t // Undefined indicates that there is no listener yet.\n\t if (typeof events[ename] === 'undefined') {\n\t // We only add a single listener once. Originally this was a workaround for\n\t // the Webcomponents ShadyDOM polyfill not removing listeners, but it's\n\t // also a simpler model for binding / unbinding events because you only\n\t // have a single handler you need to worry about and a single place where\n\t // you only store one event handler\n\t elem.addEventListener(ename, function (e) {\n\t if (events[ename]) {\n\t events[ename].call(this, e);\n\t }\n\t });\n\t }\n\t\n\t // Not undefined indicates that we have set a listener, so default to null.\n\t events[ename] = typeof newFunc === 'function' ? newFunc : null;\n\t }", "title": "" }, { "docid": "d795ac59c4e13f945c8a9cfac82b30cf", "score": "0.54788303", "text": "function constructor(options){\n\t\t\n\t\t/* options can be either a function or an object literal with the function property set.\n\t\t * \n\t\t * options\n\t\t * \t\tfunction:\tThe function to create a listener function for.\n\t\t * \n\t\t * To access this externally, use the joi.createListener alias.\n\t\t * \n\t\t * Warning: Functions created using the Listener constructor will not be instances of\n\t\t * Listener. It is recommended that the new keyword not be used in the creation of\n\t\t * Listener functions. Although it will work, it is not needed and can only cause\n\t\t * confusion about what's happening. Listener should be treated as a function that\n\t\t * wraps an argument function in a new function with methods for event handling.\n\t\t */\n\t\t\n\t\tif(!options['function']) {\n\t\t\toptions['function'] = options;\n\t\t}\n\t\t\n\t\tvar f = function() {\n\t\t\treturn callF.call(f, this, options['function'], Collection.castAsArray(arguments));\n\t\t};\n\t\t\n\t\textend(f, constructor.prototype);\n\t\t\n\t\tf.eventHandlers = [ ];\n\t\t\n\t\treturn f;\n\t\t\n\t}", "title": "" }, { "docid": "c35b74e5f8ee4aa904d47d9ee892a13b", "score": "0.5477784", "text": "function startListening(obj, evnt, func) {\n if (obj.addEventListener) {\n obj.addEventListener(evnt, func, false);\n } else if (obj.attachEvent) {\n obj.attachEvent(\"on\" + evnt, func);\n }\n}", "title": "" }, { "docid": "520bbb1d2c3a5b19eee1735a3db82d7d", "score": "0.54774284", "text": "initializeListeners_() {\n // Add a listener for changes in the RTL state\n this.storeService_.subscribe(\n StateProperty.RTL_STATE,\n (rtlState) => {\n this.onRtlStateUpdate_(rtlState);\n },\n true /** callToInitialize */\n );\n\n // Add a click listener to the element to trigger the class change\n this.quizEl_.addEventListener('click', (e) => this.handleTap_(e));\n }", "title": "" }, { "docid": "3c98b6e1d8e2016d37bfdfad6e88356d", "score": "0.5472064", "text": "function applyEvent(elem, ename, newFunc) {\n\t var events = elem[$currentEventHandlers];\n\t\n\t if (!events) {\n\t events = elem[$currentEventHandlers] = {};\n\t }\n\t\n\t // Undefined indicates that there is no listener yet.\n\t if (typeof events[ename] === 'undefined') {\n\t // We only add a single listener once. Originally this was a workaround for\n\t // the Webcomponents ShadyDOM polyfill not removing listeners, but it's\n\t // also a simpler model for binding / unbinding events because you only\n\t // have a single handler you need to worry about and a single place where\n\t // you only store one event handler\n\t elem.addEventListener(ename, function (e) {\n\t if (events[ename]) {\n\t events[ename].call(this, e);\n\t }\n\t });\n\t }\n\t\n\t // Not undefined indicates that we have set a listener, so default to null.\n\t events[ename] = typeof newFunc === 'function' ? newFunc : null;\n\t}", "title": "" }, { "docid": "b27085badc1fb7d63f45cb643c8bfbc5", "score": "0.5439311", "text": "function setUpEventListening() {\n var addEventListener, removeEventListener,\n eventListeners = [];\n\n // Modern Browsers\n if (window.EventTarget) {\n addEventListener = window.EventTarget.prototype.addEventListener;\n removeEventListener = window.EventTarget.prototype.removeEventListener;\n\n window.EventTarget.prototype.addEventListener = function (event, callback, bubble) {\n return addEventListener.call(this, event, Canadarm.watch(callback), bubble);\n };\n\n window.EventTarget.prototype.removeEventListener = function (event, callback, bubble) {\n return removeEventListener.call(this, event, Canadarm.watch(callback), bubble);\n };\n\n // Internet Explorer < 9\n } else if (window.Element && window.Element.prototype && window.Element.prototype.attachEvent) {\n\n // Only shim addEventListener if it has not already been shimmed.\n if (window.Element.prototype.addEventListener === undefined) {\n\n // Shim adapted from:\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Compatibility\n //\n // Only doing a Canadarm.watch on standard watched events. No on onload event because\n // we do not need to watch that event. If that fails the page will not work.\n if (!Event.prototype.preventDefault) {\n Event.prototype.preventDefault = function() {\n this.returnValue=false;\n };\n }\n if (!Event.prototype.stopPropagation) {\n Event.prototype.stopPropagation = function() {\n this.cancelBubble=true;\n };\n }\n if (!Element.prototype.addEventListener) {\n\n addEventListener = function(type, listener) {\n var self = this, e, wrapper2,\n wrapper = function(e) {\n e.target = e.srcElement;\n e.currentTarget = self;\n if (listener.handleEvent) {\n listener.handleEvent(e);\n } else {\n listener.call(self,e);\n }\n };\n\n if (type !== 'DOMContentLoaded') {\n this.attachEvent('on' + type, Canadarm.watch(wrapper));\n eventListeners.push({object:this, type:type, listener:listener, wrapper:wrapper});\n }\n };\n\n removeEventListener = function(type, listener) {\n var counter = 0, eventListener;\n\n while (counter < eventListeners.length) {\n eventListener = eventListeners[counter];\n\n if (eventListener.object == this && eventListener.type === type && eventListener.listener == listener) { /* jshint ignore:line */\n\n if (type !== 'DOMContentLoaded') {\n this.detachEvent('on' + type, Canadarm.watch(eventListener.wrapper));\n }\n\n eventListeners.splice(counter, 1);\n break;\n }\n ++counter;\n }\n };\n\n Element.prototype.addEventListener = addEventListener;\n Element.prototype.removeEventListener = removeEventListener;\n }\n }\n }\n}", "title": "" }, { "docid": "7c55d87343205e32251597f0e085f066", "score": "0.5435649", "text": "listen(func, scope) {\n\t\tscope = scope || this;\n\t\tthis.listeners.add({func: func, scope: scope});\n\t}", "title": "" }, { "docid": "fc985e0270ab7ccf4cdca5c5d04a8528", "score": "0.54006255", "text": "static init(evtName, fns) {\n return fns !== undefined\n ? new YngwieListener(evtName, Array.isArray(fns) === true ? fns : [fns])\n : new YngwieListener(evtName);\n }", "title": "" }, { "docid": "cc364854ae784420200fbb5494667447", "score": "0.53472686", "text": "addEventListener() { }", "title": "" }, { "docid": "59b9835777df9d6450b3a4b7f3c3ebb2", "score": "0.5332182", "text": "function addListener(_ele, _type, _function){\n if(ieSeven == true){\n _type = \"on\" + _type;\n }\n if(_ele.addEventListener){\n _ele.addEventListener(_type, _function);\n }\n else if(_ele.attachEvent){\n _ele.attachEvent(_type, _function);\n }\n}", "title": "" }, { "docid": "8b9a8de8a84b77a26d212c9a9454dcb7", "score": "0.53194267", "text": "function init() {\n document.addEventListener('keydown', keydownHandler, false);\n}", "title": "" }, { "docid": "47e8d39b418318ce568cbb1c74eac133", "score": "0.53192186", "text": "function addEvent(element, event, fn) {\n if (element.addEventListener) {\n element.addEventListener(event, fn, false);\n } else if (element.attachEvent) {\n if (element === d && event == \"DOMContentLoaded\") {\n element.attachEvent(\"onreadystatechange\", fn);\n } else {\n element.attachEvent(\"on\" + event, fn);\n }\n }\n }", "title": "" }, { "docid": "533f90714f4a30bf0c05e71a7cb2115e", "score": "0.531836", "text": "function addListener(eventType, fn) {\n if (document.addEventListener) {\n document.addEventListener(eventType, fn, false);\n } else {\n document.attachEvent(\"on\" + eventType, fn);\n }\n}", "title": "" }, { "docid": "621ecc4de02cfcd6db6409877948d8f5", "score": "0.5314289", "text": "callbackFunction() {\r\n // It's needed to wait until the integration target is ready. The event is fired\r\n // from the integration side.\r\n var listener = Listeners.newListener('onTargetReady', function() {\r\n this.addEvents(this.target);\r\n }.bind(this));\r\n this.listeners.add(listener);\r\n }", "title": "" }, { "docid": "36fcfc305580229512a00a740bb33ede", "score": "0.5312587", "text": "addChangeCallback(elName, fun, scope = null) {\n var el = document.getElementById(elName);\n if (scope == null) {\n el.onchange = fun;\n } else {\n el.onchange = fun.bind(scope);\n }\n }", "title": "" }, { "docid": "e8ac066f16438125f67a0aaf5651db04", "score": "0.5307021", "text": "function dom_loaded_listener(arg_callback, arg_operand)\n{\n\twindow.devapt.TRACE_DOM && console.log('devapt-bootstrap:dom_loaded_listener')\n\n\tvar cb = function()\n\t{\n\t\twindow.devapt.TRACE_DOM && console.info('devapt-bootstrap:dom_loaded_listener:cb')\n\n\t\tdocument.removeEventListener(\"DOMContentLoaded\", cb, false);\n\n\t\targ_callback(arg_operand);\n\n\t\tif (document.body.className.indexOf('javascript') == -1)\n\t\t{\n\t\t\tdocument.body.className += ' javascript';\n\t\t}\n\t}\n\n\treturn cb\n}", "title": "" }, { "docid": "0eeed7a1706709d0a1c044f8bee6b5c5", "score": "0.5306826", "text": "function addEventListeners (){\n\n }", "title": "" }, { "docid": "9a5473e5c93de77d82bb7addf38cbf6e", "score": "0.5301464", "text": "function init() {\n setDomEvents();\n }", "title": "" }, { "docid": "fe2ad9d85d4a505ac5cec1a540212e9a", "score": "0.5296311", "text": "function bindToFunction(target, entity, evt, method) {\n target.listenToOnce(entity, evt, method);\n }", "title": "" }, { "docid": "30ce64528587a602cbd37c9b1c6412c3", "score": "0.5288239", "text": "function myListenerFunction() {\n alert(\"woohoo!\");\n}", "title": "" }, { "docid": "7fe9b28b960d482cb5ef56a06e061e3e", "score": "0.5286122", "text": "init() {\n this.$module.addEventListener('keydown', this.handleKeyDown.bind(this))\n this.$module.addEventListener('click', this.debounce.bind(this))\n }", "title": "" }, { "docid": "588431d7ca25ba8209f837fd283b0ca6", "score": "0.5281179", "text": "setupEventListeners() {\n this.mouseMoveListener = this.mousemove.bind(this);\n this.mouseUpListener = this.mouseup.bind(this);\n this.onEndRotationAnimationListener = this.rectOnRotationAnimationEnd.bind(this);\n this.onEndFadeAnimationListener = this.rectOnFadeAnimationEnd.bind(this);\n this.canva.addEventListener('mousedown', this.mousedown.bind(this));\n }", "title": "" }, { "docid": "50adaead38ddabc10365b94d9afed2be", "score": "0.5279284", "text": "initialize () {\n this._bindEvents()\n }", "title": "" }, { "docid": "a86c1c7324636f8fd14abacefc92945c", "score": "0.52583224", "text": "function applyEvent(node, appliedFunction) {\n node.onclick = appliedFunction;\n}", "title": "" }, { "docid": "85cecd4771e3c5855f438efa74e2c6c3", "score": "0.5257095", "text": "setListener(col, row, fn) \n\t{\n\t\tthis.setTrigger(col, row, fn, \"listener\", true);\n\t}", "title": "" }, { "docid": "049c85713143f0b05c5fbdbf23ded611", "score": "0.52441746", "text": "on(evtName, fns) {\n let listener = _Listener_main_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].init(evtName, fns);\n this._listeners.push(listener);\n return this;\n }", "title": "" }, { "docid": "1f442bf8e45f9359dff6dfee344e5946", "score": "0.5239565", "text": "function AddEventHandler(Element, EventHandlerName, Function)\n{\n var EventHandler = Element[EventHandlerName];\n if (EventHandler) {\n Element[EventHandlerName] = function() { EventHandler(); Function(); };\n } else {\n Element[EventHandlerName] = Function;\n }\n}", "title": "" }, { "docid": "728a78be890f1fb86330377ad23fccb9", "score": "0.52394027", "text": "function init() {\n _bindEvents();\n }", "title": "" }, { "docid": "3f743f12c07573af3a68e7e5a68070c7", "score": "0.523836", "text": "constructor(...args) {\n super();\n this.dom = new$(...args)\n // the listeners will get populated when other code calls the listen() method\n this.listeners = new Map()\n }", "title": "" }, { "docid": "e42b90f0132b946da445748d60b8fa80", "score": "0.52289814", "text": "setup(eventElement)\n\t\t{\n\t\t\tvar inp = this;\n\n\t\t\teventElement.addEventListener(\"keydown\", function(evt){ inp.onKeyDown(evt); });\n\t\t\teventElement.addEventListener(\"keyup\", function(evt){ inp.onKeyUp(evt); });\n\t\t\teventElement.addEventListener(\"mousedown\", function(evt){ inp.onMouseDown(evt); });\n\t\t\teventElement.addEventListener(\"mouseup\", function(evt){ inp.onMouseUp(evt); });\n\n\t\t\teventElement.addEventListener(\"mousemove\", function(evt){ inp.onMouseMove(evt); });\n\t\t\teventElement.addEventListener(\"mousedrag\", function(evt){ inp.onMouseMove(evt); });\n\n\t\t\teventElement.addEventListener(\"wheel\", function(evt){ inp.onMouseWheel(evt); });\n\t\t}", "title": "" }, { "docid": "c9c7061388e081ec88e70e3953dc43b6", "score": "0.52273816", "text": "attach(element) {\n /* Store a reference of the DOM element. */\n this.listenElement = element;\n\n /* Engage the essential keyboard events to each corresponding handler. */\n element.addEventListener(\"keydown\", this._keyDown, eventOptions);\n element.addEventListener(\"keyup\", this._keyUp, eventOptions);\n }", "title": "" }, { "docid": "0e37cd025a5e4870016a6ba16568c46e", "score": "0.5225602", "text": "function initEventListeners() {\n addInputEventListener(cardHolderComponent, cardHolder, cardHolderError);\n addInputEventListener(cardNumberComponent, cardNumber, cardNumberError);\n addInputEventListener(expiryDateComponent, expiryDate, expiryDateError);\n addInputEventListener(verificationCodeComponent, verificationCode, verificationCodeError);\n}", "title": "" }, { "docid": "99c2f25d5fe65850dfe939b181852b0f", "score": "0.52154326", "text": "initCallBacks()\n {\n window.addEventListener('resize', this.resize);\n // document.addEventListener('mousedown', this.mouseDown, false);\n }", "title": "" }, { "docid": "fcbf3a23da7cf70235502302ec3326fc", "score": "0.5207018", "text": "function init() {\n if (firefox) {\n addWindowListener(eventFired); /* Firefox addon function */\n } else if (ytcenter.supported.localStorage) {\n if (typeof uw.addEventListener === \"function\") {\n uw.addEventListener(\"storage\", eventFiredStorage, false);\n } else if (typeof uw.attachEvent === \"function\") {\n uw.attachEvent(\"onstorage\", eventFiredStorage, false);\n }\n }\n }", "title": "" }, { "docid": "cf62a497067c34098e5e5d2ed3b1f78c", "score": "0.52014625", "text": "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "title": "" }, { "docid": "b1a6f780696150fb6b12c6daa51976e0", "score": "0.5195797", "text": "function EventInit() {\n}", "title": "" }, { "docid": "875ffe1d460f79ff4c8ee108dff1368d", "score": "0.5193857", "text": "init(onTrackingCb) {\n if (this.isInitiated) {\n return;\n }\n\n this.isInitiated = true;\n this.onTrackingCb = onTrackingCb;\n\n Djaty.initApp._attachInitNodeListenersToOurEvents([{\n node: window,\n eventName: 'error',\n cb: exceptionTracker._errHandler,\n }]);\n }", "title": "" }, { "docid": "55ac9578740893d2ec7fa212e3e5e973", "score": "0.5192542", "text": "function bindToFunction(target, entity, evt, method){\n\t target.listenTo(entity, evt, method, target);\n\t }", "title": "" }, { "docid": "8edbeacbe77f75dd5bd8889f73aabe57", "score": "0.5185228", "text": "function _addListener(element, eventName, handler)\n\t{\n\t\telement\t= $(element);\n\t\telement.addListener.apply(element, Array.slice(arguments, 1));\n\t\treturn element;\n\t}", "title": "" }, { "docid": "750874e45845aa779fd9ef01a74d709a", "score": "0.5182596", "text": "function bindToFunction(target, entity, evt, method){\n target.listenTo(entity, evt, method);\n }", "title": "" }, { "docid": "750874e45845aa779fd9ef01a74d709a", "score": "0.5182596", "text": "function bindToFunction(target, entity, evt, method){\n target.listenTo(entity, evt, method);\n }", "title": "" }, { "docid": "2c5d49170744ca4aba65d1d652503938", "score": "0.5178824", "text": "_bindEventListenerCallbacks() {\n this._onFocusBound = this._onFocus.bind(this);\n this._onBlurBound = this._onBlur.bind(this);\n this._onInputBound = this._onInput.bind(this);\n }", "title": "" }, { "docid": "cc3be8d24fdc28aae1d59d702708dae9", "score": "0.5174719", "text": "function init() {\n\n cacheDOM();\n events();\n }", "title": "" }, { "docid": "29512e8f34387db71b4d83f8def7f8de", "score": "0.516679", "text": "attach() {\n document.addEventListener('mousedown', this[onMouseDown], true);\n }", "title": "" }, { "docid": "29512e8f34387db71b4d83f8def7f8de", "score": "0.516679", "text": "attach() {\n document.addEventListener('mousedown', this[onMouseDown], true);\n }", "title": "" }, { "docid": "5d82ee06877773c2ed44ddec1cd00078", "score": "0.5165712", "text": "attach(listener) {\r\n\r\n this.listener.push(listener);\r\n }", "title": "" }, { "docid": "7e47c7a439a4cf757dc11a80129c0a0e", "score": "0.5164227", "text": "function init() {\n bindEvents();\n }", "title": "" }, { "docid": "ace490a27d80da4cfa7a3af7ddcc39c5", "score": "0.5158002", "text": "function addResizeListener(element, fn, context){\n var events = element[resizeHandlers];\n\n if (!events)\n events = element[resizeHandlers] = [];\n\n if (!events.resizeSensor_)\n {\n // NOTE: we don't use `onresize` event in IE, because it doesn't fire when\n // element inserting into document;\n // overflow/underflow events also not using as target for remove from browsers;\n // so using iframe is better solution for now\n\n var handler = function(){\n events.forEach(function(handler){\n handler.fn.call(handler.context, element);\n });\n };\n\n var init = function(){\n if (getComputedStyle(element, 'position') == 'static')\n element.style.position = 'relative';\n\n var document = sensor.contentDocument;\n var win = document.defaultView || document.parentWindow;\n win.onresize = handler;\n win.document.body.onresize = handler;\n\n handler();\n };\n\n var sensor = iframeSensorProto.cloneNode();\n\n // https://github.com/jugglinmike/srcdoc-polyfill/blob/master/srcdoc-polyfill.js\n // Explicitly set the iFrame's window.location for\n // compatability with IE9, which does not react to changes in\n // the `src` attribute when it is a `javascript:` URL, for\n // some reason\n if (sensor.contentWindow)\n sensor.contentWindow.location = STUB_DOCUMENT_SRC;\n\n if (sensor.attachEvent) // IE8 don't fire load event otherwise\n sensor.attachEvent('onload', init);\n else\n sensor.onload = init;\n\n element.appendChild(sensor);\n\n events.resizeSensor_ = sensor;\n }\n\n events.push({\n fn: fn,\n context: context || element\n });\n\n return element;\n }", "title": "" }, { "docid": "dd8ef4b658c31133635509df90c7b2e0", "score": "0.5156476", "text": "set initialFunction(func){\n if(typeof func !== 'function'){ \n console.log('WARNING: initialFunction is required to be a function. Please modify your code accordingly.\\n\\nExecution terminating...');\n return;\n }\n this._initialFunction = func;\n }", "title": "" }, { "docid": "4ed49e759732f2b9cf38706004b0cafa", "score": "0.51524824", "text": "function initialize(){\n\t \t//bindEvents();\n\t}", "title": "" }, { "docid": "168eaeaf43cbfdb16d74f46b39c5b95b", "score": "0.5152132", "text": "on(eventName, callBack, callOnce = false) {\n if (!eventName) {\n throw new SyntaxError(\"must specifc the name of event to listen\");\n } else if (typeof eventName != 'string') {\n let errMessage = \"expected argument 1 to be of type string. recieved type of \" + typeof eventName;\n throw new TypeError(errMessage);\n }\n\n if (!callBack) {\n throw new SyntaxError(\"must include callback to be run on event\");\n } else if (typeof callBack != 'function') {\n let errMessage = \"expected argument 2 to be of type function. recieved type of \" + typeof callBack;\n throw new TypeError(errMessage);\n }\n\n this.events[eventName] = this.events[eventName] || [];\n let listener = new Listener(callBack, callOnce);\n this.events[eventName].push(listener);\n }", "title": "" }, { "docid": "0b22f5f8918a4f8daae7ae12ba838c58", "score": "0.5150748", "text": "function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }", "title": "" }, { "docid": "0b22f5f8918a4f8daae7ae12ba838c58", "score": "0.5150748", "text": "function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }", "title": "" }, { "docid": "6f8b0cfdfcc031b9530e6fa0ed58255d", "score": "0.5147222", "text": "onEvent(eventName, listener = () => {}) {\n if (!this.events[eventName]) {\n if (eventName === 'click') {\n this.events.click = []\n\n this.node.addEventListener(\n 'click',\n passEventTo.bind(this, this.events.click, {\n fromUser: true,\n from: this\n })\n )\n } else if (eventName === 'contextmenu') {\n this.events.contextmenu = []\n\n this.node.addEventListener(\n 'contextmenu',\n passEventTo.bind(this, this.events.contextmenu, {\n fromUser: true,\n from: this\n })\n )\n } else {\n this.events[eventName] = []\n }\n }\n\n this.events[eventName].push(listener)\n }", "title": "" }, { "docid": "1cdd023e0c9b5485a3b5f998e5b9459a", "score": "0.5143958", "text": "attachedCallback () {\n this._mapElement = document.getElementById(this.getAttribute('map'));\n\n this.addEventListener('click', this.handleClick);\n\n if (this._mapElement.ready) {\n this.init();\n } else {\n this._mapElement.addEventListener('ready', (e) => {\n this.init();\n });\n }\n }", "title": "" }, { "docid": "90dae53484a33143ccf283aefbc60f4d", "score": "0.51427925", "text": "on(event, callback) { this._ee.on(event, callback) }", "title": "" }, { "docid": "8a6392c2c0fe3fb26d001c9625b9781f", "score": "0.51418203", "text": "function on(element, type, listener) {\n element.addEventListener(type, listener, false);\n }", "title": "" }, { "docid": "47044e2f543b258796c6e1540c5fc96e", "score": "0.51405525", "text": "setupListeners() {\n\t\t// Media query listener.\n\t\t// We're using this instead of resize + debounce because it should be more efficient than that combo.\n\t\tthis.mq.addListener(this.setMQ);\n\n\t\t// Menu toggle listener.\n\t\tthis.addEventListener(this.$menuToggle, 'click', this.listenerMenuToggleClick);\n\n\t\t// Submenu listeners.\n\t\t// Mainly applies to the anchors of submenus.\n\t\tthis.$submenus.forEach(($submenu) => {\n\t\t\tconst $anchor = $submenu.previousElementSibling;\n\n\t\t\tif (this.settings.action === 'hover') {\n\t\t\t\tthis.addEventListener($anchor, 'focus', this.listenerSubmenuAnchorFocus);\n\t\t\t}\n\n\t\t\tthis.addEventListener($anchor, 'click', this.listenerSubmenuAnchorClick);\n\t\t});\n\n\t\t// Document specific listeners.\n\t\t// Mainly used to close any open menus.\n\t\tthis.addEventListener(document, 'click', this.listenerDocumentClick);\n\t\tthis.addEventListener(document, 'keyup', this.listenerDocumentKeyup);\n\t}", "title": "" }, { "docid": "d5471bff52f4259d8ca2988e1514fccc", "score": "0.5138174", "text": "function init(callback) {\n\n if (isInitialized) {\n if (callback) {\n callback();\n }\n return;\n }\n else if (callback) {\n callbacks.push(callback);\n }\n\n // We expect <body> to be defined now, but we're being defensive\n // (perhaps future extension will init and call us very early).\n if (document.body) {\n isInitialized = true;\n body = document.body;\n docElem = document.documentElement;\n $origBody = $(body);\n refreshOriginalBodyInfo();\n executeCallbacks();\n\n domEvents.on(window, 'resize', function () {\n cachedDocumentScrollHeight = null;\n cachedDocumentScrollWidth = null;\n });\n\n events.on('zoom', function () {\n cachedDocumentScrollHeight = null;\n cachedDocumentScrollWidth = null;\n });\n\n return;\n }\n\n // No document.body yet\n if (document.readyState !== 'loading') {\n init(callback);\n }\n else {\n document.addEventListener('DOMContentLoaded', function() {\n init(callback);\n });\n }\n\n // Not necessary to use CSS will-change with element.animate()\n // Putting this on the <body> is too much. We saw the following message in Firefox's console:\n // Will-change memory consumption is too high. Surface area covers 2065500 pixels, budget is the document\n // surface area multiplied by 3 (450720 pixels). All occurrences of will-change in the document are\n // ignored when over budget.\n // shouldUseWillChangeOptimization =\n // typeof body. style.willChange === 'string' && !shouldUseElementDotAnimate;\n }", "title": "" }, { "docid": "1d7ff72abc17287968876f571f0c0ed7", "score": "0.5137842", "text": "function init() {\n windowLoadListeners();\n }", "title": "" }, { "docid": "79b2bd152ee87574697d5a489454fb70", "score": "0.51368016", "text": "function addEventListeners() {\n\n\t\teventsAreBound = true;\n\n\t\twindow.addEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.addEventListener( 'resize', onWindowResize, false );\n\n\t\tif( config.touch ) {\n\t\t\tdom.wrapper.addEventListener( 'touchstart', onTouchStart, false );\n\t\t\tdom.wrapper.addEventListener( 'touchmove', onTouchMove, false );\n\t\t\tdom.wrapper.addEventListener( 'touchend', onTouchEnd, false );\n\n\t\t\t// Support pointer-style touch interaction as well\n\t\t\tif( window.navigator.pointerEnabled ) {\n\t\t\t\t// IE 11 uses un-prefixed version of pointer events\n\t\t\t\tdom.wrapper.addEventListener( 'pointerdown', onPointerDown, false );\n\t\t\t\tdom.wrapper.addEventListener( 'pointermove', onPointerMove, false );\n\t\t\t\tdom.wrapper.addEventListener( 'pointerup', onPointerUp, false );\n\t\t\t}\n\t\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\t\t// IE 10 uses prefixed version of pointer events\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t\t}\n\t\t}\n\n\t\tif( config.keyboard ) {\n\t\t\tdocument.addEventListener( 'keydown', onDocumentKeyDown, false );\n\t\t\tdocument.addEventListener( 'keypress', onDocumentKeyPress, false );\n\t\t}\n\n\t\tif( config.progress && dom.progress ) {\n\t\t\tdom.progress.addEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\tif( config.focusBodyOnPageVisibilityChange ) {\n\t\t\tvar visibilityChange;\n\n\t\t\tif( 'hidden' in document ) {\n\t\t\t\tvisibilityChange = 'visibilitychange';\n\t\t\t}\n\t\t\telse if( 'msHidden' in document ) {\n\t\t\t\tvisibilityChange = 'msvisibilitychange';\n\t\t\t}\n\t\t\telse if( 'webkitHidden' in document ) {\n\t\t\t\tvisibilityChange = 'webkitvisibilitychange';\n\t\t\t}\n\n\t\t\tif( visibilityChange ) {\n\t\t\t\tdocument.addEventListener( visibilityChange, onPageVisibilityChange, false );\n\t\t\t}\n\t\t}\n\n\t\t// Listen to both touch and click events, in case the device\n\t\t// supports both\n\t\tvar pointerEvents = [ 'touchstart', 'click' ];\n\n\t\t// Only support touch for Android, fixes double navigations in\n\t\t// stock browser\n\t\tif( UA.match( /android/gi ) ) {\n\t\t\tpointerEvents = [ 'touchstart' ];\n\t\t}\n\n\t\tpointerEvents.forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "79b2bd152ee87574697d5a489454fb70", "score": "0.51368016", "text": "function addEventListeners() {\n\n\t\teventsAreBound = true;\n\n\t\twindow.addEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.addEventListener( 'resize', onWindowResize, false );\n\n\t\tif( config.touch ) {\n\t\t\tdom.wrapper.addEventListener( 'touchstart', onTouchStart, false );\n\t\t\tdom.wrapper.addEventListener( 'touchmove', onTouchMove, false );\n\t\t\tdom.wrapper.addEventListener( 'touchend', onTouchEnd, false );\n\n\t\t\t// Support pointer-style touch interaction as well\n\t\t\tif( window.navigator.pointerEnabled ) {\n\t\t\t\t// IE 11 uses un-prefixed version of pointer events\n\t\t\t\tdom.wrapper.addEventListener( 'pointerdown', onPointerDown, false );\n\t\t\t\tdom.wrapper.addEventListener( 'pointermove', onPointerMove, false );\n\t\t\t\tdom.wrapper.addEventListener( 'pointerup', onPointerUp, false );\n\t\t\t}\n\t\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\t\t// IE 10 uses prefixed version of pointer events\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t\t}\n\t\t}\n\n\t\tif( config.keyboard ) {\n\t\t\tdocument.addEventListener( 'keydown', onDocumentKeyDown, false );\n\t\t\tdocument.addEventListener( 'keypress', onDocumentKeyPress, false );\n\t\t}\n\n\t\tif( config.progress && dom.progress ) {\n\t\t\tdom.progress.addEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\tif( config.focusBodyOnPageVisibilityChange ) {\n\t\t\tvar visibilityChange;\n\n\t\t\tif( 'hidden' in document ) {\n\t\t\t\tvisibilityChange = 'visibilitychange';\n\t\t\t}\n\t\t\telse if( 'msHidden' in document ) {\n\t\t\t\tvisibilityChange = 'msvisibilitychange';\n\t\t\t}\n\t\t\telse if( 'webkitHidden' in document ) {\n\t\t\t\tvisibilityChange = 'webkitvisibilitychange';\n\t\t\t}\n\n\t\t\tif( visibilityChange ) {\n\t\t\t\tdocument.addEventListener( visibilityChange, onPageVisibilityChange, false );\n\t\t\t}\n\t\t}\n\n\t\t// Listen to both touch and click events, in case the device\n\t\t// supports both\n\t\tvar pointerEvents = [ 'touchstart', 'click' ];\n\n\t\t// Only support touch for Android, fixes double navigations in\n\t\t// stock browser\n\t\tif( UA.match( /android/gi ) ) {\n\t\t\tpointerEvents = [ 'touchstart' ];\n\t\t}\n\n\t\tpointerEvents.forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.51315296", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.51315296", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.51315296", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.51315296", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "367d17dce2013748c63108ca44335269", "score": "0.51284206", "text": "function bindToFunction(target, entity, evt, method) {\n target.listenTo(entity, evt, method);\n }", "title": "" }, { "docid": "367d17dce2013748c63108ca44335269", "score": "0.51284206", "text": "function bindToFunction(target, entity, evt, method) {\n target.listenTo(entity, evt, method);\n }", "title": "" }, { "docid": "367d17dce2013748c63108ca44335269", "score": "0.51284206", "text": "function bindToFunction(target, entity, evt, method) {\n target.listenTo(entity, evt, method);\n }", "title": "" }, { "docid": "367d17dce2013748c63108ca44335269", "score": "0.51284206", "text": "function bindToFunction(target, entity, evt, method) {\n target.listenTo(entity, evt, method);\n }", "title": "" }, { "docid": "8bd14e9cb28f9e9ba4b0ce6dd911965b", "score": "0.51174796", "text": "listenerNotNull(element, event, method) {\n\n\t\tif (element !== null) {\n\t\t\telement.addEventListener(event, method);\n\t\t}\n\t}", "title": "" } ]
d1b1c8e3978981f84666e4a450b63a32
TODO optimise for this common case
[ { "docid": "92d82806e211dc0e7173c30542446594", "score": "0.0", "text": "function interpolate(from, to, direction, stream) {\n Object(_circle__WEBPACK_IMPORTED_MODULE_1__[\"circleStream\"])(stream, radius, delta, direction, from, to);\n }", "title": "" } ]
[ { "docid": "a8da3a494b4e64a48ea4b6c527214764", "score": "0.5371035", "text": "function _0x4d320b(_0x118194,_0x4d5573){0x0;}", "title": "" }, { "docid": "13df25260e4440a35d55566645faf853", "score": "0.5123522", "text": "function mifuncion(){}", "title": "" }, { "docid": "a14a82fc30745b59820199a46d30b5e7", "score": "0.4973396", "text": "constructor(_) { return (_ = super(_)).init(), _; }", "title": "" }, { "docid": "c17a9674d03bc921693de293dffc6aca", "score": "0.49502125", "text": "function ie(e){return Array.isArray(e)?e.length>1?{$or:[].concat(e.map(e=>Object.assign({},e)))}:Object.assign({},e[0]):Object.assign({},e)}", "title": "" }, { "docid": "c4e55674d585f2ef29252d4eaf998c60", "score": "0.4875368", "text": "function i(e){return void 0===e&&(e=null),Object(o[\"n\"])(null!==e?e:r)}", "title": "" }, { "docid": "24c3cf0b274b840714c103b58a5da824", "score": "0.4793672", "text": "get PCHosted() {}", "title": "" }, { "docid": "24c3cf0b274b840714c103b58a5da824", "score": "0.4793672", "text": "get PCHosted() {}", "title": "" }, { "docid": "9271df66f27ffe8d78f86a505e2a758f", "score": "0.4792781", "text": "function Common (){}", "title": "" }, { "docid": "b5544ff5681aa4424b67e63f2c0bba58", "score": "0.47672242", "text": "function i(e){return void 0===e&&(e=null),Object(o[\"i\"])(null!==e?e:r)}", "title": "" }, { "docid": "600ec276ca6549fb793a827386771833", "score": "0.47347984", "text": "function Rd(a){return a&&a.ub?a.cb():a}", "title": "" }, { "docid": "c94f232a3506f7c647e50f0faeb7c150", "score": "0.4717486", "text": "headValue() {}", "title": "" }, { "docid": "8177766787ad4ec3cb8156bc40da1ee1", "score": "0.46752974", "text": "function e1827621() { return 'atch '; }", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.46466115", "text": "_firstRendered() { }", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.46466115", "text": "_firstRendered() { }", "title": "" }, { "docid": "d6aa4852c18130f8ea757f1d1b269dcd", "score": "0.4645784", "text": "function utility() {}", "title": "" }, { "docid": "9f1610cc8eb4774b5bc463f206305d7c", "score": "0.464552", "text": "function berechneSchaltjahr() {\n \n}", "title": "" }, { "docid": "df9393c6a6fdd0ac474c681b7eed250d", "score": "0.46323273", "text": "function ha(){}", "title": "" }, { "docid": "e24a8cb69dfdd7e8d4fb4fbebb9ffbb6", "score": "0.4606487", "text": "function parseread1(blob) { blob.l+=1; return; }", "title": "" }, { "docid": "a849cef664f1343be8a787478b4b2b39", "score": "0.46040875", "text": "static getTitleWithId2(media) {\n\t\treturn; //your solution...\n\t}", "title": "" }, { "docid": "209d701fd8d8b8894223e29205a1cd95", "score": "0.45742896", "text": "function i(e){return void 0===e&&(e=null),Object(r[\"m\"])(null!==e?e:o)}", "title": "" }, { "docid": "e4e55e6ed76aa7a9effdd9bb51b7d26b", "score": "0.4560026", "text": "function supportOptionalChaining(){\ntry{\n const creators={\n\n }\n creators.inter?.name;\n return true; \n\n}catch(e){\n return false;\n}\n\n}", "title": "" }, { "docid": "859e3c9c9722cfe128a9215cca70b299", "score": "0.4558808", "text": "function oc(){}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.4547002", "text": "prepare() {}", "title": "" }, { "docid": "37fa3272b535534a2eb4ed0d720e2dab", "score": "0.4545855", "text": "_generateInitialValue() { return null; }", "title": "" }, { "docid": "fcb04715759b506572235b15f3a6bd18", "score": "0.4534062", "text": "get srcEcu() { return this.data[6]; }", "title": "" }, { "docid": "abcd36756fa01b57aa4fa5445dbe58bd", "score": "0.45319712", "text": "function readthis(){defalt(); build(); localn(); }", "title": "" }, { "docid": "a92e7a566c0693bfee0f0aa764c85102", "score": "0.4530343", "text": "function accessesingData2() {\n\n}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.4527567", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.4527567", "text": "function miFuncion(){}", "title": "" }, { "docid": "fa0481de6413b5a96658a73a438b6e91", "score": "0.45083135", "text": "function o77() {\n try {\nif (index < length) {\n try {\ntry {\n try {\no39.o25[index].o17();\n}catch(e){}\n } catch (o78) {\n try {\no39.o67(o78);\n}catch(e){}\n try {\nreturn null;\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o79;\n}catch(e){}\n }\n}catch(e){}\n try {\no39.o62();\n}catch(e){}\n try {\nreturn null;\n}catch(e){}\n }", "title": "" }, { "docid": "0d928d63482878e0044e0b857deed634", "score": "0.45004842", "text": "function me(e){return Array.isArray(e)?e.length>1?{$or:[].concat(e.map(e=>Object.assign({},e)))}:Object.assign({},e[0]):Object.assign({},e)}", "title": "" }, { "docid": "fba3120ef1a3aed5c52b19f266bce42d", "score": "0.44930202", "text": "function f1(a,b){this.Rh=[];this.Jk=a;this.Zj=b||null;this.Cg=this.uf=!1;this.Ve=void 0;this.jj=this.ll=this.bi=!1;this.Th=0;this.sd=null;this.ci=0}", "title": "" }, { "docid": "a5a4e05c3952856aca2d617bc6dc2c83", "score": "0.4482717", "text": "GetCommonFields(...arg){\n const DescendingOrder = (d={})=>{\n let key = [] , dtAndKey = {}, newAsc = { }\n for(let k in d || {}){\n try{\n let dt = new Date(k.replace(\"_\")).getTime()\n key.push(dt);\n dtAndKey[dt] = k\n }catch(e){}\n }\n \n let a = key.sort((a, b) => b - a);\n for(let e of a){\n let k = dtAndKey[e]\n newAsc[k] = d[k] \n }\n return newAsc\n }\n try {\n const arr = []\n for(let v of arg){\n if( v && typeof v==='object' && !Array.isArray(v)){\n arr.push(DescendingOrder(v))\n }\n }\n \n const newArr = []\n function hasProperty(key){\n let l = arr.length , res = false\n for(let i=0;i<l;++i){\n let a = arr[i]\n if( a && 'object'===typeof a && !Array.isArray(a) && key){\n if(a.hasOwnProperty(key)){\n res = true;\n }else {\n res = false\n break;\n }\n }\n }\n return res\n }\n \n for(let i in arr){\n let k = arr[i], nP = { }\n if( k && 'object'===typeof k && !Array.isArray(k)){ \n for( let ik in k){\n if(hasProperty(ik)){\n nP[ik] = k[ik]\n }\n }\n }\n newArr.push(nP)\n \n }\n return newArr\n } catch (e) {\n return `error : - ${e}`\n }\n \n }", "title": "" }, { "docid": "7f0d9de98f72c9dc0d97c64c5b928057", "score": "0.4481532", "text": "function s(){r.call(this),this.idx={}}", "title": "" }, { "docid": "d998457f98b93cec16bbd7d4131f1bec", "score": "0.44618902", "text": "function l_(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return\"object\"!==Object(mi[\"a\"])(n[n.length-1])&&(t=n.pop()),Td()(n).call(n,1).reduce((function(e,n,r){return u_()(e,n,t)}),n[0])}", "title": "" }, { "docid": "b8a11ae8f7ed72282b6caf74c223d045", "score": "0.4452179", "text": "conditional() {\n\n\t}", "title": "" }, { "docid": "95fcd5c786c707d36782c5cdae4031da", "score": "0.4447443", "text": "get exactMatch() {return 0}", "title": "" }, { "docid": "2b0325238811ec10e1a17f6dd60c5147", "score": "0.4445441", "text": "function identify(){\r\n\r\n}", "title": "" }, { "docid": "45e60d4bfe3572d350202602ff7f91bc", "score": "0.4437125", "text": "function zs(e,...t){return Gi(e,null,void 0)}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.44355687", "text": "function r(){}", "title": "" }, { "docid": "7840a8ed23d7a047b4da62c59d66ffaa", "score": "0.4431847", "text": "function reElement () {}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.4428758", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.4428758", "text": "function ba(){}", "title": "" }, { "docid": "028818142e65baf629a68bd17566e076", "score": "0.4425432", "text": "function e968739() { return 'XOb'; }", "title": "" }, { "docid": "f1abbae64af6b85200e2769339c63483", "score": "0.4424749", "text": "function intermediate() {}", "title": "" }, { "docid": "d2fdf8eb4c76e73e4ac5a8ff2a845098", "score": "0.44227403", "text": "function a(b){if(b&&b.nodeType||void 0===b||\"object\"!=typeof b)return b;if(Array.isArray(b))return[].concat(b);if(\"object\"==typeof b){let c={};for(let d in b)c[d]=a(b[d]);return c}return b}", "title": "" }, { "docid": "2c2b6aa3835e1f7557486e7537bdf491", "score": "0.44195703", "text": "function i(){if(fs){var e=ds;throw fs=!1,ds=null,e}}", "title": "" }, { "docid": "eb4c3821413979890ebc8c69a45a2626", "score": "0.44111386", "text": "function eh(a,b){this.g=[];this.v=a;this.s=b||null;this.f=this.a=!1;this.c=void 0;this.u=this.A=this.i=!1;this.h=0;this.b=null;this.l=0}", "title": "" }, { "docid": "4bd0c0b8afc8277d5e5aa2faccc34281", "score": "0.44095835", "text": "comparison() {\n\n\t}", "title": "" }, { "docid": "daf946f4fb9f1aac2395d1c36c005748", "score": "0.4408593", "text": "function eh(a,b){this.g=[];this.v=a;this.s=b||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.j=!1;this.h=0;this.b=null;this.l=0}", "title": "" }, { "docid": "ec9510c0af4acb7a0816c9d0a177d39b", "score": "0.4407281", "text": "findByPathCompression (val) {\n let path = []\n let current = val\n while(this.data[current] >= 0) { // capture the case when things are not negtive\n path.push(current);\n current = this.data[current];\n }\n for (var i = 0; i < path.length; i++) {\n this.data[path[i]] = current\n }\n return current;\n }", "title": "" }, { "docid": "9cb3a3572242a9bdb4c66d44c601f4fa", "score": "0.44053024", "text": "type(obj) {\n let offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;\n }", "title": "" }, { "docid": "2c185e5ee2f29a1ddd80619bac78128d", "score": "0.44045633", "text": "static __initStatic2() {this.SUBSEQUENT = 0;}", "title": "" }, { "docid": "eeecd25e623da591522f6140feaa2399", "score": "0.44030446", "text": "function accessesingData3() {\n\n}", "title": "" }, { "docid": "7c0e34db6f6d4451c612517abc54877a", "score": "0.43980473", "text": "size() {\n throw \"not implemented\";\n }", "title": "" }, { "docid": "6b3ec2c19aa89fbda644a974d5effeb5", "score": "0.43937138", "text": "function fZb(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}", "title": "" }, { "docid": "c193b53d83c11cb0b47e1763ee507515", "score": "0.4387899", "text": "function firstFn() {}", "title": "" }, { "docid": "cfdac927de784f7004572ddcdd9b6ad6", "score": "0.43872854", "text": "function Mr(e,t){for(var n in t)e[n]=t[n];return e}", "title": "" }, { "docid": "865366dcdcc69225e98b408bde22a706", "score": "0.43857095", "text": "function X(e){return e.length?e:null}", "title": "" }, { "docid": "c3aad09c1a3914006c44617bb7eb3340", "score": "0.43852764", "text": "getData() { }", "title": "" }, { "docid": "eef062c162d4cd6a58b9200268d588e3", "score": "0.43845618", "text": "__init4() {this.modificationMarker = 0;}", "title": "" }, { "docid": "dab2cfd48e7573b51e10d8421297dbf9", "score": "0.4383406", "text": "function B(b,c,d){var e,f;\n// note: very similar logic is in View's reportExternalDrop\nreturn d&&(e=a.extend({},d,c),f=w(s(e))[0]),f?A(b,f):C(b)}", "title": "" }, { "docid": "525b2809d228398f0b3f388f5204e2cd", "score": "0.43799585", "text": "static checkUniqueIds(media) {\n\t\treturn; //your solution...\n\t}", "title": "" }, { "docid": "79c42d8b598c58c7b059b99af268bc95", "score": "0.43787807", "text": "function RCTFH() {}", "title": "" }, { "docid": "06f6c934d4256a08703276a5ba88ccad", "score": "0.4378546", "text": "function g(a){var b={};return oa.each(a.match(Ea)||[],function(a,c){b[c]=!0}),b}", "title": "" }, { "docid": "06f6c934d4256a08703276a5ba88ccad", "score": "0.4378546", "text": "function g(a){var b={};return oa.each(a.match(Ea)||[],function(a,c){b[c]=!0}),b}", "title": "" }, { "docid": "8486ad6d21d7562557ca4dea55643260", "score": "0.43727392", "text": "function Match () {}", "title": "" }, { "docid": "7cb34532677a30fc4f84aa20c0437460", "score": "0.43687427", "text": "function a_e(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "title": "" }, { "docid": "129a83bac1a9c65d7bb3abea96d3fa92", "score": "0.4365945", "text": "conflicts() {}", "title": "" }, { "docid": "88b86633871c09b2ba6fd1473318d5fd", "score": "0.43628585", "text": "function e868869() { return ' va'; }", "title": "" }, { "docid": "f2913e8e15615faede334aaab7930e19", "score": "0.43604362", "text": "static complexRetrieve6(media) {\n\t\treturn; //your solution...\n\t}", "title": "" }, { "docid": "21737b4ca2b27924a54c7f45b7ece51f", "score": "0.4354553", "text": "function CND_EXTHIDDEN()\r\n\t{\r\n\t}", "title": "" }, { "docid": "14799b539cfb4f98158c02f6ebb58ab1", "score": "0.43540144", "text": "function e$a(t,e,i){const o=\"?\"===t[t.length-1]?t.slice(0,-1):t;if(null!=i.getItemAt||Array.isArray(i)){const t=parseInt(o,10);if(!isNaN(t))return Array.isArray(i)?i[t]:i.getItemAt(t)}const u=e$9(i);return e?i$8(u,o)?u.get(o):i[o]:i$8(u,o)?u.internalGet(o):i[o]}", "title": "" }, { "docid": "6b27bef00d7aa9a6d94452e8383d1e86", "score": "0.43532395", "text": "function fm(){}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.434869", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.434869", "text": "function TMP() {}", "title": "" }, { "docid": "6c763d8731cad7189659792c4b2c0199", "score": "0.43477145", "text": "function Internal(){\n\n\t}", "title": "" }, { "docid": "31a11436df6e0f60c6211cdb6944581d", "score": "0.43437022", "text": "function fehlersuche2() {\n \n}", "title": "" }, { "docid": "87afe3f67b13320be63e49c783cbd6b0", "score": "0.43432084", "text": "function forLooopEX2(){\n\n}", "title": "" } ]
4a40b1d6736520a6e47de17b5c8bb845
CONCATENATED MODULE: ../reactdevtoolsshared/src/devtools/ContextMenu/useContextMenu.js Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
[ { "docid": "f9e4d84c72f405707ec699453c070518", "score": "0.6820256", "text": "function useContextMenu({\n data,\n id,\n ref\n}) {\n const {\n showMenu\n } = Object(react[\"useContext\"])(RegistryContext);\n Object(react[\"useEffect\"])(() => {\n if (ref.current !== null) {\n const handleContextMenu = event => {\n event.preventDefault();\n event.stopPropagation();\n const pageX = event.pageX || event.touches && event.touches[0].pageX;\n const pageY = event.pageY || event.touches && event.touches[0].pageY;\n showMenu({\n data,\n id,\n pageX,\n pageY\n });\n };\n\n const trigger = ref.current;\n trigger.addEventListener('contextmenu', handleContextMenu);\n return () => {\n trigger.removeEventListener('contextmenu', handleContextMenu);\n };\n }\n }, [data, id, showMenu]);\n}", "title": "" } ]
[ { "docid": "4bfa084e7aeebebd9034ccdf4ba44727", "score": "0.68529135", "text": "showContextMenuButton(event, {x, y}) {\n var menu = this.contextMenu;\n\n if(_.isUndefined(menu)) return;\n\n y += 20;\n\n this.contextMenuXPos = x;\n this.contextMenuYPos = y;\n menu.reset().move(x, y);\n\n // Commenting out copy/paste actions for now until mobile copy/paste handling is properly solved.\n\n // if(!this.readOnly && this.copyPasteHandler.copiedValue) {\n // menu.add('Paste', this.pasteFromMenu);\n // }\n if(this.selection) {\n // menu.add('Copy', this.copyFromMenu);\n menu.add('Analyze Fragment', this.analyzeFragment);\n\n if(!this.readOnly) {\n menu.add('Add annotation', 'edit', this.addAnnotationFromMenu);\n // menu.add('Add annotation', this.addAnnotationFromMenu);\n }\n }\n\n _.chain(Gentle.plugins).where({type: 'sequence-canvas-context-menu'}).each((plugin) => {\n var data = plugin.data;\n if(!(!data.selectionOnly || (data.selectionOnly && this.selection))) return;\n if(!_.isUndefined(data.visible) && !data.visible()) return;\n // menu.add(data.title, data.icon, data.callback)\n menu.add(data.title, _.bind(data.callback, this));\n });\n\n if(this.selection && this.autoCorrectable()) {\n menu.add(this.selectionReplacementName(this.selection), this.replaceSelection);\n }\n\n if(menu.menuItems.length || menu.menuIcons.length) {\n menu.show();\n } else {\n menu.hide();\n }\n\n }", "title": "" }, { "docid": "b918ce68d3acab937124247228323ac4", "score": "0.65492165", "text": "function onContextMenu ({ id }) {\n if (id === 'vue-inspect-instance') {\n const src = `window.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__`\n\n chrome.devtools.inspectedWindow.eval(src, function (res, err) {\n if (err) {\n console.log(err)\n }\n if (typeof res !== 'undefined' && res) {\n panelAction(() => {\n chrome.runtime.sendMessage('vue-get-context-menu-target')\n }, 'Open Vue devtools to see component details')\n } else {\n pendingAction = null\n toast('No Vue component was found', 'warn')\n }\n })\n }\n}", "title": "" }, { "docid": "94d09d1863d942e05b472147dda63021", "score": "0.643509", "text": "_onContextMenu (event) {\n domHelpers.stopAndPrevent(event)\n const selectionState = this.editorState.selectionState\n const context = _getContext(selectionState)\n if (context) {\n const menuSpec = this.context.config.getToolPanel(`context-menu:${context}`)\n if (menuSpec) {\n const desiredPos = { x: event.clientX, y: event.clientY + 10 }\n this.send('requestPopover', {\n requester: this,\n desiredPos,\n content: menuSpec,\n position: 'relative'\n })\n }\n }\n }", "title": "" }, { "docid": "9a01e9f1a104019e7fad1abd27684c37", "score": "0.6399353", "text": "onContextmenu( /*event*/ ) {}", "title": "" }, { "docid": "8385e7e0ccfa525f5730b06f893a06b3", "score": "0.636469", "text": "@action\n setupContextMenu() {\n let menu = this.resizableColumns\n .getColumnVisibility()\n .reduce((arr, { id, name, visible }) => {\n let check = `${CHECK_HTML}`;\n if (!visible) {\n check = `<span style='opacity:0'>${check}</span>`;\n }\n name = `${check} ${name}`;\n arr.push({\n name,\n title: name,\n fn: bind(this, this.toggleColumnVisibility, id),\n });\n return arr;\n }, []);\n\n this.showBasicContext = (e) => {\n basicContext.show(menu, e);\n };\n\n const listHeader = this.el.querySelector('.list__header');\n if (listHeader) {\n listHeader.addEventListener('contextmenu', this.showBasicContext);\n }\n }", "title": "" }, { "docid": "25274badaf42fe6cd7ad49249cdeb30a", "score": "0.6322173", "text": "showCoreContextMenu(position) {\n this.setState({\n tappedPosition: position\n }, () => {\n this.showCoreMenu();\n });\n }", "title": "" }, { "docid": "576f7e164aea4bbf9adc3703fab652a7", "score": "0.62795657", "text": "function ContextMenuItem_ContextMenuItem({\n children,\n onClick,\n title\n}) {\n const {\n hideMenu\n } = Object(react[\"useContext\"])(RegistryContext);\n\n const handleClick = event => {\n onClick();\n hideMenu();\n };\n\n return /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: ContextMenuItem_default.a.ContextMenuItem,\n onClick: handleClick,\n onTouchEnd: handleClick\n }, children);\n}", "title": "" }, { "docid": "2e3eab85bbe48bf6e3aecf61cacb1477", "score": "0.6278642", "text": "function showContextMenu(event){\r\n\t\t\tevent.preventDefault();\r\n\t\t\twindow.htmlLoader.contextMenu.display(window.nativeWindow.stage, event.clientX, event.clientY);\r\n\t\t}", "title": "" }, { "docid": "49ef93935a944f7a12d7f8d5b936919e", "score": "0.6273454", "text": "function onContextMenu(cm, e) {\n\t if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n\t cm.display.input.onContextMenu(e);\n\t }", "title": "" }, { "docid": "6fd8de9b0358120bc713ef8473408e41", "score": "0.62322086", "text": "openContextMenu(e) {\n this.contextMenuOpen = !this.contextMenuOpen;\n if (e && window) {\n // Calculate placement based on cursor and scroll position\n this.contextPos = {\n posX: e.clientX + window.pageXOffset,\n posY: e.clientY + window.pageYOffset,\n };\n }\n }", "title": "" }, { "docid": "df1132f972a6f23f1338cc49ab915f5d", "score": "0.6214172", "text": "function onContextMenuActions() {\r\n\t//alert(event.srcElement.id);return;\r\n\tswitch (event.srcElement.menu) {\r\n\t\tcase 'bar' :\r\n\t\tcase 'none' :\r\n\t\t\tevent.returnValue = false;\r\n\t\t\tbreak;\r\n\t\tdefault :\r\n\t\t\twaMenuInstance = new waMenu(event.srcElement);\r\n\t\t\twaMenuInstance.open();\r\n\t\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "70acdd8fcd3898acdab41d864a25cd09", "score": "0.6183311", "text": "function useContextMenu() {\n contextMenu.Menu({\n label: 'Datawake Prefetch',\n contentScriptFile: data.url(\"js/datawake/selections.js\"),\n items: [\n contextMenu.Item({\n label: \"Add Entity\",\n data: \"add-entity\",\n context: contextMenu.SelectionContext()\n }),\n contextMenu.Item({\n label: \"Add Irrelevant Entity\",\n data: \"add-irrelevant-entity\",\n context: contextMenu.SelectionContext()\n }),\n contextMenu.Item({\n label: \"Add Custom Entity\",\n data: \"add-entity-custom\"\n }),\n contextMenu.Item({\n label: \"Add Custom Irrelevant Entity\",\n data: \"add-irrelevant-entity-custom\"\n }),\n contextMenu.Separator(),\n contextMenu.Item({\n label: \"Show Selections\",\n data: \"show-trail\"\n }),\n contextMenu.Item({\n label: \"Hide Selections\",\n data: \"hide-trail\"\n })\n ],\n onMessage: function(message) {\n var tabId = tabs.activeTab.id;\n switch (message.intent) {\n case \"add-entity-custom\":\n addCustomTrailEntity(datawakeInfo.domain.name, datawakeInfo.trail.name, message.text);\n break;\n case \"add-irrelevant-entity-custom\":\n addCustomIrrelevantTrailEntity(datawakeInfo.domain.name, datawakeInfo.trail.name, message.text);\n break;\n case \"add-entity\":\n addTrailEntity(datawakeInfo.domain.name, datawakeInfo.trail.name, message.text);\n break;\n case \"add-irrelevant-entity\":\n addIrrelevantTrailEntity(datawakeInfo.domain.name, datawakeInfo.trail.name, message.text);\n break;\n case \"show-trail\":\n showTrailEntities(datawakeInfo.domain.name, datawakeInfo.trail.name);\n break;\n case \"hide-trail\":\n hideSelections(\"trailentities\");\n break;\n }\n }\n });\n}", "title": "" }, { "docid": "b77f7359f1890a2d61d4e1f78a2b6191", "score": "0.61717844", "text": "function AppContextMenu() {\n this.__proto__ = AppContextMenu.prototype;\n this.initialize();\n }", "title": "" }, { "docid": "be08a6dc21a04de5f74a8ce76275e52c", "score": "0.6171464", "text": "function createContextMenu() {\n return new phosphor_menus_1.Menu([\n new phosphor_menus_1.MenuItem({\n text: '&Copy',\n icon: 'fa fa-copy',\n shortcut: 'Ctrl+C',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n text: 'Cu&t',\n icon: 'fa fa-cut',\n shortcut: 'Ctrl+X',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n text: '&Paste',\n icon: 'fa fa-paste',\n shortcut: 'Ctrl+V',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n type: phosphor_menus_1.MenuItem.Separator\n }),\n new phosphor_menus_1.MenuItem({\n text: '&New Tab',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n text: '&Close Tab',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n type: phosphor_menus_1.MenuItem.Check,\n text: '&Save On Exit',\n handler: saveOnExitHandler\n }),\n new phosphor_menus_1.MenuItem({\n type: phosphor_menus_1.MenuItem.Separator\n }),\n new phosphor_menus_1.MenuItem({\n text: 'Task Manager',\n disabled: true\n }),\n new phosphor_menus_1.MenuItem({\n type: phosphor_menus_1.MenuItem.Separator\n }),\n new phosphor_menus_1.MenuItem({\n text: 'More...',\n submenu: new phosphor_menus_1.Menu([\n new phosphor_menus_1.MenuItem({\n text: 'One',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n text: 'Two',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n text: 'Three',\n handler: logHandler\n }),\n new phosphor_menus_1.MenuItem({\n text: 'Four',\n handler: logHandler\n })\n ])\n }),\n new phosphor_menus_1.MenuItem({\n type: phosphor_menus_1.MenuItem.Separator\n }),\n new phosphor_menus_1.MenuItem({\n text: 'Close',\n icon: 'fa fa-close',\n handler: logHandler\n })\n ]);\n}", "title": "" }, { "docid": "16471ce90808351cc3cfa97d5b9bcafd", "score": "0.6157354", "text": "onContextMenu(e) {\n e.preventDefault();\n }", "title": "" }, { "docid": "171fc98654f41ca28fa99f3a45ce864e", "score": "0.61452234", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "171fc98654f41ca28fa99f3a45ce864e", "score": "0.61452234", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "171fc98654f41ca28fa99f3a45ce864e", "score": "0.61452234", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "67beeb3508c8485f1edb4c669f77d16b", "score": "0.60777795", "text": "_onContextMenuOpened(hints) {\n // ATTENTION: assuming that the context menu is always only showing enabled tools\n if (this._derivedState.hasEnabledItem) {\n let mouseBounds = hints.mouseBounds;\n this.el.removeClass('sm-hidden');\n let contextMenuWidth = this.el.htmlProp('offsetWidth');\n\n // By default, context menu are aligned left bottom to the mouse coordinate clicked\n this.el.css('top', mouseBounds.top);\n let leftPos = mouseBounds.left;\n // Must not exceed left bound\n leftPos = Math.max(leftPos, 0);\n // Must not exceed right bound\n let maxLeftPos = mouseBounds.left + mouseBounds.right - contextMenuWidth;\n leftPos = Math.min(leftPos, maxLeftPos);\n this.el.css('left', leftPos);\n }\n }", "title": "" }, { "docid": "dd24770bf3150a358bea071f6334a804", "score": "0.60639775", "text": "function onContextMenu(cm, e) {\n\t if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n\t if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n\t cm.display.input.onContextMenu(e);\n\t }", "title": "" }, { "docid": "dd24770bf3150a358bea071f6334a804", "score": "0.60639775", "text": "function onContextMenu(cm, e) {\n\t if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n\t if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n\t cm.display.input.onContextMenu(e);\n\t }", "title": "" }, { "docid": "9b9a5c2caef74ea865dd7ece7206acdd", "score": "0.6021819", "text": "nodeContextmenu() {\n this.logger.log('Right click');\n }", "title": "" }, { "docid": "cd1b621cc759d8aea9d7ee6624ca555c", "score": "0.6012272", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e)\n }", "title": "" }, { "docid": "28309406ababdad2a5d8da2a09380e31", "score": "0.59781444", "text": "function buildContextMenu(p) {\n let items = [];\n let x = p.x;\n let y = p.y;\n const xOffset = 2;\n const yOffset = 12;\n\n if (!window.useSafeMode && $(\".mtd-context-menu\").length > 0) {\n let removeMenu = $(\".mtd-context-menu\");\n removeMenu.addClass(\"mtd-fade-out\");\n removeMenu.on(\"animationend\", () => {\n removeMenu.remove();\n });\n }\n\n if (!window.useSafeMode && $(document.elementFromPoint(x, y)).hasClass(\"mtd-context-menu-item\")) {\n return;\n }\n\n if (p.isEditable || exists(p.selectionText) && p.selectionText.length > 0) {\n if (p.isEditable) {\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"undo\",\n text: I18n(\"Undo\"),\n enabled: p.editFlags.canUndo\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"redo\",\n text: I18n(\"Redo\"),\n enabled: p.editFlags.canRedo\n }));\n items.push(makeCMDivider());\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"cut\",\n text: I18n(\"Cut\"),\n enabled: p.editFlags.canCut\n }));\n }\n\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"copy\",\n text: I18n(\"Copy\"),\n enabled: p.editFlags.canCopy\n }));\n\n if (p.isEditable) {\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"paste\",\n text: I18n(\"Paste\"),\n enabled: p.editFlags.canPaste\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"selectAll\",\n text: I18n(\"Select all\"),\n enabled: p.editFlags.canSelectAll\n }));\n }\n\n items.push(makeCMDivider());\n }\n\n if (p.linkURL !== '' && p.linkURL !== \"https://tweetdeck.twitter.com/#\") {\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"openLink\",\n text: I18n(\"Open link in browser\"),\n enabled: true,\n data: p.linkURL\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"copyLink\",\n text: I18n(\"Copy link address\"),\n enabled: true,\n data: p.linkURL\n }));\n items.push(makeCMDivider());\n }\n\n if (p.srcURL !== '') {\n if (exists(p.mediaType) && p.mediaType === \"video\") {\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"openImage\",\n text: I18n(\"Open video in browser\"),\n enabled: true,\n data: p.srcURL\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"saveImage\",\n text: I18n(\"Save video...\"),\n enabled: true,\n data: p.srcURL\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"copyImageURL\",\n text: I18n(\"Copy video address\"),\n enabled: true,\n data: p.srcURL\n }));\n } else {\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"openImage\",\n text: I18n(\"Open image in browser\"),\n enabled: true,\n data: p.srcURL\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"copyImage\",\n text: I18n(\"Copy image\"),\n enabled: true,\n data: {\n x: x,\n y: y\n }\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"saveImage\",\n text: I18n(\"Save image...\"),\n enabled: true,\n data: p.srcURL\n }));\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"copyImageURL\",\n text: I18n(\"Copy image address\"),\n enabled: true,\n data: p.srcURL\n }));\n }\n\n items.push(makeCMDivider());\n }\n\n if (getPref$1(\"mtd_inspectElement\") || isDev) {\n items.push(makeCMItem({\n mousex: x,\n mousey: y,\n dataaction: \"inspectElement\",\n text: I18n(\"Inspect element\"),\n enabled: true,\n data: {\n x: x,\n y: y\n }\n }));\n }\n\n if (useNativeContextMenus || window.useSafeMode) {\n return items;\n } else {\n let ul = make(\"ul\");\n\n for (let i = 0; i < items.length; i++) {\n ul.append(items[i]);\n }\n\n let menu = make(\"menu\").addClass(\"mtd-context-menu dropdown-menu\").attr(\"style\", \"opacity:0;animation:none;transition:none\").append(ul);\n\n if (items.length > 0) {\n setTimeout(() => {\n if (x + xOffset + menu.width() > $(document).width()) {\n x = $(document).width() - menu.width() - xOffset - xOffset;\n }\n\n if (y + yOffset + menu.height() > $(document).height()) {\n y = $(document).height() - menu.height();\n }\n\n menu.attr(\"style\", `left:${x + xOffset}px!important;top:${y + yOffset}px!important`);\n }, 20);\n } else {\n menu.addClass(\"hidden\");\n }\n\n return menu;\n }\n}", "title": "" }, { "docid": "692ece31a8dd2a574eac489bf29d5fb6", "score": "0.5974608", "text": "function onContextMenu(cm, e) {\n\t\t if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n\t\t if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n\t\t cm.display.input.onContextMenu(e)\n\t\t}", "title": "" }, { "docid": "55a1d35e3700de15e5eb6ffb8bfec18e", "score": "0.5951911", "text": "function repaintContextMenu(className){\r\n\tnew Proto.Menu({\r\n\t selector: '.'+arrContextualMenus[className][0].selector,\r\n\t className: 'menu desktop',\r\n\t menuItems: arrContextualMenus[className]\r\n\t});\r\n}", "title": "" }, { "docid": "016104442475a777d09a8486ea360e50", "score": "0.5931792", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "9bab298cbe52debecb8decda3118e2d0", "score": "0.59131235", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "1208515729fab7eb3cdbc268ce468fb3", "score": "0.5911959", "text": "function onContextMenu(cm, e) {\n\t if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n\t if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n\t cm.display.input.onContextMenu(e)\n\t}", "title": "" }, { "docid": "1208515729fab7eb3cdbc268ce468fb3", "score": "0.5911959", "text": "function onContextMenu(cm, e) {\n\t if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n\t if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n\t cm.display.input.onContextMenu(e)\n\t}", "title": "" }, { "docid": "aaf06390f188111a5aeb63abba3b84bf", "score": "0.59062606", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) {\n return;\n }\n if (signalDOMEvent(cm, e, \"contextmenu\")) {\n return;\n }\n cm.display.input.onContextMenu(e);\n }", "title": "" }, { "docid": "00c31621000b2dc8aadf8f1d11a78ebb", "score": "0.58947", "text": "function onContextMenu(cm, e) { // 3440\n if (signalDOMEvent(cm, e, \"contextmenu\")) return; // 3441\n var display = cm.display; // 3442\n if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return; // 3443\n // 3444\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; // 3445\n if (!pos || presto) return; // Opera is difficult. // 3446\n // 3447\n // Reset the current text selection only if the click is done outside of the selection // 3448\n // and 'resetSelectionOnContextMenu' option is true. // 3449\n var reset = cm.options.resetSelectionOnContextMenu; // 3450\n if (reset && cm.doc.sel.contains(pos) == -1) // 3451\n operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); // 3452\n // 3453\n var oldCSS = display.input.style.cssText; // 3454\n display.inputDiv.style.position = \"absolute\"; // 3455\n display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) + // 3456\n \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: \" + // 3457\n (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + // 3458\n \"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\"; // 3459\n if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) // 3460\n focusInput(cm); // 3461\n if (webkit) window.scrollTo(null, oldScrollY); // 3462\n resetInput(cm); // 3463\n // Adds \"Select all\" to context menu in FF // 3464\n if (!cm.somethingSelected()) display.input.value = display.prevInput = \" \"; // 3465\n display.contextMenuPending = true; // 3466\n display.selForContextMenu = cm.doc.sel; // 3467\n clearTimeout(display.detectingSelectAll); // 3468\n // 3469\n // Select-all will be greyed out if there's nothing to select, so // 3470\n // this adds a zero-width space so that we can later check whether // 3471\n // it got selected. // 3472\n function prepareSelectAllHack() { // 3473\n if (display.input.selectionStart != null) { // 3474\n var selected = cm.somethingSelected(); // 3475\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\"); // 3476\n display.prevInput = selected ? \"\" : \"\\u200b\"; // 3477\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length; // 3478\n // Re-set this, in case some other handler touched the // 3479\n // selection in the meantime. // 3480\n display.selForContextMenu = cm.doc.sel; // 3481\n } // 3482\n } // 3483\n function rehide() { // 3484\n display.contextMenuPending = false; // 3485\n display.inputDiv.style.position = \"relative\"; // 3486\n display.input.style.cssText = oldCSS; // 3487\n if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); // 3488\n slowPoll(cm); // 3489\n // 3490\n // Try to detect the user choosing select-all // 3491\n if (display.input.selectionStart != null) { // 3492\n if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); // 3493\n var i = 0, poll = function() { // 3494\n if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0) // 3495\n operation(cm, commands.selectAll)(cm); // 3496\n else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); // 3497\n else resetInput(cm); // 3498\n }; // 3499\n display.detectingSelectAll = setTimeout(poll, 200); // 3500\n } // 3501\n } // 3502\n // 3503\n if (ie && ie_version >= 9) prepareSelectAllHack(); // 3504\n if (captureRightClick) { // 3505\n e_stop(e); // 3506\n var mouseup = function() { // 3507\n off(window, \"mouseup\", mouseup); // 3508\n setTimeout(rehide, 20); // 3509\n }; // 3510\n on(window, \"mouseup\", mouseup); // 3511\n } else { // 3512\n setTimeout(rehide, 50); // 3513\n } // 3514\n } // 3515", "title": "" }, { "docid": "9f8eab944bcd5b0f0a9bba80b71873e7", "score": "0.587343", "text": "onHeaderContextMenu(event) {\n if (event.button !== 2) {\n // 2 = secondary button = right click. We only show context menus if the\n // user has right clicked.\n return;\n }\n const menu = new UI.ContextMenu.ContextMenu(event);\n addColumnVisibilityCheckboxes(this, menu);\n const sortMenu = menu.defaultSection().appendSubMenuItem(Common.ls `Sort By`);\n addSortableColumnItems(this, sortMenu);\n menu.defaultSection().appendItem(Common.ls `Reset Columns`, () => {\n this.dispatchEvent(new ContextMenuHeaderResetClickEvent());\n });\n if (this.contextMenus && this.contextMenus.headerRow) {\n // Let the user append things to the menu\n this.contextMenus.headerRow(menu, this.columns);\n }\n menu.show();\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "985a17cfcb6ff3e8ea37bbac45155ccd", "score": "0.5852912", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }", "title": "" }, { "docid": "7741c27014964509411d83cf33dadef4", "score": "0.582027", "text": "constructor() {\n this.defaultContext = this.ReturnDefaultContextMenu();\n }", "title": "" }, { "docid": "84e8f9693e1dde5d66b1a50575421707", "score": "0.58116955", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e)\n}", "title": "" }, { "docid": "84e8f9693e1dde5d66b1a50575421707", "score": "0.58116955", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e)\n}", "title": "" }, { "docid": "84e8f9693e1dde5d66b1a50575421707", "score": "0.58116955", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e)\n}", "title": "" }, { "docid": "951a1556ae5e77374f78b4cf48bc1c98", "score": "0.58045614", "text": "_openOnContextMenu(event) {\n var _a, _b, _c;\n if (!this.disabled) {\n // Prevent the native context menu from opening because we're opening a custom one.\n event.preventDefault();\n // Stop event propagation to ensure that only the closest enabled context menu opens.\n // Otherwise, any context menus attached to containing elements would *also* open,\n // resulting in multiple stacked context menus being displayed.\n event.stopPropagation();\n this._contextMenuTracker.update(this);\n this.open({ x: event.clientX, y: event.clientY });\n // A context menu can be triggered via a mouse right click or a keyboard shortcut.\n if (event.button === 2) {\n (_a = this._menuPanel._menu) === null || _a === void 0 ? void 0 : _a.focusFirstItem('mouse');\n }\n else if (event.button === 0) {\n (_b = this._menuPanel._menu) === null || _b === void 0 ? void 0 : _b.focusFirstItem('keyboard');\n }\n else {\n (_c = this._menuPanel._menu) === null || _c === void 0 ? void 0 : _c.focusFirstItem('program');\n }\n }\n }", "title": "" }, { "docid": "f7eeb71fc78c24021c7bd6c7fd6cc8c4", "score": "0.57971454", "text": "ReturnDefaultContextMenu() {\n return [\n {\n label: 'Copy',\n accelerator: 'CmdOrCtrl+C',\n role: 'copy',\n },\n {\n label: 'Paste',\n accelerator: 'CmdOrCtrl+V',\n role: 'paste',\n },\n ];\n }", "title": "" }, { "docid": "da93dd96c1e7d8d255caef860b438881", "score": "0.5793209", "text": "contextMenu(node){\n let ctx = [];\n if ( !this.disabledAction ){\n ctx = [{\n icon: 'nf nf-fa-trash',\n text: bbn._('Delete'),\n action: n => {\n this.deleteItem(n);\n }\n }];\n //case context in section menu\n if ( node.data.id_option === null ){\n // if node is sectiom transform to link\n if ( !node.numChildren ){\n ctx.push({\n icon: 'nf nf-custom-elm',\n text: bbn._('Transform to link'),\n action: n => {\n this.selectItem(n);\n this.$nextTick(() => {\n this.selected.$set(this.selected.data ,'id_option', '')\n });\n }\n });\n }\n else {\n ctx.push({\n icon: 'nf nf-mdi-sort_alphabetical',\n text: bbn._('Fix order'),\n action: n => {\n this.fixOrder(n);\n }\n });\n }\n //adds the possibility of create sub-section\n ctx.unshift({\n icon: 'nf nf-fa-level_down',\n text: bbn._('New sub-section'),\n action: n => {\n this.createSection(n);\n }\n });\n //adds the possibility of create a link\n ctx.unshift({\n icon: 'nf nf-fa-link',\n text: bbn._('New link'),\n action: n => {\n if ( bbn.fn.isNull(n.data.id_option) ){\n this.editLink(n);\n }\n }\n });\n }\n else{\n //convert the link menu in section menu\n ctx.push({\n icon: 'nf nf-custom-elm',\n text: bbn._('Transform to section'),\n action: n => {\n this.selectItem(n);\n this.$nextTick(()=>{\n this.selected.$set(this.selected.data, 'id_option', null);\n });\n }\n });\n }\n }\n //adds the possibility of copy the section to another menu\n ctx.push({\n icon: 'nf nf-fa-copy',\n text: bbn._('Copy to'),\n action: n => {\n this.copyTo({\n id: n.data.id,\n text: n.data.text,\n icon: n.data.icon,\n id_user_option: this.currentMenu.id\n });\n }\n });\n return ctx\n }", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "6446da1d1ff88db06184438f3ce7df3b", "score": "0.57900715", "text": "function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e);\n}", "title": "" }, { "docid": "91d19dd655f0c7291c6a5d9cd5bffc95", "score": "0.57742405", "text": "showNodeContextMenu(node) {\n /** Save node information for further menu operations*/\n this.setState({\n tappedNode: node.data,\n tappedPosition: node.position\n }, () => {\n this.showNodeMenu();\n });\n }", "title": "" }, { "docid": "d17ab7fc3ad458bbcda2748c10cbec07", "score": "0.57398564", "text": "onElementContextMenu(event) {\n const me = this,\n cellData = me.getCellDataFromEvent(event);\n\n // There is a cell\n if (cellData) {\n me.triggerCellMouseEvent('contextMenu', event);\n\n // Focus on tap for touch events.\n // Selection follows from focus.\n if (DomHelper.isTouchEvent) {\n me.onFocusGesture(cellData, event);\n }\n }\n }", "title": "" }, { "docid": "44169aec2b16c533a889861b670385e0", "score": "0.5686722", "text": "closeContextMenu() {\n this.contextMenuOpen = false;\n }", "title": "" }, { "docid": "833ef06f75e94a00d541ffcace4b3c80", "score": "0.5651522", "text": "addContextMenuItem() {\n this.app.logger.info(`${this}adding contextmenu`)\n this._contextMenuItem = browser.contextMenus.create({\n contexts: ['selection'],\n onclick: (info, _tab) => {\n this.app.modules.dialer.dial(info.selectionText, _tab)\n this.app.analytics.telemetryEvent('Calls', 'Initiate ConnectAB', 'Webpage')\n },\n title: this.app.i18n.translate('contextMenuLabel'),\n })\n }", "title": "" }, { "docid": "ae5341a09e2a651a6a1a0ea70fa15138", "score": "0.56461954", "text": "function setupMenuContext() {\n const DECODER_ID = 'dolphin-decoder';\n const ENCODER_ID = 'dolphin-encoder';\n\n chrome.contextMenus.create({\n type: 'separator',\n id: 'dolphin-separator',\n contexts: ['selection'],\n });\n\n chrome.contextMenus.create({\n type: 'normal',\n id: DECODER_ID,\n title: 'decode \"%s\"',\n contexts: ['selection'],\n });\n\n chrome.contextMenus.create({\n type: 'normal',\n id: ENCODER_ID,\n title: 'encode \"%s\"',\n contexts: ['selection'],\n });\n\n chrome.contextMenus.onClicked.addListener(({ menuItemId, selectionText }) => {\n if (menuItemId === DECODER_ID) {\n return decode(selectionText);\n }\n\n if (menuItemId === ENCODER_ID) {\n return encode(selectionText);\n }\n });\n}", "title": "" }, { "docid": "dfa7de110172eea6a68e0fcb27ef11ac", "score": "0.5627017", "text": "_attachContextMenu() {\n this.dom.contextMenu.config = new PopContextMenuConfig();\n //\n this.dom.contextMenu.configure = (name, row, event) => {\n let goToUrl = '';\n let internal_name;\n // check if it is a route, get the url from the route given from name definition\n if (this.config.columnDefinitions[name].route) {\n goToUrl = ParseLinkUrl(this.config.columnDefinitions[name].route, row);\n }\n else if (this.config.route) {\n // else check if a global route exists on the table config. If it does, route to that\n // this will most likely be used to route to an entityId by their entityId\n goToUrl = ParseLinkUrl(this.config.route, row);\n }\n if (this.config.columnDefinitions[name].internal_name) {\n internal_name = this.config.columnDefinitions[name].internal_name;\n }\n else {\n internal_name = row.internal_name ? row.internal_name : this.config.internal_name ? this.config.internal_name : null;\n }\n if (!goToUrl && !internal_name)\n return false;\n // if we haven't returned, prevent the default behavior of the right click.\n event.preventDefault();\n // reset the context menu, and configure it to load at the position clicked.\n this.dom.contextMenu.config.resetOptions();\n if (internal_name) {\n this.dom.contextMenu.config.addPortalOption(internal_name, row.id ? +row.id : +row[internal_name + '_fk']);\n }\n if (goToUrl)\n this.dom.contextMenu.config.addNewTabOption(goToUrl);\n this.dom.contextMenu.config.x = event.clientX;\n this.dom.contextMenu.config.y = event.clientY;\n this.dom.contextMenu.config.toggle.next(true);\n };\n this.dom.setSubscriber('context-menu', this.dom.contextMenu.config.emitter.subscribe((event) => {\n this.config.onEvent.next(event);\n }));\n }", "title": "" }, { "docid": "1eac41d3d9e92db1b4d0a1942ab6d08d", "score": "0.5626116", "text": "function buildContextMenu(showContextMenu) {\n\n var currentDisplayLevel = contextMenuItems ? contextMenuItems.length : 0,\n allContexts = [\"page\", \"frame\", \"selection\", \"editable\", \"image\",\n \"video\", \"audio\", \"browser_action\", \"page_action\"\n ];\n\n chrome.contextMenus.removeAll();\n contextMenuItems = [];\n\n //Open tab suspended\n contextMenuItems.push(chrome.contextMenus.create({\n title: \"Open link in new suspended tab\",\n contexts:[\"link\"],\n onclick: function (info, tab) {\n openLinkInSuspendedTab(tab, info.linkUrl);\n }\n }));\n\n if (showContextMenu) {\n\n //make right click Context Menu for Chrome\n contextMenuItems.push(chrome.contextMenus.create({\n type: \"separator\"\n }));\n\n //Suspend present tab\n contextMenuItems.push(chrome.contextMenus.create({\n title: \"Suspend tab\",\n contexts: allContexts,\n onclick: suspendHighlightedTab\n }));\n\n //Add present tab to temporary whitelist\n contextMenuItems.push(chrome.contextMenus.create({\n title: \"Don't suspend for now\",\n contexts: allContexts,\n onclick: temporarilyWhitelistHighlightedTab\n }));\n\n //Add present tab to permenant whitelist\n contextMenuItems.push(chrome.contextMenus.create({\n title: \"Never suspend this site\",\n contexts: allContexts,\n onclick: whitelistHighlightedTab\n }));\n\n //Suspend all the tabs\n contextMenuItems.push(chrome.contextMenus.create({\n title: \"Suspend other tabs\",\n contexts: allContexts,\n onclick: suspendAllTabs\n }));\n\n //Unsuspend all the tabs\n contextMenuItems.push(chrome.contextMenus.create({\n title: \"Unsuspend all tabs\",\n contexts: allContexts,\n onclick: unsuspendAllTabs\n }));\n\n //Open settings page\n contextMenuItems.push(chrome.contextMenus.create({\n title: \"Settings\",\n contexts: allContexts,\n onclick: function(e) {\n chrome.tabs.create({\n url: chrome.extension.getURL('options.html')\n });\n }\n }));\n }\n }", "title": "" }, { "docid": "395c1dbc979f9da21b49a700a4de2020", "score": "0.5624045", "text": "get contextMenuDataSource() {\n\t\treturn this.nativeElement ? this.nativeElement.contextMenuDataSource : undefined;\n\t}", "title": "" }, { "docid": "30874cfafe781340c6eec5a9dd051338", "score": "0.56112003", "text": "function createContextMenus () {\n createPageContextMenu()\n createLinkContextMenu()\n}", "title": "" }, { "docid": "0459344f276249a6f811e6130f765be4", "score": "0.5593145", "text": "function useTooltipHoverModeActions() {\n return react_1.useContext(exports.HoverModeActions);\n}", "title": "" }, { "docid": "615152d44ee2c0230a162d287947e6d4", "score": "0.55882025", "text": "function showUIActionContext(event) {\n if (!g_user.hasRole(\"ui_action_admin\"))\n return;\n var element = Event.element(event);\n if (element.tagName.toLowerCase() == \"span\")\n element = element.parentNode;\n var id = element.getAttribute(\"gsft_id\");\n var mcm = new GwtContextMenu('context_menu_action_' + id);\n mcm.clear();\n mcm.addURL(getMessage('Edit UI Action'), \"sys_ui_action.do?sys_id=\" + id, \"gsft_main\");\n contextShow(event, mcm.getID(), 500, 0, 0);\n Event.stop(event);\n}", "title": "" }, { "docid": "3d9d6194db58e9317af8af347c03b8f9", "score": "0.5555309", "text": "function ContextMenuItem(string, cmdId) {\n this.string = string;\n this.cmdId = cmdId;\n}", "title": "" }, { "docid": "3b464ab3a95502cbc9dd76a0218a3fb4", "score": "0.55543965", "text": "function closeContextMenu() {\n contextMenu.close();\n}", "title": "" }, { "docid": "dc6e0a82a02f0ad6c0e41d6273dfa9a4", "score": "0.5539495", "text": "function testContextMenuAccessKeys() {\n controller.open(TEST_DATA);\n controller.waitForPageLoad();\n\n var ids = [\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-canvas\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-input\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-image\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-image-link\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-link\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-mailto\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-video-good\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-audio-in-video\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-video-wrong-source\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-video-wrong-type\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-video-in-iframe\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-image-in-iframe\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, { id : \"test-plugin\" }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-object\",\n preHook : openAdobeFlashContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-textarea\",\n preHook : selectTextAndOpenContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-input-spellcheck\",\n preHook : selectTextAndOpenContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-select-input-text\",\n preHook : selectTextAndOpenContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-select-input-text-type-password\",\n preHook : selectTextAndOpenContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-text\",\n preHook : selectTextAndOpenContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-contenteditable\",\n preHook : selectTextAndOpenContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-iframe\",\n preHook : selectTextAndOpenContextMenu\n }),\n utils.combineObjects(DEFAULT_HTML_ELEMENT, {\n id : \"test-select-text-link\",\n preHook : selectTextAndOpenContextMenu\n })\n ];\n var domWalker = new domUtils.DOMWalker(controller,\n localization.filterAccessKeys,\n localization.prepareAccessKey,\n localization.checkAccessKeysResults,\n false);\n domWalker.walk(ids);\n}", "title": "" }, { "docid": "b11861b8e84974f6f5e073485665bdc2", "score": "0.5538343", "text": "function showContextMenu(e) {\t\t\r\n\tif (!document.getElementById(cmenu))\r\n\t\tcreateContextMenu(cmenu);\r\n\t\r\n\tcreateServicesList(e, cmenu);\t\r\n\tpositionContextMenu(e, cmenu);\r\n}", "title": "" }, { "docid": "00c78bae0333506096c14c7cc4a90ca6", "score": "0.5526339", "text": "function ContextMenu(options,element){return _super.call(this,options,element)||this;}", "title": "" }, { "docid": "b61f5e1e38bd5b8031f3586dd61d0b83", "score": "0.5522847", "text": "function buildContextMenus() {\n setReadonly();\n\n // apply hcconf on cmHeadCol\n cmHeadCol = ctxmgr.add('hcconf', hcconf);\n cmHeadCol.bindTarget('.' + def.Classes.COL, {\n before: function(e) {\n var pos = headings.getColPosition((e.target||e.srcElement), e.clientX, e.clientY);\n if(!pos) { return false; }\n\n // {row: 1, col: 5, colheader: true, distance: 8, coltoresize: 4}\n headings.columns.select(pos.col);\n return true;\n }\n });\n\n // apply hrconf on cmHeadRow\n cmHeadRow = ctxmgr.add('hrconf', hrconf);\n cmHeadRow.bindTarget('.' + def.Classes.ROW, {\n before: function(e) {\n var pos = headings.getRowPosition((e.target||e.srcElement), e.clientX, e.clientY);\n if(!pos) { return false; }\n\n // {row: 7, col: 1, rowheader: true, distance: 12, rowtoresize: 6}\n headings.rows.select(pos.row);\n return true;\n }\n });\n\n // apply tconf on cmMain\n cmMain = ctxmgr.add('tconf', tconf);\n cmMain.bindTarget('#te_toplevel', {\n // allow browser's context menu\n excep: {\n tags: ['INPUT', 'textarea'],\n classes:[def.Classes.COL, def.Classes.ROW],\n attr: ['contentEditable']\n },\n\n // check before real right-click action\n // return false if not clicked on cell\n before:function(e) {\n var target = e.target||e.srcElement;\n if(!target) { return false; }\n\n // incase of clicking on the text node\n if (target.tagName !== 'TD') {\n target = $(target).closest('td')[0];\n }\n\n if(target && target.id && /^cell/.test(target.id)) {\n return true;\n }\n\n return false;\n }\n });\n\n // init language of menu-panes\n\n // @param{Object.Panes}\n var transPanes = function(panes) {\n var pkeys = Object.keys(panes);\n\n // translate each menu pane\n pkeys.forEach(function(k) {\n if(panes[k].mPane) {\n L10n.translate(panes[k].mPane[0]);\n }\n\n });\n };\n\n ctxmgr.items.forEach(function(ctxmenu) {\n if(ctxmenu.panes) {\n transPanes(ctxmenu.panes);\n }\n });\n\n var spreadsheet = global.getSpreadsheetObject();\n if(spreadsheet && spreadsheet.editor && spreadsheet.editor.StatusCallback) {\n\n spreadsheet.editor.StatusCallback.ctxMenuRefresh = {\n\n func: function(e, st) {\n if(st==='doneposcalc') {\n\n // rebind heading (row)column elements\n // update row(column) selections\n if(cmHeadCol) {\n cmHeadCol.rebindTarget();\n headings.columns.updateRange(e);\n }\n if(cmHeadRow) {\n cmHeadRow.rebindTarget();\n headings.rows.updateRange(e);\n }\n }\n },\n params: {}\n };\n }\n\n } // END OF buildContextMenus", "title": "" }, { "docid": "615076fddfbd7a96ebe1feca18ba40d9", "score": "0.55011415", "text": "componentDidMount() {\n document.addEventListener('click', this.onClickOutside, true);\n document.addEventListener('keydown', this.onHideContextMenu);\n }", "title": "" }, { "docid": "c9636c6ad3edd5bce6b0cb59ebc28919", "score": "0.5499461", "text": "function ContextMenuItem(string, cmdId) {\r\n this.string = string;\r\n this.cmdId = cmdId;\r\n}", "title": "" }, { "docid": "de1095488c016c8268382125e528b920", "score": "0.5462861", "text": "function HandleContextMenu (appletName)\r\n{ \r\n return Top()._swescript.HandleContextMenu_Top (appletName, event);\r\n}", "title": "" }, { "docid": "37dac9cd936c602dd4be1dd306b5391a", "score": "0.5456484", "text": "function contextMenuHandler(node) {\n\n var layerId = wmsLoader.layerTitleNameMapping[node.attributes.text];\n var layer = wmsLoader.layerProperties[layerId];\n\n //disable option for opentable if layer is not queryableor layer has no attributes (WMS)\n //var contTable = Ext.getCmp('contextOpenTable');\n var contTable = node.menu.getComponent('contextOpenTable');\n if (layer.queryable && typeof(layer.attributes) !== 'undefined')\n contTable.setDisabled(false);\n else\n contTable.setDisabled(true);\n\n node.select();\n node.menu.show ( node.ui.getAnchor());\n}", "title": "" }, { "docid": "2a6dd4ddeea4d48cecf2911974caf114", "score": "0.54144436", "text": "function onContextMenu(cm, e) {\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n var display = cm.display;\n if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;\n\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) return; // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);\n\n var oldCSS = display.input.style.cssText;\n display.inputDiv.style.position = \"absolute\";\n display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) +\n \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: \" +\n (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") +\n \"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)\n focusInput(cm);\n if (webkit) window.scrollTo(null, oldScrollY);\n resetInput(cm);\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) display.input.value = display.prevInput = \" \";\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n display.inputDiv.style.position = \"relative\";\n display.input.style.cssText = oldCSS;\n if (ie && ie_version < 9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;\n slowPoll(cm);\n\n // Try to detect the user choosing select-all\n if (display.input.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) prepareSelectAllHack();\n var i = 0, poll = function() {\n if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0)\n operation(cm, commands.selectAll)(cm);\n else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);\n else resetInput(cm);\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) prepareSelectAllHack();\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function() {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n }", "title": "" }, { "docid": "2a6dd4ddeea4d48cecf2911974caf114", "score": "0.54144436", "text": "function onContextMenu(cm, e) {\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n var display = cm.display;\n if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;\n\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) return; // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);\n\n var oldCSS = display.input.style.cssText;\n display.inputDiv.style.position = \"absolute\";\n display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) +\n \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: \" +\n (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") +\n \"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)\n focusInput(cm);\n if (webkit) window.scrollTo(null, oldScrollY);\n resetInput(cm);\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) display.input.value = display.prevInput = \" \";\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n display.inputDiv.style.position = \"relative\";\n display.input.style.cssText = oldCSS;\n if (ie && ie_version < 9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;\n slowPoll(cm);\n\n // Try to detect the user choosing select-all\n if (display.input.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) prepareSelectAllHack();\n var i = 0, poll = function() {\n if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0)\n operation(cm, commands.selectAll)(cm);\n else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);\n else resetInput(cm);\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) prepareSelectAllHack();\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function() {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n }", "title": "" }, { "docid": "2a6dd4ddeea4d48cecf2911974caf114", "score": "0.54144436", "text": "function onContextMenu(cm, e) {\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n var display = cm.display;\n if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;\n\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) return; // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);\n\n var oldCSS = display.input.style.cssText;\n display.inputDiv.style.position = \"absolute\";\n display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) +\n \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: \" +\n (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") +\n \"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)\n focusInput(cm);\n if (webkit) window.scrollTo(null, oldScrollY);\n resetInput(cm);\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) display.input.value = display.prevInput = \" \";\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n display.inputDiv.style.position = \"relative\";\n display.input.style.cssText = oldCSS;\n if (ie && ie_version < 9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;\n slowPoll(cm);\n\n // Try to detect the user choosing select-all\n if (display.input.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) prepareSelectAllHack();\n var i = 0, poll = function() {\n if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0)\n operation(cm, commands.selectAll)(cm);\n else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);\n else resetInput(cm);\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) prepareSelectAllHack();\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function() {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n }", "title": "" }, { "docid": "2a6dd4ddeea4d48cecf2911974caf114", "score": "0.54144436", "text": "function onContextMenu(cm, e) {\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n var display = cm.display;\n if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;\n\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) return; // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);\n\n var oldCSS = display.input.style.cssText;\n display.inputDiv.style.position = \"absolute\";\n display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) +\n \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: \" +\n (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") +\n \"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)\n focusInput(cm);\n if (webkit) window.scrollTo(null, oldScrollY);\n resetInput(cm);\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) display.input.value = display.prevInput = \" \";\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n display.inputDiv.style.position = \"relative\";\n display.input.style.cssText = oldCSS;\n if (ie && ie_version < 9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;\n slowPoll(cm);\n\n // Try to detect the user choosing select-all\n if (display.input.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) prepareSelectAllHack();\n var i = 0, poll = function() {\n if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0)\n operation(cm, commands.selectAll)(cm);\n else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);\n else resetInput(cm);\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) prepareSelectAllHack();\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function() {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n }", "title": "" } ]
bfdb0967a3fa8cb5c1e91cd024d27b6c
Render the footer HTML
[ { "docid": "ff314154c3626c39790e0c25e46aa450", "score": "0.6352017", "text": "function Footer() {\n return (\n <div className=\"footer-container\">\n <footer className=\"page-footer\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col l6 s12\">\n <h5 className=\"white-text\">Our users</h5>\n <p className=\"grey-text text-lighten-4\">\n You can read more about all our users and their work\n </p>\n </div>\n </div>\n </div>\n <div className=\"footer-copyright\">\n <div className=\"container\">\n © 2020 Copyright Alba\n <a className=\"grey-text text-lighten-4 right\" href=\"#!\">\n More Links\n </a>\n </div>\n </div>\n </footer>\n </div>\n );\n}", "title": "" } ]
[ { "docid": "962fd896617f6c592a951b2413c6071f", "score": "0.7962596", "text": "function renderFooter() {\n\t\t\tfooter.setToolbarOptions(computeFooterOptions());\n\t\t\tfooter.render();\n\t\t\tif (footer.el) {\n\t\t\t\telement.append(footer.el);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "01c5c92bad83df9f4d83830517d095f7", "score": "0.79622203", "text": "function renderFooter() {\n\t\tfooter.setToolbarOptions(computeFooterOptions());\n\t\tfooter.render();\n\t\tif (footer.el) {\n\t\t\telement.append(footer.el);\n\t\t}\n\t}", "title": "" }, { "docid": "01c5c92bad83df9f4d83830517d095f7", "score": "0.79622203", "text": "function renderFooter() {\n\t\tfooter.setToolbarOptions(computeFooterOptions());\n\t\tfooter.render();\n\t\tif (footer.el) {\n\t\t\telement.append(footer.el);\n\t\t}\n\t}", "title": "" }, { "docid": "343c27c5a29c376054e84574c30186c4", "score": "0.73314875", "text": "render () {\n return (\n <footer>\n <p>Made with 💖 by Clarke MacArthur</p>\n <p>at <a href=\"https://junocollege.com\">Juno College</a></p>\n <p>Images by pch.vector at <a href=\"https://www.freepik.com/vectors/vintage\">www.freepik.com</a></p>\n </footer>\n\n \n )\n }", "title": "" }, { "docid": "0ecc0a72220c0ceacf89da04bcd126bc", "score": "0.72908455", "text": "function renderFooter(){\n var ftHeight = $('footer.clear').height();\n $('.fs').css('height', ftHeight);\n }", "title": "" }, { "docid": "8e3c1c52bfdd8afedc9e9f98c2694104", "score": "0.7228795", "text": "footer() {\n return `</div>\n</div>\n\n</body>\n</html>\n`;\n }", "title": "" }, { "docid": "d026dde10e18f36c60a27795a52de6ec", "score": "0.7194359", "text": "function Footer() {\n return (\n <footer>\n <Notifications />\n <div id=\"hopeful-heart-footer-info\">\n <a href=\"mailto:[email protected]?subject=Family Connections\">\n [email protected]\n </a>\n <div id=\"hopeful-heart-links\">\n <a\n href=\"https://www.facebook.com/hopefulheartproject/\"\n target=\"_blank\"\n >\n <FacebookIcon />\n </a>\n <a\n href=\"https://www.instagram.com/hopefulheartproject/\"\n target=\"_blank\"\n >\n <InstagramIcon />\n </a>\n </div>\n </div>\n </footer>\n );\n}", "title": "" }, { "docid": "74ce9c608f1e129c887ab41877026dee", "score": "0.7125369", "text": "function getHtmlInvoiceFooter() {\n return \"\" +\n \"<div id='invoice-footer'>\" +\n \"<div id='invoice-footer-text'>\" +\n \"<p>\" +\n \"Bitte überweisen Sie den Rechnungsbetrag innerhalb von <b>sieben Tagen</b> an das<br>oben stehende Konto.<br><br>\" +\n \"Vielen Dank für das entgegengebrachte Vertrauen.<br><br><br><br><br>Jochen Wehner\" +\n \"</p>\" +\n \"</div>\" +\n \"</div>\";\n}", "title": "" }, { "docid": "9960f2daefc78036e14e4e0b77da77dd", "score": "0.7096539", "text": "function loadFooter() {\n document.getElementById(\"footer\").innerHTML = resourcePackage.templates[\"footer.html\"]\n}", "title": "" }, { "docid": "2d5bc167513418168eff93ce96fca089", "score": "0.70387995", "text": "get _displayFooter() {\n\t\treturn true;\n\t}", "title": "" }, { "docid": "9236504983bddadeffcbd5efa8e7bcdf", "score": "0.6973131", "text": "render() {\n return (\n <div>\n <footer className=\"footer\">\n <span className=\"text-muted\">All Rights Reserved @Jose Paulo || @Henrique Demetrio</span>\n </footer>\n </div>\n );\n }", "title": "" }, { "docid": "217b1b99b21beac90e10f830515587cc", "score": "0.69669926", "text": "function pageFooterTemplate(metadata) {\n var authorName;\n if (metadata.author.length == 1) {\n authorName = metadata.author[0].ins.replace(/^[A-Z.]*\\s+/, \"\");\n } else if (metadata.author.length == 2) {\n var lastName1 = metadata.author[0].ins.replace(/^[A-Z.]*\\s+/, \"\");\n var lastName2 = metadata.author[1].ins.replace(/^[A-Z.]*\\s+/, \"\");\n authorName = lastName1 + \" & \" + lastName2;\n } else if (metadata.author.length > 2) {\n authorName = metadata.author[0].ins.replace(/^[A-Z.]*\\s+/, \"\") + \", et al.\";\n } else {\n throw \"No author provided\";\n }\n\n var expiry = addSixMonths(metadata.date);\n\n var footer = blank(PAGE_WIDTH);\n footer = insertLeftAligned(authorName, footer);\n footer = insertCentered(\"Expires \"+renderDate(expiry), footer);\n return footer;\n}", "title": "" }, { "docid": "2bd076131e507418c5be492b80cf16e2", "score": "0.6965124", "text": "render() {\n return (\n\t\t\t<footer className=\"bg-accent text-center\">&copy; 2017</footer>\n );\n }", "title": "" }, { "docid": "2a3dea45a4c35429bc73eff19fbd3bd6", "score": "0.6939422", "text": "function renderAbbreviatedViewFooter_() {\n const footer =\n `\n <div class=\"swg-subscribe-footer swg-abbreviated-footer\">\n <div id=\"swg-button\" class=\"swg-button\" role=\"button\" tabindex=\"1\">\n <div class=\"swg-button-content-wrapper\">\n <div class=\"swg-button-icon\"><div class=\"swg-icon\"></div></div>\n <div class=\"swg-button-content\">\n <span>Subscribe with Google</span>\n </div>\n </div>\n </div>\n </div>\n `;\n return footer;\n}", "title": "" }, { "docid": "706ef595274e8b2d3ae075a296d10eca", "score": "0.6917451", "text": "get _displayFooter() {\n return true;\n }", "title": "" }, { "docid": "e3e79e36139f20b92a78fad7ab20d7b5", "score": "0.6916908", "text": "function Footer() {\n return(\n <footer>\n <br />\n Parker Martin\n <br />\n <br />\n Click on my email address to send me an email! <a href=\"mailto:[email protected]\">[email protected]</a>\n <br /><br />\n </footer>\n )\n\n}", "title": "" }, { "docid": "8c0010d12518953dbd6fac629fa4b54c", "score": "0.6871309", "text": "function renderFooter(){\n let t_string = boxChars.boldCorner_botLeft;\n\n // For each column\n for(let i = 0; i < columnWidths.length; i++){\n t_string += boxChars.boldFlat.repeat(2 + columnWidths[i]);\n\n // Append vertical divider\n if(i === columnWidths.length - 1){\n t_string += boxChars.boldCorner_botRight;\n }\n else{\n t_string += boxChars.boldFlat_thinVertUp;\n }\n }\n\n return t_string;\n}", "title": "" }, { "docid": "0399f3a9249567f5887f8244aa63d90a", "score": "0.6856481", "text": "function Footer() {\n return <footer>\n <p>\n Icons made by <a href=\"https://www.flaticon.com/authors/freepik\" title=\"Freepik\">Freepik</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a>\n </p>\n </footer>;\n}", "title": "" }, { "docid": "43a7f4ca210c11425ddb688e53c00172", "score": "0.68468064", "text": "function Footer(){//return footer html component with <p> \n const today = new Date().getFullYear();\n //to paste Javascript code inside html we use {}\n return <footer>\n <p>Copyright {today}</p>\n </footer>\n}", "title": "" }, { "docid": "38bc4ba758cb2aa9afaabe564721dcdd", "score": "0.6814138", "text": "function getFooterContent() {\n let footerElement = buildElement('footer', [\n buildDIV([\n buildSPAN('S\\'inscrire à notre NewsLetter', wrap([\n {name:'style', value:'font-size: 17px;color: white;'},\n ]))\n ], wrapCI('text-news-letter', 'newsBlocks', [\n {name:'onclick', value:'$(\\'#news-modal-id\\').style.display = \\'block\\''}\n ])),\n buildHR(),\n buildDIV([\n buildIMG('resources/pictures/App/icons/partners.png', 'partners', cls('right-space', [\n {name:'width', value:'80'},\n {name:'height', value:'46'},\n ])),\n buildSPAN('Partenaires')\n ], cls('text-partenaire')),\n buildHR()\n ]);\n let partnersDiv = buildDIV(null, cls('partenaire'));\n for(let partner of footerData.partners) {\n partnersDiv.appendChild(buildSPAN([\n buildLINK('', [\n buildIMG(partner.image, '', wrapIC('partner-' + partner.id, 'img-partenaire', [\n {name:'onclick', value:'route(\\'../Partner\\',\\'' + partner.id + '\\')'},\n ]))\n ])\n ]));\n }\n footerElement.appendChild(partnersDiv);\n footerElement.appendChild(buildDIV(null, cls('background-space')));\n let footerDiv = buildDIV(null, cls('flex-container'));\n for(let foot of footerData.foots) {\n let container = buildDIV(buildElement('h5', foot.title));\n let list = buildElement('ul', null, cls('remove-space'));\n for(let c of foot.content) {\n if(c.type === 'link') {\n list.appendChild(buildElement('li', [\n buildLINK(c.link_address, c.link_name, cls('links'))\n ]));\n }\n if(c.type === 'list') {\n list.appendChild(buildElement('li', [\n buildElement('strong', c.list_title),\n c.list_content\n ], id('direct-contact-element')));\n }\n if(c.type === 'direct-contact'){\n list.appendChild(buildElement('li', [\n buildElement('button', 'Contactez-nous directement !', cls('button-contact', [\n {name:'onclick', value:'$(\\'#form-contact-id\\').style.display=\\'block\\''},\n {name:'style', value:'width:auto;'},\n ]))\n ]));\n }\n if(c.type === 'geo') {\n list.appendChild(buildDIV([\n buildDIV([\n buildElement('iframe', null, cls('map-size', [\n {name:'src', value:c.source},\n {name:'frameborder', value:'0'},\n {name:'style', value:'border:0;'},\n {name:'allowfullscreen', value:'true'},\n {name:'aria-hidden', value:'false'},\n {name:'tabindex', value:'0'},\n ]))\n ], cls('over-flow'))\n ], cls('map')));\n }\n }\n container.appendChild(list);\n footerDiv.appendChild(container);\n }\n footerElement.appendChild(footerDiv);\n // Copy-right\n footerElement.appendChild(buildDIV([\n buildSPAN([\n 'Master Qualité du Logiciel,',\n buildLINK('#', 'Faculté des sciences'),\n ]),\n buildSPAN('&copy; 2020 All rights reserved'),\n ], cls('copy-right')));\n // Elements for form-contact\n footerElement.appendChild(buildDIV(null, id('form-contact')));\n // // Elements for newsLetter\n footerElement.appendChild(buildLINK('#', null, wrapCI('button-news', 'news-button')));\n footerElement.appendChild(buildDIV(null, id('news-cont')));\n return footerElement;\n}", "title": "" }, { "docid": "b7de3e040e458c44fa056f6c3f00c299", "score": "0.68038225", "text": "function getFooter() {\n return React.createElement(\n 'div',\n { className: 'footer' },\n 'Click on a cell to make it come alive',\n React.createElement('br', null),\n 'Click ',\n React.createElement(\n 'a',\n { href: 'https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life', target: '_blank' },\n 'here'\n ),\n ' for more information on Game of Life',\n React.createElement('br', null),\n 'Created by BXR'\n );\n}", "title": "" }, { "docid": "6c16d74d54e64014b681d3606eaa497f", "score": "0.6799039", "text": "function _generateFooterReport() {\n\tthis.htmlFile.writeln( \"</table>\");\n\tthis.htmlFile.writeln( \"</body>\");\n\tthis.htmlFile.writeln( \"</html>\");\n}", "title": "" }, { "docid": "bc30484f978b7fabec4edb12eba24a4c", "score": "0.6791062", "text": "generateFooter(container) {\n\n /* defined as a constant as its not dynamic */\n const footer = '<span>En oppgave av Daniel Wendt Kjellid. Høst 2019.</span>' \n\n /* append footer to whatever container is stated when calling the method */\n $(container).append(footer);\n }", "title": "" }, { "docid": "e7859cd7652ae1f3f04dfcb37d66d087", "score": "0.67883605", "text": "function Footer() {\n return (\n <div>\n <h3>My Footer</h3>\n <p>My Footer Paragraph</p>\n </div>\n );\n}", "title": "" }, { "docid": "7df4754ff7f858b7694e386f8a8ff2d8", "score": "0.67423445", "text": "function getFooter() {\n var footer_str = \"<footer>\";\n footer_str += \"<div>\";\n footer_str += \"<button class = 'prev-btn'><i class='fa fa-arrow-left' aria-hidden='true'></i></button>\";\n footer_str += \"<span>0</span>\";\n footer_str += \"<button class = 'next-btn'><i class='fa fa-arrow-right' aria-hidden='true'></i></button>\";\n footer_str += \"</div>\";\n footer_str += \"</footer>\";\n return footer_str;\n}", "title": "" }, { "docid": "15f784eef06ee3b8065eb1cc9283a690", "score": "0.6723122", "text": "function compileAndDisplayFooter(): void {\n const source = components.sourceLink()\n source.setAttribute(\"href\", `https://gist.github.com/${gistId}`)\n source.innerHTML = gistId\n\n creditsLink()\n\n basic.show(components.footer())\n}", "title": "" }, { "docid": "557e53f7e79ec17442ffd0a181a17a03", "score": "0.6712312", "text": "function Footer() {\n return (\n // footer tag\n <footer>\n <hr />\n {/* p-tag */}\n <p className=\"pull-right\">\n {/* github icon with React js plug */}\n <i className=\"fab fa-github\" /> リアクトで作られたアップリです。\n </p>\n </footer>\n );\n}", "title": "" }, { "docid": "e8ff775059ee41cc535b8059481da2fe", "score": "0.66712034", "text": "function Footer() {\r\n return <p>Copyright 2020</p>;\r\n}", "title": "" }, { "docid": "9d69d23bbd9c1118746cc8a882ebaff1", "score": "0.66317147", "text": "function footer() {\n document.write(\"</div>\"); // end content div\n\n document.write(\"<div id='footer'>\");\n document.write(\"<a style='margin-right:100px' href='contact.html'>Contact Us</a>\");\n document.write(\"Copyright &#64; 2014 Frye\");\n document.write(\"</div>\");\n\n document.write(\"</div>\");\n} // end function footer", "title": "" }, { "docid": "06454877666abca94ce6d1307525179e", "score": "0.65884095", "text": "getFooter() {\n const { callback = null } = this.getModalData() || {};\n\n return (\n <div className=\"modal__footer actions\">\n <div>\n <ActionButtons.Cancel />\n <ActionButtons.Confirm callback={callback} />\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "aeacfb6f9991bdfb61bbec35ba9a183b", "score": "0.6575485", "text": "function makeTheFooter() {\n const tfootElement = _makeElement('tfoot', locationsTable, null);\n const rowElement = _makeElement('tr', tfootElement, null);\n _makeElement('th', rowElement, 'Hourly Total');\n let hourlyTotal = 0;\n let grandTotal = 0;\n for (let i = 0; i < dailyOpsHours.length; i++) { // loop through dailyOpsHours (each hour i)\n for (let j = 0; j < Location.allLocations.length; j++) { \n let currentLocation = Location.allLocations[j];\n hourlyTotal += currentLocation.hrlySalesArray[i]\n }\n // all done counting cookies at stores\n _makeElement('td', rowElement, hourlyTotal);\n grandTotal += hourlyTotal;\n hourlyTotal = 0;\n }\n _makeElement('td', rowElement, grandTotal); // looked at every hour\n}", "title": "" }, { "docid": "f2f93d0df9bde219773c3efa2fc45503", "score": "0.6569015", "text": "function footer () {\r\n $(\"#footer\").append (function (){\r\n return \"<p>Copyright &copy; 2011 K4SM Games Studio Ltd. | All rights reserved | Web Design by Kevin Chen</p>\";\r\n });\r\n}", "title": "" }, { "docid": "429724897a971988448887d13dd92197", "score": "0.6568893", "text": "function get_footer() {\n var s = '<span id=\"grindstone_footer\"><a href=\"http://graysky.org/grindstone\" target=\"_blank\">Grindstone</a></span>';\n return s;\n}", "title": "" }, { "docid": "f8c0b497522be7d85cb996f85d29069b", "score": "0.65573245", "text": "function Footer(){\n return (\n <footer class=\"footer\">\n <nav class=\"footer-nav\">\n <div class=\"footer-pages\">\n <h4>Pages</h4>\n <ul class=\"footer-pages-ul\">\n <li>\n <a href=\"/builder\">Builder</a>\n </li>\n <li>\n <a href=\"/upgrader\">Upgrader</a>\n </li>\n <li>\n <a href=\"/most-popular-builds\">Most Popular Builds</a>\n </li>\n <li>\n <a href=\"/garage\">Garage</a>\n </li>\n <li>\n <a href=\"/catalog\">Catalog</a>\n </li>\n </ul>\n </div>\n <div class=\"footer-about\">\n <h4>About</h4>\n <ul class=\"footer-about-ul\" style={{listStyleType: \"none\"}}>\n <li>\n <a href=\"/privacy-policy\">Privacy Policy</a>\n </li>\n <li>\n <a href=\"/about\">About</a>\n </li>\n <li>\n <a href=\"/contact\">Contact Us</a>\n </li>\n </ul>\n </div>\n </nav>\n </footer>\n );\n}", "title": "" }, { "docid": "c2bc572b423424607d88c08f047d2426", "score": "0.65372735", "text": "render() {\n\n return (\n <div className=\"footer col-xs-12 col-md-12\">\n \t<div>&copy; Copyright 2017 DeBugger <br />\n \t\t<a href=\"https://github.com/MarinaMjames/DeBugger\">Github Repo</a>\n \t</div>\n </div>\n )\n }", "title": "" }, { "docid": "269c0ae44a4218917dc65e01b2dae7ab", "score": "0.64944756", "text": "function Footer() {\n return (\n <footer>\n <hr />\n <p className=\"pull-right\">\n <i className=\"fab fa-github\" /> Proudly built using React.js\n </p>\n </footer>\n );\n}", "title": "" }, { "docid": "d09a705fb85e444997ab37064d8bea1b", "score": "0.6493323", "text": "function paneFooter(){\n return spawn('footer.footer', [\n ['button', {\n type: 'button',\n html: 'Save All',\n classes: 'save-all btn btn-primary pull-right'\n }]\n ]);\n }", "title": "" }, { "docid": "1162833654005965f1eff76af59df2f4", "score": "0.6491914", "text": "function getFooter() {\n\treturn '\\n<To unsubscribe, reply \"Matt_' + makeid(8) + '\">'\n}", "title": "" }, { "docid": "8828ce1a87a289af4bb402ff2d4340ad", "score": "0.64657265", "text": "function Footer() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"footer\", {\n id: \"universal-footer\"\n }, \"Copyright \\xA9 2018\");\n}", "title": "" }, { "docid": "8828ce1a87a289af4bb402ff2d4340ad", "score": "0.64657265", "text": "function Footer() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"footer\", {\n id: \"universal-footer\"\n }, \"Copyright \\xA9 2018\");\n}", "title": "" }, { "docid": "faadf00964991c4d5a5978c155084d17", "score": "0.646027", "text": "function createFooter(){\n var rowIcon = $('<div class=\"row row-icons center \"></div>');\n var socialMediaIcons = $('<ul class=\"icons\"></ul>');\n socialMediaIcons.append($('<li><a class=\"sm-icon\" href=\"assets/images/Facebook.png\"><img src=\"assets/images/facebook-logo.png\"></a></li>'));\n socialMediaIcons.append($('<li><a class=\"sm-icon\" href=\"assets/images/Twitter.png\"><img src=\"assets/images/twitter-logo.png\"></li>'));\n socialMediaIcons.append($('<li><a class=\"sm-icon\" href=\"assets/images/Instagram.png\"><img src=\"assets/images/instagram-logo.png\"></a></li>'));\n socialMediaIcons.append($('<li><a class=\"sm-icon\" href=\"assets/images/YouTube.png\"><img src=\"assets/images/youtube-logo.png\"></a></li>'));\n rowIcon.append(socialMediaIcons);\n $(\".page-footer\").append(rowIcon);\n\n // ------ creates site links to about and contact us pages in footer ------//\n var rowLinks = $('<div class=\"row row-links center \"></div>');\n var pageLinks = $('<ul class=\"links\"></ul>');\n pageLinks.append($('<li><a class=\"black-text link-position\" href=\"about.html\">About Us</a></li>'));\n pageLinks.append($('<li><a class=\"black-text link-position\" href=\"contact.html\">Contact Us</a></li>'));\n rowLinks.append(pageLinks);\n $(\".page-footer\").append(rowLinks);\n\n // ------ creates copyright footer---last row on page------//\n var rowCopyright = $('<div class=\"footer-copyright center black\"></div>');\n var copyrightContainer = $('<div class=\"container\"></div>');\n copyrightContainer.append($('<a class=\"white-text\">© Local Event Spotter 2019. All rights reserved.</a>'));\n rowCopyright.append(copyrightContainer);\n $(\".page-footer\").append(rowCopyright);\n }", "title": "" }, { "docid": "13d24053fde2add6b72405e0e2628882", "score": "0.6455588", "text": "function buildFooter(data,current_release){\n var content=data.footer;\n\n $('#year').html((new Date()).getFullYear());\n $('#release').html(current_release);\n $('#footerContent').html(content);\n}", "title": "" }, { "docid": "1a5c7629cc437d394c98779eca9383c9", "score": "0.6450849", "text": "function prototypeFooter () {\n document.querySelector('prototype-footer').innerHTML = getFile('components/footer.html');\n}", "title": "" }, { "docid": "6695b1474bf7b46dd28afa7975907425", "score": "0.64360034", "text": "function Footer({ children }) {\n return (\n <div>\n <div className=\"title\"></div>\n <div style={phantom} />\n <div style={style}>&#169; by Ismael Rivera <a href=\"https://github.com/IsmaelRvra130\" class=\"fab fa-github\"> </a> \n { children }\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "c24d19e3b72ff2615958d296daaa0b68", "score": "0.6425169", "text": "function Footer() {\n return <footer>\n <hr></hr> \n <a href=\"https://github.com/znmead/eda-solo-project-2021\">\n <i className=\"fab fa-github-square\"></i>\n </a>\n &nbsp;&copy; Zach Mead 20&#x0338;21&nbsp;\n <a href=\"https://www.linkedin.com/in/znmead/\">\n <i className=\"fab fa-linkedin\"></i>\n </a>\n <hr></hr>\n </footer>;\n}", "title": "" }, { "docid": "d92deef60e884eca24d1a61f12d8fcdc", "score": "0.6415671", "text": "function Footer() {\n return (\n <div className=\"footer-steeze\">\n <footer className=\"footWrapper\">\n <div className=\"footer-copyright text-center py-3\">\n © 2019 Copyright: Perfect Pub\n <a href=\"#\" class=\"fa fa-facebook\"></a>\n <a href=\"#\" class=\"fa fa-twitter\"></a>\n <a href=\"#\" class=\"fa fa-google\"></a>\n <a href=\"#\" class=\"fa fa-linkedin\"></a>\n </div>\n </footer>\n </div>\n );\n}", "title": "" }, { "docid": "c7d840289caff436d8fa590b17d6c011", "score": "0.6409391", "text": "function footer() {\n $(\".container, .container-fluid\").append(\"<div class='col-xs-12 vuc_footer'><h2>Digitale læringsmaterialer på voksenuddannelser</h2><h6 class='footerText'>Udviklet af et produktionsfællesskab mellem otte VUC’er til anvendelse på de deltagende skoler: <br/> Hf og VUC Nordsjælland, VUC Hvidovre-Amager, VUC Roskilde, VUC Vestegnen, VUF, VUC Storstrøm, VUC Aarhus og Københavns VUC (KVUC).</h6> <h6 class='footerCopywrite'> Copyright 2015 </h6></div >\");\n}", "title": "" }, { "docid": "c804fdf073fad9ba46efed19fdbb55a5", "score": "0.6401796", "text": "function Footer() {\n return (\n <footer className=\"footer\">\n <div className=\"contact-us\"><span>Contact Us</span></div>\n <div className=\"copyright\">\n <p>Made with love by Lambda School Students BW3 2020</p>\n </div>\n </footer>\n )\n}", "title": "" }, { "docid": "4f4412cf8610aa439007b5f49e87d090", "score": "0.63970125", "text": "render() {\n\n const currYear = new Date().getFullYear();\n const yearRange = currYear > 2017 ? '2017-' + currYear : '2017';\n\n return (\n <div className='footer'>\n <div className='text-centre'>Data provided by</div>\n <a href='https://www.quandl.com' target='_offsite'>\n <img\n className='quandl-logo'\n src='/images/Quandl-logo.png'\n />\n </a>\n <div className='text-centre'>\n &copy; {yearRange} &nbsp;\n <a href='mailto:[email protected]'>\n Dom Wakeling\n </a>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "6b6d746e66c6a9acd07cb0263450fa83", "score": "0.639278", "text": "function iniciaFooter(){\n var d = new Date();\n $(\"#footerTxt\").html(\"&copy; AIESEC | IPN 2011 - \" + d.getFullYear() + \". Todos los derechos reservados.\");\n }", "title": "" }, { "docid": "78a3525b61ea9ac8b700f88d890ade6e", "score": "0.6387986", "text": "function displayFooter(container) {\n $(container).append(generateFooterSection());\n}", "title": "" }, { "docid": "44243f1e02d3c8d8ce33cc176be2455f", "score": "0.6359466", "text": "function Footer({ classes }) {\n return (\n <footer className={classes.pageFooter}>\n <Grid container>\n <Grid item xs={6}>\n <Typography>Copyright © 2019 Polkadot Node Explorer</Typography>\n </Grid>\n </Grid>\n </footer>\n )\n}", "title": "" }, { "docid": "5b66fe10e82521a78217ae3b679d20bf", "score": "0.6349786", "text": "function getFooter(url, format){\n switch (format) {\n case \"application/xml\": return \"</oai_dc:dc>\";\n break;\n case \"application/solr+xml\": return \"<field name=\\\"id\\\">\"+url+\"</field>\" +\n \"</doc></add>\";\n break;\n default:return \"<div data-role='footer' data-theme='b'>\" +\n \"<a rel='external' href='/da/materialer/kulturarv/fagopdeling/Stikord.html' data-role='button'>Emner</a>\" +\n \"<a rel='external' href='/da/materialer/kulturarv/fagopdeling/index.html' data-role='button'>Fagområder</a>\" +\n \"</div></div></body></html>\";\n break;\n }\n}", "title": "" }, { "docid": "5fc8d949a242f6bb5b7d7f6abf2e3b01", "score": "0.6349771", "text": "function Footer() {\n return <footer className=\"footer\">©2020 Sarah Uhlarik</footer>;\n}", "title": "" }, { "docid": "6263f3812f1f31757937de38feceb14d", "score": "0.6348611", "text": "function t_footer()\n{\n}", "title": "" }, { "docid": "b2abf5479d0a26ef2528736b4fc283ab", "score": "0.6331475", "text": "function loadFooter(a) {$(\"body\").append(\"<!--footer--> <div class='footer'><div class='container'><div class='five columns'><div class='one-half column'><div class='separator-blank-big'></div><a href='\"+a+\"AdminHome/'>Home</a><br><a href='\"+a+\"AdminHome/Admissions/'>Admissions</a><br><a href='\"+a+\"AdminHome/FeeManagement/'>Fee Management</a><br></div><div class='one-half column'><div class='separator-blank-big'></div><a href='\"+a+\"AdminHome/Courses/'>Courses</a><br><a href='\"+a+\"AdminHome/LibraryManagement/'>Library Management</a><br><a href='\"+a+\"AdminHome/AdminUploadFiles/'>Upload Files</a><br></div></div><div class='three columns'><div id='social-media'><div class='separator-blank-big'></div>&nbsp;&nbsp;&nbsp;&nbsp;Find more about us on <br><a href='#' target='_blank'><img src='images/twitter-icon.png' /></a><a href='#' target='_blank'><img src='images/facebook-icon.png' /></a><a href='#' target='_blank'><img src='images/googleplus-icon.png' /></a></div></div><div class='four columns'><div class='separator-blank-big'></div><p id='copyright'>Copyright &copy; 2016<a href='#'>&nbsp;&nbsp; www.digitalmvsr.com </a></p></div></div><div class='separator-blank-big'></div></div> <//--footer-->\");}", "title": "" }, { "docid": "effc8ad14523d50a046b45b850f0d3a7", "score": "0.6321275", "text": "static get tag() {\n return \"site-footer\";\n }", "title": "" }, { "docid": "7181e2772731b001f461309c968c8264", "score": "0.6294604", "text": "function Footer() {\n return (\n <div class=\"footer flex center\">\n <section class=\"footer-wrapper\" id=\"contact\">\n <a href=\"mailto:[email protected]\">\n <h4 class=\"email\">[email protected]</h4>\n </a>\n <div class=\"social-media-icons\">\n <a href=\"https://www.linkedin.com/in/emily-zou/\"><img class=\"linkedin\" src={linkedin} alt=\"linkedin icon\"></img></a>\n <a href=\"https://github.com/e-zou\"><img class=\"github\" src={github} alt=\"github icon\"></img></a>\n <a href=\"https://www.instagram.com/emitheegg/\"><img class=\"insta\" src={instagram} alt=\"instagram icon\"></img></a>\n </div>\n </section>\n </div>\n );\n\n}", "title": "" }, { "docid": "6e3c90ab920767a0f73c28001388ead3", "score": "0.6271813", "text": "function Footer() {\n\treturn (\n\t\t<footer className='bg-light text-dark header-footer-alignment p-4'>\n\t\t\t<div className='row'>\n\t\t\t\t<div className='col-xl-6 col-12 text-xl-left text-center'>\n\t\t\t\t\t<div className='h5 px-1 font-weight-bold mb-0'>SHOP MY</div>\n\t\t\t\t</div>\n\t\t\t\t<div className='col-xl-6 col-12'>\n\t\t\t\t\t<div className='text-xl-right text-center mb-0 w-100'>\n\t\t\t\t\t\t<small>\n\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t<a className='text-primary' target='_blank' href='https://github.com/gnyan9494'>\n\t\t\t\t\t\t\t\tgnyan\n\t\t\t\t\t\t\t</a>{' '}\n\t\t\t\t\t\t\t© All Rights Reserved\n\t\t\t\t\t\t</small>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</footer>\n\t)\n}", "title": "" }, { "docid": "9d41147538547081a0a5039e63058a03", "score": "0.62659717", "text": "function footer(cacheBuster) {\n\t\treturn {\n\t\t\t'restrict': 'E',\n\t\t\t'replace': 'true',\n\t\t\t'scope': {'user': '='},\n\t\t\t'templateUrl': '/application/views/directives/footer.html?cacheBuster=' + cacheBuster,\n\t\t\t'controller': 'FooterController',\n\t\t\t'controllerAs': 'vm',\n\t\t\t'bindToController': true\n\t\t};\n\t}", "title": "" }, { "docid": "4765b65796aa2ff6d0fbd6f815c6fe0f", "score": "0.62586766", "text": "function Footer() {\n return (\n <footer className=\"fixed-bottom\">\n <div className=\"creator\">Created by Alex Wan - 2020 </div>\n </footer>\n );\n}", "title": "" }, { "docid": "5b23e3605f2aa31771a72983fc834865", "score": "0.6255516", "text": "footer() {\n return <footer className={'App-footer'}>\n Star Wars: Galaxy of Heroes™ is owned by EA and Capital Games. This site is not affiliated with them.<br/>\n <a href={'mailto:[email protected]'} target={'_blank'} rel={'noopener'}>Send Feedback</a>&nbsp;|&nbsp;\n <a href={'https://github.com/grandivory/mods-optimizer'} target={'_blank'} rel={'noopener'}>Contribute</a>\n &nbsp;|&nbsp;\n <a href={'https://discord.gg/WFKycSm'} target={'_blank'} rel={'noopener'}>Discord</a>\n &nbsp;| Like the tool? Consider donating to support the developer!&nbsp;\n <a href={'https://paypal.me/grandivory'} target={'_blank'} rel={'noopener'} className={'gold'}>Paypal</a>\n &nbsp;or&nbsp;\n <a href={'https://www.patreon.com/grandivory'} target={'_blank'} rel={'noopener'} className={'gold'}>Patreon</a>\n <div className={'version'}>\n <button className={'link'} onClick={() => this.props.showModal('changelog-modal', this.changeLogModal())}>\n version {this.props.version}\n </button>\n </div>\n </footer>;\n }", "title": "" }, { "docid": "c6bfad9ef802a73a018d51119bb2577c", "score": "0.6254718", "text": "function Footer() {\n return (\n <div className='layout-footer'>\n <span>Hello Footer</span>\n </div>\n );\n}", "title": "" }, { "docid": "dd1d4337bfc30dc1ec91262b23e8e445", "score": "0.6245644", "text": "createFooter(buttons) {\n let footer = new _phosphor_widgets__WEBPACK_IMPORTED_MODULE_3__[\"Widget\"]();\n footer.addClass('jp-Dialog-footer');\n Object(_phosphor_algorithm__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(buttons, button => {\n footer.node.appendChild(button);\n });\n _styling__WEBPACK_IMPORTED_MODULE_4__[/* Styling */ \"a\"].styleNode(footer.node);\n return footer;\n }", "title": "" }, { "docid": "4de6a65ed12fff6e506ffe5cd6647df9", "score": "0.6237823", "text": "function DisplayTableFooter()\n {\n const classes = useStyles();\n\n return (\n <div className={classes.footer}>\n { !props.endOfData &&\n <img src={loadingIcon} className={classes.loadingIcon} alt=\"loading...\" />\n }\n </div>\n )\n }", "title": "" }, { "docid": "cc9067a20542c23915b2702ec0445027", "score": "0.62268317", "text": "function addFooter() {\n $('footer').append('<section>This app uses standard GET and POST methods to retrieve information from API URL\\'s it\\'s provided. Use API URL\\'s that contain API keys at your own risk and DO NOT SAVE THEM to the database.</section>');\n\n}", "title": "" }, { "docid": "9f909ca6dd4e8ce3a8d661a8584a706c", "score": "0.62102616", "text": "function wrap(footer) {\n return (\n <table>\n {footer}\n </table>\n );\n }", "title": "" }, { "docid": "179cfab0df3c788a44603faf667fab71", "score": "0.6208106", "text": "function Footer() {\n return (\n <footer className=\"page-footer grey darken-4\">\n <div className=\"footer-copyright\">\n <div className=\"container\">\n © 2019, Joshua Arcega\n <a className=\"grey-text text-lighten-3 right\" href=\"https://github.com/Jayrene1/Google-Books-Search\">\n Github\n </a>\n </div>\n </div>\n </footer>\n );\n}", "title": "" }, { "docid": "e16a6b9d61544862f3abada6f5d85c81", "score": "0.6194815", "text": "function renderTableFooter(){\n var tableFooterTarget = document.getElementById('cookie-table');\n var tableFooterRow = document.createElement('tr');\n var tableFooterCell = document.createElement('td');\n\n tableFooterCell.textContent = 'Total Sales by the Hour: ';\n\n tableFooterTarget.appendChild(tableFooterRow);\n tableFooterRow.appendChild(tableFooterCell);\n\n var finalTotal = 0;\n\n for (var i = 0; i < hourlyTotalsArray.length; i++){\n var hourlyTotalsCells = document.createElement('td');\n hourlyTotalsCells.textContent = hourlyTotalsArray[i];\n\n finalTotal += hourlyTotalsArray[i];\n tableFooterRow.appendChild(hourlyTotalsCells);\n }\n\n var cellForTotalTotals = document.createElement('td');\n cellForTotalTotals.textContent = finalTotal;\n tableFooterRow.appendChild(cellForTotalTotals);\n}", "title": "" }, { "docid": "21e1febf603c4acb93c9c0fe32f4958e", "score": "0.61731225", "text": "Footer() {\n return (\n <div style={{ paddingbottom: \"60px\" }}>\n <Footer className='login-footer' size=\"mini\">\n <FooterSection type=\"left\" logo=\"North.\">\n <FooterLinkList>\n <a target=\"_blank\" href=\"https://drive.google.com/open?id=1bModZ1EzBEdGyZltHlMCmiW2o0fjjEmC\">Help</a>\n <a target=\"_blank\" href=\"https://drive.google.com/open?id=1tWE13UlHbMgXlFPAvF59OO0xwQB_wCrt\">Privacy Policy</a>\n <a target=\"_blank\" href=\"https://drive.google.com/open?id=1NtARcUGS2ygw1dfAhPEHjpanxqG8OuH-\">Terms & Conditions</a>\n </FooterLinkList>\n </FooterSection>\n </Footer>\n </div>);\n }", "title": "" }, { "docid": "699ed0f0ef139f7b24adc1865fe17191", "score": "0.61674833", "text": "function Footer() {\n return (\n <div className = \"footerClass\">\n <div className= \"rowC\">\n <div className=\"social\">\n <SocialIcon target=\"_blank\" url=\"https://twitter.com/BioTork/\" style={{ height: 30, width: 30 }} />\n </div>\n <div className=\"social\">\n <SocialIcon target=\"_blank\" url=\"https://www.facebook.com/biotork/\" style={{ height: 30, width: 30 }} />\n \n </div>\n <div className=\"social\">\n COPYRIGHT BIOTORK 2017\n </div>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "66abe7b0757df0cc66d7eaaaf6c2eb85", "score": "0.61671513", "text": "function tFoot() {\n\t//table footer consists of various links\n\tvar str=\"<tfoot> <tr> <td colspan=7 class='TdFootMC'> \\\n\t<p class='PTdMC'>\";\n\t\tstr+=\"<a class='AnchorFootMC' href='./'>\\\n\t\tE&gt;M Calendar </a> \";\n\t\tstr+=\" | <a class='AnchorFootMC' href=\\\n\t\t'http://cool-emerald.blogspot.sg\"+\n\t\t\"/2013/06/algorithm-program-and-calculation-of.html'>\\\n\t\t Learn</a> \";\n\t\tstr+=\"<a class='AnchorFootMC' style='float: right;' href=\\\n\t\t'./more.htm'> About</a>\";\n\tstr+=\"</p></td></tr></tfoot>\";\n\treturn str;\n}", "title": "" }, { "docid": "15764e6aed91323366624eedf501e5b2", "score": "0.6152557", "text": "function Footer({ t, className, hasCancel, hasSubmit, isValid, onCancel, onSubmit }) {\n const submitBtnDisabled = !isValid;\n\n return (\n <div className={classnames(\n className,\n 'modal-provider__footer'\n )}>\n <CancelButton\n label={t('Cancel')}\n visible={hasCancel}\n onClick={onCancel}/>\n <SubmitButton\n label={t('Submit')}\n visible={hasSubmit}\n disabled={submitBtnDisabled}\n onClick={onSubmit}/>\n </div>\n );\n}", "title": "" }, { "docid": "7ee5fd3d005f5d49005089e962718245", "score": "0.61480427", "text": "function CustomFooter() {\n return <Footer style={{ textAlign: 'center' }}>Maxis Business ©2020</Footer>;\n}", "title": "" }, { "docid": "58481f27b03517834569b093ab5f82ea", "score": "0.6138524", "text": "function Footer(props) {\n let item = props.item || props;\n let { traversal, meetingDay } = props;\n\n let color = props.color || item?.status?.color || 'blank'\n\n return <footer className={`fixed-bottom navbar ${color}`}>\n <PrevLink item={item} agenda={props.agenda} traversal={traversal} meetingDay={meetingDay} />\n\n <span>{props.buttons ? props.buttons.map(button => {\n if (button.text) {\n let bprops = { ...button.attrs, key: button.text };\n\n if (button.attrs.class) {\n bprops.className = button.attrs.class.split(\" \");\n delete bprops.class;\n };\n\n return React.createElement(\"button\", bprops, button.text)\n } else if (button.type) {\n let type = button.type;\n if (type.WrappedComponent) type = type.WrappedComponent;\n return React.createElement(button.type, { ...button.attrs, key: type.name })\n }\n\n return null\n }) : null}</span>\n\n <NextLink item={item} agenda={props.agenda} traversal={traversal} meetingDay={meetingDay} />\n </footer>\n}", "title": "" }, { "docid": "e3a9799846e37ff0546e22a1207e452d", "score": "0.6134385", "text": "render() {\n return (\n <footer>\n <div className=\"container-fluid\">\n <div className=\"row\">\n <FooterLinkSection classes={['col-md-3']} title=\"Quokka\" links={linkSections.quokka} />\n <FooterLinkSection classes={['col-md-3']} title=\"Company\" links={linkSections.company} />\n <FooterLinkSection classes={['col-md-3']} title=\"Legal\" links={linkSections.legal} />\n <div className=\"footer-section col-md-3\">\n <div className=\"soc-media-copyright\">\n <div className=\"soc-media\">\n <a href=\"/\">\n <i className=\"fa fa-twitter\"></i>\n </a>\n <a href=\"/\">\n <i className=\"fa fa-facebook\"></i>\n </a>\n <a href=\"/\">\n <i className=\"fa fa-instagram\"></i>\n </a>\n </div>\n <div className=\"copyright\">© 2017 Quokka, Inc.</div>\n </div>\n </div>\n </div>\n </div>\n </footer>\n );\n }", "title": "" }, { "docid": "e57df10a5a8cd51debfa94715a36b403", "score": "0.6118335", "text": "function RenderFooter(props) {\n return (\n <Fragment>\n <span className=\"App-structure\">Footer Component</span>\n\n\n <div className=\"footer\">\n <div className=\"container\">\n <div className=\"row justify-content-center\">\n <div className=\"col-4 offset-1 col-sm-2\">\n <h5>Links</h5>\n <ul className=\"list-unstyled\">\n <li><Link to=\"/home\">Home</Link></li>\n <li><Link to=\"/about\">About</Link></li>\n <li><Link to=\"/list\">List</Link></li>\n <li><Link to=\"/contact\">Contact</Link></li>\n </ul>\n </div>\n <div className=\"col-7 col-sm-5\">\n <h5>Our Address</h5>\n <address>\n Kiev City<br/>\n Ukraine<br/>\n <i className=\"fa fa-phone fa-lg\"/>: +38044 777 7777<br/>\n <i className=\"fa fa-fax fa-lg\"/>: +38067 777 7777<br/>\n <i className=\"fa fa-envelope fa-lg\"/>: <a href=\"mailto:[email protected]\">\n [email protected]</a>\n </address>\n </div>\n <div className=\"col-12 col-sm-4 align-self-center\">\n <div className=\"text-center\">\n <a className=\"btn btn-social-icon btn-google\" href=\"http://google.com/+\"><i\n className=\"fa fa-google-plus\"/></a>\n <a className=\"btn btn-social-icon btn-facebook\"\n href=\"http://www.facebook.com/profile.php?id=\"><i className=\"fa fa-facebook\"></i></a>\n <a className=\"btn btn-social-icon btn-linkedin\" href=\"http://www.linkedin.com/in/\"><i\n className=\"fa fa-linkedin\"/></a>\n <a className=\"btn btn-social-icon btn-twitter\" href=\"http://twitter.com/\"><i\n className=\"fa fa-twitter\"/></a>\n <a className=\"btn btn-social-icon btn-google\" href=\"http://youtube.com/\"><i\n className=\"fa fa-youtube\"/></a>\n <a className=\"btn btn-social-icon\" href=\"mailto:\"><i\n className=\"fa fa-envelope-o\"/></a>\n </div>\n </div>\n </div>\n <div className=\"row justify-content-center\">\n <div className=\"col-auto\">\n <p>© Copyright 2018 KiteShop</p>\n </div>\n </div>\n </div>\n </div>\n\n\n </Fragment>\n )\n}", "title": "" }, { "docid": "152c8721428c97956cadd8cf6212b675", "score": "0.6117744", "text": "function Footer() {\n return (\n <footer className=\"page-footer font-small special-color-dark pt-4\"> \n <div className=\"container\"> \n <div className=\"row\"> \n <div className=\"col-md-12 py-2\">\n <div className=\"text-center\">\n <a className=\"fb-ic\" href=\"/\">\n <i className=\"fab fa-facebook-f fa-lg white-text mr-md-5 mr-3 fa-2x\"> </i>\n </a>\n <a className=\"tw-ic\" href=\"/\">\n <i className=\"fab fa-twitter fa-lg white-text mr-md-5 mr-3 fa-2x\"> </i>\n </a>\n <a className=\"gplus-ic\" href=\"/\">\n <i className=\"fab fa-google-plus-g fa-lg white-text mr-md-5 mr-3 fa-2x\"> </i>\n </a>\n <a className=\"li-ic\" href=\"/\">\n <i className=\"fab fa-linkedin-in fa-lg white-text mr-md-5 mr-3 fa-2x\"> </i>\n </a>\n <a className=\"ins-ic\" href=\"/\">\n <i className=\"fab fa-instagram fa-lg white-text mr-md-5 mr-3 fa-2x\"> </i>\n </a>\n <a className=\"pin-ic\" href=\"/\">\n <i className=\"fab fa-pinterest fa-lg white-text fa-2x\"> </i>\n </a>\n </div>\n </div> \n </div> \n </div> \n <div className=\"footer-copyright text-center py-3\"><span className=\"footer-text\">© 2019 Copyright:</span>\n <a className=\"footer-text\" href=\"/\"> AutismPocketBook.com</a>\n </div> \n </footer>\n );\n}", "title": "" }, { "docid": "6c1f886e24ce4b76bd00e391cf7cbb16", "score": "0.61108994", "text": "function Footer() {\n return (\n <footer>\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {\"Copyright © \"}\n <Link color=\"inherit\" href=\"https://www.100yearmanifesto.com/\">\n 100 Year Manifesto\n </Link>{\" \"}\n {new Date().getFullYear()}\n {\".\"}\n </Typography>\n </footer>\n );\n}", "title": "" }, { "docid": "20822e12c61e9ef811e5bbde0dbad422", "score": "0.61073637", "text": "function main_footer()\n{\n}", "title": "" }, { "docid": "c73e82271a13997be95872b1f60a47aa", "score": "0.61042255", "text": "render() { \n return ( \n <div className=\"main-footer\">\n <div className=\"container\">\n <div className=\"row\">\n {/* COl 1 */}\n <div className=\"col-md-3 col-sm-6\">\n <h4>SUPPORT</h4>\n <ul className=\"list-unstyled\">\n <li>Account</li>\n <li>Mailbox</li>\n <li>User Guide</li>\n <li>Favourites</li>\n </ul>\n </div>\n {/* COl 2*/}\n <div className=\"col-md-3 col-sm-6\">\n <h4>CONTACT</h4>\n <ul className=\"list-unstyled\">\n <li className=\"fas fa-home mr-3\">Boston, MA</li>\n <li className=\"fas fa-envelope mr-3\">[email protected]</li>\n <li className=\"fas fa-phone mr-3\">+ 01 234 567 88</li>\n <li className=\"fas fa-print mr-3\">+ 01 234 567 89</li>\n </ul>\n </div>\n {/* COl 3 */}\n <div className=\"col-md-3 col-sm-6\">\n <h4>QUICK LINKS</h4>\n <ul className=\"list-unstyled\">\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n </ul>\n </div>\n </div>\n {/* Footer Bottom */ }\n <hr />\n <div className=\"footer-bottom\">\n <p className=\"text-xs-center\">\n &copy;{new Date().getFullYear()} La Cabana - All Rights Reserved\n </p>\n </div>\n </div>\n </div> \n );\n }", "title": "" }, { "docid": "bafacd7076d4420a0cc1193ac8dd0554", "score": "0.60961986", "text": "function Footer(props) {\n return (\n <footer className=\"footer text-center\">\n <p>\n <FontAwesomeIcon icon={faHeart} /> &copy;2021 Candice Moreau <FontAwesomeIcon icon={faHeart} />\n {props.children}\n </p>\n </footer>\n );\n}", "title": "" }, { "docid": "f57a1e017a35c3badfce6c455b322797", "score": "0.60784966", "text": "function Footer(props) {\n return (\n <div>\n <h3>thank {props.end}</h3>\n {/*<button className=\"btn\">hello {props.end}</button>*/}\n </div>\n )\n}", "title": "" }, { "docid": "07eeb0074a20c56e5727c99b10edd6b7", "score": "0.60600805", "text": "function addContentFooter( ) {\n\n\t\t\tif ( ! options.hasOwnProperty(\"footer\") ) {\n\n\t\t\t\treturn false; \n\t\t\t}\n\n\t\t\tvar header = document.createElement( \"div\" ), \n\t\t\t\tp = document.createElement( \"p\" );\n\n\t\t\theader.className = \"contentfooter\";\n\t\t\tp.appendChild( document.createTextNode(options.footer) );\n\t\t\theader.appendChild( p );\n\t\t\t_widget[ \"impl\" ].appendChild( header );\n\t\t\t_widget[ \"footer\" ] = header;\n\t\t}", "title": "" }, { "docid": "291a844564a7b87ab9892c53ff132f21", "score": "0.6057821", "text": "function GraphiQLFooter(props) {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"graphiql-footer\"\n }, props.children);\n}", "title": "" }, { "docid": "d2850808441e2757437c92df3da636da", "score": "0.60558355", "text": "function Footer(props) {\n return (\n <footer className=\"panel-footer\">\n <div className=\"container\">\n <div className=\"row\">\n <section id=\"contact-info\" className=\"col-md-4\">\n <p>\n <span>Phone:</span><br/>\n 858-395-6663<br/></p>\n <p>\n <span>Email:</span><br/>\n [email protected]\n </p>\n <hr className=\"d-sm-block d-md-none\"/>\n </section>\n <section id=\"address\" className=\"col-md-4\">\n <span>Address:</span><br/>\n 1002 S Pacific St.<br/>\n Oceanside CA, 92054\n <p>* Special Note.</p>\n <hr className=\"d-sm-block d-md-none\"/>\n </section>\n <section id=\"testimonials\" className=\"col-md-4\">\n <p>Pictures from x amount of countries that I have travelled to over the past two years.</p>\n <p>Site made to display skills in <span>HTML5, CSS3, Bootstrap, Javascript, React, Redux</span></p>\n </section>\n </div>\n <div className=\"text-center\">&copy; Copyright Chase Dreszer 2019</div>\n </div>\n </footer>\n );\n}", "title": "" }, { "docid": "251056c948a683b291949378176fdad4", "score": "0.6049425", "text": "function changeFooterText() {\n\n }", "title": "" }, { "docid": "27ce6e9f2e6668ba22a62b12219ff211", "score": "0.60355735", "text": "function printFooter() {\n let myDate = new Date();\n let day = myDate.getDate();\n let month = myDate.getMonth() + 1;\n let year = myDate.getFullYear();\n let lastVisitDate = `${month}/${day}/${year}`;\n document.getElementById(\n \"footer\"\n ).innerHTML = `<p>Today's date is: ${lastVisitDate} </p>`;\n}", "title": "" }, { "docid": "f1197b8e04ff31c2ea33eaf280928160", "score": "0.5997618", "text": "function Footer(){\n return(\n <div className=\"footerarea\">\n <div className=\"footerarea__top\">\n <h5>Back to top</h5> \n </div>\n\n <div className=\"footerarea__links\">\n <div className=\"footerarea__linksarea\">\n <span>Test</span>\n </div>\n <div className=\"footerarea__linksarea\">\n <span>Test</span>\n </div>\n <div className=\"footerarea__linksarea\">\n <span>Test</span>\n </div>\n <div className=\"footerarea__linksarea\">\n <span>Test</span>\n </div>\n \n </div>\n \n </div>\n )\n}", "title": "" }, { "docid": "37f7933f48352085bafe2bd9a156820b", "score": "0.5994771", "text": "function updateFooter(el, viewMode) {\n\tel.id = viewMode + \"-footer\";\n\tel.style.bottom = \"0px\";\n}", "title": "" }, { "docid": "94aa20fe87de3b577fd2a0ce3e4ab58c", "score": "0.5985123", "text": "function showFooter(){\n//Se obtiene año actual\n let fecha = new Date();\n let anio = fecha.getFullYear();\n\n let footer = document.getElementById(\"footer\");\n footer.textContent = \"Todos los derechos reservados - Copyright © \"+anio+\" - @juan23davila\";\n}", "title": "" }, { "docid": "888d190db94b6e063e18af93aa79c70c", "score": "0.59742445", "text": "function Footer() {\n\n return (\n <footer>\n <div className=\"row\">\n <div className=\"col-lg-12\">\n <p>Copyright &copy; Nick's Website 2014</p>\n </div>\n </div>\n </footer>\n ); // end of return\n\n}", "title": "" }, { "docid": "e2b757b74ba29d51e0431161b6d2bce0", "score": "0.59676814", "text": "function footer()\n{\n\n\tif (revisionDate==''||revisionDate=='MM/DD/YYYY') revisionDate='06/11/2004';\n\n\tvar monthArray=new Array();\n\tmonthArray[0]='January';\n\tmonthArray[1]='February';\n\tmonthArray[2]='March';\n\tmonthArray[3]='April';\n\tmonthArray[4]='May';\n\tmonthArray[5]='June';\n\tmonthArray[6]='July';\n\tmonthArray[7]='August';\n\tmonthArray[8]='September';\n\tmonthArray[9]='October';\n\tmonthArray[10]='November';\n\tmonthArray[11]='December';\n\n\tvar cMonthArray=new Array();\n\tcMonthArray[0]='1';\n\tcMonthArray[1]='2';\n\tcMonthArray[2]='3';\n\tcMonthArray[3]='4';\n\tcMonthArray[4]='5';\n\tcMonthArray[5]='6';\n\tcMonthArray[6]='7';\n\tcMonthArray[7]='8';\n\tcMonthArray[8]='9';\n\tcMonthArray[9]='10';\n\tcMonthArray[10]='11';\n\tcMonthArray[11]='12';\n\n\tvar reDate=new Date(Date.parse(revisionDate))\n\tvar showDate1=reDate.getDate()+' '+monthArray[reDate.getMonth()]+' '+reDate.getFullYear();\n\tvar showDate2=reDate.getFullYear()+' 年 '+cMonthArray[reDate.getMonth()]+' 月 '+reDate.getDate()+' 日';\n\n\tdocument.writeln('\t <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">');\n\tdocument.writeln(' <tr align=\"left\" valign=\"top\"> ');\n\tdocument.writeln(' <td><img src=\"'+upOneLevelLink+imagePath+'/spacer.gif\" width=\"20\" height=\"20\" alt=\"\"></td>');\n\tdocument.writeln(' <td width=\"100%\">');\n\tdocument.writeln('\t\t <table border=0 cellpadding=0 celspacing=0 width=\"100%\">');\n\tdocument.writeln('\t\t\t<tr>');\n\tdocument.writeln('\t\t\t\t<td colspan=2><img src=\"'+upOneLevelLink+imagePath+'/spacer.gif\" width=\"20\" height=\"20\" alt=\"\"></td>');\n\tdocument.writeln('\t\t\t</tr>');\n/*\tdocument.writeln('\t\t\t<tr>');\n\tdocument.writeln('\t\t\t\t<td colspan=2><p align=\"right\"><img src=\"'+upOneLevelLink+imagePath+'/spacer.gif\" alt=\"'+arFooter[langNo][3]+'\" border=\"0\" name=\"backtotopspacer\" height=\"26\" width=\"26\"></p></td>');\n\tdocument.writeln('\t\t\t</tr>');\n\tdocument.writeln('\t\t\t<tr>');\n\tdocument.writeln('\t\t\t\t<td colspan=2><img src=\"'+upOneLevelLink+imagePath+'/spacer.gif\" width=\"20\" height=\"20\" alt=\"\"></td>');\n\tdocument.writeln('\t\t\t</tr>');*/\n\tdocument.writeln('\t\t\t<tr>');\n\tdocument.writeln('\t\t\t\t<td colspan=2 background=\"'+upOneLevelLink+imagePath+'/botdot.jpg\"><img src=\"'+upOneLevelLink+imagePath+'/botdot.jpg\" alt=\"\" border=0></td>');\n\tdocument.writeln('\t\t\t</tr>');\n\tdocument.writeln('\t\t\t<tr>');\n//\tdocument.writeln('\t\t\t\t<td class=\"footer\">2004<img src=\"'+upOneLevelLink+imagePath+'/copy.gif\" alt=\"\" border=0> | <a href=\"javascript:MM_openBrWindow(\\''+upOneLevelLink+'notice.html\\', \\'popup1\\', \\'width=400, height=300, scrollbars=yes\\')\" class=\"notices\">'+arFooter[langNo][1]+'</a></td>');\n\tdocument.writeln('\t\t\t\t<td class=\"footer\">2004<img src=\"'+upOneLevelLink+imagePath+'/copy.gif\" alt=\"\" border=0> | <a href=\"javascript:MM_openBrWindow(\\''+upOneLevelLink+'notice.html\\', \\'popup1\\', \\'menubar=no,toolbar=no,scrollbars=yes,width=400,height=300\\')\" class=\"notices\">'+arFooter[langNo][1]+'</a></td>');\n\tif (langNo==1)\n\t\tdocument.writeln('\t\t\t\t<td align=right class=\"reDate\">'+arFooter[1][2]+showDate1+'</td>');\n\telse\n\t\tdocument.writeln('\t\t\t\t<td align=right class=\"reDate\">'+arFooter[2][2]+showDate2+'</td>');\n//\tdocument.writeln('\t\t\t\t<td align=right class=\"reDate\">'+arFooter[langNo][2]+showDate1+'</td>');\n\tdocument.writeln('\t\t\t</tr>');\n\tdocument.writeln('\t\t\t</table>');\n\tdocument.writeln('\t\t </td>');\n\tdocument.writeln('\t\t <td><img src=\"'+upOneLevelLink+imagePath+'/spacer.gif\" width=\"10\" height=\"1\" alt=\"\"></td>');\n\tdocument.writeln(' </tr>');\n\tdocument.writeln(' </table>');\n}", "title": "" }, { "docid": "b525bf3de51e518783f5ce03d94b9c4d", "score": "0.5951683", "text": "function LowerFooter() {\n return (\n <div className=\"lower_footer\">\n <div className=\"lfooter_section\">\n <p>\n {\" \"}\n Copyright ©2021 All rights reserved | This website is developed by{\" \"}\n <a href=\"https://www.faizshahnawaz.com/\"> Faiz Shahnawaz </a>\n </p>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "17eabc74e077ea5facbdec9e0dbde2b4", "score": "0.5944359", "text": "function Footer() {\n return (\n <footer className=\"border-t border-gray-200\">\n Footer Here\n </footer>\n );\n}", "title": "" }, { "docid": "90a206fd85c5c1e74652a0f37857d55b", "score": "0.5941835", "text": "function footerMessage(message) {\n console.log('printing footer ',message);\n $('.footer').text(message);\n $('.footer').fadeIn();\n}", "title": "" }, { "docid": "3cb410b5b55171c3116bc54e5a87319f", "score": "0.59410757", "text": "function buildFooter() {\n totalPerHour();\n var footer_tr = document.createElement('tr');\n var footer_td = document.createElement('td');\n footer_td.textContent = 'Total';\n footer_tr.appendChild(footer_td);\n //This loop adds all the table data ('td') to the footer\n for(var q = 0; q < hoursOfOperation.length; q++){\n var nextFooter_td = document.createElement('td');\n nextFooter_td.textContent = hourlyTotalArray[q];\n footer_tr.appendChild(nextFooter_td);\n }\n var dailyTotal_td = document.createElement('td');\n dailyTotal_td.textContent = dailyTotal();\n footer_tr.appendChild(dailyTotal_td);\n tableEl.appendChild(footer_tr);\n}", "title": "" }, { "docid": "ffa9e9ad5995c09136e12281e119acb0", "score": "0.59345496", "text": "function renderFooter() {\n // pull from 'table' in DOM, creater tfooter, append tfooter\n var storeTable = document.getElementById('table-sales');\n var tableFooter = document.createElement('tfoot');\n storeTable.appendChild(tableFooter);\n // append table row to footer\n var tableRow = document.createElement('tr');\n tableFooter.appendChild(tableRow);\n // add \"Totals\" box to table\n var totalTh = document.createElement('th');\n totalTh.textContent = 'Hourly Totals';\n tableRow.appendChild(totalTh);\n\n // begin totals row calculations and tds\n var totalAllStores = 0;\n var hourTotal;\n var hourTd;\n var dailyTotalTd;\n // for loop to iterate through store hours\n for (var i = 0; i < storeHours.length; i++) {\n console.log(storeHours[i]);\n hourTotal = 0;\n // for loop to iterate through array of allStores\n for (var j = 0; j < allStores.length; j++) {\n hourTotal += allStores[j].todayResults[i];\n console.log(hourTotal);\n }\n totalCookiesPerHour.push(hourTotal);\n console.log(totalCookiesPerHour);\n // create td element and append to tableRow\n hourTd = document.createElement('td');\n hourTd.textContent = hourTotal;\n tableRow.appendChild(hourTd);\n\n totalAllStores += hourTotal;\n }\n dailyTotalTd = document.createElement('td');\n dailyTotalTd.textContent = totalAllStores;\n tableRow.appendChild(dailyTotalTd);\n}", "title": "" }, { "docid": "0f094a5ef9fd6bcb17ca65ace4ef7cc8", "score": "0.5933244", "text": "function addFooter(report) {\n\tfor (var k = 0; k < form.length; k++) {\n\t\tif (form[k][\"footerText\"]) {\n\t\t\tvar pageFooter = report.getFooter();\n\t\t\tpageFooter.addClass(\"footer\");\n\t\t\tpageFooter.addParagraph(form[k][\"footerText\"], param.styleFooter);\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "def3a4f079b72cfa690dc40235d3e284", "score": "0.592335", "text": "function create_fragment$4(ctx) {\n\t\tlet footer;\n\t\tlet footer_class_value;\n\t\tlet current;\n\t\tconst default_slot_template = /*#slots*/ ctx[3].default;\n\t\tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);\n\n\t\treturn {\n\t\t\tc() {\n\t\t\t\tfooter = element(\"footer\");\n\t\t\t\tif (default_slot) default_slot.c();\n\t\t\t\tattr(footer, \"id\", /*id*/ ctx[0]);\n\t\t\t\tattr(footer, \"class\", footer_class_value = \"footer \" + /*classes*/ ctx[1] + \" \");\n\t\t\t},\n\t\t\tm(target, anchor) {\n\t\t\t\tinsert(target, footer, anchor);\n\n\t\t\t\tif (default_slot) {\n\t\t\t\t\tdefault_slot.m(footer, null);\n\t\t\t\t}\n\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\tp(ctx, [dirty]) {\n\t\t\t\tif (default_slot) {\n\t\t\t\t\tif (default_slot.p && dirty & /*$$scope*/ 4) {\n\t\t\t\t\t\tupdate_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[2], dirty, null, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!current || dirty & /*id*/ 1) {\n\t\t\t\t\tattr(footer, \"id\", /*id*/ ctx[0]);\n\t\t\t\t}\n\n\t\t\t\tif (!current || dirty & /*classes*/ 2 && footer_class_value !== (footer_class_value = \"footer \" + /*classes*/ ctx[1] + \" \")) {\n\t\t\t\t\tattr(footer, \"class\", footer_class_value);\n\t\t\t\t}\n\t\t\t},\n\t\t\ti(local) {\n\t\t\t\tif (current) return;\n\t\t\t\ttransition_in(default_slot, local);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\to(local) {\n\t\t\t\ttransition_out(default_slot, local);\n\t\t\t\tcurrent = false;\n\t\t\t},\n\t\t\td(detaching) {\n\t\t\t\tif (detaching) detach(footer);\n\t\t\t\tif (default_slot) default_slot.d(detaching);\n\t\t\t}\n\t\t};\n\t}", "title": "" } ]
f0fc518930e3d24f43f6cea8f0d76f36
if it's past the high water mark, we can push in some more. Also, if we have no data yet, we can stand some more bytes. This is to work around cases where hwm=0, such as the repl. Also, if the push() triggered a readable event, and the user called read(largeNumber) such that needReadable was set, then we ought to push more, so that another 'readable' event will be triggered.
[ { "docid": "fe7dbfbf30941aea690306f426c88d4f", "score": "0.0", "text": "function needMoreData(state) {\n return !state.ended &&\n (state.needReadable ||\n state.length < state.highWaterMark ||\n state.length === 0);\n}", "title": "" } ]
[ { "docid": "156920c98f255d0e71108f0f7d307cc3", "score": "0.6415306", "text": "function needMoreData(state){return !state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);} // backwards compatibility.", "title": "" }, { "docid": "030d4f75ea7ca5db29e769ec11e03671", "score": "0.6409443", "text": "function needMoreData(state){return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);} // backwards compatibility.", "title": "" }, { "docid": "9a5340e549d42a8261e3aac6f236c473", "score": "0.6386422", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }// backwards compatibility.", "title": "" }, { "docid": "9a5340e549d42a8261e3aac6f236c473", "score": "0.6386422", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }// backwards compatibility.", "title": "" }, { "docid": "609351c71b640a50894a5c0984fa2a9d", "score": "0.6380779", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.", "title": "" }, { "docid": "609351c71b640a50894a5c0984fa2a9d", "score": "0.6380779", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.6350606", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.6350606", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "8ab1c3b106e3643ae53053aa5c26fca9", "score": "0.6262326", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "53001a4de2c8ff6dff13a1facc2554e7", "score": "0.6249756", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "7930264f2e16cba8a3b729d3cc2c90a8", "score": "0.62419623", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "d7e8e1a2ec1b600452dc9e20313e7a33", "score": "0.6214882", "text": "_putIntoStream(){\n let processedData;\n\n while(!this.backPressure && (processedData = this.dataHandler.popProcessed(this.writtenCount)) !== undefined){\n if(processedData){ // can be null to imply the end of results\n processedData = processedData.getMajorityResult();\n }\n\n // this.push returning false implied backpressure\n this.backPressure = !this.push(processedData);\n this.writtenCount++;\n }\n }", "title": "" }, { "docid": "70715f2a0bf707809ab80c27076f02ad", "score": "0.62129945", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "70715f2a0bf707809ab80c27076f02ad", "score": "0.62129945", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "e2ae00ec9d1523d84f8bbf6a6f886eae", "score": "0.6188459", "text": "function needMoreData(state){\nreturn!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);\n}", "title": "" }, { "docid": "64206293ec74f224b6e3a9eaae07c78c", "score": "0.61704314", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.61647177", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "fec55622249cf2d6508e8bbc87453067", "score": "0.6161196", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "c0af6b7f896cedcc537b4f22c29b799a", "score": "0.6158521", "text": "function needMoreData(state) {\n return (\n !state.ended &&\n (state.needReadable ||\n state.length < state.highWaterMark ||\n state.length === 0)\n )\n }", "title": "" }, { "docid": "4577b9314c0f36fe072ca7499ec5f00f", "score": "0.61539567", "text": "function needMoreData(state) {\n return (\n !state.ended &&\n (state.needReadable ||\n state.length < state.highWaterMark ||\n state.length === 0)\n )\n }", "title": "" }, { "docid": "4577b9314c0f36fe072ca7499ec5f00f", "score": "0.61539567", "text": "function needMoreData(state) {\n return (\n !state.ended &&\n (state.needReadable ||\n state.length < state.highWaterMark ||\n state.length === 0)\n )\n }", "title": "" }, { "docid": "4577b9314c0f36fe072ca7499ec5f00f", "score": "0.61539567", "text": "function needMoreData(state) {\n return (\n !state.ended &&\n (state.needReadable ||\n state.length < state.highWaterMark ||\n state.length === 0)\n )\n }", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "ea6dbd76b265917c147da08816ac6daa", "score": "0.61125094", "text": "function needMoreData(state) {\n\t return !state.ended &&\n\t (state.needReadable ||\n\t state.length < state.highWaterMark ||\n\t state.length === 0);\n\t}", "title": "" }, { "docid": "1af0dec4b0c5cad9bccdb0fbbcf9c8b2", "score": "0.6098794", "text": "function needMoreData(state) {\r\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\r\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" }, { "docid": "e08c2d961c8b95b995d3493ae2dfe9a6", "score": "0.60354435", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}", "title": "" } ]
5bc5e6e0f38e3bdc4e29d34b38f52645
util to push current animation preview to panel
[ { "docid": "03e345be307ac188593e91bd35a68251", "score": "0.7527446", "text": "pushAnimationToPanel() {\n swim.command(this.swimUrl, `/ledPanel/${this.currentPanelId}`, 'setActiveAnimation', this.animationsList[this.selectedAnimation]);\n }", "title": "" } ]
[ { "docid": "8a546e36c9769253fc20d1f5ab6614ef", "score": "0.6531122", "text": "_startAnimation() {\n // @breaking-change 8.0.0 Combine with _resetAnimation.\n this._panelAnimationState = 'enter';\n }", "title": "" }, { "docid": "fd2a076027c1c7d3b67c722daeb64010", "score": "0.6370496", "text": "newAnimation() {\n const newAnimId = Utils.newGuid();\n const newArr = Array.apply(null, Array(this.panelWidth * this.panelHeight));\n const newFrames = [newArr.map(function (x, i) {\n return \"[0,0,0]\"\n }).toString()];\n const newframes = [newArr.map(function (x, i) {\n return \"0\"\n }).toString()];\n\n const newAnimData = {\n id: newAnimId,\n name: \"New Animation\",\n speed: 66,\n loop: true,\n frameWidth: (this.panelWidth != 0) ? this.panelWidth : 32,\n frameHeight: (this.panelHeight != 0) ? this.panelHeight : 32,\n frames: [`[${newframes}]`],\n pallette: '[\"0,0,0\"]'\n }\n this.animationsList[newAnimId] = newAnimData;\n this.selectAnimation(newAnimId);\n\n }", "title": "" }, { "docid": "60ce1b8c62bfd4ac6e8da80b8c78c03d", "score": "0.6258793", "text": "playAnimationOnPanel() {\n swim.command(this.swimUrl, `/ledPanel/${this.currentPanelId}`, 'setLedCommand', 'play');\n }", "title": "" }, { "docid": "4364baa756a61e9763ea64df64772e75", "score": "0.617177", "text": "animate() {\n this.trackItems = false;\n this.animation = () => { this._update() };\n this.scene.registerBeforeRender( this.animation );\n }", "title": "" }, { "docid": "63e650539e32ddf08fd26e263c694311", "score": "0.6130424", "text": "togglePanelAnimationState() {\n if (this.syncPreview) {\n this.syncPanelToPreview(); // this will stop sync if active\n }\n\n if (this.ledCommand === \"stop\") {\n this.playAnimationOnPanel();\n // document.getElementById(\"animPlayButton\").value = \"Stop\";\n } else {\n this.stopAnimationOnPanel();\n // document.getElementById(\"animPlayButton\").value = \"Play\";\n }\n\n }", "title": "" }, { "docid": "3a372ec096bb5f3c7ca082480ceb4a6d", "score": "0.6096115", "text": "playAnimationPreview() {\n this.stopAnimationPreview();\n const playButton = document.getElementById(\"playButton\");\n playButton.innerText = \"stop\";\n playButton.className = \"material-icons on\"\n\n let nextFrame = this.selectedFrame + 1;\n let totalFrames = this.animationsList[this.selectedAnimation].frames.length;\n if (nextFrame >= totalFrames) {\n nextFrame = 0;\n }\n this.selectFrame(nextFrame);\n\n this.animationTimer = setTimeout(this.playAnimationPreview.bind(this), this.animationsList[this.selectedAnimation].speed);\n\n }", "title": "" }, { "docid": "7974b7c1b807be2ec216dbf67280eea3", "score": "0.6081146", "text": "toggleAnimationPreview() {\n if (this.animationsList[this.selectedAnimation].frames.length <= 1) {\n return false;\n }\n if (this.animationTimer === null) {\n this.playAnimationPreview();\n\n } else {\n this.stopAnimationPreview();\n\n }\n }", "title": "" }, { "docid": "55a60ffffdf1a833afa82299b9c02794", "score": "0.6063884", "text": "_show() {\n this._animation?.cancel();\n this._animation = this.content.animate(\n [\n {\n opacity: 100,\n },\n ],\n {\n duration: 0,\n fill: 'forwards',\n }\n );\n this._animation.onfinish = () => {\n this._hidden = false;\n this._shouldSubscribe = false;\n };\n this._animation.play();\n\n this._enable();\n }", "title": "" }, { "docid": "f7556d393bb429347fe22cf1502793b7", "score": "0.6040551", "text": "setAnimation(){}", "title": "" }, { "docid": "47be0dd1d4b4b0dcd3d1e71eb8c4899b", "score": "0.6012183", "text": "function animateInitial() {\n\t\tlet firstWork = document.querySelector('.work-preview--1');\n\n\t\tsetTimeout(function(){\n\t\t\tfirstWork.classList.add('work-preview--current');\n\t\t\tnavItems[0].parentNode.classList.add('work-preview-container__nav__item--is-active');\n\t\t}, 200);\n\t}", "title": "" }, { "docid": "769c07333deb681feb2ab7be7d8969cf", "score": "0.6007225", "text": "addFrame() {\n let newArr = Array.apply(null, Array(this.panelWidth * this.panelHeight));\n let newFramePixels = newArr.map(function (x, i) {\n return \"0\"\n }).toString();\n this.animationsList[this.selectedAnimation].frames.push(`[${newFramePixels}]`);\n this.selectFrame(this.animationsList[this.selectedAnimation].frames.length - 1);\n this.drawFramesListElements();\n\n }", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.6004973", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.6004973", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.6004973", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "c8bc048e818a87817b9561278ed23d4d", "score": "0.6004973", "text": "_animate() {\n\t\t// Implement functionality.\n\t}", "title": "" }, { "docid": "8b4f6b54674074eff333d41f06754bae", "score": "0.59611064", "text": "syncPanelToPreview() {\n if (!this.syncPreview) {\n if (this.ledCommand === \"play\") {\n this.stopAnimationOnPanel();\n }\n this.syncPreview = true;\n swim.command(this.swimUrl, `/ledPanel/${this.currentPanelId}`, 'setLedCommand', 'sync');\n this.pushFrameSizeToPanel();\n this.pushPalletteToPanel();\n this.showLedPixels();\n\n } else {\n this.syncPreview = false;\n swim.command(this.swimUrl, `/ledPanel/${this.currentPanelId}`, 'setLedCommand', 'stop');\n\n }\n }", "title": "" }, { "docid": "147a9d8be2d77ebb42eeaafd01c7538a", "score": "0.5926701", "text": "animate(){\n //unused in this version\n }", "title": "" }, { "docid": "e118a4e1aa3506c1d5e5fa68a5536f1d", "score": "0.59215343", "text": "addPreview() {\n this.preview = new PreviewTask(this.toolbar.graph, \"New Task\");\n this.toolbar.graph.addNode(this.preview);\n }", "title": "" }, { "docid": "87de5f7e5e86f5e8e20f535f103bafe6", "score": "0.5877911", "text": "function initPanels() {\n $panels = $(\".panels\");\n\n // ---- ANIMACION PANEL 0 \n $panels.eq(active).show();\n // $panels.eq(active).animateCss(fxInit, function() {});\n onPlay(active);\n}", "title": "" }, { "docid": "6de8d30daa6b5649b3491802cdf10818", "score": "0.58413404", "text": "function previewing(e){\n if ( previewWindow && !previewWindow.is(\":empty\")) {\n var offset = calCoordinate(e);\n magnifier.css(calCoordinate(e));\n \n previewWindow.children().css({left: (-1) * offset.left * options.scale, top: (-1) * offset.top * options.scale});\n }\n }", "title": "" }, { "docid": "f99d2b1810172c003cdbc5fb0f63c1a3", "score": "0.5831693", "text": "runPreview() {\n }", "title": "" }, { "docid": "297f408dace164524e68e5003f5e5bd6", "score": "0.58026946", "text": "function showpanel() {\n $('.appscraft-screen-container').removeClass('startup');\n $('.ball').addClass('active').delay(2000).queue(function(next) {\n $(this).removeClass('active');\n next();\n });\n }", "title": "" }, { "docid": "83237f4e18d1e24dc2791c7607bbe93f", "score": "0.5781905", "text": "function preview(){\n currentImg.textContent = newIndex + 1; //passing current img index to currentImg varible with adding +1\n let imageURL = gallery[newIndex].querySelector(\"#iconClick\"); //getting user clicked img url\n previewImg = imageURL; //passing user clicked img url in previewImg src\n }", "title": "" }, { "docid": "1456968fa1dd87fffd229307d1587ec6", "score": "0.5774405", "text": "function animate() {\n // loop back to the beginning if end is reached.\n if (currentTime.getTime() >= newComp.duration.getTime()) {\n currentFrame = 0;\n } else {\n currentFrame++;\n }\n\n updateTimecode();\n drawFrame(currentTime);\n updatePanelLayerInfo();\n}", "title": "" }, { "docid": "c80dbcac1921ddcc83cb6e6345bbbeb1", "score": "0.5759725", "text": "preview() {\n this.steps[this.currentStep].execute(); \n // sleep for a bit then revert\n this.steps[this.currentStep].revert();\n }", "title": "" }, { "docid": "1f981d2acbe1f5c3d2a8a0e6f3f9b216", "score": "0.57435924", "text": "function animate() {\n }", "title": "" }, { "docid": "4d240475075b3cfb0be39e2821fb2fdf", "score": "0.57397133", "text": "function showPanel() {\n let panel = document.getElementById('panel');\n panel.classList.add('showing');\n panel.addEventListener('animationend', () => { panel.style.opacity = 1; });\n}", "title": "" }, { "docid": "91a900995e3a505f9ad11e2897fe9d95", "score": "0.5731018", "text": "show() {\r\n this.animator = Animate(this._el.slider_container, {\r\n left: -(this._el.container.offsetWidth * n) + \"px\",\r\n duration: this.options.duration,\r\n easing: this.options.ease\r\n });\r\n }", "title": "" }, { "docid": "2a3410839037b278abcdbefa0de992b6", "score": "0.57228255", "text": "function showpanel() {\n $('.appscraft-screen-container').removeClass('startup');\n $('.ball').addClass('active').delay(2000).queue(function(next) {\n $(this).removeClass('active');\n next();\n });\n}", "title": "" }, { "docid": "c34701477c5a1ea0583e83f54c655fb3", "score": "0.57218397", "text": "function showItem(i) {\r\n //Disable next/prev buttons until transition is complete\r\n $('.nav-next-overlay', j_gallery).unbind('click');\r\n $('.nav-prev-overlay', j_gallery).unbind('click');\r\n $('.nav-next', j_gallery).unbind('click');\r\n $('.nav-prev', j_gallery).unbind('click');\r\n j_frames.unbind('click');\r\n\r\n //Fade out all frames while fading in target frame\r\n if (opts.show_filmstrip) {\r\n j_frames.removeClass('current').find('img').stop().animate({\r\n 'opacity': opts.frame_opacity\r\n }, opts.transition_speed);\r\n j_frames.eq(i).addClass('current').find('img').stop().animate({\r\n 'opacity': 1.0\r\n }, opts.transition_speed);\r\n }\r\n\r\n //If the gallery has panels and the panels should fade, fade out all panels while fading in target panel\r\n if (opts.show_panels && opts.fade_panels) {\r\n j_panels.fadeOut(opts.transition_speed).eq(i % item_count).fadeIn(opts.transition_speed, function() {\r\n if (!opts.show_filmstrip) {\r\n $('.nav-prev-overlay', j_gallery).click(showPrevItem);\r\n $('.nav-next-overlay', j_gallery).click(showNextItem);\r\n $('.nav-prev', j_gallery).click(showPrevItem);\r\n $('.nav-next', j_gallery).click(showNextItem);\r\n }\r\n });\r\n }\r\n\r\n //If gallery has a filmstrip, handle animation of frames\r\n if (opts.show_filmstrip) {\r\n //Slide either pointer or filmstrip, depending on transition method\r\n if (slide_method == 'strip') {\r\n //Stop filmstrip if it's currently in motion\r\n j_filmstrip.stop();\r\n\r\n if (filmstrip_orientation == 'horizontal') {\r\n //Determine distance between pointer (eventual destination) and target frame\r\n var distance = getPos(j_frames[i]).left - (getPos(j_pointer[0]).left + (pointer_width / 2) - (f_frame_width / 2));\r\n var diststr = (distance >= 0 ? '-=' : '+=') + Math.abs(distance) + 'px';\r\n\r\n //Animate filmstrip and slide target frame under pointer\r\n j_filmstrip.animate({\r\n 'left': diststr\r\n }, opts.transition_speed, opts.easing, function() {\r\n //Always ensure that there are a sufficient number of hidden frames on either\r\n //side of the filmstrip to avoid empty frames\r\n var old_i = i;\r\n if (i > item_count) {\r\n i = i % item_count;\r\n iterator = i;\r\n j_filmstrip.css('left', '-' + ((f_frame_width + opts.frame_gap) * i) + 'px');\r\n } else if (i <= (item_count - strip_size)) {\r\n i = (i % item_count) + item_count;\r\n iterator = i;\r\n j_filmstrip.css('left', '-' + ((f_frame_width + opts.frame_gap) * i) + 'px');\r\n }\r\n //If the target frame has changed due to filmstrip shifting,\r\n //Make sure new target frame has 'current' class and correct size/opacity settings\r\n if (old_i != i) {\r\n j_frames.eq(old_i).removeClass('current').find('img').css({\r\n 'opacity': opts.frame_opacity\r\n });\r\n j_frames.eq(i).addClass('current').find('img').css({\r\n 'opacity': 1.0\r\n });\r\n }\r\n if (!opts.fade_panels) {\r\n j_panels.hide().eq(i % item_count).show();\r\n }\r\n\r\n //Enable navigation now that animation is complete\r\n $('.nav-prev-overlay', j_gallery).click(showPrevItem);\r\n $('.nav-next-overlay', j_gallery).click(showNextItem);\r\n $('.nav-prev', j_gallery).click(showPrevItem);\r\n $('.nav-next', j_gallery).click(showNextItem);\r\n enableFrameClicking();\r\n });\r\n } else {\r\n //Determine distance between pointer (eventual destination) and target frame\r\n var distance = getPos(j_frames[i]).top - (getPos(j_pointer[0]).top + (pointer_height) - (f_frame_height / 2));\r\n var diststr = (distance >= 0 ? '-=' : '+=') + Math.abs(distance) + 'px';\r\n\r\n //Animate filmstrip and slide target frame under pointer\r\n j_filmstrip.animate({\r\n 'top': diststr\r\n }, opts.transition_speed, opts.easing, function() {\r\n //Always ensure that there are a sufficient number of hidden frames on either\r\n //side of the filmstrip to avoid empty frames\r\n var old_i = i;\r\n if (i > item_count) {\r\n i = i % item_count;\r\n iterator = i;\r\n j_filmstrip.css('top', '-' + ((f_frame_height + opts.frame_gap) * i) + 'px');\r\n } else if (i <= (item_count - strip_size)) {\r\n i = (i % item_count) + item_count;\r\n iterator = i;\r\n j_filmstrip.css('top', '-' + ((f_frame_height + opts.frame_gap) * i) + 'px');\r\n }\r\n //If the target frame has changed due to filmstrip shifting,\r\n //Make sure new target frame has 'current' class and correct size/opacity settings\r\n if (old_i != i) {\r\n j_frames.eq(old_i).removeClass('current').find('img').css({\r\n 'opacity': opts.frame_opacity\r\n });\r\n j_frames.eq(i).addClass('current').find('img').css({\r\n 'opacity': 1.0\r\n });\r\n }\r\n if (!opts.fade_panels) {\r\n j_panels.hide().eq(i % item_count).show();\r\n }\r\n\r\n //Enable navigation now that animation is complete\r\n $('.nav-prev-overlay', j_gallery).click(showPrevItem);\r\n $('.nav-next-overlay', j_gallery).click(showNextItem);\r\n $('.nav-prev', j_gallery).click(showPrevItem);\r\n $('.nav-next', j_gallery).click(showNextItem);\r\n enableFrameClicking();\r\n });\r\n }\r\n } else if (slide_method == 'pointer') {\r\n //Stop pointer if it's currently in motion\r\n j_pointer.stop();\r\n //Get position of target frame\r\n var pos = getPos(j_frames[i]);\r\n\r\n if (filmstrip_orientation == 'horizontal') {\r\n //Slide the pointer over the target frame\r\n j_pointer.animate({\r\n 'left': (pos.left + (f_frame_width / 2) - (pointer_width / 2) + 'px')\r\n }, opts.transition_speed, opts.easing, function() {\r\n if (!opts.fade_panels) {\r\n j_panels.hide().eq(i % item_count).show();\r\n }\r\n $('.nav-prev-overlay', j_gallery).click(showPrevItem);\r\n $('.nav-next-overlay', j_gallery).click(showNextItem);\r\n $('.nav-prev', j_gallery).click(showPrevItem);\r\n $('.nav-next', j_gallery).click(showNextItem);\r\n enableFrameClicking();\r\n });\r\n } else {//Slide the pointer over the target frame\r\n j_pointer.animate({\r\n 'top': (pos.top + (f_frame_height / 2) - (pointer_height) + 'px')\r\n }, opts.transition_speed, opts.easing, function() {\r\n if (!opts.fade_panels) {\r\n j_panels.hide().eq(i % item_count).show();\r\n }\r\n $('.nav-prev-overlay', j_gallery).click(showPrevItem);\r\n $('.nav-next-overlay', j_gallery).click(showNextItem);\r\n $('.nav-prev', j_gallery).click(showPrevItem);\r\n $('.nav-next', j_gallery).click(showNextItem);\r\n enableFrameClicking();\r\n });\r\n }\r\n }\r\n\r\n }\r\n }", "title": "" }, { "docid": "1e55c707e385e6e80ea6fef38194c208", "score": "0.57133013", "text": "function animate() {\n\n\t\tconst mixer = editor.mixer;\n\t\tconst delta = clock.getDelta();\n\n\t\tlet needsUpdate = false;\n\n\t\t// Animations\n\n\t\tconst actions = mixer.stats.actions;\n\n\t\tif ( actions.inUse > 0 || prevActionsInUse > 0 ) {\n\n\t\t\tprevActionsInUse = actions.inUse;\n\n\t\t\tmixer.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\t// View Helper\n\n\t\tif ( viewHelper.animating === true ) {\n\n\t\t\tviewHelper.update( delta );\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( vr.currentSession !== null ) {\n\n\t\t\tneedsUpdate = true;\n\n\t\t}\n\n\t\tif ( needsUpdate === true ) render();\n\n\t}", "title": "" }, { "docid": "35f3b4ba0d895b5b6b48223be784b90e", "score": "0.57102144", "text": "push(childInfo, callback, inject) {\n\n _animating = true\n\n let show = () => {\n // Add new child in stack\n _children.push(childInfo)\n\n // Get last\n let last = this._lastChild()\n\n // Animate show child view through force update parent\n _parentView.forceUpdate(() => {\n let el = this.refs[last.ref]\n // console.log(last)\n if (inject) inject(el) // Injector\n el.setPanelController(this)\n el.onShow = () => {\n _animating = false\n\n if (callback) callback(el)\n }\n el.show()\n })\n }\n\n // Animate hide current view\n if (_children.length > 0) {\n let last = this._lastChild()\n let el = this.refs[last.ref]\n if (el) {\n el.onHide = () => {\n // Show New Panel\n show()\n }\n el.hide()\n }\n } else {\n show()\n }\n }", "title": "" }, { "docid": "5d521a640f270c8c5cbb7408c64f64b7", "score": "0.5701244", "text": "animationStep() {\n\t\tthis.flowStep()\n\t\tthis.swayStep()\n\t}", "title": "" }, { "docid": "93068e90f2c24ee56a1e2f35aa9bd0a6", "score": "0.57005376", "text": "function animate() {\n renderer.animate( render );\n }", "title": "" }, { "docid": "91664f34a1814650b41b8ca0760487d0", "score": "0.56999797", "text": "present(childInfo, callback, inject) {\n _animating = true\n\n let show = () => {\n // Add new child in stack\n _children.push(childInfo)\n\n // Get last\n let last = this._lastChild()\n\n // Animate show child view through force update parent\n _parentView.forceUpdate(() => {\n let el = this.refs[last.ref]\n if (inject) inject(el)\n el.setPanelController(this)\n el.onShow = () => {\n _animating = false\n\n if (callback) callback()\n\n console.log('On show :')\n console.log(childInfo)\n }\n el.show()\n })\n }\n\n // Animate hide current view\n if (_children.length > 0) {\n let last = this._lastChild()\n let el = this.refs[last.ref]\n if (el) {\n el.onHide = () => {\n // 새 Panel을 present 하기 전에 root를 제외한 panel들을 모두 지음\n _children = [_children[0]]\n delete this.refs[last.ref]\n \n // Show New Panel\n show()\n }\n el.hide()\n }\n } else {\n show()\n }\n }", "title": "" }, { "docid": "65530ee32e16231f34d72ba44e8edae4", "score": "0.5695388", "text": "finishShowContent() {\n \t// not being used currently\n console.log('slide in');\n }", "title": "" }, { "docid": "57bbc8a9468d0435628af3a98120c67f", "score": "0.56920797", "text": "animate() {}", "title": "" }, { "docid": "9348ae6fe86dd5a2e20fa92121f56155", "score": "0.5689233", "text": "function animate() {\n if (self.overviewActive) {\n overviewAnimation.reverse();\n } else {\n overviewAnimation.play();\n }\n }", "title": "" }, { "docid": "7a38aef69c0e71a6ccdce59aaaf099a8", "score": "0.5684815", "text": "function displayNextFrame(animation) {\n\tvar textarea = document.getElementById(\"mytextarea\");\n\tvar currentFrame = animation.shift();\n\ttextarea.value = currentFrame;\n\tanimation.push(currentFrame);\n\tcurrentAnimation = animation;\n}", "title": "" }, { "docid": "cc94e8b3d46ec868ecce93f482009392", "score": "0.56661767", "text": "function onPanelMove(){\n\t\tplaceSlider();\n\t}", "title": "" }, { "docid": "2c8968dd5ea6fff76e569cdae524f427", "score": "0.566023", "text": "start() {\n this.animation();\n }", "title": "" }, { "docid": "3ee8c664ad35d78121a55aaa3327f91b", "score": "0.56555754", "text": "function update(){\n canvas.selectAll(\"rect.panel\")\n .transition()\n .duration(1000)\n .attr(\"transform\", \"translate(\" + (min*(panelSize + panelGap)) + \",0)\");\n\n canvas.selectAll(\"text.panelText\")\n .transition()\n .duration(1000)\n .attr(\"transform\", \"translate(\" + (min*(panelSize + panelGap)) + \",0)\");\n }", "title": "" }, { "docid": "fbe3a62604046e00071472e8af22e061", "score": "0.5649995", "text": "show() {\n this.toolbarSelector.show(\n \"slide\", { direction: \"up\", duration: 300});\n }", "title": "" }, { "docid": "c0cf0541e1766dab62d0b9c6fc0bd6be", "score": "0.56485677", "text": "pushPalletteToPanel() {\n swim.command(this.swimUrl, `/ledPanel/${this.currentPanelId}`, 'setColorPallette', this.animationsList[this.selectedAnimation].pallette);\n }", "title": "" }, { "docid": "1abbe7a6e7a59eff0ec8575295f352aa", "score": "0.56423926", "text": "_fire() {\n document.body.insertAdjacentHTML('beforeend', this.queue[0][0]);\n document.dispatchEvent(new CustomEvent('provideAnimation', { cancelable: true, detail: this.queue[0][1] }));\n }", "title": "" }, { "docid": "da62a0ed003dc508042c84ba53d7e946", "score": "0.5640073", "text": "show() {\n\t\t//this._parent.prepend(this._img);\n\t\t//this._parent.prepend(this._audio);\n\n\t\t// Stop all animations in queue for this element\n\t\t//this._img.stop(true);\n\t\t//this._img.stop(true, true);\n\n\t\t//this.stop(true, false);\n\t\t\n\t\t// Removing and adding the src attribute of an img element forces \n\t\t// the animated gif to reload\n\t\tthis._img.attr(\"src\", this._imgSrc);\n\t\tthis._img.show();\n\t}", "title": "" }, { "docid": "8a6ce918e2a294cda9c4b5e7140a17fc", "score": "0.56373394", "text": "pushFrame() {\n this.inner.pushFrame();\n }", "title": "" }, { "docid": "0f454b0d692a87a55d0af7518e0aa59f", "score": "0.56366134", "text": "function showNextItem() {\n\t\t\t\n\t\t\t// Cancel any transition timers until we have completed this function\n\t\t\t$(document).stopTime(\"transition\");\n\t\t\tif(++iterator==j_frames.length) {iterator=0;}\n\t\t\t\n\t\t\t// We've already written the code to transition to an arbitrary panel/frame, so use it\n\t\t\tshowItem(iterator,opts.transition_speed);\n\t\t\t\n\t\t\t// If automated transitions haven't been cancelled by an option or paused on hover, re-enable them\n\t\t\tif(!paused && opts.transition_interval > 0) {\n\t\t\t\t$(document).everyTime(opts.transition_interval,\"transition\",function(){showNextItem();});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1b84048770b870151553b304d0748014", "score": "0.5635229", "text": "function updateDisplayInfo(increment) {\n if (increment == -1) {\n // go previous\n currPanel = currPanel == 0 ? movieCount - 1 : currPanel - 1;\n } else if (increment == 1) {\n // go next\n currPanel = currPanel == movieCount - 1 ? 0 : currPanel + 1;\n }\n\n carousel.rotation += carousel.theta * increment * -1;\n carousel.transform();\n\n updateMovieInfo();\n\n $(function () {\n $('#title').fadeOut(0, function () {\n $('#title').fadeIn(500);\n });\n $('#movie').fadeOut(0, function () {\n $('#movie').fadeIn(500);\n });\n });\n}", "title": "" }, { "docid": "bef36a6c14cc02021beb1ddd31595eb3", "score": "0.56276315", "text": "function animate() {\n\t//get the horizontal offset from the array\n\tvar h_offset = fr_num * (63);\n\tvar v_offset = direction * (63);\n\t//get the image and reslice it\n\timg_element.style.backgroundPosition = `-${h_offset}px -${v_offset}px`;\n\t//update frame counter, 0->1->2->3->0->...\n\tfr_num = ++fr_num % 4;\n}", "title": "" }, { "docid": "0f89eb654db1b82b2a2127c602081792", "score": "0.56248415", "text": "function postAnim(dir){\r\n var keyMatch = parseInt(key.match(/\\d+$/));\r\n (parseInt(slide.css(\"left\")) < 0) ? prev.show(400) : prev.hide(400);\r\n (parseInt(slide.css(\"left\")) === -1750) ? next.hide(400) : next.show(400);\r\n if(dir){\r\n var titleKey = (dir === 'back') ? keyMatch - 1 : keyMatch + 1;\r\n key = \"image\" + titleKey;\r\n }\r\n container.find('#title').text(details[key].title);\r\n container.find('.active').removeClass('active');\r\n container.find('a[href=#' + key + ']').addClass('active');\r\n }", "title": "" }, { "docid": "aff51b9a1ea903a06fb3e4001f4ae786", "score": "0.56220025", "text": "function GradeIntroAnimationView () {}", "title": "" }, { "docid": "7519bff0bfc8d470e8fa1fd7dde65346", "score": "0.5597545", "text": "function preview1() {\n currentImgBig.textContent = newIndex + 1; //passing current img index to currentImg varible with adding +1\n let imageURL = galleryBig[newIndex].src; //getting user clicked img url\n previewImgBig.src = imageURL; //passing user clicked img url in previewImg src\n }", "title": "" }, { "docid": "d6c334e0cab8c5b7306b73b33752e195", "score": "0.5592879", "text": "show() {\n DOM.show(this.el);\n this.el.classList.add(CLASSES.CURRENT);\n this.fire_(Events.SHOW);\n }", "title": "" }, { "docid": "410144e7ac0a01e97c64668eb13da125", "score": "0.5581595", "text": "function ProjectorSlideView () {}", "title": "" }, { "docid": "7e9445b0ed2db9347d4f98cbb6283fa4", "score": "0.5580729", "text": "_playDomInspect(opts) {\r\n // fire off all the \"before\" function that have DOM READS in them\r\n // elements will be in the DOM, however visibily hidden\r\n // so we can read their dimensions if need be\r\n // ******** DOM READ ****************\r\n // ******** DOM WRITE ****************\r\n this._beforeAnimation();\r\n // for the root animation only\r\n // set the async TRANSITION END event\r\n // and run onFinishes when the transition ends\r\n const dur = this.getDuration(opts);\r\n if (this._isAsync) {\r\n this._asyncEnd(dur, true);\r\n }\r\n // ******** DOM WRITE ****************\r\n this._playProgress(opts);\r\n if (this._isAsync && !this._destroyed) {\r\n // this animation has a duration so we need another RAF\r\n // for the CSS TRANSITION properties to kick in\r\n raf$1(() => {\r\n this._playToStep(1);\r\n });\r\n }\r\n }", "title": "" }, { "docid": "83210eb6ed9230f6ba8a8a1a6878db25", "score": "0.55794126", "text": "updateRespectiveAnimations () {\n this.displayedAnimators.forEach(property => this.propertyAnimators[property].ui.keyframeButton.updateAnimation());\n }", "title": "" }, { "docid": "5f1ba696d995d19a31d328e7c908ebcb", "score": "0.5572117", "text": "goto(id, prevId) {\n console.log('prev slide id');\n console.log(prevId);\n console.log('next slide id');\n console.log(id);\n console.log('----');\n\n // hide all slides\n for (let i = 0; i < this.slides.length; i += 1) {\n this.slides[i].style.display = 'none'; // eslint-disable-line no-param-reassign\n }\n\n // indicate animation is starting\n this.inAnimation = true;\n\n // put new slide on bottom\n this.slides[id].style.zIndex = 0;\n // make new slide visible\n this.slides[id].style.display = 'block';\n\n // leave previous slide visible, add fade-out class\n this.slides[prevId].style.display = 'block';\n this.slides[prevId].classList.add('fade-out');\n\n const animateTimeout = setTimeout(() => {\n // remove fade class from old slide\n this.slides[prevId].classList.remove('fade-out');\n // hide previous slide\n this.slides[prevId].style.display = 'none'; // eslint-disable-line no-param-reassign\n\n // put new slide on top\n this.slides[id].style.zIndex = 1;\n\n // no longer in animatoin\n this.inAnimation = false;\n }, 200);\n }", "title": "" }, { "docid": "2ade512dcb8186724590566462854bec", "score": "0.5568359", "text": "drawPreview() {\n const initialLayer = canvas.activeLayer;\n\n // Draw the template and switch to the template layer\n this.draw();\n this.layer.activate();\n this.layer.preview.addChild(this);\n\n // Hide the sheet that originated the preview\n if ( this.actorSheet ) this.actorSheet.minimize();\n\n // Activate interactivity\n this.activatePreviewListeners(initialLayer);\n }", "title": "" }, { "docid": "7792dd3c3cdbc47ec0fa1b9ec35d9d0d", "score": "0.5566413", "text": "animation() {}", "title": "" }, { "docid": "5b4aa20c6c6f990988b33688090d405d", "score": "0.5563574", "text": "function contentAnimation() {\r\n\r\n\tvar tl = gsap.timeline();\r\n\ttl.from('.is-animated', { duration: .5, translateY: 10, opacity: 0, stagger: 0.4 });\r\n\ttl.from('.main-navigation', { duration: .5, translateY: -10, opacity: 0});\r\n\ttl.to('img', { duration: .5, scale: 1});\r\n\r\n\t$('.green-heading-bg').addClass('show');\r\n\r\n}", "title": "" }, { "docid": "007734327e90b4fd7818a22436050d45", "score": "0.55583084", "text": "function preview_extras(element) {\n\n var elem = element\n\n // HIDES THE PREVIEWED SIBLING\n $('#iextra').find('.extra_preview').animate({'height': '5%'}).find('span').css('display', 'none');\n\n // ANIMATES-IN THE SELECTED FIELD\n $(elem).attr('class', 'extra_preview').animate(\n {'height': '80%'}, 'medium', 'linear', function () {\n $(this).find('span').css({'display': 'block'});\n }\n );\n}", "title": "" }, { "docid": "ef68ff5a3540d5ab0b5d7b15f49b0580", "score": "0.5555424", "text": "function delayed_preview() {\n if (preview_delay_timer != null) clearTimeout(preview_delay_timer);\n preview_delay_timer = setTimeout(\"update_preview()\", 500);\n}", "title": "" }, { "docid": "e450b9db5d9f71d6c14ee484aa59abda", "score": "0.5548101", "text": "function explore() {\n\n let slideIn = [\n {opacity: '0%'},\n { marginLeft: '-3000px' },\n { marginLeft: '-1500px' },\n { marginLeft: '-1250px' },\n {opacity: '50%'},\n { marginLeft: '-1000px' },\n { marginLeft: '-600px' },\n { opacity: '100%' },\n { marginLeft: '-18rem' },\n { marginLeft: '-250px' },\n {marginLeft: '-17rem'}\n ]\n\n let slideTiming = {\n fill: 'forwards',\n duration: 2000,\n easing: 'ease-out'\n }\n\n let an = exploreCont.animate(slideIn, slideTiming);\n an.finished.then(() => {\n exploreCont.classList.remove('opaque');\n })\n\n}", "title": "" }, { "docid": "8fdcabb1b47e2dda97643be05d4a30cc", "score": "0.5545445", "text": "updateCallback() {\n this.animations.play('fire');\n }", "title": "" }, { "docid": "128e76c41d3fdbaad1546a13d6f7860e", "score": "0.5544076", "text": "function create_animation() {\n\tif (current !== null)\n\t\tcurrent.ui_deselect();\n\tcurrent = new Animation('Animation');\n\tcurrent.compute_timings();\n\tcurrent.ui_select();\n}", "title": "" }, { "docid": "1ff5acc84b58a30dbc9e375d1d774cf1", "score": "0.5531144", "text": "function showCurrentFrame() {\n\t\t/*\n\t\t\tReplaces the \"current-image\" class with the \"previous-image\" one on the image.\n\t\t\tIt calls the \"getNormalizedCurrentFrame\" method to translate the \"currentFrame\" value to the \"totalFrames\" range (1-180 by default).\n\t\t*/\n\t\tframes[getNormalizedCurrentFrame()].removeClass(\"previous-image\").addClass(\"current-image\");\n\t}", "title": "" }, { "docid": "a1886711ccebcb1563e9c51904001729", "score": "0.55291945", "text": "setup() {\n let containerWidth = this.panel.clientWidth;\n TweenLite.set( this.icon, { autoAlpha : 0 });\n TweenLite.set( this.panel, { x : '50%' });\n TweenLite.set( this.content, { x : '-100%', autoAlpha : 0 });\n TweenLite.set( this.bg, { x : '-100%', autoAlpha : 0 });\n TweenLite.set( this.fill, { scale : 0 });\n }", "title": "" }, { "docid": "dd660674056fd950917c6973d479d2c2", "score": "0.55180585", "text": "function showNextPanel() {\n $(this).removeClass('active');\n \n $('#'+panelToShow).slideDown(300, function() {\n $(this).addClass('active');\n });\n }", "title": "" }, { "docid": "180f0d826660c10859149bc4263c9080", "score": "0.5513731", "text": "animate(){\n\t\tthis.currState = 1;\n\t}", "title": "" }, { "docid": "2d2c5dbab0d7571d3f78c3ae1d561161", "score": "0.55113924", "text": "function extendSidePreview(){\n\t$('#ce-list').animate({\n\t\twidth: '30%'\n\t}, 300, function(){\n\t\t$('#ce-side').show();\n\t\t$('#ce-side').animate({\n\t\t\topacity: 1\n\t\t}, 700);\n\t});\n}", "title": "" }, { "docid": "545256e42f42c477f24cd7aee88ec854", "score": "0.55044186", "text": "function Animation() {\n }", "title": "" }, { "docid": "72d54f7970454634a70243c74cee5876", "score": "0.5502104", "text": "start() {\n this.deselectAll();\n let new_frame = new Frame(toSeconds(height / 2));\n new_frame.recording = true;\n new_frame.selected = true;\n this.model.frames.push(new_frame);\n }", "title": "" }, { "docid": "ab863358350c1b6277d6a469d17bcd24", "score": "0.55013555", "text": "_animate() {\n\n\t\t// Functionality goes here, implemented in subclass.\n\t}", "title": "" }, { "docid": "3bc43bf02819db56bff76a7a51154e9a", "score": "0.54998827", "text": "function enterPreviewMode() {\n\n }", "title": "" }, { "docid": "3a52af1740860cf87160314ef621f4fd", "score": "0.54952866", "text": "function PreviewBall () {}", "title": "" }, { "docid": "6325a45d95a53eae04ead151c89af4fa", "score": "0.54893345", "text": "function animateSnapshot(axis, plusmin, el, elani){\n\tanimating = true;\n\tvar w = el.width();\n\tvar h = el.height();\n\telani.css({\n\t\twidth: w,\n\t\theight: h,\n\t\tmarginLeft: -w/2,\n\t\tmarginTop: -h/2\n\t});\n\t\n\t//css3 animation\n\tif(axis == \"h\"){\n\t\telani.show().animate({\"transform\": 'translateX('+plusmin+w+'px)'},animationTime,function(){\n\t\t\tanimating = false;\n\t\t});\n\t} else {\n\t\telani.show().animate({\"transform\": 'translateY('+plusmin+h+'px)'},animationTime,function(){\n\t\t\tanimating = false;\n\t\t});\n\t}\n}", "title": "" }, { "docid": "56ab3b59e48eb1fb3617a0da33ca14b1", "score": "0.548926", "text": "function updateSelectedPanel(dir) {\n var panels = getPanels();\n\n console.log(panelIndex + \" to \");\n\n if (dir) {\n if (panelIndex === (panels.length - 1)) {\n panelIndex = 0;\n } else {\n panelIndex++\n }\n } else {\n if (panelIndex === 0) {\n panelIndex = panels.length - 1;\n } else {\n panelIndex--;\n }\n }\n\n console.log(\" : \" + panelIndex);\n\n $('.panel-img').addClass('opaque');\n if (panelIndex < 5) {\n $(\".panel-img:nth-of-type(\" + (panelIndex + 2) + \")\").removeClass('opaque');\n }\n}", "title": "" }, { "docid": "adf669fac450f327453aed4694c9a4a7", "score": "0.5483565", "text": "function animateStorageUI()\n{\n if (storageUI.state === 1 && storageUI.idle === false)\n {\n storageUI.frameIdx++;\n if (storageUI.frameIdx === 2)\n storageUI.idle = true;\n }\n else if (storageUI.state === 2 && storageUI.idle === false)\n {\n storageUI.frameIdx--;\n if (storageUI.frameIdx === 0)\n {\n storageUI.idle = true;\n storageUI.draw = false;\n }\n }\n}", "title": "" }, { "docid": "bfaeaacb6d30edc114a66380415a837f", "score": "0.5477739", "text": "get textureSheetAnimation() {}", "title": "" }, { "docid": "92216a706854513d234fb544b22fdc97", "score": "0.54753053", "text": "saveSnapshot(){\n const frame = this.animationProject.getCurrFrame(); \n const currLayer = frame.getCurrCanvas();\n const w = currLayer.width;\n const h = currLayer.height;\n frame.addSnapshot(currLayer.getContext(\"2d\").getImageData(0, 0, w, h));\n }", "title": "" }, { "docid": "dee159e94d838a6625c28796fcf88cee", "score": "0.5473592", "text": "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }", "title": "" }, { "docid": "14b3887f2d3f41485593bc1d75f62f2a", "score": "0.5464889", "text": "set currentFrame(index) {\n seekFrame(index)\n }", "title": "" }, { "docid": "537a5e9574a0929845e50fed9fba1f45", "score": "0.5464136", "text": "display() {\n push();\n image(imgPlayer, this.x, this.y, this.size, this.size);\n //Set the predicted image to be slightly opaque\n tint(255, 120);\n image(imgPlayer, this.nextMoveX, this.nextMoveY, this.size, this.size);\n pop();\n }", "title": "" }, { "docid": "db935f8446253cc94edc7eb86383d901", "score": "0.5460889", "text": "function animate() {\r\n\t//get the horizontal offset from the array\r\n\tvar h_offset = fr_num * (63);\r\n\tvar v_offset = direction * (63);\r\n\t//get the image and reslice it\r\n\timg_element.style.backgroundPosition = `-${h_offset}px -${v_offset}px`; \r\n\t//update frame counter, 0->1->2->3->0->...\r\n\tfr_num = ++fr_num % 4;\r\n}", "title": "" }, { "docid": "fea0b2e49aefdd6dfd34d6e6e312ea6e", "score": "0.5459077", "text": "_refreshAnimation()\n {\n // Create the animation.\n let { animationMode, animation } = this._createCurrentAnimation();\n if(animation == null)\n {\n this._stopAnimation();\n return;\n }\n\n // In slideshow-hold, delay between each alternation to let the animation settle visually.\n //\n // The animation API makes this a pain, since it has no option to delay between alternations.\n // We have to add it as an offset at both ends of the animation, and then increase the duration\n // to compensate.\n let iterationStart = 0;\n if(animationMode == \"loop\")\n {\n // To add a 1 second delay to both ends of the alternation, add 0.5 seconds of delay\n // to both ends (the delay will be doubled by the alternation), and increase the\n // total length by 1 second.\n let delay = 1;\n animation.duration += delay;\n let fraction = (delay*0.5) / animation.duration;\n\n // We can set iterationStart to skip the delay the first time through. For now we don't\n // do this, so we pause at the start after the fade-in.\n // iterationStart = fraction;\n\n animation.keyframes = [\n { ...animation.keyframes[0], offset: 0 },\n { ...animation.keyframes[0], offset: fraction },\n { ...animation.keyframes[1], offset: 1-fraction },\n { ...animation.keyframes[1], offset: 1 },\n ]\n }\n \n // If the mode isn't changing, just update the existing animation in place, so we\n // update the animation if the window is resized.\n if(this._currentAnimationMode == animationMode)\n {\n // On iOS leave the animation alone, since modifying animations while they're\n // running is broken on iOS and just cause the animation to freeze, and restarting\n // the animation when we regain focus looks ugly.\n if(ppixiv.ios)\n return;\n\n this._animations.main.effect.setKeyframes(animation.keyframes);\n this._animations.main.updatePlaybackRate(1 / animation.duration);\n return;\n }\n\n // If we're in pan mode and we've already run the pan animation for this image, don't\n // start it again.\n if(animationMode == \"auto-pan\")\n {\n if(this._ranPanAnimation)\n return;\n\n this._ranPanAnimation = true;\n }\n\n // Stop the previous animations.\n this._stopAnimation();\n \n this._currentAnimationMode = animationMode;\n \n // Create the main animation.\n this._animations.main = new DirectAnimation(new KeyframeEffect(\n this._imageBox,\n animation.keyframes,\n {\n // The actual duration is set by updatePlaybackRate.\n duration: 1000,\n fill: 'forwards',\n direction: animationMode == \"loop\"? \"alternate\":\"normal\",\n iterations: animationMode == \"loop\"? Infinity:1,\n iterationStart,\n }\n ));\n\n // Set the speed. Setting it this way instead of with the duration lets us change it smoothly\n // if settings are changed.\n this._animations.main.updatePlaybackRate(1 / animation.duration);\n this._animations.main.onfinish = this._checkAnimationFinished;\n\n // If this animation wants a fade-in and a previous one isn't still playing, start it.\n // Note that we use Animation and not DirectAnimation for fades, since DirectAnimation won't\n // sleep during the long delay while they're not doing anything.\n if(animation.fadeIn > 0)\n this._animations.fadeIn = Slideshow.makeFadeIn(this._imageBox, { duration: animation.fadeIn * 1000 });\n\n // Create the fade-out.\n if(animation.fadeOut > 0)\n {\n this._animations.fadeOut = Slideshow.makeFadeOut(this._imageBox, {\n duration: animation.fadeIn * 1000,\n delay: (animation.duration - animation.fadeOut) * 1000,\n });\n }\n\n // Start the animations. If any animation is finished, it was inherited from a\n // previous animation, so don't call play() since that'll restart it.\n for(let animation of Object.values(this._animations))\n {\n if(animation.playState != \"finished\")\n animation.play();\n }\n\n // Make sure the rounding box is disabled during the animation.\n this._updateRoundingBox();\n }", "title": "" }, { "docid": "10cb1b889a9d89720da4ba87e3614552", "score": "0.54259914", "text": "function setslide(index,len){\n \t// this for is add class img tag befor $(this).index() And set style.\n \tref(index,len);\n\t\t// start base animate of this plugin\n\t\t$('div.shower').css({'display':'block'});\n\t\t$('div.shower').stop().animate({\n\t\t\t'opacity':'1'\n\t\t},500)\n //Close btn clicked.\n\t\t$('div.closebtn').on('click',function(){\n $('div.shower').stop().animate({\n 'opacity':'0'\n },500,'linear',function(){\n // remove attr(class & style)\n $('div.tube > img').removeAttr('class');\n $('div.tube > img').removeAttr('style');\n\n $('div.shower').css({'display':'none'});\n });\n });\n // forward btn clicked.\n $('div.forwardbtn').on('click',function(){\n // It was the last picture.\n // View first photo back to animation.\n if(index==len-1){\n $('div.tube > img').eq(0).attr('class','rightout');\n $('div.tube > img').eq(0).attr('style','right : -960px');\n $('div.tube > img').eq(0).css({\n 'z-index':'1'\n });\n $('div.tube > img').eq(0).animate({\n 'right':'0px'\n },400,'linear',function(){\n $('div.tube > img').eq(0).attr('class','active');\n index=0;\n ref(index,len);\n })\n // If the last picture was not\n }else{\n\n\n index++;\n\n $('div.tube > img').eq(index).stop().animate({\n 'right':'0px'\n },400,'linear',function(){\n ref(index,len);\n });\n }\n });\n // backbtn clicked.\n $('div.backbtn').on('click',function(){\n //It was the frist picture.\n if(index<=0){\n // $('div.tube > img').attr('style','z-index : 0');\n $('div.tube > img').eq(len-1).attr('class','leftout');\n $('div.tube > img').eq(len-1).attr('style','left : -960px');\n $('div.tube > img').eq(len-1).css({'z-index':'1'});\n $('div.tube > img').eq(len-1).stop().animate({\n 'left':'0px'\n },400,'linear',function(){\n $('div.tube > img').eq(len-1).attr('class','active');\n index=len-1;\n ref(index,len);\n });\n }else{\n\n index--;\n\n $('div.tube >img').eq(index).css({\n 'z-index':'15'\n })\n $('div.tube > img').eq(index).stop().animate({\n 'left':'0px'\n },400,'linear',function(){\n ref(index,len);\n })\n\n }\n })\n \n //----------//\n }", "title": "" }, { "docid": "7bb70597fac8280aad88f34ca32b0a2d", "score": "0.54211396", "text": "function animate(openCards) {\r\n\r\n}", "title": "" }, { "docid": "97571bd4ba698021eb2f0434f651cc26", "score": "0.5402875", "text": "function animation()\r\n\t{\r\n\t\tcount = first_image ;\r\n\t}", "title": "" }, { "docid": "d3c34a33796be1d754b84522e726a853", "score": "0.5401892", "text": "function animate() {\n\t\t\t\trequestAnimationFrame( animate );\n\t\t\t\t//console.log(controls)\n\t\t\t\tcontrols.update();\n\t\t\t\trenderer.render( scene, camera );\n\t\t\t\t//stats.update();\n\t\t\t\t}", "title": "" }, { "docid": "e8de6d58b17e5de3bb7ed2f2ea2ed12a", "score": "0.5399823", "text": "update() {\n if ( this.animation ) {\n this.animation.update();\n }\n }", "title": "" }, { "docid": "eb80ca8e172f895f025dc169ccb8ac6b", "score": "0.5398642", "text": "preview(element) {\n //let localmedia = SharedObjects.Instance().cameraLocalMedia;\n //if (element instanceof preview) {\n // var myElement = element as preview;\n // localmedia?.changeVideoSourceInput(new fm.liveswitch.SourceInput(this.sourceDevice.id, this.sourceDevice.name)).then(() => {\n // if (!SharedObjects.Instance().islocalmediastarted && !this._isSourceStarted) {\n // localmedia?.start();\n // } if (localmedia) {\n // myElement.layoutManager.setLocalView(localmedia.getView());\n // }\n // });\n //myElement. ?.setLocalView((view));\n //}\n // switch to this element\n }", "title": "" }, { "docid": "6c82e8f959187aa6619250d7022d6567", "score": "0.53966737", "text": "_animate() {\n if (this.bvhLoader.loadingState === \"loading\" || this.fbxLoader.loadingState === \"loading\") {\n this.framerateTimeReference = -1\n $(\"#messagePlayer\").text(\"Chargement en cours\").show()\n return\n }\n\n requestAnimationFrame(this._animate.bind(this))\n this.cameraControls.update()\n this.animating = true\n\n // BVH ---\n this._updateAnimation(this.bvhLoader, this.bvhAnimationsArray, \"bvh\")\n\n // FBX ---\n this._updateAnimation(this.fbxLoader, this.fbxAnimationsArray, \"fbx\")\n\n this.animating = false\n this.renderer.render(this.scene, this.camera)\n }", "title": "" }, { "docid": "74692ab68e3876150c591a5444ad5d60", "score": "0.5396021", "text": "show() {\n this.panel.show();\n }", "title": "" }, { "docid": "57251e9ec0b85c2d13cf74b1f0da9301", "score": "0.5388595", "text": "animate() {\n anime({\n duration: Infinity,\n update: () => {\n this.cxt.clearRect(0, 0, this.cW, this.cH);\n this.animations.forEach((anim) => {\n anim.animatables.forEach((animatable) => {\n if (typeof animatable.target.draw !== 'undefined') animatable.target.draw(this.cxt);\n });\n });\n },\n });\n }", "title": "" }, { "docid": "d52f4841ef677adaa7e225f2ebb6fa3f", "score": "0.53838146", "text": "show() {\n if (!this.isVisible())\n $(\"#sideToolbarContainer\")\n .removeClass(\"slideOutExt\").addClass(\"slideInExt\");\n }", "title": "" }, { "docid": "e3774298a7b0511a521af4cfff3fe7e2", "score": "0.53813785", "text": "schedulePreviewRefresh () {\n clearTimeout(this.previewRefreshId);\n this.previewRefreshId = setTimeout( () => {\n if (this.dirtyPreview) {\n this.dirtyPreview = false;\n\n // If the previewFirstLoad is false it means the first preview hasn't event loaded yet.\n // This was initially related to the GameAndPrizeEditor in the slideout editor.\n // Until the first preview loads, ignore updating the other preview panel.\n // I'm not 100% sure this the best way to handle this but i can't figure out a better solution and this works for now.\n if (!this.previewFirstLoad) {\n let stateUpdate = {};\n stateUpdate.previewPointer = (this.state.previewPointer === 1) ? 2 : 1;\n stateUpdate[ \"previewTimestamp\" + stateUpdate.previewPointer ] = Date.now();\n stateUpdate.refreshing = true;\n this.setState(stateUpdate);\n }\n }\n }, 1000 );\n }", "title": "" }, { "docid": "82b676ea4e03cec285331e0410b668a4", "score": "0.5375559", "text": "animationTop(type,primerakey,segundakey){\n if(type==\"add\") this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]] = this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]]+10;\n if(type==\"rest\")this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]] = this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]]-10;\n var margin = this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]];\n var pos = this.posinitial[primerakey][segundakey][this.keyimages[primerakey][segundakey]];\n var opa = 1;\n var opaci;\n var initial = setInterval(()=>{\n if(pos==this.margintop[primerakey][segundakey][this.keyimages[primerakey][segundakey]]){\n this.posinitial[primerakey][segundakey][this.keyimages[primerakey][segundakey]] = pos;\n clearInterval(initial);\n }else{\n if(type==\"add\")pos++;\n if(type==\"rest\")pos--;\n if(opa==9){\n opaci =1;\n }else{\n opa++;\n opaci =\"0.\"+opa;\n }\n document.getElementById(`imageneshow-${primerakey}-${segundakey}-${this.keyimages[primerakey][segundakey]}`).style.marginTop= pos+\"0px\";\n document.getElementById(`imageneshow-${primerakey}-${segundakey}-${this.keyimages[primerakey][segundakey]}`).style.opacity = opaci;\n }\n },38);\n }", "title": "" }, { "docid": "cf7c722858395a89f2c7f05e5c41c690", "score": "0.5370464", "text": "updatePreview() {\n // From wfactory_controller.js:updatePreview()\n this.view.previewWorkspace.clear();\n Blockly.Xml.domToWorkspace(this.view.getWorkspaceContents().getExportData(),\n this.view.previewWorkspace);\n }", "title": "" }, { "docid": "878c425e77f82952137b12b2bb8ed6ac", "score": "0.5367456", "text": "function scheduleControlsFade( viewer ) {\n $.requestAnimationFrame( function(){\n updateControlsFade( viewer );\n });\n}", "title": "" } ]
671c52848ccf5bcc10706c1882903541
//////////////////object for dialog handler////////////////// dialog_dept=new makeDialog('sysdb.department','dept',['deptcode','description'], 'Department'); //////////////////////////////////start dialog
[ { "docid": "97ba7b1de4b331b2c1bcdac3ebadf5fb", "score": "0.0", "text": "function saveFormdata_receipt(grid,dialog,form,oper,saveParam,urlParam,obj,callback,uppercase=true){\n\n\t\tvar formname = $(\"a[aria-expanded='true']\").attr('form')\n\n\t\tvar paymentform = $( formname ).serializeArray();\n\n\t\t$('.ui-dialog-buttonset button[role=button]').prop('disabled',true);\n\t\tsaveParam.oper=oper;\n\n\t\tlet serializedForm = trimmall(form,uppercase);\n\t\t$.post( saveParam.url+'?'+$.param(saveParam), serializedForm+'&'+$.param(paymentform) , function( data ) {\n\t\t\t\n\t\t}).fail(function(data) {\n\t\t\terrorText(dialog.substr(1),data.responseText);\n\t\t\t$('.ui-dialog-buttonset button[role=button]').prop('disabled',false);\n\t\t}).success(function(data){\n\t\t\tif(grid!=null){\n\t\t\t\trefreshGrid(grid,urlParam,oper);\n\t\t\t\t$('.ui-dialog-buttonset button[role=button]').prop('disabled',false);\n\t\t\t\t$(dialog).dialog('close');\n\t\t\t\tif (callback !== undefined) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "0c49fcad2eef8ce1895b71b46e523050", "score": "0.6344658", "text": "function levantaPopup(){\n\n\tvar option = { \n\t\t\t\t\ttitle:\"Comprobación de Aprobación\",\n\t\t\t\t\tallowMaximize:false,\n\t\t\t\t\tshowMaximized:false,\n\t\t\t\t\tshowClose:false,\n\t\t\t\t\t//autoSize:true,\n\t\t\t\t\t//width:515,\n\t\t\t\t\twidth:500,\n\t\t\t\t\theight:160,\n\t\t\t\t\tscroll:0,\n\t\t\t\t\targs: {\t\n\t\t\t\t\t\t\testado:'VI'\t\n\t\t\t\t\t\t },\n\n\t\t\t\t\t//center:1,resizable:1,scroll:0,status:0,maximize:1,minimize:1,\n\t\t\t\t\tdialogReturnValueCallback: callbackMethod,\n\t\t\t\t\turl:urlPantallaComprobacion+'?ID='+iniciativaID\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSP.UI.ModalDialog.showModalDialog(option);\n}", "title": "" }, { "docid": "996e1b23093ea974cc52621422995d08", "score": "0.6313636", "text": "function viewDept() {\n // console.log(\"VEBD Working\");\n //selecting from dept. \n connection.query(\"SELECT * from department\", function (err, res) {\n if (err) throw err;\n\n console.table(res);\n\n startPrompt();\n });\n}", "title": "" }, { "docid": "810b9057db74e4e82de2c928aec2d1e9", "score": "0.6292921", "text": "function Dialog(addForm, editForm, delForm, updateTbl) {\n this.addForm = addForm;\n this.editForm = editForm;\n this.delForm = delForm;\n this.updateTbl = updateTbl;\n}", "title": "" }, { "docid": "5563a09966b8acc3fea0e0bf1fa95518", "score": "0.62504554", "text": "function makeDialog(table,id,cols,setLabel1,setLabel2,setLabel3,title){\n\t\t\t\tthis.table=table;\n\t\t\t\tthis.id=id;\n\t\t\t\tthis.cols=cols;\n\t\t\t\tthis.setLabel1=setLabel1;\n\t\t\t\tthis.setLabel2=setLabel2;\n\t\t\t\tthis.setLabel3=setLabel3;\n\t\t\t\tthis.title=title;\n\t\t\t\tthis.handler=dialogHandler;\n\t\t\t\tthis.offHandler=function(){\n\t\t\t\t\t$( this.id+\" ~ a\" ).off();\n\t\t\t\t}\n\t\t\t\tthis.check=checkInput;\n\t\t\t\tthis.updateField=function(table,id,cols,title){\n\t\t\t\t\tthis.table=table;\n\t\t\t\t\tthis.id=id;\n\t\t\t\t\tthis.cols=cols;\n\t\t\t\t\tthis.title=title;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d9480a1520ea895b2b44e70781ee2b5e", "score": "0.6229969", "text": "function OnCmdEditPrayerPlans()\r\n{\r\n window.openDialog(\"chrome://kneemail/content/edit_prayer_plans.xul\", \"edit_prayer_plans\", \"modal,centerscreen\");\r\n PopulatePrayerPlans();\r\n}", "title": "" }, { "docid": "5936528f06b93f1b4d9bc24b9cc24ab6", "score": "0.61870956", "text": "function loadDialog(entryStr, modeStr)\r\n{\r\n //Get id from id string\r\n var id = entryStr.split(\"-\")[1];\r\n id = parseInt(id);\r\n console.log(\"loadDialog entryId is \" + id);\r\n \r\n //Find item in database\r\n var i = itemDB({itemId:id}).first();\r\n \r\n //If item does not exist\r\n if (!i)\r\n {\r\n $('#dialog .dialogItem .title').html(\"Item with id \" + id + \" not found.\");\r\n }\r\n else //If item exists\r\n {\r\n //Set title of dialog\r\n $('#dialog').dialog('option', 'title', i.title + ' Details');\r\n\r\n $('#dialog .itemData .title').html(i.title); //Set title\r\n \r\n if (i.similarItemUrl.length > 0) //Set similar Item URL\r\n { \r\n $('#dialog .similarItem td').html('<a href=\"' + i.similarItemUrl + '\" target=\"_blank\">See similar item online</a>'); \r\n }\r\n else\r\n { \r\n $('#dialog .similarItem').hide(); \r\n }\r\n \r\n var user = userDB({userId:i.ownerId}).first(); //Get userdata \r\n $('#dialog .itemData .owner .ivalue').html(user.realName); //Set user info\r\n $('#dialog .itemData .desc .ivalue').html(i.description); //Set item description\r\n \r\n if (i.image.length > 0) //Set item image\r\n $('#dialog .itemThumb .thumb').attr('src', i.image);\r\n else\r\n $('#dialog .itemThumb .thumb').attr('src', 'img/itemNotFound_l.jpg');\r\n \r\n if (i.notes) //Set item Notes\r\n { \r\n $('#dialog .itemData .notes').show();\r\n $('#dialog .itemData .notes .ivalue').html(i.notes);\r\n }\r\n else\r\n $('#dialog .itemData .notes').hide();\r\n\r\n var buttons = {}; //Setup buttons\r\n //Buttons are configured depending on how the item was called\r\n //From the borrowed/lent list etc...\r\n if (modeStr == 'borrowed')\r\n {\r\n buttons = {\r\n \"Return item\": function() { \r\n $(this).dialog(\"close\"); \r\n }\r\n };\r\n }\r\n else if (modeStr == 'lent')\r\n {\r\n buttons = {\r\n \"Send Reminder\": function() { \r\n $(this).dialog(\"close\"); \r\n } \r\n };\r\n }\r\n else if (modeStr == 'viewNotMyItem')\r\n {\r\n buttons = {\r\n \"Request Item\": function() { \r\n $(this).dialog(\"close\"); \r\n }\r\n };\r\n }\r\n //All windows have a cancel button\r\n buttons[\"Cancel\"] = function() { \r\n $(this).dialog(\"close\"); \r\n } \r\n //Set the buttons\r\n $('#dialog').dialog('option', 'buttons', buttons);\r\n }\r\n //Open dialog\r\n $('#dialog').dialog('open');\r\n}", "title": "" }, { "docid": "5b28a066d8b8418e55082460e7c70c2e", "score": "0.61517304", "text": "function addAttachement () {\r\n\tdojo.byId(\"attachementId\").value=\"\";\r\n\tdojo.byId(\"attachementRefType\").value=dojo.byId(\"objectClass\").value;\r\n\tdojo.byId(\"attachementRefId\").value=dojo.byId(\"objectId\").value;\r\n\tif (dijit.byId(\"attachementFile\")) {\r\n\t\tdijit.byId(\"attachementFile\").reset();\r\n\t}\r\n\tdijit.byId(\"attachementDescription\").set(\"value\",\"\");\r\n\tdijit.byId(\"dialogAttachement\").set('title',i18n(\"dialogAttachement\"));\r\n\tdijit.byId(\"dialogAttachement\").show();\r\n}", "title": "" }, { "docid": "a9b8963fdb9858b8cb607090ec1c1b24", "score": "0.60862976", "text": "function ivdrDialog() {\n\t\t//$('keysform').style.display = \"block\";\n\t\t//oDialog = new dialog(\"iVDR\", true, null, null, null, new Array());\n\t\t//oDialog = new dialog(\"iVDR\", null, null, null,null, [null,new button(\"Grab TV\", null, \"if (confirm('Start directly?')) doJSByHref(sn+'stream=dialog&type=media&id=1'); else alert('So not')\")], usercontrol);\n\t\t//oDialog.show();\n\t\t//$('epginfobar').style.display = \"block\";\n\t\t//$('epginfobar').innerHTML =\"asfasf\";\n\t\tshowDialog(bf());\n\t\t\n\t\t//showRemote();\n\t}", "title": "" }, { "docid": "a59e39a4339ae01b08beffbac5674de1", "score": "0.60559213", "text": "popup () {\r\n document.getElementById('fieldname').value = this.name\r\n document.getElementById('fieldvalue').value = this.value\r\n let dialog = document.getElementById('fielddialog')\r\n dialog.style.display = 'table'\r\n }", "title": "" }, { "docid": "e097da1b04eec5aaaae22b4f49413399", "score": "0.6039535", "text": "function Trash_001_RandomEncounterHans2(){\n Dialog(\"Trash_013\");\n}", "title": "" }, { "docid": "6e81add396e40d8f9696f93d071e9382", "score": "0.603276", "text": "function opencreatepermitdialog(dialogid, related_label, related_id, relation_type, okcallback) { \n var title = \"Add new Permit record to \" + related_label;\n var content = '<div id=\"'+dialogid+'_div\">Loading....</div>';\n var h = $(window).height();\n var w = $(window).width();\n w = Math.floor(w *.9);\n var thedialog = $(\"#\"+dialogid).html(content)\n .dialog({\n title: title,\n autoOpen: false,\n dialogClass: 'dialog_fixed,ui-widget-header',\n modal: true,\n stack: true,\n zindex: 2000,\n height: h,\n width: w,\n minWidth: 400,\n minHeight: 450,\n draggable:true,\n buttons: {\n \"Save Permit Record\": function(){ \n var datasub = $('#newPermitForm').serialize();\n\t if ($('#newPermitForm')[0].checkValidity()) {\n $.ajax({\n \t\t url: \"/component/functions.cfc\",\n type: 'post',\n \t\t returnformat: 'plain',\n data: datasub,\n success: function(data) { \n if (jQuery.type(okcallback)==='function') {\n okcallback();\n };\n $(\"#\"+dialogid+\"_div\").html(data);\n },\n \t\t fail: function (jqXHR, textStatus) { \n\t \t $(\"#\"+dialogid+\"_div\").html(\"Error:\" + textStatus);\n \t\t }\t\n\t\t });\n } else { \n messageDialog('Missing required elements in form. Fill in all yellow boxes. ','Form Submission Error, missing required values');\n };\n },\n \"Close Dialog\": function() { \n \tif (jQuery.type(okcallback)==='function') {\n \tokcallback();\n \t\t}\n\t \t$(\"#\"+dialogid+\"_div\").html(\"\");\n\t\t$(\"#\"+dialogid).dialog('close'); \n\t\t$(\"#\"+dialogid).dialog('destroy'); \n }\n },\n close: function(event,ui) { \n if (jQuery.type(okcallback)==='function') {\n okcallback();\n \t}\n } \n });\n thedialog.dialog('open');\n datastr = {\n method: \"getNewPermitForTransHtml\",\n \treturnformat: \"plain\",\n relation_type: relation_type,\n related_label: related_label,\n related_id: related_id\n };\n jQuery.ajax({\n url: \"/component/functions.cfc\",\n type: \"post\",\n data: datastr,\n success: function (data) { \n $(\"#\"+dialogid+\"_div\").html(data);\n }, \n fail: function (jqXHR, textStatus) { \n $(\"#\"+dialogid+\"_div\").html(\"Error:\" + textStatus);\n }\n });\n}", "title": "" }, { "docid": "b87a87b3513968e1bc18f691a09d8588", "score": "0.60027295", "text": "function viewFR(id){\n var pel=$('#departemenS').val();\n $.Dialog({\n shadow:true,\n overlay:true,\n draggable:true,\n height:'auto',\n width:'35%',\n padding:20,\n onShow: function(){\n var titlex;\n if(id==''){ //add mode\n titlex='<span class=\"icon-plus-2\"></span> Tambah ';\n $.ajax({\n url:dir2,\n data:'aksi=cmbdepartemen&replid='+$('#departemenS').val(),\n type:'post',\n dataType:'json',\n success:function(dt){\n $('#departemenH').val($('#departemenS').val());\n $('#departemenTB').val(dt.departemen[0].nama);\n cmbjenismutasi('');\n }\n });\n\n }else{ // edit mode\n titlex='<span class=\"icon-pencil\"></span> Ubah';\n $.ajax({\n url:dir,\n data:'aksi=ambiledit&replid='+id,\n type:'post',\n dataType:'json',\n success:function(dt){\n $('#idformH').val(id);\n $('#departemenH').val($('#departemenS').val());\n $('#departemenTB').val(dt.departemen);\n $('#siswaH').val(dt.siswa);\n $('#namaTB').val(dt.nama);\n $('#nisnTB').val(dt.nisn);\n $('#tanggalTB').val(dt.tanggal);\n $('#keteranganTB').val(dt.keterangan);\n cmbjenismutasi(dt.nama.nama);\n }\n });\n }$.Dialog.title(titlex+' '+mnu);\n $.Dialog.content(contentFR);\n }\n });\n // autosuggest\n $(\"#siswaTB\").combogrid({\n debug:true,\n width:'400px',\n colModel: [{\n 'align':'left',\n 'columnName':'nisn',\n 'hide':true,\n 'width':'55',\n 'label':'NISN'\n },{ \n 'columnName':'nama',\n 'width':'40',\n 'label':'NAMA'\n }],\n url: dir+'?aksi=autocomp',\n select: function( event, ui ) {\n $('#siswaH').val(ui.item.replid);\n $('#nisnTB').val(ui.item.nisn);\n $('#namaTB').val(ui.item.nama);\n $('#siswaTB').combogrid( \"option\", \"url\", dir+'?aksi=autocomp&departemen='+$('#departemenS').val() );\n return false;\n }\n });\n }", "title": "" }, { "docid": "a4c437d0a6328dd9e406495bfa7e79c5", "score": "0.599372", "text": "function launchAddEventDlg() {\n let dlgBase = document.getElementById(\"add-event-dlg\");\n dlgBase.style.display = \"none\";\n var addEventDlg = $(\"#add-event-dlg\").dialog(addEventOpt);\n addEventDlg.dialog(\"open\");\n\n // Further dialog customization.\n $(\".ui-dialog\").addClass('ui-dialog-ext');\n $(\".ui-dialog-titlebar-close\").hide();\n $(\".ui-dialog-titlebar\").addClass('ui-dialog-titlebar-ext');\n\n // Handler for the 'OK' button\n let okBtn = document.getElementById(\"xedx-btn-ok\");\n okBtn.addEventListener(\"click\", function() {\n btnOnOkClick();\n let dlgBase = document.getElementById(\"add-event-dlg\");\n dlgBase.style.display = \"none\";\n $(\"#add-event-dlg\").dialog(\"close\");\n }, false);\n}", "title": "" }, { "docid": "c741c116f970c7093e17836f1bfdcfd9", "score": "0.597878", "text": "function openAddCategoryDialog(){\r\n\t\t\r\n\t\tg_ucAdmin.openCommonDialog(\"#uc_dialog_add_category\", function(){\r\n\t\t\t\r\n\t\t\tjQuery(\"#uc_dialog_add_category_catname\").val(\"\").focus();\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t}", "title": "" }, { "docid": "4ae3bff7e593e4e8a9de6ade0fc60f14", "score": "0.5977465", "text": "function Trash_001_RandomEncounterHans1(){\n Dialog(\"Trash_011\");\n}", "title": "" }, { "docid": "a9cd3e35189863d49c2d57f668ec8fbe", "score": "0.597732", "text": "function AbrirPoPupAddAgente(id, idDivision) {\n $(\"#hidIdDivisionAdmAR\").val(idDivision);\n $(\"#mvBuscarAgenteRecaudo\").dialog(\"open\");\n loadDataDivisionAgenteAR();\n}", "title": "" }, { "docid": "45638573555c51ae9e4838a1634d8fb8", "score": "0.5974562", "text": "function initsoftware() {\n q = {};\n q.ke = _ucode;\n q.lu = _ulcod;\n q.ti = _utval;\n tips = $(\".validateTips\");\n\n $('#dynamictable').dataTable({\n \"sPaginationType\": \"full_numbers\"\n });\n\n $(\"#crearsoftware\").button().click(function() {\n q.id = 0;\n nombre = $(\"#nombre\");\n archivo = $(\"#archivo\");\n UTIL.clearForm('formcreate');\n $(\"#form_crearsoftware\").dialog(\"open\");\n });\n\n $(\"#form_crearsoftware\").dialog({\n autoOpen: false,\n height: 400,\n width: 600,\n modal: true,\n buttons: {\n \"Guardar\": function() {\n nombre = $(\"#nombre\");\n archivo = $(\"#archivo\");\n updateTips('');\n bValid = true;\n bValid = bValid && checkLength(nombre, 'nombre', 3, 30);\n if (bValid) {\n bValid = bValid && checkLength(archivo, \"archivo\", 3, 30);\n if (bValid) {\n SOFTWARE.savedata();\n }\n\n }\n }\n },\n close: function() {\n UTIL.clearForm('formcreate');\n updateTips('');\n }\n });\n\n $('#form_mostrarResena').dialog({\n autoOpen: false,\n height: 320,\n width: 500,\n modal: true,\n close: function () {\n UTIL.clearForm('formcreate2');\n updateTips('');\n }\n });\n\n}", "title": "" }, { "docid": "14d36a61dff0a0c8adc932d12c3484a9", "score": "0.59718597", "text": "function create(target){\n\t\tvar opts = $.data(target, 'combodept').options;\n\t\tvar tree = $.data(target, 'combodept').tree;\n\t\tvar boxlist = $.data(target, 'combodept').boxlist;\n\t\t\n\t\t$(target).addClass('combodept-f');\n\t\t$(target).combo($.extend({},opts, {\n\t\t\tonShowPanel : function() {\n\t\t\t\t//_showPanel(target);\n\t\t\t}\n\t\t}));\n\t\tvar panel = $(target).combo('panel');\n\t\tvar viewpanel = panel;\n\t\t\n\t\t//set param\n\t\topts.param = opts.param||{};\n\t\t$.extend(opts.param, opts.bureauCode?{bureauCode:opts.bureauCode}:{}, opts.rootDept?{rootDept:opts.rootDept}:{});\n\n\t\tif (!tree) {\n\t\t\tif(opts.multiple) {\n\t\t\t\t\n\t\t\t\tvar layout = $('<div></div>').appendTo(panel);\n\t\t\t\t$('<div data-options=\"region:\\'north\\',border:false\" style=\"height:' + (opts.panelHeight - 90) + 'px\"></div>').appendTo(layout);\n\t\t\t\t$('<div data-options=\"region:\\'center\\',border:false\"></div>').appendTo(layout);\n\t\t\t\t$('<div data-options=\"region:\\'south\\',border:false\" style=\"height:36px\"></div>').appendTo(layout);\n\t\t\t\t\n\t\t\t\tlayout.layout({ fit : true });\n\t\t\t\t\n\t\t\t\tviewpanel = layout.layout('panel', 'north');\n\t\t\t\t\n\t\t\t\tboxlist = $('<div></div>').appendTo(layout.layout('panel', 'center'));\n\t\t\t\t$.data(target, 'combodept').boxlist = boxlist;\n\t\t\t\tboxlist.boxlist({\n\t\t\t\t\tonBeforeClose : function(box) {\n\t\t\t\t\t\ttree.tree('uncheck', tree.tree('find', box.attr('vid')).target);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tvar buttondiv = $('<div class=\"dialog-button\"></div>').appendTo(layout.layout('panel', 'south'));\n\t\t\t\t\n\t\t\t\tfunction _buildButton(buttons) {\n\t\t\t\t\tfor(var i=0; i<buttons.length; i++){\n\t\t\t\t\t\tvar p = buttons[i];\n\t\t\t\t\t\tvar button = $('<a href=\"javascript:void(0)\"></a>').appendTo(buttondiv);\n\t\t\t\t\t\tif (p.handler) button[0].onclick = p.handler;\n\t\t\t\t\t\tbutton.linkbutton(p);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t_buildButton([{\n\t\t\t\t\t\ttext : '清除', handler : function() {\n\t\t\t\t\t\t\tvar checkeds = tree.tree('getChecked');\n\t\t\t\t\t\t\t$.each(checkeds, function() {\n\t\t\t\t\t\t\t\ttree.tree('uncheck', this.target);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t},{ text : '确定', handler : function() {\n\t\t\t\t\t\tretrieveValues(target);\n\t\t\t\t\t\t$(target).combo('hidePanel');\n\t\t\t\t\t\tif($(target).attr('onChoose')) {\n\t\t\t\t\t\t\t(function(){\n\t\t\t\t\t\t\t\tvar values = tree.tree('getChecked');\n\t\t\t\t\t\t\t\tvar dept = [], depts, parti, partis;\n\t\t\t\t\t\t\t\t$(values).each(function() {\n\t\t\t\t\t\t\t\t\tdept.push({ deptId : this.id, deptName : this.text });\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tparti = partis = depts = dept;\n\t\t\t\t\t\t\t\teval($(target).attr('onChoose'));\n\t\t\t\t\t\t\t}).apply(target, []);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}]);\n\t\t\t} \n\t\t\tvar viewlayout = $('<div></div>').appendTo(viewpanel);\n\t\t\t$('<div data-options=\"region:\\'north\\',border:false\" style=\"height:25px;\"></div>').appendTo(viewlayout);\n\t\t\t$('<div data-options=\"region:\\'center\\',border:false\"></div>').appendTo(viewlayout);\n\t\t\tviewlayout.layout({fit:true});\n\t\t\t\n\t\t\tvar searcher = $('<input></input>').appendTo(viewlayout.layout('panel', 'north'));\n\t\t\tsearcher.css('width', opts.panelWidth - 2);\n\t\t\tsearcher.searchbox({\n\t\t\t\tprompt : '搜索部门',\n\t\t\t\tsearcher : function(value, name) {\n\t\t\t\t\ttree.tree('query', value);\n\t\t\t\t}\n\t\t\t});\n\t\t\ttree = $('<ul></ul>').appendTo(viewlayout.layout('panel', 'center'));\n\t\t\t$.data(target, 'combodept').tree = tree;\n\t\t}\n\t\t\n\t\ttree.tree($.extend({}, opts, {\n\t\t\turl : $.pluiplugin.config.deptTreeUrl,\n\t\t\tdataType : 'jsonp',\n\t\t\tparam : opts.param,\n\t\t\tlazy : true,\n\t\t\tcheckbox: opts.multiple,\n\t\t\tonLoadSuccess: function(node, data){\n\t\t\t\tvar values = $(target).combodept('getValues');\n\t\t\t\tif (opts.multiple){\n\t\t\t\t\tvar nodes = tree.tree('getChecked');\n\t\t\t\t\tfor(var i=0; i<nodes.length; i++){\n\t\t\t\t\t\tvar id = nodes[i].id;\n\t\t\t\t\t\t(function(){\n\t\t\t\t\t\t\tfor(var i=0; i<values.length; i++){\n\t\t\t\t\t\t\t\tif (id == values[i]) return;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalues.push(id);\n\t\t\t\t\t\t})();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$(target).combodept('setValues', values);\n\t\t\t\t//tree.tree('collapseAll');\n\t\t\t\ttree.tree('expand', tree.tree('getRoot').target);\n\t\t\t\topts.onLoadSuccess.call(this, node, data);\n\t\t\t},\n\t\t\tonClick: function(node){\n\t\t\t\tif (!opts.multiple) {\n\t\t\t\t\t//如果为单选,将点击节点值和文字设置为combo值和文字\n\t\t\t\t\tretrieveValues(target);\n\t\t\t\t\t$(target).combo('hidePanel');\n\t\t\t\t\t//opts.onClick.call(this, node);\n\t\t\t\t\tif($(target).attr('onChoose')) {\n\t\t\t\t\t\t(function(){\n\t\t\t\t\t\t\tvar dept = { deptId : node.id, deptName : node.text }, parti = partis = depts = dept;\n\t\t\t\t\t\t\teval($(target).attr('onChoose'));\n\t\t\t\t\t\t}).apply(target, []);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//如果为多选\n\t\t\t\t\tvar ck = $(node.target).find('.tree-checkbox');\n\t\t\t\t\tif (ck.length){\n\t\t\t\t\t\tif (ck.hasClass('tree-checkbox1')){\n\t\t\t\t\t\t\t//如果已经选择,取消该节点选中\n\t\t\t\t\t\t\ttree.tree('uncheck', node.target);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//如果未选中,选中该节点\n\t\t\t\t\t\t\ttree.tree('check', node.target);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCheck: function(node, checked){\n\t\t\t\tconsole.log(node);\n\t\t\t\t//retrieveValues(target);\n\t\t\t\topts.onCheck.call(this, node, checked);\n\t\t\t\tif (checked) {\n\t\t\t\t\tboxlist.boxlist('setValues', {\n\t\t\t\t\t\tids : node.id,\n\t\t\t\t\t\tvalues : node.text\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tboxlist.boxlist('deleteValues', {\n\t\t\t\t\t\tids : node.id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\t\n\t}", "title": "" }, { "docid": "5443ae9c0f44c233eb9432887f475d53", "score": "0.59627235", "text": "function main() {\r\n\tlayoutDialog().show();\r\n}", "title": "" }, { "docid": "54650dd9e2d02b63e717ab2ec3df5fe5", "score": "0.5933651", "text": "function _initDialog(dialogId)\n\t{\n\t\tswitch(dialogId)\n\t\t{\n\t\t\tcase 'dialog_def_where':\n\t\t\t\t// 不能放在 dialog 的 create 里 create 只会 init 一次,换 view 之后栏位没有重新换\n\t\t\t\t_addItem2List('select_cols'); //打开之前填充栏位清单 List\n\t\t\t\t// init all autocomplete column before open\n\t\t\t\t_initAutoComplete();\t\t\t\n\t\t\t\t// init default where dialog\n\t\t\t\t$('#'+dialogId).dialog({\n\t\t\t\t\tautoOpen: false,\n\t\t\t\t\tmodal: true,\n\t\t\t\t\twidth: 535,\n\t\t\t\t\theight:300,\n\t\t\t\t\tbuttons:[{\n\t\t\t\t\t\ttext: \"确定\",\n\t\t\t\t\t\tclick: function(){\n\t\t\t\t\t\t\t_combine2Where(); // 组合查询条件\n\t\t\t\t\t\t\t_storeDefWhere(dialogId); // 记录当前条件物件\n\t\t\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\t}\n\t\t\t },\n\t\t\t {\n\t\t\t \t text: \"取消\",\n\t\t\t \t click: function(){\n\t\t\t \t\t if ($default_where_dis.val() == '' && $('#where_tab').attr('rows').length>1) _clearDefWhere('where_tab');\n\t\t\t \t\t $(this).dialog(\"close\");\n\t\t\t \t }\n\t\t\t }],\n\t\t\t\t\tcreate:function(event){\n\t\t\t\t\t\t// execute once code here\n\t\t\t\t\t\t_initDlgCondAddDelBtn($('#btn_add'),$('#btn_remove')); // 打开之前 init 画面上的 button(add/delete)\n\t\t\t\t\t\t_initDlgCondOpList($('#select_operator')); \t\t // 打开之前 init 画面上的 Select Onchange 事件\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'dialog_help_pulldownlist':\n\t\t\t\t// pulldownlist help dialog \n\t\t\t\t$('#'+dialogId).dialog({\n\t\t\t\t\tautoOpen: false,\n\t\t\t\t\tmodal: true,\n\t\t\t\t\twidth: 500,\n\t\t\t\t\tbuttons:[{\n\t\t\t \t text: \"关闭\",\n\t\t\t \t click: function(){ $(this).dialog(\"close\");}\n\t\t\t }]\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'dialog_add_colsgroup':\n\t\t\t\t// init default where dialog \n\t\t\t\t$('#'+dialogId).dialog({\n\t\t\t\t\tautoOpen: false,\n\t\t\t\t\tmodal: true,\n\t\t\t\t\twidth: 535,\n\t\t\t\t\tbuttons:[{\n\t\t\t \ttext: \"确定\",\n\t\t\t \tclick: function(){\n\t\t\t \t\tvar grpdesc = $('#colgroup_name');\n\t\t\t \t\tif ($.trim(grpdesc.val()) == '')\n\t\t\t \t\t{\n\t\t\t \t\t\talert('请输入分组名称');\n\t\t\t \t\t\treturn false;\n\t\t\t \t\t}\n\t\t\t \t\tif($ui_group_col_list.children().length ==0)\n\t\t\t \t\t{\n\t\t\t \t\t\talert('至少要选取一个栏位');\n\t\t\t \t\t\treturn false;\n\t\t\t \t\t}\n\t\t\t \t\t_addCol2Grp(grpdesc,$ui_group_col_list);\n\t\t\t \t\t$(this).dialog(\"close\");\n\t\t\t \t}\n\t\t\t },\n\t\t\t {\n\t\t\t \t text: \"取消\",\n\t\t\t \t click: function(){\n\t\t\t \t \t$(this).dialog(\"close\");\n\t\t\t \t }\n\t\t\t }]\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault:break;\n\t\t}\n\t}", "title": "" }, { "docid": "a80e3cf70eaa1d4891e5591b23afe98b", "score": "0.59250575", "text": "function openDialog(val, heading, table_str_data) {\n\n \n\n // add-edit-reports-dialog.html\n var templateUrl = '';\n\n if (val == 'AddEdit') {\n vm.dialog.type = 'AddEdit';\n templateUrl = 'app/main/reports/dialogs/reports/add-edit-reports-dialog.html';\n $scope.multiSelectDropdown('new');\n }\n else if (val == 'AddDataPoint') {\n templateUrl = 'app/main/checklist/dialogs/checklist/checklist-set-labels-dialog.html';\n\n vm.labels.selectable = $rootScope.user.dashboard.labels;\n \n }\n else if (val == 'addTable') {\n\n if (!vm.newItem.column) return $rootScope.message(\"Please give number of Columns to continue\", 'error');\n if (!vm.newItem.row) return $rootScope.message(\"Please give number of Rows to continue\", 'error');\n if (!vm.newItem.name) return $rootScope.message(\"Please give Report name to continue\", 'error');\n\n\n\n templateUrl = 'app/main/reports/dialogs/reports/data-table-dialog.html';\n\n var name = vm.newItem.name;\n var columns = vm.newItem.column;\n var rows = vm.newItem.row;\n\n vm.total_num_column = vm.newItem.column\n\n vm.newItem = {};\n vm.newItem.range = 'All';\n\n\n var date = new Date();\n var timestamp = date.getTime();\n\n\n\n // vm.table_id = table_id != undefined ? table_id : '';\n vm.editDataTable = [];\n vm.editHeadingTable = [];\n var heading_data = heading != undefined ? heading : '';\n if (heading_data != '' || heading_data != undefined) {\n vm.editHeadingTable = heading_data;\n var etSectionId = heading_data.parent_id;\n var etHeadingId = heading_data.id;\n var new_field = 'edit_' + timestamp;\n vm.new_field = 'edit_' + timestamp;\n vm.editDataTable[new_field] = [];\n\n vm.editDataTable[new_field]['table_str_data'] = table_str_data != undefined ? table_str_data : '';\n\n }\n\n vm.newDataTableItem = {\n\n name: name,\n column: columns,\n row: rows,\n submitting: false\n };\n\n /***************** */\n\n // vm.newItem.name, vm.newItem.column, vm.newItem.row, $event\n\n vm.dataTableName = name;\n vm.data_table_structure = [];\n\n $scope.cell_format_for_reports = dataTable.getValue('cell_format_for_reports');\n // [{ \"name\": \"None\" }, { \"name\": \"Date\" }, { \"name\": \"Label\" }, { \"name\": \"Text\" }, { \"name\": \"Number\" }, { \"name\": \"Currency\" }, { \"name\": \"Formula\" }]\n\n\n vm.model = $scope.cell_format_for_reports[0].name;\n //// //;\n\n $scope.datapoint_functions = dataTable.getValue('datapoint_functions');\n\n\n\n $scope.decimal = dataTable.getValue('decimal');\n // //;\n // $scope.decimal = [\n // { \"value\": 0 }, { \"value\": 1 }, { \"value\": 2 }\n\n // ]\n\n $rootScope.DataTableFields.number_type = $scope.decimal[0].value;\n\n $scope.currency = dataTable.getValue('currency');\n\n // $scope.currency = [ { \"name\": \"$\", \"sign \": \"Dollars\" }, { \"name\": \"€\", \"sign \": \"Euros\" }, { \"name\": \"£\", \"sign \": \"Pounds\" }, { \"name\": \"¥\", \"sign \": \"Yen/Yuan\" }];\n\n\n $rootScope.DataTableFields.currency_type = $scope.currency[0].name;\n\n\n $scope.alignTextVal = dataTable.getValue('alignTextVal');\n\n // [{ \"name\": \"center\" }, { \"name\": \"left\" }, { \"name\": \"right\" }]\n\n \n vm.alignTextStatus = $scope.alignTextVal[0].name;\n\n $scope.TextPostition = dataTable.getValue('TextPostition');\n // [ { \"name\": \"bottom\", \"pos\": \"fa-long-arrow-down\" }, { \"name\": \"middle\", \"pos\": \"fa-arrows-v\" }, { \"name\": \"top\", \"pos\": \"fa-long-arrow-up\" }]\n\n vm.TextPostitionStatus = $scope.TextPostition[0].name;\n\n\n\n\n // $scope.decimal = [\n // { \"value\": 0 }, { \"value\": 1 }, { \"value\": 2 }\n\n // ]\n\n $rootScope.DataTableFields.number_type = $scope.decimal[0].value;\n\n vm.formats = $scope.cell_format_for_reports\n\n var data_table_row = rows;\n var data_table_col = columns;\n\n dataTable.toExcelHeader(data_table_col)\n\n vm.header_names = dataTable.toExcelHeaderArray(data_table_col + 1)\n\n vm.header_names.shift()\n\n $scope.rows = [];\n $scope.columns = [];\n for (var i = 0; i < data_table_row; i++) {\n $scope.rows.push(String.fromCharCode(65 + i));\n }\n\n\n var col_data = {};\n\n for (var j = 0; j < data_table_col; j++) {\n $scope.columns.push(j + 1)\n }\n\n vm.rows = $scope.rows.length;\n vm.columns = $scope.columns.length;\n\n\n\n vm.rowIndex = [];\n vm.myrecords = [];\n var col_data_update = {};\n\n $scope.init = function (row, key, column, index, current_index, heading) {\n col_data_update = {};\n vm.table_id;\n // var etSectionId = heading_data.parent_id;\n // var etHeadingId = heading_data.id;\n // var new_field = 'edit_'+etSectionId+'_'+etHeadingId;\n\n if (vm.editDataTable[vm.new_field]['table_str_data'] != '') {\n var tbd = vm.editDataTable[new_field]['table_str_data'][current_index];\n if (tbd == undefined) {\n return;\n // // //;\n }\n\n var new_val = tbd.value;\n\n col_data_update[row + column] = '';\n vm.myrecords.push(col_data_update);\n //// // //;\n\n\n // $rootScope.DataTableFields.cell_stucture = { 'index': parseInt(tbd.index), 'cell_no': tbd.row_no + parseInt(tbd.col_no), 'type': tbd.type, 'row': tbd.row_no, 'column': parseInt(tbd.col_no), 'value': tbd.value, 'text_align': tbd.text_align, 'text_position': tbd.text_position, 'dataPointName' : tbd.dataPointName, 'dataPointId' : tbd.dataPointId }\n\n $rootScope.DataTableFields.cell_stucture = { 'index': parseInt(tbd.index), 'cell_no': tbd.col_no + parseInt(tbd.row_no), 'type': tbd.type, 'row': tbd.col_no, 'column': parseInt(tbd.row_no), 'value': tbd.value, 'text_align': tbd.text_align, 'text_position': tbd.text_position, 'dataPointName': tbd.dataPointName, 'dataPointId': tbd.dataPointId }\n\n if (tbd.type == 'Number') {\n if (tbd.is_percentage == 1) {\n $rootScope.DataTableFields.cell_stucture['percentage'] = true;\n }\n else {\n $rootScope.DataTableFields.cell_stucture['percentage'] = false;\n }\n }\n var tbd_value = tbd.value;\n\n if (tbd.value != 'n-def') {\n if (tbd.type != 'Label') {\n\n tbd_value = '';\n // // //;\n }\n\n vm.myrecords[current_index][row + column] = tbd_value;\n\n\n }\n\n //// // //;\n //vm.myrecords.push(col_data_update);\n vm.data_table_structure[current_index] = $rootScope.DataTableFields.cell_stucture;\n\n\n }\n else {\n col_data_update[row + column] = '';\n vm.myrecords.push(col_data_update)\n\n vm.data_table_structure.push({})\n\n }\n\n\n\n };\n\n $scope.initRow = function (key_row) {\n vm.rowIndex.push(key_row + 1)\n\n };\n\n $rootScope.DataTableFields = {\n lable_show: false,\n formula_show: false,\n currency_show: false,\n number_show: false,\n percentage: false,\n textShow: false,\n data_point_show: false\n }\n\n vm.selectedRow = undefined;\n vm.selectedColumn = undefined;\n vm.selectedIndex = undefined;\n\n\n vm.selectedHeaderName = undefined;\n vm.selectedHeaderIndex = undefined;\n }\n\n console.log('templateUrl', templateUrl)\n\n $mdDialog.show({\n scope: $scope,\n preserveScope: true,\n templateUrl: templateUrl,\n parent: angular.element($document.find('#checklist'))\n });\n }", "title": "" }, { "docid": "207ad485849d211dd262b0a74d44fd23", "score": "0.5907071", "text": "function openPoPup( object)\r\n{\r\n// setting the object id of clicked listitem for later use\r\nobject.id=\"selected\";\r\n\r\n//alert(object.id);\r\n\r\n $( \"#dialog-form\" ).dialog( \"open\" );\r\n}", "title": "" }, { "docid": "478686a896b739dec9d2984fe68618fb", "score": "0.58923715", "text": "function showDialog(id){\n Dialog.window($(id).innerHTML, {className: \"alphacube\", width:400,height:267, id: \"d12\"})\n}", "title": "" }, { "docid": "b35cf20bc272683ff0fbec7951db47e4", "score": "0.5891634", "text": "function showDlgSettings(){\n\n console.log(\"[showDlgSettings]\")\n if (dlgSettings==null){\n console.error(\"dlgSettings non definito!\")\n return\n }\n // Aggiorna i dati in dlg\n //document.querySelector('#dlgAddIdx').val = idx\n document.querySelector('#dlgAddNumero').textContent = \"1\"\n //document.querySelector('#dlgAddNome').textContent = data.nome\n // Apre la dlg\n //var dlg = dlgAddToOrder[0]\n dlgSettings.open()\n}", "title": "" }, { "docid": "c18b878c097713e2ad1a688fadabac03", "score": "0.58880556", "text": "function newDepartment() {\n inquirer.prompt([{\n type: \"input\",\n name: \"department_name\",\n message: \"department name: \"\n }, {\n type: \"input\",\n name: \"over_head_cost\",\n message: \"Overhead cost: \"\n }]).then((item) => {\n connection.query(\"INSERT INTO departments(department_name,over_head_costs, product_sales) VALUES (?,?,0)\", [item.department_name, item.over_head_costs],\n (err) => { if (error) throw error; });\n console.log('Department was successfully added.');\n console.log('******************************************************************');\n menuScreen();\n })\n}", "title": "" }, { "docid": "ab1912e72dece203935c60883b4fd47b", "score": "0.58679855", "text": "function toolbox_data_js_open_new_data_row_dialog(flowchart_id)\n{\n\tvar dialogid='toolbox_data_js_new_data_row_dialog_id'+flowchart_id;\n\t$('#'+dialogid).dialog('destroy');\n\t$('#'+dialogid).remove();\n\tif($('#'+dialogid).length==0)\n\t{\n\t\t$('body').append(\"<div id='\"+dialogid+\"' title='属性:数据工具:ADD新建一条数据系列'>\"+\n\t\t\t\t\"<div >\" +\n\t\t\t\t\ttoolbox_data_js_get_data_content_for_new_data_row_dialog(flowchart_id)+\n\t\t\t\t\"</div>\" +\n\t\t\"</div>\");\n\t\t$('#'+dialogid).dialog({\n\t\t\tresizable: false,\n\t\t\tautoOpen: true,\n\t\t\theight: 500,\n\t\t\twidth: 800,\n\t\t\tmodal: true,\n\t\t\tbuttons:[{\n\t\t\t\ttext: \"确定\",\n\t\t\t\tclick: function() {\n\t\t\t\t\t//alert(JSON.stringify(toolbox_data_js_get_flow(flowchart_id)));\n\t\t\t\t\ttoolbox_data_js_show_data_row_list(flowchart_id);\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\ttext: \"取消\",\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t}\n\t\t\t}]\n\t\t});\n\t\topes_utils_add_table_css();\n\t\t$(\"#toolbox_data_js_new_data_row_dialog_id\"+flowchart_id+\" .aImgButton\").button();\n\t}else\n\t{\n\t\t$('#'+dialogid).dialog('open');\n\t}\n\tvar data_row_id=getTimestamp();\n\t//var data_column_id=null;\n\ttoolbox_data_js_bind_click_even_for_sub_data_type_buttons(flowchart_id,data_row_id);\n\ttoolbox_data_js_show_data_column_list(flowchart_id,data_row_id);\n}", "title": "" }, { "docid": "afffafa5f2237b089d406c44a7168b4b", "score": "0.5866595", "text": "function del1(){\r\n\t$('#del_dialog').html(\"\");\r\n\t\tdel =$('#delt').val();\t\t\r\n\t\t$('#del_dialog').dialog({\r\n\t\tautoOpen: false,\r\n\t\tshow: 'highlight',\r\n\t\thide: 'highlight',\r\n\t\tbuttons: {\r\n\t\t\t'No': function() {\r\n\t\t\t\t$(this).dialog('close');\r\n\t\t\t},\r\n\t\t\t'Yes': function() {\r\n\t\t\t\tconf1();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\t\t$('#del_dialog').dialog('open');\r\n\t\t$('#del_dialog').load(\"scripts/processDeleteItem.php?delt=\"+del);\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "f18d94ed28f2798a01724bc971d7680e", "score": "0.5862189", "text": "function settingDialog(generatorObj)\n{\n dlgMain = new Window(\"dialog\", strTitle);\n \n // match our dialog background color to the host application\n\t//var brush = dlgMain.graphics.newBrush(dlgMain.graphics.BrushType.THEME_COLOR, \"appDialogBackground\");\n //dlgMain.graphics.backgroundColor = brush;\n //dlgMain.graphics.disabledBackgroundColor = brush;\n\n\tdlgMain.orientation = 'column';\n\tdlgMain.alignChildren = 'left';\t\n\n\t// -- two groups, one for left and one for right ok, cancel\n\tdlgMain.grpTop = dlgMain.add(\"group\");\n\tdlgMain.grpTop.orientation = 'column';\n\tdlgMain.grpTop.alignChildren = 'left';\n\tdlgMain.grpTop.alignment = 'fill';\n\t\n\t// -- two groups, one for left and one for right ok, cancel\n\tdlgMain.grpButton = dlgMain.add(\"group\");\n\tdlgMain.grpButton.orientation = 'row';\n\tdlgMain.grpButton.alignChildren = 'center';\n\tdlgMain.grpButton.alignment = 'fill';\n\t\n\tdlgMain.pnlCreateOption = dlgMain.add(\"panel\", undefined, \"Options\");\n\tdlgMain.pnlCreateOption.alignChildren = 'left';\n\tdlgMain.pnlCreateOption.alignment = 'fill';\n\t\n\tdlgMain.grpBottom = dlgMain.add(\"group\");\n\tdlgMain.grpBottom.orientation = 'column';\n\tdlgMain.grpBottom.alignChildren = 'center';\n\tdlgMain.grpBottom.alignment = 'fill';\t\t\n\n\t// -- the third line in the dialog\n dlgMain.grpTop.add(\"statictext\", undefined, strLabelContainerWidth);\n\t// -- the fourth line in the dialog\n dlgMain.etContainerWidth = dlgMain.grpTop.add(\"edittext\", undefined, generatorObj.containerWidth.toString());\n dlgMain.etContainerWidth.alignment = 'fill';\n dlgMain.etContainerWidth.preferredSize.width = StrToIntWithDefault( strLabelContainerWidth, 160 );\n\t\n\t// -- the third line in the dialog\n dlgMain.grpTop.add(\"statictext\", undefined, strLabelColPadding);\n\t// -- the fourth line in the dialog\n dlgMain.etColPadding = dlgMain.grpTop.add(\"edittext\", undefined, generatorObj.colPadding.toString());\n dlgMain.etColPadding.alignment = 'fill';\n dlgMain.etColPadding.preferredSize.width = StrToIntWithDefault( strLabelColPadding, 160 );\n\t\n\t// -- the fourth line in the dialog\n dlgMain.etHorizontalGuides = dlgMain.pnlCreateOption.add(\"checkbox\", undefined, 'Horizontal Guides');\n\t\n\t// -- the third line in the dialog\n dlgMain.pnlCreateOption.add(\"statictext\", undefined, strLabelTotalHeight);\n\t// -- the fourth line in the dialog\n dlgMain.etTotalHeight = dlgMain.pnlCreateOption.add(\"edittext\", undefined, generatorObj.totalHeight.toString());\n dlgMain.etTotalHeight.alignment = 'fill';\n dlgMain.etTotalHeight.preferredSize.width = StrToIntWithDefault( strLabelTotalHeight, 160 );\n\t\n\t// -- the third line in the dialog\t\n dlgMain.pnlCreateOption.add(\"statictext\", undefined, strLabelDocumentType);\n\tdlgMain.ddDocumentType = dlgMain.pnlCreateOption.add(\"dropdownlist\", undefined);\n dlgMain.ddDocumentType.preferredSize.width = StrToIntWithDefault( strddDocumentType, 100 );\n dlgMain.ddDocumentType.alignment = 'left';\n dlgMain.ddDocumentType.add(\"item\", \"White\");\n dlgMain.ddDocumentType.add(\"item\", \"Black\");\n dlgMain.ddDocumentType.add(\"item\", \"Transparent\");\n\tdlgMain.ddDocumentType.items[generatorObj.documentType].selected = true;\n\n\tdlgMain.btnRun = dlgMain.grpButton.add(\"button\", undefined, strButtonRun );\n dlgMain.btnRun.onClick = function() {\n\t\tvar containerWidth = dlgMain.etContainerWidth.text;\n\t\tif (containerWidth.length == 0) {\n\t alert(strAlertSpecifyContainerWidth);\n\t\t\treturn;\n\t\t}\n\t\tif (Math.abs(parseInt(containerWidth, 10)) == 0) {\n\t alert(strAlertNotNullContainerWidth);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar colPadding = dlgMain.etColPadding.text;\n\t\tif (colPadding.length == 0) {\n\t alert(strAlertSpecifyColPadding);\n\t\t\treturn;\n\t\t}\n\t\tif (Math.abs(parseInt(colPadding, 10)) == 0) {\n\t alert(strAlertNotNullColPadding);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar totalHeight = dlgMain.etTotalHeight.text;\t\t\n\t\tif (Math.abs(parseInt(totalHeight, 10)) < 200) {\n\t alert(strAlertSpecifyTotalHeight);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tdlgMain.close(runButtonID);\n\t}\n\n\tdlgMain.btnCancel = dlgMain.grpButton.add(\"button\", undefined, strButtonCancel );\n dlgMain.btnCancel.onClick = function() { \n\t\tdlgMain.close(cancelButtonID); \n\t}\n\t\n\tdlgMain.grpBottom.add(\"statictext\", undefined, strTextCopyrightTNQSoft);\n\t\n\tdlgMain.defaultElement = dlgMain.btnRun;\n\tdlgMain.cancelElement = dlgMain.btnCancel;\n \n\tapp.bringToFront();\n\t\n\tdlgMain.center();\n var result = dlgMain.show();\n \n if (cancelButtonID == result) {\n\t\treturn result; // close to quit\n\t}\n \n // get setting from dialog\n generatorObj.containerWidth = Math.abs(parseInt(dlgMain.etContainerWidth.text, 10));\n\tgeneratorObj.colPadding = Math.abs(parseInt(dlgMain.etColPadding.text, 10));\n\tgeneratorObj.horizontalGuides = dlgMain.etHorizontalGuides.value;\n\tgeneratorObj.totalHeight = Math.abs(parseInt(dlgMain.etTotalHeight.text, 10));\n\tgeneratorObj.documentType = dlgMain.ddDocumentType.selection.index;\n\n return result;\n}", "title": "" }, { "docid": "e2162003b86b13873f6dceb15f75446a", "score": "0.58599335", "text": "_createDialog(dlgId) {\n const dlgTitleText = '';\n const dlgTitleTextStrId = 'kTitleStrId';\n\n const builder = new cred.resource.DialogResourceSetBuilder();\n builder.addResource(\n makeMinimalDialogResource(cred.locale.any, dlgId, dlgTitleTextStrId)\n );\n for (const lang of cred.language) {\n const strMap = new StringMap();\n strMap.add(dlgTitleTextStrId, dlgTitleText, lang);\n builder.addStrings(lang, strMap);\n }\n\n this._resourceSet = builder.build();\n this._storeUndo();\n this._controller.notifyDialogCreated(this, this._resourceSet);\n }", "title": "" }, { "docid": "39b1566c90637110015242669b83d123", "score": "0.58528376", "text": "function showAlert (msg) {\r\n\tdojo.byId(\"dialogAlertMessage\").innerHTML=msg ;\r\n\tdijit.byId(\"dialogAlert\").show();\r\n}", "title": "" }, { "docid": "8534cda2fc5337b626c3980b62281cc9", "score": "0.58471507", "text": "function viewEmpDept(){\n\n connection.query(\"SELECT * FROM department\", \n\n function (err, res) {\n\n if (err) throw err\n console.table(res)\n startMenu()\n\n })\n\n}", "title": "" }, { "docid": "ef72756adab79e96365ba90bd0958186", "score": "0.5840858", "text": "function ObtenerFormaAgregarGrupo()\n{\n $(\"#dialogAgregarGrupo\").obtenerVista({\n nombreTemplate: \"tmplAgregarGrupo.html\",\n despuesDeCompilar: function(pRespuesta) {\n $(\"#dialogAgregarGrupo\").dialog(\"open\");\n }\n });\n}", "title": "" }, { "docid": "6630d1c95e124a74f3a5e1928e8a8ffe", "score": "0.58402973", "text": "function loadData(dialog){}", "title": "" }, { "docid": "be82d08ce240111fd4fb66229d9b47e4", "score": "0.58372825", "text": "function open(dialog) {\n\t\n}", "title": "" }, { "docid": "a0dc07abf09190465fe4f8e24bfc9247", "score": "0.5829252", "text": "function onButtonClick(args) {\n\tif ($(args.e.currentTarget).hasClass(\"add\")) {\n\t\twindow.addlist = true;\n\t\tvar schArgs = $(\"#DoctorSchedule\").ejSchedule('instance');\n\t\tif (!schArgs.model.readOnly) {\n\t\t\t$(\"#customWindow\").ejDialog({ \n\t\t\t\twidth: \"auto\", \n\t\t\t\theight: \"auto\", \n\t\t\t\tshowOnInit: false, \n\t\t\t\tenableModal: true, \n\t\t\t\ttitle: \"Patient Appointment Details\", \n\t\t\t\tenableResize: false, \n\t\t\t\tallowKeyboardNavigation: false, \n\t\t\t\tclose: \"clearFields\" \n\t\t\t});\n\t\t\t$(\"#subject\").ejAutocomplete({ \n\t\t\t\twidth: \"100%\", \n\t\t\t\tdataSource: window.patientlist, \n\t\t\t\twatermarkText: \"Select Patient Name\", \n\t\t\t\tfields: { text:\"Name\" },\n\t\t\t\tshowPopupButton: false \n\t\t\t});\n\t\t\t$(\"#customWindow\").ejDialog(\"open\");\n\t\t\tclearFields();\n\t\t\t$(\"#StartTime\").ejDateTimePicker({ value: new Date() });\n\t\t\t$(\"#EndTime\").ejDateTimePicker({ value: new Date(new Date().setMinutes(new Date().getMinutes() + 30 )) });\n\t\t\tvar resObj = $(\"#DoctorSchedule\").ejSchedule('instance');\n\t\t\tif (!ej.isNullOrUndefined(resObj.model.resources)) {\n\t\t\t\t$(\".department\").css(\"display\", \"\");\n\t\t\t\tvar res = resObj.model.resources[resObj.model.resources.length-2].resourceSettings.dataSource;\n\t\t\t\t$(\"#dept\").ejDropDownList({ dataSource: res, fields: { text: \"Text\", id: \"Id\", value: \"Text\" } });\n\t\t\t\t(res.length > 0) && $(\"#dept\").data(\"ejDropDownList\").selectItemByText(res[0].Text);\n\t\t\t\tvar res1 = new ej.DataManager(resObj.model.resources[resObj.model.resources.length-1].resourceSettings.dataSource).executeLocal(new ej.Query().where(resObj.model.resources[resObj.model.resources.length - 2].resourceSettings[\"groupId\"], ej.FilterOperators.equal, res[0].Id));;\n\t\t\t\t$(\"#deptdoctors\").ejDropDownList({ dataSource: res1, fields: { text: \"Text\", id: \"Id\", value: \"Text\" } });\n\t\t\t\t(res1.length > 0) && $(\"#deptdoctors\").data(\"ejDropDownList\").selectItemByText(res1[0].Text);\n\t\t\t}\n\t\t}\n\t}\n\telse if ($(args.e.currentTarget).hasClass(\"delete\")) {\n\t\tif (window.list) {\n\t\t\t$(\"#alertWindow\").ejDialog(\"open\");\n\t\t}\n\t\telse {\n\t\t\t$(\"#deleteWindow\").ejDialog({ \n\t\t\t\twidth: \"auto\", \n\t\t\t\theight: \"auto\", \n\t\t\t\tshowOnInit: false, \n\t\t\t\tenableModal: true, \n\t\t\t\ttitle: \"Delete Appointment\", \n\t\t\t\tenableResize: false, \n\t\t\t\tallowKeyboardNavigation: false, \n\t\t\t\tclose: \"clearFields\" \n\t\t\t});\n\t\t\t$(\"#deleteWindow\").ejDialog(\"open\");\n\t\t\tclearFields();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "677ed225890eb571f82bc5c8bae433ee", "score": "0.5816864", "text": "function newDep() {\n console.log('>>>>>>Creating New Department<<<<<<');\n //prompts to add deptName and numbers. if no value is then by default = 0\n inquirer.prompt([\n {\n type: \"input\",\n name: \"ID\",\n message: \"ID: \"\n }, {\n type: \"input\",\n name: \"Name\",\n message: \"Department Name: \"\n }, {\n type: \"input\",\n name: \"Cost\",\n message: \"Over Head Cost: \",\n }, {\n type: \"input\",\n name: \"Sales\",\n message: \"Product Sales: \",\n }\n ]).then(function (answers) {\n connection.query('INSERT INTO Departments SET ?', {\n department_id: answers.ID,\n department_name: answers.Name,\n over_head_costs: answers.Cost,\n total_sales: answers.Sales\n }, function (err, res) {\n if (err) throw err;\n console.log('Added department.');\n })\n supAction();\n });\n}", "title": "" }, { "docid": "5d831ee08d95f7ab0f5ee9f0d3b1e8ba", "score": "0.5816368", "text": "function org_zmail_example_dialogs_HandlerObject() {\n}", "title": "" }, { "docid": "5e4837c1cee7fef3dbed5f8b3913e13b", "score": "0.58149046", "text": "function openDialog() {\n //start preload\n objChartMain.preloadobj.startPreload();\n dialogTitle = \"TradingCentral Binary Option\";\n\n var updatetime = cache == false ? ('?' + Math.floor((Math.random() * 100) + 1)) : \"\";\n initDialog('', dialogTitle);\n $('#chart-dialog').load(objChartMain.guiinit.rootpath + \"/\" + objPlugin.info.path + 'dialog.htm' + updatetime + ' #gui-dialog', function () {\n\n\n //Init Tabs\n initEventTab();\n\n\n\n //Open indicator\n //indicator4All(objInfo);\n\n\n initPluginSettings();\n\n\n\n\n //run localization\n if (typeof objChartMain.localizationobj != 'undefined') {\n objChartMain.localizationobj.gui.updateFromDataLang($('#chart-dialog'));\n }\n\n\n //OPen\n $(\"#chart-dialog\").dialog(\"open\");\n });\n }", "title": "" }, { "docid": "be931be8c067c75e568860b6383890a9", "score": "0.58096695", "text": "function myDisplayDialog(){\r\n\tvar myDialog, myTabButtons;\r\n\twith(myDialog = app.dialogs.add({name:\"TabUtilities\"})){\r\n\t\twith(dialogColumns.add()){\r\n\t\t\twith(borderPanels.add()){\r\n\t\t\t\tstaticTexts.add({staticLabel:\"Set a Tab Stop At:\"});\r\n\t\t\t\twith(myTabButtons = radiobuttonGroups.add()){\r\n\t\t\t\t\tradiobuttonControls.add({staticLabel:\"Right Column Edge\", checkedState:true});\r\n\t\t\t\t\tradiobuttonControls.add({staticLabel:\"Current Cursor Position\"});\r\n\t\t\t\t\tradiobuttonControls.add({staticLabel:\"Left Indent\"});\r\n\t\t\t\t\tradiobuttonControls.add({staticLabel:\"Hanging Indent at Cursor\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twith(borderPanels.add()){\r\n\t\t\t\tstaticTexts.add({staticLabel:\"Tab Leader\"});\r\n\t\t\t\t\twith(dialogColumns.add()){\r\n\t\t\t\t\tmyTabLeaderField = textEditboxes.add({editContents:\"\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar myResult = myDialog.show();\r\n\tif(myResult == true){\r\n\t\tvar myTabType = myTabButtons.selectedButton;\r\n\t\tvar myTabLeader = myTabLeaderField.editContents;\r\n\t\tmyDialog.destroy();\r\n\t\tmyAddTabStop(myTabType, myTabLeader);\t\t\r\n\t}\r\n\telse{\r\n\t\tmyDialog.destroy();\r\n\t}\r\n}", "title": "" }, { "docid": "0f7edf3a215fcd036d8c2b3ea9a4692f", "score": "0.5806671", "text": "function showInfo (msg) {\r\n\tdojo.byId(\"dialogInfoMessage\").innerHTML=msg ;\r\n\tdijit.byId(\"dialogInfo\").show();\r\n}", "title": "" }, { "docid": "7411afd0787027cc34636113f6008377", "score": "0.58054185", "text": "function onDialogLoad() {\n}", "title": "" }, { "docid": "fc30bd4d47da7ae5bb900db3405ddc51", "score": "0.5804524", "text": "function setupDialog() {\n\t\t\t\t// setup e2e values as log level and content\n\t\t\t\tif (dialog.traceXml) {\n\t\t\t\t\tdialog.$(e2eTraceConst.taContent).text(dialog.traceXml);\n\t\t\t\t}\n\t\t\t\tif (dialog.e2eLogLevel) {\n\t\t\t\t\tdialog.$(e2eTraceConst.selLevel).val(dialog.e2eLogLevel);\n\t\t\t\t}\n\n\t\t\t\tfillPanelContent(controlIDs.dvLoadedModules, oData.modules);\n\n\n\t\t\t\t// bind button Start event\n\t\t\t\tdialog.$(e2eTraceConst.btnStart).one(\"tap\", function () {\n\n\t\t\t\t\tdialog.e2eLogLevel = dialog.$(e2eTraceConst.selLevel).val();\n\t\t\t\t\tdialog.$(e2eTraceConst.btnStart).addClass(\"sapUiSupportRunningTrace\").text(\"Running...\");\n\t\t\t\t\tdialog.traceXml = \"\";\n\t\t\t\t\tdialog.$(e2eTraceConst.taContent).text(\"\");\n\n\t\t\t\t\tsap.ui.core.support.trace.E2eTraceLib.start(dialog.e2eLogLevel, function (traceXml) {\n\t\t\t\t\t\tdialog.traceXml = traceXml;\n\t\t\t\t\t});\n\n\t\t\t\t\t// show info message about the E2E trace activation\n\t\t\t\t\tsap.m.MessageToast.show(e2eTraceConst.infoText, {duration: e2eTraceConst.infoDuration});\n\n\t\t\t\t\t//close the dialog, but keep it for later use\n\t\t\t\t\tdialog.close();\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "b08c7d428e8f3feac7a78854fed2f251", "score": "0.58032835", "text": "function V(){this.name=\"Dialog\";this.prefix=\"cwc-dialog-\";this.a=this.node=this.b=null;this.c=this.prefix+\"chrome\"}", "title": "" }, { "docid": "c01990b6ab9532bdd538fee16b870d77", "score": "0.57947123", "text": "function initDeleteCategoryDialog(){\r\n\t\t\r\n\t\t// set update title onenter function\r\n\t\tjQuery(\"#uc_dialog_delete_category_action\").on(\"click\",deleteCategory);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "f8171c4a54bb0cbc859329a3930af9e9", "score": "0.5783678", "text": "function showPrompt(){\n\t\n\t\t$.ajax ({\n\t\t type: 'post',\n\t\t url: 'ecalc_main.php',\n\t\t data: ({\n\t\t\t tag: \"addNGrp\",\n\t\t }),\n\t\t cache: false,\n\t\t success: function(feedback){\n\t\t NewGroupWindowDiv.html(feedback);\n\t\t }\n\t });\n\t NewGroupWindowDiv = $('#addNItem').dialog({\n\t\t\t autoOpen: false,\n modal: true,\n draggable: false,\n resizable: false,\n width: 350,\n height: 260,\n dialogClass: 'frd-dialog-titled centered',\n title: 'ازدیاد کتگوری',\n close: function() {\n\t\t\t\t $('#messages').text('');\n }\n\t\t });\n\t NewGroupWindowDiv.dialog(\"open\");\n}", "title": "" }, { "docid": "e4f4296e28631bce587729ccf26d1fae", "score": "0.57813096", "text": "function createDialog(dialogName,askQuery, actionName, processResult,actionTitle,dialogTitle, labelTitle,editPage){\n/* Static Properties */\n//was: ve.ui.EditOrInsertDialog\nvar addOrEditResourceDialog = function( manager, config ) {\n\t// Parent constructor\n\taddOrEditResourceDialog.super.call( this, manager, config );\n\n};\n/* Inheritance */\n\nOO.inheritClass( addOrEditResourceDialog, ve.ui.FragmentDialog );\n\naddOrEditResourceDialog.static.name = dialogName;\naddOrEditResourceDialog.static.title = dialogTitle;\naddOrEditResourceDialog.static.size = 'medium';\naddOrEditResourceDialog.prototype.getBodyHeight = function () {\n var dialogthat=this;\n \n var api = new mw.Api();\n // Start a \"GET\" request\n //console.log('Query:'+askQuery+'|?Semantic title');\n api.get( {\n action: 'ask',\n parameters:'limit:10000',//todo:check how to increase limit of ask-result; done in LocalSettings.php\n query: askQuery+'|?Semantic title'//get all pages; include property Semantic title\n } ).done( function ( data ) {\n //console.log(data);\n //parse data\n //first get results within data\n var res=data.query.results;\n //console.log(res);\n\n //array to store results\n var pagenames=[];\n for (prop in res) {\n\t if (!res.hasOwnProperty(prop)) {\n\t //The current property is not a direct property of p\n\t continue;\n\t }\n\t //property defined\n\t //now get pagename and Semantic title (if available)\n\t var pagename=res[prop].fulltext;\n\t var semantictitle=res[prop].printouts['Semantic title'][0];\n\t var title='';\n\t if (semantictitle)\n\t title=semantictitle;\n\t else\n\t title=pagename;\n\t pagenames.push({ value: title, data: pagename });\n }\n \n \n pagenames.sort(function(a, b) {\n\t if (a.value > b.value) {\n\t return 1;\n\t }\n\t if (a.value < b.value) {\n\t return -1;\n\t }\n\t // a must be equal to b\n\t return 0;\n\t});\n var prevTitle=\"\";\n for (var i=0;i<pagenames.length;i++){\n\tvar item=pagenames[i];\n\tvar title=item.value;\n\t if (title==prevTitle){\n\t pagenames[i].value=title+\"(\"+pagename+\")\";\n\t }\n\t else\n\t {\n\t prevTitle=title;\n\t }\n }\n \n\n var complete=$( \"#\"+dialogName+\"id\" ).find(\"input\");\n //TODO workaround, set width of label to 450px\n $(\".oo-ui-fieldLayout-body\").width(450);\n //store data in inputfields \n $(complete).autocomplete({\n\t lookup: pagenames,//pagenames are created at the start of dialog\n\t onSelect: function (suggestion) {\n\t editPage(suggestion.data);\n\t //that.pageid=suggestion.data;\n\t dialogthat.close();\n\t dialogthat.subject.setValue(\"\");\n\t },\n\t appendTo: complete.parentElement\n\t});\n });\n return 120;\n}\naddOrEditResourceDialog.prototype.initialize = function () {\n\taddOrEditResourceDialog.super.prototype.initialize.call( this );\n\tthis.panel = new OO.ui.PanelLayout( { '$': this.$, 'scrollable': true, 'padded': true } );\n\tthis.inputsFieldset = new OO.ui.FieldsetLayout( {\n\t\t'$': this.$\n\t} );\n\t// input from\n\tthis.subject = new OO.ui.TextInputWidget(\n\t\t{ '$': this.$, 'multiline': false, 'placeholder': OO.ui.deferMsg( 'visualeditor-emm-search' )() }\n\t);\n\t//add DOM-id to parent of input-field\n\tthis.subject.$element.attr(\"id\",dialogName+\"id\");\n\tthis.subjectField = new OO.ui.FieldLayout( this.subject, {\n\t\t'$': this.$,\n\t\t'label': labelTitle\n\t} );\n\tthis.subjectField.$element.attr(\"id\",dialogName+\"nameid\");\n\taddOrEditResourceDialog.static.actions = [\n\n\t{ action: 'save', label: actionTitle, flags: [ /*'primary',*/ 'progressive' ] },\n\t{\n\t\t'label': OO.ui.deferMsg( 'visualeditor-dialog-action-cancel' ),\n\t\t'flags': 'safe',\n\t\t'modes': [ 'edit', 'insert', 'select' ]\n\t}\n\t];\n\tthis.inputsFieldset.$element.append(\n\t\t\n\t\tthis.subjectField.$element\n\t);\n\tthis.panel.$element.append(\tthis.inputsFieldset.$element );\n\tthis.$body.append( this.panel.$element );\n\n }\n\taddOrEditResourceDialog.prototype.getActionProcess = function ( action ) {\n\t var that = this;\n\n\n\t switch (action) {\n\t case \"cancel\":\n\t\treturn new OO.ui.Process(function() {\n\t\t console.log(\"cancel\");\n\t\t that.close();\n\t\t});\n\n\t case \"save\":\n\t\treturn new OO.ui.Process(function() {\n\t\t processResult();\n\t\t that.close();\n\t\t});\n\n\t default:\n\t\treturn addOrEditResourceDialog.super.prototype.getActionProcess.call(this, action);\n\t }\n\t};\n ve.ui.windowFactory.register( addOrEditResourceDialog );\n}", "title": "" }, { "docid": "b4f686467e9f644934e497115001de36", "score": "0.57661206", "text": "function addStoreInspectionRecord(evt){\r\n\tvar dialogName = 'healthInspection';\r\n\t\r\n\ttry{if (!evt) var evt = window.event;\r\n\tevt.preventDefault();\r\n\tevt.stopPropagation();}catch(e){console.log('Error is --> ' + e);}\r\n\t\r\n\tvar domStyle = require('dojo/dom-style');\r\n\tvar dom = require('dojo/dom');\r\n\tvar registry = require('dijit/registry');\r\n\tvar domConstruct = require('dojo/dom-construct');\r\n\tswitch(dialogName){\r\n\tcase 'healthInspection':\r\n\t\tif(domStyle.getComputedStyle(dom.byId('healthInspectionWidgetsDiv')).display != 'none')\r\n\t\t\thideFileUploadDialog('healthInspection');\r\n\t\tdomConstruct.empty(dom.byId('healthInspectionUploaded'));\r\n\t\tdomConstruct.empty(dom.byId('healthInspectionExisting'));\r\n\t\t\r\n\t\thealthInspectionDialog.reset();\r\n\t\tregistry.byId('hiddenHealthId').set('value', 0);\r\n\t\t//healthInspectionDialog.titleBar.style.display = 'none';\r\n\t\thealthInspectionDialog.set('title', 'Health Inspection Details');\r\n\t\thealthInspectionDialog.show();\r\n\t\tdomStyle.set(dom.byId('healthInspectionDialog'), {top:'40px', position: \"absolute\"});\r\n\t\tbreak;\r\n\tdefault:\r\n\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "9d250954361304a6e41b5d39df948af8", "score": "0.5761043", "text": "function showQuestion (msg,actionYes, ActionNo) {\r\n\tdojo.byId(\"dialogQuestionMessage\").innerHTML=msg ;\r\n\tdijit.byId(\"dialogQuestion\").acceptCallbackYes=actionYes;\r\n\tdijit.byId(\"dialogQuestion\").acceptCallbackNo=actionNo;\r\n\tdijit.byId(\"dialogQuestion\").show();\r\n}", "title": "" }, { "docid": "3cb4d186d6466294a18c1ee15e71a86f", "score": "0.5759524", "text": "function createDepartment() {\n\t inquirer.prompt([\n {\n type: \"input\",\n name: \"department\",\n message: \"New department name:\"\n },\n {\n type: \"input\",\n name: \"overhead\",\n message: \"What is the department overhead:\"\n },\n ])\n .then(function(answer) {\n\n connection.query(\"INSERT INTO departments (department_name, over_head_costs) VALUES (?, ?)\", [answer.department, answer.overhead], function(err, results) {\n if (err) throw err;\n \n console.log(chalk.bold.yellow(\"\\nThe department \" + answer.department + \" has been added to the department list.\"));\n \n startMenu();\n \n })\n\n })\n}", "title": "" }, { "docid": "f7bc7de757594914d980c3599455fc67", "score": "0.57562155", "text": "function viewDepartment() {\n var sqlQuery = \"SELECT * FROM department\";\n connection.query(sqlQuery, function(err, res) {\n if (err) throw err;\n console.table(res);\n // Then reinitiate the Menu so the user can take more actions\n initiateMenu();\n }); \n}", "title": "" }, { "docid": "478d59fb30c95b9d7c0df38f8a09c8f0", "score": "0.5755447", "text": "function addDepartment() {\n inq.prompt([{\n type: 'input',\n message: 'What\\'s the new department?',\n name: 'newDept'\n }, ]).then(response => {\n db.query('INSERT INTO department (name) VALUES (?)', [response.newDept], function(err, results) {\n if (err) throw err;\n console.log(\"New department added\");\n });\n startMenu();\n })\n}", "title": "" }, { "docid": "06ed2e5e9bac78d5fb5090877e6111e7", "score": "0.5750621", "text": "function newDepartment()\n{\n var id = dijit.byId(\"Department.DepartmentId\");\n var name = dijit.byId(\"Department.Name\");\n var type = dijit.byId(\"Department.Type\");\n var notes = dijit.byId(\"Department.Notes\");\n\n dojo.xhrGet(\n {\n url: \"servlets/departmentManager?operationType=add\",\n load: function(response)\n {\n dojo.publish(\"/saved\", [{message: \"<font size='2'><b>Enter new Department\", type: \"info\", duration: 15000}]);\n id.setValue(\"\");\n name.setValue(\"\");\n type.setValue(\"\");\n notes.setValue(\"\");\n },\n error: function(response)\n {\n dojo.publish(\"/saved\", [{message: \"<font size='2'><b>...Failed: \" + response, type: \"error\", duration: 15000}]);\n }\n });\n}", "title": "" }, { "docid": "4230c0e8c351ecba4ab484954cde7c90", "score": "0.57479334", "text": "function createDialog(status,result)\n {\n var self = this;\n\n if(status === $.PercServiceUtils.STATUS_ERROR)\n {\n var defaultMsg = $.PercServiceUtils.extractDefaultErrorMessage(result.request);\n $.perc_utils.alert_dialog({title: 'Error', content: defaultMsg});\n callback(false);\n return;\n }\n\n percDialogObject = {\n resizable : false,\n title: I18N.message(\"perc.ui.revisionDialog.title@Revisions\") + \": \" + itemName,\n modal: true,\n closeOnEscape : false,\n percButtons:{},\n id: \"perc-revisions-dialog\",\n open:function(){\n addRevisionRows(result.data);\n },\n width: 700,\n height:490\n };\n\n percDialogObject.percButtons.Close = {\n click: function(){\n dialog.remove();\n },\n id: \"perc-revisions-dialog-close\"\n };\n\n var dialogHTML = createRevisionTable();\n dialog = $(dialogHTML).perc_dialog(percDialogObject);\n $(\"#perc-revisions-container\").css( \"min-height\", \"350px\" );\n $(\"#revisionsTable_paginate\").css( \"right\", \"-25px\" );\n\n }", "title": "" }, { "docid": "059e4f65afcdbad76f1606712dce5af7", "score": "0.5742004", "text": "function createNewDepartmentMenu () {\n\n // Runs a SQL select query to display the existing departments\n connection.query(\n 'SELECT * FROM departments',\n function (err, res) {\n if (err) throw err;\n\n // Create an object of keys mapped to department Names\n // For access time of amortized constant complexity (and space of n)\n var departmentNames = {};\n res.forEach(function (item) {\n departmentNames[item.department_name] = undefined;\n });\n\n // Create a prompt to determine the details of the department to add\n inquirer.prompt([\n {\n message: 'What is the Name of the department you would like to add?',\n name: 'departmentName',\n validate: function (input) {\n // If the department name doesn't already exist\n if (!departmentNames.hasOwnProperty(input)) {\n // Return valid\n return true;\n }\n // Return invalid message\n return 'That Department Name already exists! Please correct!';\n }\n },\n {\n message: 'What is the total overhead cost of this Department?',\n name: 'overheadCost',\n validate: function (input) {\n // If the input is a number\n if (!isNaN(input)) {\n // Return valid\n return true;\n }\n // Return invalid message\n return 'That is not a valid number! Expected no characters or currency symbols.';\n }\n },\n ])\n .then(function (answers) {\n\n // Add a new department with the given info\n addNewDepartment(\n answers.departmentName,\n answers.overheadCost\n );\n });\n }\n );\n}", "title": "" }, { "docid": "d7d08ef9e6666526e5f60c731bae1df6", "score": "0.5741805", "text": "function openlinkpermitshipdialog(dialogid, shipment_id, shipment_label, okcallback) { \n var title = \"Link Permit record(s) to \" + shipment_label;\n var content = '<div id=\"'+dialogid+'_div\">Loading....</div>';\n var h = $(window).height();\n var w = $(window).width();\n w = Math.floor(w *.9);\n var thedialog = $(\"#\"+dialogid).html(content)\n .dialog({\n title: title,\n autoOpen: false,\n dialogClass: 'dialog_fixed,ui-widget-header',\n modal: true,\n stack: true,\n zindex: 2000,\n height: h,\n width: w,\n minWidth: 400,\n minHeight: 450,\n draggable:true,\n buttons: {\n \"Close Dialog\": function() { \n\t\t$(\"#\"+dialogid).dialog('close'); \n }\n },\n close: function(event,ui) { \n if (jQuery.type(okcallback)==='function') {\n okcallback();\n \t}\n\t$(\"#\"+dialogid+\"_div\").html(\"\");\n\t$(\"#\"+dialogid).dialog('destroy'); \n } \n });\n thedialog.dialog('open');\n jQuery.ajax({\n url: \"/component/functions.cfc\",\n type: \"post\",\n data: {\n method: \"shipmentPermitPickerHtml\",\n \treturnformat: \"plain\",\n shipment_id: shipment_id,\n shipment_label: shipment_label\n }, \n success: function (data) { \n $(\"#\"+dialogid+\"_div\").html(data);\n }, \n fail: function (jqXHR, textStatus) { \n $(\"#\"+dialogid+\"_div\").html(\"Error:\" + textStatus);\n }\n });\n}", "title": "" }, { "docid": "f42cb7ee5e61822774a8f7b5fbcf2569", "score": "0.5733123", "text": "function dialogSpawn(title,text,dialogID,titleID,blurbID) {\n var dialog = document.getElementById(dialogID);\n dialog.style.display = \"block\";\n\n var titleBlock = document.getElementById(titleID);\n titleBlock.innerHTML = title;\n\n var blurb = document.getElementById(blurbID);\n blurb.innerHTML = text;\n\n}", "title": "" }, { "docid": "4f19cec083e6a315e46e458cf798a7a2", "score": "0.5731595", "text": "function viewdepartment() {\n const query = connection.query(\"SELECT * FROM department\", function (err, res) {\n if (err) throw err;\n console.table(res);\n runPrompt();\n }\n )\n}", "title": "" }, { "docid": "77577b64af73ecacb2c4b5ac1ced2acd", "score": "0.5720711", "text": "function queryDepts() {\n\tconsole.log(\"\\n Departments\");\n\tinquirer.prompt([\n\n\t\t{\n\t name: \"department\",\n\t type: \"list\",\n\t message: \"Which Department would you like to place this item in?\", \n\t choices: [\"Appliances\", \"Electronics\", \"Fitness\", \"Furniture\", \"Patio,_Lawn_&_Garden\", \"Sports_&_Outdoor\"]\n\t },\n\n\t]).then(function(user) {\n\t\tconnection.connect(function(err){\n connection.query(\"SELECT * FROM products WHERE department_name = ?\", [user.department], function(err, res){\n if (err) throw err;\n console.log(\"\\n\" + user.department);\n for (var i = 0; i < res.length; i++) {\n \t\t\tconsole.log(\"\\n \" + res[i].id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity + \" | \");\n \t\t\t}\n \t\t\tconsole.log(\"\\n-----------------------------------\");\n \t\t\tstartManager(); //back to start\n });\n });\n\t});\n}", "title": "" }, { "docid": "428824d3b9641a8378489e906a4b2ebd", "score": "0.57182235", "text": "function OpenModelDialogueAddQuickTxPlan(tableName, textBoxGoalText) {\r\n try {\r\n //Changes made by Vikas Kasyup-22/Oct/2011 Ref task No. 338- To show processing until the popup open\r\n PopupProcessing();\r\n var goalText = $(\"[id$=\" + textBoxGoalText + \"]\");\r\n\r\n //End\r\n var myDate = new Date();\r\n\r\n OpenPage(5765, 10189, \"tableName=\" + tableName + \"^goalText=\" + escape(goalText[0].value) + \"^time=\" + myDate.getMinutes() + myDate.getSeconds(), null, GetRelativePath(), 'T', \"dialogHeight: 450px; dialogWidth: 700px;dialogTitle:\");\r\n\r\n }\r\n catch (err) {\r\n LogClientSideException(err, 'HRMTreatmetPlan'); //Code added by Devinder \r\n }\r\n}", "title": "" }, { "docid": "2686fbcbd758b7e270cf33e30b9f44d5", "score": "0.57137555", "text": "function selectDepartmet(){\n connection.query(\"SELECT * FROM department\", function(err, res){\n if (err) throw err;\n console.table(res);\n startPrompt();\n });\n}", "title": "" }, { "docid": "424a86f3c19b1135a63905a3b33d6b34", "score": "0.57095236", "text": "function openAddDeviceDialog()\n{\n jQuery('#modal-add-device').dialog('open');\n jQuery('.ui-widget-overlay').addClass('bg-black opacity-80');\n jQuery(\"#txtDeviceName\").focus();\n}", "title": "" }, { "docid": "53a81c56a9ac65ad03758b6d6016e560", "score": "0.570639", "text": "async function newdept(){\n return await inquirer.prompt([\n {\n type: 'input',\n name: 'title',\n message: 'Add name of new department:',\n },\n \n ]);\n}", "title": "" }, { "docid": "0a951bfc2b0b9bbd9ab13708d70ab73e", "score": "0.57054853", "text": "function addDept() {\n console.log(\"Department Creation Screen. Lucifer is Bringer of Light.\");\n inquirer\n .prompt([\n {\n name: \"dept\",\n type: \"input\",\n message: \"Enter new Department name\"\n },\n {\n name: \"overhead\",\n type: \"input\",\n message: \"Enter projected overhead costs\"\n }\n ])\n .then(answers => {\n connection.query(\n \"INSERT INTO depts set ?\",\n\n {\n dept: answers.dept,\n\n overhead: answers.overhead\n },\n function(error, results, fields) {\n if (error) throw error;\n console.log(\n \"Department created.The Dark Master brings Wisdom to All\"\n );\n }\n );\n init();\n });\n}", "title": "" }, { "docid": "f93f99c7766e3dcbb50a902d85e2e183", "score": "0.57039005", "text": "function setupCreateDialogs(){\n\tcreateHostDialog();\n\tcreateClusterDialog();\n\tcreateVMachineDialog();\n\tcreateVNetworkDialog();\n\tcreateUserDialog();\n createImageDialog();\n}", "title": "" }, { "docid": "d4d70d8d8c10387b54bd23f8f4db70fa", "score": "0.5700063", "text": "function openAddToolDialog() {\n // Start by getting list of existing tools for this user.\n new Ajax.Request(\"ExternalTools\", {\n parameters: {\n requestingMethod: \"ExternalTools.getToolListByOwner\",\n externalToolsAction: \"getToolListByOwner\"\n },\n onComplete: setupAddToolDialog,\n onException: function (request, exception) {\n throw(exception);\n }\n });\n}", "title": "" }, { "docid": "992e483730cfa02f0eae7a1a5ea8a396", "score": "0.5699592", "text": "function fnl_llamarPopupObjetivo()\n {\n var codDir = trim(document.getElementById(\"ch_codigo_directiva\").value);// 'codDir':'\"+codDir+\"',\n\n precargaALCON(\"Cargando...\",true,1,\"center\");//'fondo':{'zIndex':'10','opacidad':'85'},\n windowPopUpALCON(\"[{'opciones':{'botonCerrar':true,'width': '650','height':'450','url':'/SGDUNI/insertarObjetivoDirectivas.uni','urlVar':{'codDir':'\"+codDir+\"'},'precarga':'Cargando...','iniClose':true}}];\",false,function()\n {\n precargaALCON(\"\",true,0,\"center\");\n });\n }", "title": "" }, { "docid": "9641199352e3467251139c66bd7da2ab", "score": "0.5691141", "text": "function openDialog(dep, cls, sem, professor, res) {\n\t$(\"#myModal\").fadeIn(fadetime);\n\t//initial text on the \"save course button\"\n\tchrome.runtime.sendMessage({\n\t\tcommand: \"alreadyContains\",\n\t\tunique: uniquenum\n\t}, function (response) {\n\t\tif (response.alreadyContains) {\n\t\t\t$(\"#saveCourse\").text(\"Remove Course -\");\n\t\t} else {\n\t\t\t$(\"#saveCourse\").text(\"Add Course +\");\n\t\t}\n\t});\n\t//set if no grade distribution\n\tvar data;\n\tif (typeof res == 'undefined' || profname == \"\") {\n\t\tdata = [];\n\t} else {\n\t\tdata = res.values[0];\n\t}\n\tvar modal = document.getElementById('myModal');\n\tvar span = document.getElementsByClassName(\"close\")[0];\n\tmodal.style.display = \"block\";\n\n\t$(\"#title\").text(prettifyTitle());\n\tvar color = \"black\";\n\tif (status.includes(\"open\")) {\n\t\tcolor = \"#4CAF50\";\n\t} else if (status.includes(\"waitlisted\")) {\n\t\tcolor = \"#FF9800\"\n\t} else if (status.includes(\"closed\") || status.includes(\"cancelled\")) {\n\t\tcolor = \"#FF5722\";\n\t}\n\t$(\"#title\").append(\"<span style='color:\" + color + \";font-size:medium;'>\" + \" #\" + uniquenum + \"</>\");\n\n\tif (typeof profinit != \"undefined\" && profinit.length > 1) {\n\t\tprofinit = profinit.substring(0, 1);\n\t}\n\tvar name;\n\tif (profname == \"\") {\n\t\tname = \"Undecided Professor \";\n\t} else {\n\t\tname = prettifyName();\n\t}\n\t$(\"#profname\").text(\"with \" + name);\n\t//close button\n\tspan.onclick = function () {\n\t\t$(\"#myModal\").fadeOut(200);\n\t\t$(\"#snackbar\").attr(\"class\", \"\");\n\t}\n\t//set up the chart \n\tchart = Highcharts.chart('chart', {\n\t\tchart: {\n\t\t\ttype: 'column',\n\t\t\tbackgroundColor: ' #fefefe',\n\t\t\tspacingLeft: 10\n\t\t},\n\t\ttitle: {\n\t\t\ttext: null\n\t\t},\n\t\tsubtitle: {\n\t\t\ttext: null\n\t\t},\n\t\tlegend: {\n\t\t\tenabled: false\n\t\t},\n\t\txAxis: {\n\t\t\ttitle: {\n\t\t\t\ttext: 'Grades'\n\t\t\t},\n\t\t\tcategories: [\n\t\t\t\t'A',\n\t\t\t\t'A-',\n\t\t\t\t'B+',\n\t\t\t\t'B',\n\t\t\t\t'B-',\n\t\t\t\t'C+',\n\t\t\t\t'C',\n\t\t\t\t'C-',\n\t\t\t\t'D+',\n\t\t\t\t'D',\n\t\t\t\t'D-',\n\t\t\t\t'F'\n\t\t\t],\n\t\t\tcrosshair: true\n\t\t},\n\t\tyAxis: {\n\t\t\tmin: 0,\n\t\t\ttitle: {\n\t\t\t\ttext: 'Students'\n\t\t\t}\n\t\t},\n\t\tcredits: {\n\t\t\tenabled: false\n\t\t},\n\t\tlang: {\n\t\t\tnoData: \"The professor hasn't taught this class :(\"\n\t\t},\n\t\ttooltip: {\n\t\t\theaderFormat: '<span style=\"font-size:small; font-weight:bold\">{point.key}</span><table>',\n\t\t\tpointFormat: '<td style=\"color:{black};padding:0;font-size:small; font-weight:bold;\"><b>{point.y:.0f} Students</b></td>',\n\t\t\tfooterFormat: '</table>',\n\t\t\tshared: true,\n\t\t\tuseHTML: true\n\t\t},\n\t\tplotOptions: {\n\t\t\tbar: {\n\t\t\t\tpointPadding: 0.2,\n\t\t\t\tborderWidth: 0\n\t\t\t},\n\t\t\tseries: {\n\t\t\t\tanimation: {\n\t\t\t\t\tduration: 700\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tseries: [{\n\t\t\tname: 'Grades',\n\t\t\tdata: [{\n\t\t\t\ty: data[6],\n\t\t\t\tcolor: '#4CAF50'\n\t\t\t}, {\n\t\t\t\ty: data[7],\n\t\t\t\tcolor: '#8BC34A'\n\t\t\t}, {\n\t\t\t\ty: data[8],\n\t\t\t\tcolor: '#CDDC39'\n\t\t\t}, {\n\t\t\t\ty: data[9],\n\t\t\t\tcolor: '#FFEB3B'\n\t\t\t}, {\n\t\t\t\ty: data[10],\n\t\t\t\tcolor: '#FFC107'\n\t\t\t}, {\n\t\t\t\ty: data[11],\n\t\t\t\tcolor: '#FFA000'\n\t\t\t}, {\n\t\t\t\ty: data[12],\n\t\t\t\tcolor: '#F57C00'\n\t\t\t}, {\n\t\t\t\ty: data[13],\n\t\t\t\tcolor: '#FF5722'\n\t\t\t}, {\n\t\t\t\ty: data[14],\n\t\t\t\tcolor: '#FF5252'\n\t\t\t}, {\n\t\t\t\ty: data[15],\n\t\t\t\tcolor: '#E64A19'\n\t\t\t}, {\n\t\t\t\ty: data[16],\n\t\t\t\tcolor: '#F44336'\n\t\t\t}, {\n\t\t\t\ty: data[17],\n\t\t\t\tcolor: '#D32F2F'\n\t\t\t}]\n\t\t}]\n\t}, function (chart) { // on complete\n\t\tif (data.length == 0) {\n\t\t\t//if no data, then show the message and hide the series\n\t\t\tchart.renderer.text('Could not find distribution for this Instructor teaching this Course.', 100, 120)\n\t\t\t\t.css({\n\t\t\t\t\tfontSize: '20px',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\twidth: '300px',\n\t\t\t\t\tleft: '160px'\n\t\t\t\t})\n\t\t\t\t.add();\n\t\t\t$.each(chart.series, function (i, ser) {\n\t\t\t\tser.hide();\n\t\t\t});\n\t\t}\n\n\t}); // When clicks anywhere outside of the modal, close it\n\twindow.onclick = function (event) {\n\t\tif (event.target == modal) {\n\t\t\t$(\"#myModal\").fadeOut(fadetime);\n\t\t\t$(\"#snackbar\").attr(\"class\", \"\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8fc7fa6e6a0ee8c4678629dd42c46ba3", "score": "0.5690937", "text": "function popup(div_name, data, args, title, css_class){\n args['id'] = div_name; args['css'] = css_class; args['title'] = title;\n alert(\"error\")\n //new Dialog(data, args);\n}", "title": "" }, { "docid": "4812391a400391ee79a8e701716bc517", "score": "0.56887174", "text": "function newDepartment() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What is the name of the new department?\",\n name: \"name\",\n },\n ])\n .then((response) => {\n //console.log(titles, managers);\n\n connection.query(\n \"INSERT INTO department SET ?\",\n { name: response.name },\n (err, res) => {\n if (err) throw err;\n console.log(`Added ${response.name} department to the database`);\n // Call updateProduct AFTER the INSERT completes\n\n menuPrompt();\n }\n );\n });\n}", "title": "" }, { "docid": "90a3269da566ee6ce221bccb52a97b16", "score": "0.56883126", "text": "function setupCreateHostDialog(){\n $('div#dialogs').append('<div title=\"Create host\" id=\"create_host_dialog\"></div>');\n $('div#create_host_dialog').html(create_host_tmpl);\n $('#create_host_dialog').dialog({\n\t\tautoOpen: false,\n\t\tmodal: true,\n\t\twidth: 500\n\t});\n \n $('#create_host_dialog button').button();\n \n //Handle the form submission\n\t$('#create_host_form').submit(function(){\n if (!($('#name',this).val().length)){\n notifyError(\"Host name missing!\");\n return false;\n }\n\t\tvar host_json = { \"host\": { \"name\": $('#name',this).val(),\n\t\t\t\t\t\t\t\"tm_mad\": $('#tm_mad :selected',this).val(),\n\t\t\t\t\t\t\t\"vm_mad\": $('#vmm_mad :selected',this).val(),\n\t\t\t\t\t\t\t\"im_mad\": $('#im_mad :selected',this).val()}}\n\n\t\t//Create the OpenNebula.Host.\n\t\t//If it's successfull we refresh the list.\n Sunstone.runAction(\"Host.create\",host_json);\n\t\t//OpenNebula.Host.create({data: host_json, success: addHostElement, error: onError});\n\t\t$('#create_host_dialog').dialog('close');\n\t\treturn false;\n\t});\n \n}", "title": "" }, { "docid": "2ddfa870b04c1a52710dbb5166a66386", "score": "0.5687417", "text": "function showDialogProduct() {\n $('#d_product').dialog({\n title: 'Productos Seleccionados',\n width: 400,\n height: 280,\n closed: false,\n cache: false,\n modal: true\n })\n}", "title": "" }, { "docid": "f69f4e638d3ecbafc95034ca48ae6b5d", "score": "0.5687029", "text": "function init_dialog_act_tagger_guide() {\r\n // set scenario toolbar\r\n// $(\"#dialog_act_tagger_guide_task_manager\").empty();\r\n $(\"#dialog_act_tagger_guide_task_manager\").panel({ \r\n \"tools\": [{ \r\n \"iconCls\": \"icon-dialog_act_tagger_db\", \r\n \"handler\":function(){ \r\n dialog_act_tagger_open_upload_win();\r\n }\r\n }, \"-\", {\r\n \"iconCls\": \"icon-add\", \r\n \"handler\":function(){ \r\n \r\n }\r\n }, {\r\n \"iconCls\": \"icon-remove\", \r\n \"handler\":function(){ \r\n \r\n }\r\n }, \"-\", {\r\n \"iconCls\": \"icon-dialog_act_tagger_build_slu\", \r\n \"handler\":function(){ \r\n learn_slu(\"\");\r\n }\r\n }, \"-\", {\r\n \r\n \"iconCls\": \"icon-dialog_action_tagger_open_dialog_system\", \r\n \"handler\":function(){\r\n dialog_action_tagger_open_dialog_system();\r\n }\r\n }] \r\n });\r\n \r\n init_dialog_act_tagger_guide_refresh();\r\n}", "title": "" }, { "docid": "2d35bf93daa1e9288f48b972b0bc3e7d", "score": "0.5686894", "text": "constructor(dialog) {\n this.dialog = dialog;\n this.displayedColumns = ['firstname', 'lastname', 'phone', 'actions'];\n this.searchField = \"\";\n this.confirmDeleted = true;\n this.contactDataSource = new _contact_list_datasource__WEBPACK_IMPORTED_MODULE_5__[\"ContactDataSource\"]();\n }", "title": "" }, { "docid": "6d41c4574d0daba98436bb835261a8a3", "score": "0.56851256", "text": "function ManageContractValue() {\r\n GetContractValueFormData();\r\n $(\"#addEditContractValue\").dialog(\"open\");\r\n}", "title": "" }, { "docid": "5ad187e3a031abd419b308a40dbc342f", "score": "0.5682799", "text": "function createDept() {\n inquirer.prompt(createDeptQs).then(function(res) {\n connection.query(`INSERT INTO department (name) VALUES (\"${res.name}\")`);\n console.log(`${res.name} successfully added!`);\n openingSalvo();\n });\n}", "title": "" }, { "docid": "0a2bd5f4fe1a2e3f8d0a9e2ae5b24cf4", "score": "0.5678405", "text": "function callthisfn(mstype,fldtag,fmtoption,strTranSlno)\n{\n \t\n\t//alert(\"mstype \"+mstype + \"FldTag \"+fldtag+ \" FmtOpt \"+fmtoption);\n\tvar strURL = \"IC_Outgoing_FieldDescription.jsp?FldTag=\"+fldtag+\"&FmtOpt=\"+fmtoption+\"&Msgtype=\"+mstype+\"&strTranSlno=\"+strTranSlno;\n \tvar newwindow = window.open(strURL,\"Help\",\"Width=500px,Height=300px,status=no,resizable=false,scrollbars=yes,top=100px,left=200,help= no;\");\n \tnewwindow.focus();\n}", "title": "" }, { "docid": "7795e169fb623715898fec0b749ca8a2", "score": "0.5677738", "text": "function del7(){\r\n\t$('#del_dialog7').html(\"\");\r\n\t\tdel_s =$('#delt3').val();\r\n\t\t$('#del_dialog7').dialog({\r\n\t\tautoOpen: false,\r\n\t\tshow: 'highlight',\r\n\t\thide: 'highlight',\r\n\t\tbuttons: {\r\n\t\t\t'No': function() {\r\n\t\t\t\t$(this).dialog('close');\r\n\t\t\t},\r\n\t\t\t'Yes': function() {\r\n\t\t\t\tconf7();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\t\t$('#del_dialog7').dialog('open');\r\n\t\t$('#del_dialog7').load(\"scripts/processDeleteSupply.php?delt=\"+del_s);\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "f40ab1d5a619d0b53904d63a7ee89cf4", "score": "0.5676901", "text": "function OpenDialog_Ins_PermitDetails() {\n var title = \"\";\n var width = 810;\n var height = 500;\n if ($(\"#PositionShowDialog\").length <= 0) {\n $(\"body\").append('<div id=\"#PositionShowDialog\" style=\"display:none; overflow-x:hidden; overflow-y:scroll;\" title=\"' + title + '\"></div>');\n }\n\n $(\"#PositionShowDialog\").setTemplateURL('../../Templates/Ins_PermitDetails.htm');\n $(\"#PositionShowDialog\").setParam('NumLang', sys_NumLang); //sys_NumLang : trong file SystemConfig.js\\\n $(\"#PositionShowDialog\").setParam('Lang', sys_Lang);\n $(\"#PositionShowDialog\").processTemplate();\n \n $(\"#PositionShowDialog\").dialog({\n modal: true,\n width: width,\n height: height,\n resizable: false,\n //open: setTimeout('Change_TextareaToTinyMCE_OnPopup(\"#txt_InfoAlbumLang1\");Change_TextareaToTinyMCE_OnPopup(\"#txt_InfoAlbumLang2\");Change_TextareaToTinyMCE_OnPopup(\"#txt_InfoAlbumLang3\");', 2000), // Cần phải có settimeout,\n \n show: {\n effect: \"clip\",\n duration: 1000\n },\n hide: {\n effect: \"explode\",\n duration: 1000\n },\n\n buttons: {\n 'Cancel': function () {\n $(this).dialog(\"close\");\n\n },\n\n 'Save': function () {\n //tinymce.get('txt_InfoLang1').save();\n Ins_PermitDetails();\n\t\t\t\t\n $(this).dialog(\"close\");\n }\n },\n close: function () {\n //$(this).dialog(\"close\");\n }\n });\n}", "title": "" }, { "docid": "c78ad00b0593346f45ee5994033f7bfd", "score": "0.56749654", "text": "function ObtenerFormaAgregarTiempoEntrega()\n{\n $(\"#dialogAgregarTiempoEntrega\").obtenerVista({\n nombreTemplate: \"tmplAgregarTiempoEntrega.html\",\n despuesDeCompilar: function(pRespuesta) {\n $(\"#dialogAgregarTiempoEntrega\").dialog(\"open\");\n }\n });\n}", "title": "" }, { "docid": "aa926672c1de970e7f38ba482bfb6248", "score": "0.5673442", "text": "function DialogOK() {\n switch (mCurrentProgramMode) {\n case mProgramMode.INITIAL:\n window.history.back();\n break;\n case mProgramMode.CREATE:\n case mProgramMode.UPDATE:\n case mProgramMode.DELETE:\n LoadItemsFromServer(null, null, mStoreFieldsList, null, null, mRetrevalLimit);\n ToListSelectionView();\n break;\n case mProgramMode.READ:\n break;\n default:\n }\n}", "title": "" }, { "docid": "1623e7c96ed528d8cfcbedd364d1c74b", "score": "0.56689763", "text": "function newDept(){\n console.log('\\n=====Create New Department=====\\n');\n\n inquirer.prompt([\n {\n type: 'input',\n name: 'deptName',\n message: 'Name of new Department: ',\n validate: function(input){\n if(input){return true;}else{return false;}\n }\n },\n {\n type: 'input',\n name: 'overheadCost',\n message: 'What is the overhead cost of this new department?',\n validate: function(input){\n if(isNaN(input) === false){return true;}else{return false;}\n }\n }\n ]).then(function(answer){\n server.query('INSERT INTO Departments SET ?',[{DepartmentName: answer.deptName, OverheadCosts: answer.overheadCost,}], function(error, response){\n if(error) throw error;\n console.log(\"New department successfully added.\");\n supervisorMenu();\n });\n })\n}", "title": "" }, { "docid": "1a040b476ba108dd4d20cc10144d29dd", "score": "0.5667658", "text": "function myDisplayDialog(){\n\tvar myDialog;\n\twith(myDialog = app.dialogs.add({name:\"Is this MathType OK?\"})){\n\t\twith(dialogColumns.add()){\n\t\t\twith(borderPanels.add()){\n\t\t\t\tstaticTexts.add({staticLabel:\"Select:\"});\n var myRadioButtonGroup = radiobuttonGroups.add();\n with(myRadioButtonGroup){\n var myMathTypeRadio = radiobuttonControls.add\n ({staticLabel:\"YES\", checkedState:true});\n var myMathTypeRadio = radiobuttonControls.add\n ({staticLabel:\"NO\"});\n }\n\t\t\t}\n\t\t}\n\t}\n\tmyResult = myDialog.show();\n\tif (myResult == true){\n\t\tif (myRadioButtonGroup.selectedButton == 1){\n allowEdit();\n\t\t}\n\t\telse{\n// alert(\"No action taken. Proceed to next\");\n\n\t\t}\n \n\t\tmyDialog.destroy();\n\t}\n}", "title": "" }, { "docid": "f8e3659ec9e6c157ac185f24db91458b", "score": "0.5666538", "text": "function showDialog(name) {\r\n var json = get(\"?name=\" + name);\r\n var struct = JSON.parse(json);\r\n /* if GET request returns error we need to make POST with arguments\r\n * but we need to know the arguments so ve call Function&form=1 to get\r\n * JSON describing arguments and then we call showSeter which renders\r\n * html dialog for based on this JSON string */\r\n if (struct['status'] == \"ERROR_PARAM\") {\r\n struct = JSON.parse(get(\"?name=\" + name + \"&form=1\"));\r\n showForm(name, struct)\r\n showCallButton(name);\r\n setNaviRefresh(\"\");\r\n } else {\r\n showForm(name, struct);\r\n setNaviRefresh(\"showDialog(\\\"\" + name + \"\\\")\");\r\n }\r\n setNaviBack(\"location.href = '/\" + base_uri + \"'\");\r\n}", "title": "" }, { "docid": "5a7cc696359ad19876d73895db647276", "score": "0.56607926", "text": "function OpenDialog_Upd_PermitDetails(IDPermitDetails) {\n var title = \"\";\n var width = 810;\n var height = 500;\n if ($(\"#PositionShowDialog\").length <= 0) {\n $(\"body\").append('<div id=\"PositionShowDialog\" style=\"display:none; overflow-x:hidden; overflow-y:scroll;\" title=\"' + title + '\"></div>');\n }\n\n Fill_PermitDetails_Dialog_Upd(IDPermitDetails);\n\n $(\"#PositionShowDialog\").dialog({\n modal: true,\n width: width,\n //open: setTimeout('Change_TextareaToTinyMCE_OnPopup(\"#txt_InfoAlbumLang1\")', 2000), // Cần phải có settimeout,\n \n height: height,\n resizable: false,\n show: {\n effect: \"clip\",\n duration: 1000\n },\n hide: {\n effect: \"explode\",\n duration: 1000\n },\n\n buttons: {\n 'Đóng': function () {\n $(this).dialog('close');\n },\n 'Sửa': function () {\n\t //tinymce.get('txt_InfoLang1').save();\n Upd_PermitDetails(IDPermitDetails);\n \n $(this).dialog('close');\n }\n },\n close: function () {\n\n }\n });\n}", "title": "" }, { "docid": "9607aaa569f642146beedecd7e407fa4", "score": "0.5655149", "text": "function createAddDialog()\n{\n\taddDialog = $( \"#addProductModal\" ).dialog({\n\t autoOpen: false,\n\t autoHeight: true,\n\t width: 700,\n\t modal: true,\n\t buttons: {\n\t \n\t Cancel: function() {\n\t \t addDialog.dialog('close');\n\t }\n\t },\n\t close: function() {\n\t form[ 0 ].reset();\n\t addDialog.find('.ui-state-error').removeClass( \"ui-state-error\" );\n\t $('#formErrors').html('');\n\t $('formStatusMessage').html('');\n\t }\n\t });\n\t\n}", "title": "" }, { "docid": "dc211f9cbb85a28b7dd08d98e5d47eef", "score": "0.5654507", "text": "function del4(){\r\n\t$('#del_dialog4').html(\"\");\r\n\t\tdel =$('#deltAccts').val();\r\n\t\t$('#del_dialog4').dialog({\r\n\t\tautoOpen: false,\r\n\t\tshow: 'highlight',\r\n\t\thide: 'highlight',\r\n\t\tbuttons: {\r\n\t\t\t'No': function() {\r\n\t\t\t\t$(this).dialog('close');\r\n\t\t\t},\r\n\t\t\t'Yes': function() {\r\n\t\t\t\tconf4();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\t\t$('#del_dialog4').dialog('open');\r\n\t\t$('#del_dialog4').load(\"scripts/processDeleteAcct2.php?delt=\"+del);\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "089ea288cbf8a2b634d03c732b37a6ed", "score": "0.5646968", "text": "function createDialog(combat){\n if(combat == null || combat == undefined) return;\n\n return new Dialog({\n title : combat.id,\n content : updateDialog(combat),\n buttons : {\n roll :{\n label : \"Roll\", callback : (html) => execute_roll_from_form(html, combat),\n }\n }\n });\n}", "title": "" }, { "docid": "f3a73f794ced7666deed0fca2b4e8a8e", "score": "0.564564", "text": "function addDepartment() { \n inquirer.prompt([\n {\n name: \"name\",\n type: \"input\",\n message: \"What is the new department?\"\n }\n ])\n .then(function(res) {\n connection.query(\n \"INSERT INTO department SET ? \",\n {\n name: res.name\n \n },\n function(err) {\n if (err) throw err\n console.table(res);\n startPrompt();\n }\n )\n })\n }", "title": "" }, { "docid": "1386508e3ee439874461e0c7a6468c41", "score": "0.5635141", "text": "function popupPatientDynamicTaskAllocation(patientID) {\n // check if we are displaying a decision support triage window or a regular one\n var classes = \"source_dialog mhc_show_explanations\";\n var width = \"94%\";\n var maxHeight = 950;\n\n var assign_to_agent = $(\"#\"+patientID+\"patientCardBody input\")[0].checked;\n\n // assigning from the the human to the robot\n if (assign_to_agent) {\n var buttons_unblocked = {\n \"Wijs aan robot toe\": function() {\n // assign the patient to the robot\n reassignPatient(\"robot\", lv_agent_id, patientID)\n $(this).dialog('close');\n },\n \"Annuleren\": function() {\n // the patient was still assigned to the human, so closing the window is enough\n $(this).dialog('close');\n },\n }\n\n var buttons_blocked = {\n \"Annuleren\": function() {\n // the patient was still assigned to the human, so closing the window is enough\n $(this).dialog('close');\n },\n }\n\n $(\"#dialog-confirm\").html(gen_patient_popup_dynamic(lv_state[patientID], assign_patient_to=\"robot\"));\n $(\"#dialog-confirm\").dialog({\n resizable: true,\n position: {\n my: \"center top\",\n at: \"center top+10%\",\n of: window\n },\n zIndex: 1000,\n maxHeight: maxHeight,\n classes: {\n \"ui-dialog\": classes\n },\n width: width,\n modal: true,\n open: function(event, ui) {\n $(\".ui-dialog-titlebar-close\").hide();\n },\n buttons: (lv_state[patientID]['can_be_triaged_by_agent']) ? buttons_unblocked : buttons_blocked,\n });\n\n // assign from robot to person\n } else {\n // first assign the patient to the test subject (no timer), so the test subject has enough time to consider the choice\n reassignPatient(\"person\", lv_agent_id, patientID)\n\n // open de popup en vraag om confirmation\n $(\"#dialog-confirm\").html(gen_patient_popup_dynamic(lv_state[patientID], assign_patient_to=\"person\"));\n $(\"#dialog-confirm\").dialog({\n resizable: true,\n position: {\n my: \"center top\",\n at: \"center top+10%\",\n of: window\n },\n zIndex: 1000,\n maxHeight: maxHeight,\n classes: {\n \"ui-dialog\": classes\n },\n width: width,\n modal: true,\n open: function(event, ui) {\n $(\".ui-dialog-titlebar-close\").hide();\n },\n buttons: {\n \"Wijs aan mij toe\": function() {\n // the patient is already assigned to the test subject, so closing is enough\n $(this).dialog('close');\n },\n \"Annuleren\": function() {\n // assign back to the robot\n reassignPatient(\"robot\", lv_agent_id, patientID)\n $(this).dialog('close');\n },\n }\n });\n }\n return;\n}", "title": "" }, { "docid": "62bac1f70464b3fc4744f9ebeacb3d71", "score": "0.5633279", "text": "function modalOpenAddCustomer(dialog) {\r\n dialog.overlay.fadeIn('fast', function() {\r\n dialog.container.fadeIn('fast', function() {\r\n dialog.data.hide().slideDown('slow');\r\n });\r\n });\r\n\r\n}", "title": "" }, { "docid": "1044905a3341e37d41bb0091a674423b", "score": "0.56312215", "text": "function DialogClass(){\n this.fields = {};\n this.opt = {};\n this.enforceDirty = false;\n this.requireLogin = false;\n this.ajaxBusy = false;\n this.enterKeySubmit = false;\n}", "title": "" }, { "docid": "ab85da77a00cadb902ff44a1217d5217", "score": "0.56297433", "text": "function newDept() {\n inquirer.prompt([{ type: \"input\", name: \"newDeptname\", message: \"Please enter name of Department you wish to create\" },\n ])\n .then(response => {\n //learned the SET query from tutor\n let query = \"INSERT INTO department SET ?\";\n connection.query(query, { name: response.newDeptname }, function (err, res) {\n if (err) throw err;\n console.log(response);\n console.log(\"New Department added to System\");\n //executes query to show the updated list of departments\n deptList();\n\n //ends the connection\n connection.end();\n });\n });\n}", "title": "" }, { "docid": "0afebadac134ae0ce452623fd17db2a8", "score": "0.56275", "text": "function clickMenu_csCust011(menuObject){\n\n\tDialog.open({\n\t\tdiv : '#dialogContent', \n\t\turl : baseUrl+\"cs/csCust011?dialogName=dialogContent\",\n\t\ttitle : 'Hotel', \n\t\twidth : 935, \n\t\theight : 780, \n\t\tmodal : true\n\t});\n}", "title": "" }, { "docid": "e9dfb11798b5f89521c966f9fbc37949", "score": "0.5624348", "text": "function displayDialog(){\n var dialog = app.dialogs.add({name:\"Add Master To Every Nth Page\"});\n var masterSpreadNames = getMasterSpreadNames();\n with (dialog) {\n with (dialogColumns.add()) {\n with (borderPanels.add()) {\n with (dialogColumns.add()) {\n staticTexts.add({staticLabel:\"Master:\"});\n staticTexts.add({staticLabel:\"First page:\"});\n staticTexts.add({staticLabel:\"Interval:\"});\n }\n with (dialogColumns.add()) {\n var masterNameDropdown = dropdowns.add({stringList: masterSpreadNames, selectedIndex: 0, minWidth: 200});\n var firstPageField = integerEditboxes.add({editValue: 1, minimumValue: 1, maximumValue: pages.length});\n var intervalField = integerEditboxes.add({editValue: 2, minimumValue: 1, maximumValue: pages.length});\n }\n }\n }\n }\n var dialogReturn = dialog.show();\n if (dialogReturn == true) {\n var masterName = masterSpreadNames[masterNameDropdown.selectedIndex];\n var firstPage = firstPageField.editValue;\n var interval = intervalField.editValue;\n dialog.destroy();\n applyMasterToEveryNthPage(masterName, firstPage, interval);\n } else {\n dialog.destroy();\n }\n}", "title": "" }, { "docid": "fb6aa0d60ee92c927c11b995ab494506", "score": "0.5622625", "text": "function doDialog(d) {\n $uibModal\n .open({\n backdrop: true,\n keyboard: true,\n backdropClick: true,\n templateUrl: QDRTemplatePath + \"tmplClientDetail.html\",\n controller: \"QDR.DetailDialogController\",\n resolve: {\n d: function () {\n return d;\n }\n }\n })\n .result.then(function () { });\n }", "title": "" }, { "docid": "05d92134206cf91cab3119619acb66db", "score": "0.56210095", "text": "function del3(){\r\n\t$('#del_dialog3').html(\"\");\r\n\t\tdel =$('#deltAcct').val();\r\n\t\t$('#del_dialog3').dialog({\r\n\t\tautoOpen: false,\r\n\t\tshow: 'highlight',\r\n\t\thide: 'highlight',\r\n\t\tbuttons: {\r\n\t\t\t'No': function() {\r\n\t\t\t\t$(this).dialog('close');\r\n\t\t\t},\r\n\t\t\t'Yes': function() {\r\n\t\t\t\tconf3();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\t\t$('#del_dialog3').dialog('open');\r\n\t\t$('#del_dialog3').load(\"scripts/processDeleteAcct.php?delt=\"+del);\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "b1854123f2b5958344f55083ed0ea42f", "score": "0.5613257", "text": "function popup_horarios_agregar()\n{\n $('#cmb_docxsal_a option').remove();\n $('#cmb_cursoxsal_a option').remove();\n $('#cmb_cursoxsal_a').append('<option value=\"0\">CURSO</option>');\n cargar_docentes('');\n $('#cmb_docxsal_a').attr(\"disabled\", false);\n $('#cmb_cursoxsal_a').attr(\"disabled\", false);\n $('#cmb_dia_a').attr(\"disabled\", false);\n $('#popupbox_Agregar_horario').dialog({\n\n title: \"Agregar Horario\",\n modal: true,\n width: 500,\n height: 300,\n draggable:true,\n position: [\"center\",100],\n closeOnEscape : \"true\",\n buttons: \n {\n \"Agregar\": function() \n { \n if($(\"#cmb_docxsal_a\").val()!='0')//1\n {\n document.getElementById(\"cmb_docxsal_a\").style.border=\"\";\n if($(\"#cmb_cursoxsal_a\").val()!='0')//2\n {\n document.getElementById(\"cmb_cursoxsal_a\").style.border=\"\";\n if($(\"#cmb_dia_a\").val()!='0')//3\n {\n document.getElementById(\"cmb_dia_a\").style.border=\"\";\n horaReal=new Array();\n horaReal=calcularHora($(\"#cmb_hora_fin_a\").val(),$(\"#cmb_hora_inicio_a\").val());\n ///////////////////////para validar el horario\n if(horaReal[1]>=45)//preguntamos si los minutos son igual a una hora lectiva\n {\n document.getElementById(\"cmb_hora_inicio_a\").style.border=\"\";\n document.getElementById(\"cmb_hora_fin_a\").style.border=\"\";\n regHorario();//actualizar horarios/////////////////\n $( this ).dialog( \"close\" );\n cargar_horario_salon();\n\n }\n else if(horaReal[0]>=1)\n {\n document.getElementById(\"cmb_hora_inicio_a\").style.border=\"\";\n document.getElementById(\"cmb_hora_fin_a\").style.border=\"\";\n regHorario();//regsitrar horarios/////////////////\n $( this ).dialog( \"close\" );\n cargar_horario_salon();\n }\n else\n {\n document.getElementById(\"cmb_hora_inicio_a\").style.border=\"2px solid red\";\n document.getElementById(\"cmb_hora_fin_a\").style.border=\"2px solid red\";\n\n }\n /////////////////fin validar horario\n }\n else//3\n {\n document.getElementById(\"cmb_dia_a\").style.border=\"2px solid red\";\n\n }\n\n }\n else//2\n {\n document.getElementById(\"cmb_cursoxsal_a\").style.border=\"2px solid red\";\n\n }\n }\n else//1\n {\n document.getElementById(\"cmb_docxsal_a\").style.border=\"2px solid red\";\n\n }\n },\n \"Cancelar\": function() \n {\n $( this ).dialog( \"close\" );\n ocultar();\n document.getElementById(\"cmb_hora_inicio_a\").style.border=\"2px solid red\";\n document.getElementById(\"cmb_hora_fin_a\").style.border=\"2px solid red\";\n }\n },\n close: function() { \n document.getElementById(\"cmb_hora_inicio_a\").style.border=\"2px solid red\";\n document.getElementById(\"cmb_hora_fin_a\").style.border=\"2px solid red\";\n ocultar();\n } \n }); \n}", "title": "" }, { "docid": "0f980dee07cb895fe8d612ca7a3e8307", "score": "0.5605778", "text": "function showDialog(title,message,type,autohide,objId) {\n if(!type) {\n type = 'error';\n }\n var dialog;\n var dialogheader;\n var dialogclose;\n var dialogtitle;\n var dialogcontent;\n var dialogmask;\n if(!document.getElementById('dialog')) {\n dialog = document.createElement('div');\n dialog.id = 'dialog';\n dialogheader = document.createElement('div');\n dialogheader.id = 'dialog-header';\n dialogtitle = document.createElement('div');\n dialogtitle.id = 'dialog-title';\n dialogclose = document.createElement('div');\n dialogclose.id = 'dialog-close';\n dialogcontent = document.createElement('div');\n dialogcontent.id = 'dialog-content';\n dialogmask = document.createElement('div');\n dialogmask.id = 'dialog-mask';\n document.body.appendChild(dialogmask);\n document.body.appendChild(dialog);\n dialog.appendChild(dialogheader);\n dialogheader.appendChild(dialogtitle);\n dialogheader.appendChild(dialogclose);\n dialog.appendChild(dialogcontent);;\n dialogclose.setAttribute('onclick','hideDialog()');\n dialogclose.onclick = hideDialog;\n } else {\n dialog = document.getElementById('dialog');\n dialogheader = document.getElementById('dialog-header');\n dialogtitle = document.getElementById('dialog-title');\n dialogclose = document.getElementById('dialog-close');\n dialogcontent = document.getElementById('dialog-content');\n dialogmask = document.getElementById('dialog-mask');\n dialogmask.style.visibility = \"visible\";\n dialog.style.visibility = \"visible\";\n }\n dialog.style.opacity = 100;\n dialog.style.filter = 'alpha(opacity=100)';\n dialog.alpha = 0;\n var width = pageWidth();\n var height = pageHeight();\n var left = leftPosition();\n var top = topPosition();\n var dialogwidth = dialog.offsetWidth;\n var dialogheight = dialog.offsetHeight;\n //var topposition = top + (height / 3) - (dialogheight / 2);\n var oElm = (parent && parent.document && parent.document.getElementById('xform-iframe')) ?\n parent.document.getElementById('xform-iframe').contentWindow.document.getElementById(objId) :\n document.getElementById(objId);\n var topposition = Position.get(oElm).top;\n var leftposition = left + (width / 2) - (dialogwidth / 2);\n dialog.style.top = topposition + \"px\";\n dialog.style.left = leftposition + \"px\";\n dialogheader.className = type + \"header\";\n dialogtitle.innerHTML = title;\n dialogcontent.className = type;\n dialogcontent.innerHTML = replaceHTMLEntities(message);\n //var content = document.getElementById(WRAPPER);\n var content = document.documentElement ? document.documentElement : document.body;\n dialogmask.style.height = content.offsetHeight + 'px';\n dialog.timer = setInterval(\"fadeDialog(1)\", TIMER);\n if(autohide) {\n dialogclose.style.visibility = \"hidden\";\n window.setTimeout(\"hideDialog()\", (autohide * 1000));\n } else {\n dialogclose.style.visibility = \"visible\";\n }\n}", "title": "" }, { "docid": "ea0abdcc481090b80afd95aca3b528b3", "score": "0.56020933", "text": "async function genDept(connection) {\n// function genDept() {\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"deptChoice\",\n message: \"Department Management Options?\",\n choices: [\n \"View all departments\",\n \"Add department\",\n \"Update department\",\n \"Remove department\",\n // \"View total utilized budget of department\", \n \"Return to main menu\"\n ]\n }\n ]).then(userChoice => {\n console.log(userChoice);\n switch (userChoice.deptChoice) {\n case \"View all departments\":\n console.log(\"vd\");\n getDeptList(connection);\n break;\n console.log();\n \n case \"Add department\":\n console.log(\"ad\");\n addDepartment(connection);\n break;\n case \"Update department\":\n updateDepartment(connection);\n break;\n case \"Remove department\":\n removeDepartment(connection);\n break;\n case \"View total utilized budget of department\":\n viewDepartments(connection);\n break;\n // default:\n // console.log(\"Exitting Department Management Tool.\");\n // // init();\n // break;\n }\n })\n}", "title": "" }, { "docid": "e70b2e7334cc631aec5eb6cd063c4dd6", "score": "0.55991495", "text": "function gendialog(ev, act) {\n // Create even the element (w. unique id) to which to create dialog ?\n // var uniid = new Date().foo()+\"_\"+act.path; // No act.dialogid ?\n // Most dialogs have data ...\n var axopts = {params: null};\n if (act.pmaker) { axopts.params = act.pmaker(); } // TODO: pass ....\n if (ev.viewdata) { return showdialog(ev.viewdata); } // sync\n if (!act.url) { return; }\n axios.get(act.url).then(function (resp) {\n var d = resp.data; // data always passed \"raw\"\n if (!d) { return alert(\"No data from server for dialog !\"); }\n showdialog(d);\n })\n .catch(function (ex) { console.log(\"\"); });\n function showdialog(data) {\n if (!act.dialogid) { return alert(\"No dialog indicated (by 'dialogid')\"); }\n // Check existence of elem by act.dialogid\n var diael = document.getElementById(act.dialogid);\n if (!diael) { alert(\"No dialog by id:\" + act.dialogid); return; }\n rapp.templated(act.tmpl, data, act.dialogid);\n var dopts = {modal: true, width: 500, height: 200};\n console.log(\"Dialog.dataset\", diael.dataset);\n // Look for dialog size (XSxYS) in ... target elem (jev: this)\n if (diael.dataset && diael.dataset.dsize) {\n var m = diael.dataset.dsize.match(/(\\d+)x(\\d+)/);\n if (m) { dopts.width = m[1]; dopts.height = m[2]; }\n console.log(\"DOPTS(post-adjust):\", dopts );\n }\n //console.log(\"gendialog:TGT:\",ev.target);\n //console.log(\"gendialog:THIS:\",this); // this is Window\n //$(\"#\"+act.dialogid).html(out);\n $(\"#\"+act.dialogid).dialog(dopts);\n }\n // TODO: Make this into rapp. ...\n // Get \"raw\" DOM element where event being handled now took place.\n // This is expected to be used within event handler function\n // This should cover either case of (e.g. click event)\n // // \n // elem.addEventListener(\"click\", function (rawev) {})\n // // Type: jQuery.Event\n // $(elem).click(function (jqev) {});\n // \n function getevelem(anyev) {\n // Test this directly ?\n console.log(\"getevelem -> this: \" + this);\n if (anyev.originalEvent) { return anyev.originalEvent.target; } // Same as this in ev handler\n return anyev.target;\n }\n}", "title": "" }, { "docid": "7f25e3a687d986317033daa3d264f369", "score": "0.5591468", "text": "function saveDependency() {\r\nif (dojo.byId(\"dependencyRefIdDep\").value==\"\") return;\r\nloadContent(\"../tool/saveDependency.php\", \"resultDiv\", \"dependencyForm\", true,'dependency');\r\ndijit.byId('dialogDependency').hide();\r\n}", "title": "" } ]
75967aa17f312f60a4597efed70173b0
Creates a User object with passed arguments and saves it to the database
[ { "docid": "8dab36f269c190b03751f60480f4368b", "score": "0.0", "text": "async signupUser(_, { name, email, password, confirmPassword }, context) {\n var { valid, errors } = validateUserRegisterInput(\n email,\n password,\n confirmPassword\n ); // Determine if the information provided is valid for an email and matching passwords\n if (!valid) {\n throw new UserInputError(\"Errors\", { errors });\n }\n\n const checkUser = await User.findOne({ email });\n if (checkUser) {\n throw new UserInputError(\"Email already exists\", {\n errors: {\n email: \"A user with this email already exists\",\n },\n });\n }\n\n password = await bcrypt.hash(password, 12); // Hash out password\n\n const newUser = new User({\n name,\n email,\n password,\n friendIds: [],\n requesterIds: [],\n createdAt: new Date(),\n });\n\n const res = await newUser.save();\n\n const token = generateToken(res); // Create JWT token\n\n return { ...res._doc, id: res._id, token }; // Token passed, needs to be used as header in localhost\n }", "title": "" } ]
[ { "docid": "1d38c70df95730c218d95bf237837871", "score": "0.78520155", "text": "function createUser(user) {\n return User.create(user); //this inserts user in db\n\n \n }", "title": "" }, { "docid": "b8449e4f66e5936f0d3e3b6c747b9dd1", "score": "0.7804899", "text": "async createUser (parent, args, context, info) {\n let user = await new User(args).save()\n return user\n }", "title": "" }, { "docid": "acfac81395887ac81ca7078809c8dc4b", "score": "0.77393997", "text": "function createUser( tUser )\n {\n db.User.create( tUser ).then( onUserCreated );\n }", "title": "" }, { "docid": "50534ae7e42e89d6a6960263285b2aa7", "score": "0.76832044", "text": "function create(email,password) {\n\t// New user info\n\tvar newUser = new models.User({\n \t\"email\":email,\n \t\"password\":password\n \t});\n \tnewUser.save(function(err){\n if (err) { \n console.log(err); \n }\n });\n}", "title": "" }, { "docid": "d8dff6bfd39d3e91a2d841bfc8494259", "score": "0.75216913", "text": "function createUser() {\n /** set user object to userParam without the cleartext password */\n let user = _.omit(userParam, 'password');\n\n /** add hashed password to user object */\n user.hash = bcrypt.hashSync(userParam.password, 10);\n \n /** insert in table */\n db.users.insert(\n user,\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n\n deferred.resolve();\n });\n }", "title": "" }, { "docid": "67582969dcd74a211c0ebd0d9dc3ebde", "score": "0.74953324", "text": "function signup({ username, password, email, dateOfBirth, city }) {\n //create new user\n}", "title": "" }, { "docid": "275d3925c94ad7eb5dc879c325da2e44", "score": "0.7466855", "text": "create(data) {\n const user = new this.model(data);\n return user.save();\n }", "title": "" }, { "docid": "1fdf1c5fdf1c1552dac0aec85f25824b", "score": "0.7452281", "text": "addUser(root, args) {\n return User.build(args).save();\n }", "title": "" }, { "docid": "ad64284e4597b7ac37a9f978c6f4e862", "score": "0.7437253", "text": "function createNewUser (name, pass, email, callback) {\n User.create({\n username: name,\n password: pass,\n email: email\n })\n .then(callback);\n}", "title": "" }, { "docid": "88f1c9a89edb03271f9af91b17942fb5", "score": "0.743026", "text": "function signUp({ email, password, dateOfBirth, city, username}) {\n //create a new user\n}", "title": "" }, { "docid": "e064f8d1344b4e74ba0430b2aa40a435", "score": "0.74196655", "text": "function userCreate(firstName,lastName,userName,password,email,type,company,companyURL){\n const job = [{type,company,companyURL},{type,company,companyURL}];\n const userDetail = {firstName,lastName,userName,password,email,job};\n const user = new User(userDetail);\n return user.save();\n \n}", "title": "" }, { "docid": "79ee09a42ed9d21afeb4d979711d62d9", "score": "0.7410486", "text": "async saveUser () {\n\t\tthis.log('NOTE: Creating user under one-user-per-org paradigm');\n\t\tthis.userCreator = new UserCreator({\n\t\t\trequest: this,\n\t\t\tnrUserId: this.nrUserId,\n\t\t\texistingUser: this.user\n\t\t});\n\t\tthis.user = await this.userCreator.createUser(this.userData);\n\t}", "title": "" }, { "docid": "6f4162c02a5ec231d484b74d6a380bd2", "score": "0.7370325", "text": "newUser(req, res, next) {\n const { username, password } = req.body;\n\n const newUser = { username, password };\n\n // USE MODEL TO REGISTER A NEW USER\n User.addUser(newUser)\n .then((user) => {\n res.status(201).json({\n success: true,\n message: 'User registered',\n data: { id: user.id },\n });\n })\n .catch((err) => next(err));\n }", "title": "" }, { "docid": "cd59d61d06938b688e296d813cb8b405", "score": "0.7370136", "text": "function signup({username, password, email, dateOfBirth, city}) {\n\t// create new user\n\n}", "title": "" }, { "docid": "199926f1a2e445583b75910578d1921c", "score": "0.7353908", "text": "function createUser(user, res) {\n User.create(user, function (err, user) {\n if (!err) console.log('user saved successfully to database. email id: ' + user.email);\n });\n }", "title": "" }, { "docid": "d337f0afc170df9a26f577b8284e258c", "score": "0.7330376", "text": "function createUser() {\n\tvar user = new StackMob.User({\n\t\tusername : 'toucansam',\n\t\tpassword : 'fruitloops',\n\t\tage : 15,\n\t\tfavoriteflavors : [\"lemon\", \"blueberry\", \"prime rib\"]\n\t});\n\tuser.create({\n\t\tsuccess : function(model) { debugger;\n\t\t\tTi.API.info(JSON.stringify(model, null, 2));\n\t\t},\n\t\terror : function(model, response) { debugger;\n\t\t\tTi.API.error(model);\n\t\t\tTi.API.error(response)\n\t\t}\n\t});\n \n\tTi.API.info(StackMob.isOAuth2Mode());\n}", "title": "" }, { "docid": "9700cb23fd28aa19da4c5ecdd4f015fc", "score": "0.7278754", "text": "function create(httpContext) {\n\tvar userModel = new user.UserModel(),\n\t\tuserParams = httpContext.req.body.user;\n\n\tvar userEntity = {\n\t\tname: userParams.name,\n\t\temail: userParams.email,\n\t\tpassword: userParams.password\n\t};\n\n\tuserModel.addUser(userEntity, function(err, user) {\n\t\tif(err) {\n\t\t\tvar renderModel = new render.RenderModel(httpContext.user);\n\t\t\trenderModel.pushError(err);\n\n\t\t\thttpContext.res.render('signup', renderModel);\n\t\t} else {\n\t\t\tsessionController.signedIn(user, httpContext);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e9b639f66b0f761dec778b71bb06f66e", "score": "0.72578686", "text": "function signUp({username, password, email, dateOfBirth, city}) {\n\t// create new user\n}", "title": "" }, { "docid": "80cc01c8276c77345d9b8ef1b5eeea42", "score": "0.7252629", "text": "function createUser(req, res) {\n console.log(req.body)\n User.create(req.body, function(err, user) {\n if(err) {\n console.log(err)\n return res.status(500).json(err);\n }\n res.json(user);\n });\n}", "title": "" }, { "docid": "069198a8711d0860f671f11a631e4e68", "score": "0.72252023", "text": "async function newUser(user) {\n var saveUser = new User(user);\n await saveUser.save();\n}", "title": "" }, { "docid": "16f7c888fb0890d8f4b2155d2f6b2aaa", "score": "0.7196044", "text": "async createUser (data) {\n let user = new this.User(data);\n await user.save();\n return user;\n }", "title": "" }, { "docid": "f9a1c21bd16a81b63a8050c3dc6c38d5", "score": "0.71694905", "text": "function createUser(options) {\n return new User(options);\n }", "title": "" }, { "docid": "f9a1c21bd16a81b63a8050c3dc6c38d5", "score": "0.71694905", "text": "function createUser(options) {\n return new User(options);\n }", "title": "" }, { "docid": "27700d3bcb50fe12b6a68c795d7602f1", "score": "0.7164747", "text": "static async create({\n\t\tusername,\n\t\tpassword,\n\t\tfirst_name,\n\t\tlast_name,\n\t\temail,\n\t\tphoto_url = \"https://cdn3.vectorstock.com/i/1000x1000/21/62/human-icon-in-circle-vector-25482162.jpg\",\n\t\tis_admin = false,\n\t}) {\n\t\tconst hashedPW = await bcrypt.hash(password, BCRYPT_WORK_FACTOR);\n\t\tconst result = await db.query(\n\t\t\t`INSERT INTO users (username, password, first_name, last_name, email, photo_url, is_admin)\n VALUES ($1, $2, $3, $4, $5, $6, $7)\n RETURNING username, password, first_name, last_name, email, photo_url, is_admin`,\n\t\t\t[username, hashedPW, first_name, last_name, email, photo_url, is_admin]\n\t\t);\n\t\tconst user = result.rows[0];\n\n\t\tif (user === undefined) {\n\t\t\tconst err = new ExpressError(\"Could not create user\", 400);\n\t\t\tthrow err;\n\t\t}\n\t\treturn new User(user);\n\t}", "title": "" }, { "docid": "92f190934b382366cef376a8d8b4794e", "score": "0.71293896", "text": "function create(name , password) {\n new Users(\n {\n userName : name,\n passWord : password\n }\n)\n}", "title": "" }, { "docid": "0903c1563385e977eb6444b13cfb5236", "score": "0.71256006", "text": "function signup(username, password, email, dateOfBirth, city) {\n\t// create new user\n\n}", "title": "" }, { "docid": "b60f0dae9385399aa0cf7db8d150655a", "score": "0.71158594", "text": "function createUser(aUser, callback) {\n\t\t\n\tvar user = new User(aUser);\n\t// insert a new user to db\n\tuser.save(function (error, userObj) {\n\t\tif (error) {\n\t\t\t//fail to create a user\n\t\t\tcallback(error, userObj)\n\t\t}\n\t\telse {\n\t\t\t//User is inserted successfully\n\t\t\tcallback(null, userObj)\n\t\t}\n\t\t\n\t});\n\n}", "title": "" }, { "docid": "c5306e44eb4867e705e4d3fbb484c27f", "score": "0.71152043", "text": "function createUser(request, response) {\n var username = request.body.username;\n var password = request.body.password;\n var email = request.body.email;\n \n console.log(\"This is the username: \" + username);\n console.log(\"This is the password: \" + password);\n console.log(\"This is the email: \" + email);\n \n userModel.addUserToDb(username, password, email, function(error, result) {\n if (error) {\n response.status(400).json({success: false, data: error});\n } if (result == false) {\n response.status(200).json({success: false, data: result});\n } else {\n response.status(201).json({success: true, data: result});\n }\n });\n}", "title": "" }, { "docid": "0df2a4ad52b1c5f253d8f7f12d50f28b", "score": "0.71058345", "text": "function createUser (userData, name, cb) { User.createAndSaveInstance(userData, function(err, user) { users[name] = user; return cb(err); }); }", "title": "" }, { "docid": "82ea7bf5c6991d923d7313b1ee50e505", "score": "0.7099869", "text": "function createUser(req, res) {\n var avatar = gravatar.url(req.body.email,\n {\n s: '100', r: 'pg', d: 'mm', protocol: 'http'\n });\n const newUser = new User({\n name: req.body.name,\n email: req.body.email,\n password: req.body.password,\n avatar //If RHS and LHS has the same name then we can define single name like this which is called deconstruction eg avartar : avartar\n });\n saveDocument(newUser, res);\n}", "title": "" }, { "docid": "d4178dbba2d00555b40953b460b4d04b", "score": "0.7080714", "text": "function create(userInfo) {\n let user = new User(userInfo);\n return userDao.save(user);\n}", "title": "" }, { "docid": "fe5e03f7be7e148455d66f04b7c00acc", "score": "0.7070152", "text": "async function createUser(){\n\tawait User.destroy({where: {} });\n\tawait User.create({\n\t\temail: '[email protected]',\n\t\tpassword: 'password',\n\t\tfirstName: 'Curt',\n\t\tlastName: 'Morgan',\n\t\tphone: '999-999-9999',\n\t\tisActive: true,\n\t\tisHelper: false,\n\t\tskill: '',\n\t\taverageRating: 0,\n\t\tlocation: 'Seattle, WA'\n\t})\n}", "title": "" }, { "docid": "1e1abd7330e1a8ba4696fa25a17d0932", "score": "0.7066731", "text": "function createUser() {\n return new User({\n username: loginCtrl.username,\n password: loginCtrl.password\n });\n }", "title": "" }, { "docid": "c752e1741470efe49c3ec0daa9f6b841", "score": "0.70532274", "text": "function createNewUser(name, email) {\n\tvar user = new User({\n\t\tname: name,\n\t\temail: email\n\t})\n\n\treturn user.save()\n}", "title": "" }, { "docid": "f3cdc3cf560347781042c5712d43b36b", "score": "0.7020239", "text": "function createUser() {\n // check if user already exists \n User.filter({username: 'kenkang'}).run().then(function(result) {\n // if the user doesn't exist, save the default user\n if (result.length <= 0) {\n User.save([\n {firstName: \"Ken\", lastName: \"Kang\", username:\"kenkang\", password: createHash(\"bloomsky\")}\n ]).then(function(result) {\n console.log(\"RESULT\", result);\n }).error(function(error) {\n throw error; \n });\n }\n });\n}", "title": "" }, { "docid": "2786359702bf311d58ea2cdba083af77", "score": "0.70055705", "text": "async createUser(parent, args, { prisma }, info) {\n // Check if email exists.\n const emailTaken = await prisma.exists.User({ email: args.data.email })\n if (emailTaken) throw new Error('Email already in use.')\n\n // Hash the password.\n const password = await hashPassword(args.data.password)\n\n // Save info to database.\n const user = await prisma.mutation.createUser({\n data: {\n ...args.data,\n password\n }\n })\n\n // Return user and token\n return {\n user,\n token: generateToken(user.id)\n }\n }", "title": "" }, { "docid": "c1dfe2ae4b146597b93b96ff7ca97eff", "score": "0.69999444", "text": "function createUser(user, callback) {\n let newUser = new User({\n name \t: {\n first : user.first,\n last : user.last\n },\n year\t: user.year\n });\n\n // call the built-in save method to save to the database\n newUser.save(function(err) {\n if (err) {\n if (callback)\n callback(\"FAILED\", \"error creating user...\", null);\n return console.error(err);\n }\n });\n console.log(newUser.fullName + \" added to db...\");\n\n if (callback)\n callback(\"SUCCESS\", newUser.fullName + \" added to db...\", newUser);\n return newUser;\n}", "title": "" }, { "docid": "dc45d955a7e4136f67ee3c489165c733", "score": "0.6995304", "text": "function createUser(req, res) {\n const { email } = req.body;\n const { password } = req.body;\n const { firstname } = req.body;\n const { surname } = req.body;\n const { avatarImage } = req.body;\n const { phone } = req.body;\n const { signUpDate } = req.body;\n\n if (!email || !password || !firstname || !surname) {\n return res.status(400).send({ message: 'Missing params' });\n }\n\n // Checks if the user already exist\n User.findOne({ email }, (err1, userExist) => {\n if (err1) return res.status(500).send({ message: `Error finding user ${err1}` });\n if (userExist) return res.status(409).send({ message: 'User already exist' });\n\n // Create a new user\n const user = new User({\n email,\n password,\n firstname,\n surname,\n avatarImage,\n phone,\n signUpDate,\n });\n\n // Save the new user\n user.save((err2, newUser) => {\n if (err2) return res.status(500).send({ message: `Error saving user ${err2}` });\n if (!newUser) return res.status(500).send({ message: 'No user to save' });\n\n return res.status(200).send({ message: 'User saved', newUser });\n });\n });\n}", "title": "" }, { "docid": "4e5d0454fae5b17ff65155586e02fa7b", "score": "0.69840765", "text": "createUser(username, email) {\n \treturn this.db.one(`\n \t\tINSERT INTO accounts(\n \t\t\tusername,\n \t\t\temail)\n \t\tVALUES (\n \t\t\t$1,\n \t\t\t$2)\n \t\tRETURNING\n \t\t\tuser_id \t\tAS id,\n \t\t\tusername,\n \t\t\temail,\n \t\t\tcreated,\n \t\t\tchanged,\n \t\t\tis_deleted\n \t\t`, [username, email]);\n }", "title": "" }, { "docid": "c0a7ddf7cc19e1397d4f000b3be1cb4d", "score": "0.698", "text": "createUser(user) {\n return API.post(\"user\", \"/user\", {\n body: user\n });\n }", "title": "" }, { "docid": "e3dd7fa2c9adb2a10727b8dac5ac2da4", "score": "0.6976219", "text": "createUser (data, callback) {\n\t\tnew _UserCreator(this).createUser(data, callback);\n\t}", "title": "" }, { "docid": "c889906d1ddacb7fa595b7371e2f10fa", "score": "0.6974682", "text": "async function createUser(userData) {\n const user = new User(userData);\n return user.save();\n}", "title": "" }, { "docid": "d0747eab3e07342988dc7daea68e9f89", "score": "0.6974069", "text": "function addUser(obj){\n User.create(obj,(err,doc)=>{\n console.log(\"Usuario creado\");\n })\n}", "title": "" }, { "docid": "bdcebb9e37a55208b6a05d029a2bed45", "score": "0.6951426", "text": "function signup({ username, password, email, dateOfBirth, city }) {\n\t//code to create user, etc.\n}", "title": "" }, { "docid": "afe85229b754fd64a29909a8ef37bef0", "score": "0.69452924", "text": "createUser(user) {\n return Repository.post(`${resource}`, user);\n }", "title": "" }, { "docid": "1e99e6c10d779d7daa0eb862464ff251", "score": "0.69414407", "text": "create(req, res, next) {\n var user = req.body;\n var ctx = req.ctx;\n\n UserService.create(user, ctx, function(err, user){\n if (err) {\n err.setReq(req);\n return next(err);\n }\n\n res.status(201).json({user});\n });\n }", "title": "" }, { "docid": "9a2f55038c9ecdf3e27658b6fccef29d", "score": "0.69397753", "text": "function create(){\n const userModel = new UserModel({\n username:'Bob', password:md5('123'), type:'employee'\n })\n userModel.save(function (err, doc){\n console.log('create()', err, doc);\n })\n}", "title": "" }, { "docid": "819d1f28933a195a1d0e3d7d36cbe99c", "score": "0.69364226", "text": "static createUser(name, username, password, phone_number) {\n const salt = bcrypt.genSaltSync(saltRounds);\n const hash = bcrypt.hashSync(password, salt);\n return db\n .one(\n `\n insert into users \n (name, username, pwhash, phone_number)\n values \n ($1, $2, $3, $4)\n returning id`,\n [name, username, hash, phone_number]\n )\n .then(data => {\n const u = new User(data.id, name, username, hash, phone_number);\n return u;\n });\n }", "title": "" }, { "docid": "b7a9036b80cf94feba17f6d90dac6b05", "score": "0.69145936", "text": "createUser(firstName, username, role, cellphone, lastName, password, customer, email) {\n BasePage.clickElement(this.addUserButton)\n AddUserForm.fillAddUserForm(firstName, username, role, cellphone, lastName, password, customer, email)\n AddUserForm.saveUser()\n }", "title": "" }, { "docid": "0bf240baf7a28de509969c8b28077071", "score": "0.69120175", "text": "async create({request, response}) {\n const userData = request.only(['username', 'email', 'password', 'is_admin'])\n\n // search for an existing instance with given username or email \n if (await User.findBy('email', userData.email) || await User.findBy('username', userData.username))\n return response.unprocessableEntity()\n \n const user = await User.create(userData)\n return user\n }", "title": "" }, { "docid": "39ab5f1ce533d3785a480fc0da8394f6", "score": "0.6909356", "text": "async function addUser(user){\n console.log(\"Inside add new user\");\n var encryptedPwd = passwordHash.encryptPwd(user.pwd);\n console.log(\"encrypted password: \"+encryptedPwd);\n var newUser = new users({\"userId\": user.userid, \"password\": encryptedPwd, \"firstName\": user.fname, \"lastName\": user.lname, \"emailAddress\": user.email, \"address1\": user.address1, \"address2\": user.address2, \"city\": user.city, \"state\": user.state, \"zipcode\": user.zip, \"country\": user.country});\n console.log(newUser);\n await newUser.save();\n}", "title": "" }, { "docid": "56e1d4ca586396eca69c85d925ebbd41", "score": "0.6895868", "text": "createUser({ body }, res) {\n User.create(body)\n .then(dbUserData => res.json(dbUserData))\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "457574df3e2846eb9643bcc9622669b1", "score": "0.68951553", "text": "function createUser(req, res) {\n var user = new User();\n user.email = req.body.email;\n user.handle = req.body.handle;\n user.city = req.body.city;\n user.state = req.body.state;\n user.zip = req.body.zip;\n user.password = req.body.password;\n\n // FIXME...\n if (user.email == \"[email protected]\") user.isAdmin = true;\n\n user.save(function(err) {\n if (err) {\n // duplicate entry\n if (err.code == 11000)\n return res.json({ success: false, message: 'A user with that email address already exists! '});\n else\n return res.json(err);\n }\n\n // return a message\n res.json({\n message: \"Welcome to Film Avatar!\",\n user: {\n _id: user._id,\n email: user.email,\n handle: user.handle,\n city: user.city,\n state: user.state,\n zip: user.zip\n }\n });\n });\n}", "title": "" }, { "docid": "e9042b0d9a6899d97d932891011967bf", "score": "0.6893548", "text": "static async createNewUser(newUserObj) {\n const newUser = await User.create(newUserObj);\n return newUser;\n }", "title": "" }, { "docid": "8394345fa83b4744bdc4a8844c172de2", "score": "0.6893512", "text": "function _createUser(FirstName, LastName, Email, Role, Birthday, Sex, password, callback) // this creates a user\n{\n console.log(\"createUser1\")\n validate.valUser(Email, password, Role, function (data) {\n if (data) {\n console.log(\"create user 2\")\n User.createUser(FirstName, LastName, Email, Role, Birthday, Sex, password, function (data2) {\n callback(data2)\n })\n } else callback(false)\n })\n}", "title": "" }, { "docid": "a7780216490d53cd33f64fe39e06d7b8", "score": "0.6876716", "text": "function signUp (req, res) {\n const user = new User(req.body)\n // console.log(req.body)\n user.save((err, user) => {\n // console.log(err)\n if (err) return res.status(401).json({error: '/user creation error 1'})\n res.status(201).json({message: 'welcome! ', user})\n })\n}", "title": "" }, { "docid": "d85b70bea57d5e0df8f06604c3f343da", "score": "0.68632686", "text": "function addUser(user) {\n return UserModel.create(user);\n}", "title": "" }, { "docid": "6ea38f5cb7c79953352a73a5e950bf28", "score": "0.6843597", "text": "function create(req, res) {\n\t// make a single user -- create\n\tconsole.log('Creating a user')\n\tvar user = new User()\n\n\tuser.user_name = req.body.user_name\n\tuser.email = req.body.email\n\n\tuser.save(function(err){\n\t\tif(err){\n\t\t\tif(err.code == 11000){\n\t\t\t\treturn res.json({success: false, message: 'username already exists' })\n\t\t\t} else {\n\t\t\t\tres.send(err)\n\t\t\t}\n\t\t} else {\n\t\t\tres.json({success: true, message: 'User created, Wahey!'})\n\t\t}\n\t})\n}", "title": "" }, { "docid": "58ae78aed3b248bd6fff524f84179e60", "score": "0.6842556", "text": "static register(username, password, cb) {\n const newUser = new User({\n _id: new mongoose.Types.ObjectId(),\n username,\n password,\n todoList: [],\n });\n\n newUser.save()\n .then((res) => {\n cb(null, res);\n })\n .catch((err) => {\n cb(err, null);\n });\n }", "title": "" }, { "docid": "c6885f325512759a364bf229e4382ce2", "score": "0.68324864", "text": "function postUser(req, res) {\n //Creates a new user\n\n let newUser = new User(req.body);\n //Save it into the DB.\n newUser.save((err, user) => {\n if(err) {\n res.send(err);\n }\n else { //If no errors, send it back to the client\n res.json({message: \"User successfully added!\", user});\n }\n });\n}", "title": "" }, { "docid": "0198812d205182583f1677cecc301385", "score": "0.6831167", "text": "function create(req,res){\n\tconsole.log('Creating a user')\n\tvar user = new User(req.body.user)\n\n\tuser.user_name = req.body.user_name\n\tuser.email = req.body.email\n\tuser.age = req.body.age\n\n\tuser.save(function(err){\n\t\tif(err){\n\t\t\tif(err.code == 11000){\n\t\t\t\treturn res.json({success: false, message: 'username already exists' })\n\t\t\t} else {\n\t\t\t\tres.send(err)\n\t\t\t}\n\t\t}\n\t\tres.json({success: true, message: 'User created, Wahey!'})\n\t})\n}", "title": "" }, { "docid": "7e46aed17870899b4e4f6462063f3278", "score": "0.6817214", "text": "function create(req, res, next) {\n var newUser = new _userModel2['default'](req.body);\n newUser.provider = 'local';\n newUser.role = 'user';\n newUser.saveAsync().spread(function (user) {\n var token = _jsonwebtoken2['default'].sign({ _id: user._id }, _configEnvironment2['default'].secrets.session, {\n expiresIn: 60 * 60 * 5\n });\n res.json({ token: token });\n })['catch'](validationError(res));\n}", "title": "" }, { "docid": "453b7656c948a5839a99573c75682b7c", "score": "0.6816258", "text": "function insertUser(obj){\n \tconsole.log(obj)\n User.create(obj, (err, user) => {\n \tconsole.log('>>>>>>',err, user)\n if(err){\n return common.handleError(res, err);\n }\n let token = common.createJwt({email:req.body.email,role:req.body.role});\n return common.returnResponse(res,201,null,{token: token, role: req.body.role});\n })\n }", "title": "" }, { "docid": "4caf25b49ca7a6777f55d93c68d4da9e", "score": "0.68143743", "text": "createUser({ body }, res) { // destructure the body out of the 'req'\n\n User.create(body)\n .then(dbUserData => res.json(dbUserData))\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "52fb30975bc7249b8081156d8a04ab9f", "score": "0.6803206", "text": "function createUser() { \n\t\tvar user = new User(\n\t\t\t\t$usernameFld.val(),\n\t\t\t\t$passwordFld.val(),\n\t\t\t\t\"\",\n\t\t\t\t$firstNameFld.val(),\n\t\t\t\t$lastNameFld.val(),\n\t\t\t\t\"\",\n\t\t\t\t$roleFld.val(),\n\t\t\t\t$dobFld.val());\n\n\t\texists = false;\n\n\t\tfor(var u=0; u<allUsers.length; u++) {\n\t\t\tif(allUsers[u].username == $usernameFld.val()){\n\t\t\t\tconsole.log(\"User exists!!!\");\n\t\t\t\talert(\"User with the same username already exists!\");\n\t\t\t\texists = true;\n\t\t\t}\n\n\t\t\tif(!exists && u+1 == allUsers.length){\n\t\t\t\tuserService\n\t\t\t\t.createUser(user)\n\t\t\t\t.then(findAllUsers);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "16d0c1860d941b9402838e399ac89577", "score": "0.6802333", "text": "createUser({ body }, res){\n User.create( body )\n .then(dbUserData => res.json(dbUserData))\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "6f749b6d777225d839627676498815ce", "score": "0.67986196", "text": "function createUser(user) {\n return fetch(self.url, {\n // We are posting a new user to the server\n method: 'POST',\n // Headers tell the server what kind of data we're sending\n headers: {\n 'content-type': 'application/json'\n },\n // Provide the server with a string version of the actual user object\n body: JSON.stringify(user)\n // Once the user is posted into the database, we return its response to the controller\n }).then(function (response) {\n return response.json()\n })\n }", "title": "" }, { "docid": "eda8a9e5e0f9e64b56a594fa3af73159", "score": "0.67817706", "text": "function createUser(){\n\t\tbcrypt.genSalt(function(err, salt) {\n\t\t\tbcrypt.hash(password, salt, function(err, hash) {\n\t\t\t\tif (err) return console.log(err)\n\t\t\t\tvar user = {\n\t\t\t\t\tusername: name,\n\t\t\t\t\thash: hash,\n\t\t\t\t\tsalt: salt,\n\t\t\t\t\tgames: {chess:[],ships:[]},\n\t\t\t\t\tcurrentGame: \"\"\n\t\t\t\t}\n\n\t\t\t\tclient.set('user:' + name, JSON.stringify(user), function(err, reply) {\n\t\t\t\t\tif (err) return console.error(err)\n\t\t\t\t\treq.login(user, function(err){\n\t\t\t\t\t\tif (err) return console.error(err)\n\t\t\t\t\t\tres.redirect('/')\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t}", "title": "" }, { "docid": "1544cacc0c7a6855d3fdc390d2708ad1", "score": "0.67620164", "text": "static async createUser () {\n log('Create a Lineberty User')\n\n const url = '/users'\n\n return ApiLinebertyHandler.runRequest(url, 'POST')\n }", "title": "" }, { "docid": "d9a089ab159eba6b7353e48c7f374b2c", "score": "0.6742022", "text": "createNewUser(userData) {\n\t\treturn new Promise( async (resolve, reject) => {\n\t\t\tconst user = new User(userData);\n\t\t\tuser.save(function (err) {\n\t\t\t\tif (err) reject(err)\n\t\t\t\tresolve(user);\n\t\t\t})\n\t\t});\n\t}", "title": "" }, { "docid": "cf297ae40a920f92d666a82f1cd39d0f", "score": "0.67227465", "text": "createUser (req, res) {\n let reqUser = req.body\n\n // Wait for User to be successfully created and then return the User\n Promise.resolve(userDAL.insertUser(reqUser)).then((newUser) => {\n // Send result\n res.status(201).send(JSON.stringify(newUser))\n })\n }", "title": "" }, { "docid": "83bf630ffc5387eb93e4c292ef8078d2", "score": "0.6715988", "text": "async function createUser(req, res) {\n try {\n let userData = await User.create(req.body);\n global.apiResponder(req, res, 201, 'Successfully created driver.', userData);\n } catch (e) {\n console.log(e)\n global.apiResponder(req, res, 400, e);\n }\n}", "title": "" }, { "docid": "daaa2971943998040a2a70f3d5f7d9b6", "score": "0.6714832", "text": "function create(req, res) {\n const newUser = new User(req.body);\n newUser.provider = 'local';\n newUser.role = 'user';\n\n return newUser.save()\n .then((user) => {\n const token = jwt.sign(\n { _id: user._id },\n config.secrets.session,\n { expiresIn: 60 * 60 * 5 },\n );\n res.json({ token });\n })\n .catch(validationError(res));\n}", "title": "" }, { "docid": "af6872eef3913b5077613109326276e1", "score": "0.67067534", "text": "function createUser(user) {\n var url = \"/api/user\";\n return $http.post(url, user);\n }", "title": "" }, { "docid": "2afd8f11104c233095d4a01eb86e4534", "score": "0.66980517", "text": "async function makeUser() {\n // make sure all pre-reqs to creating user are met\n if (!verifiedUniqueEmail || !createdLoginInfo || !madeProfileUrl) { return; }\n\n // make the user db object\n try {\n await Users.create(user);\n return resolve(true);\n } catch (createUserError) {\n console.log(\"Error creating user: \", createUserError);\n return reject(\"Error creating user.\");\n }\n }", "title": "" }, { "docid": "4e5881dec430a118e9d65c874007a38b", "score": "0.668784", "text": "createUser(){\n program\n .command('create <name>')\n .alias('c')\n .description('Create new User')\n .action(name => {\n new User(name, 0);\n });\n }", "title": "" }, { "docid": "fa6ccf22fb99276bf036a4a378563e94", "score": "0.66750133", "text": "function create(newUser) {\n var deferred = q.defer();\n\n UserModel.create(newUser, function(err, newUser) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(newUser);\n }\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "0ed08546f6659e0a2ec9f02ae3c8a6c1", "score": "0.6667357", "text": "function signUpNewUser() {\n\t\tauth.createUserWithEmailAndPassword(email, password)\n\t\t\t.then(user => {\n\t\t\t\tconsole.log('User account created & signed in!');\n\t\t\t\twriteUserData(user.user.uid);\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tif (error.code === 'auth/email-already-in-use') {\n\t\t\t\t\tconsole.log('That email address is already in use!');\n\t\t\t\t}\n\t\t\t\tif (error.code === 'auth/invalid-email') {\n\t\t\t\t\tconsole.log('That email address is invalid!');\n\t\t\t\t}\n\t\t\t\tconsole.error(error + ' ' + email + ' ' + firstName + ' ' + lastName);\n\t\t\t});\n\t}", "title": "" }, { "docid": "79405b1454be4d4f4f1805a3669494db", "score": "0.6664107", "text": "function addUser(req, res) {\n if (!req.body.username || !req.body.password || !req.body.type) {\n res.status(403).end();\n }\n\n const newUser = new User(req.body);\n\n // Let's sanitize inputs and hash password\n bcrypt.genSalt(10, (err, salt) => {\n bcrypt.hash(sanitizeHtml(newUser.password), salt, (err, hash) => {\n newUser.password = hash;\n newUser.save((err, saved) => {\n if (err) {\n res.status(500).send(err);\n }\n res.json({\n user: saved,\n });\n });\n })\n })\n}", "title": "" }, { "docid": "92d8458faf01e7c2c67eba033b7b0991", "score": "0.66624576", "text": "createUser(param, options) {\n return this.api.createUser(param.body, param.activate, param.provider, param.nextLogin, options).toPromise();\n }", "title": "" }, { "docid": "63273e9e620304dabfe6864af14c4ecb", "score": "0.66619486", "text": "post(req, res) {\n const newUser = new User(req.body);\n newUser.createdAt = new Date();\n\n newUser.save((err, user) => {\n if (err) {\n // Renders back the signup page on error (including validation error)\n return res.render('users/signup', {\n error: err,\n csrfToken: req.csrfToken(),\n // Sends back the new user info for restoring valid input back\n user: newUser\n });\n }\n\n // Log in the new user on success\n // Redirect to /tasks\n req.login(user, err => {\n if (err) logger.error(err);\n return res.redirect('/tasks');\n });\n });\n }", "title": "" }, { "docid": "470f2440adcbdf74d546317244bb4fff", "score": "0.6658723", "text": "function create_user(fname, lname, phone, email, pwd, callback) {\n var mysqlTimestamp = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss');\n\n db.query(\"INSERT INTO Users(firstname, lastname, phonenumber, email, createdAt) VALUES (?, ?, ?, ?, ?)\", [fname, lname, phone, email, mysqlTimestamp],\n function(err,rows,fields) {\n if(err) {\n return callback(err);\n }\n }\n )\n\t\n db.query(\"INSERT INTO password(email, password) VALUES (?, ?)\", [email, pwd], \n function(err,rows,fields) {\n if(err) {\n return callback(err);\n }\n }\n )\n\n callback();\n}", "title": "" }, { "docid": "7b85e821ffb7b2e0479c30b0cf0eca50", "score": "0.66545385", "text": "function createUser(userObj) {\n var deferred = $.Deferred();\n rootRef.createUser(userObj, function (err) {\n\n if (!err) {\n deferred.resolve();\n } else {\n deferred.reject(err);\n }\n\n });\n\n return deferred.promise();\n }", "title": "" }, { "docid": "ab830dd07a75eeda7baa44f4775d9758", "score": "0.66523504", "text": "addUser(handle, first_name, last_name, school, email, password, img, status, code, subscription, major){\n var UserDB = mongoose.model('UserDB',userDBSchema);\n var user =new UserDB({handle:handle,first_name: first_name, last_name: last_name,\n school: school, email: email, password: password, img: img, activationCode: code,\n theme:'bg-dark', rating:0, status:status, subscription:subscription, StripeId: \"none\", Major:major });\n return user.save();\n }", "title": "" }, { "docid": "88819d9b60f590fd65b7c5b88facbec4", "score": "0.6650241", "text": "createUser({ body }, res) {\n User.create({\n username: body.username,\n email: body.email\n })\n .then(dbUserData => res.status(200).json(dbUserData))\n .catch(err => {\n console.log(err);\n res.status(500).json(err);\n });\n }", "title": "" }, { "docid": "dacfa1c31c34513baf38af28592bb25a", "score": "0.6647408", "text": "function createUser() {\n\n var user= $(\"#usernameFld\").val();\n var pass= $(\"#passwordFld\").val();\n var first= $(\"#firstNameFld\").val();\n var last= $(\"#lastNameFld\").val();\n var role= $(\"#roleFld\").val();\n\n var userObj = new User(\"\",user,pass,first,last,role);\n\n var response = userService.createUser(userObj);\n\n\n if(response!='success')\n {\n\n infoMsgs(response);\n }\n else{\n\n $(\"tbody\").empty();\n findAllUsers()\n infoMsgs(\"SUCCESSFULLY ADDED\");\n $(':input').val('');\n\n }\n\n\n $(\"#usernameFld\").removeAttr(\"readonly\");\n\n }", "title": "" }, { "docid": "f5ffe397c69b1eeef83da164242646d5", "score": "0.6645063", "text": "function createNewUser(username, password, vPassword){\n if(!(password === vPassword)){\n vm.error = \"Non-Matching Passwords\";\n return null;\n }\n var newUser = {_id: \"444\", username: username, password: password}\n UserService.createUser(newUser);\n $location.url(\"/user/\" + newUser._id);\n }", "title": "" }, { "docid": "2105845f820174f2a0d7138b1040f0e7", "score": "0.66399276", "text": "async signup (parent, args, { SECRET_KEY }, info) {\n const password = await bcrypt.hash(args.password, 10)\n let newUser = Object.assign({}, args, { password })\n let user = await new User(newUser).save()\n const { _id } = user\n const token = jwt.sign({ userId: _id }, SECRET_KEY)\n return { user, token }\n }", "title": "" }, { "docid": "caa79ed231a098e81d07c68d0501b278", "score": "0.6637557", "text": "async function create(userParam) {\n if (!validator.isAscii(userParam.username) || !validator.isAscii(userParam.password)) {\n return null;\n }\n // validate\n if (await user.findOne({where: {username: userParam.username}})) {\n throw 'Username \"' + userParam.username + '\" is already taken';\n }\n let userToCreate = userParam;\n\n\n // hash password\n if (userToCreate.password) {\n userToCreate.hash = bcrypt.hashSync(userParam.password, 10);\n }\n userToCreate.id = uuidv4();\n\n\n // save user\n await user.create(userToCreate);\n\n // add roles\n for (let i = 0; i < userParam.roles.length; i++) {\n let userRoleToCreate = {\n id: uuidv4(),\n userId: userToCreate.id,\n roleId: userParam.roles[i]\n };\n await userRole.create(userRoleToCreate)\n }\n}", "title": "" }, { "docid": "5a5ac24c1fe3c1d3b8f38d7224a5cee6", "score": "0.66347265", "text": "create(req, res) {\n return User.create({\n cpf: '123.456.789-10',\n name: req.body.name,\n email: '[email protected]',\n phone: '912345678',\n monthlyIncome: 900\n })\n .then(user => res.status(201).send(user))\n .catch(error => res.status(400).send(error));\n }", "title": "" }, { "docid": "28d29bf754093e5b6e75534932a8fadd", "score": "0.66283476", "text": "async store(req, res) {\n const newUser = new User(req.body);\n\n try {\n const result = await newUser.save();\n res\n .status(200)\n .json({ message: \"user was inserted successfully!\", user: result });\n } catch (error) {\n res.status(500).json({\n statusCode: 500,\n error: error.message,\n });\n }\n }", "title": "" }, { "docid": "bacf66b346267919cfaa25005d46fa3f", "score": "0.6625772", "text": "async createUser(parent, args, { prisma }, info) {\n if (args.data.password.length < 8) {\n throw new Error(\"Password must be 8 characters or longer.\");\n }\n\n // Bcrypt's second argument is a salt\n // A salt is a random series of characters that are hashed along\n // with the string you are hashing. It is more secure.\n const password = await bcrypt.hash(args.data.password, 10);\n const user = await prisma.mutation.createUser({\n data: {\n ...args.data,\n password,\n },\n });\n\n return {\n user,\n // first argument can be anything\n token: jwt.sign({ userId: user.id }, \"thisisasecret\"),\n };\n }", "title": "" }, { "docid": "ded9f175903624a8b3eeb53a6bf621dd", "score": "0.6625643", "text": "function signupNew({ username, password, email, dateOfBirth, city }) {\n //create new user\n console.log(username);\n}", "title": "" }, { "docid": "8327fbd322c842717af55a1c856745e4", "score": "0.6625302", "text": "function createUser(name, login, password) {\n\tUser.create({name:name, login:login, password:password}, function(err, user) {\n\t\tif (err)\n\t\t\tconsole.log(err);\n\t\telse\n\t\t\tconsole.log(\"-- User \" + name + \" inserted.\");\n\n\t\toperations++;\n\t});\n}", "title": "" }, { "docid": "7c636b9ec45cb4f694c772930b15f156", "score": "0.662121", "text": "function insertNewUser(username,password,email) {\n var stmt = db.prepare(\"INSERT INTO users (username, password, email) VALUES (?,?,?)\");\n stmt.run(username,password,email);\n stmt.finalize();\n}", "title": "" }, { "docid": "0ae86f94299af1aa16c59085641608a9", "score": "0.6620583", "text": "function postUser(request, response) {\n\t// create a user instance with the parameters\n\tlet newUser = new User(request.body)\n\n\tnewUser.save()\n\t\t.then(user => {\n\t\t\tresponse.json({\n\t\t\t\tmessage: 'Usuario creado con exito'\n\t\t\t})\n\t\t\tresponse.end()\n\t\t})\n\t\t.catch(error => {\n\t\t\tlet message = ''\n\t\t\tif(error.code === 11000) {\n\t\t\t\tmessage = 'El nombre de usuario ya existe'\n\t\t\t} else {\n\t\t\t\tfor(let property in error.errors) {\n\t\t\t\t\tif(error.errors.hasOwnProperty(property)) {\n\t\t\t\t\t\tmessage += error.errors[property].message + ','\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tresponse.status(422).send({ message: message.replace(/(^,)|(,$)/g, \"\") })\n\t\t\tresponse.end()\n\t\t})\n}", "title": "" }, { "docid": "f944a0777e9ed61617c9a6a8a708e15b", "score": "0.65917015", "text": "function create_user(name, sub) {\r\n var key = datastore.key('USER'); // Make key needed to input entity in datastore\r\n const new_user = {\"name\": name, \"sub\": sub}; // Makes attributes for entity\r\n return datastore.save({\"key\": key, \"data\": new_user})\r\n .then( () => {return key}); // Save entity in datastore and then return its key\r\n}", "title": "" }, { "docid": "f092fbff3686b1c21f278b0afd2b914b", "score": "0.6588589", "text": "function newUser(req, res) {\n var account_lname = req.body.account_lname;\n var account_fname = req.body.account_fname;\n var account_email = req.body.account_email;\n var account_password = req.body.account_password;\n\n accountModel.createNewUser(\n account_lname,\n account_fname,\n account_email,\n account_password,\n function(error, results) {\n res.json(results);\n }\n );\n}", "title": "" }, { "docid": "b3f0f6bc9d2c132c204fd7f2c9da9d2f", "score": "0.65769047", "text": "createUser({ body }, res) { // destructuring body\n User.create(body) // create is a Mongoose method\n .then(dbData => res.json(dbData))\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "b8970fb766cdc29e89ab6fca07ded620", "score": "0.65746605", "text": "function create(req, res, next) {\n if (!req.body.password) {\n return res.status(422).send('Missing required fields');\n }\n User\n .create(req.body)\n .then(function(user) {\n res.json({\n success: true,\n message: 'Successfully created user.',\n data: {\n email: user.email,\n id: user._id\n }\n });\n }).catch(function(err) {\n if (err.message.match(/E11000/)) {\n err.status = 409;\n } else {\n err.status = 422;\n }\n next(err);\n });\n}", "title": "" }, { "docid": "5f640d6eb07f6add56f85362ac7072de", "score": "0.6564755", "text": "function createUser(userData){\n return $http({\n method: 'POST',\n url: '/createUser',\n headers: { 'Content-Type': 'application/json'},\n data: userData\n })\n .then(function(res){\n console.log(\"Successfully created user\");\n })\n }", "title": "" } ]
2637a6d7df872189a46e657d448c1d3b
Here is where we "activate" the GridPanel. We have decided that the element with class "hospitaltarget" is the element which can receieve drop gestures. So we inject a method "getTargetFromEvent" into the DropZone. This is constantly called while the mouse is moving over the DropZone, and it returns the target DOM element if it detects that the mouse if over an element which can receieve drop gestures. Once the DropZone has been informed by getTargetFromEvent that it is over a target, it will then call several "onNodeXXXX" methods at various points. These include: onNodeEnter onNodeOut onNodeOver onNodeDrop We provide implementations of each of these to provide behaviour for these events.
[ { "docid": "16e09a281e1a4bc59e9ebe7a235fc154", "score": "0.64523923", "text": "function initializeHospitalDropZone(g) {\n g.dropZone = new Ext.dd.DropZone(g.getView().scroller, {\n\n// If the mouse is over a target node, return that node. This is\n// provided as the \"target\" parameter in all \"onNodeXXXX\" node event handling functions\n getTargetFromEvent: function(e) {\n return e.getTarget('.hospital-target');\n },\n\n// On entry into a target node, highlight that node.\n onNodeEnter : function(target, dd, e, data){\n Ext.fly(target).addClass('hospital-target-hover');\n },\n\n// On exit from a target node, unhighlight that node.\n onNodeOut : function(target, dd, e, data){\n Ext.fly(target).removeClass('hospital-target-hover');\n },\n\n// While over a target node, return the default drop allowed class which\n// places a \"tick\" icon into the drag proxy.\n onNodeOver : function(target, dd, e, data){\n var rowIndex = g.getView().findRowIndex(target);\n var h = g.getStore().getAt(rowIndex);\n\n //if (h.data.revassignment[data.patientData.name] >= 0)\n //\treturn false ;\n\n return Ext.dd.DropZone.prototype.dropAllowed;\n },\n\n// On node drop, we can interrogate the target node to find the underlying\n// application object that is the real target of the dragged data.\n// In this case, it is a Record in the GridPanel's Store.\n// We can use the data set up by the DragZone's getDragData method to read\n// any data we decided to attach.\n onNodeDrop : function(target, dd, e, data){\n var rowIndex = g.getView().findRowIndex(target);\n var h = g.getStore().getAt(rowIndex);\n var targetEl = Ext.get(target);\n\n\t\t\tvar sel = data.selections ;\n var org = data.patientData.ORG ;\n var dest = data.patientData.DEST ;\n var resvids = [] ;\n for(i=0;i<sel.length;i++){\n \tresvids[i] = sel[i].data.RESERVATIONID ;\n }\n\n \t\tassignroute() ;\n\n \tfunction assignroute () {\n\t\t\t\tvar acreg = h.data.ACREG ;\n\t\t\t\tEditorBean.assignMultiFleetAtEnd(acreg,resvids,function(retval, e) {\n\t\t\t\t\tupdateFleetAssignment(retval, e, h, rowIndex);\n\t\t\t\t}) ;\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\t// remove a port from a route\n\t\t\t// port = data.patientData.name\n function removeroute () {\n\t\t\t var NOT_ASSIGNED ;\n\t\t\t\tvar port1 ;\n\t\t\t\tvar port2 ;\n \tvar hqidx = h1.data.revassignment[data.patientData.DEST] ;\n \tvar oldassignment = h1.data.assignment ;\n\n \th1.data.revassignment = null ;\n \th1.data.assignment = null ;\n\n \toldassignment.splice (hqidx, 1) ;\n \t// rebuild revassignment\n \tvar revassignment = [] ;\n \tvar newassignment = [] ;\n\t var startport = \"SPG\" ;\n\n \tfor (var i=0; i<oldassignment.length; i++) {\n \t\trevassignment[oldassignment[i].data.DEST] = i ;\n \t\tnewassignment[i] = oldassignment[i] ;\n\n\t \tif (i<h.data.assignment.length-1)\n\t \t\tstartport = oldassignment[i].data.DEST ;\n \t}\n\n \toldassignment = null ;\n\n \th1.data.assignment = newassignment ;\n \th1.data.revassignment = revassignment ;\n\n \th1.commit () ;\n }\n return true;\n }\n });\n}", "title": "" } ]
[ { "docid": "c449f57fa2fa0e90ee55510c8e05744b", "score": "0.60423344", "text": "dropEvent(e) {\n if (this.editMode) {\n var target = this.activeItem;\n if (this.__dragTarget) {\n target = this.__dragTarget;\n }\n // support global hax store target\n if (\n window.HaxStore &&\n window.HaxStore.ready &&\n window.HaxStore.instance.__dragTarget\n ) {\n target = window.HaxStore.instance.__dragTarget;\n window.HaxStore.instance.__dragTarget = null;\n }\n setTimeout(() => {\n let children = this.querySelectorAll(\n \".hax-mover, .hax-hovered, .hax-moving, .grid-plate-active-item\"\n );\n // walk the children and apply the draggable state needed\n for (var i in children) {\n if (typeof children[i].classList !== typeof undefined) {\n children[i].classList.remove(\n \"hax-mover\",\n \"hax-hovered\",\n \"hax-moving\"\n );\n }\n }\n for (var j = 1; j <= this.columns; j++) {\n if (this.shadowRoot.querySelector(\"#col\" + j) !== undefined) {\n this.shadowRoot\n .querySelector(\"#col\" + j)\n .classList.remove(\"hax-mover\", \"hax-hovered\", \"hax-moving\");\n }\n }\n // support hax and dropping back inside grid plate\n if (window.HaxStore && window.HaxStore.ready) {\n let childrenHAX = window.HaxStore.instance.activeHaxBody.children;\n // walk the children and apply the draggable state needed\n for (var i in childrenHAX) {\n if (childrenHAX[i].classList) {\n childrenHAX[i].classList.remove(\n \"hax-mover\",\n \"hax-hovered\",\n \"hax-moving\"\n );\n }\n }\n }\n // sort the children by slot to ensure they are in the correct semantic order\n this.__sortChildren();\n }, 100);\n // edge case, something caused this to drag and it tried to do\n // itself into itself\n if (target === this) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n return false;\n }\n var local = e.target;\n // if we have a slot on what we dropped into then we need to mirror that item\n // and place ourselves below it in the DOM\n if (\n target &&\n typeof local !== typeof undefined &&\n local.getAttribute(\"slot\") != null &&\n local.parentNode &&\n target !== local\n ) {\n target.setAttribute(\"slot\", local.getAttribute(\"slot\"));\n local.parentNode.insertBefore(target, local);\n // ensure that if we caught this event we process it\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n // special case for dropping on an empty column or between items\n // which could involve a miss on the column\n else if (\n target &&\n local.tagName === \"DIV\" &&\n local.classList.contains(\"column\")\n ) {\n var col = local.id.replace(\"col\", \"\");\n target.setAttribute(\"slot\", \"col-\" + col);\n this.appendChild(target);\n // ensure that if we caught this event we process it\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n setTimeout(() => {\n // support for hax\n if (\n window.HaxStore &&\n window.HaxStore.ready &&\n window.HaxStore.instance\n ) {\n if (\n target &&\n target.parentNode &&\n target.parentNode.tagName === \"GRID-PLATE\"\n ) {\n window.HaxStore.write(\"activeNode\", target, this);\n window.HaxStore.write(\n \"activeContainerNode\",\n target.parentNode,\n this\n );\n setTimeout(() => {\n window.HaxStore.instance.activeHaxBody.positionContextMenus(\n target,\n target.parentNode\n );\n }, 10);\n }\n }\n this.positionArrows(null);\n this.activeItem = null;\n }, 0);\n }\n }", "title": "" }, { "docid": "163c0ac4930ee6a72b52d803790aa93c", "score": "0.5908702", "text": "function Dropzones__prepareDropTarget(target) {\n\t\t// get/create target dropzone\n\t\tvar column, dropzone;\n\t\tif (target.classList.contains('dropcolumn')) {\n\t\t\tcolumn = target;\n\t\t\tif (target.hasChildNodes() === false) {\n\t\t\t\t// we need a dropzone to act as the target\n\t\t\t\tdropzone = document.createElement('div');\n\t\t\t\tdropzone.classList.add('dropzone');\n\t\t\t\tcolumn.appendChild(dropzone);\n\n\t\t\t\t// also, will need drop-columns around it\n\t\t\t\tvar col_left = document.createElement('td');\n\t\t\t\tcol_left.classList.add('dropcolumn');\n\t\t\t\tcolumn.parentNode.insertBefore(col_left, column);\n\t\t\t\tvar col_right = document.createElement('td');\n\t\t\t\tcol_right.classList.add('dropcolumn');\n\t\t\t\tcolumn.parentNode.insertBefore(col_right, column.nextSibling);\n\t\t\t} else {\n\t\t\t\tdropzone = column.lastChild;\n\t\t\t}\n\t\t} else {\n\t\t\tdropzone = target;\n\t\t\tcolumn = dropzone.parentNode;\n\t\t}\n\n\t\t// create agent's future home\n\t\tvar agent_elem = document.createElement('div');\n\t\tcolumn.insertBefore(agent_elem, dropzone);\n\n\t\treturn agent_elem;\n\t}", "title": "" }, { "docid": "99f480ad1407f6f238e44d832ec7d0d2", "score": "0.58588624", "text": "_evtDragOver(event) {\n if (!event.mimeData.hasData(JUPYTER_CELL_MIME)) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n event.dropAction = event.proposedAction;\n let elements = this.node.getElementsByClassName(DROP_TARGET_CLASS);\n if (elements.length) {\n elements[0].classList.remove(DROP_TARGET_CLASS);\n }\n let target = event.target;\n let index = this._findCell(target);\n if (index === -1) {\n return;\n }\n let widget = this.layout.widgets[index];\n widget.node.classList.add(DROP_TARGET_CLASS);\n }", "title": "" }, { "docid": "f6ad8704dd9fd98e8cdd286f3153e89b", "score": "0.5794837", "text": "function dropZoneDragHandler(event){\n //this event.preventDefault function allows the element to be dropped!\n //but you need to specify where in a separate function that will \"drop\" it in the specified place\n //event.preventDefault();\n \n //this logs for every pixel instance that the DOM element is moving over...logs a lot!!!\n //console.log(\"Targeting the Dragover event on this HTML DOM element: \", event.target);\n\n //need this to specify which query selector we are searching which is the closest\n //in this case we are using the CSS class for the query selector\n //the event of dragging is targeting the closest element by the CSS class name .task-list\n event.target.closest(\".task-list\");\n //store the value of the event targeting the closest element with the same class name\n var taskListEl = event.target.closest(\".task-list\");\n //if the value is true its the closest - do these things.\n //also doesn't allow the element to be dropped anywhere except the closest!!!\n if (taskListEl){//true\n event.preventDefault();//make sure we can drop it somewhere and doesn't default back to original place\n //console dir to verify the element dropzone is what we want!!\n //console.dir(taskListEl);//if true also print to console which element it is which is closest based on the CSS class selector argument\n \n //adding some dynamically generated inline HTML styling which shows \n //that a dragged element is being dragged over the task list element\n taskListEl.setAttribute(\"style\", \"background: rgba(68, 233, 255, 0.7); border-style: dashed;\");\n }\n //******** REFERENCE CODE COMMENT ******* */\n //*******the function below checks to see if the dragging DOM element is a descendent element of the task list \n //or the task list element itself\n //originates a search from the target element for an element that contains the selector\n //if the element with the selector is found, its returned as a DOM element, \n //if not this function will return null\n //******targetElement.closest(selector); this is the example format DO NOT USE THIS WE DID NOT DEFINE targetElement\n}", "title": "" }, { "docid": "dcbbe4d3003d57faad4c0a422dde7991", "score": "0.5763723", "text": "activateDropDetection() {\n if (this.dropDetectionActivated) { return; }\n this.dropDetectionActivated = true;\n setTimeout(() => {\n if (!this.dropDetectionActivated) { return; }\n this.addDocumentEventListener('mousemove', this.onDocumentDetectDrop);\n this.addDocumentEventListener('mousedown', this.onDocumentDetectDrop);\n this.addDocumentEventListener('fakedragend', this.onDocumentDragEnd);\n }, BaseMainGrid.dropDetectionActivationTimeout);\n }", "title": "" }, { "docid": "856b27c77ad01f330f95b600a479941d", "score": "0.5691907", "text": "_evtDragEnter(event) {\n if (!event.mimeData.hasData(JUPYTER_CELL_MIME)) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n let target = event.target;\n let index = this._findCell(target);\n if (index === -1) {\n return;\n }\n let widget = this.layout.widgets[index];\n widget.node.classList.add(DROP_TARGET_CLASS);\n }", "title": "" }, { "docid": "669d229f607a39b52bf179f4944ba4a1", "score": "0.55243945", "text": "function dragEnter(event) {\n \n event.target.classList.add(\"droppable-hover\");\n \n}", "title": "" }, { "docid": "04a0670d1b26f5edc0bf248b43501c4e", "score": "0.55115503", "text": "function handleDragEnter() {\n\t\t/*jshint validthis:true */\n\n\t\tvar target = $( this );\n\t\tif ( ! target.hasClass( 'no-drop' )) {\n\t\t\t$( this ).addClass( 'drop-target' );\t\n\t\t}\n\t}", "title": "" }, { "docid": "67d153d57c3bb8547e68a2707da32323", "score": "0.55037224", "text": "_dragStart(e) {\n // create the tag\n let target = this.cloneNode(true);\n window.HaxStore.instance.__dragTarget = target;\n if (e.dataTransfer) {\n this.crt = target;\n this.crt.style.position = \"absolute\";\n this.crt.style.top = \"-1000px\";\n this.crt.style.right = \"-1000px\";\n this.crt.style.transform = \"scale(0.25)\";\n this.crt.style.opacity = \".8\";\n e.dataTransfer.dropEffect = \"move\";\n document.body.appendChild(this.crt);\n e.dataTransfer.setDragImage(this.crt, 0, 0);\n }\n e.stopPropagation();\n e.stopImmediatePropagation();\n // show where things can be dropped only during the drag\n if (\n !window.HaxStore.instance.activeHaxBody.openDrawer &&\n window.HaxStore.instance.editMode\n ) {\n let children = window.HaxStore.instance.activeHaxBody.children;\n // walk the children and apply the draggable state needed\n for (var i in children) {\n if (children[i].classList && target !== children[i]) {\n children[i].classList.add(\"hax-mover\");\n }\n }\n }\n }", "title": "" }, { "docid": "1149f705c105df9e9ab484d03a091473", "score": "0.54939747", "text": "_evtDragOver(event) {\n event.preventDefault();\n event.stopPropagation();\n event.dropAction = event.proposedAction;\n let dropTarget = domutils[\"a\" /* DOMUtils */].findElement(this.node, listing_DROP_TARGET_CLASS);\n if (dropTarget) {\n dropTarget.classList.remove(listing_DROP_TARGET_CLASS);\n }\n let index = listing_Private.hitTestNodes(this._items, event.clientX, event.clientY);\n this._items[index].classList.add(listing_DROP_TARGET_CLASS);\n }", "title": "" }, { "docid": "a78c7eb150e1c9ccfc41cef12ea80d7b", "score": "0.5474031", "text": "addTarget(target) {\n target.addEventListener(\"mousedown\", () => { this.mouseIsDown = true; }, false);\n target.addEventListener(\"mousemove\", (e) => this.handleMouseMove(e), false);\n document.addEventListener(\"mouseup\", () => { this.mouseIsDown = false; }, false);\n }", "title": "" }, { "docid": "8ccb6cd8a876887631f1009dcbcb0f84", "score": "0.5470922", "text": "_evtDragOver(event) {\n event.preventDefault();\n event.stopPropagation();\n event.dropAction = event.proposedAction;\n let dropTarget = domutils[\"a\" /* DOMUtils */].findElement(this.node, DROP_TARGET_CLASS);\n if (dropTarget) {\n dropTarget.classList.remove(DROP_TARGET_CLASS);\n }\n let index = algorithm_lib[\"ArrayExt\"].findFirstIndex(this._crumbs, node => domutils_lib[\"ElementExt\"].hitTest(node, event.clientX, event.clientY));\n if (index !== -1) {\n this._crumbs[index].classList.add(DROP_TARGET_CLASS);\n }\n }", "title": "" }, { "docid": "9165a7bdfba9616e62f99bb597a64e19", "score": "0.5459035", "text": "dragEnterGrid(e) {\n const children = this.children;\n // walk the children and apply the draggable state needed\n for (var i in children) {\n if (children[i].classList && children[i] !== this.activeItem) {\n children[i].classList.add(\"hax-mover\");\n }\n }\n for (var j = 1; j <= this.columns; j++) {\n if (this.shadowRoot.querySelector(\"#col\" + j) !== undefined) {\n this.shadowRoot.querySelector(\"#col\" + j).classList.add(\"hax-mover\");\n }\n }\n }", "title": "" }, { "docid": "d635953014a53495b4e77b2c7f2e8235", "score": "0.5432186", "text": "function dragEnter(event) {\r\n if (!event.target.classList.contains(\"dropped\")) {\r\n event.target.classList.add(\"droppable-hover\");\r\n }\r\n}", "title": "" }, { "docid": "07b93f9cb50260497dae0ae98b3ab6d5", "score": "0.5398925", "text": "function dropToTargetZone(e) {\n e = e.originalEvent;\n\te.stopPropagation();\n\t$(this).css('border-style', 'dotted');\n\t\n\tvar id = e.dataTransfer.getData('Text');\n\tvar type = srcMgr.sourceType(id);\n\tif(!id || type != $(this).data('type')) return;\n\t// Place in the elem zone\n\t$(this).html(srcMgr.getExpoClone(id));\n\t$(this).attr('target', id);\n}", "title": "" }, { "docid": "b12ef671e059219db9ca1dad44fb260c", "score": "0.5356061", "text": "dragEnter(e) {\n if (this.editMode) {\n e.preventDefault();\n if (e.target && e.target.classList) {\n e.target.classList.add(\"hax-hovered\");\n }\n }\n }", "title": "" }, { "docid": "1a07eda0e97c924227890c5715768732", "score": "0.52827835", "text": "onDragOver(evt) {\n\n if (evt.preventDefault !== void 0) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n evt.dataTransfer.dropEffect = 'move';\n\n var target = evt.target.offsetParent;\n if (target && target !== this.dragEl && target.nodeName == 'DIV' && target.getAttribute(\"draggable\")===\"true\") {\n this.newIndex = target.getAttribute(\"column-no\");\n var rect = target.getBoundingClientRect();\n var width = rect.right - rect.left;\n var height = rect.bottom - rect.top;\n var isWide = (target.offsetWidth > this.dragEl.offsetWidth);\n var isLong = (target.offsetHeight > this.dragEl.offsetHeight);\n var halfway = ((evt.clientX - rect.left) / width) > 0.5;\n var nextSibling = target.nextElementSibling;\n var after = (nextSibling !== this.dragEl) && !isLong || halfway && isLong;\n this.rootEl.insertBefore(this.dragEl, after ? target.nextSibling : target);\n }\n }", "title": "" }, { "docid": "27b02c4e79e3c746dc32242a31a4d6e8", "score": "0.5280526", "text": "function addDropTarget(dropTarget){\n\tdropTargets.push(dropTarget);\n}", "title": "" }, { "docid": "877c52a47dee190e5f6136c53ab0fce4", "score": "0.5278782", "text": "chooseTarget() {\n // Has been captured, return home!\n if (this.captured) {\n this.targetTile = this.houseExit;\n if ((Math.abs(this.column - this.houseExit[0]) + Math.abs(this.row - this.houseExit[1])) < 1) {\n this.release();\n }\n }\n // If in scatter mode, go to scatter target\n else if (this.scatterMode && (this.mapReference.foodTotal - this.mapReference.foodEaten > this.elroyMode)) {\n this.targetTile = this.scatterTile;\n }\n // Otherwise, do default, player hunting behavior\n else {\n const playerRef = this.mapReference.playerRef;\n switch(this.ghostType) {\n // Default, and red ghost, \"Blinky\". Chases directly after player\n default:\n case 'red':\n this.targetTile = [playerRef.column, playerRef.row];\n break;\n // Pink ghost, \"Pinky\". Aims 4 tiles in front of player to try and ambush them\n case 'pink':\n this.targetTile = [playerRef.column + 4*playerRef.currentDirection[0], playerRef.row + 4*playerRef.currentDirection[1]];\n break;\n // Orange ghost, \"Clyde\". Chases player, unless they get too close, then hides in the corner\n case 'orange':\n const distanceToPlayerSquared = (this.column - playerRef.column)**2 + (this.row - playerRef.row)**2;\n if (distanceToPlayerSquared > 64) {\n this.targetTile = [playerRef.column, playerRef.row];\n }\n else {\n this.targetTile = this.scatterTile;\n }\n break;\n // Blue ghost, \"Inky\". Tries to be opposite of the red ghost's position, kinda\n // Takes a point 2 tiles in front of the player, and draws a vector from the red ghost to that point.\n // Then, doubles the length of that vector.\n // That is the blue ghosts target. Functionally a fancier approach to ambushing\n case 'blue':\n const redRef = this.mapReference.ghostRefs[0];\n this.targetTile = [\n redRef.column + 2 * (playerRef.column + 2*playerRef.currentDirection[0] - redRef.column),\n redRef.row + 2 * (playerRef.row + 2*playerRef.currentDirection[1] - redRef.row)\n ]\n }\n }\n }", "title": "" }, { "docid": "35c433a5682c0b8c4b17b7e51ecc2231", "score": "0.52775383", "text": "function dragEnter(event) {\n if(event.target.classList && event.target.classList.contains(\"droppable\") && !event.target.classList.contains(\"dropped\")) {\n event.target.classList.add(\"droppable-hover\");\n }\n}", "title": "" }, { "docid": "847d39553d13fe422ae3bed3da62b2c7", "score": "0.52460635", "text": "function dragEnter(event) {\n\n var drop = this;\n\n //set the drop effect for this zone\n event.dataTransfer.dropEffect = $(drop).attr('data-drop-effect');\n $(drop).addClass('drop-active');\n\n event.preventDefault();\n event.stopPropagation();\n\n }", "title": "" }, { "docid": "28f44d780c4403b9216ca70ed81bb7a5", "score": "0.52379817", "text": "function initiateDrag(d, domNode) {\n\t\t\t\t\tdraggingNode = d;\n\n\t\t\t\t\t// Ignore pointer events on own drop zone\n\t\t\t\t\td3.select(domNode).select('.dropZone').attr('pointer-events', 'none').classed('dropZone-dragging', true);\n\t\t\t\t\t// Show all drop zones\n\t\t\t\t\td3.selectAll('.dropZone').style('display', 'block');\n\t\t\t\t\t// Send dragged node to the back so that the mouseover method will fire properly when we're over the other nodes\n\t\t\t\t\tngroup.selectAll(\".node\").sort(function(a, b) { \n\t\t\t\t\t\tif (a.data.oid !== draggingNode.data.oid) return 1;\n\t\t\t\t\t\telse return -1;\n\t\t\t\t\t});\n\n\t\t\t\t\tvar descendants = draggingNode.descendants();\n\t\t\t\t\t// if nodes has children, remove the links and nodes\n\t\t\t\t\tif (descendants.length > 1) {\n\t\t\t\t\t\tvar links = draggingNode.links(); \n\t\t\t\t\t\tegroup.selectAll(\".depEdge\")\n\t\t\t\t\t\t\t.data(links, function (d) { return d.target.data.oid; })\n\t\t\t\t\t\t\t.remove();\n\t\t\t\t\t\tngroup.selectAll(\".node\")\n\t\t\t\t\t\t\t.data(descendants, function(d) { return d.data.oid; })\n\t\t\t\t\t\t\t// NOTE: descendants() includes the node it is called on\n\t\t\t\t\t\t\t.filter(function(d) { return d.data.oid !== draggingNode.data.oid; })\n\t\t\t\t\t\t\t.remove();\n\t\t\t\t\t};\n\t\t\t\t\t// \tremove parent edge\n\t\t\t\t\tegroup.selectAll(\".depEdge\")\n\t\t \t\t\t\t\t\t.filter(function(d) { return d.target.data.oid === draggingNode.data.oid; })\n\t\t \t\t\t\t\t\t.remove();\n\t\t\t\t\tdragStarted = false;\n\t\t\t\t\tdragActive = true;\n\t\t\t\t}", "title": "" }, { "docid": "7a0dab36570553f91fcd76d366bbf46c", "score": "0.5231949", "text": "_startDrag() {\n this._dragAndDrop = new DragDrop({\n dragPlaceholder: Drag.Placeholder.CLONE,\n sources: '.ddm-drag-item',\n targets: '.ddm-target',\n });\n\n this._dragAndDrop.on(DragDrop.Events.END, this._handleFieldMove.bind(this));\n this._dragAndDrop.on(DragDrop.Events.DRAG, this._handleDrag.bind(this));\n }", "title": "" }, { "docid": "54ecb4181e9e72375bda3abb38bbeed9", "score": "0.5231447", "text": "function onDragStart (event) {\n console.log(\"Drag event fired! HTML element is \"+event.target.getAttribute('id'));\n\n //Firstly, we want any item that is being dragged by the user to render ON TOP of everything else, so they can\n //always see what they are doing. Equally, set the utility zone elements to be just below the node being dragged.\n let utilityZones = document.getElementsByClassName(\"utilityDropZone\");\n for (let utilityElem of utilityZones) {\n utilityElem.style.zIndex = currTopZIndex-1;\n }\n\n let targetElem = event.target;\n targetElem.style.zIndex = currTopZIndex; //Sets to be at the front!\n currTopZIndex++;\n\n //Since the user is about to move this node, we should take this oppurtunity to save the current position in the\n //'previousTranslation' variable. That way, return to previous position funcitonality will work!\n let contentNode = getContentNode(targetElem);\n contentNode.previousTranslation.x = contentNode.translation.x;\n contentNode.previousTranslation.y = contentNode.translation.y;\n\n //Set the transform transition to be zero, so any loitering transition settings do not affect this drag action\n targetElem.classList.add(\"noTransitions\");\n\n /*Now, this dragging event will trigger the follow up event of activating all potential dropzones.\n To avoid insanely confusing structures, we will ENFORCE that this dragged node cannot be nested inside one of its children/descendents.\n Thus, we must dictate HERE that all descendant nodes are no longer potential 'dropzones' for the time being!\n To do this, we will simply remove the 'dropzone' class from all of this node's descendants. Then, when we are finished dragging this node,\n we will re-add that class to all descendants, so that they can be seen as dropzones again for other potential nodes.\n */\n //Cycle all children, and deactive them as drop zones.\n removeHtmlClassFromAllDescendants(contentNode, \"dropzone\");\n}", "title": "" }, { "docid": "e5e4de34314a7c31d05aaa4bd33b50ae", "score": "0.52266866", "text": "function dragAction() {\n move.play();\n\n // const gridItems = [...grid.childNodes];\n // const indexInGrid = gridItems.indexOf(e.target);\n // const { currentIndex } = this.target.dataset;\n\n // console.log(indexInGrid, currentIndex);\n // const index = 0;\n\n // console.log(this);\n\n // const tileSize = {\n // width: this.target.clientWidth,\n // height: this.target.clientHeight,\n // };\n\n // console.log(tileSize);\n\n // function getIndex(direction, size, total) {\n // return gsap.utils.clamp(Math.round(direction / size), 0, total - 1);\n // }\n\n // switch (this.getDirection()) {\n // case \"up\": {\n // console.log(Math.round(this.y / tileSize.height));\n // break;\n // }\n // case \"down\": {\n // console.log(Math.round(this.y / tileSize.height));\n // console.log(\"going down\");\n // break;\n // }\n // case \"left\": {\n // console.log(Math.round(this.y / tileSize.height));\n // console.log(\"going left\");\n // break;\n // }\n // case \"right\": {\n // console.log(Math.round(this.y / tileSize.height));\n // console.log(\"going right\");\n // break;\n // }\n // default: {\n // break;\n // }\n // }\n }", "title": "" }, { "docid": "6d9b5f5b39037c0a77d559dfd9a944ab", "score": "0.5220106", "text": "function initDragOver(dropZone) {\n dropZone.addEventListener('dragover', function(e) {\n e.preventDefault();\n dropZone.classList.add(\"element-dragged\");\n e.dataTransfer.dropEffect = 'copy';\n });\n}", "title": "" }, { "docid": "aac89300d9915333fa46f71877eeeb5d", "score": "0.52021873", "text": "function makeHeroSelectable(heroCon) {\n\theroCon.SetPanelEvent(\"oncontextmenu\", function () {\n\t\tvar heroName = heroCon.GetAttributeString(\"heroName\", \"\");\n\t\tif (heroName == null || heroName.length <= 0) return;\n\n\t\tGameEvents.SendCustomGameEventToServer(\"lodGameSetupPing\", {\n\t\t\toriginalContent: heroName,\n\t\t\tcontent: $.Localize(heroName),\n\t\t\ttype: \"hero\",\n\t\t});\n\t});\n\n\theroCon.SetPanelEvent(\"onactivate\", function () {\n\t\tvar heroName = heroCon.GetAttributeString(\"heroName\", \"\");\n\t\tif (heroName == null || heroName.length <= 0) return;\n\n\t\tif (GameUI.IsAltDown()) {\n\t\t\tGameEvents.SendCustomGameEventToServer(\"lodGameSetupPing\", {\n\t\t\t\toriginalContent: heroName,\n\t\t\t\tcontent: $.Localize(heroName),\n\t\t\t\ttype: \"hero\",\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tsetSelectedHelperHero(heroName);\n\t});\n\n\t// Dragging\n\theroCon.SetDraggable(true);\n\n\t$.RegisterEventHandler(\"DragStart\", heroCon, function (panelID, dragCallbacks) {\n\t\tvar heroName = heroCon.GetAttributeString(\"heroName\", \"\");\n\t\tif (heroName == null || heroName.length <= 0) return;\n\n\t\t// Create a temp image to drag around\n\t\tvar displayPanel = $.CreatePanel(\"DOTAHeroImage\", $.GetContextPanel(), \"dragImage\");\n\t\tdisplayPanel.heroname = heroName;\n\t\tdragCallbacks.displayPanel = displayPanel;\n\t\tdragCallbacks.offsetX = 0;\n\t\tdragCallbacks.offsetY = 0;\n\t\tdisplayPanel.SetAttributeString(\"heroName\", heroName);\n\n\t\t// Hide skill info\n\t\t$.DispatchEvent(\"DOTAHideAbilityTooltip\");\n\t\t$.DispatchEvent(\"DOTAHideTitleTextTooltip\");\n\n\t\t// Highlight drop cell\n\t\t$(\"#pickingPhaseSelectedHeroImage\").SetHasClass(\"lodSelectedDrop\", true);\n\t\t$(\"#pickingPhaseSelectedHeroImageNone\").SetHasClass(\"lodSelectedDrop\", true);\n\n\t\t// Banning\n\t\t$(\"#pickingPhaseBans\").SetHasClass(\"lodSelectedDrop\", true);\n\t});\n\n\t$.RegisterEventHandler(\"DragEnd\", heroCon, function (panelId, draggedPanel) {\n\t\t// Delete the draggable panel\n\t\tdraggedPanel.deleted = true;\n\t\tdraggedPanel.DeleteAsync(0.0);\n\n\t\t// Highlight drop cell\n\t\t$(\"#pickingPhaseSelectedHeroImage\").SetHasClass(\"lodSelectedDrop\", false);\n\t\t$(\"#pickingPhaseSelectedHeroImageNone\").SetHasClass(\"lodSelectedDrop\", false);\n\n\t\t// Banning\n\t\t$(\"#pickingPhaseBans\").SetHasClass(\"lodSelectedDrop\", false);\n\n\t\tvar heroName = draggedPanel.GetAttributeString(\"heroName\", \"\");\n\t\tif (heroName == null || heroName.length <= 0) return;\n\n\t\t// Can we select this as our hero?\n\t\tif (draggedPanel.GetAttributeInt(\"canSelectHero\", 0) == 1) {\n\t\t\tchooseHero(heroName);\n\t\t}\n\n\t\t// Are we banning a hero?\n\t\tif (draggedPanel.GetAttributeInt(\"banThis\", 0) == 1) {\n\t\t\tbanHero(heroName);\n\t\t}\n\t});\n\n\t// Hook the hero info display\n\thookHeroInfo(heroCon);\n}", "title": "" }, { "docid": "ecc30ab74f8b17c902ff791c3004935c", "score": "0.52010614", "text": "_applyDropZoneEvents(node) {\n node.addEventListener(\"dragover\", e => this._dragOver(e));\n node.addEventListener(\"dragenter\", e => this._dragEnter(e));\n node.addEventListener(\"dragleave\", e => this._dragLeave(e));\n node.addEventListener(\"drop\", e => this._dragDrop(e));\n }", "title": "" }, { "docid": "378ceeafd7a45832d0f8abe57f178a3b", "score": "0.5175514", "text": "function dragOver(event, source, target, dragData, dropData) {\n /////\n // If the element supports drop, add a hilight to it.\n /////\n if (allowDrop(source, target, dragData, dropData)) {\n $(event.currentTarget).addClass('fb-hilight');\n }\n }", "title": "" }, { "docid": "e58a41ddfb3e51a0777ba5162246f6c5", "score": "0.5148926", "text": "_dragOver(e) {\n e.preventDefault();\n this.dragZone.classList.add(\"drag-zone-delete\");\n }", "title": "" }, { "docid": "4d2dfaeefd74c26b9bdda54a2158f466", "score": "0.5148559", "text": "dragover() {}", "title": "" }, { "docid": "49561eb26cf87ec20b3be24b10f47355", "score": "0.51387864", "text": "function triggerTarget() {\n // Show/hide $target\n toggleTarget();\n\n // Clear timeout to help prevent focus / other data toggle press conflicts\n window.dataExpTimeOut = null;\n }", "title": "" }, { "docid": "350938d6759920c797616e008e6722d3", "score": "0.51376593", "text": "setUpDragAndDropSystem() {\n const tabs = document.querySelectorAll('.tab')\n\n tabs.forEach(tab => this.setUpTabDragAndDropSystem(tab))\n\n // set up dropzone: unclassified, dropzone\n const dropzones = document.querySelectorAll('.dropzone')\n const unclassified = document.querySelector('.unclassified')\n\n // set up dropzone for archives\n dropzones.forEach(dropzone => this.setUpArchiveDragAndDropSystem(dropzone))\n\n // set up dropzone for root.unclassified\n this.setUpUnclassifiedDragAndDropSystem(unclassified)\n unclassified.addEventListener('dragenter', (e) => { this.preventDefaultHandler(e) })\n unclassified.addEventListener('dragover', (e) => { this.preventDefaultHandler(e) })\n unclassified.addEventListener('dragleave', (e) => { this.preventDefaultHandler(e) })\n unclassified.addEventListener('drop', (e) => { this.unclassifiedDroppedHandler(e, unclassified) })\n }", "title": "" }, { "docid": "309f6cb0ad1f1dc9a521d8d549e67a10", "score": "0.5136224", "text": "function triggerTarget() {\r\n // Show/hide $target\r\n toggleTarget();\r\n\r\n // Clear timeout to help prevent focus / other data toggle press conflicts\r\n window.dataExpTimeOut = null;\r\n }", "title": "" }, { "docid": "500227deef9aada7d95459c620515dde", "score": "0.5134619", "text": "function onMouseMove(event) {\n moveAt(event.pageX, event.pageY);\n\n event.target.hidden = true;\n let elemBelow = document.elementFromPoint(event.clientX, event.clientY);\n event.target.hidden = false;\n \n\n if (!elemBelow) return;\n\n let droppableBelow = elemBelow.closest('.js-droppable');\n if (currentDroppable != droppableBelow) {\n currentDroppable = droppableBelow;\n if (currentDroppable) { \n enterDroppable(currentDroppable,event.target);\n } \n \n }\n }", "title": "" }, { "docid": "d1246cbe43bbe67f46aa190fe1ba7365", "score": "0.51312035", "text": "function dragOver(event) {\n var drop = this;\n\n //set the drop effect for this zone\n event.dataTransfer.dropEffect = $(drop).attr('data-drop-effect');\n $(drop).addClass('drop-active');\n\n event.preventDefault();\n event.stopPropagation();\n }", "title": "" }, { "docid": "5d2a702dbeb052b7bf1df462df2b09bc", "score": "0.51302874", "text": "onDrop(e) {\n this.isEntered = 0;\n ClassName.remove(this.layoutDomRef, \"rb-dragged\");\n Style.remove(this.layoutDomRef, this.props.draggedStyle);\n Style.add(this.layoutDomRef, this.props.style);\n if(e.dataTransfer) {\n this.props.onDrop({\n target: e.dataTransfer\n });\n }\n }", "title": "" }, { "docid": "d3c0adb03d131351862a7fac957d2080", "score": "0.5130168", "text": "updateContainerDrag(event) {\n const me = this,\n context = me.context;\n if (!context.started || !context.targetElement) return;\n const containerElement = DomHelper.getAncestor(context.targetElement, me.containers, 'b-grid'),\n willLoseFocus = context.dragging && context.dragging.contains(document.activeElement);\n\n if (containerElement && DomHelper.isDescendant(context.element, containerElement)) {\n // dragging over part of self, do nothing\n return;\n } // The dragging element contains focus, and moving it within the DOM\n // will cause focus loss which might affect an encapsulating autoClose Popup.\n // Prevent focus loss handling during the DOM move.\n\n if (willLoseFocus) {\n GlobalEvents.suspendFocusEvents();\n }\n\n if (containerElement && context.valid) {\n me.moveNextTo(containerElement, event);\n } else {\n // dragged outside of containers, revert position\n me.revertPosition();\n }\n\n if (willLoseFocus) {\n GlobalEvents.resumeFocusEvents();\n }\n\n event.preventDefault();\n }", "title": "" }, { "docid": "3fb1bf34ead712afee7f8ab07fdfa609", "score": "0.512327", "text": "function dropShip(ev) {\n ev.preventDefault();\n /*document.querySelector(\"#display p\").innerText = \"\";*/\n //checks if the targeted element is a cell\n if (!ev.target.classList.contains(\"grid-cell\")) {\n return updateConsole(\"movement not allowed\");\n }\n //variables where the data of the ship beeing dragged is stored\n let data = ev.dataTransfer.getData(\"ship\");\n let ship = document.getElementById(data);\n //variables where the data of the targeted cell is stored\n let cell = ev.target;\n\n //Before the ship is dropped to a cell, checks if the length of the ship exceed the grid width,\n //If true, the drop event is aborted.\n if (isShipOffBounds(cell, ship)) return;\n\n //Else:\n //the ship takes the position data of the targeted cell\n const { x, y } = cell.dataset;\n ship.dataset.y = y;\n ship.dataset.x = x;\n //the ship is added to the cell\n cell.appendChild(ship);\n /*dockIsEmpty();*/\n\n checkBusyCells(ship, cell);\n}", "title": "" }, { "docid": "a317edb4060b3bb2190ed92a45717433", "score": "0.5116296", "text": "onMouseUp(event) {\n const me = this,\n data = me.creationData,\n target = event.target;\n me.abort();\n\n const doDependencyDrop = async () => {\n data.targetTerminal = event.target;\n const result = me.createDependency(data);\n\n if (ObjectHelper.isPromise(result)) {\n await result;\n } //data.valid = true; // TODO: remove this line if tests are fine\n\n /**\n * Fired on the owning Scheduler/Gantt when a dependency drag creation operation succeeds\n * @event dependencyCreateDrop\n * @param {Object} data\n */\n\n me.view.trigger('dependencyCreateDrop', {\n data\n });\n };\n\n const doAfterDependencyDrop = data => {\n /**\n * Fired on the owning Scheduler/Gantt after a dependency drag creation operation finished, no matter to outcome\n * @event afterDependencyCreateDrop\n * @param {Object} data\n */\n me.view.trigger('afterDependencyCreateDrop', {\n data\n });\n }; // TODO: should call finalize and allow user to hook it (as in EventDrag, EventResize)\n\n if (data.valid && target.matches(`.${me.terminalCls}`)) {\n if (ObjectHelper.isPromise(data.valid)) {\n data.valid.then(valid => {\n data.valid = valid;\n\n if (valid) {\n doDependencyDrop().then(() => doAfterDependencyDrop(data));\n } else {\n doAfterDependencyDrop(data);\n }\n });\n } else {\n doDependencyDrop().then(() => doAfterDependencyDrop(data));\n }\n } else {\n data.valid = false;\n doAfterDependencyDrop(data);\n }\n }", "title": "" }, { "docid": "85a1e960235c53b755f42233c50bd78b", "score": "0.51134336", "text": "function onProjectMouseEnter(event) {\n // Current target = element qui subit levent\n var currentTarget = event.currentTarget\n var projectInfo = currentTarget.getElementsByClassName('project-info')[0]\n\n var offsetX = ((event.offsetX - projectElSize.width / 2) / projectElSize.width ) * 2;\n var offsetY = ((event.offsetY - projectElSize.height / 2) / projectElSize.height ) * 2;\n\n var direction;\n if( Math.abs( offsetX ) > Math.abs( offsetY ) ) {\n direction = ( offsetX < 0 ) ? 'left' : 'right'\n } else {\n direction = ( offsetY < 0 ) ? 'top' : 'bottom'\n }\n\n currentTarget.setAttribute('data-direction', direction)\n\n projectInfo.classList.add('project-info--show')\n\n TweenMax.fromTo( projectInfo, 1, {\n x: translationValue[direction].x,\n y: translationValue[direction].y\n }, {\n x: '0%',\n y: '0%',\n ease: Expo.easeOut\n })\n}", "title": "" }, { "docid": "63147ba324be334fc7be51940159b2fb", "score": "0.51130664", "text": "function DragAndDrop() {\n\t/**\n\t * La posizione x iniziale dalla quale si inizia a traslare.\n\t * @type {int}\n\t */\n\tthis.startX = event.clientX;\n\t/**\n\t * La posizione y iniziale dalla quale si inizia a traslare.\n\t * @type {int}\n\t */\n\tthis.startY = event.clientY;\n\t/**\n\t * Mantiene i limiti alla traslazione della telecamera.\n\t * @type {Bound}\n\t */\n\tthis.bound = Bound.getInstance();\n}", "title": "" }, { "docid": "2bbaafb1c1601349a9e9576169a07407", "score": "0.5101504", "text": "handleDrop(evt) {\n \n console.log('Handling Drop into drop tagert for QUESTION gap [' + this.gapNumber + ']');\n \n //Cancel the event\n this.cancel(evt);\n\n //Dispatch the custom event to raise the detail payload up one level \n const event = new CustomEvent('gapdrop', {\n detail: {\n groupId : this.getGroupId(),\n groupNumber : (this.group ? this.group.GroupNumber__c : 0),\n gapNumber : this.gapNumber \n }\n });\n console.log('raising gapdrop event...');\n this.dispatchEvent(event);\n\n this.removeDragOverStyle();\n \n }", "title": "" }, { "docid": "c20c57395a3e18c9c0170ea955045339", "score": "0.50846964", "text": "function bindDragAndDrop () {\n var tile_Being_Dragged_ID = null;\n var tile_to_be_shifted_ID = null;\n var drag_in_progress = false;\n var iniMX = 0, iniMY = 0; //initial mouseX and mouseY when drag Starts\n \n \n //whenever a tile recieves a mousedown, assume dragging start\n container.on('pointerdown', '.tile', function(ev){ //console.log('drag start');console.log(ev);\n if(!container.hasClass('movementMode')) {return;}\n// ev.stopPropagation();\n ev.preventDefault();\n if(drag_in_progress) {return;}\n tile_Being_Dragged_ID = $(this).attr('id'); \n// tile_Being_Dragged_ID = $(ev.target).closest('.tile').attr('id'); \n drag_in_progress = true;\n iniMX = ev.pageX;\n iniMY = ev.pageY;\n container.find('.tile').removeClass('being-dragged');\n $(this).addClass('being-dragged');\n });\n \n \n //whenever body recieves a mouseup, assume dragging end\n $('body').on('pointerup', function(ev){ //console.log('drag end'); console.log(ev);\n //ev.stopPropagation();\n if(!drag_in_progress) {return;}\n drag_in_progress = false;\n $('body').trigger('click');\n \n //bring the tile_Being_Dragged_ID before tile_to_be_shifted_ID in tileOrder\n if (tile_to_be_shifted_ID != null && tile_Being_Dragged_ID != null) {\n var newTileOrder = [];\n for (var i in tileOrder) {\n if (tileOrder[i] == tile_Being_Dragged_ID) {\n continue;\n } \n else if (tileOrder[i] == tile_to_be_shifted_ID) {\n newTileOrder.push(tile_Being_Dragged_ID);\n newTileOrder.push(tile_to_be_shifted_ID);\n } else {\n newTileOrder.push(tileOrder[i]);\n }\n }\n \n //sometimes false triggering causes data loss\n if(newTileOrder.length != tileOrder.length) {\n console.log(\"length mismatch... Hence this order cannot be taken...\");\n console.log('current tile order');console.log(tileOrder);\n console.log('new tile order');console.log(newTileOrder);\n //debugger;\n \n } else {\n tileOrder = newTileOrder;\n } \n }\n \n reTilefy(); \n \n tile_Being_Dragged_ID = null;\n tile_to_be_shifted_ID = null;\n $('.tile').removeClass('being-dragged');\n });\n \n //if the pointer goes out of current tile container, trigger a pointerup\n container.on('pointerout', function(ev) {\n $('body').trigger('pointerup');\n });\n \n //while dragging the tile should move with mouse\n $('body').on('pointermove', function (ev) {\n ev.stopPropagation();\n if(!tileMovementAllowed || !drag_in_progress || tile_Being_Dragged_ID == null) {\n return;\n }\n \n //get mouse pointer displacement\n var diffX = ev.pageX - iniMX;\n var diffY = ev.pageY - iniMY;\n iniMX = ev.pageX;\n iniMY = ev.pageY;\n \n var tileLeft = parseInt($('#'+tile_Being_Dragged_ID).css('left'));\n var tileTop = parseInt($('#'+tile_Being_Dragged_ID).css('top'));\n var newTop = tileTop + diffY;\n var newLeft = tileLeft + diffX;\n \n for (var i in tiles) {\n if(tile_Being_Dragged_ID != tiles[i].id && Math.abs(tiles[i].left - tileLeft) < small_tile_size && Math.abs(tiles[i].top - tileTop) < small_tile_size) {\n //console.log(tiles[i].id + \" can be moved...\");\n container.find('.tile').removeClass('shift-effect');\n tile_to_be_shifted_ID = tiles[i].id;\n $('#' + tile_to_be_shifted_ID).addClass('shift-effect');\n break;\n }\n }\n \n //apply the new top and left\n $('#'+tile_Being_Dragged_ID).css({\n \"top\": newTop,\n \"left\": newLeft\n });\n });\n \n $('#'+config.btn_ID_to_Toggle_Tile_Movement).on('click', function(){\n checkTileDNDPermission();\n });\n \n //first tie it doesnot have any of the classes off/on, so it will set to off\n function checkTileDNDPermission () {\n $('.tileResizeMenu').remove();\n if(!$('#'+config.btn_ID_to_Toggle_Tile_Movement).hasClass('on')) {\n $('#'+config.btn_ID_to_Toggle_Tile_Movement).removeClass('off').addClass('on');\n tileMovementAllowed = true;\n container.addClass('movementMode').removeClass('resizeMode');\n //tile resize and movement are mutually exclusive\n tileResizeAllowed = false;\n $('#'+config.btn_ID_to_Toggle_Tile_Resize).removeClass('on').addClass('off');\n } else {\n $('#'+config.btn_ID_to_Toggle_Tile_Movement).removeClass('on').addClass('off');\n tileMovementAllowed = false;\n container.removeClass('movementMode');\n reTilefy(); //to correct any anomaly during tile movement\n }\n }\n \n //Initial / first time check, comment this out if first time on/off class is given in html\n //checkTileDNDPermission();\n }", "title": "" }, { "docid": "4292af8df364a6651b71f1546b1515e3", "score": "0.50771844", "text": "bindHoverListeners() {\n var container, expandButton, node;\n node = this.html.querySelector(\".node\");\n container = this.html.querySelector(\".node-content-container\");\n expandButton = this.html.querySelector(\".node-expand\");\n // The hover-effect on the node itself.\n container.addEventListener(\"mouseover\", () => {\n return node.classList.add(\"hover\");\n });\n container.addEventListener(\"mouseout\", () => {\n return node.classList.remove(\"hover\");\n });\n // The hover-effect on the expand-button.\n if (expandButton) {\n expandButton.addEventListener(\"mouseover\", () => {\n return expandButton.classList.add(\"hover\");\n });\n return expandButton.addEventListener(\"mouseout\", () => {\n return expandButton.classList.remove(\"hover\");\n });\n }\n }", "title": "" }, { "docid": "8bffaf0310ead9ec3d3d65e53b1ed8d2", "score": "0.5075499", "text": "flyover ( ...zones ) {\n const { elem } = this;\n let dx = 0, dy = 0;\n elem.draggable = true;\n\n const { offsetLeft, offsetTop, offsetWidth, offsetHeight } = elem;\n elem.style.margin = \"0\";\n elem.style.right = \"\";\n elem.style.bottom = \"\";\n elem.style.left = `${ offsetLeft }px`;\n elem.style.top = `${ offsetTop }px`;\n elem.style.width = `${ offsetWidth }px`;\n elem.style.height = `${ offsetHeight }px`;\n\n elem.addEventListener ( \"dragstart\", e => {\n e.dataTransfer.setData ( \"text/plain\", elem.id );\n const { offsetLeft, offsetTop } = elem;\n dx = offsetLeft - e.x;\n dy = offsetTop - e.y;\n } );\n zones.forEach ( zone => {\n zone.elem.addEventListener ( \"dragover\", e => { e.preventDefault (); } );\n zone.elem.addEventListener ( \"drop\", e => {\n e.preventDefault ();\n if ( e.dataTransfer.getData ( \"text/plain\" ) !== elem.id ) return; // not for us !\n elem.style.left = `${ e.x + dx }px`;\n elem.style.top = `${ e.y + dy }px`;\n } );\n } );\n }", "title": "" }, { "docid": "a48b3ad0af067954162e34ee98b0a3eb", "score": "0.50713056", "text": "_dragDrop(e) {\n e.preventDefault();\n\n if(e.target.classList.contains(\"dropZone\") && this.element !== null) {\n if(e.target.attributes.disabled.value !== \"false\") {\n return;\n }\n this.element.name = `dragged`;\n\n e.target.append(this.element);\n this.audio.play();\n }\n\n if(e.target.classList.contains(\"dragZone\") && this.element !== null) {\n if(this.double_colors_enabled) {\n this.element.remove();\n this.dragZone.classList.remove(\"drag-zone-delete\");\n } else {\n this.colors_container.append(this.element)\n this.element.name = `draggable`;\n }\n }\n this._toggleSubmitButton();\n this.element = null;\n }", "title": "" }, { "docid": "bcd72ff8323efdeb974bb3fa4563d2ce", "score": "0.5066905", "text": "function setupGrid( grid ) {\n \n // Element to show the previously hovered tile\n var prev = document.createElement(\"div\");\n prev.style.textAlign = \"center\";\n prev.style.lineHeight = grid.tileHeight + \"px\";\n prev.style.position = \"absolute\";\n prev.style.border = \"4px outset yellow\";\n prev.style.width = (grid.tileWidth - 7) + \"px\";\n prev.style.height = (grid.tileHeight - 7) + \"px\";\n prev.style.display = \"none\";\n grid.root.appendChild(prev);\n \n // Element to show the currently hovered tile\n var curr = document.createElement(\"div\");\n curr.style.textAlign = \"center\";\n curr.style.lineHeight = grid.tileHeight + \"px\";\n curr.style.position = \"absolute\";\n curr.style.border = \"4px outset green\";\n curr.style.width = (grid.tileWidth - 7) + \"px\";\n curr.style.height = (grid.tileHeight - 7) + \"px\";\n curr.style.display = \"none\";\n grid.root.appendChild(curr);\n \n // Extra element to mark the origin\n var marker = document.createElement(\"div\");\n marker.style.lineHeight = \"0px\";\n marker.style.position = \"absolute\";\n marker.style.border = \"5px ridge red\";\n marker.style.height = \"0px\";\n marker.style.width = \"0px\";\n marker.style.left = \"-5px\";\n marker.style.top = \"-5px\";\n grid.root.appendChild(marker);\n \n // Setting mouse movement related tile events\n grid.addEvent(\"tileover\", function(e, x, y) {\n hex.log([x, y], e.type);\n var inv = grid.screenpos(x, y);\n curr.style.left = inv.x + \"px\";\n curr.style.top = inv.y + \"px\";\n curr.innerHTML = [x, y] + '';\n });\n grid.addEvent(\"tileout\", function(e, x, y) {\n hex.log([x, y], e.type);\n var inv = grid.screenpos(x, y);\n prev.style.left = inv.x + \"px\";\n prev.style.top = inv.y + \"px\";\n prev.innerHTML = [x, y] + '';\n });\n \n // Setting mouse button related tile events\n grid.addEvent(\"tiledown\", function(e, x, y) {\n hex.log([x, y], e.type);\n curr.style.borderStyle = \"inset\";\n });\n grid.addEvent(\"tileup\", function(e, x, y) {\n hex.log([x, y], e.type);\n curr.style.borderStyle = \"outset\";\n });\n grid.addEvent(\"tileclick\", function(e, x, y) {\n hex.log([x, y], e.type);\n });\n grid.addEvent(\"tiletap\", function(e, x, y) {\n hex.log([x, y], e.type);\n });\n \n // Setting mouse movement related grid events\n grid.addEvent(\"gridover\", function(e, x, y) {\n hex.log([x, y], e.type);\n curr.style.display = \"\";\n prev.style.display = \"\";\n });\n grid.addEvent(\"gridout\", function(e, x, y) {\n hex.log([x, y], e.type);\n curr.style.display = \"none\";\n prev.style.display = \"none\";\n });\n \n // Center the root element.\n var size = hex.size(grid.elem);\n grid.reorient(size.x * 0.5, size.y * 0.5);\n \n}", "title": "" }, { "docid": "5bb5844c56923ecac9cf170145b279db", "score": "0.506532", "text": "dragAndDropElement(element, target){\n element.waitForDisplayed(time)\n element.dragAndDrop(target)\n }", "title": "" }, { "docid": "830d2f91b3550f814f14e87dd41c6e8f", "score": "0.506517", "text": "dragStart(e) {\n if (this.editMode) {\n if (window.HaxStore && window.HaxStore.ready) {\n let childrenHAX = window.HaxStore.instance.activeHaxBody.children;\n // walk the children and apply the draggable state needed\n for (var i in childrenHAX) {\n if (childrenHAX[i].classList) {\n childrenHAX[i].classList.add(\"hax-mover\");\n }\n }\n window.HaxStore.instance.__dragTarget = this.activeItem;\n } else {\n this.__dragTarget = this.activeItem;\n }\n this.activeItem.classList.add(\"hax-moving\");\n e.dataTransfer.dropEffect = \"move\";\n e.dataTransfer.setDragImage(this.activeItem, 0, 0);\n e.stopPropagation();\n e.stopImmediatePropagation();\n const children = this.children;\n // walk the children and apply the draggable state needed\n for (var i in children) {\n if (children[i].classList && children[i] !== this.activeItem) {\n children[i].classList.add(\"hax-mover\");\n }\n }\n for (var j = 1; j <= this.columns; j++) {\n if (this.shadowRoot.querySelector(\"#col\" + j) !== undefined) {\n this.shadowRoot.querySelector(\"#col\" + j).classList.add(\"hax-mover\");\n }\n }\n }\n }", "title": "" }, { "docid": "829c58e43a666b8be13e1c4e06248d1c", "score": "0.50641894", "text": "function triggerEvent(hitData, target, evtSuffix, elements) {\n target.triggerCustom(\n hitData.type + (evtSuffix || 'Hit'), {\n hitType: hitData.type\n },\n elements ? elements : hitData.elements, \n hitData.absXY,\n hitData.relXY,\n new GeoXY(hitData.gridX, hitData.gridY)\n ); \n }", "title": "" }, { "docid": "dbc37dd8cbf53570ca34e2746f5ac908", "score": "0.5058615", "text": "function identifyDropTarget(x, y, container){\n\n var dropTarget = null;\n \n //onsole.log('Draggable.identifyDropTarget for component ' + box.name + ' (' + box.nestedBoxes.length + ' children)') ;\n var component = BoxModel.smallestBoxContainingPoint(container,x,y);\n \n if (component){\n var pos = BoxModel.pointPositionWithinComponent(x,y,component);\n var nextDropTarget = getNextDropTarget(component, pos, _dragState.constraint.zone);\n dropTarget = new DropTarget({component, pos, nextDropTarget}).activate()\n }\n\n return dropTarget;\n}", "title": "" }, { "docid": "682453d5eb4fc967143278cc6ce81eb2", "score": "0.5054078", "text": "function drop(ev) {\n ev.preventDefault();\n var data = ev.dataTransfer.getData(\"text\");\n var toDrop = document.getElementById(data);\n var topY = ev.currentTarget.getBoundingClientRect().top;\n var bottomY = ev.currentTarget.getBoundingClientRect().bottom;\n var midY = (topY + bottomY) / 2;\n var hoverPoint = ev.clientY < midY;\n (document.getElementById(\"app\")).insertBefore(toDrop, (hoverPoint) ? ev.currentTarget : ev.currentTarget.nextSibling);\n toDrop.style.borderTopColor = \"#FFFFFF\";\n ev.currentTarget.style.borderTopColor = \"#FFFFFF\";\n ev.currentTarget.style.borderTopWidth = \"1px\";\n toDrop.style.borderBottomColor = \"#EFEFEF\";\n ev.currentTarget.style.borderBottomColor = \"#EFEFEF\";\n ev.currentTarget.style.borderBottomWidth = \"1px\";\n resort();\n}", "title": "" }, { "docid": "b1ead23ef739b58e7917bd77828516fc", "score": "0.504968", "text": "function dragDrop(e) {\n e.preventDefault();\n\n // This will get the currently item being dragged by searching for a class\n const cardBeingDragged = document.querySelector('.is-dragging')\n\n //this will append the item on the \"this\" element that refers to the column, the drop zone\n this.appendChild(cardBeingDragged)\n\n}", "title": "" }, { "docid": "0cbaa75e6cfe6b4dfbbdd6e77fe6991a", "score": "0.5041419", "text": "onDragStart(evt) {\n\n this.dragEl = evt.target;\n this.oldIndex = evt.target.getAttribute(\"column-no\");\n \n if(this.canMove()){\n this.onStart();\n this.nextEl = this.dragEl.nextSibling;\n\n evt.dataTransfer.effectAllowed = 'move';\n evt.dataTransfer.setData('Text', this.dragEl.textContent);\n\n this.rootEl.addEventListener('dragover', this.onDragOver.bind(this), false);\n this.rootEl.addEventListener('dragend', this.onDragEnd.bind(this), false);\n\n setTimeout(function () {\n this.dragEl.classList.add('ghost');\n }.bind(this), 0);\n } else {\n evt.preventDefault()\n }\n\n }", "title": "" }, { "docid": "add32d763ac414d43c765cdf349e6e1f", "score": "0.5040871", "text": "onMouseUp(e){\n e.preventDefault();\n this.dragging = false;\n if(this.dropzones == undefined){\n \n } else {\n for(var i = 0; i < this.dropzones.length; i++){\n if(utilities.boundingBoxCollision(this.entity.getCollider(), this.dropzones[i].getCollider())){\n var dropzone = this.dropzones[i].getCollider();\n this.entity.x = dropzone.x + ((dropzone.width - this.entity.width) / 2);\n this.entity.y = dropzone.y + ((dropzone.height - this.entity.height) / 2);\n\n if(this.entity.soundManager !== undefined){\n this.entity.soundManager.playSound(\"confirm\", false);\n }\n } else {\n this.entity.x = this.origin.x;\n this.entity.y = this.origin.y;\n \n if(this.entity.soundManager !== undefined){\n this.entity.soundManager.playSound(\"error\", false);\n }\n }\n }\n }\n\n document.removeEventListener(\"mousemove\",this.mouseMoveHandler, true);\n document.removeEventListener(\"mouseup\", this.mouseUpHandler, true);\n }", "title": "" }, { "docid": "4ea5c6c081ae163b19d68e43b5695ea6", "score": "0.5032276", "text": "dragDrop(e) {\n this.parent.trigger(actionBegin, e, (actionBeginArgs) => {\n if (actionBeginArgs.cancel) {\n e.preventDefault();\n }\n else {\n if (closest(e.target, '#' + this.parent.getID() + '_toolbar')) {\n e.preventDefault();\n return;\n }\n if (this.parent.element.querySelector('.' + CLS_IMG_RESIZE)) {\n detach(this.imgResizeDiv);\n }\n e.preventDefault();\n let range;\n if (this.contentModule.getDocument().caretRangeFromPoint) { //For chrome\n range = this.contentModule.getDocument().caretRangeFromPoint(e.clientX, e.clientY);\n }\n else if ((e.rangeParent)) { //For mozilla firefox\n range = this.contentModule.getDocument().createRange();\n range.setStart(e.rangeParent, e.rangeOffset);\n }\n else {\n range = this.getDropRange(e.clientX, e.clientY); //For internet explorer\n }\n this.parent.notify(selectRange, { range: range });\n let uploadArea = this.parent.element.querySelector('.' + CLS_DROPAREA);\n if (uploadArea) {\n return;\n }\n this.insertDragImage(e);\n }\n });\n }", "title": "" }, { "docid": "1a8082462e0975b71a4d10d94b8fcf13", "score": "0.50252116", "text": "_evtDragLeave(event) {\n event.preventDefault();\n event.stopPropagation();\n let dropTarget = domutils[\"a\" /* DOMUtils */].findElement(this.node, DROP_TARGET_CLASS);\n if (dropTarget) {\n dropTarget.classList.remove(DROP_TARGET_CLASS);\n }\n }", "title": "" }, { "docid": "1f0d75e497e5ea382916b78cb2a7eee7", "score": "0.50144875", "text": "function _showDropper(){\n $(document.body).addClass(\"dragover\");\n }", "title": "" }, { "docid": "cb00aa05e89516ddf050f5be9da79c65", "score": "0.50134224", "text": "function DropTargeter(rootElem) {\n this.rootElem = rootElem;\n this.targetsDom = null;\n this.currentBox = null;\n this.currentAffinity = null;\n this.delayedInsertion = Delay.create();\n this.activeTarget = null;\n this.autoDisposeCallback(this.removeTargetHints);\n}", "title": "" }, { "docid": "22f5b351ad6f2d199a29f075090a6834", "score": "0.5013172", "text": "configure() {\n this.element.addEventListener('dragstart', this.dragStartHandler);\n this.element.addEventListener('dragend', this.dragEndHandler);\n }", "title": "" }, { "docid": "d14f028ccf6a5348bd13b8629d1f5034", "score": "0.501249", "text": "handleDraggables(listDraggables) {\n listDraggables.forEach(object => {\n let myEl = `#${object.texture}`;\n $(myEl).on('dragstart', event => {\n //get data to transfer\n let transferData = {\n targetId: event.target.id,\n entity: object,\n gameParams: {\n x: event.pageX - Math.floor(event.target.offsetLeft),\n y: event.pageY - Math.floor(event.target.offsetTop)\n }\n };\n //attach transfer data to the event\n event.originalEvent.dataTransfer.setData(\"text\", JSON.stringify(transferData));\n event.originalEvent.dataTransfer.effectAllowed = \"move\";\n });\n });\n\n $('#droptarget')\n .on('dragover', event => {\n event.preventDefault()\n })\n .on('drop', event => {\n // event.preventDefault();\n\n //get embedded transferData\n let rawData = event.originalEvent.dataTransfer.getData(\"text\");\n let transferData = JSON.parse(rawData);\n var myBackground = $(\"#droptarget\");\n var element = $(`#${transferData.targetId}`)\n\n //create a new element in the right location\n var myClone = element.clone().prop(\"id\", `${transferData.targetId}-${this.id}`)\n myClone.appendTo(myBackground);\n myClone.css('position', \"absolute\");\n myClone.css('width', \"30%\");\n myClone.css('left', event.pageX - transferData.gameParams.x + \"px\");\n myClone.css('top', event.pageY - transferData.gameParams.y + \"px\");\n\n //delete clones\n myClone.on('contextmenu', event => {\n event.preventDefault()\n var deletedEl = $(event.target);\n delete this.levelElements[`${event.target.id}`]\n deletedEl.remove();\n })\n\n //save element into array\n this.levelElements[`${transferData.targetId}-${this.id}`] = {\n id: `${transferData.targetId}-${this.id}`,\n pos: { \"x\": event.pageX - transferData.gameParams.x, \"y\": event.pageY - transferData.gameParams.y },\n entity: transferData.entity\n }\n this.id++;\n });\n }", "title": "" }, { "docid": "2f2573690342a5588400647c6a9f7e2f", "score": "0.5009844", "text": "setupDragAndDrop2() {\n this.setDraggable(true);\n this.setDroppable(true);\n // @TODO Issue because <cntrl> is also right click. \n // this.setSelectionMode(\"multi\");\n this.addListener(\"dragstart\", (e) => {\n Cats.IDE.console.log(\"drag started. Not yet implemented!!!\");\n e.addAction(\"move\");\n e.addType(\"tree-items\");\n e.addData(\"tree-items\", this.getSelection());\n }, this);\n this.addListener(\"drop\", (e) => {\n Cats.IDE.console.log(\"Target path:\" + e.getRelatedTarget());\n for (var i = 0; i < this.getSelection().getLength(); i++) {\n Cats.IDE.console.log(\"To be moved:\" + this.getSelection().getItem(i));\n }\n }, this);\n }", "title": "" }, { "docid": "0c7f150da367a29c0e16b18ae390623b", "score": "0.49893937", "text": "function addPointerEventListeners() {\r\n var input;\r\n\r\n input = this;\r\n\r\n document.addEventListener('mouseover', handlePointerOver, false);\r\n document.addEventListener('mouseout', handlePointerOut, false);\r\n document.addEventListener('mousemove', handlePointerMove, false);\r\n document.addEventListener('mousedown', handlePointerDown, false);\r\n document.addEventListener('mouseup', handlePointerUp, false);\r\n document.addEventListener('keydown', handleKeyDown, false);\r\n // TODO: add touch support\r\n\r\n function handlePointerOver(event) {\r\n var tile;\r\n\r\n if (tile = getTileFromEvent(event)) {\r\n\r\n if (tile.element.getAttribute('data-hg-post-tile')) {\r\n // TODO: reset the other tile parameters\r\n }\r\n\r\n input.grid.setHoveredTile(tile);\r\n }\r\n }\r\n\r\n function handlePointerOut(event) {\r\n var tile;\r\n\r\n if (!event.relatedTarget || event.relatedTarget.nodeName === 'HTML') {\r\n console.log('The mouse left the viewport');\r\n\r\n input.grid.setHoveredTile(null);\r\n } else if (tile = getTileFromEvent(event)) {\r\n\r\n if (tile.element.getAttribute('data-hg-post-tile')) {\r\n // TODO: reset the other tile parameters\r\n }\r\n\r\n input.grid.setHoveredTile(null);\r\n\r\n window.hg.controller.transientJobs.HighlightHoverJob.create(input.grid, tile);\r\n\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n function handlePointerMove(event) {\r\n if (event.target.getAttribute('data-hg-post-tile')) {\r\n // TODO:\r\n } else if (event.target.getAttribute('data-hg-tile')) {\r\n // TODO:\r\n }\r\n }\r\n\r\n function handlePointerDown(event) {\r\n if (event.target.getAttribute('data-hg-post-tile')) {\r\n // TODO:\r\n }\r\n }\r\n\r\n function handlePointerUp(event) {\r\n var tile;\r\n\r\n if (event.button === 0 && (tile = getTileFromEvent(event))) {\r\n\r\n if (tile.element.getAttribute('data-hg-post-tile')) {\r\n // TODO:\r\n }\r\n\r\n createClickAnimation.call(input, input.grid, tile);\r\n }\r\n }\r\n\r\n function handleKeyDown(event) {\r\n if (event.key === 'Escape' || event.key === 'Esc') {\r\n closeOpenPost.call(input, false);\r\n }\r\n }\r\n\r\n function getTileFromEvent(event) {\r\n var tileIndex;\r\n\r\n if (event.target.getAttribute('data-hg-tile')) {\r\n tileIndex = event.target.getAttribute('data-hg-index');\r\n return input.grid.allTiles[tileIndex];\r\n } else if (event.target.parentElement.getAttribute('data-hg-tile')) {\r\n tileIndex = event.target.parentElement.getAttribute('data-hg-index');\r\n return input.grid.allTiles[tileIndex];\r\n } else {\r\n return null;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "575a60ee9b13ba2ce850591c16277d7e", "score": "0.4986848", "text": "_onDragOver(event) {\n // let itemId = event.currentTarget.getAttribute(\"data-item-id\");\n\n // if(!itemId)\n // return;\n\n // let item = $('#'+itemId);\n\n // if(item == null)\n // return;\n\n // item.fadeIn(150);\n // setTimeout(function(){\n // item.style.visibility = \"visible\";\n // }, 100);\n }", "title": "" }, { "docid": "9037e15ccab61fb43e8a95426d147b04", "score": "0.49755356", "text": "dragEnter(ev) {\n this.dragOver(ev);\n }", "title": "" }, { "docid": "e105c19d06ae95d20e2bae8d3d5901d0", "score": "0.49728012", "text": "tapEventOn(e){if(typeof this.hoverClass!==typeof void 0){var classes=this.hoverClass.split(\" \");classes.forEach((item,index)=>{if(\"\"!=item){this.$.flyouttrigger.classList.add(item)}})}}", "title": "" }, { "docid": "54a2a1bba4a4fc95a0e75c660f93b773", "score": "0.4966986", "text": "function jfuDropZone() {\r\n\r\n\t\tvar counter = 0;\r\n\t\tdropZone.bind({\r\n\t\t\tdragenter: function(e) {\r\n\t\t\t\te.preventDefault(); // needed for IE\r\n\t\t\t\tcounter++;\r\n\t\t\t\t$(this).addClass('in hover');\r\n\t\t\t},\r\n\t\t\tdragleave: function() {\r\n\t\t\t\tcounter--;\r\n\t\t\t\tif (counter === 0) {\r\n\t\t\t\t\t$(this).removeClass('in hover');\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdrop: function () {\r\n\t\t\t\t$(this).removeClass('in hover');\r\n\t\t\t}\r\n\t\t});\r\n\r\n }", "title": "" }, { "docid": "8a502cf0921f82de88262a38839134f2", "score": "0.49668595", "text": "onDrag({\n context,\n event\n }) {\n const me = this,\n targetHeader = IdHelper.fromElement(event.target, 'header'); // If SubGrid is configured with a sealed column set, do not allow moving into it\n\n if (targetHeader && targetHeader.subGrid.sealedColumns) {\n context.valid = false;\n return;\n } // Require that we drag inside grid header while dragging if we don't have a drag toolbar\n\n if (!me.grid.features.columnDragToolbar) {\n context.valid = Boolean(event.target.closest('.b-grid-headers'));\n }\n }", "title": "" }, { "docid": "388086f379a914a1a55fd938337b75c0", "score": "0.49626416", "text": "function dropTask(ev) {\r\n\r\n\t// prevent dropping into other tasks...\r\n\tif (ev.target.getAttribute(\"class\") != \"station_tasks\") {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// target is a station..\r\n\tev.preventDefault();\r\n\tvar data = ev.dataTransfer.getData(\"text\");\r\n\tvar task_container = document.getElementById(data);\r\n\tvar station_container = ev.target;\r\n\r\n\t// identify station and task for board update purpose\r\n\tvar station_id = station_container.getAttribute(\"id\").replace(\"s\", \"\");\r\n\tvar task_id = task_container.getAttribute(\"id\").replace(\"t\", \"\");\r\n\tvar board_id = currentBoard.id;\r\n\t// drop it.\r\n\tmoveTask(task_id, station_id, board_id);\r\n\tev.target.appendChild(task_container);\r\n\r\n}", "title": "" }, { "docid": "aeb511a22aad4463892dc82ca97bceed", "score": "0.49622875", "text": "function dropStation(ev) {\r\n\t// prevent dropping into other tasks...\r\n\tif (ev.target.getAttribute(\"id\") != \"board_stations\")\r\n\t\treturn;\r\n\t// target is the board.\r\n\tev.preventDefault();\r\n\tvar data = ev.dataTransfer.getData(\"text\");\r\n\tvar station_container = document.getElementById(data);\r\n\tvar board_container = ev.target;\r\n\t// identify for update purposes\r\n\tvar board_id = board_container.getAttribute(\"id\");\r\n\tvar station_id = station_container.getAttribute(\"id\");\r\n\t// drop it.\r\n\tconsole.log(\"station '\" + station_id + \"' dropped into board '\" + board_id\r\n\t\t\t+ \"'.\");\r\n\tev.target.appendChild(task_container);\r\n\r\n}", "title": "" }, { "docid": "6bbb6c070a1cb90b28fbcc8c1701de0c", "score": "0.49430278", "text": "startTranslateDrag(event) {\n const me = this,\n context = me.context,\n {\n relatedElements\n } = context;\n let element = context.dragProxy || context.element;\n\n if (element && !context.started) {\n const grabbed = element,\n grabbedParent = element.parentElement,\n // When cloning an element to be dragged, we place it in BODY by default\n dragWithin = me.dragWithin = me.dragWithin || me.cloneTarget && document.body,\n outerElement = me.outerElement;\n\n if (me.cloneTarget) {\n const offsetX = DomHelper.getOffsetX(element, dragWithin),\n offsetY = DomHelper.getOffsetY(element, dragWithin),\n offsetWidth = element.offsetWidth,\n offsetheight = element.offsetHeight;\n element = this.createProxy(element); // Match the grabbed element's size and position.\n\n DomHelper.setTranslateXY(element, offsetX, offsetY);\n element.style.width = `${offsetWidth}px`;\n element.style.height = `${offsetheight}px`;\n element.classList.add(me.dragProxyCls);\n dragWithin.appendChild(element);\n grabbed.classList.add('b-drag-original');\n\n if (me.hideOriginalElement) {\n grabbed.classList.add('b-hidden');\n }\n }\n\n Object.assign(me.context, {\n // The element which we're moving, could be a cloned version of grabbed, or the grabbed element itself\n element,\n // The original element upon which the mousedown event triggered a drag operation\n grabbed,\n // The parent of the original element where the pointerdown was detected - to be able to restore after an invalid drop\n grabbedParent,\n // The next sibling of the original element where the pointerdown was detected - to be able to restore after an invalid drop\n grabbedNextSibling: element.nextElementSibling,\n // elements position within parent element\n elementStartX: DomHelper.getTranslateX(element),\n elementStartY: DomHelper.getTranslateY(element),\n elementX: DomHelper.getOffsetX(element, dragWithin || outerElement),\n elementY: DomHelper.getOffsetY(element, dragWithin || outerElement),\n scrollX: 0,\n scrollY: 0,\n scrollManagerElementContainsDragProxy: !me.cloneTarget || dragWithin === outerElement\n });\n element.classList.add(me.draggingCls);\n\n if (dragWithin) {\n context.parentElement = element.parentElement;\n\n if (dragWithin !== element.parentElement) {\n dragWithin.appendChild(element);\n }\n\n me.updateTranslateProxy(event);\n }\n\n if (relatedElements) {\n relatedElements.forEach(r => {\n r.classList.add(me.draggingCls);\n });\n }\n }\n }", "title": "" }, { "docid": "7f7ded5252d35d1fd18132a0c5610699", "score": "0.49411923", "text": "onMouseUp(event) {\n event.preventDefault();\n\n this.nodes.forEach(node => node.input.setFocusable(true));\n\n let eventPos = this.eventPos(event);\n let x = eventPos.x;\n let y = eventPos.y;\n\n this.mouseDown = false;\n this.cameraDrag = false;\n this.resizing = false;\n this.justClicked = null;\n\n let mouseTime = new Date().getTime() - this.mouseDownTime;\n if (mouseTime <= 200)\n this.onClick(event);\n\n if (this.tempConnection != null) {\n let hoverPlug = null;\n this.nodes.forEach(node => {\n node.forEachPlug(plug => {\n let h = plug.isInBounds(x, y);\n\n if (h)\n hoverPlug = plug;\n });\n })\n\n if (hoverPlug != null) {\n if (this.tempConnection.outputPlug\n .canReplaceConnection(hoverPlug)) {\n let list = this.findConnections({ inputPlug: hoverPlug });\n if (list.length > 0)\n this.removeConnection(list[0]);\n\n this.addConnection(this.tempConnection.outputPlug,\n hoverPlug);\n }\n }\n\n this.tempConnection = null;\n this.repaint = true;\n }\n\n this.nodes.forEach(node => {\n node.dragging = false;\n node.position.setFrom(node.snapPos);\n });\n }", "title": "" }, { "docid": "53afa44add2e781ee1ac8aae8b239aba", "score": "0.49337032", "text": "function onDropEl(event) {\n insertBeforeEl = event.currentTarget;\n if (dragSrcEl != event.currentTarget) {\n var targetEl = event.currentTarget.innerHTML;\n event.currentTarget.innerHTML = dragSrcEl.innerHTML;\n dragSrcEl.innerHTML = targetEl;\n }\n}", "title": "" }, { "docid": "014d80a987a880557b134e4a45877d88", "score": "0.49311388", "text": "constructor(props) {\n super(props);\n\n this.uuid = _.uniqueId();\n\n this.onDocumentDragOver = this.onDocumentDragOver.bind(this);\n this.onDocumentDrop = this.onDocumentDrop.bind(this);\n this.onDocumentDetectDrop = this.onDocumentDetectDrop.bind(this);\n this.onDocumentDragEnd = this.onDocumentDragEnd.bind(this);\n this.focusRightModuleCell = this.focusRightModuleCell.bind(this);\n this.focusLeftModuleCell = this.focusLeftModuleCell.bind(this);\n this.focusBottomModuleCell = this.focusBottomModuleCell.bind(this);\n this.focusTopModuleCell = this.focusTopModuleCell.bind(this);\n this.onResize = this.onResize.bind(this);\n this.onNavigateTo = this.onNavigateTo.bind(this);\n this.onPan = this.onPan.bind(this);\n this.onSwipe = this.onSwipe.bind(this);\n this.addRandomModule = this.addRandomModule.bind(this);\n this.undo = this.undo.bind(this);\n this.redo = this.redo.bind(this);\n this.toggleDesignMode = this.toggleDesignMode.bind(this);\n\n this.saveResizeDetectorRef = (ref) => { this.resizeDetectorRef = ref; };\n this.saveGridContainerRef = (ref) => { this.gridContainerRef = ref; };\n\n // this.state defined in GridNode, parent of Grid, parent of MainGrid\n this.state.gridName = props.node.getAttribute('name');\n this.state.oneScreenMode = props.screenMode !== BaseMainGrid.screenModes.multi;\n if (this.state.oneScreenMode) {\n Actions.enterOneScreenMode(this.state.gridName);\n }\n }", "title": "" }, { "docid": "569face4c7c4d8579e3106b4aca430eb", "score": "0.49283677", "text": "function dropzone_dragOverHandler(event) {\n event.stopPropagation();\n event.preventDefault();\n \n dropzone.addClassName('dropzone-over');\n }", "title": "" }, { "docid": "651b044b260d674740994ee1e8e0981b", "score": "0.49225563", "text": "onDropFrame(e) {\r\n let data = JSON.parse( e.dataTransfer.getData( 'text' ) );\r\n let target = document.getElementById( data.id );\r\n let deltaX = e.clientX - parseInt( data.startX );\r\n let deltaY = e.clientY - parseInt( data.startY );\r\n\r\n e.preventDefault();\r\n e.stopPropagation();\r\n \r\n target.style.top = ( target.offsetTop + deltaY ) + 'px';\r\n target.style.left = ( target.offsetLeft + deltaX ) + 'px';\r\n }", "title": "" }, { "docid": "250d9c0226a9ee2176bcd2c4ff95c444", "score": "0.49217534", "text": "function attachDnDEvents() {\n\tvar draglist, elem;\n\tswitch (metricCnt.iDevice) {\n\t\tcase true:\n \t\t\tdragList = document.querySelectorAll('li.dragEnabled');\n\t\t\tfor (var i=0; i<dragList.length; i++) {\n\t\t\t\telem = dragList[i];\n\t\t\t\telem.onclick = iClick;\n\t\t\t\telem.onmouseover = '';\n\t\t\t\telem.draggable = false;\n\t\t\t\telem.style.cursor = 'default';\n\t\t\t\t}\n\t\t \tdragList = document.getElementById('section1').getElementsByTagName('div');\n\t\t\tfor (var i=0; i<dragList.length; i++) {\n\t\t\t\tdropLocations[i] = dragList[i]; // no drop event, so remember drop locations\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase false:\n\t\t\t// attach event handlers to drag sources\n \t\t\tdragList = document.getElementById('dragSources').getElementsByTagName('li'); // this approach in deference to lte IE 7\n\t\t\tfor (var i=0; i<dragList.length; i++) {\n\t\t\t\telem = dragList[i];\n\t\t\t\tif (elem.className.match(/dragEnabled/i)) {\n\t\t\t\t\telem.draggable = true;\n\t\t\t\t\telem.ondragstart = dragStart;\n\t\t\t\t\telem.ondragend = dragEnd;\n\t\t\t\t\t}\n\t\t\t}\n\t\t // attach handlers to drop targets\n\t\t \tdragList = document.getElementById('section1').getElementsByTagName('div'); // cross-browser incl lte IE 7\n\t\t\tfor (var i=0; i<dragList.length; i++) {\n\t\t\t\tvar elem = dragList[i];\n\t\t\t\telem.draggable = true;\n\t\t\t\telem.ondragstart = dragStart;\n\t\t\t\telem.ondragend = dragEnd;\n\t\t\t\telem.ondragenter = dragEnter;\n\t\t\t\telem.ondragleave = dragLeave;\n\t\t\t\telem.ondragover = dragOver;\n\t\t\t\telem.ondrop = dragDrop;\n\t\t\t\t}\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "0f90c27e254938ec3331f8e42e06d2ae", "score": "0.4918959", "text": "function SetupPanelHoverEvents( panel, ancestorPanel, className )\r\n{\r\n\tpanel.SetPanelEvent( \r\n\t\t'onmouseover', \r\n\t\tfunction() {\r\n\t\t\tancestorPanel.AddClass( className );\r\n\t\t} \r\n\t);\r\n\tpanel.SetPanelEvent( \r\n\t\t'onmouseout', \r\n\t\tfunction() {\r\n\t\t\tancestorPanel.RemoveClass( className );\r\n\t\t} \r\n\t);\r\n}", "title": "" }, { "docid": "1843bcb1e8bfbba855549f008ed43c81", "score": "0.4910228", "text": "handleEvent(event) {\n switch (event.type) {\n case 'p-dragenter':\n this._evtDragEnter(event);\n break;\n case 'p-dragleave':\n this._evtDragLeave(event);\n break;\n case 'p-dragover':\n this._evtDragOver(event);\n break;\n case 'p-drop':\n this._evtDrop(event);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "fc183ad4b7660f38ec2e3057e655b73e", "score": "0.49095377", "text": "_dragEnd(e) {\n this.crt.remove();\n setTimeout(() => {\n let children = window.HaxStore.instance.activeHaxBody.querySelectorAll(\n \".hax-mover, .hax-hovered, .hax-moving, .grid-plate-active-item\"\n );\n // walk the children and apply the draggable state needed\n for (var i in children) {\n if (typeof children[i].classList !== typeof undefined) {\n children[i].classList.remove(\n \"hax-mover\",\n \"hax-hovered\",\n \"hax-moving\",\n \"grid-plate-active-item\"\n );\n }\n }\n setTimeout(() => {\n this._itemSelected(e);\n }, 100);\n }, 0);\n }", "title": "" }, { "docid": "d26c062ffd290f0114c7b5cd98062716", "score": "0.48911345", "text": "function drop(e) {\n e.preventDefault()\n listColumns.forEach(column => column.classList.remove('over'))\n const parent = listColumns[currentColumn]\n parent.appendChild(draggedItem)\n dragging = false\n rebuildArrays()\n}", "title": "" }, { "docid": "5d541ef3e01a9436484bfc0cc8e10fc6", "score": "0.4885932", "text": "_evtDragEnter(event) {\n if (event.mimeData.hasData(CONTENTS_MIME)) {\n let index = algorithm_lib[\"ArrayExt\"].findFirstIndex(this._crumbs, node => domutils_lib[\"ElementExt\"].hitTest(node, event.clientX, event.clientY));\n if (index !== -1) {\n if (index !== crumbs_Private.Crumb.Current) {\n this._crumbs[index].classList.add(DROP_TARGET_CLASS);\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n }", "title": "" }, { "docid": "7903dea687c6d1ee84829b6b09332dca", "score": "0.4884845", "text": "function dragEnter() {\n // console.log('Event: ', 'dragenter');\n this.classList.add('over');\n}", "title": "" }, { "docid": "38210ae0fba93914ce4f580f3576e270", "score": "0.4878141", "text": "onDragOverTile (e) {\n // We have to tell the browser that dragging is allowed, by\n // disabling the normal mouse interactions.\n e.preventDefault();\n }", "title": "" }, { "docid": "07e9415e0277aff0ccb06ad2f5cdb95c", "score": "0.4877751", "text": "function TargetaResultados() {\n\n this.toolbar = new Toolbar()\n this.grid = new GridPrincipal()\n}", "title": "" }, { "docid": "07e9415e0277aff0ccb06ad2f5cdb95c", "score": "0.4877751", "text": "function TargetaResultados() {\n\n this.toolbar = new Toolbar()\n this.grid = new GridPrincipal()\n}", "title": "" }, { "docid": "25520f540dc48e6a62177b9acc2a6443", "score": "0.4877325", "text": "function bkmkDragEnterHandler (e) {\n let target = e.target;\n let dt = e.dataTransfer;\n//console.log(\"Drag enter event: \"+e.type+\" target: \"+target+\" id: \"+target.id+\" class: \"+target.classList);\n // Handle drag scrolling inhibition\n handleBkmkDragScroll(EnterEvent, e);\n if (((target.className == undefined) // When on Text, className and classList are undefined.\n\t || (target.className.length > 0)\n\t )\n\t && checkDragType(dt)\n ) {\n\t// Get the enclosing row and bkmkitem_x inside it which we will highlight\n\t// Note: when the mouse is over the lifts, an HTMLDivElement is returned\n\tlet row = getDragToRow(target);\n//console.log(\"Enter row: \"+row+\" class: \"+row.classList+\" BN_id: \"+row.dataset.id);\n//console.log(\"Bkmkitem_x: \"+bkmkitem_x+\" class: \"+bkmkitem_x.classList);\n\tif (row == undefined) { // We are on the scrollbars for example\n\t highlightRemove(e);\n\t dt.dropEffect = \"none\"; // Signal drop not allowed\n\t}\n\telse {\n\t let is_ctrlKey = e.ctrlKey;\n\t if ((!is_ctrlKey && (noDropZone != undefined) && noDropZone.isInZone(row.rowIndex))\n\t\t || (isProtected && !isTopItem) // Protection, can't drop on non top draggable elements = specials\n\t ) {\n\t\thighlightRemove(e);\n\t\tdt.dropEffect = \"none\"; // Signal drop not allowed\n\t }\n\t else {\n\t\te.preventDefault(); // Allow drop\n\t\thighlightInsert(e);\n\t\tif (isBkmkItemDragged) { // For internal drags, take Ctrl key into account to change visual feedback\n\t\t dt.dropEffect = (is_ctrlKey ? \"copy\" : \"move\");\n\t\t}\n\t }\n\t}\n }\n else {\n\thighlightRemove(e);\n\tdt.dropEffect = \"none\"; // Signal drop not allowed\n }\n}", "title": "" }, { "docid": "2ed3ac5c109fdb5b9ccc935d44d365b7", "score": "0.4876364", "text": "handleEvent(event) {\n if (this.isHidden || this.isDisposed) {\n return;\n }\n const { node } = this;\n const target = event.target;\n switch (event.type) {\n case 'keydown':\n if (node.contains(target)) {\n return;\n }\n this.dispose();\n break;\n case 'mousedown':\n if (node.contains(target)) {\n this.activate();\n return;\n }\n this.dispose();\n break;\n case 'scroll':\n this._evtScroll(event);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "7fe4dba9d28ae7454b6d6218122b2982", "score": "0.48762617", "text": "_evtDragEnter(event) {\n if (this.editor.getOption('readOnly') === true) {\n return;\n }\n const data = Private.findTextData(event.mimeData);\n if (data === undefined) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.addClass('jp-mod-dropTarget');\n }", "title": "" }, { "docid": "4547043a80b707b73dc1742ede85e8f4", "score": "0.487523", "text": "function drop(target){ //alert(\"drop()\");\n \n var cBounds;\n var shiftX, shiftY;\n var globalPt;\n \n //determine how much target is shifted in container, relative to 0,0 of container\n shiftX = (dContainer.width - target.width) /2;\n shiftY = drone.height;\n \n //convert this shifted position into an x,y relative to stage\n globalPt = target.localToGlobal(target.x-shiftX, target.y-shiftY);\n \n //update properties to reflect having been dropped\n target.direction = dContainer.direction; //moves in same direction as parent\n target.speedY = dContainer.speedY*2; //falls faster downward than parent\n target.speedX = dContainer.speedX; //falls horizontally at same speed as parent\n target.carried = false; //no longer carried\n \n \n //move target to calculated position relative stage\n target.x = target.nextX = globalPt.x;\n target.y = target.nextY = globalPt.y;\n \n //adjusts target bounds to match new position\n target.setBounds(target.x, target.y, target.width, target.height);\n \n //add target to stage\n stage.addChild(target); //adding to stage removes from dContainer\n \n //check whether to add target to movingArr\n if(dContainer.landed && drone.landed){ //drone is landed but parcel is hanging\n movingArr.push(target);\n target.landed = false;\n }\n else if(!dContainer.landed){ //mid-air drop\n movingArr.push(target);\n target.landed = false;\n }\n else { //drop while having landed on the ground\n gameObjectsArr.push(parcel);\n target.landed = true;\n }\n \n //update dContainer properties to reflect no longer carrying target\n dContainer.height -= target.height; //remove extra height\n \n //update dContainer bounds\n cBounds = dContainer.getBounds();\n dContainer.setBounds(cBounds.x, cBounds.y, cBounds.width, dContainer.height);\n}", "title": "" }, { "docid": "7f223d926985e9cd23d0c404eb06ffc7", "score": "0.48704377", "text": "init() {\n const me = this,\n {\n grid\n } = me;\n me.dragHelper = new DragHelper({\n name: 'rowReorder',\n mode: 'translateXY',\n cloneTarget: true,\n dragThreshold: 10,\n targetSelector: '.b-grid-row',\n lockX: true,\n transitionDuration: grid.transitionDuration,\n scrollManager: grid.scrollManager,\n dragWithin: grid.verticalScroller,\n outerElement: grid.verticalScroller,\n // Since parent nodes can expand after hovering, meaning original drag start position now refers to a different point in the tree\n ignoreSamePositionDrop: false,\n\n createProxy(element) {\n const clone = element.cloneNode(true),\n container = document.createElement('div');\n clone.removeAttribute('id'); // The containing element will be positioned instead\n\n clone.style.transform = '';\n container.appendChild(clone);\n return container;\n },\n\n listeners: {\n beforedragstart: me.onBeforeDragStart,\n dragstart: me.onDragStart,\n drag: me.onDrag,\n drop: me.onDrop,\n reset: me.onReset,\n prio: 10000,\n // To ensure our listener is run before the relayed listeners (for the outside world)\n thisObj: me\n }\n });\n me.dropIndicator = DomHelper.createElement({\n parent: grid.bodyContainer,\n className: 'b-row-drop-indicator'\n });\n me.relayEvents(me.dragHelper, ['beforeDragStart', 'dragStart', 'drag', 'abort'], 'gridRow');\n }", "title": "" }, { "docid": "e2a424d39cd4f1a0478208a4dc98a257", "score": "0.48659304", "text": "function dragging() {\n\n $$('#devices .device_block').addEvent('mousedown', function(event) {\n event.stop();\n\n // This refers to element with 'device_block' class\n var device = this;\n \n var clone = device.clone().setStyles(device.getCoordinates()).setStyles({\n opacity: 0.9,\n position: 'absolute'\n }).inject(document.body);\n\n var drag = new Drag.Move(clone, {\n\n droppables: $('drop_device'),\n\n onDrop: function(dragging, drop) {\n dragging.destroy();\n\n if (drop != null && !in_drop(device.getFirst().innerHTML)) {\n device.clone().inject(drop);\n add_device(device.getFirst().innerHTML, device.getElement('img').src);\n }\n\n if (drop)\n drop.tween('background-color', '#E0E0E0');\n\n if (drop && drop.contains($('drop_inner')))\n $('drop_inner').destroy();\n },\n onEnter: function(dragging, drop) {\n drop.tween('background-color', '#98B5C1');\n },\n onLeave: function(dragging, drop) {\n drop.tween('background-color', '#E0E0E0');\n },\n onCancel: function(dragging) {\n dragging.destroy();\n }\n });\n\n drag.start(event);\n });\n}", "title": "" }, { "docid": "499c35847ec506a0a9563f90143220da", "score": "0.48637", "text": "_dragStart(e) {\n // We use this check te prevent the issue that multiple\n // Event handlers are attached to the copied element.\n if(this.dragStarted) {\n return;\n }\n\n this.dragStarted = true;\n\n if(e.target.parentElement.classList.contains(\"dropZone\")) {\n this.element = e.target;\n } else {\n if(this.double_colors_enabled) {\n this.element = e.target.cloneNode(true);\n this._applyDraggableEvents(this.element);\n } else {\n this.element = e.target;\n }\n }\n e.dataTransfer.setData(\"text\", e.target.id);\n\n this.dragZone.classList.add(\"drag-zone-delete\");\n }", "title": "" }, { "docid": "c74caf495b9c8d92355f2f78594becb5", "score": "0.4861814", "text": "_evtDrop(event) {\n if (!event.mimeData.hasData(JUPYTER_CELL_MIME)) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n if (event.proposedAction === 'none') {\n event.dropAction = 'none';\n return;\n }\n let target = event.target;\n while (target && target.parentElement) {\n if (target.classList.contains(DROP_TARGET_CLASS)) {\n target.classList.remove(DROP_TARGET_CLASS);\n break;\n }\n target = target.parentElement;\n }\n let source = event.source;\n if (source === this) {\n // Handle the case where we are moving cells within\n // the same notebook.\n event.dropAction = 'move';\n let toMove = event.mimeData.getData('internal:cells');\n // Compute the to/from indices for the move.\n let fromIndex = _phosphor_algorithm__WEBPACK_IMPORTED_MODULE_0__[\"ArrayExt\"].firstIndexOf(this.widgets, toMove[0]);\n let toIndex = this._findCell(target);\n // This check is needed for consistency with the view.\n if (toIndex !== -1 && toIndex > fromIndex) {\n toIndex -= 1;\n }\n else if (toIndex === -1) {\n // If the drop is within the notebook but not on any cell,\n // most often this means it is past the cell areas, so\n // set it to move the cells to the end of the notebook.\n toIndex = this.widgets.length - 1;\n }\n // Don't move if we are within the block of selected cells.\n if (toIndex >= fromIndex && toIndex < fromIndex + toMove.length) {\n return;\n }\n // Move the cells one by one\n this.model.cells.beginCompoundOperation();\n if (fromIndex < toIndex) {\n Object(_phosphor_algorithm__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(toMove, cellWidget => {\n this.model.cells.move(fromIndex, toIndex);\n });\n }\n else if (fromIndex > toIndex) {\n Object(_phosphor_algorithm__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(toMove, cellWidget => {\n this.model.cells.move(fromIndex++, toIndex++);\n });\n }\n this.model.cells.endCompoundOperation();\n }\n else {\n // Handle the case where we are copying cells between\n // notebooks.\n event.dropAction = 'copy';\n // Find the target cell and insert the copied cells.\n let index = this._findCell(target);\n if (index === -1) {\n index = this.widgets.length;\n }\n let start = index;\n let model = this.model;\n let values = event.mimeData.getData(JUPYTER_CELL_MIME);\n let factory = model.contentFactory;\n // Insert the copies of the original cells.\n model.cells.beginCompoundOperation();\n Object(_phosphor_algorithm__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(values, (cell) => {\n let value;\n switch (cell.cell_type) {\n case 'code':\n value = factory.createCodeCell({ cell });\n break;\n case 'markdown':\n value = factory.createMarkdownCell({ cell });\n break;\n default:\n value = factory.createRawCell({ cell });\n break;\n }\n model.cells.insert(index++, value);\n });\n model.cells.endCompoundOperation();\n // Select the inserted cells.\n this.deselectAll();\n this.activeCellIndex = start;\n this.extendContiguousSelectionTo(index - 1);\n }\n }", "title": "" }, { "docid": "fa4754d71dd64de2d18504d3bbbcccdd", "score": "0.4856689", "text": "addCustomEventListeners(target) {\r\n target.addEventListener(\r\n 'touchdragstart', this.handleTopDragStart\r\n );\r\n target.addEventListener(\r\n 'touchdragstart', this.handleTopDragStartCapture, true\r\n );\r\n target.addEventListener(\r\n 'touchdragend', this.handleTopDragEndCapture, true\r\n );\r\n target.addEventListener(\r\n 'touchdragenter', this.handleTopDragEnter\r\n );\r\n target.addEventListener(\r\n 'touchdragenter', this.handleTopDragEnterCapture, true\r\n );\r\n target.addEventListener(\r\n 'touchdragleave', this.handleTopDragLeaveCapture, true\r\n );\r\n target.addEventListener(\r\n 'touchdragover', this.handleTopDragOver\r\n );\r\n target.addEventListener(\r\n 'touchdragover', this.handleTopDragOverCapture, true\r\n );\r\n target.addEventListener(\r\n 'touchdrop', this.handleTopDrop\r\n );\r\n target.addEventListener(\r\n 'touchdrop', this.handleTopDropCapture, true\r\n );\r\n }", "title": "" }, { "docid": "32e3034e9ec95dc407939b22f18c5f6e", "score": "0.4854103", "text": "function handleDrop(owner, widget, target) {\r\n\t // Do nothing if the dock zone is invalid.\r\n\t if (target.zone === 10 /* Invalid */) {\r\n\t return;\r\n\t }\r\n\t // Handle the simple case of root drops first.\r\n\t switch (target.zone) {\r\n\t case 0 /* RootTop */:\r\n\t owner.insertTop(widget);\r\n\t return;\r\n\t case 1 /* RootLeft */:\r\n\t owner.insertLeft(widget);\r\n\t return;\r\n\t case 2 /* RootRight */:\r\n\t owner.insertRight(widget);\r\n\t return;\r\n\t case 3 /* RootBottom */:\r\n\t owner.insertBottom(widget);\r\n\t return;\r\n\t case 4 /* RootCenter */:\r\n\t owner.insertLeft(widget);\r\n\t return;\r\n\t }\r\n\t // Otherwise, it's a panel drop, and that requires more checks.\r\n\t // Do nothing if the widget is dropped as a tab on its own panel.\r\n\t if (target.zone === 9 /* PanelCenter */) {\r\n\t if (target.panel.childIndex(widget) !== -1) {\r\n\t return;\r\n\t }\r\n\t }\r\n\t // Do nothing if the panel only contains the drop widget.\r\n\t if (target.panel.childCount() === 1) {\r\n\t if (target.panel.childAt(0) === widget) {\r\n\t return;\r\n\t }\r\n\t }\r\n\t // Find a suitable reference widget for the drop.\r\n\t var n = target.panel.childCount();\r\n\t var ref = target.panel.childAt(n - 1);\r\n\t if (ref === widget) {\r\n\t ref = target.panel.childAt(n - 2);\r\n\t }\r\n\t // Insert the widget based on the panel zone.\r\n\t switch (target.zone) {\r\n\t case 5 /* PanelTop */:\r\n\t owner.insertTop(widget, ref);\r\n\t return;\r\n\t case 6 /* PanelLeft */:\r\n\t owner.insertLeft(widget, ref);\r\n\t return;\r\n\t case 7 /* PanelRight */:\r\n\t owner.insertRight(widget, ref);\r\n\t return;\r\n\t case 8 /* PanelBottom */:\r\n\t owner.insertBottom(widget, ref);\r\n\t return;\r\n\t case 9 /* PanelCenter */:\r\n\t owner.insertTabAfter(widget, ref);\r\n\t selectWidget(widget);\r\n\t return;\r\n\t }\r\n\t }", "title": "" }, { "docid": "9c142d177dc1c3bb2849126340fb26c2", "score": "0.48463318", "text": "function bkmkDragOverHandler (e) {\n let target = e.target;\n let dt = e.dataTransfer;\n if (isLinux) {\n\tcurBkmkTarget = target;\n\tcurBkmkDt = dt;\n }\n//console.log(\"Drag over event: \"+e.type+\" target: \"+target+\" id: \"+target.id+\" class: \"+target.classList);\n // Handle drag scrolling inhibition\n handleBkmkDragScroll(OverEvent, e);\n if (((target.className == undefined) // When on Text, className and classList are undefined.\n\t || (target.className.length > 0)\n\t )\n\t && checkDragType(dt)\n ) {\n\t// Get the enclosing row\n\t// Note: when the mouse is over the lifts, an HTMLDivElement is returned\n\tlet row = getDragToRow(target);\n//console.log(\"Over row: \"+row+\" class: \"+row.classList+\" BN_id: \"+row.dataset.id);\n//console.log(\"Bkmkitem_x: \"+bkmkitem_x+\" class: \"+bkmkitem_x.classList);\n\tif (row == undefined) { // We are on the scrollbars for example\n\t highlightRemove(e);\n\t dt.dropEffect = \"none\"; // Signal drop not allowed\n\t}\n\telse {\n\t let is_ctrlKey = e.ctrlKey;\n\t if ((!is_ctrlKey && (noDropZone != undefined) && noDropZone.isInZone(row.rowIndex))\n\t\t || (isProtected && !isTopItem) // Protection, can't drop on non top draggable elements = specials\n\t ) {\n\t\thighlightRemove(e);\n\t\tdt.dropEffect = \"none\"; // Signal drop not allowed\n\t }\n\t else {\n\t\te.preventDefault(); // Allow drop\n\t\thighlightInsert(e);\n\t\tif (isBkmkItemDragged) { // For internal drags, take Ctrl key into account to change visual feedback\n\t\t dt.dropEffect = (is_ctrlKey ? \"copy\" : \"move\");\n\t\t}\n\t }\n\t}\n }\n else {\n\thighlightRemove(e);\n\tdt.dropEffect = \"none\"; // Signal drop not allowed\n }\n}", "title": "" }, { "docid": "52c73db552aaee2f18a774bc771be995", "score": "0.4846128", "text": "function grid_hover() {\n\n // Get list of grid div elements\n let grid_list = document.querySelectorAll('.grid');\n\n // Iterate through each button, add hover event listener\n grid_list.forEach((grid) => {\n\n // Hover listener\n grid.addEventListener('mouseover', (event) => {\n\n grid.style.backgroundColor = 'powderblue';\n });\n });\n}", "title": "" }, { "docid": "d7840a30a56af7a33324dad18ed34a94", "score": "0.4836768", "text": "function dynamicallyAddDropInteraction(dropArea,dropItem)\n{\n interact(dropArea).dropzone({\n // only accept elements matching this CSS selector\n accept: '.items',\n \n // Require a 75% element overlap for a drop to be possible\n overlap: 0.75,\n\n // listen for drop related events:\n\n ondropactivate: function (event) {\n // add active dropzone feedback\n // event.target.classList.add('drop-active');\n },\n ondragenter: function (event) {\n var draggableElement = event.relatedTarget,\n dropzoneElement = event.target;\n\n // feedback the possibility of a drop\n dropzoneElement.classList.add('drop-target');\n draggableElement.classList.add('can-drop');\n draggableElement.textContent = 'Dragged in';\n },\n ondragleave: function (event) {\n // remove the drop feedback style\n event.target.classList.remove('drop-target');\n\n event.relatedTarget.classList.remove('can-drop');\n event.relatedTarget.textContent = 'Dragged out';\n\n\n },\n ondrop: function (event) {\n event.relatedTarget.textContent = 'Dropped';\n console.log(dropItem+event.relatedTarget.classList+event.relatedTarget.classList.contains(dropItem));\n if(event.relatedTarget.classList.contains(dropItem))\n {\n event.relatedTarget.parentNode.removeChild(event.relatedTarget);\n }\n },\n ondropdeactivate: function (event) {\n // remove active dropzone feedback\n event.target.classList.remove('drop-active');\n event.target.classList.remove('drop-target');\n }\n });\n}", "title": "" } ]
8229a2ec02e77ab1e638d1a3d47c2357
load vessels list from localStorage or dropbox
[ { "docid": "db569e16812c763f873fe105da51529c", "score": "0.8302592", "text": "function loadVesselsList() {\n //localStorage.removeItem(\"vessels\");\n if (localStorage.getItem(\"vessels\")) {\n vessels = JSON.parse(localStorage.getItem(\"vessels\"));\n } else {\n //check internet connection and load\n if (navigator.onLine) {\n document.getElementById(\"status\").innerHTML = \"online\"; \n //TODO load vessels' list from dropbox\n loadVessels();\n } else {\n document.getElementById(\"status\").innerHTML = \"offline\";\n }\n }\n}", "title": "" } ]
[ { "docid": "59c1e5347b6312088ed72116e02f08ca", "score": "0.76924086", "text": "function loadVessels() {\n var request = new XMLHttpRequest();\n request.open(\"GET\", \"vessels.json\", false);\n request.send(null);\n vessels = JSON.parse(request.responseText); \n localStorage.setItem(\"vessels\", JSON.stringify(vessels));\n}", "title": "" }, { "docid": "f42d5a6a3a3d6bf428cb8dda1d624939", "score": "0.7003714", "text": "function divelistToLocalStorage() {\n var listName = $(\"#divelist-savename\").html();\n localStorage.setItem(listName, JSON.stringify(divelist));\n $(\"#dropdown-load\").html($(\"#dropdown-load\").html()+\"<option>\"+listName+\"</option>\");\n localStorage.currentList = listName;\n}", "title": "" }, { "docid": "2a5ab23472991fccd75a4d76ba3557ba", "score": "0.6936723", "text": "function getListFromLocal() {\n var productList = localStorage.getItem(\"productList\");\n if(productList != null) {\n adapter.setProductList(JSON.parse(productList));\n }\n }", "title": "" }, { "docid": "2a6d415095073dd7caad46fc4a3b0358", "score": "0.69032216", "text": "function loadFromStorage(){\n\tvar items;\n\n//\talert(localStorage['test']);\n\tif(localStorage['saleList']){\n\t\titems = JSON.parse(localStorage['saleList']);\n\n\t\t$(items).each(function(index){\n\t\t\t//alert(items[index]);\n\t\t\t$('#listItems').append(items[index]);\n\t\t});\n\t}\n\n\t//load data back into 'fullListItem' object for use in postToPreview()\n\tif(localStorage['savedDescription']){\n\t\tfullListItem = JSON.parse(localStorage['savedDescription']);\n\t\t\n\t\t//update listCounter with accurate number of \n\t\t$('#listItems li').each(function(){\n\t\t\tlistCounter++;\n\t\t});\n\n\t}\n\n}", "title": "" }, { "docid": "635c4ce923b15616ab389259c051a6c6", "score": "0.6829726", "text": "function populateList(event) {\n setList(JSON.parse(localStorage.getItem(\"playerList\")));\n }", "title": "" }, { "docid": "7e415f9f879f1046c2a7c5f6d5b5a6ec", "score": "0.6829413", "text": "loadLists() {\n\t\tlet saved = JSON.parse(localStorage.getItem('lists'))\n\t\tif (saved) {\n\t\t\t_state.lists = saved;\n\t\t}\n\t}", "title": "" }, { "docid": "b63b056bf92ea8a05ce97ab9f16cc3a4", "score": "0.67711514", "text": "function loadLocalList() {\n let storedList = JSON.parse(localStorage.getItem(\"localList\"));\n if (localStorage.getItem(\"localList\") !== null) {\n var loadedList = JSON.parse(localStorage.getItem(\"localList\"));\n loadedList.forEach(key => {\n new Card(key.id, key.title, key.description);\n if (key.archive === true) {\n document.getElementById(`${key.id}`).classList.add(\"archive\");\n localStorage.setItem(\"localList\", JSON.stringify(storedList));\n }\n });\n }\n}", "title": "" }, { "docid": "57d8aa85faf8b3365659f17aa9148cd3", "score": "0.6768713", "text": "function load() {\n var str = null;\n var sel = document.getElementById('file list');\n for (var i = 0; i < sel.options.length; i++) {\n if (sel.options[i].selected) {\n str = localStorage.getItem(sel.options[i].text);\n }\n }\n if (str !== null) {\n myDiagram.model = go.Model.fromJson(str);\n myDiagram.undoManager.isEnabled = true;\n updateChairArray();\n }\n }", "title": "" }, { "docid": "9d14a5be822bda92abe5396fed02ec63", "score": "0.6708055", "text": "function getVistos() {\n return JSON.parse(localStorage.getItem(\"vistos\"))\n}", "title": "" }, { "docid": "aaf347b2185bb2207f0115a47d04a67e", "score": "0.66419154", "text": "function getItemsFromLS(){\n let items = localStorage.getItem('items')\n return (items) ? JSON.parse(items) : []\n}", "title": "" }, { "docid": "133346f7cc42278ef0ddaa6643cb065d", "score": "0.66129273", "text": "getLists() {\n let saved = JSON.parse(localStorage.getItem('list'))\n if (saved) {\n _state.list = saved;\n }\n }", "title": "" }, { "docid": "403d926b2174621a80852912f4a8b6dd", "score": "0.65692776", "text": "function getItemsFromLS(){\r\n if(localStorage.getItem('items')===null){\r\n items = [];\r\n }else {\r\n items = JSON.parse(localStorage.getItem('items'))\r\n }\r\n return items;\r\n}", "title": "" }, { "docid": "eba9ff4914afc78444a199a056c7255f", "score": "0.65530854", "text": "function showList() {\n var storedCities = JSON.parse(localStorage.getItem(\"citiesList\"));\n if (storedCities !== null) {\n citiesList = storedCities;\n }\n showCities();\n}", "title": "" }, { "docid": "3353acc92736e04c4432092bbb5ea2c3", "score": "0.65442586", "text": "async function loadLists(){\n // Get from DB\n const data = await Object(_ajax__WEBPACK_IMPORTED_MODULE_0__[\"getListsDB\"])();\n // Load into local storage\n const listObj = data.lists.reduce((total, list) => {\n total[list._id] = {\n title: list.title,\n owner: list.owner,\n created: list.created\n }\n return total;\n }, {});\n localStorage.setItem(\"lists\", JSON.stringify(listObj));\n localStorage.setItem(\"user\", JSON.stringify(data.user));\n}", "title": "" }, { "docid": "d2ba54bc7329bd9bab9e0999c8969ffb", "score": "0.6541852", "text": "function getItemsFromLS() {\r\n if (localStorage.getItem('items') === null) {\r\n items = [];\r\n } else {\r\n items = JSON.parse(localStorage.getItem('items'));\r\n }\r\n return items;\r\n}", "title": "" }, { "docid": "a4251b82be6257d28e0b911fff0338e5", "score": "0.65375954", "text": "function getList() {\n var storedList = localStorage.getItem('localList');\n if (storedList === null) {//si no hay nada se resetea con corchetes vacios\n list = [];\n } else {//si hay informacion se parsea el texto retomando los datos del LS\n list = JSON.parse(storedList); //de texto vuelve al formato que tenia\n }\n return list;\n }", "title": "" }, { "docid": "d0ebdfe7854ed9ccaa6bea14b5e34715", "score": "0.6531539", "text": "function getItemsFromLS(){\n if(localStorage.getItem('items')===null){\n items = [];\n \n }else{\n items = JSON.parse(localStorage.getItem('items'))\n }\n return items;\n}", "title": "" }, { "docid": "15f81bff64b2603d2442d4fb58da499b", "score": "0.6484183", "text": "function getFromLS(e) {\n\tlet tasks;\n\tif (localStorage.getItem('tasks') === null) {\n\t\ttasks = [];\n\t} else {\n\t\ttasks = JSON.parse(localStorage.getItem('tasks'));\n\t};\n\ttasks.forEach(function(tasksElement) {\n\t\tconst li = document.createElement('li');\n\t\tconst link = document.createElement('a');\n\t\n\t\tli.className = 'collection-item';\n\t\tli.appendChild(document.createTextNode(tasksElement));\n\n\t\n\t\tlink.className = 'secondary-content';\n\t\tlink.appendChild(document.createTextNode('X'));\n\t\tlink.setAttribute('href', '#');\n\n\t\tli.appendChild(link);\n\t\tlist.appendChild(li);\n\t});\n\tlocalStorage.setItem('tasks', JSON.stringify(tasks));\n}", "title": "" }, { "docid": "c3556d092f08f1a063c6148a831fe574", "score": "0.64787686", "text": "function getItemsFromLS() {\n if (localStorage.getItem('items')===null) {\n items = [];\n }else {\n items = JSON.parse(localStorage.getItem('items'));\n }\n\n return items;\n}", "title": "" }, { "docid": "4c7cc11469ce592793ed5d7adbdfbbf9", "score": "0.64747065", "text": "function loadList() {\n\t\tif(localStorage.getItem('todoList')) { //if was saved before load it\n\t\t\tlistMain.innerHTML = localStorage.getItem('todoList')\n\t\t}\n\t}", "title": "" }, { "docid": "54d651e1ebf1e8be1270f4fa3b79cb7a", "score": "0.6470023", "text": "function saveList() {\n\t\"use strict\";\n\tvar myList = $('ul#weapon-items').html();\n\tstore.setItem('myList', myList);\n}", "title": "" }, { "docid": "663b4c1963337c7a0f20836d934c959b", "score": "0.6462131", "text": "function initLists(){\n\t\tvar initialLists = localStorage.getItem('ixigo');\n\t\tinitialLists = JSON.parse(initialLists)\n\t\tif(initialLists && initialLists.length > 0){\n\t\t\tpopulateLists(initialLists);\n\t\t}\n\t\telse{\n\t\t\t$('#lists').html('<h3> No Lists Added </h3>')\n\t\t}\n\t}", "title": "" }, { "docid": "64fb2402299581515c916a70d86fe1fd", "score": "0.6458219", "text": "getLists() {\n let saved = JSON.parse(localStorage.getItem('lists'))\n if (saved) {\n _state.lists = saved;\n }\n }", "title": "" }, { "docid": "64fb2402299581515c916a70d86fe1fd", "score": "0.6458219", "text": "getLists() {\n let saved = JSON.parse(localStorage.getItem('lists'))\n if (saved) {\n _state.lists = saved;\n }\n }", "title": "" }, { "docid": "ee5bf4b5393e594e01d4fb5067bf137b", "score": "0.64366096", "text": "function onload(){\n // e.preventDefault();\n let names= localStorage.getItem('Names');\n if(names===null)\n return null\n\n console.log(names); \n \n\n\n // FOREACH() for getting individual values from the arrays.\n JSON.parse(names).forEach((content)=> {\n let list = document.createElement('li');\n list.innerHTML = content;\n document.querySelector('#listlist').appendChild(list);\n console.log(content);\n });\n\n}", "title": "" }, { "docid": "69684c2d50d93d83ded84d92ea92602c", "score": "0.64276785", "text": "function localStorageToDivelist(listName) {\n console.log(localStorage);\n divelist = JSON.parse(localStorage.getItem(listName));\n divelist_redraw();\n $(\".selected-dive\").each(function(n,selectedDive) {\n var dive = $(\"#\"+getDiveID(selectedDive));\n dive.addClass(\"selected\");\n });\n divelist_redraw();\n quicklist_redraw();\n}", "title": "" }, { "docid": "942248e49b1366c009ac4f056e785c60", "score": "0.6385738", "text": "function loadData() {\n\n\tvar productJSON = localStorage.getItem(\"price_list\");\n\tconsole.log(\"Loaded data\", productJSON);\n\n\n\t// Parse it into a Javascript data type and\n\t// save the global array\n\tproducts = JSON.parse(productJSON);\n\tconsole.log(products);\n\n\t// Double check that products is set a list if null\n\tif (!products) {\n\t\tproducts = [];\n\t}\n\n\t//Update the rendered display\n\tdisplayInventory();\n}", "title": "" }, { "docid": "3c1ea43dc81f7de76ca93ac5bb558ef9", "score": "0.63638306", "text": "function renderItems() {\n // if there is a value in localStorage under listItems\n // set listItems to the value\n // loop through them and add them to the #list \n \n }", "title": "" }, { "docid": "f186ca0e8ba239fc73c18055b872e30a", "score": "0.6340223", "text": "function loadShoppingItems(){\n\tvar list;\n/*\tif (window.localStorage.itemList)\n\t\tlist = JSON.parse(window.localStorage.itemList);\n\telse {\n\t\tlist = emptyStorage();\n\t\twindow.localStorage.itemList = JSON.stringify(list);\n\t}*/\n\n// list = [{ text:\"Salami\", ean:null}, { text:\"Mittlerer Arabica Kaffee\", ean:\"9182736451928\"}];\n list = [];\n\treturn list;\n}", "title": "" }, { "docid": "6c98cddf13384cd67607691273b4a421", "score": "0.630884", "text": "function loadLocalStorageData() {\n\tif (localStorage.getItem(\"vacationPlans\") !== null) {\n\t\tvacationPlans = JSON.parse(localStorage.getItem(\"vacationPlans\"));\n\t}\n}", "title": "" }, { "docid": "5b02a7441280525f264b68a6afd544b0", "score": "0.63058877", "text": "function loadTaskFromLS(){\r\n \r\n let taskstore;\r\n if(localStorage.getItem('tasks') === null){\r\n taskstore = [];\r\n }\r\n else{\r\n document.querySelector('#filterlist').classList.remove('hide');\r\n taskstore = JSON.parse(localStorage.getItem('tasks'));\r\n \r\n }\r\n taskstore.forEach(task=>{\r\n addTaskToWindow(task);\r\n })\r\n}", "title": "" }, { "docid": "8b8ba6c42afc58d1513b43adcc3fe88a", "score": "0.6294076", "text": "function loadDataFromLocalStorage(){\n if(LocalStorage.getFromLocalStorage(\"video\")){\n video = JSON.parse(LocalStorage.getFromLocalStorage(\"video\"));\n }\n if(LocalStorage.getFromLocalStorage(\"currentId\")){\n currentId = parseInt(LocalStorage.getFromLocalStorage(\"currentId\"));\n }\n if(LocalStorage.getFromLocalStorage(\"fragments\")){\n fragments = JSON.parse(LocalStorage.getFromLocalStorage(\"fragments\"));\n }\n }", "title": "" }, { "docid": "8c484dea1e778f90fe5b4d54512dc821", "score": "0.6289757", "text": "function loadWikiList() {\n\twikiList = JSON.parse(localStorage.wikiList || \"[]\");\n}", "title": "" }, { "docid": "5f26f3abbd52c2e9e1882914b577e962", "score": "0.62770957", "text": "created(){\n this.items = JSON.parse(localStorage.getItem('items')) || []\n }", "title": "" }, { "docid": "6be061137b17f4de8d4bcb29bfcf7fbc", "score": "0.62656236", "text": "function store() {\r\n window.localStorage.myitems = list.innerHTML;\r\n}", "title": "" }, { "docid": "986cd1fef28325997554296c489919b3", "score": "0.6259436", "text": "function loadEditSelectValues() {\n const select = document.getElementById('newParticipatingSnails');\n let snailKeys = Object.keys(localStorage).filter((key) => { return key.includes('snail_') });\n\n\n for (let i = 0; i < snailKeys.length; i++) {\n\n let parsedSnailKeys = JSON.parse(localStorage.getItem(snailKeys[i]))\n\n let name = parsedSnailKeys.name;\n\n let newOption = document.createElement('option');\n select.appendChild(newOption);\n newOption.innerHTML = name;\n }\n\n }", "title": "" }, { "docid": "7c95ec1c1ad6e01e5d0b2c6d9588c102", "score": "0.6256601", "text": "function loadItems () {\n try {\n return List(JSON.parse(window.localStorage.getItem('items')))\n } catch (e) {\n return List(['Item 1', 'Item 2'])\n }\n}", "title": "" }, { "docid": "6b29e5c38ded5448579ffac31e3a0a90", "score": "0.6217222", "text": "function storeLocalSorage(list) {\n let lists;\n if(localStorage.getItem('lists') === null) {\n lists = []\n } else {\n lists = JSON.parse(localStorage.getItem('lists'))\n }\n \n lists.push(list)\n localStorage.setItem('lists', JSON.stringify(lists))\n}", "title": "" }, { "docid": "fa4dafe5f9aa8aff68ef55c9b70ee01b", "score": "0.6194663", "text": "function loadItems() {\n\titemsArray = getStoreArray(storageName);\n\tif (itemsArray.length!=0) {\n\t\tfor (let i = 0; i < itemsArray.length; i++) {\n\t\t\tlet ul = document.getElementById(storageName);\n\t\t\tlet li = document.createElement(\"li\");\n\t\t\tli.textContent = itemsArray[i];\n\t\t\tli.onclick = function() {\n\t\t\t\tul.removeChild(li);\n\t\t\t\tclear(itemsArray[i]);\n\t\t\t};\n\t\t\tul.appendChild(li);\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "1124bfc171be0163fe7000f9a1f24199", "score": "0.6192634", "text": "function cargaLs() {\r\n if (localStorage.getItem(\"favLs\") != null) {\r\n favoritos = JSON.parse(localStorage.getItem(\"favLs\"));\r\n }\r\n}", "title": "" }, { "docid": "9e07a5d314746e54da9fbc4b4456f0a4", "score": "0.618219", "text": "function localStorageList(plist) {\n localStorage.setItem('localList', JSON.stringify(plist));//\n }", "title": "" }, { "docid": "2b28a4e41a1c1c9b30b52c55b3764e05", "score": "0.6151827", "text": "function loadFromLocalStorage() {\n \n if (localStorage && localStorage.length > 0) {\n\t\t\t// run LoadtheList to insert all the todo list items\n loadTheList();\n\t\t} else {\n //create an empty array and store it in local storage\n\t\t\tvar a = [];\n\t\t\tlocalStorage.setItem('todoList', JSON.stringify(a));\n\t\t}\n \n }", "title": "" }, { "docid": "e2fb350433476fa87cdf53ce02ca7584", "score": "0.6149674", "text": "function loadFromLocalStorage(senators) {\n var output = '';\n\n // loop through array to format output and make dragable if 'voted' set to false\n senators.forEach(senator => {\n if (senator.voted == true) {\n // already voted so don't allow drag and drop\n output += `<li draggable='false' id=\"${senator.name}\"><strike>` + senator.name + \"</strike></li>\"; \n } else {\n output += `<li draggable='true' id=\"${senator.name}\">` + senator.name + \"</li>\"; \n } \n });\n\n // send formatted output to an html element\n document.getElementById(\"members\").innerHTML = output;\n\n document.getElementById(\"msg\").innerHTML = \"From LocalStorage Loaded \" +\n senators.length + \" senators\";\n}", "title": "" }, { "docid": "017aabba6e657ca5a1ff62fd7cf77f74", "score": "0.6146118", "text": "function putProductDataIntoLS() {\n // turns the allProductsList array into JSON\n var stringifiedProducts = JSON.stringify(allProductsList);\n // put the JSON array into local storage\n localStorage.setItem('productsInLocalStorage', stringifiedProducts);\n}", "title": "" }, { "docid": "2e359e76dd8730cb9f4dcd9ae251d1f5", "score": "0.6140036", "text": "function getAllVessels() {\n $.getJSON(\"/allVessels\")\n .done(function (data) {\n // check if the list of mmsi numbers has changed since last time\n if (!_.isEqual(data, lastAllVesselsSearch)) {\n search.empty();\n data.forEach(function (entry) {\n var mmsi = entry.key;\n search.append('<option value=\"' + mmsi + '\">' + mmsi + '</option>');\n });\n search.selectpicker('refresh');\n lastAllVesselsSearch = data;\n }\n });\n }", "title": "" }, { "docid": "433813a2ba2678ec8d8c61b62ea2e017", "score": "0.6138403", "text": "function localList() {\n var localButton = JSON.parse(localStorage.getItem('button'));\n\n\n buttons = localButton;\n }", "title": "" }, { "docid": "ed2b8356d6baa2581f010abb3bab519c", "score": "0.6137146", "text": "loadData() {\n\n // Call the API to retrieve the items of the current supermarket list\n new SupermarketAPI().getItemsFromCurrentList(this.grabbed).then((data) => {\n\n // Check if the list has changed\n if (this.hasChanged(data.items)) {\n\n // Refresh the list\n this.refreshList(data.items);\n }\n\n });\n }", "title": "" }, { "docid": "4f150084b9c42a0af459e38a3f23e93c", "score": "0.6133776", "text": "function loadFiles() {\n var fileItemsString = localStorage.getItem(filesKey);\n fileItems = JSON.parse(fileItemsString);\n}", "title": "" }, { "docid": "f0118e9525a7fbc04f01e1b2af559f79", "score": "0.6118933", "text": "function loadItems() {\r\n const loadedItems = localStorage.getItem(items_localStorage);\r\n if (loadedItems !== null) {\r\n const parsedItems = JSON.parse(loadedItems);\r\n parsedItems.forEach(function(item) {\r\n makeItems(item.text);\r\n });\r\n }\r\n}", "title": "" }, { "docid": "df644413a89d0746360152fd54050029", "score": "0.6098285", "text": "function loadLs() {\n let storedPlan = JSON.parse(localStorage.getItem(\"dailyPlan\"));\n if (storedPlan !== null) {\n\n for (let i = 0; i < 10; i++) {\n\n $(\".columnInput\" + (i + 9)).text(storedPlan[i]);\n\n }\n }\n }", "title": "" }, { "docid": "830c0c58d25e48d2a31090ebc977e0be", "score": "0.60868967", "text": "function loadLocalMenu(menuName) {\n var menuItems = $(\"li.menu-menu-item\");\n menuItems.remove();\n\n var menu = JSON.parse(localStorage.getItem(menuName));\n if (menu) {\n for (var i = 0; i <= menu.length - 1; i++) {\n var object = $(\"<li class=menu-menu-item><div class=item-name><p>Tooth</p></div><div class=item-price><p>$15.99</p></div></li>\")\n object.children(\".item-name\").children(\"p\").text(menu[i].name);\n object.children(\".item-price\").children(\"p\").text(\"$\" + menu[i].price);\n object.draggable({\n connectToSortable: \"#sortable\",\n helper: \"clone\",\n revert: \"invalid\",\n distance: 20\n })\n object.appendTo(\"#menu-content-left ul\");\n };\n } \n\n }", "title": "" }, { "docid": "2f4b8fa78091932ccccc6e531ab8c35b", "score": "0.60806066", "text": "function bindList(data) {\n localStorage.setItem('items', JSON.stringify(data));\n populateList(data, itemsList);\n}", "title": "" }, { "docid": "8999e8755cc5dedf318f213b2a398ae5", "score": "0.60690117", "text": "function loadSaved() {\n var load = localStorage.getItem(\"saved\");\n if (!load) {\n return false;\n } \n load = JSON.parse(load);\n list = load;\n}", "title": "" }, { "docid": "48779dbc8e9b44b6ba821eae9fb78120", "score": "0.6057138", "text": "function getLocalStorage() {\n return localStorage.getItem(\"list\") ? JSON.parse(localStorage.getItem(\"list\")) : [];\n}", "title": "" }, { "docid": "64103db7fba606248588b73712e5735e", "score": "0.6054687", "text": "function onload() {\n console.log(\"onload\");\n dataList = JSON.parse(localStorage.getItem(\"data\"));\n console.log(dataList);\n if (dataList.length > 0) {\n dataList.forEach(function(data) {\n storeDetails.innerHTML += \"Seller name is \" + data.name + \" and is from \" + data.address + \" in \" + data.city + \" city and car is <a href=\" + data.site + \" target='_blank'>\" + data.carDetails + \"</a>. <br/><br/>\";\n });\n }\n}", "title": "" }, { "docid": "569a9e65289b9cfc3d690ca47607fc62", "score": "0.60502595", "text": "function retrieveRouteList()\n{\n let dataObject = JSON.parse(localStorage.getItem(\"routeList\"));\n\t// restore the global list with the data retrieved.\n if (dataObject !== null)//if local storage has data stored...\n {\n routeList.fromData(dataObject);\n }\n}", "title": "" }, { "docid": "4cf4f41d89be906335cd88a06fb8c947", "score": "0.6048436", "text": "function restoreFromLocalStorage() {\n const lsItems = JSON.parse(localStorage.getItem('items'));\n\n if (lsItems.length) {\n lsItems.forEach(item => items.push(item));\n list.dispatchEvent(new CustomEvent('itemsUpdated'));\n }\n}", "title": "" }, { "docid": "da8081d3209bece0ca9471ce5eb2a00e", "score": "0.603237", "text": "function loadProgramData() {\n safelist_config = window.localStorage.safelist_config;\n if(safelist_config!==undefined){\n try {\n safelist_config = JSON.parse(safelist_config);\n } catch (e) {\n Danbooru.notice(\"Settings corrupted... reverting to initial configuration.\");\n initialProgramData();\n setProgramData();\n return;\n }\n $.each(safelist_config.levels, (level,val)=>{\n safelist_config.levels[level] = Object.assign(new Safelist(''),val);\n });\n pruneCustomLists();\n } else {\n initialProgramData();\n }\n setProgramData();\n}", "title": "" }, { "docid": "8f984dd8608964f2623c1385ba7e7a42", "score": "0.60154134", "text": "function loadSheets() {\n sheets = JSON.parse(localStorage.getItem(gameName));\n\n let sheetSelect = document.getElementById('sheetSelect');\n sheets.forEach(function(sheet) {\n\tlet option = document.createElement('option');\n\toption.text = sheet['name'];\n\tsheetSelect.add(option);\n });\n}", "title": "" }, { "docid": "c7d536496c595f7a9502dbb86a2e784b", "score": "0.6014978", "text": "function mounting(){\n let data = JSON.parse(localStorage.getItem('li')) ? JSON.parse(localStorage.getItem('li')) : []\n if(data.length > 0 ){\n for(i=0;i<data.length;i++){\n let li = document.createElement('li')\n var span = document.createElement(\"SPAN\");\n var txt = document.createTextNode(\"\\u00D7\");\n span.className = \"close\";\n span.appendChild(txt);\n li.append(data[i])\n li.append(span)\n ul.append(li)\n }\n }\n}", "title": "" }, { "docid": "f706476ecf15203cff837e9602ca5406", "score": "0.6014281", "text": "function getList() {\n getClothesData.getList()\n .then(function (result) {\n renderItem(checkClothingType(result.data));\n setLocalStorage(result.data);\n })\n .catch(function (error) {\n console.log(error);\n })\n}", "title": "" }, { "docid": "557e51b88d1be641cd0e37db5c826a53", "score": "0.600651", "text": "function save () {\n var myList = $('ul#items').html();\n\tstore.setItem('myList', myList);\n}", "title": "" }, { "docid": "c54ae6764e886607f67e8ea91ab54e0b", "score": "0.60062706", "text": "function loadData() {\n\t\tvar loadedList = localStorage.getItem('whtb-blocklist');\n\t\tvar loadedStylesList = localStorage.getItem('tigercloud-ekas-desinterest-styleBlockList');\n\t\tlogAdd('Loaded Ekas-Desinterest Block-Lists');\n\n\t\t// Handle if blocklist exists\n\t\tif(loadedList !== null) {\n\t\t\tbadUserList = loadedList.split(',');\n\n\t\t\t// Show Loaded User in Log\n\t\t\tfor(var i = 0; i < badUserList.length; i++)\n\t\t\t\tlogAdd('Loaded bad user: ' + badUserList[i]);\n\t\t}\n\n\t\t// Handle\n\t\tif(loadedStylesList !== null) {\n\t\t\tuserStyleBlockList = loadedStylesList.split(',');\n\n\t\t\tfor(var n = 0; n < userStyleBlockList.length; n++)\n\t\t\t\tlogAdd('Loaded blocked User-Style: ' + userStyleBlockList[n]);\n\t\t}\n\t}", "title": "" }, { "docid": "209a4a43635d7e99acd63998351f9df4", "score": "0.5998425", "text": "function recuperarLS() { return JSON.parse(localStorage.getItem('msj')); }", "title": "" }, { "docid": "ab65bb956d74a347b37f263cfd43de22", "score": "0.5993149", "text": "function loadProducts() {\n let productsList = JSON.parse(localStorage.getItem(\"productsList\"));\n if (productsList == null) {\n return [];\n } else {\n return productsList;\n }\n}", "title": "" }, { "docid": "c163c83ad4688802ec2cd474caa1776e", "score": "0.5988272", "text": "function storePlayerList(list){\r\n\tlocalStorage.setItem(\"playerList\", JSON.stringify(list));\r\n}", "title": "" }, { "docid": "7d988c7b8a9b62a29aa5d8ab29a44475", "score": "0.59827", "text": "function addList(list_name)\n{\n\tvar storage = window.localStorage;\n\tvar nameInStorage = list_name;\n\tvar obj = { Type:\"list\",list:[] };\n\tstorage.setItem(nameInStorage,JSON.stringify( obj ));\n}", "title": "" }, { "docid": "69396b83217dcd536befaca2f0ff1f71", "score": "0.5974692", "text": "function setVistos(vistos) {\n localStorage.setItem(\"vistos\", JSON.stringify(vistos))\n}", "title": "" }, { "docid": "2c6c15b0eba2340e05f8c4b0628cc5f8", "score": "0.59728986", "text": "function addList(){\r\n localStorage.setItem(\"list_items\", JSON.stringify(list_items));\r\n\r\n let jsonString = localStorage.getItem(\"list_items\");\r\n\r\n let retrievedItem = JSON.parse(jsonString);\r\n console.log(retrievedItem);\r\n}", "title": "" }, { "docid": "51f83a0b87a9a3cacbb1f1aeb898e255", "score": "0.59586257", "text": "function getFileNamesList()\n {\n //Hide the notification message\n app.clearNotification();\n\n //Empty the list to avoid duplicates\n $('#ListBox').empty();\n\n //Get the content of the url\n var jsonFilenamesObj = JSON.parse(Get(\"docs\"));\n var len = jsonFilenamesObj.length;\n\n\n //If Banana web server is running and there is one or more accounting file retrieved into the list:\n if (len > 0) \n {\n //Add the content to the listbox\n for (var i = 0; i < len; i++)\n {\n var x = document.getElementById(\"ListBox\");\n var option = document.createElement(\"option\");\n option.text = jsonFilenamesObj[i];\n x.add(option);\n }\n\n //Enable the elements\n document.getElementById('ListBox').disabled = false;\n document.getElementById('accounts-list').disabled = false;\n document.getElementById('ListAccounts').disabled = false;\n document.getElementById('ListPeriod').disabled = false;\n document.getElementById('load-data-and-create-file').disabled = false; \n }\n }", "title": "" }, { "docid": "7c5abef49874c236c115a5db973b6270", "score": "0.59539634", "text": "function getPlayerList(){\r\n\tvar playerList = JSON.parse(localStorage.getItem('playerList'));\r\n\tif (playerList != null){\r\n\t\treturn playerList;\r\n\t} else {\r\n\t\tvar playerList = [];\r\n\t\treturn playerList;\r\n\t}\r\n}", "title": "" }, { "docid": "879910d4a98739e10ad22af563ae72a3", "score": "0.5950256", "text": "function loadPage(list) {\n\tvar ul = document.getElementById(\"posts\");\n\tif (list == \"post\") {\n\t\tvar postResults = JSON.parse(localStorage.getItem(\"posts\"));\n\t\tpostResults.forEach(function(post){\n\t\t\tvar li = document.createElement('li');\n\t\t\tul.appendChild(li);\n\t\t\tli.addEventListener(\"click\", function (e) {\n\t\t\t\tlocation.href = \"Post.html?post=\" + encodeURIComponent(post.id);\n\t\t\t})\n\t\t\tli.innerHTML += \"Title \" + post.id + \": \" + post.title;\n\t\t});\n\t} else {\n\t\tvar albumResults = JSON.parse(localStorage.getItem(\"albums\"));\n\t\tvar ul = document.getElementById(\"albums\");\n\t\talbumResults.forEach(function(album){\n\t\t\tvar li = document.createElement('li');\n\t\t\tul.appendChild(li);\n\t\t\tli.addEventListener(\"click\", function (e) {\n\t\t\t\tlocation.href = \"Album.html?album=\" + encodeURIComponent(album.id);\n\t\t\t})\n\t\t\tli.innerHTML += \"Album \" + album.id + \": \" + album.title;\n\t\t});\n\t}\n}", "title": "" }, { "docid": "9599b7691b16829ce26e8dc85e057d7e", "score": "0.5943742", "text": "function getData() {\n let getLocal = localStorage.getItem('flowerList');\n if (getLocal) {\n everyThing = JSON.parse(getLocal);\n table.textContent = '';\n header();\n body();\n }\n}", "title": "" }, { "docid": "d7f5a0ba6924aa97793e606371996065", "score": "0.5934361", "text": "function getItemsFromLocalStorage(){\n\n if(localStorage.getItem('items')===null){ // items içi boşsa dizi haline getirelim\n items = [];\n }else{\n items = JSON.parse(localStorage.getItem('items')); // items içi doluysa Json parsa ile dönüştürelim \n }\n return items;\n}", "title": "" }, { "docid": "df5302bbd580ec5f823026cd72e408fa", "score": "0.5931503", "text": "function setItemStorage(){\n localStorage.setItem(\"list\", JSON.stringify(habitsArrList));\n}", "title": "" }, { "docid": "c011647f31eed7f1c5366b744f9c9828", "score": "0.59244305", "text": "getLoadLocal() {\n let name = document.getElementById('name').value;\n this.loadingLocaly(name);\n vista.activate(false);\n }", "title": "" }, { "docid": "05e26e8552343ca847be2cb7327fb780", "score": "0.592282", "text": "function reloadList(yourBooks) {\n // Save books to local storage\n localStorage.setItem(\"yourBooks\", JSON.stringify(yourBooks));\n\n //Reload list\n if (localStorage.getItem(\"yourBooks\")) {\n document.getElementById(\"addedToList\").innerHTML = \"\";\n yourBooks = JSON.parse(localStorage.getItem(\"yourBooks\"));\n loadList();\n }\n}", "title": "" }, { "docid": "288ab7b8f533608df39b5eadf093381b", "score": "0.5901178", "text": "function retrieveData () {\t\t\t\n\tvar frozen = localStorage.getItem(\"listOfProducts\");\n\tvar unfrozen = JSON.parse(frozen);\n\tif (unfrozen !== null) {\n\t\tnewProductsList = unfrozen;\n\t\treturn newProductsList;\n\t}\n}", "title": "" }, { "docid": "dfc154248a2ac4d7c4e08e1302a92978", "score": "0.58989114", "text": "function load() {\n let taskRepository = JSON.parse(localStorage[\"taskRepository\"]);\n taskRepository.forEach(function (task) {\n $(\".item-holder\").append($(taskString(task)));\n })\n}", "title": "" }, { "docid": "e9ef08b4d326d7f0144391f25a08863b", "score": "0.5895027", "text": "function loadSectionList() {\n var storedList = localStorage[\"sectionList\"],\n convertedList = [];\n if(storedList) {\n storedList = JSON.parse(storedList);\n for(var key in storedList) {\n convertedList.push(new Section(storedList[key].course, storedList[key].nbr, storedList[key].type,\n storedList[key].instructor, storedList[key].time.raw, storedList[key].place, storedList[key].semester,\n storedList[key].source));\n }\n }\n return new SectionList(convertedList);\n}", "title": "" }, { "docid": "2fb7993910681e8f9da5b46218103db9", "score": "0.5894384", "text": "function set_session_file_list() {\n var selectedlist = [];\n // for list\n $('.c_side_selects_list li').each(function() {\n selectedlist.push($(this).attr('data'));\n });\n\n sessionStorage.setItem('download_list', JSON.stringify(selectedlist));\n}", "title": "" }, { "docid": "492b38cf70d9331458df0bd2db55779b", "score": "0.5892946", "text": "_getFromLs() {\n return localStorage.getItem(this.get('lsKey'));\n }", "title": "" }, { "docid": "0baa67859f1d04822bd9e59a2d2507c2", "score": "0.5891563", "text": "function loadLocations()\n{\n var storedLocations = localStorage.getItem( 'locations');\n locations = JSON.parse( storedLocations );\n \n}", "title": "" }, { "docid": "ccc6b734c84e0c00786e3761d7b62647", "score": "0.5891083", "text": "function restoreOptions(){\n //retrive array from cloud\n chrome.storage.sync.get({\n blockList:[ \"youtube.com\", \"reddit.com\",\n \"twitter.com\",\"instagram.com\",\"facebook.com\",\n \"twitch.tv\", \"netflix.com\", \"hulu.com\"],\n }, function(items) {\n urlarray = items.blockList;\n //add each element to html list and display\n for(var i =0; i < urlarray.length; i++){\n var ul = document.getElementById(\"dynamic-list\");\n var input = urlarray[i];\n console.log(urlarray);\n var li = document.createElement(\"div\");\n li.setAttribute('id',input);\n li.appendChild(document.createTextNode(input));\n ul.appendChild(li);\n }\n });\n}", "title": "" }, { "docid": "33bdfee962db2b6bfcc6d5fb632a84d8", "score": "0.58893704", "text": "function displayLists() {\n\tvar list = document.getElementById(\"lists\");\n\t/*get the key names*/\n\tvar savedLists = Object.keys(localStorage);\n\t/*loop through localStorage*/\n\tfor (var i = 0 ; i < savedLists.length ; i++ ) {\n\t\t/*make the li*/\n\t\tvar li = document.createElement(\"li\");\n\t\tli.innerHTML = savedLists[i];\n\t\tlist.appendChild(li);\n\t}\n}", "title": "" }, { "docid": "198e441803e1fd4dcbfca548f17368ed", "score": "0.5878091", "text": "saveLists() {\n localStorage.setItem('list', JSON.stringify(_state.list))\n }", "title": "" }, { "docid": "bd5d2905e3635d680812ac023d080c92", "score": "0.5876901", "text": "function retrieveShipList()\n{\n\tlet dataObject = JSON.parse(localStorage.getItem(\"shipkey\"));\n\t// restore the global ship list (shipList) with the data retrieved.\n if (dataObject !== null)//if local storage has data stored...\n {\n shipList.fromData(dataObject);\n storeShipList();\n }\n else //if local storage has no data...\n {\n jsonpRequest(shipUrl, data); //obtain list of ships from API.\n }\n}", "title": "" }, { "docid": "77d6eb75829582e1928447c9f19fa1db", "score": "0.5876779", "text": "function loadTheList() {\n var allCompleted = true; //used to determine whether the chevron(.toggle-all) should be checked\n var i = 0;\n todoList = JSON.parse(localStorage.getItem('todoList'));\n if (todoList.length > 0) {\n for (i = 0; i <= todoList.length - 1; i++) {\n\t\t\t\t// insert the todo into the html list.\n console.log(\"todoList completed is: \" + todoList[i]['completed']);\n\t\t\t\tinsertEntry(todoList[i]['todotext'], todoList[i]['id'], todoList[i]['completed']);\n if (todoList[i]['completed'] === false) {\n\t\t\t\t\tallCompleted = false;\n\t\t\t\t}\n\t\t\t}\n \n if (allCompleted === true) {\n $('#toggle-all').prop('checked', true);\n }\n }\n \n listfunctions.updateListCount();\n }", "title": "" }, { "docid": "d9460cc7e3196ad4156244064c8c6276", "score": "0.587033", "text": "function getLocalList (key) {\n if (typeof key === 'string') {\n var studentsList = localStorage.getItem(key)\n if (studentsList) {\n var parsedStudentsList = JSON.parse(studentsList)\n return parsedStudentsList\n } else {\n return []\n }\n }\n}", "title": "" }, { "docid": "05dcecd39df5ecbe5b5bfedf8e937000", "score": "0.5866949", "text": "function saveToLocStorage() {\n\tlocalStorage.setItem('list', JSON.stringify(items));\n}", "title": "" }, { "docid": "faeec7a1caed5f7700ff56cc95b526e3", "score": "0.5866793", "text": "function loadListPageData() {\n $('#list > ul').html(setListPageParkingPois());\n}", "title": "" }, { "docid": "faeec7a1caed5f7700ff56cc95b526e3", "score": "0.5866793", "text": "function loadListPageData() {\n $('#list > ul').html(setListPageParkingPois());\n}", "title": "" }, { "docid": "797a09884782472a4c6fc05508721b49", "score": "0.5865641", "text": "function loadKittens() {\r\n if(localStorage.getItem('myKittyList')) {\r\n kittens = JSON.parse(localStorage.getItem('myKittyList'));\r\n drawKittens()\r\n }\r\n}", "title": "" }, { "docid": "13f463a14f75f1fd2550bb4c78485069", "score": "0.58553773", "text": "function getData() {\n toggleControls(\"on\");\n if(localStorage.length === 0) {\n navigator.notification.alert(\"There are no players stored, so a default player was added\",\n alertDismissed,\n \"iDraft\",\n \"OK\");\n autoFillData();\n }\n //Create Div/ul/li tags to display data\n var makeDiv = document.createElement('div');\n makeDiv.setAttribute(\"id\", \"players\");\n document.body.appendChild(makeDiv);\n var makeList = document.createElement('ul');\n makeList.setAttribute(\"id\", \"playerContainer\");\n makeDiv.appendChild(makeList);\n $('players').style.display = \"display\";\n for(var i=0, j=localStorage.length; i<j; i++) {\n var makeLi = document.createElement('li');\n var linksLi = document.createElement('li');\n makeList.appendChild(makeLi);\n var key = localStorage.key(i);\n var value = localStorage.getItem(key);\n var player = JSON.parse(value);\n var makeSubList = document.createElement('ul');\n makeSubList.setAttribute(\"id\", \"playerData\");\n makeLi.appendChild(makeSubList);\n var playerImage = document.createElement('img');\n playerImage.setAttribute(\"src\", \"img/stockplayer.png\");\n makeSubList.appendChild(playerImage);\n // getImage(obj.position[1], makeSubList);\n for(var n in player) {\n var makeSubLi = document.createElement('li');\n makeSubList.appendChild(makeSubLi);\n var optSubText = player[n][0] +\" \"+ player[n][1];\n makeSubLi.innerHTML = optSubText;\n makeSubList.appendChild(linksLi);\n }\n makeItemLinks(localStorage.key(i), linksLi); //Create our edit and delete buttons/links for each item in localStorage.\n }\n}", "title": "" }, { "docid": "81e33f0861c2195126452f809e95e736", "score": "0.5845753", "text": "function loadItems() {\n if (localStorage.getItem(\"items\") != null) {\n items_LS = JSON.parse(localStorage.getItem(\"items\"));\n items_LS.forEach((item) => {\n createTodo(item);\n });\n }\n}", "title": "" }, { "docid": "0fdb82a1374bd2cabde823fe56e38080", "score": "0.58416206", "text": "function loadRequestList() {\r\n return JSON.parse(localStorage.getItem(\"requestList\"));\r\n}", "title": "" }, { "docid": "a74256f53aeee8413271f77754c045ed", "score": "0.5841515", "text": "function loadStorage() {\r\n if (localStorage.getItem(\"users\") === null) {\r\n // nao faz nada\r\n } else {\r\n const list = JSON.parse(localStorage.users); // converte de string para json\r\n\r\n console.log(\"Dom fully loaded...\"); // informaçao sobre o ready state do dom\r\n for (const user of list) {\r\n playerList.push(new Player(user.name, user.points));\r\n }\r\n updateLeaderboard();\r\n }\r\n}", "title": "" }, { "docid": "51f800e58053c06a380c0995c2007f89", "score": "0.584015", "text": "function loadTasks() {\n const data = JSON.parse(localStorage.getItem('taskToDo'));\n data.forEach(item => {\n taskLi(item);\n })\n}", "title": "" }, { "docid": "f361c1374a408767a65b67e624541e38", "score": "0.5839125", "text": "function listWestern() {\n\n localStorage.setItem(\"category\",\"Western\");\n }", "title": "" }, { "docid": "cd411f5faa169fb545ed465fb8015b49", "score": "0.5830367", "text": "function loadScores() {\n scoreList = JSON.parse(localStorage.getItem(\"highScores\")) || [];\n}", "title": "" } ]
a14b22395f0ee1793c8eefed082cd542
it doesn't matter whether the component is modified. the idea is to merge the specified version with the current version. 1) when there are conflicts and the strategy is "ours", don't do any change to the component. 2) when there are conflicts and the strategy is "theirs", add all files from the specified version and write the component. 3) when there is no conflict or there are conflicts and the strategy is manual, update component.files. it's going to be 2way merge: currentfile: is the current file. basefile: empty. otherfile: the specified version.
[ { "docid": "c7fba1433f60d92802686cddb62d9b3c", "score": "0.7305188", "text": "async function applyVersion(\n consumer: Consumer,\n id: BitId,\n componentFromFS: Component,\n mergeResults: MergeResultsTwoWay,\n mergeStrategy: MergeStrategy\n): Promise<ApplyVersionResult> {\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n componentFromFS.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n return { id, filesStatus };\n }\n const component = componentFromFS.componentFromModel;\n if (!component) throw new GeneralError('failed finding the component in the model');\n const componentMap = componentFromFS.componentMap;\n if (!componentMap) throw new GeneralError('applyVersion: componentMap was not found');\n const files = componentFromFS.files;\n component.files = files;\n\n files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n\n // update files according to the merge results\n const modifiedStatus = applyModifiedVersion(consumer, files, mergeResults, mergeStrategy);\n\n const componentWriter = ComponentWriter.getInstance({\n component,\n writeToPath: component.files[0].base, // find the current path from the files. (we use the first one but it's the same for all)\n writeConfig: false, // never override the existing bit.json\n writePackageJson: false,\n deleteBitDirContent: false,\n origin: componentMap.origin,\n consumer,\n bitMap: consumer.bitMap,\n existingComponentMap: componentMap\n });\n await componentWriter.write();\n\n consumer.bitMap.removeComponent(component.id);\n componentWriter.origin = componentMap.origin;\n // $FlowFixMe todo: fix this. does configDir should be a string or ConfigDir?\n componentWriter.configDir = componentMap.configDir;\n componentWriter.addComponentToBitMap(componentMap.rootDir);\n\n return { id, filesStatus: Object.assign(filesStatus, modifiedStatus) };\n}", "title": "" } ]
[ { "docid": "9110bd4fd92c6bccde4316197feb4265", "score": "0.5587066", "text": "function mergeIn(src, tgt)\n{\n /*\n * This is the plan:\n * 1. Copy the code from the snapshot method and after you get all the files compare manifest files\n * the ones that don't have matches for manifest have changed so keep track of the paths to these files\n * 2. The paths to the files mentioned above are the only lines that we will have to change\n * 3. Update the date at the top, the command, and the directories\n */\n\n // CORRECT PLAN:\n // get all the artIDs from the latest version of the manifest or just pull the filenames from the repoDir\n // compare all those artIDs with each one from the workingDir\n // if the artIDs are different, then copy that file from workingDir to the repoDir\n // store a checkin manifest in the repoDir folder (update the date and the commandLine)\n // var dirFiles = fs.readdirSync(path.join(tgt), 'utf-8');\n\n // list of full path strings in working dir\n var wdFilePaths = getFiles(src); \n \n // create manifest file based on how many we already have\n var manifestNum = glob.sync(path.join(tgt, '.man-*.rc')).length + 1;\n var manifestFileName = `.man-${manifestNum}.rc`; \n var manifestPath = path.join(tgt, manifestFileName);\n\n // populate manifest file \n populateManifest(src, tgt, wdFilePaths, manifestPath, \"merge-in\"); \n}", "title": "" }, { "docid": "23c0ec5ed4a0e0581eb465172c86b87f", "score": "0.52211046", "text": "merge(chunk, chunkList, options, inputBase) {\n if (this.facadeModule !== null || chunk.facadeModule !== null)\n throw new Error('Internal error: Code splitting chunk merges not supported for facades');\n for (const module of chunk.orderedModules) {\n module.chunk = this;\n this.orderedModules.push(module);\n }\n for (const variable of chunk.imports) {\n if (!this.imports.has(variable) && variable.module.chunk !== this) {\n this.imports.add(variable);\n }\n }\n // NB detect when exported variables are orphaned by the merge itself\n // (involves reverse tracing dependents)\n for (const variable of chunk.exports) {\n if (!this.exports.has(variable)) {\n this.exports.add(variable);\n }\n }\n const thisOldExportNames = this.exportNames;\n // regenerate internal names\n this.generateInternalExports(options);\n const updateRenderedDeclaration = (dep, oldExportNames) => {\n if (dep.imports) {\n for (const impt of dep.imports) {\n impt.imported = this.getVariableExportName(oldExportNames[impt.imported]);\n }\n }\n if (dep.reexports) {\n for (const reexport of dep.reexports) {\n reexport.imported = this.getVariableExportName(oldExportNames[reexport.imported]);\n }\n }\n };\n const mergeRenderedDeclaration = (into, from) => {\n if (from.imports) {\n if (!into.imports) {\n into.imports = from.imports;\n }\n else {\n into.imports = into.imports.concat(from.imports);\n }\n }\n if (from.reexports) {\n if (!into.reexports) {\n into.reexports = from.reexports;\n }\n else {\n into.reexports = into.reexports.concat(from.reexports);\n }\n }\n if (!into.exportsNames && from.exportsNames) {\n into.exportsNames = true;\n }\n if (!into.exportsDefault && from.exportsDefault) {\n into.exportsDefault = true;\n }\n into.name = this.variableName;\n };\n // go through the other chunks and update their dependencies\n // also update their import and reexport names in the process\n for (const c of chunkList) {\n let includedDeclaration = undefined;\n for (let i = 0; i < c.dependencies.length; i++) {\n const dep = c.dependencies[i];\n if ((dep === chunk || dep === this) && includedDeclaration) {\n const duplicateDeclaration = c.renderedDeclarations.dependencies[i];\n updateRenderedDeclaration(duplicateDeclaration, dep === chunk ? chunk.exportNames : thisOldExportNames);\n mergeRenderedDeclaration(includedDeclaration, duplicateDeclaration);\n c.renderedDeclarations.dependencies.splice(i, 1);\n c.dependencies.splice(i--, 1);\n }\n else if (dep === chunk) {\n c.dependencies[i] = this;\n includedDeclaration = c.renderedDeclarations.dependencies[i];\n updateRenderedDeclaration(includedDeclaration, chunk.exportNames);\n }\n else if (dep === this) {\n includedDeclaration = c.renderedDeclarations.dependencies[i];\n updateRenderedDeclaration(includedDeclaration, thisOldExportNames);\n }\n }\n }\n // re-render the merged chunk\n this.preRender(options, inputBase);\n }", "title": "" }, { "docid": "a2595b5abb9b277acc6d1c27ed721a39", "score": "0.5188293", "text": "function mergeOut(src, tgt)\n{ \n // perform a check in to be safe\n var srcFileMapNPaths = checkIn(src, tgt); \n // src file map : {artID => relativePath}\n var srcFileMap = srcFileMapNPaths[0];\n \n // for each file in the snapshot do the\n // file to file case checking (4 cases) \n \n // get all files from the latest tgt manifest \n manifestFiles = glob.sync(path.join(tgt, '.man-*.rc'));\n file = manifestFiles[manifestFiles.length - 1];\n \n // read the most up to date manifest file of tgt\n manContents = fs.readFileSync(path.join(file), 'utf-8');\n arr = manContents.split('\\n');\n \n // for every line in this tgt manifest create a file map\n // in the form {artID => fullPath}\n var tgtFileMap = new Map();\n for (var i = 2; i < arr.length; i++)\n {\n let oneLine = arr[i].trim().split(\"@\");\n if (oneLine[1] == undefined)\n continue;\n tgtFileMap.set(oneLine[0].split(\".\")[0].trim(), oneLine[1].trim());\n }\n\n // both files are already sorted because windows does that automatically (NO FRILLS)\n var min;\n var max;\n var isMinSrc = false;\n if (srcFileMap.size < tgtFileMap.size)\n {\n max = tgtFileMap;\n min = srcFileMap;\n isMinSrc = true;\n }\n else\n {\n max = srcFileMap;\n min = tgtFileMap;\n } \n \n fileCaseChecking(min, max, src, tgt, isMinSrc);\n\n // create manifest file based on how many we already have\n var manifestNum = glob.sync(path.join(tgt, '.man-*.rc')).length + 1;\n var manifestFileName = `.man-${manifestNum}.rc`; \n var manifestPath = path.join(tgt, manifestFileName);\n var srcFilePaths = srcFileMapNPaths[1];\n\n\n // populate manifest file \n populateManifest(src, tgt, srcFilePaths, manifestPath, \"merge-out\"); \n}", "title": "" }, { "docid": "559da2c6c33da5645470e009d988b340", "score": "0.5145011", "text": "update(item, meta) {\n let locked = this._lockData[item.name];\n if (!locked) return meta;\n\n //\n // Add versions from <meta>\n //\n\n this._isFynFormat = false;\n\n if (!locked.hasOwnProperty(LOCK_SORTED_VERSIONS)) {\n locked = this.convert(item) || this._lockData[item.name];\n }\n\n _.defaults(locked.versions, meta.versions);\n const versions = Object.keys(locked.versions);\n locked[SORTED_VERSIONS] = versions.sort(simpleSemverCompare);\n locked[\"dist-tags\"] = meta[\"dist-tags\"];\n\n return locked;\n }", "title": "" }, { "docid": "d7d384fc823691368a59939edd085618", "score": "0.5140558", "text": "function versionBump(importance){\n\t\tif (!importance) throw `\\nAn importance must be specified for a version bump to occur.\nValid importances: \"--patch\", \"--minor\", \"--major\"\\n`;\n\t\t// get all the files to bump version in\n\t\tgulp.src(['./package.json', './bower.json'])\n\t\t\t// bump the version number in those files\n\t\t\t.pipe(bump({type: importance}))\n\t\t\t// save it back to filesystem\n\t\t\t.pipe(gulp.dest('./'))\n\t\t\t//read only one file to get the version number\n\t\t\t.pipe(filter('package.json'))\n\t\t\t//commit the changed version number\n\t\t\t.pipe(git.commit(`${importance} version bump`))\n\t\t\t// **tag it in the repository**\n\t\t\t.pipe(tag_version());\n\t}", "title": "" }, { "docid": "08887ad5e5185935a5604366cff260a9", "score": "0.5128335", "text": "commit() {\r\n this.host.overwrite(`${this._path}/package.json`, this.content());\r\n }", "title": "" }, { "docid": "851fcad72f0d1869e4aae56134b6483c", "score": "0.50773746", "text": "async merge() {\n }", "title": "" }, { "docid": "edeb15806a420ff668c2e13be2e53d06", "score": "0.5067229", "text": "function f(e,t,n,r,i,o,u){return e.op=t,c.canMerge(n)&&e.merge(n),r&&e._mergeUpdate(r),s.isObject(i)&&e.setOptions(i),o||u?!e._update||!e.options.overwrite&&0===s.keys(e._update).length?(u&&s.soon(u.bind(null,null,0)),e):(i=e._optionsForExec(),u||(i.safe=!1),n=e._conditions,r=e._updateForExec(),a(\"update\",e._collection.collectionName,n,r,i),u=e._wrapCallback(t,u,{conditions:n,doc:r,options:i}),e._collection[t](n,r,i,s.tick(u)),e):e}", "title": "" }, { "docid": "e587d6a010a92ba735adcc42d6568a93", "score": "0.50628394", "text": "function h(e,t,n,r,i,o,l){if(e.op=t,c.canMerge(n)&&e.merge(n),r&&e._mergeUpdate(r),s.isObject(i)&&e.setOptions(i),!o&&!l)return e;if(!e._update||!e.options.overwrite&&0===s.keys(e._update).length)return l&&s.soon(l.bind(null,null,0)),e;i=e._optionsForExec(),l||(i.safe=!1);n=e._conditions;return r=e._updateForExec(),a(\"update\",e._collection.collectionName,n,r,i),l=e._wrapCallback(t,l,{conditions:n,doc:r,options:i}),e._collection[t](n,r,i,s.tick(l)),e}", "title": "" }, { "docid": "12b88adc179bb721c58bf3a88860c9d0", "score": "0.50410986", "text": "updateService() {\n // we do not update the dom if swagger is not edited.\n if (this.swaggerAce && !this.swaggerAce.getSession().getUndoManager().isClean()) {\n // Merge to service. this.swagger\n getServiceDefinition(this.swagger, this.props.targetService.getName().getValue())\n .then((serviceDefinition) => {\n SwaggerUtil.merge(this.context.astRoot, TreeBuilder.build(serviceDefinition.model),\n this.props.targetService);\n })\n .catch(error => log.error(error));\n }\n }", "title": "" }, { "docid": "d2999fd36e195581ae1c98d74f41b253", "score": "0.50332546", "text": "function h(e,t,n,i,o,r,l){return e.op=t,c.canMerge(n)&&e.merge(n),i&&e._mergeUpdate(i),s.isObject(o)&&e.setOptions(o),r||l?!e._update||!e.options.overwrite&&0===s.keys(e._update).length?(l&&s.soon(l.bind(null,null,0)),e):(o=e._optionsForExec(),l||(o.safe=!1),n=e._conditions,i=e._updateForExec(),a(\"update\",e._collection.collectionName,n,i,o),l=e._wrapCallback(t,l,{conditions:n,doc:i,options:o}),e._collection[t](n,i,o,s.tick(l)),e):e}", "title": "" }, { "docid": "f8fd6cce156ba3d220d29a28b4bc9976", "score": "0.5022936", "text": "function updateJSONFiles(product, version, name) {\n\n var i = 0;\n\n function proceed (err) {\n i = i + 1;\n if (err) {\n throw err;\n }\n if (push && i === 2) {\n runGit(product, version);\n }\n }\n\n console.log('Updating bower.json and package.json for ' + name + '...');\n\n ['bower', 'package'].forEach(function (file ) {\n fs.readFile('../' + product + '-release/' + file + '.json', function (err, json) {\n if (err) {\n throw err;\n }\n json = JSON.parse(json);\n json.version = 'v' + version;\n json = JSON.stringify(json, null, ' ');\n fs.writeFile('../' + product + '-release/' + file + '.json', json, proceed);\n });\n });\n }", "title": "" }, { "docid": "6fac1dc77e39df12b50ecc6393cc7ee3", "score": "0.50173855", "text": "function conflict() {\n throw new Error(\n 'This property was defined by multiple merged objects, override it with the proper implementation');\n }", "title": "" }, { "docid": "ae74913551306a13a5c802c66eb6554e", "score": "0.49984738", "text": "async trackDirectoryChangesLegacy(consumer, id) {\n const trackDir = this.getTrackDir();\n\n if (!trackDir) {\n return;\n }\n\n const trackDirAbsolute = path().join(consumer.getPath(), trackDir);\n const trackDirRelative = path().relative(process.cwd(), trackDirAbsolute);\n if (!_fsExtra().default.existsSync(trackDirAbsolute)) throw new (_componentNotFoundInPath().default)(trackDirRelative);\n const lastTrack = await consumer.componentFsCache.getLastTrackTimestamp(id.toString());\n\n const wasModifiedAfterLastTrack = async () => {\n const lastModified = await (0, _lastModified().getLastModifiedDirTimestampMs)(trackDirAbsolute);\n return lastModified > lastTrack;\n };\n\n if (!(await wasModifiedAfterLastTrack())) {\n return;\n }\n\n const addParams = {\n componentPaths: [trackDirRelative || '.'],\n id: id.toString(),\n override: false,\n // this makes sure to not override existing files of componentMap\n trackDirFeature: true,\n origin: this.origin\n };\n const numOfFilesBefore = this.files.length;\n const addContext = {\n consumer\n };\n const addComponents = new (_addComponents().default)(addContext, addParams);\n\n try {\n await addComponents.add();\n } catch (err) {\n if (err instanceof _exceptions().NoFiles || err instanceof _exceptions().EmptyDirectory) {// it might happen that a component is imported and current .gitignore configuration\n // are effectively removing all files from bitmap. we should ignore the error in that\n // case\n } else {\n throw err;\n }\n }\n\n if (this.files.length > numOfFilesBefore) {\n _logger().default.info(`new file(s) have been added to .bitmap for ${id.toString()}`);\n\n consumer.bitMap.hasChanged = true;\n }\n\n this.recentlyTracked = true;\n }", "title": "" }, { "docid": "1f3427cc6b6b53125b466ceb6a9006ed", "score": "0.49981356", "text": "function updateVersionFile (done) {\n const version = getVersion()\n\n fs.writeFileSync(VERSION, `export const version = '${version}'${AUTOGENERATED_WARNING}`)\n\n done()\n}", "title": "" }, { "docid": "4f60e0109efd60a0eb2f4b80a696e143", "score": "0.49915996", "text": "function h(t,e,r,n,i,o,u){if(t.op=e,c.canMerge(r)&&t.merge(r),n&&t._mergeUpdate(n),s.isObject(i)&&t.setOptions(i),!o&&!u)return t;if(!t._update||!t.options.overwrite&&0===s.keys(t._update).length)return u&&s.soon(u.bind(null,null,0)),t;i=t._optionsForExec(),u||(i.safe=!1);r=t._conditions;return n=t._updateForExec(),a(\"update\",t._collection.collectionName,r,n,i),u=t._wrapCallback(e,u,{conditions:r,doc:n,options:i}),t._collection[e](r,n,i,s.tick(u)),t}", "title": "" }, { "docid": "74758182e1fb0d174c7d2281a126e410", "score": "0.49671993", "text": "function h(e,t,n,r,o,i,u){return e.op=t,c.canMerge(n)&&e.merge(n),r&&e._mergeUpdate(r),s.isObject(o)&&e.setOptions(o),i||u?!e._update||!e.options.overwrite&&0===s.keys(e._update).length?(u&&s.soon(u.bind(null,null,0)),e):(o=e._optionsForExec(),u||(o.safe=!1),n=e._conditions,r=e._updateForExec(),a(\"update\",e._collection.collectionName,n,r,o),u=e._wrapCallback(t,u,{conditions:n,doc:r,options:o}),e._collection[t](n,r,o,s.tick(u)),e):e}", "title": "" }, { "docid": "74ece08c582f92ddb1bb84c00abf0775", "score": "0.49564603", "text": "function updateVersion(cb) {\n\n const appPackage = require('../package.json');\n const appVersion = appPackage.version;\n const jsonData = { version: appVersion, note: \"this file is auto-generated\" };\n const jsonContent = JSON.stringify(jsonData);\n const jsonPublicFile = './public/meta.json';\n\n fs.writeFile(jsonPublicFile, jsonContent, 'utf8', function(err) {\n if (err) {\n console.log('gulp cannot update ' + jsonPublicFile + ' file: \\n' + err);\n return console.log(err);\n }\n console.log('gulp updated ' + jsonPublicFile + ' file with latest version number');\n });\n\n const jsonSourceFile = './src/CacheApp.json';\n fs.writeFile(jsonSourceFile, jsonContent, 'utf8', function(err) {\n if (err) {\n console.log('gulp cannot update ' + jsonSourceFile + ' file: \\n' + err);\n return console.log(err);\n }\n console.log('gulp updated ' + jsonSourceFile + ' file with latest version number');\n });\n cb();\n\n}", "title": "" }, { "docid": "3762ff209148ac734fc509f6cc0d4908", "score": "0.49542344", "text": "async updateExistingTsOrJsFile(path, changes) {\n path = utils_1.normalizePath(path);\n // Only update once because all snapshots are shared between\n // services. Since we don't have a current version of TS/JS\n // files, the operation wouldn't be idempotent.\n let didUpdate = false;\n await service_1.forAllServices((service) => {\n if (service.hasFile(path) && !didUpdate) {\n didUpdate = true;\n service.updateTsOrJsFile(path, changes);\n }\n });\n }", "title": "" }, { "docid": "590b8e36ba2d3838d5494e036c0f99b3", "score": "0.49473977", "text": "function doUpdateComponent (name) {\n // Build defined component data.\n var data = mergeComponentData(self.getDOMAttribute(name), extraComponents[name]);\n delete componentsToUpdate[name];\n self.updateComponent(name, data);\n }", "title": "" }, { "docid": "cc4bdae323c2b45840d94d2c748a13ef", "score": "0.49440235", "text": "_writeUpdateFiles() {\n const shouldWriteChangelog =\n this.addedFields.length > 0 ||\n this.removedFields.length > 0 ||\n this.addedRelationships.some(relationship => relationship.shouldWriteRelationship || relationship.shouldWriteJoinTable) ||\n this.removedRelationships.some(relationship => relationship.shouldWriteRelationship || relationship.shouldWriteJoinTable);\n if (!shouldWriteChangelog) {\n return;\n }\n\n this.hasFieldConstraint = this.addedFields.some(field => field.unique || !field.nullable);\n this.hasRelationshipConstraint = this.addedRelationships.some(\n relationship =>\n (relationship.shouldWriteRelationship || relationship.shouldWriteJoinTable) &&\n (relationship.unique || !relationship.nullable)\n );\n this.shouldWriteAnyRelationship = this.addedRelationships.some(\n relationship => relationship.shouldWriteRelationship || relationship.shouldWriteJoinTable\n );\n\n this.writeFilesToDisk(updateEntityFiles, this, false, this.sourceRoot());\n this.addIncrementalChangelogToLiquibase(`${this.databaseChangelog.changelogDate}_updated_entity_${this.entity.entityClass}`);\n\n if (!this.skipFakeData && (this.addedFields.length > 0 || this.shouldWriteAnyRelationship)) {\n this.fields = this.addedFields;\n this.relationships = this.addedRelationships;\n this.writeFilesToDisk(fakeFiles, this, false, this.sourceRoot());\n this.writeFilesToDisk(updateMigrateFiles, this, false, this.sourceRoot());\n\n this.addIncrementalChangelogToLiquibase(\n `${this.databaseChangelog.changelogDate}_updated_entity_migrate_${this.entity.entityClass}`\n );\n }\n\n if (this.hasFieldConstraint || this.shouldWriteAnyRelationship) {\n this.writeFilesToDisk(updateConstraintsFiles, this, false, this.sourceRoot());\n\n this.addIncrementalChangelogToLiquibase(\n `${this.databaseChangelog.changelogDate}_updated_entity_constraints_${this.entity.entityClass}`\n );\n }\n }", "title": "" }, { "docid": "a46530ca479f1f905fcc45b1e6c934d5", "score": "0.49252707", "text": "componentDidUpdate(prevProps) {\n const { uploads } = prevProps;\n const prevFile = get(uploads, this.props.identifier, {});\n\n if (this.file.id !== prevFile.id && this.file.id) {\n this.props.onFileUpload(this.file);\n } else {\n this.props.onFileRemove(prevFile);\n }\n }", "title": "" }, { "docid": "251a8982c5a717e33a045cffe140473a", "score": "0.48985872", "text": "function test_upgrade_multi_ext_inplace() {}", "title": "" }, { "docid": "e3e24271796bd200d192f2a4aef07df0", "score": "0.4849458", "text": "get merge() {\n this.commandsRoot.arguments.push('merge');\n this.commandsRoot.executable = false;\n return new DataModifyValues(this.commandsRoot);\n }", "title": "" }, { "docid": "72d8c9dfbdc909ce4957ad3ac7c93ae3", "score": "0.48474023", "text": "function d(e,t,n,o,r,i,l){return e.op=t,c.canMerge(n)&&e.merge(n),o&&e._mergeUpdate(o),s.isObject(r)&&e.setOptions(r),i||l?!e._update||!e.options.overwrite&&0===s.keys(e._update).length?(l&&s.soon(l.bind(null,null,0)),e):(r=e._optionsForExec(),l||(r.safe=!1),n=e._conditions,o=e._updateForExec(),a(\"update\",e._collection.collectionName,n,o,r),l=e._wrapCallback(t,l,{conditions:n,doc:o,options:r}),e._collection[t](n,o,r,s.tick(l)),e):e}", "title": "" }, { "docid": "39e341aa6f89b2e1277925a11cc1b2f7", "score": "0.48329884", "text": "function updatevendors(){\n return src(mainBowerFiles(), { base: './components/' })\n .pipe(plumber(function (err) {\n console.log('Bower Task Error');\n console.log(err);\n }))\n .pipe(gulp.dest('./src/assets/vendors'));\n}", "title": "" }, { "docid": "5aeb1c44ff9dfdbfeb3e16965c8cc551", "score": "0.48255798", "text": "function mergeSwagger() {\n\tlogger.info(`Starting to merge Swagger definitions of ${args.resources.join(' ')}`);\n\n\tlet info = {\n\t\ttitle: args.title || `${args.resources.join('-')}--FHIRAPI`,\n\t\tversion: args.version || `1.0.0`,\n\t\tdescription: `Swagger for FHIR Resources ${args.resources.join(', ')}`,\n\t};\n\n\tlet host = args.host || 'hapi.fhir.org';\n\tlet schemas = ['http', 'https'];\n\tlet basePath = args.combine ? (args.combinedBase ? `/${args.combinedBase}` : '/') : '/';\n\n\tlet merged = swaggermerge.merge(swaggerStore, info, basePath, host, schemas);\n\n\tlogger.info(`Writing Swagger definition for the combined FHIR resources`);\n\n\tfs.writeFileSync(`${args.output}/combined-swagger--output.json`, beautify(merged, null, 4), (err) => {\n\t\tif (err) {\n\t\t\tlogger.error(err);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d2d55bb13bd84d6f76c400bfd373e979", "score": "0.47709313", "text": "function updateSW() {\n fs.readFile('src/sw.js', 'utf8', (err, contents) => {\n if (err) throw err;\n const compRE = /const COMPONENTS = \\[([\\S\\s]*?)\\];/\n const versionRE = /const CACHE_ID = 'v([\\S\\s]*?)';/\n const version = parseInt(contents.match(versionRE)[1]) + 1;\n contents = contents\n .replace(compRE,`const COMPONENTS = [\\n${compArray.join(',\\n')}\\n];`);\n // allways update file since a build implies a new cache of files\n contents = contents\n .replace(versionRE,`const CACHE_ID = 'v${version}';`);\n fs.writeFile('src/sw.js', contents, (err) =>{\n if (err) throw err;\n // compress and copy file\n miniFi('sw.js')\n console.log('sw.js file has been updated!');\n });\n });\n}", "title": "" }, { "docid": "adfbb6d23f830cea316607fc6ab26857", "score": "0.47599667", "text": "async _move_to_dest_version(fs_context, new_ver_tmp_path, latest_ver_path, upload_file, key, open_mode) {\n dbg.log1('Namespace_fs._move_to_dest_version:', new_ver_tmp_path, latest_ver_path, upload_file);\n let gpfs_options;\n const is_gpfs = this._is_gpfs(fs_context);\n let retries = config.NSFS_RENAME_RETRIES;\n for (;;) {\n try {\n const new_ver_info = !is_gpfs && await this._get_version_info(fs_context, new_ver_tmp_path);\n // get latest version_id if exists\n const latest_ver_info = await this._get_version_info(fs_context, latest_ver_path);\n const versioned_path = latest_ver_info && this._get_version_path(key, latest_ver_info.version_id_str);\n const versioned_info = latest_ver_info && await this._get_version_info(fs_context, versioned_path);\n\n gpfs_options = is_gpfs ?\n await this._open_files_gpfs(fs_context, new_ver_tmp_path, latest_ver_path, upload_file,\n latest_ver_info, open_mode, undefined, versioned_info) :\n undefined;\n\n dbg.log1('Namespace_fs._move_to_dest_version:', latest_ver_info, new_ver_info, gpfs_options);\n\n if (this._is_versioning_suspended()) {\n if (latest_ver_info?.version_id_str === NULL_VERSION_ID) {\n dbg.log1('NamespaceFS._move_to_dest_version suspended: version ID of the latest version is null - the file will be unlinked');\n await this.safe_unlink(fs_context, latest_ver_path, latest_ver_info, gpfs_options);\n } else {\n // remove a version (or delete marker) with null version ID from .versions/ (if exists)\n await this._delete_null_version_from_versions_directory(key, fs_context);\n }\n }\n if (latest_ver_info &&\n ((this._is_versioning_enabled()) ||\n (this._is_versioning_suspended() && latest_ver_info.version_id_str !== NULL_VERSION_ID))) {\n dbg.log1('NamespaceFS._move_to_dest_version version ID of the latest version is a unique ID - the file will be moved it to .versions/ directory');\n await this._make_path_dirs(versioned_path, fs_context);\n await this.safe_move(fs_context, latest_ver_path, versioned_path, latest_ver_info,\n gpfs_options && gpfs_options.move_to_versions);\n }\n try {\n // move new version to latest_ver_path (key path)\n await this.safe_move(fs_context, new_ver_tmp_path, latest_ver_path, new_ver_info,\n gpfs_options && gpfs_options.move_to_dst);\n } catch (err) {\n if (err.message !== posix_unlink_retry_err && err.code !== gpfs_unlink_retry_catch) throw err;\n dbg.warn('Namespace_fs._move_to_dest_version: unable to delete new version tmp file, ignoring...');\n }\n break;\n } catch (err) {\n retries -= 1;\n if (retries <= 0 || !this.should_retry_link_unlink(is_gpfs, err)) throw err;\n dbg.warn(`NamespaceFS._move_to_dest_version retrying retries=${retries}` +\n ` new_ver_tmp_path=${new_ver_tmp_path} latest_ver_path=${latest_ver_path}`, err);\n } finally {\n if (gpfs_options) await this._close_files_gpfs(fs_context, gpfs_options.move_to_dst, open_mode);\n }\n }\n }", "title": "" }, { "docid": "1e80d3c8d7d8d49efdef1adc72e434ae", "score": "0.47570473", "text": "_addDiffViewer(prevContent, currContent) {\n const mode = Mode.findByFileName(this.props.path) || Mode.findBest(this.props.path);\n mergeView(this._mergeViewRef.current, {\n value: currContent,\n orig: prevContent,\n lineNumbers: true,\n mode: mode.mime,\n theme: 'jupyter',\n connect: 'align',\n collapseIdentical: true,\n revertButtons: false\n });\n }", "title": "" }, { "docid": "c6b9c78e4f4dfac34572b34f9dbbc747", "score": "0.47441927", "text": "updateFiles(prevLoggedIn, updateAssembly) {\n const { context, data, analyses, hideAnalysisSelector, cloningMappingsFiles } = this.props;\n const { session } = this.context;\n const { currentTab } = this.state;\n const loggedIn = !!(session && session['auth.userid']);\n const relatedFileAtIds = context.related_files && context.related_files.length > 0 ? context.related_files : [];\n const seriesFiles = getSeriesFiles(context) || [];\n const datasetFiles = [...data, ...seriesFiles];\n\n // The number of related_files has changed (or we have related_files for the first time).\n // Request them and add them to the files from the original file request.\n let relatedPromise;\n if (loggedIn !== prevLoggedIn || !this.relatedFilesRequested) {\n relatedPromise = requestFiles(relatedFileAtIds);\n this.relatedFilesRequested = true;\n } else {\n relatedPromise = Promise.resolve(this.prevRelatedFiles);\n }\n\n // Whether we have related_files or not, get all files' assemblies and annotations, and\n // the first genome browser for them.\n relatedPromise.then((relatedFiles) => {\n // Extract all cloning and mapping files from the related datasets.\n const cloningFiles = cloningMappingsFiles?.cloning?.reduce((accFiles, cloning) => accFiles.concat(cloning.files), []) || [];\n const mappingsFiles = cloningMappingsFiles?.mappings?.reduce((accFiles, mappings) => accFiles.concat(mappings.files), []) || [];\n\n this.prevRelatedFiles = relatedFiles;\n let allFiles = datasetFiles.concat(relatedFiles).concat(cloningFiles).concat(mappingsFiles);\n allFiles = this.filterForInclusion(allFiles);\n\n const dropdown = this.analysisSelectorRef.current;\n let selectedIndex = 0;\n let compiledAnalysis = compileAnalyses(analyses, allFiles, 'choose analysis');\n\n if (currentTab === 'browser' && !hideAnalysisSelector) {\n compiledAnalysis = this.getBrowserAnalysis(allFiles, compiledAnalysis);\n selectedIndex = this.getBrowserSelectedIndex(compiledAnalysis);\n } else {\n selectedIndex = dropdown ? dropdown.selectedIndex : null;\n }\n const analysis = compiledAnalysis[selectedIndex];\n const compileAnalysisFiles = analysis ? analysis.files : null;\n const getFilesDataFromIds = () => allFiles.filter((f) => compileAnalysisFiles && compileAnalysisFiles.includes(f['@id']));\n\n // default value\n const filesFilteredByAssembly = compileAnalysisFiles ? getFilesDataFromIds() : allFiles;\n\n // If there are filters, filter the new files\n let filteredFiles = compileAnalysisFiles ? getFilesDataFromIds() : allFiles;\n const graphFiles = allFiles;\n if (Object.keys(this.state.fileFilters).length > 0) {\n Object.keys(this.state.fileFilters).forEach((fileFilter) => {\n if (fileFilter !== 'assembly') {\n filteredFiles = filterItems(filteredFiles, fileFilter, this.state.fileFilters[fileFilter]);\n }\n });\n }\n\n if (!(_.isEqual(allFiles, this.state.allFiles))) {\n this.setState({ allFiles });\n this.setAssemblyList(this.state.allFiles);\n // From the new set of files, calculate the currently selected assembly and annotation to display in the graph and tables.\n this.setState({ availableAssembliesAnnotations: collectAssembliesAnnotations(allFiles) });\n }\n\n if (!(_.isEqual(filesFilteredByAssembly, this.state.filesFilteredByAssembly))) {\n this.setState({ filesFilteredByAssembly });\n this.setAssemblyList(this.state.allFiles);\n }\n\n if (!(_.isEqual(graphFiles, this.state.graphFiles))) {\n this.setState({ graphFiles });\n }\n\n if (!(_.isEqual(filteredFiles, this.state.files))) {\n this.setState({ files: filteredFiles });\n }\n this.resetCurrentBrowser(null, allFiles);\n\n // If new tab has been selected, we may need to update which assembly is chosen\n if (updateAssembly || loggedIn !== prevLoggedIn) {\n if (this.state.currentTab === 'tables') {\n // Always set the table assembly to be 'All assemblies'\n this.filterFiles('All assemblies', 'assembly');\n } else if (this.state.currentTab === 'browser' || this.state.currentTab === 'graph') {\n let availableCompiledAnalyses = this.state.compiledAnalyses;\n // Determine available assemblies\n const assemblyList = this.setAssemblyList(allFiles);\n // Update compiled analyses filtered by available assemblies\n if (this.props.analyses && this.props.analyses.length > 0) {\n availableCompiledAnalyses = compiledAnalysis;\n }\n if (availableCompiledAnalyses.length > 0) {\n // Update the list of relevant compiled analyses and use it to select an\n // appropriate selected pipeline menu based on the current assembly and the\n // last-selected pipeline lab.\n const currentAssembly = this.state.fileFilters.assembly[0];\n const compiledAnalysesIndex = this.findCompiledAnalysesIndex(currentAssembly, availableCompiledAnalyses);\n this.saveSelectedAnalysesProps(compiledAnalysesIndex, availableCompiledAnalyses);\n this.setState({ compiledAnalyses: availableCompiledAnalyses, selectedAnalysesIndex: compiledAnalysesIndex });\n // Find the matching assembly in compiledAnalyses, or the first otherwise.\n const newAnalyses = availableCompiledAnalyses[compiledAnalysesIndex] || availableCompiledAnalyses[compiledAnalysesIndex];\n const newAssembly = newAnalyses.assembly;\n if (newAssembly !== currentAssembly) {\n this.filterFiles(newAssembly, 'assembly');\n }\n } else {\n // Reset assembly filter if it is 'All assemblies' or is not in assemblyList\n // Assembly is required for browser / graph and available assemblies may be different for graph and browser\n // Do not reset if a particular assembly has already been chosen and it is an available option\n this.setState({ compiledAnalyses: [] });\n const currentAssembly = this.state.fileFilters.assembly?.[0] || '';\n let newAssembly;\n if (currentAssembly === 'All assemblies' || !(assemblyList[currentAssembly])) {\n // We want to get the assembly with the highest assembly number (but not 'All assemblies')\n newAssembly = Object.keys(assemblyList).reduce((a, b) => (((assemblyList[a] > assemblyList[b]) && (a !== 'All assemblies')) ? a : b));\n this.filterFiles(newAssembly, 'assembly');\n }\n }\n }\n }\n });\n }", "title": "" }, { "docid": "69ffde679d8ce5141472fd72badbd720", "score": "0.47441924", "text": "function d(e,t,r,n,i,a,c){return e.op=t,u.canMerge(r)&&e.merge(r),n&&e._mergeUpdate(n),o.isObject(i)&&e.setOptions(i),a||c?!e._update||!e.options.overwrite&&0===o.keys(e._update).length?(c&&o.soon(c.bind(null,null,0)),e):(i=e._optionsForExec(),c||(i.safe=!1),r=e._conditions,n=e._updateForExec(),s(\"update\",e._collection.collectionName,r,n,i),c=e._wrapCallback(t,c,{conditions:r,doc:n,options:i}),e._collection[t](r,n,i,o.tick(c)),e):e}", "title": "" }, { "docid": "74b605278e4f072a13e11d00e1f273c3", "score": "0.4735558", "text": "function createNewComponent(){\n\t\tif(!isExecutedFromRoot()){\n\t\t\tconsole.log(\"Please run command from application root directory\");\n\t\t\treturn false;\n\t\t}\n\n\t\tgetAppfacConfigFile('component', args.component,function(pluginName,themeName,compName,appfacConfig){\n\n\t\t\tvar path = \"client\";\n\t\t\tif(args.a!=undefined){\n\t\t\t\tpath = \"admin\";\n\t\t\t}\n\n\t\t\tvar pluginConfigFile = process.cwd()+\"/plugins/\"+pluginName+\"/plugin.config.json\";\n\n\t\t\t// check that plugin exist\n\t\t\tvar pluginPath = process.cwd()+\"/plugins/\"+pluginName;\n\t\t\tvar pluginDoesExist = fs.pathExistsSync(pluginPath);\n\t\t\tif(!pluginDoesExist){\n\t\t\t\tconsole.log(\"Plugin does not exist: \"+pluginName);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check that theme exist\n\t\t\tvar themePath = process.cwd()+\"/plugins/\"+pluginName+\"/\"+path+\"/themes/\"+themeName;\n\t\t\tvar themeDoesExist = fs.pathExistsSync(themePath);\n\t\t\tif(!themeDoesExist){\n\t\t\t\tconsole.log(\"Plugin theme does not exist: \"+themeName);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check that component has no spaces and any special characters except _\n\t\t\tvar isNameValid = generalSupport.checkIfValid(compName,[\"_\",\"-\"]);\n\t\t\tif(!isNameValid){\n\t\t\t\tconsole.log(\"Please provide a valid component name\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar configFile = process.cwd()+\"/\"+mainConfigFile;\n\t\t\tvar pluginConfigFile = process.cwd()+\"/plugins/\"+pluginName+\"/plugin.config.json\";\n\t\t\tgeneralSupport.readFile(configFile,function(content){\n\t\t\t\tvar config = JSON.parse(content);\n\n\t\t\t\tgeneralSupport.readFile(pluginConfigFile,function(content2){\n\t\t\t\t\tvar pluginConfig = JSON.parse(content2);\n\n\t\t\t\t\tcompComponentOption(pluginName,themeName,compName,path,config,configFile,pluginConfig,pluginConfigFile);\n\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "f02499dd04114d81e03ca98cf3ffe51f", "score": "0.47313157", "text": "updateBlueprint(component, action) {\n const blueprintComponent = {\n name: component.name,\n version: component.version,\n };\n // action is add or remove, and maybe update\n if (action === 'add') {\n if (component.ui_type === 'Module') {\n this.blueprint.modules.push(blueprintComponent);\n } else if (component.ui_type === 'RPM') {\n this.blueprint.packages.push(blueprintComponent);\n }\n }\n if (action === 'edit') {\n if (component.ui_type === 'Module') {\n // comment the following two lines to fix eslint no-unused-vars error\n // let updatedComponent = this.blueprint.modules.filter((obj) => (obj.name === blueprintComponent.name))[0];\n // updatedComponent = Object.assign(updatedComponent, blueprintComponent);\n } else if (component.ui_type === 'RPM') {\n // comment the following two lines to fix eslint no-unused-vars error\n // let updatedComponent = this.blueprint.packages.filter((obj) => (obj.name === blueprintComponent.name))[0];\n // updatedComponent = Object.assign(updatedComponent, blueprintComponent);\n }\n }\n if (action === 'remove') {\n if (component.ui_type === 'Module') {\n this.blueprint.modules = this.blueprint.modules.filter(\n (obj) => (!(obj.name === blueprintComponent.name && obj.version === blueprintComponent.version))\n );\n } else if (component.ui_type === 'RPM') {\n this.blueprint.packages = this.blueprint.packages.filter(\n (obj) => (!(obj.name === blueprintComponent.name && obj.version === blueprintComponent.version))\n );\n }\n }\n }", "title": "" }, { "docid": "be3f8ea4d5afa3915e4db5f96b8cb92d", "score": "0.47293112", "text": "function mergeRepo(data) {\n\n if (fs.existsSync(SHAFILE)) {\n var d = (fs.readFileSync(SHAFILE) + '').trim();\n if (d === data.shasum.trim()) {\n console.log(\"Aborting since everything is up to date.\");\n return;\n }\n }\n fs.writeFileSync(SHAFILE, data.shasum);\n \n var pth = data.path;\n var subdirs = fs.readdirSync(pth).filter(function(subdir) {\n var stat = fs.statSync(path.resolve(pth, subdir));\n return stat.isDirectory();\n });\n if (!fs.existsSync(config.local.cacheFolder)) {\n fs.mkdirSync(config.local.cacheFolder);\n }\n var pagesDir = path.resolve(pth, subdirs[0], \"pages\"),\n pagesSubdirs = fs.readdirSync(pagesDir);\n\n pagesSubdirs.forEach(function(dir) {\n var dpath = path.resolve(pagesDir, dir),\n pages = fs.readdirSync(dpath);\n pages.forEach(function(page) {\n if (path.extname(page) === \".md\") {\n var ppath = path.resolve(dpath, page),\n npath = path.resolve(config.local.cacheFolder, path.basename(page).replace(/\\.md$/,\"\") + \".\" + dir + \".md\");\n if (fs.existsSync(npath)) {\n fs.unlinkSync(npath);\n }\n function nicepath(p) {\n return path.basename(path.dirname(p)) + '/' + path.basename(p);\n }\n console.log(\"Copying \" + nicepath(ppath) + \" to \" + npath);\n copyFile(ppath, npath, function(err) {\n if (err) {\n console.log(\"ERR: \" + err);\n }\n });\n }\n });\n });\n}", "title": "" }, { "docid": "262c188e4f18dd5c21fedc4588fd2b43", "score": "0.47265548", "text": "function merge(original, updates) {\n return mergeWithOptions(original, updates);\n }", "title": "" }, { "docid": "039eabd700c9413b2c68788773cbdc44", "score": "0.4716205", "text": "_writeLiquibaseFiles() {\n // Write initial liquibase files\n this.writeFilesToDisk(addEntityFiles, this, false, this.sourceRoot());\n if (!this.skipFakeData) {\n this.writeFilesToDisk(fakeFiles, this, false, this.sourceRoot());\n }\n\n const fileName = `${this.changelogDate}_added_entity_${this.entity.entityClass}`;\n if (this.incremental) {\n this.addIncrementalChangelogToLiquibase(fileName);\n } else {\n this.addChangelogToLiquibase(fileName);\n }\n\n if (this.entity.fieldsContainOwnerManyToMany || this.entity.fieldsContainOwnerOneToOne || this.entity.fieldsContainManyToOne) {\n const constFileName = `${this.changelogDate}_added_entity_constraints_${this.entity.entityClass}`;\n if (this.incremental) {\n this.addIncrementalChangelogToLiquibase(constFileName);\n } else {\n this.addConstraintsChangelogToLiquibase(constFileName);\n }\n }\n }", "title": "" }, { "docid": "1bf7d3802ce104eee946f61fa4e7a41a", "score": "0.4705381", "text": "async _promote_version_to_latest(fs_context, params, deleted_version_info, latest_ver_path) {\n dbg.log1('Namespace_fs._promote_version_to_latest', params, deleted_version_info, latest_ver_path);\n const deleted_latest = deleted_version_info && deleted_version_info.path === latest_ver_path;\n const prev_version_id = deleted_latest && deleted_version_info.prev_version_id;\n\n let retries = config.NSFS_RENAME_RETRIES;\n for (;;) {\n try {\n const latest_version_info = await this._get_version_info(fs_context, latest_ver_path);\n if (latest_version_info) return;\n const max_past_ver_info = (prev_version_id &&\n (await this.get_prev_version_info(fs_context, params.key, prev_version_id))) ||\n (await this.find_max_version_past(fs_context, params.key));\n\n if (!max_past_ver_info || max_past_ver_info.delete_marker) return;\n // 2 - if deleted file is a delete marker and is older than max past version - no need to promote max - return\n if (deleted_version_info &&\n deleted_version_info.delete_marker &&\n deleted_version_info.mtimeNsBigint < max_past_ver_info.mtimeNsBigint) return;\n dbg.log1('Namespace_fs._promote_version_to_latest ', max_past_ver_info.path, latest_ver_path, max_past_ver_info, latest_version_info);\n // on concurrent put, safe_move_gpfs might override new coming latest (no fd verification, gpfs linkfileat will override)\n await this.safe_move_posix(fs_context, max_past_ver_info.path, latest_ver_path, max_past_ver_info);\n break;\n } catch (err) {\n retries -= 1;\n if (retries <= 0) throw err;\n if (!this._is_gpfs(fs_context) && err.code === 'EEXIST') {\n dbg.warn('Namespace_fs._delete_version_id: latest version exist - skipping');\n return;\n }\n if (err.code !== 'ENOENT') throw err;\n dbg.warn(`NamespaceFS: _promote_version_to_latest failed retries=${retries}`, err);\n }\n }\n }", "title": "" }, { "docid": "57f76775843791aa264b757486624499", "score": "0.4688883", "text": "function d(t,e,r,n,o,i,s){return t.op=e,c.canMerge(r)&&t.merge(r),n&&t._mergeUpdate(n),a.isObject(o)&&t.setOptions(o),i||s?!t._update||!t.options.overwrite&&0===a.keys(t._update).length?(s&&a.soon(s.bind(null,null,0)),t):(o=t._optionsForExec(),s||(o.safe=!1),r=t._conditions,n=t._updateForExec(),u(\"update\",t._collection.collectionName,r,n,o),s=t._wrapCallback(e,s,{conditions:r,doc:n,options:o}),t._collection[e](r,n,o,a.tick(s)),t):t;}", "title": "" }, { "docid": "95fe9c661b8a0d3e5c55692167669383", "score": "0.46809587", "text": "function getComponents(cwd, components, currentDir, jenkinsPosition) {\n var imgDir = path.join(currentDir, \"img\");\n if (!fs.existsSync(imgDir)) {\n fs.mkdirSync(imgDir);\n }\n\n components.forEach(function (overview) {\n var componentDirName = path.dirname(overview);\n var componentHeader = path.basename(componentDirName);\n // Create the component article file, i.e. button.md\n var componentArticleFile = path.join(currentDir, componentHeader + \".md\");\n\n var componentPrettyHeader = prettify(componentHeader);\n\n var componentArticlesOrder = [];\n // Jenkins Header\n // MetaData.md\n var subDirPath = overview.replace(\"/overview.md\", \"\");\n var pathExists = fs.existsSync(path.join(subDirPath, \"metadata.md\"));\n\n if (pathExists) {\n var metadata = path.join(subDirPath, \"metadata.md\");\n var metadataContents = fs.readFileSync(metadata, { encoding: 'utf8' });\n var metadataSplit = metadataContents.split(\"---\");\n fs.appendFileSync(componentArticleFile, \"---\\n\", { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, metadataSplit[1], { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, \"---\\n\\n\", { encoding: 'utf8' });\n\n if (metadataSplit[2].indexOf(\"example-order\") >= 0) {\n var exampleOrderString = metadataSplit[2].split(\":\");\n var orderString = exampleOrderString[1].replace(/\\s/g, '');\n componentArticlesOrder = orderString.split(\",\");\n }\n }\n else {\n fs.appendFileSync(componentArticleFile, \"---\\n\", { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, \"title: \" + componentPrettyHeader + \"\\n\", { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, \"description: \" + componentPrettyHeader + \" SDK Examples\" + \"\\n\", { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, \"position: \" + jenkinsPosition++ + \"\\n\", { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, \"slug: \" + componentHeader + \"\\n\", { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, \"---\\n\\n\", { encoding: 'utf8' });\n }\n\n // Component Markdown Header\n fs.appendFileSync(componentArticleFile, \"# \" + componentPrettyHeader + \"\\n\\n\", { encoding: 'utf8' });\n\n // Component Overview\n var overviewContents = fs.readFileSync(overview, { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, overviewContents + \"\\n\\n\", { encoding: 'utf8' });\n\n // Component Images\n let componentImage = path.join(componentDirName, \"image.png\");\n if (fs.existsSync(componentImage)) {\n let newImageFileName = componentHeader + \"-\" + \"image.png\";\n fs.copySync(componentImage, path.join(imgDir, newImageFileName));\n\n fs.appendFileSync(componentArticleFile, \"![Image](img/\" + newImageFileName + \" \\\"Image\\\")\\n\\n\", { encoding: 'utf8' });\n }\n var articles = [];\n if (componentArticlesOrder.length > 0) {\n articles = orderExamples(glob.sync(componentDirName + \"/**/article.md\"), componentArticlesOrder, componentDirName);\n } else {\n articles = glob.sync(componentDirName + \"/**/article.md\").sort(compareFiles);\n }\n\n // Append each example to the big article file.\n articles.forEach(function (article) {\n var articleDirName = path.dirname(article);\n var articleHeader = path.basename(articleDirName);\n\n // Header\n var prettyArticleHeader = prettify(articleHeader);\n prettyArticleHeader = prettyArticleHeader.replace(/Ios|IOS/, \"iOS\");\n fs.appendFileSync(componentArticleFile, \"## \" + prettyArticleHeader + \"\\n\\n\", { encoding: 'utf8' });\n\n // Content\n var articleContents = fs.readFileSync(article, { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, articleContents + \"\\n\\n\", { encoding: 'utf8' });\n\n // Article Images\n let articleImage = path.join(articleDirName, \"image.png\");\n\n if (fs.existsSync(articleImage)) {\n let newArticleImageFileName = componentHeader + \"-\" + articleHeader + \"-image.png\";\n let joined = path.join(imgDir, newArticleImageFileName);\n fs.copySync(articleImage, joined);\n\n fs.appendFileSync(componentArticleFile, \"![Image](img/\" + newArticleImageFileName + \" \\\"Image\\\")\\n\\n\", { encoding: 'utf8' });\n }\n let articleImages = glob.sync(articleDirName + \"/*.png\");\n articleImages.forEach(function (imagePath) {\n let stringSplitResult = imagePath.split(\"/\");\n let imageName = stringSplitResult[stringSplitResult.length - 1];\n let joined = path.join(imgDir, imageName);\n fs.copySync(imagePath, joined);\n })\n\n // Links\n var githubDirUrl = pjson.homepage + \"/edit/master/\" + path.relative(cwd, articleDirName).replace(/\\\\/g, \"/\");\n\n var linkToDocument = \"[Improve this document](\" + githubDirUrl + \"/\" + path.basename(article) + \")\"\n fs.appendFileSync(componentArticleFile, linkToDocument + \"\\n\\n\", { encoding: 'utf8' });\n\n var linkToSource = \"[Demo Source](\" + githubDirUrl + \")\"\n fs.appendFileSync(componentArticleFile, linkToSource + \"\\n\\n\", { encoding: 'utf8' });\n\n // Horizontal Line\n fs.appendFileSync(componentArticleFile, \"---\\n\\n\", { encoding: 'utf8' });\n });\n\n // End.md\n var subDirPath = overview.replace(\"/overview.md\", \"\");\n var end = path.join(subDirPath, \"end.md\");\n var endContents = fs.readFileSync(end, { encoding: 'utf8' });\n fs.appendFileSync(componentArticleFile, endContents + \"\\n\\n\", { encoding: 'utf8' });\n });\n}", "title": "" }, { "docid": "8d360ed43fa461283293261fd1cf2029", "score": "0.46717924", "text": "putObjectVerCase1(c, bucketName, objName, objVal, params, log, cb) {\n const versionId = generateVersionId(this.replicationGroupId);\n // eslint-disable-next-line\n objVal.versionId = versionId;\n const vObjName = formatVersionKey(objName, versionId);\n c.bulkWrite([{\n updateOne: {\n filter: {\n _id: vObjName,\n },\n update: {\n _id: vObjName, value: objVal,\n },\n upsert: true,\n },\n }, {\n updateOne: {\n // eslint-disable-next-line\n filter: {\n _id: objName,\n $or: [{\n 'value.versionId': {\n $exists: false,\n },\n },\n {\n 'value.versionId': {\n $gt: objVal.versionId,\n },\n },\n ],\n },\n update: {\n _id: objName, value: objVal,\n },\n upsert: true,\n },\n }], {\n ordered: 1,\n }, err => {\n /*\n * Related to https://jira.mongodb.org/browse/SERVER-14322\n * It happens when we are pushing two versions \"at the same time\"\n * and the master one does not exist. In MongoDB, two threads are\n * trying to create the same key, the master version, and one of\n * them, the one with the highest versionID (less recent one),\n * fails.\n * We check here than than the MongoDB error is related to the\n * second operation, the master version update and than the error\n * code is the one related to mentionned issue.\n */\n if (err) {\n if (!err.index || err.index !== 1\n || !err.code || err.code !== 11000) {\n log.error(\n 'putObjectVerCase1: error putting object version',\n { error: err.errmsg });\n return cb(errors.InternalError);\n }\n log.debug('putObjectVerCase1: error putting object version',\n { code: err.code, error: err.errmsg });\n }\n return cb(null, `{\"versionId\": \"${versionId}\"}`);\n });\n }", "title": "" }, { "docid": "b8121223a8b9861352406eb74cd4a850", "score": "0.46689904", "text": "function merge(appPath, templatePath)\n{\n const appPackage = require(path.join(appPath, 'package.json'));\n\n const templateJsonPath = path.join(templatePath, 'template.json');\n\n let templateJson = {};\n if (fs.existsSync(templateJsonPath)) {\n templateJson = require(templateJsonPath);\n }\n\n const templatePackageToMerge = ['dependencies', 'scripts'];\n\n const templatePackageToReplace = Object.keys(templateJson).filter(key => {\n return (\n !templatePackageToMerge.includes(key)\n );\n });\n\n const templateScripts = templateJson.scripts || {};\n appPackage.scripts = Object.assign(\n {\n start: \"webpack serve --mode development --open --hot\",\n build: \"webpack --mode production\"\n },\n templateScripts\n );\n\n templatePackageToReplace.forEach(key => {\n appPackage[key] = templateJson[key];\n });\n\n fs.writeFileSync(\n path.join(appPath, 'package.json'),\n JSON.stringify(appPackage, null, 2) + os.EOL\n );\n\n\n\n\n const dependenciesToInstall = Object.entries({\n ...templateJson.dependencies,\n ...templateJson.devDependencies,\n });\n if (dependenciesToInstall.length) {\n dependencies = dependencies.concat(\n dependenciesToInstall.map(([dependency, version]) => {\n return `${dependency}@${version}`;\n })\n );\n }\n\n return {...appPackage, dependencies};\n \n}", "title": "" }, { "docid": "8178813155ea0f599a28e2e4f831483a", "score": "0.4661124", "text": "bumpVersion(modulePath) {\n const oldVersion = this.imports.get(modulePath);\n this.imports.set(modulePath, {\n version: oldVersion ? oldVersion.version++ : 1,\n modulePath,\n });\n }", "title": "" }, { "docid": "e6c83b4207341522b93908d4ca1b6c3f", "score": "0.46596116", "text": "componentDidUpdate() {\n this.processFiles();\n }", "title": "" }, { "docid": "46a53c91c7070306df9442730d7d75d2", "score": "0.46595055", "text": "function mergeAssets(parentVal, childVal, vm, key) {\n var res = babel_runtime_core_js_object_create__WEBPACK_IMPORTED_MODULE_0___default()(parentVal || null);\n if (childVal) {\n \"none\" !== 'production' && assertObjectType(key, childVal, vm);\n return Object(shared_util__WEBPACK_IMPORTED_MODULE_7__[\"extend\"])(res, childVal);\n } else {\n return res;\n }\n}", "title": "" }, { "docid": "75ee02cfdacecf11a38ac1431c0e4904", "score": "0.4658029", "text": "async installUpdate() {\n this.emit('update.start');\n if (this.ignore) {\n this.ignore.forEach((file) => {\n file = path.join(this.temp, file);\n if (fs.existsSync(file)) {\n if (fs.lstatSync(file).isDirectory()) {\n rmdir.sync(file);\n } else {\n fs.unlinkSync(file);\n }\n }\n });\n }\n let destination = this.testing ? './testing/' : './';\n fs.ensureDirSync(destination);\n fs.copySync(this.temp, destination);\n fs.removeSync(this.temp);\n }", "title": "" }, { "docid": "f5718f6d51e4c4be776219c7823f2b96", "score": "0.46460995", "text": "static PUT(repositorypath, filepath, req, res) {\n var fullpath = path.join(repositorypath, filepath);\n log('write file: ' + fullpath);\n var fullBody = '';\n // if (filepath.match(/png$/)) {\n if (filepath.match(isTextRegEx)) {\n // #TODO how do we better decide if we need this...\n } else {\n log('set binary encoding');\n req.setEncoding('binary');\n }\n // }\n\n //read chunks of data and store it in buffer\n req.on('data', function(chunk) {\n fullBody += chunk.toString();\n });\n\n //after transmission, write file to disk\n req.on('end', async () => {\n if (fullpath.match(/\\/$/)) {\n mkdirp(fullpath, err => {\n if (err) {\n log('Error creating dir: ' + err);\n }\n log('mkdir ' + fullpath);\n res.writeHead(200, 'OK');\n res.end();\n });\n } else {\n var lastVersion = req.headers['lastversion'];\n var currentVersion = await this.getVersion(repositorypath, filepath);\n\n log('last version: ' + lastVersion);\n log('current version: ' + currentVersion);\n\n // we have version information and there is a conflict\n if (lastVersion && currentVersion && lastVersion !== currentVersion) {\n log('[writeFile] CONFLICT DETECTED');\n res.writeHead(409, {\n // HTTP CONFLICT\n 'content-type': 'text/plain',\n conflictversion: currentVersion\n });\n res.end('Writing conflict detected: ' + currentVersion);\n return;\n }\n\n log('size ' + fullBody.length);\n fs.writeFile(\n fullpath,\n fullBody,\n fullpath.match(isTextRegEx) ? undefined : 'binary',\n err => {\n if (err) {\n // throw err;\n log(err);\n return;\n }\n\n if (autoCommit) {\n var username = req.headers.gitusername;\n var email = req.headers.gitemail;\n // var password = req.headers.gitpassword; // not used yet\n\n var authCmd = '';\n if (username) authCmd += `git config user.name '${username}'; `;\n if (email) authCmd += `git config user.email '${email}'; `;\n log('EMAIL ' + email + ' USER ' + username);\n\n // #TODO maybe we should ask for github credetials here too?\n let cmd = `cd \"${repositorypath}\"; ${authCmd} git add \"${filepath}\"; git commit -m \"AUTO-COMMIT ${filepath}\"`;\n log('[AUTO-COMMIT] ' + cmd);\n exec(cmd, (error, stdout, stderr) => {\n log('stdout: ' + stdout);\n log('stderr: ' + stderr);\n if (error) {\n log('ERROR');\n res.writeHead(500, '' + err);\n res.end('ERROR: ' + stderr);\n } else {\n // return the hash for the commit, we just created\n let fileVersionCmd = `cd \"${repositorypath}\"; git log -n 1 --pretty=format:%H -- \"${filepath}\"`;\n log('cmd: ' + fileVersionCmd);\n exec(fileVersionCmd, (error, stdout, stderr) => {\n log('New version: ' + stdout);\n if (error) {\n res.writeHead(500);\n res.end(\n 'could not retrieve new version... somthing went wrong: ' +\n stdout +\n ' ' +\n stderr\n );\n } else {\n res.writeHead(200, {\n 'content-type': 'text/plain',\n fileversion: stdout\n });\n res.end('Created new version: ' + stdout);\n }\n });\n }\n });\n } else {\n log('saved ' + fullpath);\n res.writeHead(200, 'OK');\n res.end();\n }\n }\n );\n }\n });\n }", "title": "" }, { "docid": "4990bfdc940c09c75828256646e01187", "score": "0.4643851", "text": "addFile(file) {\n const hash = objectHash(file)\n if (this.state.fileIndex[hash]) return\n this.handleChange(this.state.files.concat(file))\n }", "title": "" }, { "docid": "81017d34bdf141d0a3d560512d698ae3", "score": "0.46343106", "text": "function writeTreeAddMerge(writeTree, path, changedChildren, writeId) {\n Object(__WEBPACK_IMPORTED_MODULE_2__firebase_util__[\"assert\"])(writeId > writeTree.lastWriteId, 'Stacking an older merge on top of newer ones');\n writeTree.allWrites.push({\n path: path,\n children: changedChildren,\n writeId: writeId,\n visible: true\n });\n writeTree.visibleWrites = compoundWriteAddWrites(writeTree.visibleWrites, path, changedChildren);\n writeTree.lastWriteId = writeId;\n}", "title": "" }, { "docid": "8743eedd9f9db8ee39414df3d3d52b64", "score": "0.463324", "text": "updateConfig(config) {\n\n if (!config) return;\n\n // Temp fix to support config.component\n if (config.component && !config.sPath) config.sPath = config.component;\n\n // Set sPath\n if (config.sPath || config.component) {\n this._config.component = config.component;\n this._config.sPath = config.sPath;\n }\n\n // Make full path\n if (this._S.config.projectPath && this._config.sPath) {\n this._config.fullPath = path.join(this._S.config.projectPath, this._config.sPath);\n }\n }", "title": "" }, { "docid": "28a0e2dbe826ff4dbe733b633f3cec81", "score": "0.46303815", "text": "function applyPatches(uniDiff, options) {\n\t\t if (typeof uniDiff === 'string') {\n\t\t uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n\t\t }\n\n\t\t var currentIndex = 0;\n\t\t function processIndex() {\n\t\t var index = uniDiff[currentIndex++];\n\t\t if (!index) {\n\t\t return options.complete();\n\t\t }\n\n\t\t options.loadFile(index, function (err, data) {\n\t\t if (err) {\n\t\t return options.complete(err);\n\t\t }\n\n\t\t var updatedContent = applyPatch(data, index, options);\n\t\t options.patched(index, updatedContent, function (err) {\n\t\t if (err) {\n\t\t return options.complete(err);\n\t\t }\n\n\t\t processIndex();\n\t\t });\n\t\t });\n\t\t }\n\t\t processIndex();\n\t\t}", "title": "" }, { "docid": "4ed44574867011e43cb1cdce91957545", "score": "0.4628723", "text": "function fs_atmomicReplace (\n destFilename, /* this is the file we are writing \"data\"\" to */\n transitFilename, /* this is the file that's used to do the atomic write/swap */\n data, /* this is the data being written to destFilename */\n hash, /* this is the hash of the data being written (optional, will hash it if not supplied )*/\n swap, /* forces transitFilename to persist after the operation, and it will contain whatever \n was in destfile before the process began (eg good for a backup file)*/\n cb ) {/* (err, hash, hash_of_replaced, replaced, transithash, transitdata ) */\n \n \n if (typeof swap==='function') {\n cb=swap;\n swap=false;\n }\n \n if (typeof hash==='function') {\n cb=hash;\n hash=undefined;\n swap=false;\n }\n const source = Buffer.isBuffer(data) ? data : Buffer.from(data);\n \n if (typeof hash!=='string') {\n hash = crypto.createHash(\"sha1\").update(source).digest(\"hex\");\n }\n \n \n \n const phase_2 = function (transit_data,transit_hash){\n \n fs.readFile(destFilename,function(err,current_data,stat){\n \n \n if (!err && current_data) {\n \n \n if (Buffer.compare(source,current_data)===0) {\n \n if(swap) {\n \n if ( transit_hash===hash ) {\n \n return cb (\n undefined,\n hash,\n hash,\n current_data,\n transit_hash,\n transit_data); \n }\n \n fs_writeFile(transitFilename,current_data,function(err){\n if (err) return cb(err);\n return cb(\n undefined,\n hash,\n crypto.createHash(\"sha1\").update(current_data).digest(\"hex\"),\n current_data,\n transit_hash,\n transit_data );\n });\n \n \n \n \n } else {\n \n return cb (\n undefined,\n hash,\n hash,\n current_data,\n transit_hash,\n transit_data );\n \n }\n }\n \n if (transit_hash===hash) {\n \n fs.rename(transitFilename,destFilename,function(){\n if (err) return cb(err);\n \n if (swap) {\n \n fs_writeFile(transitFilename,current_data,function(err){\n if (err) return cb(err);\n return cb(\n undefined,\n hash,\n crypto.createHash(\"sha1\").update(current_data).digest(\"hex\"),\n current_data,\n transit_data,\n transit_hash);\n \n \n \n }); \n \n } else {\n return cb(\n undefined,\n hash,\n crypto.createHash(\"sha1\").update(current_data).digest(\"hex\"),\n current_data);\n \n }\n });\n } else {\n \n \n fs_writeFile(transitFilename,source,function(err){\n if (err) return cb(err);\n fs.rename(transitFilename,destFilename,function(){\n if (err) return cb(err);\n if (swap) {\n fs_writeFile(transitFilename,current_data,function(err){\n if (err) return cb(err);\n return cb(\n undefined,\n hash,\n crypto.createHash(\"sha1\").update(current_data).digest(\"hex\"),\n current_data,\n transit_hash,\n transit_data\n );\n });\n } else {\n return cb(\n undefined,\n hash,\n crypto.createHash(\"sha1\").update(current_data).digest(\"hex\"),\n current_data\n ); \n \n }\n });\n });\n }\n \n } else {\n \n if (transit_hash===hash) {\n \n fs.rename(transitFilename,destFilename,function(err){\n if (err) return cb(err);\n if (swap) {\n fs_writeFile(transitFilename,transit_data,function(err){\n if (err) return cb(err);\n return cb(undefined,hash,undefined,undefined,transit_data,transit_hash) ;\n });\n } else {\n return cb(undefined,hash);\n }\n });\n \n } else {\n \n fs_writeFile(transitFilename,source,function(err){\n if (err) return cb(err);\n fs.rename(transitFilename,destFilename,function(err){\n if (err) return cb(err);\n \n fs_writeFile(transitFilename,transit_data,function(err){\n if (err) return cb(err);\n return cb(undefined,hash,undefined,undefined,transit_data,transit_hash) ;\n });\n \n });\n });\n \n }\n \n }\n \n });\n \n };\n \n if (swap) {\n fs.readFile(transitFilename,function(err,data){\n // if no previous transit data, just, proceed without it \n if (err) return phase_2();\n phase_2(data,crypto.createHash(\"sha1\").update(data).digest(\"hex\"));\n });\n } else {\n \n phase_2();\n }\n \n}", "title": "" }, { "docid": "1b8e9462fbab9199937725d02e53ba51", "score": "0.46279684", "text": "function pkgUpdate(pth, prt, props) {\n\t\t\tvar rtn = {\n\t\t\t\tpath : pth || '',\n\t\t\t\tprops : Array.isArray(props) ? props : null,\n\t\t\t\toldVer : '',\n\t\t\t\tversion : '',\n\t\t\t\tpropChangeCount : 0\n\t\t\t};\n\t\t\tif (!rtn.path) {\n\t\t\t\treturn rtn;\n\t\t\t}\n\t\t\trtn.pkg = rbot.file.readJSON(rtn.path);\n\t\t\trtn.pkgParent = prt;\n\t\t\trtn.oldVer = rtn.pkg.version;\n\t\t\trtn.u = !opts.revert && !opts.next && pkgPropUpd(rtn, true, false, false);\n\t\t\trtn.n = !opts.revert && opts.next && pkgPropUpd(rtn, false, true, false);\n\t\t\trtn.r = opts.revert && pkgPropUpd(rtn, false, false, true);\n\t\t\tif (rtn.u || rtn.n || rtn.r) {\n\t\t\t\tif (rtn.propChangeCount > 0) {\n\t\t\t\t\trtn.pkgStr = JSON.stringify(rtn.pkg, opts.replacer, opts.space);\n\t\t\t\t\tif (!opts.readOnly) {\n\t\t\t\t\t\trbot.file.write(rtn.path, typeof opts.altWrite === 'function' ? opts.altWrite(rtn,\n\t\t\t\t\t\t\t\topts.replacer, opts.space) : rtn.pkgStr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn rtn;\n\t\t}", "title": "" }, { "docid": "0fb146688805aabe86b5aef1feb9396c", "score": "0.46213838", "text": "updateSync() {\n\t\tthis.stat = fs.statSync(this.path)\n\t}", "title": "" }, { "docid": "697cf31e27b2ecaa3d37072445f3600a", "score": "0.4620982", "text": "mergeConfigFragmentIntoService(configFilename) {\n\n const servicePath = this.serverless.config.servicePath;\n const configFragmentFilePath = configFilename.substr(0, configFilename.lastIndexOf(\"/\"));\n const relativeConfigFragmentFilePath = configFragmentFilePath.replace(servicePath + \"/\", \"\");\n const configFragment = this.serverless.utils.readFileSync(configFilename);\n\n // ignore field is present and true then ignore\n if (configFragment.ignore) {\n this.serverless.cli.log(\"Colocate is ignoring \" + configFilename.replace(servicePath, \"\"));\n return;\n }\n\n delete configFragment.ignore;\n\n if (configFragment && configFragment.functions) {\n\n Object.keys(configFragment.functions).forEach(functionName =>\n correctHandlerLocation(functionName, configFragment, relativeConfigFragmentFilePath));\n }\n \n if (configFragment && configFragment.layers) {\n Object.keys(configFragment.layers).forEach(layerName => {\n if (configFragment.layers[layerName].package && configFragment.layers[layerName].package.artifact){\n configFragment.layers[layerName].package.artifact = \n this.updateLocation(configFragment.layers[layerName].package.artifact, relativeConfigFragmentFilePath)\n }\n });\n \n }\n\n this.serverless.service = _.merge(this.serverless.service || {}, configFragment);\n }", "title": "" }, { "docid": "9f81c750929412c2cfca234118bf6203", "score": "0.46184567", "text": "function addComponent (componentName) {\n var name = componentName.split(MULTIPLE_COMPONENT_DELIMITER)[0];\n if (!COMPONENTS[name]) { return; }\n componentsToUpdate[componentName] = true;\n }", "title": "" }, { "docid": "de988b0ad0ff96c8b99d988ff596eda9", "score": "0.4607512", "text": "function composeConflict(receiverFileHash, giverFileHash) {\n return \"<<<<<<\\n\" + objects.read(receiverFileHash) +\n \"\\n======\\n\" + objects.read(giverFileHash) +\n \"\\n>>>>>>\\n\";\n }", "title": "" }, { "docid": "e198af78ae8c30d57fb7f6321de9ee2e", "score": "0.46005616", "text": "function importComponents(component) {\n if (_depList.indexOf(component) > -1) {\n return\n }\n let sourceComp = path.resolve(process.cwd(), component.replace('~', 'node_modules/'))\n let npmDir = component.replace('~', 'dist/npm/')\n let targetDir = path.resolve(process.cwd(), npmDir)\n fs.copy(sourceComp, targetDir)\n this.output({ action: '写入', file: targetDir })\n _depList.push(component)\n}", "title": "" }, { "docid": "225f1c09d3ae8b953fbb11ba440db627", "score": "0.45962504", "text": "update() {\n fs.writeFileSync(path, output);\n }", "title": "" }, { "docid": "ae15996a95881e1d387e79b3d7b1c96b", "score": "0.45942554", "text": "function commitChanges() {\n\treturn gulp.src('.')\n\t\t.pipe(git.add())\n\t\t.pipe(git.commit(`chore: Release ${pkgJson.version}`));\n}", "title": "" }, { "docid": "ae15996a95881e1d387e79b3d7b1c96b", "score": "0.45942554", "text": "function commitChanges() {\n\treturn gulp.src('.')\n\t\t.pipe(git.add())\n\t\t.pipe(git.commit(`chore: Release ${pkgJson.version}`));\n}", "title": "" }, { "docid": "6d5670e47cea047537bfaa0de0dc2b1f", "score": "0.4593027", "text": "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "title": "" }, { "docid": "6d5670e47cea047537bfaa0de0dc2b1f", "score": "0.4593027", "text": "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "title": "" }, { "docid": "3281c713eb4f5a0088497cc760aa9f9c", "score": "0.45913792", "text": "static _doUpdates() {\n let curVersion = state.CheckItOut.version;\n\n if (curVersion === '1.0') {\n CheckItOut.State._updateTo_1_1();\n curVersion = '1.1';\n }\n\n // Set the state's version to the latest.\n state.CheckItOut.version = 'SCRIPT_VERSION';\n }", "title": "" }, { "docid": "9b6b5f0b629e926ae59044fed75b8fe3", "score": "0.45902273", "text": "function addColumn() {\n var source = SpreadsheetApp.getActiveSpreadsheet();\n var newrange = source.getSheets()[1];\n var header = newrange.getRange(\"K5:L5\").getFormulas();\n var form = newrange.getRange(\"K8:L37\").getFormulas();\n var summary = newrange.getRange(\"K4:L4\").getValues();\n var text = newrange.getRange(\"K6:L7\").getValues();\n var sourceFile = DriveApp.getFileById(source.getId());\n var sourceFolder = sourceFile.getParents().next();\n var folderFiles = sourceFolder.getFiles();\n var thisFile;\n\n // use this to update files in the current folder\n while (folderFiles.hasNext()) {\n thisFile = folderFiles.next();\n if (thisFile.getName() !== sourceFile.getName()) {\n var currentSS = SpreadsheetApp.openById(thisFile.getId());\n var destsheet = currentSS.getSheets()[1];\n destsheet.getRange(\"H3:K3\").breakApart();\n destsheet.getRange(\"K5:L5\").setValues(header);\n destsheet.getRange(\"K8:L37\").setValues(form);\n destsheet.getRange(\"K4:L4\").setValues(summary);\n destsheet.getRange(\"K6:L7\").setValues(text);\n destsheet.getRange(\"H3:L3\").merge();\n destsheet.getRange(\"K6:K7\").merge();\n destsheet.getRange(\"L6:L7\").merge();\n destsheet.getRange(\"H3:L7\").setBorder(true, true, true, true, true, true);\n }\n }\n}", "title": "" }, { "docid": "f504f4b90ececbefbf46e68423d5ce0e", "score": "0.45852426", "text": "putObjectVerCase4(c, bucketName, objName, objVal, params, log, cb) {\n const vObjName = formatVersionKey(objName, params.versionId);\n c.update({\n _id: vObjName,\n }, {\n _id: vObjName,\n value: objVal,\n }, {\n upsert: true,\n }, err => {\n if (err) {\n log.error(\n 'putObjectVerCase4: error upserting object version',\n { error: err.message });\n return cb(errors.InternalError);\n }\n this.getLatestVersion(c, objName, log, (err, mstObjVal) => {\n if (err) {\n log.error('getLatestVersion: getting latest version',\n { error: err.message });\n return cb(err);\n }\n MongoUtils.serialize(mstObjVal);\n // eslint-disable-next-line\n c.update({\n _id: objName,\n 'value.versionId': {\n // We break the semantic correctness here with\n // $gte instead of $gt because we do not have\n // a microVersionId to capture the micro\n // changes (tags, ACLs, etc). If we do not use\n // $gte currently the micro changes are not\n // propagated. We are now totally dependent of\n // the order of changes (which Backbeat\n // replication and ingestion can hopefully\n // ensure), but this would not work e.g. in\n // the case of an active-active replication.\n $gte: mstObjVal.versionId,\n },\n }, {\n _id: objName,\n value: mstObjVal,\n }, {\n upsert: true,\n }, err => {\n if (err) {\n // we accept that the update fails if\n // condition is not met, meaning that a more\n // recent master was already in place\n if (err.code !== 11000) {\n log.error(\n 'putObjectVerCase4: error upserting master',\n { error: err.message });\n return cb(errors.InternalError);\n }\n }\n return cb(null, `{\"versionId\": \"${objVal.versionId}\"}`);\n });\n return undefined;\n });\n return undefined;\n });\n }", "title": "" }, { "docid": "cc28ce2e291d6f4e767c4b6c5d4e49da", "score": "0.45790964", "text": "function updateComponents() {\n self.lastUsedSizeOption = self.exportSizes.selectedOption;\n exportComponentsService.update(showToast);\n }", "title": "" }, { "docid": "75b5816f6fdf3e20044e99d783aabae6", "score": "0.4574779", "text": "[onSync](fileSubsystem) {\n this.sourceDir = fileSubsystem.path;\n fs.postprocessTree(fileSubsystem);\n fs.buildFileSubsystem(\n fileSubsystem,\n this.targetDir,\n this.sourceDir,\n err => {\n if (err) {\n this.emit('error', err);\n return;\n }\n this.emit('sync');\n }\n );\n }", "title": "" }, { "docid": "a7bdfb95422885ff6f9ad5e34e987d08", "score": "0.45735604", "text": "function merge(original, updates) {\n return mergeWithOptions(original, updates);\n}", "title": "" }, { "docid": "ea6da75e5aec132ee6f11810c4f504f7", "score": "0.4571899", "text": "function mergeDefinitions(base, proposed, override) {\n if (!proposed) return\n if (!base) return proposed\n setIfValue(base, 'described', _mergeDescribed(base.described, proposed.described))\n setIfValue(base, 'licensed', _mergeLicensed(base.licensed, proposed.licensed, override))\n setIfValue(base, 'files', _mergeFiles(base.files, proposed.files, override))\n}", "title": "" }, { "docid": "5bc2dfa6f57e9b3b2431b68b7aa6e270", "score": "0.45709264", "text": "_onAdd (bundler, file) {\n if (isDirectory(file)) return\n const rootDir = bundler.rootDir\n let srcPath = file\n if (!isAbsolute(srcPath)) srcPath = path.join(rootDir, srcPath)\n if (!fs.existsSync(srcPath)) return\n const globRoot = this.opts.root || rootDir\n let destPath = path.join(this.dest, path.relative(globRoot, file))\n if (!isAbsolute(destPath)) destPath = path.join(rootDir, destPath)\n const action = new CopyAction(srcPath, destPath)\n bundler._registerAction(action)\n bundler._schedule(action)\n }", "title": "" }, { "docid": "cad94f74d4cd8bf394255ad708e9bab9", "score": "0.45674625", "text": "async function mergedContent() {\n try {\n /* This recommended */\n const result = await Promise.allSettled([\n read('contents/content1.txt'),\n read('contents/content2.txt'),\n read('contents/content3.txt'),\n read('contents/content5.txt'),\n ])\n /* End this recommended */\n await writeFile('contents/heru.txt', JSON.stringify(result))\n } catch (error) {\n throw error\n }\n\n // The best practice is:\n // return promise, not return value of promise\n // not also return use await\n return read('contents/heru.txt')\n}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "0fe49ebc3788298272f59e757fc9b2ff", "score": "0.45653233", "text": "function mergeAssets(parentVal,childVal){var res=Object.create(parentVal||null);return childVal?extend(res,childVal):res;}", "title": "" }, { "docid": "77a544e1580686a2ec2bb9a0c6ba1f68", "score": "0.45650688", "text": "updateComponentId(id, updateScopeOnly = false) {\n const newIdString = id.toString();\n const similarIds = this.findSimilarIds(id, true);\n\n if (!similarIds.length) {\n _logger().default.debug(`bit-map: no need to update ${newIdString}`);\n\n return id;\n }\n\n if (similarIds.length > 1) {\n throw new (_showDoctorError().default)(`Your ${_constants().BIT_MAP} file has more than one version of ${id.toStringWithoutScopeAndVersion()} and they\n are authored or imported. This scenario is not supported`);\n }\n\n const oldId = similarIds[0];\n const oldIdStr = oldId.toString();\n const newId = updateScopeOnly ? oldId.changeScope(id.scope) : id;\n\n if (newId.isEqual(oldId)) {\n _logger().default.debug(`bit-map: no need to update ${oldIdStr}`);\n\n return oldId;\n }\n\n _logger().default.debug(`BitMap: updating an older component ${oldIdStr} with a newer component ${newId.toString()}`);\n\n const componentMap = this.components[oldIdStr];\n\n if (componentMap.origin === _constants().COMPONENT_ORIGINS.NESTED) {\n throw new Error('updateComponentId should not manipulate Nested components');\n }\n\n this._removeFromComponentsArray(oldId);\n\n this.setComponent(newId, componentMap);\n this.markAsChanged();\n return newId;\n }", "title": "" }, { "docid": "801a7cb26a81310af75e5be85422431f", "score": "0.45638904", "text": "function getExistingIfNotChanged(): ?PathLinux {\n if (!mainFile && existingComponentMap) {\n return existingComponentMap.mainFile;\n }\n return null;\n }", "title": "" }, { "docid": "2d16ffb3516025b88cb256fdc9936116", "score": "0.4559152", "text": "function resolveWriteConflict(filePath, data, callback) {\n if (overwrite) {\n overwriteFile(filePath, data);\n callback();\n } else {\n\n choicePrompt('There is already a file at ' + filePath.red + '!\\n How do you want to handle it?', [\n {'Overwrite it': overwriteFile},\n {'Perserve it': perserveFile},\n {'Overwrite all': overwriteAll},\n {'Abort generation': abortGeneration}\n ], function (action) {\n action(filePath, data);\n callback();\n });\n }\n}", "title": "" }, { "docid": "adf1df57a63494b6f2b7509621a0c956", "score": "0.4556002", "text": "submitNewVersion(e) {\n e.preventDefault();\n // TODO: also store sha256 hashes to compare new version with all older ones ?\n if(this.state.newVersionHash === this.state.patent.id) {\n window.dialog.showAlert('Your version is identical to a previously uploaded one')\n }\n else if (this.validateNewVersionForm()) {\n this.setState({ waitingTransaction: true });\n this.state.patentsInstance.addVersion(this.state.patent.id, this.state.newIpfsLocation, {\n from: this.state.web3.eth.coinbase,\n value: this.state.etherPrice,\n gas: process.env.REACT_APP_GAS_LIMIT,\n gasPrice : this.state.gasPrice\n }).then(() => {\n return this.bundle.addFile() // Add the new encrypted file to IPFS\n }).then(filesAdded => {\n this.closeForm(); // reset and close the form\n window.dialog.show({\n title: \"Encrypted file has been successfully added to IPFS\",\n body: \"New version IPFS location : ipfs.io/ipfs/\" + filesAdded[0].path,\n actions: [\n Dialog.OKAction(),\n Dialog.Action(\n 'View encrypted File',\n () => {\n let win = window.open(\"https://ipfs.io/ipfs/\" + filesAdded[0].hash);\n win.focus();\n })],\n bsSize: \"large\"\n });\n }).catch(error => {\n this.closeForm();\n contractError(error); // Handles the error\n });\n }\n }", "title": "" }, { "docid": "bae52073c946013f6ce958aaefa363c4", "score": "0.45550072", "text": "function Conflict(ours, theirs, base, navigator, merge) {\n _classCallCheck(this, Conflict);\n\n this.ours = ours;\n this.theirs = theirs;\n this.base = base;\n this.navigator = navigator;\n this.merge = merge;\n\n this.emitter = new _atom.Emitter();\n\n // Populate back-references\n this.ours.conflict = this;\n this.theirs.conflict = this;\n if (this.base) {\n this.base.conflict = this;\n }\n this.navigator.conflict = this;\n\n // Begin unresolved\n this.resolution = null;\n }", "title": "" }, { "docid": "7d174e503fb1ac5a5a3ee69c4237cf77", "score": "0.45522693", "text": "function mergeOverride(target, source) {\n // Shallow merge should handle `component`\n var merged = _objectSpread({}, target, {}, source);\n\n if (target.props && source.props) {\n merged.props = mergeConfigurationOverrides(target.props, source.props);\n }\n\n if (target.style && source.style) {\n merged.style = mergeConfigurationOverrides(target.style, source.style);\n }\n\n return merged;\n}", "title": "" }, { "docid": "8d23bbe012080a4949bc401ecc65a8d3", "score": "0.4549087", "text": "async processSourceFile(absPath, relativePath, trigger) {\n /**\n * Update the source files manager to add the new file or\n * bump it's version.\n *\n * Bumping the version is important, so that the typescript compiler\n * referencing the source files manager should re-read the file\n * from disk\n */\n if (trigger === 'add') {\n this.sourceFilesManager.add(absPath);\n this.emit('source:add', { relativePath, absPath });\n }\n else {\n this.sourceFilesManager.bumpVersion(absPath);\n this.emit('source:change', { relativePath, absPath });\n }\n }", "title": "" }, { "docid": "564058e8e6b5edf2002d34b0a5373a09", "score": "0.45438007", "text": "function fixOldSave(oldVersion){\n}", "title": "" }, { "docid": "3362e697290b40279ce725c68c74e8d0", "score": "0.45285314", "text": "update() {\n this.components.forEach((component) => {\n component.update()\n })\n }", "title": "" }, { "docid": "f3062a62345830278b7df040dae5e04c", "score": "0.45267302", "text": "addOrReplaceScript(scriptName, content) {\r\n const scriptsSection = 'scripts';\r\n if (!this.packageJson[scriptsSection]) {\r\n this.packageJson[scriptsSection] = {};\r\n }\r\n const isOverride = !!this.packageJson[scriptsSection][scriptName];\r\n this.packageJson[scriptsSection][scriptName] = content;\r\n if (this.context) {\r\n if (isOverride) {\r\n this.context.logger.info(`changed script ${scriptName} in ${this._path}/package.json`);\r\n }\r\n else {\r\n this.context.logger.info(`added script ${scriptName} to ${this._path}/package.json`);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d7770709f0d74b2b4bc56cf901cb39e9", "score": "0.45251086", "text": "checkUpToDateSingleFile(info) {\n // Get source file timestamp\n sourceTime = fs.statSync(join(info.dir, info.base)).mtime.getTime();\n\n try {\n // Get executable timestamp\n targetTime = fs.statSync(join(info.dir, info.exe)).mtime.getTime();\n } catch (error) {\n return false;\n }\n\n // Compare Timestamps\n if(sourceTime > targetTime) {\n // Executable out of date\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "26ff435371b5be5a05f63b4b8cd001db", "score": "0.45237482", "text": "async updateProjectFiles() {\n await service_1.forAllServices((service) => service.updateProjectFiles());\n }", "title": "" }, { "docid": "0ee9dfb17d43fde7404a9850267f9746", "score": "0.451419", "text": "function mergeSource (bundles) {\n var style = extarctSource(bundles, TYPE_STYLE);\n var script = extarctSource(bundles, TYPE_SCRIPT);\n var template = extarctSource(bundles, TYPE_TEMPLATE);\n var sourceList = [\n 'import \\'robust-mixin\\';',\n 'import _ko_component_mixin from \\'robust-mixin\\';',\n 'import _ko_component_insert_css from \\'insert-css\\';',\n 'export var _ko_component_name = \\'' + currentName + '\\';',\n 'export var _ko_component_style = `' + style + '`;',\n 'export var _ko_component_template = `' + template + '`;',\n script,\n '_ko_component_insert_css(_ko_component_style);'\n ];\n\n if (!script || !/export default/mg.test(script)) {\n sourceList.push('export default { constructor: function () {} }');\n }\n\n return sourceList.join('\\n');\n }", "title": "" }, { "docid": "59605b51d40e62f9b6260ee9be53f5ef", "score": "0.45133176", "text": "function diffComponent (path, entityId, prev, next, el) {\n\t if (next.component !== prev.component) {\n\t return replaceElement(entityId, path, el, next)\n\t } else {\n\t var targetId = children[entityId][path]\n\n\t // This is a hack for now\n\t if (targetId) {\n\t updateEntityProps(targetId, next.props)\n\t }\n\n\t return el\n\t }\n\t }", "title": "" }, { "docid": "11741d71407bae8b38a065e3da6d2189", "score": "0.45092565", "text": "function updateBaseVersions( baseVersion, operations ) {\n\tfor ( let i = 0; i < operations.length; i++ ) {\n\t\toperations[ i ].baseVersion = baseVersion + i + 1;\n\t}\n\n\treturn operations;\n}", "title": "" }, { "docid": "fe2cd11da357345a32b1ea5af60125b5", "score": "0.45027784", "text": "function mergeBehavior(newBehavior) {\n var isBehaviorImpl = function isBehaviorImpl(b) {\n // filter out BehaviorImpl\n return b.indexOf(newBehavior.is) === -1;\n };\n for (var i = 0; i < behaviors.length; i++) {\n if (newBehavior.is !== behaviors[i].is) continue;\n // merge desc, longest desc wins\n if (newBehavior.desc) {\n if (behaviors[i].desc) {\n if (newBehavior.desc.length > behaviors[i].desc.length) behaviors[i].desc = newBehavior.desc;\n } else {\n behaviors[i].desc = newBehavior.desc;\n }\n }\n // merge demos\n behaviors[i].demos = (behaviors[i].demos || []).concat(newBehavior.demos || []);\n // merge events,\n behaviors[i].events = (behaviors[i].events || []).concat(newBehavior.events || []);\n behaviors[i].events = dedupe(behaviors[i].events, function (e) {\n return e.name;\n });\n // merge properties\n behaviors[i].properties = (behaviors[i].properties || []).concat(newBehavior.properties || []);\n // merge observers\n behaviors[i].observers = (behaviors[i].observers || []).concat(newBehavior.observers || []);\n // merge behaviors\n behaviors[i].behaviors = (behaviors[i].behaviors || []).concat(newBehavior.behaviors || []).filter(isBehaviorImpl);\n return behaviors[i];\n }\n return newBehavior;\n }", "title": "" }, { "docid": "d40c4a4ea1c0795372b1e43e554ba0a2", "score": "0.4502283", "text": "addVersion(version, pkgInfo) {\n if(!this.hasVersion(version)) {\n this._package.versions[version] = pkgInfo\n this._package.latest = version\n this.save();\n return true;\n } else\n return false;\n }", "title": "" }, { "docid": "7d801eead65cb39a7185e570c0e6eb7c", "score": "0.45015258", "text": "function _linkAuthoredComponents(consumer: Consumer, component: Component, componentMap: ComponentMap): LinksResult {\n const componentId = component.id;\n if (!componentId.scope) return { id: componentId, bound: [] }; // scope is a must to generate the link\n const filesToBind = componentMap.getFilesRelativeToConsumer();\n const bound = filesToBind.map((file) => {\n const dest = path.join(Consumer.getNodeModulesPathOfComponent(component.bindingPrefix, componentId), file);\n const destRelative = pathRelativeLinux(path.dirname(dest), file);\n const fileContent = getLinkContent(destRelative);\n fs.outputFileSync(dest, fileContent);\n return { from: dest, to: file };\n });\n linkToMainFile(component, componentMap, componentId, consumer);\n return { id: componentId, bound };\n}", "title": "" }, { "docid": "94ed6fed40885f1b6ceabff3b086e7b3", "score": "0.44947642", "text": "function applyPatches(uniDiff, options) {\n\t if (typeof uniDiff === 'string') {\n\t uniDiff = _parse.parsePatch(uniDiff);\n\t }\n\n\t var currentIndex = 0;\n\t function processIndex() {\n\t var index = uniDiff[currentIndex++];\n\t if (!index) {\n\t return options.complete();\n\t }\n\n\t options.loadFile(index, function (err, data) {\n\t if (err) {\n\t return options.complete(err);\n\t }\n\n\t var updatedContent = applyPatch(data, index, options);\n\t options.patched(index, updatedContent);\n\n\t setTimeout(processIndex, 0);\n\t });\n\t }\n\t processIndex();\n\t}", "title": "" }, { "docid": "1b47ba59f619ad78ebf67dbb8718bac4", "score": "0.44895148", "text": "function _merge_from_new_data(model_json){\n\tll('in MERGE main');\n\n\t// Unfold the core data graph for operations with merge.\n\tecore.unfold();\n\n\t// Create a new graph of incoming merge data.\n\tvar merge_in_graph = new noctua_graph();\n\tmerge_in_graph.load_data_basic(model_json);\n\n\t// Run the special \"dumb\" merge.\n\t// TODO: Replace later with an actual update.\n\tecore.merge_special(merge_in_graph);\n\n\t// Farm it out to rebuild.\n\t_rebuild_model_and_display();\n\n\t///\n\t/// \"[P]remature optimization is the root of all evil.\"\n\t/// -Donald Knuth\n\t///\n\t/// We'll come back to this if the merge ops are really\n\t/// slow. In fact, maybe only go the \"optimized\" merge path is\n\t/// the graph is structurally the same, but edge/node content\n\t/// has changed.\n\t///\n\n\t// // Take a snapshot of the current graph.\n\t// var ecore_snapshot = ecore.clone();\n\n\t// // We'll also need an easy lookup of the nodes coming in with\n\t// // the merge.\n\t// var updatable_nodes = {};\n\n\t// // Unfold the core data graph for operations with merge.\n\t// ecore.unfold();\n\n\t// // Create a new graph of incoming merge data.\n\t// var merge_in_graph = new noctua_graph();\n\t// merge_in_graph.load_data_basic(model_json);\n\n\t// // Suspend and restart for performance.\n\t// instance.doWhileSuspended(function(){\n\n\t// // Next, look at individuals/nodes for addition or\n\t// // updating.\n\t// each(merge_in_graph.all_nodes(), function(ind){\n\t// \t// Update node. This is preferred since deleting it\n\t// \t// would mean that all the connections would have to\n\t// \t// be reconstructed as well.\n\t// \tvar update_node = ecore.get_node(ind.id());\n\t// \tif( update_node ){\n\t// \t ll('update node: ' + ind.id());\n\t// \t updatable_nodes[ind.id()] = true;\n\n\t// \t // \"Update\" the edit node in core by clobbering\n\t// \t // it.\n\t// \t ecore.add_node(ind);\n\n\t// \t // Wipe node contents; redraw node contents.\n\t// \t widgetry.update_enode(ecore, ind, aid);\n\t// \t}else{\n\t// \t ll('add new node: ' + ind.id());\n\t// \t updatable_nodes[ind.id()] = true;\n\n\t// \t // Initial node layout settings.\n \t// \t var dyn_x = _vari() +\n\t// \t\tjQuery(graph_container_div).scrollLeft();\n \t// \t var dyn_y = _vari() +\n\t// \t\tjQuery(graph_container_div).scrollTop();\n\t// \t ind.x_init(dyn_x);\n\t// \t ind.y_init(dyn_y);\n\n\t// \t // Add new node to edit core.\n\t// \t ecore.add_node(ind);\n\n\t// \t // Update coordinates and report them.\n\t// \t local_position_store.add(ind.id(), dyn_x, dyn_y);\n\t// \t if( barclient ){\n\t// \t\tbarclient.telekinesis(ind.id(), dyn_x, dyn_y);\n\t// \t }\n\n\t// \t // Draw it to screen.\n\t// \t widgetry.add_enode(ecore, ind, aid, graph_div);\n\t// \t}\n\t// });\n\n\t// // Now look at edges (by individual) for purging (and\n\t// // reinstating later)--no going to try and update edges,\n\t// // just remove/clobber.\n\t// each(merge_in_graph.all_nodes(), function(source_node){\n\n\t// \t//ll('looking at node: ' + source_node.types()[0].to_string());\n\n\t// \t// WARNING: We cannot (apparently?) go from connection\n\t// \t// ID to connection easily, so removing from UI is a\n\t// \t// separate step.\n\t// \t//\n\t// \t// Look up what edges it has in /core/, as they will\n\t// \t// be the ones to update.\n\t// \tvar snid = source_node.id();\n\t// \tvar src_edges = ecore.get_edges_by_subject(snid);\n\n\t// \t// Delete all edges for said node in model if both the\n\t// \t// source and the target appear in the updatable list.\n\t// \tvar connection_ids = {};\n\t// \teach(src_edges, function(src_edge){\n\t// \t if( updatable_nodes(src_edge.subject_id()) &&\n\t// \t\tupdatable_nodes(src_edge.object_id()) ){\n\n\t// \t\t// Save the connection id for later.\n\t// \t\tvar eid = src_edge.id();\n\t// \t\tvar cid = ecore.get_connector_id_by_edge_id(eid);\n\t// \t\tconnection_ids[cid] = true;\n\n\t// \t\t// Remove the edge from reality.\n\t// \t\tecore.remove_edge(src_edge.id());\n\t// \t }else{\n\t// \t\t// unrelated edge outside of the complete\n\t// \t\t// merge subgraph\n\t// \t }\n\t// \t});\n\n\t// \t// Now delete all connector/edges for the node in the\n\t// \t// UI.\n\t// \tvar snid_elt = ecore.get_node_elt_id(snid);\n\t// \tvar src_conns = instance.getConnections({'source': snid_elt});\n\t// \teach(src_conns, function(src_conn){\n\t// \t // Similar to the above, we only want to remove UI\n\t// \t // edges that are contained within the individuals\n\t// \t // in the subgraph.\n\t// \t if( connection_ids(src_conn) ){\n\t// \t\tinstance.detach(src_conn);\n\t// \t }else{\n\t// \t\t// This UI edge should be preserved.\n\t// \t }\n\t// \t});\n\t// });\n\n\t// // Blitz our old annotations as all new will be incoming\n\t// // (and the merge just takes the superset)\n\t// ecore.annotations([]);\n\t// // Now that the UI is without any possible conflicting items\n\t// // (i.e. edges) have been purged from out core model, merge\n\t// // the new graph into the core one.\n\t// ecore.merge_in(merge_in_graph);\n\n\t// // Re-apply folding to graph.\n\t// _fold_graph_appropriately(ecore, view_type);\n\n\t// ///\n\t// /// Remove any standalone nodes from the /display/ that\n\t// /// may remain after a fold-in; all edges should have been\n\t// /// removed previously.\n\t// ///\n\n\t// each(ecore_snapshot.all_nodes(), function(snap_node){\n\t// \tvar snid = snap_node.id();\n\t// \tif( ! ecore.get_node(snid) ){\n\t// \t //gone_nodes.push(snid);\n\t// \t ll(\"eliminating: \" + snid)\n\t// \t _delete_iae_from_ui(snid);\n\t// \t}\n\t// });\n\n\t// ///\n\t// /// Refresh any node created or updated in the jsPlumb\n\t// /// physical view.\n\t// ///\n\n\t// // We previously updated/added nodes, so here just make\n\t// // sure it's/they're active.\n\t// each(merge_in_graph.all_nodes(), function(dn){\n\t// \tvar dnid = dn.id();\n\n\t// \t// Only update nodes that are still \"visible\" after\n\t// \t// the folding.\n\t// \tif( ecore.get_node(dnid) ){\n\t// \t var ddid = '#' + ecore.get_node_elt_id(dnid);\n\t// \t _attach_node_draggable(ddid);\n\t// \t // //_make_selector_target(ddid);\n\t// \t // //_make_selector_source(ddid, '.konn');\n\t// \t // _attach_node_click_edit(ddid);\n\t// \t // _make_selector_target(ddid);\n\t// \t // _make_selector_source(ddid, '.konn');\n\t// \t}\n\t// });\n\t// // And the reest of the general ops.\n\t// _attach_node_dblclick_ann('.demo-window');\n\t// // // _attach_node_draggable('.demo-window');\n\t// _attach_node_click_edit(\".open-dialog\");\n\t// _make_selector_target('.demo-window');\n\t// _make_selector_source('.demo-window', '.konn');\n \t// jsPlumb.repaintEverything();\n\n\t// // Now that the updated edges are in the model, reinstantiate\n\t// // them in the UI.\n\t// each(merge_in_graph.all_edges(), function(edg){\n\t// \t//ll('(re)create/add the edge in UI: ' + edg.relation());\n\t// \t_connect_with_edge(edg);\n\t// });\n\t// }); // close out updating region\n }", "title": "" } ]
f093ea84a1d0d4d098d7708d837a711f
Quick object check this is primarily used to tell Objects from primitive values when we know the value is a JSONcompliant type.
[ { "docid": "1bdd74e0a3c4358617464fac9f9dacc0", "score": "0.0", "text": "function isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}", "title": "" } ]
[ { "docid": "d8114828bf9049abb572a356b4c2b0a4", "score": "0.7209461", "text": "#isPrimitive(value) {\n return value !== Object(value); \n }", "title": "" }, { "docid": "d671f999059b30bde92e0b98c446a130", "score": "0.70473415", "text": "function isValueObject(obj) {\n\treturn (obj instanceof Number) || (obj instanceof String) || (obj instanceof Boolean) || (obj === null);\n}", "title": "" }, { "docid": "f83b7d68d14a97dab20057481aa2cf87", "score": "0.69166434", "text": "function isPrimitiveType (obj) {\r\n return ( typeof obj === 'boolean' ||\r\n typeof obj === 'number' ||\r\n typeof obj === 'string' ||\r\n obj === null ||\r\n util.isDate(obj) ||\r\n util.isArray(obj));\r\n}", "title": "" }, { "docid": "52776b233e7d2c36dbee680a3949caf8", "score": "0.69101435", "text": "function isPrimitive(v) {\n if (v === undefined) return false;\n if (v === null) return true;\n if (v.constructor == String) return true;\n if (v.constructor == Number) return true;\n if (v.constructor == Boolean) return true;\n if (v.constructor.name == 'ObjectID') return true;\n return false;\n }", "title": "" }, { "docid": "eafddefe253b59e3bd64a125651ffb74", "score": "0.68993825", "text": "function isPrimitiveType(obj) {\n return (\n typeof obj === 'boolean' ||\n typeof obj === 'number' ||\n typeof obj === 'string' ||\n obj === null ||\n util.isDate(obj) ||\n util.isArray(obj)\n );\n}", "title": "" }, { "docid": "b7f8c7cf2968ff9ab7e57ee3fd752783", "score": "0.6770658", "text": "function _is_json_value(value) {\n\tif (value === undefined) return false;\n\tif (value === null) return true;\n\treturn ([Object, Array, String, Number, Boolean].indexOf(value.constructor) !== -1);\n}", "title": "" }, { "docid": "e00bb398a134e32346049a9f764780ac", "score": "0.6720606", "text": "function isObject(value) { return typeof value === \"object\" && value !== null; }", "title": "" }, { "docid": "2b4945cf4998da1adb456fef6fce2a8e", "score": "0.67119664", "text": "__is_object(value) {\n return value && typeof value === 'object' && value.constructor === Object;\n }", "title": "" }, { "docid": "aabcfe42f3c98b5b27561404127cbe07", "score": "0.6702344", "text": "function isPrimitive(value) {\n return typeof value !== 'object' || value === null;\n}", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67013276", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "af73a4671adb07047338d14879463e1e", "score": "0.6692046", "text": "function isObject(value) {\n\n\t if (typeof value === 'object' && value !== null &&\n\t !(value instanceof Boolean) &&\n\t !(value instanceof Date) &&\n\t !(value instanceof Number) &&\n\t !(value instanceof RegExp) &&\n\t !(value instanceof String)) {\n\n\t return true;\n\t }\n\n\t return false;\n\t }", "title": "" }, { "docid": "a8d1d4585863fed513c5fb83160c1546", "score": "0.66807723", "text": "isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]'\n }", "title": "" }, { "docid": "52289b09df3bd7fc5e18df5a0dad6cf9", "score": "0.66116655", "text": "function isPrimitive(obj)\r\n{\r\n\treturn (obj !== Object(obj));\r\n}", "title": "" }, { "docid": "266a9c2124a92a5574b27621e6b5f246", "score": "0.6591204", "text": "function isPrimitiveLike (o) {\n if (o === null || (typeof o === 'object' && typeof o.toJSON !== 'undefined') ||\n typeof o === 'string' || typeof o === 'boolean' || typeof o === 'number') {\n return true\n }\n\n if (!Array.isArray(o)) {\n return false\n } else {\n let keys = Object.keys(o)\n if (keys.length !== o.length) { \n return false /* sparse array or named props */\n }\n }\n\n for (let i = 0; i < o.length; i++) {\n if (!isPrimitiveLike(o[i])) {\n return false\n }\n }\n\n return true\n}", "title": "" }, { "docid": "94bd0f817fc75092bc46938959421356", "score": "0.6553882", "text": "function IsObject(v) {\n return v !== null &&\n v !== undefined &&\n typeof v !== \"boolean\" &&\n typeof v !== \"number\" &&\n typeof v !== \"string\" &&\n typeof v !== \"symbol\";\n}", "title": "" }, { "docid": "32df724530792e784294e0432e7c6e88", "score": "0.654297", "text": "function isObject ( value ) {\n return angular.isObject ( value );\n }", "title": "" }, { "docid": "66cb4805460f154238323e1e23683c98", "score": "0.650305", "text": "function isPrimitive(value) {\n\t // Using switch fallthrough because it's simple to read and is\n\t // generally fast: http://jsperf.com/testing-value-is-primitive/5\n\t switch (typeof value) {\n\t case \"string\":\n\t case \"number\":\n\t case \"boolean\":\n\t return true;\n\t }\n\n\t return value == null;\n\t }", "title": "" }, { "docid": "3761613f1b43e3d48823ea58aeb687bb", "score": "0.6484136", "text": "function looksLikeJsonObject(input){return typeof input==='object'&&input!==null&&!(input instanceof Array)&&!(input instanceof Date)&&!(input instanceof Timestamp)&&!(input instanceof GeoPoint)&&!(input instanceof Blob)&&!(input instanceof DocumentKeyReference)&&!(input instanceof FieldValueImpl);}", "title": "" }, { "docid": "c64c3c2e231d84b8a1679b5e2ce33dfe", "score": "0.64716476", "text": "function isObj(value) {\n var type = typeof value;\n return value !== null && (type === 'object' || type === 'function');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6462702", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6462702", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6462702", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6462702", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6462702", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "abc25a1772d433972a3cef5e4a2f8844", "score": "0.6459057", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "title": "" }, { "docid": "abc25a1772d433972a3cef5e4a2f8844", "score": "0.6459057", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "title": "" }, { "docid": "de67c186bcaf25c62980e7c8764d069f", "score": "0.64474255", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }", "title": "" }, { "docid": "18266bb1eacf7a75d6e0fc399b908acc", "score": "0.644268", "text": "isObject(obj) {\n return obj !== null && typeof obj === 'object'\n }", "title": "" }, { "docid": "5b592c6439769c0c59fd317d8df17f94", "score": "0.64345664", "text": "function isObject(o){ return typeof o === 'object' && o !== null; }", "title": "" }, { "docid": "21361ff8ec4cf12bbf705ffe5c3fbf47", "score": "0.6432319", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "title": "" }, { "docid": "21361ff8ec4cf12bbf705ffe5c3fbf47", "score": "0.6432319", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "title": "" }, { "docid": "63ea9ac634ed76f37dd0a8550ad444ee", "score": "0.6420808", "text": "function isRealValue(obj){\n return obj && obj !== \"null\" && obj!== \"undefined\";\n}", "title": "" }, { "docid": "009b2ee7ec4f45d8e2d7d88d84a221c5", "score": "0.6419228", "text": "isPrimitive(value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n }", "title": "" }, { "docid": "f2e4b4ce7bfe8f252ca52dd9231f46b0", "score": "0.64182544", "text": "function isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}", "title": "" }, { "docid": "d2f2d077275c6e25ebafbff7fe8394da", "score": "0.6415254", "text": "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "title": "" }, { "docid": "27deb54da6788d8994a9f29e71964435", "score": "0.6410366", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "27deb54da6788d8994a9f29e71964435", "score": "0.6410366", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "b39c54cc9c59e9a658260827201f8b6a", "score": "0.640489", "text": "function isObjectLike(value) {\n return _typeof$1(value) == 'object' && value !== null;\n }", "title": "" }, { "docid": "d660e762933b289c875ceec504569366", "score": "0.6401675", "text": "function isObject(value) {\n // YOUR CODE BELOW HERE //\n //Make a conditional statement using if, else-if... to check for value type and return boolean\n //Could be a number, so I have to handle numbers too!\n //check if value is array using Array.isArray, as typeof will return 'object'\n if(Array.isArray(value)) {\n return false;\n }\n //check if value is null, not using typeof operator, which would return 'object'\n else if(value === null) {\n return false;\n }\n //check for instanceof Date, not using typeof operator, which would return 'object'\n else if(value instanceof Date) {\n return false;\n }\n //use typeof operator to check remaining value types...\n else if(typeof value === 'number') {\n return false;\n }\n else if(typeof value === 'string') {\n return false;\n }\n else if(typeof value === 'boolean') {\n return false;\n }\n else if(typeof value === 'object') {\n return true;\n\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "b98041a3f2dc411e04ea8c0ed9b0d373", "score": "0.63922966", "text": "function primitive (value) {\n\t var type = typeof value;\n\t return type === 'number' ||\n\t type === 'boolean' ||\n\t type === 'string' ||\n\t type === 'symbol'\n\t}", "title": "" }, { "docid": "d666d4c63efd4f9d61f53d81a171d5bb", "score": "0.63880616", "text": "function isObject(value) {\n\t\treturn value !== null && Object.prototype.toString.call(value) === '[object Object]';\n\t}", "title": "" }, { "docid": "db66bf713436377dbc51e18bcab5e269", "score": "0.63708496", "text": "function isObject(v) {\n return v instanceof Object;\n }", "title": "" }, { "docid": "9b021e09cc4ee0ec23dc42d1ab404105", "score": "0.6369559", "text": "function isPrimitiveBody(value, mapperTypeName) {\n return (mapperTypeName !== \"Composite\" &&\n mapperTypeName !== \"Dictionary\" &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !==\n null ||\n value === undefined ||\n value === null));\n}", "title": "" }, { "docid": "ce82c3008875be3871abd0102709d3a5", "score": "0.6359811", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "title": "" }, { "docid": "ce82c3008875be3871abd0102709d3a5", "score": "0.6359811", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "title": "" }, { "docid": "ce82c3008875be3871abd0102709d3a5", "score": "0.6359811", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "title": "" }, { "docid": "ce82c3008875be3871abd0102709d3a5", "score": "0.6359811", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "title": "" }, { "docid": "2c2dd1b552c7a686137108d36aba851a", "score": "0.63529134", "text": "function isPrimitiveType(value) {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}", "title": "" }, { "docid": "2c2dd1b552c7a686137108d36aba851a", "score": "0.63529134", "text": "function isPrimitiveType(value) {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}", "title": "" }, { "docid": "15bcbd4ecf52f9276b19138405c1df33", "score": "0.63514686", "text": "function isPrimitive(o) {\r\n return o !== Object(o);\r\n }", "title": "" }, { "docid": "b3c07e94eccbadb9f948f1e264c49736", "score": "0.63467836", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\n }", "title": "" }, { "docid": "b3c07e94eccbadb9f948f1e264c49736", "score": "0.63467836", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\n }", "title": "" }, { "docid": "ac78180ba6716e5b235f9216b3facca5", "score": "0.63422656", "text": "function isObject(x) {\n return (x !== null && x !== undefined && !Array.isArray(x) &&\n (x.toString() === \"[object BSON]\" || x.toString() === \"[object Object]\" ||\n (typeof x === \"object\" && Object.getPrototypeOf(x) === Object.prototype)));\n }", "title": "" }, { "docid": "8ccc67ca8b405c857210f41374f0e5c7", "score": "0.6336658", "text": "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "title": "" }, { "docid": "8ccc67ca8b405c857210f41374f0e5c7", "score": "0.6336658", "text": "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "title": "" }, { "docid": "97d65a94b1f5af8921c9687d93732adf", "score": "0.6335813", "text": "function object$1(value) {\r\n // 低版本 IE 会把 null 当作 object\r\n return value !== NULL && typeof value === 'object';\r\n }", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.6330002", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.6330002", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.6330002", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.6330002", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "fb218e0c1a12cfee8efcfa62b1a0aa0a", "score": "0.63292694", "text": "function isObject(obj){return obj!==null&&(typeof obj==='undefined'?'undefined':_typeof(obj))==='object';}", "title": "" }, { "docid": "e821a97bce0d5fc4e2adfbf460259a57", "score": "0.6328184", "text": "function object (data) {\n return Object.prototype.toString.call(data) === '[object Object]';\n }", "title": "" }, { "docid": "44cd6cfdd43aeee79790e46b0212b5c9", "score": "0.63255197", "text": "function isPrimitive(value) {\n\t\t return typeof value === 'string' || typeof value === 'number';\n\t\t}", "title": "" }, { "docid": "2f59a36c3b45eb87511f98270cf033ec", "score": "0.6324895", "text": "function isObject(obj) { // 71\n\t\treturn toString.call(obj) === '[object Object]'; // 72\n\t} // 73", "title": "" }, { "docid": "d30c130063e0d998bff2ce21a098f992", "score": "0.63182163", "text": "function isPrimitive(value) {\n return (value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}", "title": "" }, { "docid": "d30c130063e0d998bff2ce21a098f992", "score": "0.63182163", "text": "function isPrimitive(value) {\n return (value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}", "title": "" }, { "docid": "ecd4e25de1b8a78a121445dab7a23d4b", "score": "0.6310708", "text": "function isPrimitive(value) {\n if (value === null || value === undefined) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'symbol':\n return true;\n case 'object':\n case 'function':\n return false;\n default:\n throw new TypeError(`Type not supported ${value}`);\n }\n}", "title": "" }, { "docid": "5156d5c3c58044c1ee4a4ee6ef7b5391", "score": "0.6309287", "text": "function isPlainObject(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object' && value !== null && !isArray(value) && !(value instanceof RegExp) && !(value instanceof Date) && !(value instanceof Error) && !(value instanceof Number) && !(value instanceof String) && !(value instanceof Boolean) && (typeof value.toDateTime !== 'function' || value.propertyIsEnumerable('toDateTime')); //Moment.js date\n}", "title": "" }, { "docid": "ecbdbdb31e20cc48a2f11491badbd6ec", "score": "0.6304791", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\n }", "title": "" }, { "docid": "f14f417613902c1f996278c947756072", "score": "0.63026947", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "f14f417613902c1f996278c947756072", "score": "0.63026947", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "f14f417613902c1f996278c947756072", "score": "0.63026947", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "cafbe549509538fb4ffa766fdf3e68b9", "score": "0.629798", "text": "function isObject(obj){\n return Object.prototype.toString.call(obj) == '[object Object]';\n }", "title": "" }, { "docid": "75aa3ea85ed077f67b8ddacab8155fd7", "score": "0.62975305", "text": "function isobj(data) {\n if (data == null) return false\n if (data.constructor && data.constructor.name != 'Object') return false\n return true\n}", "title": "" }, { "docid": "1194e53e7a3939c522cff9bdf967e7b5", "score": "0.6294513", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "bcfe86456dcbc277b0198a35cb5bd047", "score": "0.6291492", "text": "function isObject(o) { return typeof o === 'object'; }", "title": "" }, { "docid": "bcfe86456dcbc277b0198a35cb5bd047", "score": "0.6291492", "text": "function isObject(o) { return typeof o === 'object'; }", "title": "" }, { "docid": "bcfe86456dcbc277b0198a35cb5bd047", "score": "0.6291492", "text": "function isObject(o) { return typeof o === 'object'; }", "title": "" }, { "docid": "ba0ecec46b8ac07927c3a05e6bac25f8", "score": "0.6291467", "text": "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "title": "" }, { "docid": "6688b14639d8bee415671798d9267fcc", "score": "0.62826467", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "title": "" }, { "docid": "6688b14639d8bee415671798d9267fcc", "score": "0.62826467", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "title": "" }, { "docid": "294903fbb611774e80b66f787955408d", "score": "0.62815964", "text": "function coercePrimitiveToObject(obj) {\n if(isPrimitiveType(obj)) {\n obj = object(obj);\n }\n if(noKeysInStringObjects && isString(obj)) {\n forceStringCoercion(obj);\n }\n return obj;\n }", "title": "" }, { "docid": "5c5a51feb749263f6b19b8090a9c4086", "score": "0.62731135", "text": "function wkt_is_object(val) {\n return !!val && typeof val == 'object' && !Array.isArray(val);\n}", "title": "" }, { "docid": "ed41c71f673a03b4453cf32b4fdce056", "score": "0.62706524", "text": "function isRealValue(obj) {\r\n return obj && obj !== 'null' && obj !== 'undefined';\r\n}", "title": "" }, { "docid": "cd65a3e1ecfd2980743b437fa9ef72c8", "score": "0.6269833", "text": "function isPrimitive(value) {\r\n return (value === null ||\r\n typeof value === 'boolean' ||\r\n typeof value === 'number' ||\r\n typeof value === 'string');\r\n }", "title": "" }, { "docid": "cd65a3e1ecfd2980743b437fa9ef72c8", "score": "0.6269833", "text": "function isPrimitive(value) {\r\n return (value === null ||\r\n typeof value === 'boolean' ||\r\n typeof value === 'number' ||\r\n typeof value === 'string');\r\n }", "title": "" }, { "docid": "9b6e276564f6b1f88c43bff77646dc6b", "score": "0.6268426", "text": "function assertObject(value) {\n if (Object(value) !== value) {\n var kind = value === null? 'null'\n : value === undefined? 'undefined'\n : /* otherwise */ 'a primitive value (' + JSON.stringify(value) + ')';\n\n throw new TypeError(\"Meta:Magical can only associate meta-data with objects, but you're trying to use \" + kind);\n }\n}", "title": "" }, { "docid": "9b6c67cc48d4c0b821e03c335298d017", "score": "0.6263791", "text": "function object (data) {\n return assigned(data) && Object.prototype.toString.call(data) === '[object Object]';\n }", "title": "" }, { "docid": "7a49c995a22beb4524bb5027859b1519", "score": "0.62628925", "text": "function isObjectObject(value) {\n return typeof value === 'object' && value !== null && ObjectToString(value) === '[object Object]';\n}", "title": "" }, { "docid": "9a7560fd274632be51de182bc7f3b317", "score": "0.6240319", "text": "function isObjectLike(value) {\n return typeof value === \"object\" && !!value;\n}", "title": "" } ]
f37290902006e9e8083a7fa73c7f31ec
screen the html container this sprite will sit inside of (its parent) start the initial x and y position to render this container/sprite position is defined as the top left hand corner of the sprite velocity initial vector2 velocity of the ball deadline distance towards bottom of screen that will cause the ball to die
[ { "docid": "ece3a5a7698bad0d0eaf71da8e3ba9a5", "score": "0.6946972", "text": "constructor(screen, start, velocity, deadline) {\n\n\t\t//create my own container to exist inside\n var newball = document.createElement(\"div\");\n newball.className = \"ball\";\n\n super(screen, newball, start, velocity);\n\t\tthis.deadline = deadline;\n }", "title": "" } ]
[ { "docid": "7248e75e3b08b00caf34b358a15354cb", "score": "0.6845509", "text": "constructor(start_x, start_y, vel_x, vel_y){\n // make a projectile\n super($('<img/>'));\n this.jq.attr('src', 'assets/laser.png');\n this.jq.attr('width', 13);\n game.append(this.jq);\n this.jq.css('position', 'absolute');\n //start position\n this.moveTo(start_x, start_y);\n //this.jq.offset({top: game.offset().top+start_y, left: game.offset().left+start_x});\n this.velocity.x = vel_x;\n this.velocity.y = vel_y;\n }", "title": "" }, { "docid": "83542e3c4f03ff198035113a5be122c8", "score": "0.6796214", "text": "constructor() {\r\n //ball starts at the 100 x and y coordinates when it first spawns\r\n this.position = { x: 150, y: 200};\r\n //determines the horizontal movement speed of the ball after it is spawned into the canvas\r\n //velocity is set at 0 so no verticla motion but it can be changed later on\r\n this.velocity = { x: 10, y: 0 };\r\n }", "title": "" }, { "docid": "612327acd663cd0157d96f4b4703a0ac", "score": "0.6697558", "text": "constructor( shooterX, shootery, speedX, speedY, shooter ) {\n this.buletsize = 8 ;\n this.dx = speedX;\n this.dy = speedY;\n this.deadOrAlive = 1;\n this.x = shooterX;\n this.y = shootery;\n this.xNew = null;\n this.yNew = null;\n \n \n this.img = document.querySelector('.rock');\n this.shooter = shooter;\n this.bulletRender() ;\n this.updateReq();\n \n\n }", "title": "" }, { "docid": "f9c892a5407d4e9f2383e2281fc8755a", "score": "0.66817975", "text": "function Sprite(options) {\n var that = this;\n options.image = (options.image)? options.image: false;\n options.viewport = (options.viewport)? options.viewport: {};\n //options.width = (options.width )? options.width: false;\n //options.height = (options.height)? options.height: false;\n options.xFrames = (options.xFrames)? options.xFrames: false;\n options.yFrames = (options.yFrames)? options.yFrames: false;\n options.refreshTime = (options.refreshTime)? options.refreshTime: 100;\n options.render = (options.render)? options.render: false;\n options.initial = (options.initial)? options.initial: {x:0, y:0};\n\n that.moves = {};\n that.timer = null;\n that.currentPosition = 0;\n \n if (!(options.render)) {\n console.log(\"Error: you must set render value\");\n return;\n } \n if (typeof(options.render) === 'string') {\n options.render = document.getElementById(options.render);\n }\n\n options.render.style.backgroundImage = \"url('\" + options.image + \"')\";\n options.render.style.width = String(options.viewport.width) + 'px'\n options.render.style.height = String(options.viewport.height) + 'px'\n options.render.style.backgroundPosition = \n \"-\" + options.initial.x * options.viewport.width + 'px ' +\n \"-\" + options.initial.y * options.viewport.height+ 'px';\n //console.log(options.render.style.backgroundPosition);\n if (!(options.image || options.xFrames || options.yFrames)) {\n console.log(\"Error: you Must set almost image and frames x and y\");\n return;\n }\n that.options = options;\n\n that.define= function ( name, frames, orientation, axis ) {\n that.moves[name] = { frames: frames, orientation: orientation, axis: axis };\n };\n that.event = function(nameEvent, f) {\n that.options.render.addEventListener(nameEvent, f);\n };\n\n that.animate = function(name, options) {\n var i = 0 \n , frameAnimation = null\n , frames = that.moves[name].frames\n , offsetx = that.options.viewport.width\n , offsety = that.options.viewport.height\n ;\n\n if(that.moves[name].orientation === 'x') {\n\n that.options.render.style.backgroundPositionY = \n \"-\"+ String(that.moves[name].axis*offsety) + \"px\";\n\n frameAnimation = function () {\n that.options.render.style.backgroundPositionX = \n \"-\"+ String(frames[i]*offsetx) + \"px\";\n i = (i + 1) % frames.length;\n }\n \n } else {\n\n that.options.render.style.backgroundPositionX = \n \"-\"+ String(that.moves[name].axis*offsetx) + \"px\";\n\n frameAnimation = function () {\n that.options.render.style.backgroundPositionY = \n \"-\"+ String(frames[i]*offsety) + \"px\";\n i = (i + 1) % frames.length;\n }\n }\n if (that.timer) {\n clearInterval(that.timer);\n }\n //console.log(frameAnimation);\n that.timer = setInterval(frameAnimation, that.options.refreshTime);\n }\n\n that.move = function(name, position) {\n var i = (position)? position: that.currentPosition\n , frameAnimation = null\n , frames = that.moves[name].frames\n , offsetx = that.options.viewport.width\n , offsety = that.options.viewport.height\n ;\n\n if(that.moves[name].orientation === 'x') {\n\n that.options.render.style.backgroundPositionY = \n \"-\"+ String(that.moves[name].axis*offsety) + \"px\";\n\n frameAnimation = function () {\n that.options.render.style.backgroundPositionX = \n \"-\"+ String(frames[i]*offsetx) + \"px\";\n i = (i + 1) % frames.length;\n that.currentPosition = i;\n }\n \n } else {\n\n that.options.render.style.backgroundPositionX = \n \"-\"+ String(that.moves[name].axis*offsetx) + \"px\";\n\n frameAnimation = function () {\n //console.log(that.moves[name].axis);\n that.options.render.style.backgroundPositionY = \n \"-\"+ String(frames[i]*offsety) + \"px\";\n i = (i + 1) % frames.length;\n that.currentPosition = i;\n }\n }\n frameAnimation();\n }\n \n return that;\n}", "title": "" }, { "docid": "4eec6d343d94940e9a50f4be5b8b19be", "score": "0.66309327", "text": "render(pos_x, pos_y) {\n // Set respawn position as the render coordinates\n this.respawn_x = pos_x;\n this.respawn_y = pos_y;\n\n // Add sprite to the scene and configure physics parameters\n this.player_data = this.scene.physics.add.sprite(pos_x, pos_y, this.color).setScale(3);\n this.player_data.setBounce(0.1);\n this.player_data.setGravityY(400);\n this.player_data.setCollideWorldBounds(true);\n\n // Create player animations that are prepended by the color identifier\n this.scene.anims.create({\n key: this.color+'-run-left',\n frames: this.scene.anims.generateFrameNumbers(this.color+'-reverse', { start: 13, end: 19 }),\n frameRate: 10,\n repeat: -1\n });\n\n this.scene.anims.create({\n key: this.color+'-run-right',\n frames: this.scene.anims.generateFrameNumbers(this.color, { start: 3, end: 8 }),\n frameRate: 10,\n repeat: -1\n });\n\n this.scene.anims.create({\n key: this.color+'-idle-left',\n frames: this.scene.anims.generateFrameNumbers(this.color+'-reverse', { start: 13, end: 13 }),\n frameRate: 10,\n repeat: -1\n });\n\n this.scene.anims.create({\n key: this.color+'-idle-right',\n frames: this.scene.anims.generateFrameNumbers(this.color, {start: 3, end: 3}),\n frameRate: 10,\n repeat: -1\n })\n\n this.scene.anims.create({\n key: this.color+'-jump',\n frames: this.scene.anims.generateFrameNumbers(this.color, { start: 9, end: 10 }),\n frameRate: 10,\n repeat: -1\n });\n\n // The player is initially in a standing, non jumping state. This is\n // the default state. The movement and jumping states are initialized.\n this.movement_state = new PlayerMovementIdleState(this.player_data, this.scene, 'right', this.respawn_x, this.respawn_y, this.color);\n this.jumping_state = new PlayerJumpingIdleState(this.player_data, this.scene, this.respawn_x, this.respawn_y);\n\n // This handles all the collisions based on platform type\n this.scene.plats.forEach(element => this.scene.physics.add.collider(this.player_data, element, function(player_data, element, jumping_state, scene) {\n if (element.getData('type') == 'boost'){\n if (element.body.touching.up == true ) {\n element.anims.play('boosty', true);\n jumping_state = new PlayerJumpingActiveState(player_data, scene, -700);\n element.body.touching.up = false;\n }\n\n } else if (element.getData('type') == 'broken') {\n if (element.getData('strength') == 0 ) {\n element.destroy();\n } else if (element.getData('strength') == 80) {\n element.setTexture('broken-platform', 1);\n element.data.values.strength -= 1;\n\n } else if (element.getData('strength') == 60) {\n element.setTexture('broken-platform', 2);\n element.data.values.strength -= 1;\n\n } else if (element.getData('strength') == 40) {\n element.setTexture('broken-platform', 3);\n element.data.values.strength -= 1;\n\n } else if (element.getData('strength') == 20) {\n element.setTexture('broken-platform', 4);\n element.data.values.strength -= 1;\n\n } else {\n element.data.values.strength -= 1;\n }\n }\n }));\n }", "title": "" }, { "docid": "b60ad3422bb2dd382f61da33fd70fc41", "score": "0.6622174", "text": "update() {\n\t\tball.checkCanvasBounds();\n\n\t\tthis.ymov += gravity;\n\n\t\tthis.y += this.ymov;\n\t\tthis.x += this.xmov;\n\t}", "title": "" }, { "docid": "020230e94e813f56c81d5a598e0abc0a", "score": "0.6447062", "text": "function Player(x, y, width, height){\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n \r\n // Speed, velocity, jumping, grounded\r\n this.speed = 3;\r\n this.vel = {x: 0, y: 0};\r\n this.jumping = false;\r\n this.grounded = false; \r\n // Gravity and friction\r\n this.friction = 0.8;\r\n this.gravity = 0.3;\r\n \r\n \r\n // Jump method (if not jumping and grounded, you can jump)\r\n this.jump = function() {\r\n if(!this.jumping && this.grounded) {\r\n this.jumping = true;\r\n this.grounded = false;\r\n this.vel.y = -this.speed * 2.2;\r\n //log(this.x +\" / \"+ this.y);\r\n }\r\n };\r\n \r\n // Spritesheet animation method - used in onload = init method\r\n this.Sprite = function() {\r\n\t \r\n // Hero player spritesheet images\r\n this.runR = new Image();\r\n this.runR.src = 'img/01.png';\r\n\r\n this.runL = new Image();\r\n this.runL.src = 'img/02.png';\r\n\t\r\n this.idleR = new Image();\r\n this.idleR.src = 'img/01.png';\r\n\r\n this.idleL = new Image();\r\n this.idleL.src = 'img/02.png';\r\n \r\n // Animation stuff, idle is standing, direction for animation direction\r\n this.direction = \"right\";\r\n this.idle = true;\r\n\r\n // Frame for each spritesheet; only in x-axis\r\n this.anim = {\r\n\t frameRunRightX: 0,\r\n\t frameRunLeftX: 0,\r\n\t frameIdleLeftX: 0,\r\n\t frameIdleRightX: 0\r\n };\r\n \r\n this.drawSprite = function(img, sX, sY, sW, sH, dX, dY, dW, dH) {\r\n c.drawImage(img, sX, sY, sW, sH, dX, dY, dW, dH);\r\n }\r\n \r\n }\r\n \r\n // Init Sprite method\r\n this.Sprite();\r\n \r\n // Draw method from Sprite\r\n this.draw = function() {\r\n // If direction is right and hero is moving (right_down == true)\r\n if (this.direction === 'right' && right_down) {this.drawSprite(this.runR, this.width * this.anim.frameRunRightX, 0, this.width, this.height, this.x, this.y, this.width, this.height);}\r\n else if (this.direction === 'left' && left_down) {this.drawSprite(this.runL, this.width * this.anim.frameRunLeftX, 0, this.width, this.height, this.x, this.y, this.width, this.height);}\r\n else if (this.direction === 'left' && this.idle) {this.drawSprite(this.idleL, this.width * this.anim.frameIdleLeftX, 0, this.width, this.height, this.x, this.y, this.width, this.height);}\r\n else if (this.direction === 'right' && this.idle) {this.drawSprite(this.idleR, this.width * this.anim.frameIdleRightX, 0, this.width, this.height, this.x, this.y, this.width, this.height);}\r\n\t// Fallback to draw something; also this line deletes image flickering ;)\r\n\telse \t\t\t\t\t\t\t\t\t\t\t {this.drawSprite(this.idleR, this.width * this.anim.frameIdleRightX, 0, this.width, this.height, this.x, this.y, this.width, this.height);}\r\n }\r\n\r\n // Update method\r\n this.update = function() {\r\n // Draw and animate spritesheet\r\n this.draw();\r\n\t\r\n\t////////////////////////////////////\r\n /////////////\r\n // PHYSICS //\r\n\t/////////////\r\n\t\r\n // Gravity and friction \r\n this.vel.x *= this.friction;\r\n this.vel.y += this.gravity;\r\n \r\n // Grounded\r\n if(this.grounded) {\r\n this.vel.y = 0;\r\n }\r\n // Gravity\r\n this.y += this.vel.y;\r\n\t\r\n /////////////\r\n // PHYSICS //\r\n\t///////////// \r\n ////////////////////////////////////\r\n\r\n\r\n\t\r\n // Movement\r\n // If right_down button is pressed, then hero is moving to the right\r\n // and is not standing (idle)\r\n if(right_down) {\r\n this.direction = \"right\";\r\n this.idle = false;\r\n this.x += this.vel.x++;\r\n }\r\n if(left_down) {\r\n this.direction = \"left\";\r\n this.idle = false;\r\n this.x += this.vel.x--;\r\n }\r\n // Jump\r\n if(up_down) {this.jump();}\r\n\r\n // If there's no button pushing then player isn't moving\r\n if(!right_down && !left_down) {\r\n this.idle = true;\r\n }\r\n\r\n \r\n ////////////////////////////////////////\r\n // Collisions from somethinghitme.com //\r\n ////////////////////////////////////////\r\n\t\r\n this.grounded = false;\r\n for (let l = _blocks.length - 1; l >= 0; l--) {\r\n let dir = colCheck(this, _blocks[l]);\r\n if (dir === \"l\" || dir === \"r\") {\r\n this.vel.x = 0;\r\n this.grounded = false;\r\n // if this.grounded == true I can use it for ladder ;)\r\n }else if (dir === \"b\") {\r\n this.grounded = true;\r\n this.jumping = false;\r\n\r\n }else if (dir === \"t\") {\r\n this.vel.y *= -0.4;\r\n } \r\n }\r\n \r\n\r\n\r\n };\r\n}", "title": "" }, { "docid": "601c89778afaaeaeed3741fbe15c0b25", "score": "0.64204955", "text": "start() {\n\t\tsuper.start();\n\n\t\tif(this.target){\n\t\t\tthis.baseVelocity = {\n\t\t\t\tx: this.target.body.velocity.x,\n\t\t\t\ty: this.target.body.velocity.y\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d72b030969da512c4c45121547a2bffa", "score": "0.6405444", "text": "function create() {\n \n // to center game canvas\n\tgame.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;\n\tgame.scale.pageAlignHorizontally = true;\n\tgame.scale.pageAlignVertically = true; \n\n\t// change background colour\n\tgame.stage.backgroundColor = \"#87CEEB\";\n\t//background = game.add.tileSprite(0,0,800,600, \"bg\");\n\t\n\n\t// add the ball in the middle of the area\n\tthis.ball = game.add.sprite(game.world.centerX, game.world.centerY, \"ball\");\n\t// kotwica pozwala na latwiejsze ustawienie pilki w srodku pola gry\n\tthis.ball.anchor.set(0.5, 0.5);\n\n\t// key to move the ball\n\tthis.keys = game.input.keyboard.createCursorKeys();\n}", "title": "" }, { "docid": "0d3140bcf563bb8e6ee9acc2931e1a02", "score": "0.63902295", "text": "function gameStart() {\n ball.top = 200;\n ball.left = 200;\n ball.angle = UP_RIGHT;\n ball.speed = 5;\n }", "title": "" }, { "docid": "c92be4fd63754ded770181d12f1a8cfe", "score": "0.6383609", "text": "bulletinitPlace() {\n if( this.dx > 0 && this.dy === 0) {\n this.x += 48 + 2;\n this.y += 24; }\n if( this.dx < 0 && this.dy === 0) {\n this.y += 24;\n this.x += - 2 ; }\n if( this.dx === 0 && this.dy > 0) {\n this.x += 24;\n this.y += 48 + 2; }\n if( this.dx === 0 && this.dy < 0) {\n this.x += 24;\n this.y -= 8; }\n}", "title": "" }, { "docid": "9ba452a4abe23dad6cbba3c305cd5108", "score": "0.6382432", "text": "constructor(x, y, nombre, frame){\n this._gameObject=game.add.sprite(x, y, nombre, frame);//carga el sprite\n this._vel = 125;//velocidad a la que se mueve\n this._velIni = this._vel;//velocidad inicial\n this._atraviesa = false;//indica si puede atravesar muros\n this._muerto = false;//indica si el gameObject esta muerto o no\n this._contador = 0;//contador para realizar funciones auxiliares\n game.physics.arcade.enable(this._gameObject);//habilitamos fisicas, gravedad, etc.\n this._gameObject.body.gravity.y=400;\n this._gameObject.body.setSize(this._gameObject.width, this._gameObject.height/5);//collider, solo en sus pies\n this._gameObject.anchor.setTo(0.5, 1);//establecemos su centro en sus pies\n this._gameObject.checkWorldBounds = true;//si se sale de los bordes de la pantalla muere\n this._gameObject.events.onOutOfBounds.add(this.morir, this);\n this._anim = this._gameObject.animations;//animaciones\n }", "title": "" }, { "docid": "4a610f23905b8fd820a4a12970af42d4", "score": "0.63811815", "text": "update() {\n super.draw()\n this.x = this.x + this.velocity.x\n this.y = this.y + this.velocity.y\n }", "title": "" }, { "docid": "4bd7c4bb4c6c7c3e9ec1926eb3c81961", "score": "0.6367596", "text": "constructor() {\n\t\tthis.x = 10;\n\t\tthis.y = height - 100;\n\t\tthis.r = 100;\n\t\tthis.vy = 0;\n\t\tthis.g = 2;\n\t\tthis.jumping = false;\n\t\tthis.speed = 1;\n\t\tthis.ind = 0;\n\t}", "title": "" }, { "docid": "8a760771e6a733cd5fbd98351bbeca82", "score": "0.6364127", "text": "function spawnRabbit(){\n if (World.frameCount % 100 === 0){\n count = count+1;\n var rabbit = createSprite(displayWidth, 570);\n rabbit.addImage(obstacle1L);\n rabbit.scale = 0.2\n rabbit.velocityX = -2;\n console.log(rabbit.x);\n \n \n rabbit.collide(ground1);\n rabbit.collide(ground3);\n if (rabbit.collide(ground2)){\n\n if( rabbit.x > 850){\n rabbit.velocityX = 2\n rabbit.addImage(obstacle1R);\n rabbit.scale = 0.2;\n }\n else if (rabbit.x > displayWidth){\n rabbit.x = 0;\n rabbit.velocityX = 2\n rabbit.addImage(obstacle1R);\n rabbit.scale = 0.2;\n }\n\n if (rabbit.x < 280){\n rabbit.addImage(obstacle1L);\n rabbit.scale = 0.2;\n rabbit.velocityX = -2;\n }\n\n else if (rabbit.x < 0){\n rabbit.x = displayWidth - 30\n rabbit.addImage(obstacle1L);\n rabbit.scale = 0.2;\n rabbit.velocityX = -2;\n }\n }\n\n \n rabbitGroup.add(rabbit);\n }\n \n}", "title": "" }, { "docid": "97a1bd042c1fe3d344dfba7f9e69a2af", "score": "0.63459903", "text": "bounce() {\n if (this.bodyX > windowWidth || this.bodyX < 0) {\n (this.Xspeed = this.Xspeed * -1)\n }\n if (this.bodyY > windowHeight || this.bodyY < 0) {\n (this.Yspeed = this.Yspeed * -1)\n }\n }", "title": "" }, { "docid": "25758e4cae78bd2d5b79a2f87a33a6fb", "score": "0.6345021", "text": "constructor() {\n\t\tsuper();\n\n\t\tthis.velocity = {\n\t\t\tx: 0,\n\t\t\ty: this.getSpeed()\n\t\t};\n\t\tthis.position = {\n\t\t\tx: this.getRndInteger(0, config.canvas_size.width),\n\t\t\ty: config.canvas_size.height - 510\n\t\t};\n\t}", "title": "" }, { "docid": "d9afee51944e678b0d77ba56ca960413", "score": "0.63146365", "text": "constructor(scene, x, y, texture, frame, speed){\n super(scene, x, y, texture, frame);\n\n \n scene.add.existing(this); //add object to existing scene\n this.speed = speed;\n //this.playerAttack = scene.projectiles.getChildren();\n this.scene = scene;\n this.health = 100;\n this.isDead = false;\n this.bar = scene.add.image(x,y-30,\"enemyHealth\").setScale(0.25,0.25);\n //this.bar = scene.add.image(300,300,\"health\").setScale(0.5,0.5);\n this.shooting = false;\n this.even = 0;\n this.timing = 0;\n this.bossStage = false;\n //this.laser = scene.add.tileSprite(0,0,200,150,'lasers');//([where on screen],[which area in image])\n \n //determining direction\n if( y <= 0){\n this.where = -10;\n }else{\n this.where = 10;\n }\n\n }", "title": "" }, { "docid": "2272233d03a08325c1007bf3bc9cfae8", "score": "0.62643003", "text": "newPos()\n {\n this.velocity = playerMovement(this.target.x, this.target.y, this.screenWidth, this.screenHeight);\n this.playerVelo = checkBound(this.x, this.y, this.velocity, this.radius);\n this.x += this.playerVelo.x;\n this.y += this.playerVelo.y;\n //Setting new screen boundary vectors\n this.screenTL.x = this.x - this.screenWidth / 2;\n this.screenTL.y = this.y - this.screenHeight / 2;\n this.screenBR.x = this.x + this.screenWidth / 2;\n this.screenBR.y = this.y + this.screenHeight / 2;\n\n //Invisible mode\n if (this.invisible == true)\n {\n this.alpha = 0.5;\n //If invisibleTimer is 0, disable invisible mode.\n if (this.invisibleTimer >= 0.02)\n {\n this.invisibleTimer -= 0.02;\n }\n else\n {\n this.invisible = false;\n this.invisibleTimer = 0;\n }\n }\n else\n {\n //Restart invisibleTimer\n this.alpha = 1;\n\n //Fueling invisible timer if the maximum is not reached yet.\n if (this.invisibleTimer < CONFIG.circleMaxInvMode - 0.01)\n {\n this.invisibleTimer += 0.01;\n }\n }\n }", "title": "" }, { "docid": "2e1c9c15ad199949fdab8ac02b178862", "score": "0.62479097", "text": "function DeadBody(scene) {\n\n var self = this;\n self._CLASS_ = \"DeadBody\";\n\n // Graphics: Layers to this peep.\n self.DRAWING_SCALE = 0.65 * Game.width / 960;\n var g = new PIXI.Container();\n self.graphics = g;\n self.mc = MakeMovieClip(\"gore_bodies\");\n self.mc.anchor.x = 132 / 160;\n self.mc.anchor.y = 91 / 120;\n self.mc.scale.x = self.mc.scale.y = self.DRAWING_SCALE;\n g.addChild(self.mc);\n\n // Init – set DIRECTION and VELOCITY and X,Y,Z\n // and GRAVITY and SPIN and BOUNCE and OFFSET and FRAME\n self.direction = 0;\n self.velocity = 0;\n self.vx = 0;\n self.vz = 0;\n self.x = 0;\n self.y = 0;\n self.z = -10;\n self.gravity = 0.2;\n self.flip = 1;\n self.init = function(options) {\n\n // All them dang options\n if (options.direction !== undefined) self.direction = options.direction;\n if (options.velocity !== undefined) self.velocity = options.velocity;\n if (options.x !== undefined) self.x = options.x;\n if (options.y !== undefined) self.y = options.y;\n if (options.z !== undefined) self.z = options.z;\n if (options.gravity !== undefined) self.gravity = options.gravity;\n if (options.flip !== undefined) self.flip = options.flip;\n\n // Frame\n if (options.frame !== undefined) self.mc.gotoAndStop(options.frame);\n\n // And then convert to vx & vz.\n self.vx = Math.cos(self.direction) * self.velocity;\n self.vz = Math.sin(self.direction) * self.velocity;\n\n // BLOOD FOR THE BLOOD GOD\n var blood = new Blood(scene);\n blood.init({\n x: self.x,\n y: self.y,\n scale: 1\n });\n scene.world.addBG(blood);\n\n };\n\n // Update!\n self.update = function() {\n\n // FALLING\n self.x += self.vx;\n self.z += self.vz;\n self.vz += self.gravity;\n\n // Bounce or no?\n if (self.z >= 0) {\n self.z = 0;\n self.vx *= 0.8;\n self.vr *= 0.8;\n if (Math.abs(self.vz) > 1) {\n\n // BLOOD FOR THE BLOOD GOD\n var blood = new Blood(scene);\n blood.init({\n x: self.x,\n y: self.y,\n scale: 0.5 + Math.abs(self.vz) * 0.1\n });\n scene.world.addBG(blood);\n\n // Bounce\n self.vz *= -0.3;\n\n } else {\n self.vz = 0;\n }\n }\n\n // Rotation: HOW MUCH OFF THE GROUND?\n // 0 -> 0, -50 -> TAU/4\n self.rotation = (Math.abs(self.z) / 50) * (Math.TAU / 4);\n if (self.rotation > Math.TAU * 0.2) {\n self.rotation = Math.TAU * 0.2;\n }\n\n // Convert to Graphics!\n g.x = self.x;\n g.y = self.y + self.z;\n self.mc.rotation = self.rotation;\n g.scale.x = (self.flip > 0) ? 1 : -1;\n\n };\n\n // KILL ME\n self.kill = function() {\n var world = self.scene.world;\n world.props.splice(world.props.indexOf(self), 1);\n world.layers.props.removeChild(self.graphics);\n };\n\n\n}", "title": "" }, { "docid": "754b26ef3c6f3f60bca337aa7462a23b", "score": "0.6247126", "text": "positionSprite(x, y) {\n this.x = x;\n this.y = y;\n this.element.style.left = x + 'px';\n this.element.style.top = y + 'px';\n }", "title": "" }, { "docid": "6c6e511a7c2cae9c083729ae461099cf", "score": "0.6239326", "text": "function setPositionRoadScene1() {\n gameBackground.tilePosition.x = 0;\n center.x = LOGICAL_WIDTH * numOfBgScreen;\n centerExpand.x = LOGICAL_WIDTH * (numOfBgScreen + 1);\n gameBackground.vx = humanSpeed;\n center.vx = humanSpeed;\n centerExpand.vx = humanSpeed;\n human.x = 110;\n human.vx = 0;\n}", "title": "" }, { "docid": "f0d3aed4fe301525b0deea6476583c12", "score": "0.6225705", "text": "start(){\n player.sprite.position.x = 1160;\n friend.sprite.position.x = 1222;\n player.sprite.position.y = 1374;\n friend.sprite.position.y = 1374;\n }", "title": "" }, { "docid": "4305f66eb4ecafbaedfa44cd7a78cf04", "score": "0.62246317", "text": "moveBall(){\n //Move\n if(this.started){\n this.ballX += this.ballSpeedX;\n this.ballY -= this.ballSpeedY; \n }else {\n this.ballX = this.PADDLEX + PADDLE_CANVAS_WIDTH/2;\n }\n }", "title": "" }, { "docid": "0f3c8a1df09c5b65534367a34713a1d4", "score": "0.6221698", "text": "constructor() {\n this.reset();\n this.body = new Rigidbody(this.x, this.y + 75, 100, 70);\n\n this.sprite = 'images/enemy-bug.png';\n }", "title": "" }, { "docid": "e816681c2f6f1430a97dc41921a50828", "score": "0.6208108", "text": "function Start()\n{\n x = 10;\n y = 50;\n velX = 0; \n velY = 0;\n\n w = 50;\n h = 50;\n}", "title": "" }, { "docid": "9a15e2a8044669f8f8195a83b01ff858", "score": "0.6192267", "text": "constructor(x, y) {\n this.sprite = 'images/enemy-bug.png';\n this.x = x;\n this.y = y;\n this.velocity = 100 + (Math.random() * 100); \n }", "title": "" }, { "docid": "2e825356daf9f73d526a08a875f5d09d", "score": "0.61840105", "text": "function playerSprite(width, height, img, x, y) {\n\tthis.image = new Image();\n\tthis.image.src = img;\n\tthis.colAdj = 20;\n\tthis.faceRight = true;\n\tthis.state = playerState.Idling;\n\tthis.width = width-this.colAdj;\n\tthis.height = height-this.colAdj;\n\tthis.speedX = 0;\n\tthis.x = x;\n\tthis.y = y;\n\t\n\tthis.accelY = gravity;\n\tthis.speedY = 0;\n\tthis.maxGravitySpeed = 15;\n\tthis.maxFlySpeed = -10;\n\tthis.maxWingBeats = 5;\n\tthis.wingBeats = 0;\n\t\n\tthis.accelInc = 0.4;\n\tthis.accelDec = 0.5;\n\tthis.accel = 0;\n\tthis.maxAccel = 10;\n\t\n\tthis.flyingFrames = 0;\n\tthis.jumpingFrames = 0;\n\tthis.landingFrames = 0;\n\tthis.ouchingFrames = 0;\n\tthis.dyingFrames = 0;\n\t\n\tthis.hitGround = false;\n\tthis.hitPoints = 5;\n\tthis.invincible = 0;\n\tthis.invincibleFrames = 90;\n\tthis.kill = false;\n\t\n\tthis.collectedGold = 0;\n\t\n\tthis.shootProjectile = function() {\n\t\tif (allProjectiles.length > 5) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar shoot = new CustomEvent(\"projectile\", {});\n\t\tsounds[soundIndex.PROJECTILESFX].dispatchEvent(shoot);\n\t\tvar col = \"Red\"\n\t\tvar fireBall;\n\t\tif (this.faceRight) {\n\t\t fireBall = new projectile(20, 20, col, this.x + this.width/2, this.y - 20, true, true, this.faceRight, this.accel);\n\t\t}\n\t\telse {\n\t\t fireBall = new projectile(20, 20, col, this.x - this.width/2, this.y - 20, true, true, this.faceRight, this.accel);\n\t\t}\n\t allProjectiles.push(fireBall);\n\t}\n\t\n\tthis.updatePos = function() {\n\t\tif ((this.speedY + this.accelY <= this.maxGravitySpeed &&\n\t\t\tthis.speedY + this.accelY >= this.maxFlySpeed) || this.state == playerState.Ouching) {\n\t\t\tthis.speedY += this.accelY;\t\t\t\n\t\t}\n\t\t\n\t\tif (this.invincible > 0) {\n\t\t\tthis.invincible--;\n\t\t}\n\t\t\n\t\tthis.speedX = this.accel;\t\t\t\n\t\t\n\t\tthis.hitEdge();\n\t\tthis.detectCollision();\n\t\t\n\t\tthis.x += this.speedX;\n\t\t\n\t\tif (debug) document.getElementById(\"test11\").innerHTML = \"wingbeats: \" + this.wingBeats;\n\t\tif (debug) document.getElementById(\"test7\").innerHTML = \"speed: \" + player.speedX + \",<br> accel: \" + player.accel;\n\t\tif (debug) document.getElementById(\"test5\").innerHTML = \"speedY: \" + this.speedY + \",<br> accelY: \" + this.accelY;\n\t}\n\t\n\tthis.frameIndex = 0;\t\t// current frame to be displayed\n\tthis.tickCount = 0;\t\t\t// number of updates since current frame was first displayed\n\tthis.ticksPerFrame = 1;\t\t// number of updates until next frame should be displayed, FPS\n\tthis.maxFrames = 35;\n\tthis.stateChange = false;\n\t\n\tthis.draw = function () {\n\t\tif (this.stateChange) {\n\t\t\tthis.frameIndex = 0;\n\t\t\tthis.stateChange = false;\n\t\t}\n\t\t\n\t\tswitch (this.state) {\n\t\tcase playerState.Idling:\n\t\t\tthis.image.src = images.player()[images.playerIndex().IDLE].src;\n\t\t\tthis.maxFrames = 35;\n\t\t\tbreak;\n\t\tcase playerState.Running:\n\t\t\tthis.image.src = images.player()[images.playerIndex().WALK].src;\n\t\t\tthis.maxFrames = 27;\n\t\t\tbreak;\n\t\tcase playerState.Flying:\n\t\t\tthis.image.src = images.player()[images.playerIndex().FLY].src;\n\t\t\tthis.maxFrames = 8;\n\t\t\tbreak;\n\t\tcase playerState.Gliding:\n\t\t\tthis.image.src = images.player()[images.playerIndex().GLIDE].src;\n\t\t\tthis.maxFrames = 1;\n\t\t\tbreak;\n\t\tcase playerState.Falling:\n\t\t\tthis.image.src = images.player()[images.playerIndex().FALL].src;\n\t\t\tthis.maxFrames = 4;\n\t\t\tbreak;\n\t\tcase playerState.Jumping:\n\t\t\tthis.image.src = images.player()[images.playerIndex().JUMP].src;\n\t\t\tthis.maxFrames = 4;\n\t\t\tbreak;\n\t\tcase playerState.Landing:\n\t\t\tthis.image.src = images.player()[images.playerIndex().IDLE].src;\n\t\t\tthis.maxFrames = 35;\n\t\t\tbreak;\n\t\tcase playerState.Ouching:\n\t\t\tthis.image.src = images.player()[images.playerIndex().OUCH].src;\n\t\t\tthis.maxFrames = 1;\n\t\t\tbreak;\n\t\tcase playerState.Dying:\n\t\t\tthis.image.src = images.player()[images.playerIndex().DIE].src;\n\t\t\tthis.maxFrames = 1;\n\t\t\tbreak;\n\t\t}\n\t\tif (this.invincible == 0 || (this.invincible % 10 >= 0 && this.invincible % 10 < 5)) {\n\t\t\tif (player.state == playerState.Flying) {\n\t\t\t\tdrawSprite(this, this.image, 100, 200, this.width, 160, this.maxFrames);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdrawSprite(this, this.image, 100, 100, this.width, this.height, this.maxFrames);\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\t\n\tthis.hitEdge = function () {\n\t\tif (this.y + this.speedY > levelLimitsy) {\n\t\t\tchangeState(this, playerState.Dying);\n\t\t\treturn;\n\t\t}\n\t\tif (this.y + this.speedY < -200) {\n\t\t\tchangeState(this, playerState.Falling);\n\t\t}\n\t\tif (this.x + this.speedX > levelLimitsx || this.x + this.speedX < 0) {\n\t\t\tthis.speedX = 0;\n\t\t}\n\t}\n\t\n\tthis.detectCollision = function() {\n\t\tvar slopeMax = 12;\n\n\t\tif (debug) document.getElementById(\"test4\").innerHTML = \"..\";\n\t\tif (debug) document.getElementById(\"test3\").innerHTML = \"..\";\n\t\tif (debug) document.getElementById(\"test5\").innerHTML = \"..\";\n\t\t\n\t\t// if hit by enemy\n\t\tif (this.state != playerState.Ouching && this.invincible <= 0) {\n\t\t\tfor (var i = 0; i < inViewEnemies.length; ++i) {\n\t\t\t\tif (collideObject(this.x, this.y + this.speedY, inViewEnemies[i], this.width, this.height) || \n\t\t\t\t\tcollideObject(this.x + this.speedX, this.y, inViewEnemies[i], this.width, this.height)) {\n\t\t\t\t\t--this.hitPoints;\n\t\t\t\t\tif (this.hitPoints > 0) {\n\t\t\t\t\t\tchangeState(this, playerState.Ouching);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tchangeState(this, playerState.Dying);\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// y collision\n\t\tfor (var i = 0; i < inViewPlatforms.length; ++i) {\t\n\t\t\t\n\t\t\t// check just y collision\n\t\t\tif (collide(this.x, this.y + this.speedY, inViewPlatforms[i], this.width, this.height)) {\n\t\t\t\t// check if player hit the ground instead of ceiling\n\t\t\t\tif (player.state != playerState.Gliding && player.state != playerState.Jumping && player.state != playerState.Flying) {\n\t\t\t\t\tthis.hitGround = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.hitGround = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (inViewPlatforms[i].type == \"ground\") {\n\t\t\t\t\tthis.speedY = 0;\n\t\t\t\t\tif (this.state == playerState.Gliding) {\n\t\t\t\t\t\tchangeState(this, playerState.Falling);\n\t\t\t\t\t}\n\t\t\t\t\tif (debug) document.getElementById(\"test4\").innerHTML = \"y Ground Collision \";\n\t\t\t\t}\n\t\t\t\telse if (inViewPlatforms[i].type == \"cloud\") {\n\t\t\t\t\tif (this.accelY > 0) {\n\t\t\t\t\t\tif (this.state == playerState.Gliding) {\n\t\t\t\t\t\t\tthis.accelY *= 0.75;\n\t\t\t\t\t\t\tthis.speedY *= 0.75;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.accelY *= 0.5;\n\t\t\t\t\t\t\tthis.speedY *= 0.5;\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\tthis.wingBeats = 0;\n\t\t\t\t\t\n\t\t\t\t\tif (debug) document.getElementById(\"test4\").innerHTML = \"y Cloud Collision \";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.y += this.speedY;\n\t\t\n\t\t// x collision\n\t\tvar prevThisY = this.y;\n\t\tfor (var i = 0; i < inViewPlatforms.length; ++i) {\n\t\t\t// check if can move up slopes\n\t\t\tif (inViewPlatforms[i].type == \"ground\") {\n\t\t\t\t// slope up\n\t\t\t\tfor (var n = 0; n <= slopeMax; ++n) {\n\t\t\t\t\tif (collide(this.x + this.speedX, this.y - n, inViewPlatforms[i], this.width, this.height)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!collide(this.x + this.speedX, this.y - n, inViewPlatforms[i], this.width, this.height)) {\n\t\t\t\t\t\tthis.y -= n;\n\t\t\t\t\t\tif (prevThisY-this.y > 10) {\n\t\t\t\t\t\t\tif (this.accel < -5) {\n\t\t\t\t\t\t\t\tthis.accel = -5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (this.accel > 5) {\n\t\t\t\t\t\t\t\tthis.accel = 5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// check just x collision\n\t\t\tif (collide(this.x + this.speedX, this.y, inViewPlatforms[i], this.width, this.height)) {\n\t\t\t\tif (inViewPlatforms[i].type == \"ground\") {\n\t\t\t\t\tthis.speedX = 0;\n\t\t\t\t\tthis.accel = 0;\n\n\t\t\t\t\tif (debug) document.getElementById(\"test3\").innerHTML = \"x Ground Collision\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (inViewPlatforms[i].type == \"cloud\") {\n\t\t\t\t\tthis.speedX *= 0.75;\n\n\t\t\t\t\tif (debug) document.getElementById(\"test3\").innerHTML = \"x Cloud Collision\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f9a73c68f0eb9b08c7b1e891b4a69de7", "score": "0.6181961", "text": "function PlayerBullet(shooter, weapon) {\n this.shooter=shooter;\n this.distance=weapon.range;\n this.damage=weapon.damage;\n this.deltaY=-weapon.bulletSpeed;\n this.deltaX=shooter.deltaX || 0;\n this.initialize();\n this.graphics.beginFill(\"#000\").drawCircle(0,0,2);\n this.x=this.shooter.x+this.shooter.width/2;//should subtract 1\n this.y=this.shooter.y;\n this.width=this.height=2;\n //this.regX=this.regY=1;\n\n }", "title": "" }, { "docid": "88148653b20b4c19d193823a80b5d7e9", "score": "0.61725086", "text": "function Ball(){\n\tvar self = this;\n\n\t//load the sprite\n\tself.sprite = PIXI.Sprite.fromImage(\"../img/ball.png\");\n\t\n\t//place ball in centre of screen\n\tself.sprite.position.set(SCREEN_W/2, SCREEN_H/2);\n\n\t//draw from center\n\tself.sprite.anchor.set(0.5, 0.5);\n\n\t//the velocity of the ball\n\tself.velocity = vector2.create(0,3);\n\t\n\tthis.update = function()\n\t{\n\t\tif ( gameState === 'playing'){ \n\t\t\t//move ball\n\t\t\tself.sprite.position.x += self.velocity._x;\n\t\t\tself.sprite.position.y += self.velocity._y;\n\t\t}\n\t}\n\n\tthis.onPlayerCollision = function()\n\t{\n\t\tself.velocity._y = -self.velocity._y;\n\t}\n}", "title": "" }, { "docid": "f59ede45da2a9488d79e29767642b22c", "score": "0.61706144", "text": "updatePosition() {\n this.x += this.xSpeed;\n this.y += this.ySpeed;\n\n // Drop bird if he ded\n if (this.dead === true) {\n this.xSpeed = 0;\n this.ySpeed = 5;\n\n // Stop when hit ground\n if (this.y >= this.size * 0.8) {\n this.ySpeed = 0;\n }\n }\n }", "title": "" }, { "docid": "c6fd2085df856c78c04531ecb495fd92", "score": "0.6165197", "text": "spriteSetup() {\n let sprite = this.game.physics.add.sprite(this.x, this.y, \"paddle\")\n sprite.setCollideWorldBounds(true)\n return sprite\n }", "title": "" }, { "docid": "6e78a2062ed619305b75960e3a935d59", "score": "0.6164937", "text": "constructor() {\n super();\n let x = 800 * Math.random();\n let y = 600 * Math.random();\n //console.log(\"Snowflakes constructor\");\n this.position = new Endabgabe.Vector(x, y); // position DIESES Objekts\n this.velocity = new Endabgabe.Vector(0, 3); // Was macht das hier nochmal\n }", "title": "" }, { "docid": "b17d4c28b668d913f2649cf832458d08", "score": "0.616461", "text": "constructor(x, y, speed) {\n this.x = x;\n this.y = y;\n this.speed = speed;\n this.sprite = 'images/enemy-bug.png';\n this.height = 83;\n this.width = 70;\n\n }", "title": "" }, { "docid": "c49700eb96fcde428a80fb2865299960", "score": "0.61475074", "text": "moveBall(){ //update the location of the ball, so it moves across the screen\n\n\t\tthis.x = this.x+this.speedx;\n\t\tthis.y = this.y+this.speedy;\n\t}", "title": "" }, { "docid": "a93ac75259c9ac806e605004237e69a1", "score": "0.6145432", "text": "function startGame () {\n\n\t\t if (ballOnPaddle)\n\t\t {\n\t\t ballOnPaddle = false;\n\t\t ball.body.velocity.y = -300;\n\t\t ball.body.velocity.x = -75;\n\t\t }\n\n\t\t}", "title": "" }, { "docid": "09b63ec3e7cb34b367965c1201b6bb22", "score": "0.61296546", "text": "idle() {\n let sprite = this.sprite;\n\n this.vx = 0;\n this.vy = 0;\n\t\t\t\n sprite.stopAnimation();\n }", "title": "" }, { "docid": "4400a791297a9c6fa4664b1e1b8f87ba", "score": "0.6126277", "text": "update() {\r\n \r\n //change in horizontal motion per frame, position x is added to by the velocity\r\n this.position.x += this.velocity.x;\r\n //change in vertical motion per frame, position y is added to by the velocity\r\n this.position.y += this.velocity.y;\r\n \r\n //drawing circle\r\n circle(this.position.x, this.position.y, 20);\r\n \r\n //when the ball reaches the edge of the canvas (left or right) it invokes the ballbeyond function in the world variable\r\n if(this.position.x < 0 || this.position.x > 400) {\r\n World.ballBeyond(this);\r\n \r\n box1.enlarge();\r\n box2.enlarge();\r\n }\r\n }", "title": "" }, { "docid": "161025c0d4ba0077de8a02b7f3b55cfc", "score": "0.6119431", "text": "function Start()\n{\n LogMan.Log(\"DOLPH_INSCRIPT\", \"starT\");\n ballList = new GList();\n ballList.Add(new Ball(50, 50, 40));\n ballList.Add(new Ball(200, 50, 40)); \n \n ballList.Add(new Ball(50, 150, 40));\n ballList.Add(new Ball(200, 150, 40)); \n ballList.Get(1).velX = -3;\n ballList.Get(1).g = 1;\n\n\n for (i = 0; i < 30; i++)\n {\n ballList.Add(new Ball(Math.random()*GameEngine.GetWidth(), Math.random()*GameEngine.GetHeight(), 30));\n ballList.Get(ballList.GetSize()-1).velY = -3 + Math.random()*6;\n ballList.Get(ballList.GetSize()-1).velX = -3 + Math.random()*6;\n }\n \n \n sprite = new Sprite(image, 150, 150, 256/2, 256/2);\n \n sprite.StartAnimation(new AnimationData(0,0,1,0,5));\n //sprite.curFrame = 1;\n\n\n entity = new Entity(image, 100, 100);\n \n image2 = image;\n}", "title": "" }, { "docid": "719f8a12616d50848276632d1cbbc7e6", "score": "0.61180073", "text": "resetBallPos(){\r\n this.ball.posX = CANVAS_WIDTH / 2;\r\n this.ball.posY = CANVAS_HEIGHT / 2;\r\n }", "title": "" }, { "docid": "126ff9c3e625d2b8aa22b963e198dbfc", "score": "0.61084014", "text": "newPos()\n {\n this.angle += this.moveAngle * Math.PI / 180;\n this.velocity = playerMovement(this.target.x, this.target.y, this.screenWidth, this.screenHeight);\n this.playerVelo = checkBound(this.x, this.y, this.velocity, 0);\n this.x += this.playerVelo.x;\n this.y += this.playerVelo.y;\n this.screenTL.x = this.x - this.screenWidth / 2;\n this.screenTL.y = this.y - this.screenHeight / 2;\n this.screenBR.x = this.x + this.screenWidth / 2;\n this.screenBR.y = this.y + this.screenHeight / 2;\n }", "title": "" }, { "docid": "232ec129afac3bd34925bfce47f28842", "score": "0.6102453", "text": "update() {\n const dx = this.container.parentElement.clientLeft - this.container.clientWidth / 2;\n const dy = this.container.parentElement.clientTop - this.container.clientHeight / 2;\n this.container.style.left = (100 * this.pose.current.p.x + dx) + \"px\";\n this.container.style.zIndex = this.pose.current.p.y;\n this.container.style.top = (100 * this.pose.current.p.z + dy) + \"px\";\n }", "title": "" }, { "docid": "2eeca90bcfb680a425bfc194efd90c7f", "score": "0.6093359", "text": "function setupBall() {\n ball.x = width / 2;\n ball.y = height / 2;\n ball.vx = ball.speed;\n ball.vy = ball.speed;\n}", "title": "" }, { "docid": "c781f90f22b65291fd1a46372e96a7b0", "score": "0.6075821", "text": "function setupBall() {\n ball.x = width/2;\n ball.y = height/2;\n ball.vx = ball.speed;\n ball.vy = ball.speed;\n}", "title": "" }, { "docid": "c781f90f22b65291fd1a46372e96a7b0", "score": "0.6075821", "text": "function setupBall() {\n ball.x = width/2;\n ball.y = height/2;\n ball.vx = ball.speed;\n ball.vy = ball.speed;\n}", "title": "" }, { "docid": "76d4113fafaa263744599af0ae966d45", "score": "0.607082", "text": "constructor(gameWidth, gameHeight) {\n //Guardamos el ancho del canvas que recibimos solo para utilizarlo en el if del update\n this.gameWidth = gameWidth; \n\n //Definimos un tamaño del paddle\n this.width = 150;\n this.height = 30;\n\n //Definimos una velocidad maxSpeed, que es el factor de incremento que tiene la posición \n //del paddle.\n //La variable speed va a tomar el valor de maxSpeed dependiendo de que tecla se presione, \n //y será el incremento que cambie la posición.\n this.maxSpeed = 10;\n this.speed = 0;\n\n //Definimos la posición x,y como objetos para pdoer hacer referencia a ellos más rápido y \n //mover el paddle fácilmente. \n this.position = {\n x: gameWidth/2 - this.width/2,\n y: gameHeight - this.height - 10\n };\n }", "title": "" }, { "docid": "6ad91b13d03b30d48c7f54e53cecfb30", "score": "0.6068518", "text": "constructor(x, y) { //this states the constructor we are starting in\n this.x = x;//the x coordinates\n this.y = y;//the y coordinates\n this.xspeed = 10;//how fast x will be\n this.yspeed = 10;//how fast y will be\n this.friction = 0.6;//slows the enemy down\n this.gravity = 1;//this keeps the rectangle from flying into the dark abyss that is outside the game\n this.maxSpeed = 5;//this caps how fast the rectangle can move\n this.width = 50;//this is the rectangles max width\n this.height = 100;//this is the rectangles max height\n this.active = true;\n }", "title": "" }, { "docid": "4c234968542b8b65f8498babeabcfaa0", "score": "0.6065721", "text": "function changeBall_2() {\r\n var Xmin = 0;\r\n var Xmax = 1000;\r\n if (reverse_2 === false) {\r\n positionX_2 = positionX_2 + velocity_2;\r\n ball_2.style.left = positionX_2 + 'px';\r\n } else {\r\n positionX_2 = positionX_2 - velocity_2;\r\n ball_2.style.left = positionX_2 + 'px';\r\n }\r\n if ((positionX_2 + velocity_2) > Xmax || (positionX_2 - velocity_2) < Xmin) {\r\n reverse_2 = !reverse_2;\r\n }\r\n //generates random velocity\r\n velocity_2 = getRndInteger(5, 200);\r\n //generates random color\r\n ball_2.style.background = '#'+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6)\r\n //generates random number to be number to be used in height and width\r\n var randomNumber = getRndInteger(5, 100);\r\n ball_2.style.height = randomNumber + 'px';\r\n ball_2.style.width = randomNumber + 'px';\r\n \r\n}", "title": "" }, { "docid": "510460012ba7d12fae58f6206ee94325", "score": "0.60630375", "text": "function Ball(x,y,diameter,canvas){\r\n\tif(canvas != null){\r\n\t\tthis.canvas = canvas;\r\n\t\tthis.color = this.canvas.color(255);\r\n\t}\r\n\tthis.pos = new Vector(x,y); //position vector\r\n\tthis.vel = new Vector(0,0); //velocity vector\r\n\tthis.a = new Vector(0,0); //acceleration vector\r\n\tthis.f = new Vector(0,0); //force vector\r\n\tthis.g = new Vector(0,0); //gravity vector\r\n\tthis.r = diameter / 2; //turns diameter into radius\r\n\tthis.maxSpeed = 100; //used for speed limit\r\n\tthis.angle = 0; //used for rotation\r\n\tthis.isTurned = false; //used for rotation state\r\n\tthis.isPushed = false; //if a force is acting on the ball\r\n\tthis.force = 1; //magnitude of force applied to ball\r\n\tthis.m = 1; //mass of ball\r\n\tthis.img = \"img/default.png\"; //default image path\r\n\tthis.friction = 0; //friction coefficient\r\n\tthis.spinFriction = 0; //friction applied to spin\r\n\tthis.inelastic = 1; //inelastic collision coefficient\r\n\tthis.spin = 0; //angular momentum\r\n\t//if spin is negative then it is CCW, if spin is positive it is CW\r\n\t//the absolute value of spin is how hard it is spinning\r\n\tthis.value = 0;\r\n\tthis.active = true;\r\n\t\r\n\tthis.scale = this.r * 2;\r\n\t//ship coordinates for body\r\n\tthis.body = [-this.scale*.5,this.scale,this.scale*.5,this.scale,0,-this.scale,0,this.scale*.8];//body shape/coordinates\r\n/////////////////////////////////////////////////////////////////////\r\n//sets the canvas object\r\n/////////////////////////////////////////////////////////////////////\t\r\n\tthis.setCanvas = function(canvas){\r\n\t\tthis.canvas = canvas;\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//sets the x and y to the pos vector\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.setPos = function(x,y){\r\n\t\tthis.pos.x = x;\r\n\t\tthis.pos.y = y;\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//sets the x and y to the vel vector\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.setVel = function(x,y){\r\n\t\tthis.vel.x = x;\r\n\t\tthis.vel.y = y;\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//sets the color, if only one value is given then a grayscale value\r\n//is assigned, if all 3 are given then a RGB value is assigned\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.setColor = function(R,G,B){\r\n\t\tif(G == null && B == null){\r\n\t\t\tthis.color = this.canvas.color(R);\r\n\t\t}else{\r\n\t\t\tthis.color = this.canvas.color(R,G,B);\r\n\t\t}\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//sets the x and y to the vel vector\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.setImg = function(filePath){\r\n\t\tif(filePath){\r\n\t\t\tthis.img = this.canvas.loadImage(filePath);\r\n\t\t}else{\r\n\t\t\tthis.img = this.canvas.loadImage(this.img);\r\n\t\t}\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//draws the ball on the passed p5 canvas\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.drawZone = function(){\r\n\t\tthis.canvas.push();\r\n\t\tif(this.color != null){\r\n\t\t\tthis.canvas.fill(this.color);\r\n\t\t}\r\n\t\tthis.canvas.ellipse(this.pos.x,this.pos.y,this.r * 2,this.r * 2);\r\n\t\tthis.canvas.pop();\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//draws the img on the passed p5 canvas\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.drawImg = function(){\r\n\t\tthis.canvas.push();\r\n\t\tthis.canvas.translate(this.pos.x, this.pos.y);\r\n\t\tthis.canvas.rotate(this.angle);\r\n\t\tthis.canvas.image(this.img,-this.r,-this.r,this.r * 2,this.r * 2);\r\n\t\tthis.canvas.pop();\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//draws a ship body onto the attached p5 canvas\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.drawShip = function(){\r\n\t\tthis.canvas.push();\r\n\t\tif(this.color != null){\r\n\t\t\tthis.canvas.fill(this.color);\r\n\t\t}\r\n\t\t\r\n\t\t//this.canvas.rect(this.p1().x,this.p1().y,this.w,this.h);\r\n\t\tthis.canvas.translate(this.pos.x,this.pos.y);\r\n\t\tthis.canvas.rotate(this.angle + (.5 * PI));\r\n\t\tthis.canvas.stroke(0);\r\n\t\tthis.canvas.triangle(this.body[0],this.body[1],this.body[2],this.body[3],this.body[4],this.body[5]);\r\n\t\tthis.canvas.stroke(255);\r\n\t\tthis.canvas.line(this.body[2],this.body[3],this.body[4],this.body[5]);\r\n\t\tthis.canvas.line(this.body[0],this.body[1],this.body[4],this.body[5]);\r\n\t\tthis.canvas.line(this.body[0],this.body[1],this.body[6],this.body[7]);\r\n\t\tthis.canvas.line(this.body[2],this.body[3],this.body[6],this.body[7]);\r\n\t\tthis.canvas.pop();\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//returns true if this ball intersects with another ball\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.circInt = function(ball){\r\n\t\treturn dist(this.pos.x,this.pos.y,ball.pos.x,ball.pos.y) < (this.r + ball.r);\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//returns true if this ball intersects with a specified point\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.pointInt = function(x,y){\r\n\t\treturn circPointInt(x,y,this);\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//sets new velocity vector based on a perfect elastic collision\r\n//with another ball\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.collision = function(ball){\r\n\t\t//calculations\r\n\t\tvar a1 = angle(this.pos.x,this.pos.y,ball.pos.x,ball.pos.y);\r\n\t\tvar a2 = angle(ball.pos.x,ball.pos.y,this.pos.x,this.pos.y);\r\n\t\tvar m1 = ((this.m - ball.m) / (this.m + ball.m) * this.vel.magnitude()) + ((2*ball.m / (this.m + ball.m)) * ball.vel.magnitude());\r\n\t\tvar m2 = ((ball.m - this.m) / (this.m + ball.m) * ball.vel.magnitude()) + ((2*this.m / (this.m + ball.m)) * this.vel.magnitude());\r\n\t\t\r\n\t\t//assignments\r\n\t\tthis.vel.setAngle(a2);\r\n\t\tball.vel.setAngle(a1);\r\n\t\tthis.vel.multiplyScalar(m1 * this.inelastic);\r\n\t\tball.vel.multiplyScalar(m2 * this.inelastic);\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//sets new velocity vector based on an imperfect elastic collision\r\n//with another ball\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.collision2 = function(ball){\r\n\t\t//calculations\r\n\t\tvar a1 = angle(this.pos.x,this.pos.y,ball.pos.x,ball.pos.y);\r\n\t\tvar a2 = angle(ball.pos.x,ball.pos.y,this.pos.x,this.pos.y);\r\n\t\tvar mTot = (this.m * this.vel.magnitude()) + (ball.m * ball.vel.magnitude());\r\n\t\tvar m1 = (mTot / 2) / this.m;\r\n\t\tvar m2 = (mTot / 2) / ball.m;\r\n\t\t\r\n\t\t//assignments\r\n\t\tthis.vel.setAngle(a2);\r\n\t\tball.vel.setAngle(a1);\r\n\t\tthis.vel.multiplyScalar(m1 * this.inelastic);\r\n\t\tball.vel.multiplyScalar(m2 * this.inelastic);\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//checks to see if force is applied\r\n//adds gravity to force vector\r\n//converts force vector to acceleration vector\r\n//changes velocity vector with acceleration vector\r\n//applies friction\r\n//changes pos vector by vel vector\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.move = function(){\r\n\t\tthis.f.set(0,0); //initializes force vector\r\n\t\tif(this.isPushed){\r\n\t\t\tthis.f.setAngle(this.angle); //find angle/direction of force\r\n\t\t\tthis.f.multiplyScalar(this.force); //applies magnitude of force\r\n\t\t}\r\n\t\tif(this.spin != 0){\r\n\t\t\tvar tempAngle = this.vel.getAngle();\r\n\t\t\tvar tempSpeed = this.vel.magnitude();\r\n\t\t\t\r\n\t\t\tthis.vel.setAngle(tempAngle + this.spin);\r\n\t\t\tthis.vel.multiplyScalar(tempSpeed);\r\n\t\t}\r\n\t\tthis.a.setVector(this.f); //copies f to a\r\n\t\tthis.a.multiplyScalar(1/this.m); //corrects force by applying mass to a=F/m\r\n\t\tthis.a.add(this.g);//applies gravity\r\n\t\tthis.vel.add(this.a); //adds acceleration to velocity\r\n\t\tthis.vel.multiplyScalar(1 - this.friction); //applies friction\r\n\t\tthis.spin = this.spin * (1 - this.spinFriction);\r\n\t\tthis.speedLimit();\r\n\t\tthis.pos.add(this.vel); //makes new position\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//used to push the ball once\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.push = function(){\r\n\t\tthis.isPushed = true;\r\n\t\tthis.move();\r\n\t\tthis.isPushed = false;\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//will wrap the ball around the screen when a boundary is hit\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.wrap = function(){\r\n\t\tif((this.pos.x - this.r) > this.canvas.width){\r\n\t\t\tthis.pos.x = -this.r;\r\n\t\t}else if((this.pos.x + this.r) < 0){\r\n\t\t\tthis.pos.x = this.canvas.width + this.r;\r\n\t\t}\r\n\t\t\r\n\t\tif((this.pos.y - this.r) > this.canvas.height){\r\n\t\t\tthis.pos.y = -this.r;\r\n\t\t}else if((this.pos.y + this.r) < 0){\r\n\t\t\tthis.pos.y = this.canvas.height + this.r;\r\n\t\t}\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//will rebound the ball when a screen boundary is reached\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.rebound = function(){\r\n\t\tif((this.pos.x + this.r) > this.canvas.width){\r\n\t\t\tthis.pos.x = this.canvas.width - this.r;\r\n\t\t\tthis.vel.x = -this.vel.x * this.inelastic;\r\n\t\t}else if((this.pos.x - this.r) < 0 && this.vel.x < 0){\r\n\t\t\tthis.pos.x = this.r;\r\n\t\t\tthis.vel.x = -this.vel.x * this.inelastic;\r\n\t\t}\r\n\t\t\r\n\t\tif((this.pos.y + this.r) > this.canvas.height){\r\n\t\t\tthis.pos.y = this.canvas.height - this.r;\r\n\t\t\tthis.vel.y = -this.vel.y * this.inelastic;\r\n\t\t}else if((this.pos.y - this.r) < 0){\r\n\t\t\tthis.pos.y = this.r;\r\n\t\t\tthis.vel.y = -this.vel.y * this.inelastic;\r\n\t\t}\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//redistributes the velocity vector's x/y magnitude when maxSpeed is\r\n//reached\r\n/////////////////////////////////////////////////////////////////////\r\n\tthis.speedLimit = function(){\r\n\t\tif(this.maxSpeed){\r\n\t\t\tif(this.vel.magnitude() > this.maxSpeed){\r\n\t\t\t\tthis.vel.setAngle(this.vel.getAngle());\r\n\t\t\t\tthis.vel.multiplyScalar(this.maxSpeed);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n/////////////////////////////////////////////////////////////////////\r\n//returns a string containing the parameters of a Ball\r\n/////////////////////////////////////////////////////////////////////\t\r\n\tthis.print = function(){\r\n\t\treturn this.pos.x + \" / \" + this.pos.y + \" / \" + this.r;\r\n\t}\r\n}", "title": "" }, { "docid": "04fc818e0b0ac2c0d35b1523878ba9a2", "score": "0.6062886", "text": "subClassUpdate()\n {\n if (Math.abs(this.x - this.startX) > 300)\n {\n this.isDead = true;\n }\n if (this.isHeadingRight)\n {\n this.x += this.game.clockTick * this.speed;\n } else\n {\n this.x -= this.game.clockTick * this.speed;\n }\n\n this.boundX = this.x + 19;\n this.boundY = this.y + 21;\n if (this.isHeadingRight)\n {\n this.boundX = this.x + 17.5;\n this.boundY = this.y + 20;\n }\n this.updateMyHitBoxes();\n }", "title": "" }, { "docid": "c91650eded41860d5f740d8b8ca035c6", "score": "0.6060861", "text": "function Boss2(spriteTexture, bullet) {\n this.kDelta = 0.3;\n this.kYDelta = 130;\n this.kYMDelta = 180;\n\n this.width = 10;\n this.height = 10;\n this.kRwidth = 6;\n this.kRheight = 8;\n\n this.mBarrageSet = [];\n this.target = null;\n\n this.mBoss2 = new SpriteAnimateRenderable(spriteTexture);\n this.mBoss2.setColor([1, 1, 1, 0]);\n this.mBoss2.getXform().setPosition(150, 45);\n this.mBoss2.getXform().setSize(this.width, this.height);\n // this.mBoss2.setElementPixelPositions(0, 120, 0, 180);\n this.mBoss2.setElementPixelPositions(0, 512, 2950, 3562);\n\n // this.mBoss2.setSpriteSequence(512, 0, // first element pixel position: top-left 512 is top of image, 0 is left of image\n // 566, 512, // widthxheight in pixels\n // 3, // number of elements in this sequence\n // 0); // horizontal padding in between\n // this.mBoss2.setAnimationType(SpriteAnimateRenderable.eAnimationType.eAnimateSwing);\n // this.mBoss2.setAnimationSpeed(15);\n\n // this.mRDye = new SpriteAnimateRenderable(spriteTexture);\n // this.mRDye.setColor([1, 1, 1, 0]);\n // this.mRDye.getXform().setPosition(35, 50);\n // this.mRDye.getXform().setSize(this.width, this.height);\n // // this.mBoss2.setElementPixelPositions(0, 120, 0, 180);\n // // this.mRDye.setElementPixelPositions(120, 0, 0, 180);\n // this.mRDye.setSpriteSequence(1024, 0, // first element pixel position: top-left 512 is top of image, 0 is left of image\n // 566, 512, // widthxheight in pixels\n // 3, // number of elements in this sequence\n // 0); // horizontal padding in between\n // this.mRDye.setAnimationType(SpriteAnimateRenderable.eAnimationType.eAnimateSwing);\n // this.mRDye.setAnimationSpeed(15);\n //\n //\n // this.mRDye.mXform = this.mBoss2.getXform();\n // this.mRDye.mColor = this.mBoss2.getColor();\n\n // this.mPackSet = new GameObjectSet();\n this.kMinionSprite = spriteTexture;\n this.kBullet = bullet;\n\n this.kLastFireTime = 0;\n //Rate in per second\n this.kfireRate = 5;\n\n this.health = 13;\n this.death = false;\n\n GameObject.call(this, this.mBoss2);\n\n // var r = new RigidRectangle(this.getXform(), this.kRwidth, this.kRheight);\n // // r.setMass(.18); // less dense than Minions\n // // r.setMass(0.16); // less dense than Minions\n // r.setMass(0); // less dense than Minions\n // r.setRestitution(0);\n // // r.toggleDrawBound();\n // this.toggleDrawRigidShape();\n // // r.setColor([0, 1, 0, 1]);\n // // r.setDrawBounds(true);\n // this.setRigidBody(r);\n\n this.setCurrentFrontDir(vec2.fromValues(0, 1));\n this.setSpeed(0);\n\n this.jump = false;\n this.invincible = false;\n\n this.reach = true;\n this.stay = 0;\n this.nextPos = this.getXform().getPosition();\n\n this.currentBarrageType = BARRAGE_TYPE.CIRCLE;\n\n}", "title": "" }, { "docid": "7d94bd9d1629df1b43cebb8f623ea938", "score": "0.6056937", "text": "function start(){\n\tball = new Circle(20);\n\tball.setPosition(100, 100);\n\tadd(ball);\n\t\n\tsetTimer(draw, 20);\n}", "title": "" }, { "docid": "e3a89550ad0c3c3248929494afc6d37d", "score": "0.60564345", "text": "move() {\n this.bodyX = this.bodyX + this.Xspeed;\n this.bodyY = this.bodyY + this.Yspeed;\n }", "title": "" }, { "docid": "99cdb5608bc9e96f83d57c62baa756c7", "score": "0.6053405", "text": "start() {\n // Add to active Loaders\n Loader.add(this);\n var screen = $(document).rectangle();\n var r = this.element.rectangle();\n r = r.center(screen);\n // Position on the center\n this.element.css({\n top: -this.element.height() - 10,\n left: r.left,\n opacity: 0\n });\n /// Update Layout\n Loader.update();\n }", "title": "" }, { "docid": "871fa583458733844b94f43045109fcf", "score": "0.6047622", "text": "constructor(x, y, s)\n {\n this.posX = x;\n this.posY = y;\n this.size = s;\n this.travelX = 0;\n this.travelY = 0;\n this.drag;\n this.ballType;\n }", "title": "" }, { "docid": "26722755f1ae4b992c12e0dbabc86aeb", "score": "0.60451025", "text": "update () {\n if (this.target !== null && this.worldRect !== null) {\n if (this.target.position[0] - this.x + this.xDeadZone > this.width) {\r\n this.x = this.target.position[0] - (this.width - this.xDeadZone)\n } else if (this.target.position[0] - this.xDeadZone < this.x) {\r\n this.x = this.target.position[0] - this.xDeadZone\n }\r\n\r\n if (this.target.position[1] - this.y + this.yDeadZone > this.height) {\r\n this.y = this.target.position[1] - (this.height - this.yDeadZone)\n } else if (this.target.position[1] - this.yDeadZone < this.y) {\r\n this.y = this.target.position[1] - this.yDeadZone\n }\r\n\r\n this.viewportRect.set(this.x, this.y)\n\r\n if (!this.viewportRect.within(this.worldRect)) {\r\n if (this.viewportRect.left < this.worldRect.left) {\r\n this.x = this.worldRect.left\n }\r\n if (this.viewportRect.top < this.worldRect.top) {\r\n this.y = this.worldRect.top\n }\r\n if (this.viewportRect.right > this.worldRect.right) {\r\n this.x = this.worldRect.right - this.width\n }\r\n if (this.viewportRect.bottom > this.worldRect.bottom) {\r\n this.y = this.worldRect.bottom - this.height\n }\r\n }\r\n }\n }", "title": "" }, { "docid": "3b9dc7ceb3bd3efc26a06c0816d9a849", "score": "0.6039981", "text": "moveBall(){\n\t\tthis.x = this.x+ this.speed;\n\t\tthis.y = this.y+.5;\n\t}", "title": "" }, { "docid": "2dbddce4c6941b004cccdd83e5023c90", "score": "0.6031372", "text": "function Ball(id, x, y, minX, maxX, minY, maxY, velocity) {\n const _element = document.getElementById(id);\n let _x = x;\n let _y = y;\n const _minX = minX;\n const _maxX = maxX;\n const _minY = minY;\n const _maxY = maxY;\n let _velocity = velocity;\n\n /**\n * Function to move the ball within the container\n */\n this.move = function() {\n _x += _velocity.x;\n if (_x < _minX) { // Prevent move to the left if the ball is already on the left edge\n _x = _minX;\n _velocity.x = -_velocity.x;\n }\n if (_x > _maxX) { // Prevent move to the right if the ball is already on the right edge\n _x = _maxX;\n _velocity.x = -_velocity.x;\n }\n _y += _velocity.y;\n if (_y < _minY) { // Hide the ball if it moves to the floor\n _element.style.display = 'none';\n }\n if (_y > _maxY) { // Prevent move to the bottom if the ball is already on the top edge\n _y = _maxY;\n _velocity.y = -_velocity.y;\n }\n };\n\n /**\n * Change velocity to simulate reflection along x-axis\n */\n this.reflectX = function() {\n _velocity.x = -_velocity.x;\n };\n\n /**\n * Change velocity to simulate reflection along y-axis\n */\n this.reflectY = function() {\n _velocity.y = -_velocity.y;\n };\n\n /**\n * Function to render paddle\n */\n this.render = function() {\n _element.style.left = _x + 'px';\n _element.style.bottom = _y + 'px';\n };\n\n /**\n * Get x cordinates of the center of the ball\n */\n this.getXCenter = function() {\n return _x + 10;\n };\n\n /**\n * Get x cordinates of the left of the ball\n */\n this.getX = function() {\n return _x;\n };\n\n /**\n * Get y cordinates of the bottom of the ball\n */\n this.getY = function() {\n return _y;\n };\n\n /**\n * Function to set velocity of the ball\n */\n this.setVelocity = function(velocity) {\n _velocity = velocity;\n };\n\n /***\n * Check if the ball has already dropped on the floor\n */\n this.dropped = function() {\n return _y < 1;\n };\n}", "title": "" }, { "docid": "cccdfd6f81c7e9bcf692fae7cf7fbf61", "score": "0.60258186", "text": "update(){\r\n\r\n //timer\r\n if(this.timerSprite.body.center.x < 140 ) {\r\n this.timerSprite.body.velocity.x = 4000;\r\n }else{\r\n this.timerSprite.body.velocity.x = 0;\r\n }\r\n //banner\r\n if(this.order.body.center.x < 590 ) {\r\n this.order.body.velocity.x = 4000;\r\n }else{\r\n this.order.body.velocity.x = 0;\r\n }\r\n if(this.timerSprite.body.center.x > 200 ) { this.timerSprite.setPosition(200, 255); }\r\n if(this.order.body.center.x > 630 ){ this.order.setPosition(630, 275); }\r\n\r\n\r\n\r\n if(this.leftStatut == 1){\r\n this.eggLeft.setPosition(this.pointer.x, this.pointer.y);\r\n }\r\n if(this.rightStatut == 1){\r\n this.eggRight.setPosition(this.pointer.x, this.pointer.y);\r\n }\r\n\r\n }", "title": "" }, { "docid": "920445104009d6c3ae4e191d2eb78628", "score": "0.60256845", "text": "update(delta) {\n //handle input, and store it in a Vector\n let movementVector = new Vector(0, 0)\n if (util.keyboard[\"ArrowUp\"]) {\n movementVector.y -= 1;\n }\n if (util.keyboard[\"ArrowDown\"]) {\n movementVector.y += 1;\n }\n if (util.keyboard[\"ArrowLeft\"]) {\n movementVector.x -= 1;\n }\n if (util.keyboard[\"ArrowRight\"]) {\n movementVector.x += 1;\n }\n\n //normalize the vector so that the player \n //doesn't move faster diagonally\n movementVector.normalize();\n\n //multiply with delta so it remaines consistent\n this.x += movementVector.x * this.speed * delta;\n this.y += movementVector.y * this.speed * delta;\n\n //clamp the position to a valid place on the canvas\n this.x = Math.min(this.canvas.width - 50,\n Math.max(this.x, 0));\n this.y = Math.min(this.canvas.height - 80,\n Math.max(this.y, 0));\n\n //increase shootTimer with delta\n if (this.shootTimer < this.shootCooldown) {\n this.shootTimer += delta;\n }\n\n //if all conditions are met, fire\n //the bullet class is impemented further down\n if (util.keyboard[\"z\"] && this.shootTimer >= this.shootCooldown) {\n this.shootTimer = 0; // reset the timer\n let bullet = new Bullet(world); // create a bullet\n bullet.x = this.x + 22.5; // set its coordinates\n bullet.y = this.y;\n bullet.speed = -500; // set its speed\n bullet.layer = ENEMY_COLL; //we want it to collide with enemies\n console.log(bullet.layer)\n }\n }", "title": "" }, { "docid": "aa3f6b905ad6546829aeb4a4ff1cf01d", "score": "0.60154307", "text": "loop() {\n super.loop();\n super.generateTrajectoryParams(trajectoryParameters[super.currentRounds][gameRandomization.HEIGHT],Height);\n this.createLauncher(images[gameImage.BALLBOX]);\n let paddleBoxColor = super.Utils.blueColor;\n ball = super.ball;\n if(super.ball.state === 'start'){\n this.ballObject();\n super.ball.position.y = (1.291 )* super.Utils.SCALE;\n if (super.gameState.startTime > 0 && super.getElapsedTime(super.gameState.startTime) > TRAVEL_TIME ){\n sounds[gameSound.START].play();\n }\n\n if(super.gameState.initialTime > 0 && super.isOutsideBox()){\n super.gameState.initialTime = new Date().getTime();\n super.gameState.startTime = new Date().getTime();\n sounds[gameSound.START].pause();\n sounds[gameSound.START].currentTime = 0;\n paddleBoxColor = super.Utils.redColor;\n super.createPaddleBox(paddleBoxColor);\n\n }\n\n if (super.gameState.initialTime > 0 && super.getElapsedTime() > jitterT) {\n sounds[gameSound.START].pause();\n sounds[gameSound.START].currentTime = 0;\n soundTimeStamp = super.getElapsedTime();\n super.gameState.initialTime = new Date().getTime();\n super.ball.state = 'fall';\n }\n\n }\n\n\n if(super.ball.state === 'fall'){\n if(super.gameState.initialTime > 0 && super.getElapsedTime() <= TRAVEL_TIME) {\n super.ball.positions.push(super.ball.position.y);\n super.trajectory();\n }\n\n if(super.gameState.initialTime > 0 && super.ballIsOnFloor()) {\n super.ball.state = 'hit';\n }\n\n }\n\n\n let hitTheTarget = this.collisionDetection();\n let hitTheWall = super.wallCollision();\n\n if((hitTheTarget || hitTheWall) && super.ball.state === 'fall'){\n\n super.ball.state = 'hit';\n }\n\n\n\n if (super.ball.state === 'hit') {\n\n\n if (super.ball.hitstate === 'very good') {\n\n super.increaseScore();\n // Limit consecutive sounds to 10 only\n if (consecutiveCounts > 10) {\n consecutiveCounts = 10;\n }\n //start from second count to make different sound from regular catch\n if(consecutiveCounts === 0){\n consecutiveCounts = 2;\n }\n catchSeriesSounds[consecutiveCounts].play();\n super.ball.radius = 0;\n\n }else if(super.ball.hitstate === 'good'){\n super.ball.radius = 0;\n consecutiveCounts = 0;\n catchSeriesSounds[consecutiveCounts].play();\n\n }else{\n consecutiveCounts = 0;\n sounds[gameSound.FAIL].play();\n }\n\n this.dataCollection();\n super.ball.state = 'done';\n\n }\n\n\n if(super.ball.state === 'done'){\n\n\n if (super.ball.hitstate === 'very good') {\n this.starsLocationUpdate();\n super.drawImageObject(targetStars,images[gameImage.STARS]);\n\n }\n\n // Remove super.ball and show in the starting point,\n //User should set the paddle to initial position , call stop after that\n super.paddleAtZero(false);\n\n }\n if( super.ball.hitstate !== 'good' && super.ball.hitstate !== 'very good' ) {\n this.drawBall( images[gameImage.BALL]);\n }\n obstructions.forEach(obstruction => super.drawImage(obstruction, obstruction.image));\n this.basketObject();\n super.createPaddleBox(paddleBoxColor,true);\n super.paddleMove();\n super.drawImageObject(super.paddle,images[gameImage.PADDLE]);\n\n }", "title": "" }, { "docid": "8b4b5c5f5587f226c88f73684923f52d", "score": "0.601269", "text": "function startGame() {\n birdBottom -= gravity;\n bird.style.bottom = birdBottom + 'px'\n bird.style.left = birdLeft + 'px'\n }", "title": "" }, { "docid": "9eccd550104b18e26109d1b3951d5d8c", "score": "0.60118836", "text": "constructor(spriteImage = 'images/enemy-bug.png', x= 100, y=preset.Ypos[0], speed = 1000){\n //properties\n this.spriteImage = spriteImage;\n this.x = x;\n this.y = y;\n this.speed = speed;\n }", "title": "" }, { "docid": "0817b827d8b54ce98e1da8ad310a181e", "score": "0.6011386", "text": "function loadingInitialize() {\n \n //define loading screen graphics\n loadProgressLabel = new createjs.Text(\"\",\"48px PixelFont3\",\"black\");\n loadingScreenFill = new createjs.Shape();\n loadProgressLabel.lineWidth = 2000;\n loadProgressLabel.textAlign = \"center\";\n loadProgressLabel.x = screen_width/2;\n loadProgressLabel.y = screen_height/2 - 20;\n\n //Fill background with gray\n loadingScreenFill.graphics.beginFill(\"#000000\").drawRect(0,0,screen_width,screen_height).endFill();\n\n bellSpriteSheet = new createjs.SpriteSheet( {\n // all main strings are reserved strings (images, frames, animations) that do a specific task\n \"images\": [\"images/bell.png\"],\n \"frames\": {height: 46, width: 44, regX: 21, regY: 0},\n \"animations\": {\n \"idle\": [0],\n \"initial\": [0, 3, true, 10/60],\n \"ringing\": [4, 5,\"ringing\", 5/60]\n }\n });\n\n bellSprite = new createjs.Sprite(bellSpriteSheet, \"ringing\");\n bellSprite.setTransform(screen_width/2,screen_height/2 + 20,1,1);\n\n stage.addChild(loadingScreenFill, loadProgressLabel, bellSprite);\n\n}", "title": "" }, { "docid": "a024511a0971fdbaf2cde0427a3388a7", "score": "0.6010054", "text": "function middleStart(){\r\n pongBallX = canvasWidth /2;\r\n pongBallY = canvasHight /2;\r\n}", "title": "" }, { "docid": "4d19a743f5de2b299d4a38671c37493b", "score": "0.6009201", "text": "update() {\n this.x = 200;\n this.y = 410;\n\n }", "title": "" }, { "docid": "274537c87c242d841912298ceadfade0", "score": "0.59997857", "text": "moveBullet(){\n this.posY -= this.vy;\n }", "title": "" }, { "docid": "a2e464d4fcacba253a430be7e4aabb2f", "score": "0.5996386", "text": "function init() { \n\n\tplayer.x = player.width;\n\tplayer.y = (HEIGHT - player.height)/2;\n\tai.x = WIDTH - (player.width + ai.width);\n\tai.y = (HEIGHT - ai.height)/2;\n\tball.serve(1);\n}", "title": "" }, { "docid": "870b379a166d27296becad0d7996352a", "score": "0.599047", "text": "begin() {\n //add a random offset to the spawn x value\n var random = Math.floor(Math.random() * 500); //creates either 0, 1, or 3\n\n this.x = 640 + random;\n this.y = 370;\n this.active = true;\n console.log(\"Obstacle \" + this.type + \" movement begun\");\n }", "title": "" }, { "docid": "ee837a4a167d0f41db1385b848c0d895", "score": "0.59897584", "text": "constructor() {\n super(resources.pixie.texture);\n this.anchor.set(0.5, 0.5);\n this.scale.set(0.6, 0.6);\n this.position.set(300, 300);\n //gameItemsArray.push(this);\n this._lastJump = Date.now();\n this._canJump = true;\n this._vy = 0;\n this._ay = 0.3;\n this._maxRot = Math.PI / 2 - 1;\n this._minRot = -Math.PI / 10;\n this._points = 0;\n this._isDead = false;\n }", "title": "" }, { "docid": "c9ca1c0a885414b273f7be20f16e9954", "score": "0.59880495", "text": "display(){\r\n //adding and setting the position of the ground\r\n var pos =this.body.position;\r\n rectMode(CENTER);\r\n //giving the ground a color as brown\r\n fill(\"brown\");\r\n rect(pos.x, pos.y, this.width, this.height);\r\n }", "title": "" }, { "docid": "743f808a3fbc07b9ea289f88cc2a7833", "score": "0.5987583", "text": "function Ship() {\n //position on screen (start)\n this.x = cW * 0.5;\n this.y = cH * 0.5;\n //angular movement\n this.a = (Math.PI * 0.5)\n this.rotation = 0;\n //forward movement\n this.thrusting = false;\n this.thrust_x = 0;\n this.thrust_y = 0;\n this.friction = 0.7;\n \n this.render = function() {\n this.a += this.rotation;\n\n if(this.thrusting == true) {\n this.thrust_x += Math.cos(this.a) * 7.5 / FPS;\n this.thrust_y -= Math.sin(this.a) * 7.5 / FPS;\n } \n else {\n this.thrust_x -= this.friction * this.thrust_x / FPS;\n this.thrust_y -= this.friction * this.thrust_y /FPS;\n }\n this.x += this.thrust_x;\n this.y += this.thrust_y;\n\n context.strokeStyle = 'snow';\n context.lineWidth = 2;\n context.beginPath();\n context.moveTo(\n this.x + (Math.cos(this.a) * 20),\n this.y - (Math.sin(this.a) * 20)\n );\n context.lineTo(\n this.x - (Math.cos(this.a) + Math.sin(this.a)) * 13.2,\n this.y + (Math.sin(this.a) - Math.cos(this.a)) * 13.2\n );\n context.lineTo(\n this.x - (Math.cos(this.a) - Math.sin(this.a)) * 13.2,\n this.y + (Math.sin(this.a) + Math.cos(this.a)) * 13.2\n );\n context.closePath();\n context.stroke();\n\n context.fillStyle = 'red';\n context.fillRect(this.x, this.y, 2, 2);\n\n //edge of screen\n if(this.x > cW - 5) {\n this.x = 0 - 5;\n } \n else if (this.x < 0) {\n this.x = cW + 5;\n }\n if(this.y > cH + 5) {\n this.y = 0 - 5;\n }\n else if(this.y < 0 - 5) {\n this.y = cH + 5;\n }\n }\n }", "title": "" }, { "docid": "935a7d00e0ba2d56d3393a4b0971b8b8", "score": "0.5984888", "text": "constructor(startX, startY, color = 'red'){\n this.dx = 1;\n this.dy = 0;\n this.body = [[startX, startY]];\n this.color = color;\n this.status = 'alive';\n }", "title": "" }, { "docid": "b649019ff45a9f0dff63a98e5f8e374d", "score": "0.59842724", "text": "bounceBall3(){\n if (this.y < p2.py+60 && this.y > p2.py-60 && this.x > p2.px-10) {\n this.speedx = -this.speedx;\n }\n }", "title": "" }, { "docid": "f8049e6ced93ed3b4d321860f5bbb5e3", "score": "0.5982692", "text": "function Sprite(xPos, yPos, radius, color = \"red\", xVel = 0, yVel = 0) {\n this.xPos = xPos;\n this.yPos = yPos;\n this.radius = radius;\n this.ballColor = color;\n this.xVel = xVel;\n this.yVel = yVel;\n}", "title": "" }, { "docid": "2acf7021ee32413555771a509ff2026b", "score": "0.5982538", "text": "function draw() {\n // frameRate(30);\n background(150);\n //ground\n fill('brown');\n girl.scale=.3\n blocks.scale=.5;\n blocks2.scale=.5;\n blocks3.scale=.5;\n ball.scale=.4;\n\n\n ground = rect(0,720,1200,1200);\n girl.velocity.y += GRAVITY;\n ball.velocity.y += GRAVITY;\n if(keyIsDown(65)) {\n girl.changeAnimation('run');\n girl.mirrorX(-1);//flipping\n girl.velocity.x = -5;\n }\n else if(keyIsDown(68)) {\n girl.changeAnimation('run');\n girl.mirrorX(1); //un-flip\n girl.velocity.x = 5;\n }else{\n girl.changeAnimation('idle');\n girl.velocity.x = 0;\n run.rewind();\n }\n if(keyIsDown(69)) {\n girl.changeAnimation('melee');\n girl.velocity.x = 0;\n }\n else{\n melee.rewind();\n }\n if(keyIsDown(74)){\n girl.changeAnimation('shoot');\n girl.velocity.x = 0;\n }\n else{\n shoot.rewind();\n }\n /////////--- gravity\n if(girl.position.y > 700 ) {\n girl.velocity.y = 0;\n }else{\n girl.changeAnimation('jump');}\n if(ball.position.y > 740){\n ball.velocity.y = 0;\n }\n ////////--- loop screen\n // ball.x = ball.x+5;\n\n print(ball.x);\n if(keyIsDown(32)){\n girl.changeAnimation('jump');\n girl.velocity.y = -JUMP;\n }\n if(keyIsDown(88)){\n girl.changeAnimation('dead');\n dead.goToFrame(dead.getLastFrame());\n }else{\n dead.rewind();\n }\n // if(keyIsDown(190)){\n // girl.scale += 0.05;\n // }\n // if(keyIsDown(188)){\n // girl.scale -= 0.05;\n // }\n\n\n //draw the sprite\n drawSprites();\n text('A,D= left,right', 10,20);\n text('E= Melee Attack', 10,40);\n text('<,>= Zoom In/Out --(disabled)', 10,60);\n text('Space Bar= Jump', 10,80);\n text('J= Shoot', 10,100);\n text('X = die', 10,120);\n text(\"Left mouse = hitbox\", 10, 140);\n\n ///--------------------------------------------------------------///\n\n girl.collide(blocks);\n girl.collide(blocks2);\n girl.collide(blocks3);\n ball.collide(blocks);\n ball.collide(blocks2);\n ball.collide(blocks3);\n\n girl.displace(ball);\n\n\n girl.debug = mouseIsPressed;\n blocks.debug = mouseIsPressed;\n blocks2.debug = mouseIsPressed;\n blocks3.debug = mouseIsPressed;\n ball.debug = mouseIsPressed;\n\n}", "title": "" }, { "docid": "e94c849580571467b300628ec38ada7a", "score": "0.59780085", "text": "function Bomb(x, y , velocity) {\n this.x = x;\n this.y = y;\n this.velocity = velocity;\n}", "title": "" }, { "docid": "6ece8c4fe9ce2d0676f4dd09e4f0cc0a", "score": "0.5977436", "text": "function Ball() {\r\n this.x = canvas.width/2;\r\n this.y = canvas.height-10;\r\n /*this.xSpeed = -2;\r\n this.ySpeed = 3;*/\r\n}", "title": "" }, { "docid": "f8a99746a1dd6e498c6cc64abda30ef6", "score": "0.59762657", "text": "bounceBall2(){\n if (this.y < p1.py+60 && this.y > p1.py-60 && this.x < p1.px+10) {\n this.speedx = -this.speedx;\n }\n }", "title": "" }, { "docid": "b9b7ef7237f5c351923a92fe467160e9", "score": "0.59748733", "text": "constructor(game, x, y, initVelocity, bulletAssetName, frame) {\n super(game, x, y, 'enemybasic', frame);\n\n this.game.physics.arcade.enableBody(this);\n this.body.velocity.set(initVelocity.x, initVelocity.y);\n this.enemyType = \"basic\";\n\n this.initVelocity = initVelocity;\n this.raycaster = new Raycaster();\n this.losToPlayer = null;\n this.maxTimeToFire = 800; //In milliseconds\n this.timeToFire = Infinity;\n this.maxTimeToSee = 400; //In milliseconds\n this.timeToSee = Infinity;\n this.isShooting = false;\n this.oldVelocity = this.body.velocity.clone();\n\n this.animations.add('right', [0,1,2], 5);\n this.animations.add('left',[3,4,5],5);\n\n this.weapon = game.add.weapon(2, bulletAssetName);\n this.weapon.bulletKillType = Phaser.Weapon.KILL_CAMERA_BOUNDS;\n this.weapon.bulletSpeed = 2000;\n this.weapon.bulletGravity.set(0);\n this.weapon.trackSprite(this, this.width/2 , this.height/2);\n }", "title": "" }, { "docid": "cc7b7ba3e7196656f78fd43e9f7836bd", "score": "0.5973584", "text": "function changeBall_1() {\r\n var Xmin = 0;\r\n var Xmax = 1000;\r\n if (reverse_1 === false) {\r\n positionX_1 = positionX_1 + velocity_1;\r\n ball_1.style.left = positionX_1 + 'px';\r\n } else {\r\n positionX_1 = positionX_1 - velocity_1;\r\n ball_1.style.left = positionX_1 + 'px';\r\n }\r\n if ((positionX_1 + velocity_1) > Xmax || (positionX_1 - velocity_1) < Xmin) {\r\n reverse_1 = !reverse_1;\r\n }\r\n //generates random velocity\r\n velocity_1 = getRndInteger(5, 200);\r\n //generates random color\r\n ball_1.style.background = '#'+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6)\r\n //generates random number to be number to be used in height and width\r\n var randomNumber = getRndInteger(5, 100);\r\n ball_1.style.height = randomNumber + 'px';\r\n ball_1.style.width = randomNumber + 'px';\r\n \r\n}", "title": "" }, { "docid": "926141c353e25738ceb0ace5943db614", "score": "0.59689885", "text": "function Body(_ref) {\n var _this = this;\n\n var imageName = _ref.imageName,\n speed = _ref.speed;\n\n _classCallCheck(this, Body);\n\n this.x = -100; // Положение объекта\n\n this.y = -100;\n this.speed = speed; // Скорость перемещения\n\n this.velocity = new _vector__WEBPACK_IMPORTED_MODULE_0__[\"Vector\"]('left', 0); // Направление перемещения\n\n this.lastTime = 0; // Время последнего кадра\n\n this.animations = {}; // Контейнер для хранения анимаций {walk_down: .., walk_up: .. и т.д. }\n // Форма, которая будет использоваться для коллизии. Она начинается не от левого верхнего угла спрайта, а от x: 18, y: 15\n\n this.collisionShape = {\n x: 18,\n y: 15,\n width: 28,\n height: 49\n };\n this.isShooting = false;\n this.isHitting = false; // Загружаем необходмые анимации для данного персонажа\n\n var animationSheet = new _character_sheet__WEBPACK_IMPORTED_MODULE_1__[\"CharacterSheet\"]({\n imageName: imageName\n });\n 'walk_down,walk_up,walk_left,walk_right'.split(',').forEach(function (name) {\n _this.animations[name] = animationSheet.getAnimation(name); // В итоге this.animations = {walk_down: .., walk_up: .. и т.д. }\n });\n 'shoot_down,shoot_up,shoot_left,shoot_right'.split(',').forEach(function (name) {\n _this.animations[name] = animationSheet.getAnimation(name, 50, false); // второй аргумен - скорость, false - отменить повтор\n });\n 'cut_down,cut_up,cut_left,cut_right'.split(',').forEach(function (name) {\n _this.animations[name] = animationSheet.getAnimation(name, 50, false); // второй аргумен - скорость, false - отменить повтор\n });\n ['death'].forEach(function (name) {\n _this.animations[name] = animationSheet.getAnimation(name, 50, false); // второй аргумен - скорость, false - отменить повтор\n });\n this.stand('left');\n }", "title": "" }, { "docid": "9581160ed974b1fa727e92935cba76d8", "score": "0.59664446", "text": "constructor(pos) {\n this.pos = pos;\n this.size = new utils.Vector2D(25, 5);\n this.velocityX = 20;\n this.dead = false;\n }", "title": "" }, { "docid": "9540a443f635e3b3f9856f82e9a6dd59", "score": "0.5964566", "text": "start() {\n //this._barOverlay = createSprite(0, 0, \"loading_bar\");\n this._g = new PIXI.Graphics();\n this._g.beginFill(0xd0d1cc);\n this._g.drawRect(0, 0, 350, 25);\n this._genTex = Game.renderer.generateTexture(this._g);\n this._g.destroy();\n this._bar = new Game.Sprite(this._genTex);\n this.addChild(this._bar);\n this._bar.anchor = {x: 0, y: 0.5};\n this._bar.x = -this._bar.width * 0.5;\n this._bar.scale.x = 0;\n }", "title": "" }, { "docid": "a4d5be9efc37a8db39bdb27a93792d8f", "score": "0.59621614", "text": "function Target() {\n this.xPosition = 530*unit\n this.yPosition = 1032*unit\n}", "title": "" }, { "docid": "20cb0dce00e6188da77eb00067d01aaa", "score": "0.5955249", "text": "move(){\n if (this.dragging && !this.config.Lock) {\n this.sprite.setParent(this.game.app.stage);\n var newPosition = this.interaction.getLocalPosition(this.sprite.parent);\n let bounds=this.sprite.getBounds();\n this.sprite.x = newPosition.x;\n this.sprite.y = newPosition.y;\n //We can only move the object inside the stage\n //if(newPosition.x>bounds.width/2 && newPosition.x<this.game.width-bounds.width/2) this.sprite.x = newPosition.x;\n //if(newPosition.y>bounds.height && newPosition.y<this.game.height) this.sprite.y = newPosition.y;\n }\n }", "title": "" }, { "docid": "2048102bd5467a5deac114ee58aa85cd", "score": "0.59532595", "text": "function placeNewBall() {\n var availablePos = getAvailablePos();\n createBall(availablePos); // MODEL\n renderCell(availablePos, BALL_IMG); // DOM \n}", "title": "" }, { "docid": "5d1818a223d0bf86c1eaf9f04079cefd", "score": "0.5951779", "text": "constructor() {\n let random = new Random();\n this.bird = random.getRandomBird();\n this.birdImage = {\n upflap: new Image(),\n midflap: new Image(),\n downflap: new Image(),\n };\n\n this.birdImage.downflap.src = this.bird[0];\n this.birdImage.midflap.src = this.bird[1];\n this.birdImage.upflap.src = this.bird[2];\n\n this.birdHeight = 24;\n this.birdWidth = 34;\n\n this.falldown = false;\n\n this.x = 70;\n\n this.y = 220;\n\n this.velocity = 0;\n\n this.isFalling = true;\n this.hasFallen = false;\n\n this.boundryTop = 220;\n this.boundryBottom = 250;\n\n this.frame = 0;\n this.frameImage = this.birdImage.upflap;\n\n this.currentFrameNumber = 0;\n\n this.gravity = GRAVITY;\n this.upthrust = GRAVITY;\n\n this.deltaY = 50;\n this.prevY;\n }", "title": "" }, { "docid": "d34b6a020019a3ed1b365e56f67f52d7", "score": "0.5950949", "text": "display(){\n push();\n if(this.body.position.y > 580){\n Matter.Body.setPosition(this.body, {x:random(0,400), y:random(0,400)})\n }\n // if (this.body.position.y > 600){\n // console.log(\"hey\");\n // translate(this.body.position.x, this.body.position.y = -200);\n // this.body.position.y = -200;\n // this.display();\n // } else {\n // //console.log(this.body.position.y );\n translate(this.body.position.x, this.body.position.y);\n \n\n fill(\"blue\");\n circle(0, 0, this.width, this.height)\n pop();\n \n }", "title": "" }, { "docid": "82c1bc3788999543c2ec0e661f0d00bc", "score": "0.5945794", "text": "function draw() {\n background(0);\n sea.velocityX = -3;\n\n\n\nif(sea.x <0){ship.x=ship.width/2}\n\n\n drawSprites();\n}", "title": "" }, { "docid": "7ca0faf841f3603f0026e2c077b6dadf", "score": "0.59449977", "text": "constructor(game, x, y, img = null, ctx = null, scale = 3, facingRight, energized, spriteWidth = 60, spriteHeight = 60) {\n super(game, x, y, img, ctx);\n this.parentClass = \"Actor\";\n this.movementSpeed = 13;\n if (facingRight) { this.x += 100; } else { this.x -= 100 };//offset to match gun\n this.scale = scale;\n this.spriteWidth = spriteWidth;\n this.spriteHeight = spriteHeight;\n\n this.centerX = x + ((spriteWidth * scale) / 2) - spriteWidth;\n this.boundWidth = 50;\n this.boundHeight = 50;\n if (facingRight) {\n this.boundX = this.centerX - (this.boundWidth / 2) + 100; //+100 aligns with the gun\n this.boundY = this.y - this.boundHeight - (this.spriteHeight - 10); // the -10 offset accounts for the \"padding\" I added to each frame in the sprite sheet\n }\n else {\n this.boundX = this.centerX - (this.boundWidth / 2) - 100;\n this.boundY = this.y - this.boundHeight - (this.spriteHeight - 10);\n }\n\n //Stats\n if (energized) {\n this.damage = 200;\n this.health = 2;\n this.movementSpeed = 17\n }\n else {\n this.damage = 50;\n this.health = 1;\n }\n \n\n\n this.states = {\n \"green\": !energized,\n \"blue\": energized,\n \"active\": true,\n \"stablized\": false, \n \"facingRight\": facingRight,\n };\n this.animations = {\n \"green_exiting\": new Animation(this.img, [this.spriteWidth, this.spriteHeight], 3, 15, 6, 8, false, this.scale, 4),\n \"green_stable\": new Animation(this.img, [this.spriteWidth, this.spriteHeight], 3, 15, 6, 4, true, this.scale, 11),\n \"blue_exiting\": new Animation(this.img, [this.spriteWidth, this.spriteHeight], 3, 23, 6, 8, false, this.scale, 15),\n \"blue_stable\": new Animation(this.img, [this.spriteWidth, this.spriteHeight], 3, 23, 6, 3, true, this.scale, 20),\n };\n if (this.states.green) { this.animation = this.animations.green_exiting; } else { this.animation = this.animations.blue_exiting; }\n }", "title": "" }, { "docid": "22ce7bc1f9fb5b34ad5c368bce671b82", "score": "0.59430057", "text": "function instructionScreen() {\n createjs.Sound.stop();\n drumLoop.play();\n stage.removeAllChildren();\n startScreenStatus = false;\n charSelectStatus = false;\n instructionScreenStatus = true;\n instructionScreenCount = 0;\n\n var instructionBanner = new createjs.Shape(); \n instructionText = new createjs.Text(\"Press the right arrow key to move\", \"48px PixelFont3\", \"#fafcfa\");\n instructionText.x = 250;\n instructionText.y = 35;\n instructionText.textAlign = \"center\";\n instructionBanner.graphics.beginFill(\"F25050\").drawRect(0,0,screen_width,60);\n instructionBanner.alpha = 0.9;\n instructionBanner.y = 30;\n instructionBoy = new createjs.Sprite(boySpriteSheet, \"idle\");\n instructionBoy.x = 45;\n instructionBoy.y = 200;\n instructionBell = new createjs.Sprite(bellSpriteSheet, \"initial\");\n instructionBell.x = 450;\n instructionBell.y = 100;\n\n\n\n // Boy moves across the screen 2 times\n var instructionBoyAnim = new createjs.Tween.get(instructionBoy, {paused:true})\n .wait(500) //500\n .to({x:250},2000) //2500\n .wait(1000) //3500\n .to({x:45},0) \n .to({x:250},2000) //5500\n .wait(1000); //6000\n\n instructionBoyAnim.setPaused(false);\n createjs.Ticker.addEventListener(\"tick\", instructionScreenAnimation);\n\n stage.addChild(background, instructionBanner, instructionText, instructionBoy, instructionBell);\n instructionBell.gotoAndStop(\"initial\");\n stage.update();\n}", "title": "" }, { "docid": "c2f490d77b474a4939e2e7159cf3091f", "score": "0.59397876", "text": "function Hero(spriteTexture, x, y) {\n this.kDelta = 0.3;\n\n this.mDye = new SpriteRenderable(spriteTexture);\n this.mDye.setColor([1, 1, 1, 0]);\n this.mDye.getXform().setPosition(x, y);\n this.mDye.getXform().setSize(3, 4);\n this.mDye.setElementPixelPositions(0, 128, 0, 128);\n \n this.canJump = false;\n \n //this.mGameObject = new GameObject(this.mDye);\n GameObject.call(this, this.mDye);\n \n //this.mRigidBody = new RigidRectangle(this.mGameObject.getXform(), 3, 4);\n //this.setRigidBody(r);\n //this.toggleDrawRenderable();\n //this.toggleDrawRigidShape();\n \n \n \n var r = new RigidRectangle(this.getXform(), 3, 4);\n this.setRigidBody(r);\n \n //this.jumping = false;\n \n //this.toggleDrawRenderable();\n this.toggleDrawRigidShape();\n \n}", "title": "" }, { "docid": "744fcc7bb65248eac265ae77db7cb080", "score": "0.5937751", "text": "move() {\n this.y += bombSpeed; \n }", "title": "" }, { "docid": "a94bec1da39f792d41eedd6172b0ccea", "score": "0.59366137", "text": "function backCircle(x, y, xspeed, yspeed, side,color)\n{\n var div;\n this.x = x;\n this.y = y;\n this.xspeed = xspeed;\n this.yspeed = yspeed;\n this.side = side;\n this.color = color;\n this.make = function()\n {\n div = document.createElement('div');\n div.style.height = side;\n div.style.width = side;\n div.style.borderRadius = \"50%\";\n div.style.backgroundColor = this.color;\n div.style.position = \"absolute\";\n div.style.opacity=0.8;\n div.style.zIndex = 1;\n div.style.left = this.x;\n div.style.top = this.y;\n document.body.appendChild(div);\n }\n \n this.updatePosition = function()\n {\n div.style.left = div.offsetLeft+xspeed;\n if(div.offsetLeft+side+1 >= window.innerWidth || div.offsetLeft-5 <=0)\n xspeed = -xspeed;\n\n div.style.top = div.offsetTop+yspeed;\n if(div.offsetTop+side+5 >= window.innerHeight || div.offsetTop-5 <=0) //+3 because scroll bar appears when ball touches the ground\n yspeed = -yspeed;\n \n //console.log(div.offsetLeft+\" \"+xspeed+\" \"+window.innerWidth);\n \n }\n \n this.update = function()\n {\n setInterval(this.updatePosition,20);\n }\n\n\n}", "title": "" }, { "docid": "9ec6b750aae6dc18c4db0cfaa0582489", "score": "0.59354544", "text": "constructor(x,y){\n this.x = x;\n this.y = y;\n // Got this code idea from MDN website\n this.speed = Math.floor(Math.random()* Math.floor(200));\n this.sprite = 'images/enemy-bug.png';\n }", "title": "" }, { "docid": "b4fedd7cd578df1540d079720752ee84", "score": "0.59305716", "text": "function create() {\r\n // there are three physics engine. this is the basic one\r\n game.physics.startSystem(Phaser.Physics.ARCADE);\r\n\r\n // set the background\r\n var background_velocity = game_speed / 10;\r\n var background_sprite = game.add.tileSprite(0, 0, game_width, game_height, \"background\");\r\n background_sprite.autoScroll(-background_velocity, 0);\r\n\r\n // create a sprite for the player and center on start screen\r\n player = game.add.sprite(game_width/2, game_height/2, 'player');\r\n // player = game.add.sprite(player_margin, initial_height, 'jamesbond');\r\n\r\n // rotate the player slightly for uplifting visual effect\r\n game.add.tween(player).to({angle: -375}, 2000).start();\r\n\r\n // set the anchor to the middle of the sprite\r\n player.anchor.setTo(0.5, 0.5);\r\n\r\n // enable physics (gravity etc) for the player sprite\r\n game.physics.arcade.enable(player);\r\n\r\n // test whether the player sprite is still within the world bounds at each frame\r\n // and trigger the 'onOutOfBounds' event if not\r\n player.checkWorldBounds = true;\r\n\r\n // create a new group for the pipe sprites - this will allow us to easily manipulate all\r\n // pipes at once later on\r\n pipes = game.add.group();\r\n\r\n // initialise the labels for the score, instructions, and game over message\r\n label_welcome = game.add.text(game_width/2,game.height/4, \"Welcome to CCA Flappy Karate Kid!\", big_style);\r\n label_welcome.anchor.set(0.5);\r\n\r\n label_score = game.add.text(20, 20, \"\", big_style);\r\n label_score.visible = false;\r\n\r\n label_gameover = game.add.text(game.width/2,game.height/3, \"Game over!\", big_style);\r\n label_gameover.anchor.set(0.5);\r\n label_gameover.visible = false;\r\n\r\n label_endscore = game.add.text(game.width/2,game.height/2, \"\", big_style);\r\n label_endscore.anchor.set(0.5);\r\n label_endscore.visible = false;\r\n\r\n label_instructions = game.add.text(game.width/2, game.height*2/3, \"Tap or press [Space] to start\", small_style);\r\n label_instructions.anchor.set(0.5);\r\n\r\n label_reset = game.add.text(game.width/2, game.height*2/3, \"Tap or press [Space] for start screen\", small_style);\r\n label_reset.anchor.set(0.5);\r\n label_reset.visible = false;\r\n\r\n // assign the 'game_play' function as an event handler to the space key\r\n var space_key = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);\r\n space_key.onDown.add(game_play);\r\n // also allow mouse click and touch input for game play\r\n game.input.onDown.add(game_play);\r\n}", "title": "" }, { "docid": "5f2b93b6936dbda2583bfb289ddd9746", "score": "0.59302425", "text": "constructor(x,y){\n this.sprite = 'images/enemy-bug.png';\n this.speed = Math.floor(Math.random() * 250 + 1);\n this.x=x;\n this.y=y;\n\n }", "title": "" }, { "docid": "5d7c297e57eb028a738e57bfad6a461b", "score": "0.59248155", "text": "function bomb(x,y){\r\n this.x=x;\r\n this.y=y;\r\n this.directX=0;\r\n this.directY=0;\r\n this.forceX=50000;\r\n this.forceY=50000;\r\n\r\n \r\n}", "title": "" }, { "docid": "5d00adbb3838a9e648f52202a5d3403a", "score": "0.5922713", "text": "function Player(x,y, context){\n this.x = x;\n this.y = y;\n this.width = 100;\n this.height = 100;\n this.context = context;\n this.velocityX = 0.1; //pixel/segundo\n this.velocityY = 0.7; //pixel/segundo\n}", "title": "" } ]
ecfc59bba8a6d3525051f73b3ad34377
Method used to render component on the screen
[ { "docid": "58f2add7d12444456d40283915c33c16", "score": "0.0", "text": "render() {\n let width = this.props.options.width ? this.props.options.width : \"100%\";\n let height = this.props.options.height ? this.props.options.height : \"100%\";\n return (\n <canvas width={width} height={height} id={\"chart_\"+this.props.id}></canvas>\n )\n }", "title": "" } ]
[ { "docid": "ab78d9fa354b6ac0e4009651cc25af03", "score": "0.77510613", "text": "function render() {\r\n\t\tinternalRender();\r\n\t}", "title": "" }, { "docid": "67d0dc82f6ae478ce219e3424f539aca", "score": "0.7632085", "text": "render() {\n\t\t// Default components just need to scope a piece of DOM from constructor\n\t\tthis.setElement();\n\t\tsetTimeout(() => this.onRender(), 0);\n\t}", "title": "" }, { "docid": "e95563c99b16b24ff3027eebbf757d8c", "score": "0.7613526", "text": "render() { \n \n \n\n return (\n this.renderDisplay()\n )\n }", "title": "" }, { "docid": "51a402cf7e497f9bf826584edbb3ca1d", "score": "0.74267375", "text": "initComponent() {\n\t\tthis.render();\n\t}", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.73602533", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "2c530a9fe30f4cab92453aeb79d6818e", "score": "0.73312664", "text": "render() {\n this._overlayElement.render();\n }", "title": "" }, { "docid": "9fa9ba9fe37c2b554513c314b70f9ace", "score": "0.7331102", "text": "render(){\n\t\tthis.loadStyle();\n\t\tthis.renderView();\n\t}", "title": "" }, { "docid": "905643efa378981ebb9672ca9b1864c0", "score": "0.7319746", "text": "function render() {\n // utils.log('>> render');\n }", "title": "" }, { "docid": "4495412ea43192cd9ddc54e9d0d28196", "score": "0.7311582", "text": "render() {\n if (typeof this.renderer !== 'function') {\n return;\n }\n\n this.renderer(this._card, this);\n }", "title": "" }, { "docid": "4bfac131763f28196002409f7c0f8ee7", "score": "0.7310528", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "0e83e1a9a2ef87356f7c6f32a5c0e131", "score": "0.72804224", "text": "render() {\n this.initWrapper();\n this.createPrimaryButton();\n this.renderControl();\n }", "title": "" }, { "docid": "d1f66b4d4f2ef4597d51881e21e49873", "score": "0.7267764", "text": "render () {\n\n }", "title": "" }, { "docid": "be6b20d01a979a351f567ee75e7dc2ab", "score": "0.72675115", "text": "render(){\n this.element.render();\n }", "title": "" }, { "docid": "ed737dee15554ddba503b0e14eda5a5f", "score": "0.7255026", "text": "render() {\n return this.renderContent();\n }", "title": "" }, { "docid": "cee885e97eb9e1946ca3b64cb6065ff4", "score": "0.72294563", "text": "render() {\r\n return (\r\n <div>\r\n {this.renderContent()}\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "d9d1ee4434dca294ceb7cd8937e24025", "score": "0.72253174", "text": "render() {\n this.components.forEach(component => {\n component.render();\n });\n }", "title": "" }, { "docid": "18e31cc300bb9cdaf1808eed31477a00", "score": "0.7206367", "text": "render(){\n if(this.renderer){\n this.renderer.render();\n }\n }", "title": "" }, { "docid": "abed4c59cb0dfd855302006511c19c28", "score": "0.71959335", "text": "function render() {\n\t\tupdateDom();\n\t\tresizeViewport();\n\t\tupdateViewport();\n\t}", "title": "" }, { "docid": "ff16d5f039f8dec1d60e4ffdadf0a5f2", "score": "0.71776414", "text": "render(){this._overlayElement.render()}", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.7176959", "text": "function render() {}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.7170902", "text": "render() { }", "title": "" }, { "docid": "d728209645fe4b1a584e9d0b1f087a01", "score": "0.7145039", "text": "function render() {\n renderCarousel();\n renderWatchlist();\n renderActiveDetails();\n}", "title": "" }, { "docid": "b62837733878532a4cd313ceca841703", "score": "0.7138827", "text": "render(){\n return this.renderContent();\n }", "title": "" }, { "docid": "033caa30b7daaddc547a9d710baa8c0a", "score": "0.71368253", "text": "render() {\r\n\t\tthis.renderer.render(this.canvas, this.board);\r\n\t}", "title": "" }, { "docid": "0ce8474e7099560937702082d446a5c5", "score": "0.71254015", "text": "render() {\n\n }", "title": "" }, { "docid": "5db4fafc3ada1cb86c859c11b4e2b23d", "score": "0.7106242", "text": "render() {\n this.initialize();\n if (!this.disabled) {\n this.wireEvents();\n }\n this.renderComplete();\n }", "title": "" }, { "docid": "5db4fafc3ada1cb86c859c11b4e2b23d", "score": "0.7106242", "text": "render() {\n this.initialize();\n if (!this.disabled) {\n this.wireEvents();\n }\n this.renderComplete();\n }", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.7087418", "text": "render() {\n }", "title": "" }, { "docid": "697e13aafa2fd5d24bc7d724eda49106", "score": "0.7085623", "text": "render() { /* abstract */ }", "title": "" }, { "docid": "81ca7d6215c1c18a05ae9d367ad6a954", "score": "0.7083072", "text": "onRender() {}", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.7057121", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.7057121", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.7057121", "text": "render() {\n\n }", "title": "" }, { "docid": "7fd3a5f9e085d544f04e99fe7b525180", "score": "0.705605", "text": "function render() {\n\tif(!_.isUndefined(this.renderView)) {\n\t\tthis.renderView();\n\t} else {\n\t\tthrow new Error('No renderView() method found in view', this);\n\t}\n\tthis.renderSubviews();\n}", "title": "" }, { "docid": "301b221e5cdf649e08563efa82331163", "score": "0.7045351", "text": "render() {\n }", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7015002", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7015002", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "33b08d0ac50e41951e1b95fe61dfa514", "score": "0.70042294", "text": "render() {\n this.canvas.renderAll();\n }", "title": "" }, { "docid": "1d2685be416bb53c05a9c3976989c82d", "score": "0.69818777", "text": "render() {\n this.initWrapper();\n if (this.inline) {\n this.createWidget();\n }\n else {\n this.createSplitBtn();\n }\n if (!this.enableOpacity) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"addClass\"])([this.container.parentElement], HIDEOPACITY);\n }\n this.renderComplete();\n }", "title": "" }, { "docid": "bc849dd0b90b96ba1352b1722faf0c54", "score": "0.6977062", "text": "render() {\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isBlazor\"])() || !this.isServerRendered) {\n this.initialize();\n }\n this.initRender();\n this.wireEvents();\n this.setZindex();\n this.renderComplete();\n }", "title": "" }, { "docid": "207a95e51560f17ad95b20649d396817", "score": "0.69755274", "text": "render(){\r\n \r\n }", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.6966438", "text": "function render() {\n\n}", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.6966438", "text": "function render() {\n\n}", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.6966438", "text": "function render() {\n\n}", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.6966438", "text": "function render() {\n\n}", "title": "" }, { "docid": "1c9ef90affaf0edf9bf07b480e52840c", "score": "0.6954769", "text": "function render() {\n graphics.clear();\n renderer.ViewPort.render(viewPort); \n handlers.ScoreHandler.render(); \n handlers.StatusHandler.render(); \n renderer.HyperspaceBar.render(hyperspaceBar); \n renderer.Minimap.render(minimap);\n }", "title": "" }, { "docid": "bbfffa63311895aa23dcc7a687aecf5d", "score": "0.6953224", "text": "function render(){\n\n }", "title": "" }, { "docid": "9d0ac5903a27ce5bc22ab18aa38dc99b", "score": "0.6944058", "text": "render() {\n // For example:\n // console.log('The object \"' + this.holder.id + '\" is ready');\n // this.holder.style.backgroundColor = this.options.color;\n // this.holder.innerHTML = 'Hello World!';\n }", "title": "" }, { "docid": "fb0c2c5b438425e9d55b0fefcbbe8ba1", "score": "0.6940525", "text": "function renderComponent(component){\ndocument.body.innerHTML = component;\n}", "title": "" }, { "docid": "177e239645bd029cc6c1c4c907881a8c", "score": "0.69315684", "text": "render() {\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\t\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "9f65ccc5f39304837c47c5aa9b202c06", "score": "0.6930963", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "c67b6f024ac18153f5c908c0b5788a78", "score": "0.69295216", "text": "function render(){\n\t\n\trenderInput();\n\trenderOutput();\n}", "title": "" }, { "docid": "e3facdfaa11728a08ed3dc32b2e941a3", "score": "0.68996143", "text": "constructor() {\n super();\n this.render();\n }", "title": "" }, { "docid": "e3facdfaa11728a08ed3dc32b2e941a3", "score": "0.68996143", "text": "constructor() {\n super();\n this.render();\n }", "title": "" }, { "docid": "73d20d8d1b8dbd1a5b0ca3f3f0c7c9f1", "score": "0.6888385", "text": "function render() {\n //TODO just for fun try nodejs console game view\n //update our injected view\n renderFunc(store.getState(), handlers);\n }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.688604", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.688604", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.688604", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.688604", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.688604", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.688604", "text": "render() {}", "title": "" }, { "docid": "db21f22bd6dc9307145759528188582b", "score": "0.68793494", "text": "render() {\n if (this.props.controller) {\n return <this.props.controller.View />;\n }\n return this.props.prerenderedHTML.value;\n }", "title": "" }, { "docid": "7923e7f736f08fb0ef36c4dff9d8c965", "score": "0.6876517", "text": "render()\n\t{\n\t\tthis.app.render(this.app.stage)\n\t}", "title": "" }, { "docid": "fb566274d81d9a01857cb27033e0fda1", "score": "0.6872489", "text": "ord_render () {\n return (\n this.renderMain()\n )\n }", "title": "" }, { "docid": "67af68f251416ed2d8c578eb305b4b80", "score": "0.6870679", "text": "render() {\n\t\treturn <div className=\"container\">{this.renderContent()}</div>;\n\t}", "title": "" }, { "docid": "1efe797920b584c6e02fd8ab8991a112", "score": "0.6849926", "text": "render() {\n this.draw();\n }", "title": "" }, { "docid": "f4017334c1530c0fd3e7a99738f635d4", "score": "0.68411416", "text": "render() {\n\t\t// Also, we shouldn't call the fucntion inside render because it\n\t\t// will get called again and again for re-rendering so, its gonna make some time if we call it here\n\t\t// Also direct object assignment will throw error\n\t\treturn <div className=\"border red\">{this.renderContent()}</div>;\n\t}", "title": "" }, { "docid": "f4daafcb8522facbc2b81497a42b7c54", "score": "0.6840481", "text": "_render () {\n if ( this._isRendered ) { return; }\n // set `_isRendered` hatch\n this._isRendered = true;\n // create `SVG` canvas to draw in\n this._createSVGCanvas();\n // set canvas size\n this._setCanvasSize();\n // draw the initial state\n // this._draw();\n // append the canvas to the parent from props\n this._props.parent.appendChild( this._canvas );\n }", "title": "" }, { "docid": "ee3ac5657a8f8f8086f905b8713f152b", "score": "0.6827604", "text": "render() {\n this.checkDataAttributes();\n this.setCssClass(this.cssClass);\n this.isEnabled(this.enabled);\n this.setDimension(this.getHeight(this.element), this.getWidth(this.element));\n this.createSplitPane(this.element);\n this.addSeparator(this.element);\n this.getPanesDimensions();\n this.setPaneSettings();\n this.setRTL(this.enableRtl);\n this.isCollapsed();\n EventHandler.add(document, 'touchstart click', this.onDocumentClick, this);\n this.renderComplete();\n }", "title": "" }, { "docid": "5bd3cb5c074c18babf030a5ed0436e17", "score": "0.68265325", "text": "updateComponent() {\n this.innerHTML = this.render()\n }", "title": "" }, { "docid": "5652e7fd04c8fd80f93afb9420c27ab9", "score": "0.681615", "text": "render() {\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isBlazor\"])() || !this.isServerRendered) {\n this.element.classList.add(classNames.root);\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"attributes\"])(this.element, { role: 'list', tabindex: '0' });\n this.setCSSClass();\n this.setEnableRTL();\n this.setEnable();\n this.setSize();\n this.wireEvents();\n this.header();\n this.setLocalData();\n this.setHTMLAttribute();\n // tslint:disable-next-line\n if (this.isReact) {\n this.renderReactTemplates();\n }\n }\n else {\n this.initBlazor(true);\n }\n this.rippleFn = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"rippleEffect\"])(this.element, {\n selector: '.' + classNames.listItem\n });\n this.renderComplete();\n }", "title": "" }, { "docid": "cb7f4948451cd3088b78d29d35998d85", "score": "0.68149006", "text": "connectedCallback() {\n this.render();\n }", "title": "" }, { "docid": "02cd72e67def33cf9d651e84108afc2a", "score": "0.6812283", "text": "render() {\n // draw a single frame\n this.#renderer.render();\n }", "title": "" }, { "docid": "4c45433379965f5170b9347141fa6427", "score": "0.6806849", "text": "render() {\n this.initialize();\n this.initRender();\n this.wireEvents();\n if (this.width === '100%') {\n this.element.style.width = '';\n }\n if (this.minHeight !== '') {\n this.element.style.minHeight = this.minHeight.toString();\n }\n if (this.enableResize) {\n this.setResize();\n if (this.animationSettings.effect === 'None') {\n this.getMinHeight();\n }\n }\n this.renderComplete();\n }", "title": "" }, { "docid": "e91f863d24329de4dac9fe43e9f37ee7", "score": "0.6800184", "text": "render() {\n\t\tthis.patch();\n\t}", "title": "" }, { "docid": "0dfe1976381b7ed911b889ed8ac153c3", "score": "0.67991245", "text": "render(){ }", "title": "" }, { "docid": "038d7aea543d14745069ea1e9851fcec", "score": "0.67975056", "text": "render() {\n if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isBlazor\"])()) {\n this.isServerRendered = false;\n }\n super.render();\n this.init();\n this.wireEvents();\n this.setAria();\n this.renderComplete();\n }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.67963326", "text": "render(){}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.67963326", "text": "render(){}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.67963326", "text": "render(){}", "title": "" }, { "docid": "c32407ffa2a07feab642c5236a299737", "score": "0.67956406", "text": "render() {\n throw new Error(\"RENDER NOT IMPLEMENTED FOR \" + this.name());\n }", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.6792828", "text": "_onRender() {}", "title": "" }, { "docid": "72262cfdf46f8eebc5eadf30ab3ddb30", "score": "0.6792795", "text": "function render(){\n\n}", "title": "" }, { "docid": "04593423715767014a8594d2651c5c12", "score": "0.67876565", "text": "render() {\n super.render();\n this.resizeOnLoad();\n }", "title": "" }, { "docid": "2293d3a6ba61a5bd9c0ab5a59e3defc9", "score": "0.678405", "text": "render() {\n this.s.image(this.g, 0, 0, this.w, this.h);\n }", "title": "" }, { "docid": "260efc5becd40bd2b62c74f120065709", "score": "0.67770225", "text": "render(){\n\t\t//console.log(\"render\");\n\t}", "title": "" }, { "docid": "7f99560923dd32c3db7b9fc5a6ddc467", "score": "0.6770275", "text": "render() {\n let html = \"<div class=\\\"smarthome-device\\\" id='\" + this.id + \"'>\" + this.getInnerHtml() + \"</div>\";\n this.controlPanel.append(html);\n this.self = this.controlPanel.find(this.selector);\n }", "title": "" }, { "docid": "ae3eaf2600940c5d1ccaf1dec567cb79", "score": "0.6764554", "text": "render(){\n\t\treturn (\n\t\t\t<div className = \"border red\">\n\t\t\t\t{this.renderContent()}\n\t\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "a75d764e4d32fb6c399633abb99ebe2e", "score": "0.67493814", "text": "render() { \n return (\n <div className=\"border red\">\n {this.renderContent() }\n </div>\n );\n }", "title": "" }, { "docid": "edf9e6bf76e6413b797919d27e06b51a", "score": "0.67470104", "text": "render() {\n // for the example\n this.renderer.render(this.elapsedTime);\n }", "title": "" }, { "docid": "1b342194afb4536b5228629ee4d22d4d", "score": "0.67428976", "text": "render() {\n this.element.classList.add(CLASSNAMES.ROOT);\n let styles = {};\n if (this.zIndex !== 1000) {\n styles.zIndex = this.zIndex;\n }\n if (this.width !== 'auto') {\n styles.width = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"formatUnit\"])(this.width);\n }\n if (this.height !== 'auto') {\n styles.height = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"formatUnit\"])(this.height);\n }\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"setStyleAttribute\"])(this.element, styles);\n this.fixedParent = false;\n this.setEnableRtl();\n this.setContent();\n }", "title": "" }, { "docid": "f3b35e38dcc89e1ec7e82facc1b86c35", "score": "0.67395157", "text": "render() {\n return <div className='border-red'>{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "0fe366758ff806d4fc60566ba411024d", "score": "0.6739288", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "7e709e3cb91fa0e510b5e3d4a7fb43e5", "score": "0.67259", "text": "static render() {\n Bling._adManager.renderAll();\n }", "title": "" }, { "docid": "5b36260245314cc67278700083dd84c5", "score": "0.6725116", "text": "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "title": "" }, { "docid": "48bf33de63e0a621c3adf9f9072200a5", "score": "0.6712407", "text": "Render(){\n this.r.RenderImage(this.p.position.x, this.p.position.y);\n canvasContext.fillText(this.textW + this.text, this.p.position.x, this.p.position.y);\n }", "title": "" }, { "docid": "8652d7283bbe95bb153027346cae5c82", "score": "0.6707133", "text": "render() {\n return (\n <div>\n <div>{this.renderContent()}</div>\n\n </div>\n )\n }", "title": "" }, { "docid": "ed249cf48aa066c658662b4967f0fcfe", "score": "0.6705184", "text": "get render() {\n\t\treturn this.renderFull();\n\t}", "title": "" }, { "docid": "47fdc1cd6fe491fd2b5f38d469660d0b", "score": "0.67001665", "text": "render() {\n this._overlayElement.render();\n\n if (this._menuElement && this._menuElement.items) {\n this._updateSelectedItem(this.value, this._menuElement.items);\n }\n }", "title": "" }, { "docid": "214afca77586b1621eab1a25037849f7", "score": "0.66966856", "text": "draw() {\n render(this.template(), this.root);\n }", "title": "" }, { "docid": "dbea5f9f82472414156f333259053048", "score": "0.66964585", "text": "render() {\n console.log('Executing RenderClassDemo Render');\n\n return <div>\n <h4>RenderClassDemo Component</h4>\n </div>;\n }", "title": "" } ]
0b2f2756fe2045e6d89f4e47d9ae09a7
METHOD TO SEARCH FOR DATA IN THE COLLECTION FOR ANY GIVEN SEARCH QUERIES
[ { "docid": "f39b34b39f68ec3b2a6d59895ae05d9f", "score": "0.0", "text": "find(args = {}) {\n const { keys, values } = this.createCond(args);\n const condition = Object.keys(args).length ? ` WHERE ${keys}` : '';\n return new Promise((resolve, reject) => {\n this.connect()\n .then(client => {\n client\n .query(`SELECT * FROM ${this.table}${condition}`, values)\n .then(data => resolve(data.rows))\n .catch(err => reject(this.createError(err)));\n })\n .catch(err => {\n reject(this.createError(err));\n });\n });\n }", "title": "" } ]
[ { "docid": "c697a125b4643aa2f29fcc30883d24be", "score": "0.69604456", "text": "function search() {}", "title": "" }, { "docid": "7c02fa208169dff4c7ab300f1d983c85", "score": "0.6812437", "text": "function search(query, collection) {\n\tvar results = [];\n\tfor (var i=0; i<collection.length; i++) {\n\t\tfor (var item in collection[i]) {\n\t\t\tif (query === item || query === collection[i][item]) {\n\t\t\t\tresults.push(collection[i]);\n\t\t\t}\n\t\t}\n\t} return results;\n}", "title": "" }, { "docid": "eede3aecbd0c2b55cf547151f24eef15", "score": "0.667824", "text": "getResults(query, data) {\n if (!query) return [];\n\n // Filter for matching strings\n let results = data.filter((item) => {\n return item.text.toLowerCase().includes(query.toLowerCase());\n });\n\n return results;\n }", "title": "" }, { "docid": "b31c64e8d3c02ce44e57a7a96210a35a", "score": "0.6538763", "text": "searchData(words) {\n\n let results = []\n for (let item of this.state.data) {\n\n let found = false\n for (let word of words) {\n\n if (word in item.keywordsDict) {\n\n results.push(item)\n found = true\n break;\n\n }\n }\n\n if (found) continue;\n }\n return results;\n }", "title": "" }, { "docid": "1e25c331c7afe9b0d19ef251798bc455", "score": "0.65267664", "text": "function search(people) {\r\n\t\t\r\n\t}", "title": "" }, { "docid": "4955627f6659e706db8fea64546a7fd4", "score": "0.62724614", "text": "function searchCollection() {\n scope.searchedItems = $filter('filter')(scope.items, function (item) {\n for (var attr in item) {\n if (match(item[attr], scope.query)) {\n return true;\n }\n }\n return false;\n });\n scope.currentPage = 1;\n scope.pageCount = Math.ceil(scope.searchedItems.length / scope.numPerPage);\n calcPages(true);\n }", "title": "" }, { "docid": "f72933062679bad21a60f7d92a8dd7ca", "score": "0.6246184", "text": "function findData5(mongoClient){\n\n var myDB = mongoClient.db('user') // getting database\n var myDBTable = myDB.collection('user_list') // getting table\n\n // searching all the raw where \"name\" value is \"Tahmeed\" // use comma for multiple condition\n var query = {name: \"Tahmeed\", phone: \"5\"}\n\n myDBTable.find(query).toArray(function(err, result){\n if(err){\n console.log(\"Error!\")\n }else{\n console.log(result)\n }\n })\n \n}", "title": "" }, { "docid": "5e0518d40232fb83110c2621c6b25cab", "score": "0.6178188", "text": "function findMatches() {\n var arr = $(\"#search-input\").val().split(\" \");\n var ids = [];\n getKeywords().done(function(jsonArray) {\n $.each(jsonArray, function(index, jsonObj) {\n for (var input of arr) {\n if (jsonObj.Keyword.indexOf(input) >= 0) {\n if (ids.indexOf(jsonObj.Id) == -1) {\n ids.push(jsonObj.Id);\n }\n }\n }\n });\n searchDocuments(ids);\n });\n}", "title": "" }, { "docid": "1563ca07bd0c09fd6cb5b3bf222fc159", "score": "0.61319625", "text": "function search({ columns, dataPath, selectionPred, sortPred }) {\n const fileScan = new FileScan(dataPath);\n const selection = new Selection(selectionPred, fileScan);\n const projection = new Projection(columns, selection);\n\n const results = [];\n\n let searching = true;\n\n while (searching) {\n const { value, done } = projection.next();\n if (!done) {\n results.push(value);\n } else {\n searching = false;\n }\n }\n\n let sort;\n let sortedResults;\n\n if (sortPred) {\n sort = new Sort(results, sortPred);\n sortedResults = sort.getValues();\n }\n\n return sortPred ? sortedResults : results;\n}", "title": "" }, { "docid": "86ac0e6793961f09efa89fbdc7941da0", "score": "0.6123407", "text": "search(api, property, value, callback) {\n eval('this.' + api + '()').findAll((elements) => {\n let results = _.filter(elements, (element) => {\n return eval('element.' + property) === value;\n });\n this.attach('count: ' + results.length);\n callback(results);\n });\n }", "title": "" }, { "docid": "e3526f0d64ed7f640fabda852345437c", "score": "0.6097702", "text": "mowSearch(fullData, searchKey, searchValue){\n let searchedData = [];\n fullData.find((el) => {\n if (el[searchKey].toLocaleLowerCase().search(searchValue.toLocaleLowerCase()) !== -1) {\n searchedData.push(el);\n }\n });\n return searchedData;\n }", "title": "" }, { "docid": "9411bdfabf9b3502e429254d1c29e5c3", "score": "0.609446", "text": "function search() {\n // Remove all elements in the SHOPPING_DATA.searchResults array\n SHOPPING_DATA.searchResults = [];\n\n // Get the search query from an input HTML element\n let query = $(\"#searchbox\").val().toLowerCase();\n\n /* Find all products in the PRODUCTS_DATA.PRODUCTS object with a name or\n keyword that matches the search query */\n\n // Populate the SHOPPING_DATA.searchResults with all matched products\n\n for (let productKey in PRODUCTS) {\n let product = PRODUCTS[productKey];\n if(product.name.toLowerCase().includes(query) ||\n product.keywords.includes(query)) {\n console.log(product.name);\n SHOPPING_DATA.searchResults.push(product);\n }\n }\n\n // Display the search results by calling displaySearchResults()\n displaySearchResults();\n}", "title": "" }, { "docid": "bee4e16455d7c9b60aed2dd460ae8c2e", "score": "0.6069665", "text": "function performSearch(searchString, data) {\n const searchPattern = new RegExp(searchString, 'i');\n let tempResult = [],\n allResults = [],\n uniqueResults = new Set();\n // Update searchResults with results from each category\n // Mission name\n tempResult = data.filter(function (data) {\n return searchPattern.test(data.mission_name);\n });\n allResults = allResults.concat(tempResult);\n // Flight number\n tempResult = data.filter(function (data) {\n return searchPattern.test(data.flight_number);\n });\n allResults = allResults.concat(tempResult);\n // Rocket\n tempResult = data.filter(function (data) {\n return searchPattern.test(data.rocket.rocket_name);\n });\n allResults = allResults.concat(tempResult);\n // launch site short and long\n tempResult = data.filter(function (data) {\n return searchPattern.test(data.launch_site.site_name);\n });\n allResults = allResults.concat(tempResult);\n tempResult = data.filter(function (data) {\n return searchPattern.test(data.launch_site.site_name_long);\n });\n allResults = allResults.concat(tempResult);\n // Crew\n tempResult = data.filter(function (data) {\n return searchPattern.test(data.crew);\n });\n allResults = allResults.concat(tempResult);\n // Launch year\n tempResult = data.filter(function (data) {\n return searchPattern.test(data.launch_year);\n });\n allResults = allResults.concat(tempResult);\n\n // Add all results to uniqueResults set\n for (let i = 0; i < allResults.length; i++) {\n uniqueResults.add(allResults[i]);\n }\n // Convert to array\n uniqueResults = Array.from(uniqueResults);\n\n // Return resulting array to object\n return uniqueResults;\n }", "title": "" }, { "docid": "d9cd8454f6a6ef6f02aff4c1e2d61bc1", "score": "0.60605603", "text": "function findAny(dsSearchIn, dsSearchAs, obj, str) {\n // Convert the search string to lower case\n str = str.toLowerCase();\n for (var key in obj) {\n if (dsSearchIn.length === 0 || dsSearchIn.indexOf(key) !== -1) {\n var value = String(obj[key]).toLowerCase();\n for (var field in dsSearchAs) {\n if (field === key) {\n // Found key in dsSearchAs so we pass the value and the search string to a search function\n // that returns true/false and we return that if true.\n /* Check if dsSearchAs is a function (passed from the template) */\n if (typeof dsSearchAs[field] === 'function') {\n var res = dsSearchAs[field](value, str);\n if (res === true) {\n return res\n }\n }\n }\n }\n // If it doesn't return from above we perform a simple search\n if (value.indexOf(str) >= 0) {\n return true\n }\n }\n }\n return false\n}", "title": "" }, { "docid": "00d9ded041fa3a6aa41ee0df19325dcc", "score": "0.6057171", "text": "function locater(data){\n service.textSearch(data, genData);\n }", "title": "" }, { "docid": "17777c18e9d00de914066dbcf2a95ad6", "score": "0.60550356", "text": "function searchForListings(searchTerm) {\n \n}", "title": "" }, { "docid": "a1f786705764a0925f69b6f24535aeed", "score": "0.6051913", "text": "function search(items, term) {\n results = [];\n if (term === undefined) {\n return searchables;\n }\n _.each(items, function(item) {\n var q;\n var keys = (item.UID + ' ' + item.Title + ' ' + item.path + ' ' + item.portal_type).toLowerCase();\n if (typeof(term) === 'object') {\n for (var i = 0; i < term.length; i = i + 1) {\n q = term[i].toLowerCase();\n if (keys.indexOf(q) > -1) {\n results.push(item);\n break;\n }\n }\n } else {\n q = term.toLowerCase().replace('*', '');\n if (keys.indexOf(q) > -1) {\n results.push(item);\n }\n }\n });\n }", "title": "" }, { "docid": "ac66a190dacf3c1ed422cd52acabd669", "score": "0.60430944", "text": "function searchColsbyMultiple(datalist, key, search_fields) {\n const results = [];\n const len = datalist.length;\n for (let i = 0; i < len; i += 1) {\n for (var item in search_fields) {\n var flag = 0;\n for (var k in key) {\n const fn = datalist[i][search_fields[item]].toLowerCase().indexOf(key[k]);\n if (fn >= 0) {\n results.push(datalist[i]);\n flag = 1;\n break;\n }\n }\n if (flag === 1) {\n break;\n }\n }\n }\n return results;\n}", "title": "" }, { "docid": "9da809709aa003400592629d99b2d3ab", "score": "0.60405535", "text": "function querySearch (query) {\n\t\t\t\t \n\t\t\t//Custom Filter\n\t\t\tvar results=[];\n\t\t\tfor (i = 0, len = $scope.allCompanies.length; i<len; ++i){\n\t\t\t\t//console.log($scope.allCompanies[i].value.value);\n\t\t\t\t\n\t\t\t\tif($scope.allCompanies[i].value.indexOf(query.toLowerCase()) !=-1)\n\t\t\t\t{\n\t\t\t\t\tresults.push($scope.allCompanies[i]);\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn results;\n\t\t}", "title": "" }, { "docid": "9da809709aa003400592629d99b2d3ab", "score": "0.60405535", "text": "function querySearch (query) {\n\t\t\t\t \n\t\t\t//Custom Filter\n\t\t\tvar results=[];\n\t\t\tfor (i = 0, len = $scope.allCompanies.length; i<len; ++i){\n\t\t\t\t//console.log($scope.allCompanies[i].value.value);\n\t\t\t\t\n\t\t\t\tif($scope.allCompanies[i].value.indexOf(query.toLowerCase()) !=-1)\n\t\t\t\t{\n\t\t\t\t\tresults.push($scope.allCompanies[i]);\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn results;\n\t\t}", "title": "" }, { "docid": "63ae9cc7874b544106b76b65d53e0dbb", "score": "0.6037954", "text": "function fullTextSearchMultiple(datalist, key) {\n const results = [];\n const len = datalist.length;\n for (let i = 0; i < len-1; i += 1) {\n for (var item in datalist[i]) {\n var flag = 0;\n for (var k in key) {\n const fn = String(datalist[i][item]).toLowerCase().indexOf(key[k]);\n if (fn >= 0) {\n results.push(datalist[i]);\n flag = 1;\n break;\n }\n }\n if (flag === 1) {\n break;\n }\n }\n }\n return results;\n}", "title": "" }, { "docid": "8feb3f368791a4d414e88c06f3ef5a8f", "score": "0.6025623", "text": "function doSearch() {\n var searchFields = [\"id\", \"caller_name\", \"callDate\",\n \"caller_phone1\", \"car_plateNum\", \"program\"];\n var serveFields = searchFields;\n var sType = \"or\"\n var limit = \"100\";\n\n var t = $el(\"searchtable\").dataTable();\n var term = $el(\"table-query\").val();\n var method = \"search/?\";\n method += \"q=\" + term + \"&\";\n //for (f in searchFields) {\n // method += (searchFields[f] + \"=\" + term + \"&\");\n //};\n method += \"_matchType=s&_searchType=\" + sType \n + \"&_limit=\" + limit\n + \"&_fields=\" + serveFields.join(\",\");\n $.getJSON(modelMethod(\"case\", method),\n function(results) {\n t.fnClearTable();\n t.fnAddData(results);\n });\n}", "title": "" }, { "docid": "d221e8d483413c065fd1c89227ce6947", "score": "0.60245436", "text": "function searchByConditions(data, condition, collection = []){\n\n\tif(isArray(data)){\n\t\tdata.forEach(item =>{\n\t\t\tif(condition(item)){\n\t\t\t\tcollection.push(item)\n\t\t\t}else if(isObject(item)){\n\t\t\t\tsearchByConditions(item, condition, collection)\n\t\t\t}\n\t\t})\n\t}\n\n\telse if(isObject(data)){\n\t\tif(condition(data)){\n\t\t\tcollection.push(data)\n\t\t}else{\n\t\t\tfor(let key in data){\n\t\t\t\tif(isObject(data[key])) searchByConditions(data[key], condition, collection)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection\n}", "title": "" }, { "docid": "787971f4abe56e88c567b1b53039e71b", "score": "0.6021393", "text": "function searchBuildings() {\n\tvar query = searchField.value;\n\tvar queryResult = [];\n\n\tfor (i = 0; i < buildings.length; i++) {\n\t\tif (buildings[i].name.toLowerCase().includes(query.toLowerCase())) {\n\t\t\tqueryResult.push(buildings[i]);\n\t\t}\n\t}\n\n\t// Update the UI with the buidlings whos name\n\t// matches user query\n\tpopulateBuildings(queryResult);\n}", "title": "" }, { "docid": "399049cb4a89bc169478fe53a3dabc5b", "score": "0.60128105", "text": "function search() {\n // Reset search results\n data.results = [];\n \n // Get results from search\n data.results = Calendar.search(data.searchTerm, Lists.data.lists);\n \n // Set hasSearched to true so if there are no results an error message will be shown\n data.hasSearched = true;\n }", "title": "" }, { "docid": "15f17834b362e077e11c025742abd4be", "score": "0.59907633", "text": "function findAllDataByQuery(MyMongoCLient){\n var myDatabase = MyMongoCLient.db('school');\n\n var mycollection = myDatabase.collection('students');\n var queryCondition = {Roll:\"103\", City:\"Dhaka\"}\n \n\n mycollection.find(queryCondition).toArray(function(error,result){\n if(error){\n console.log(\"Data not found\");\n }else{\n console.log(result);\n \n }\n });\n}", "title": "" }, { "docid": "a06488fdb92060e109f05631b91eba06", "score": "0.5980719", "text": "findDataByIndexes() {}", "title": "" }, { "docid": "77009bec7fe200f99605e90fbff26995", "score": "0.5975193", "text": "static search(){}", "title": "" }, { "docid": "f107311694ff90cf35d7263e363ba560", "score": "0.5970327", "text": "function coffeeSearch() {\n var searchArr = [];\n var coffeeSelect = document.getElementById('input-coffee-name');\n console.log(coffeeSelect.value);\n var inputCoffee = coffeeSelect.value;\n\n coffees.forEach(function (coffee) {\n if (coffee.name.toLowerCase().includes(inputCoffee.toLowerCase())) {\n searchArr.push(coffee);\n console.log(searchArr);\n }\n });\n tbody.innerHTML = renderCoffees(searchArr);\n}", "title": "" }, { "docid": "98abf786bad04a7c11636da9e6f57e87", "score": "0.5947065", "text": "function getSearchedData(alldocuments, matterId, mydocs, pagenum, pagesize, sortby, sortorder, filters, moreinfo, isglobal, searchText) {\n if (moreinfo == undefined) {\n moreinfo = '';\n }\n if (matterId > 0) {\n var url = documentsConstants.RESTAPI.docSearchUrl + 'all_documents=' + alldocuments + '&my_docs=' + mydocs + '&page_num=' + pagenum + '&page_size=' + pagesize + '&sort_by=' + sortby + '&sort_order=' + sortorder + '&more_info=' + moreinfo + '&search_string=' +searchText;\n } else {\n var url = documentsConstants.RESTAPI.docSearchUrl + 'all_documents=' + alldocuments + '&my_docs=' + mydocs + '&page_num=' + pagenum + '&page_size=' + pagesize + '&sort_by=' + sortby + '&sort_order=' + sortorder + '&more_info=' + moreinfo + '&search_string=' +searchText;\n }\n if (utils.isEmptyVal(filters)) {\n var filters = {};\n filters.matterid = matterId;\n }\n if (utils.isEmptyVal(filters.matterid)) {\n filters.matterid = matterId;\n }\n if (isglobal == false) {\n filters.is_matter = 1;\n }\n else {\n filters.is_matter = 0;\n }\n url += setFilters(filters);\n var deferred = $q.defer();\n $http({\n url: url,\n method: \"GET\",\n headers: {\n \"Authorization\": \"Bearer \" + localStorage.getItem('accessToken')\n }\n }).success(function (response, status) {\n deferred.resolve(response);\n }).error(function (ee, status, headers, config) {\n deferred.reject(ee);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "a906b6d95990633c39c43133e7fa4564", "score": "0.59334415", "text": "function querySearch(query) {\n var results = [];\n for (var i = 0, len = vm.fullarr.length; i < len; ++i) {\n if (vm.fullarr[i].value.indexOf(query.toLowerCase()) != -1) {\n results.push(vm.fullarr[i]);\n }\n }\n return results;\n }", "title": "" }, { "docid": "4db7ae6c95dbad40030752037643356f", "score": "0.5923556", "text": "function doSearch(databaseid, params, cb) {\r\n\tvar res;\r\n\tvar stope = {};\r\n\tvar fromdata;\r\n\tvar selectors = cloneDeep(this.selectors);\r\n\r\n\r\n\r\n\tfunction processSelector(selectors,sidx,value) {\r\n//\t\tvar val;\r\n/*\t\tif(sidx == 0) {\r\n\t\t\tif(selectors.length > 0 && selectors[0].srchid == 'SHARP') {\r\n\t\t\t\tval = alasql.databases[alasql.useid].objects[selectors[0].args[0]];\r\n\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t//selectors.shift();\t\t\t\r\n\t\t\t} else if(selectors.length > 0 && selectors[0].srchid == 'AT') {\r\n\t\t\t\tval = alasql.vars[selectors[0].args[0]];\r\n\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t//selectors.shift();\r\n\t\t\t} else if(selectors.length > 0 && selectors[0].srchid == 'CLASS') {\r\n\t\t\t\tval = alasql.databases[databaseid].tables[selectors[0].args[0]].data;\r\n\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t//selectors.shift();\r\n\t\t\t\t//selectors.unshift({srchid:'CHILD'});\r\n\t\t\t} else {\r\n\r\n\t\t\t}\r\n\t\t}\r\n*/\r\n\t\tvar \r\n\t\t\tval,\t// temp values use many places\r\n\t\t\tnest, \t// temp value used many places\r\n\t\t\tr,\t\t// temp value used many places\r\n\t\t\tsel = selectors[sidx];\r\n//\t\tconsole.log(sel);\r\n//\t\tif(!alasql.srch[sel.srchid]) {\r\n//\t\t\tthrow new Error('Selector \"'+sel.srchid+'\" not found');\r\n//\t\t};\r\n\t\t\r\n\t\tvar SECURITY_BREAK = 100000;\r\n\r\n\t\tif(sel.selid) {\r\n\t\t\t// TODO Process Selector\r\n\t\t\tif(sel.selid === 'PATH') {\r\n\t\t\t\tvar queue = [{node:value,stack:[]}];\r\n\t\t\t\tvar visited = {};\r\n\t\t\t\t//var path = [];\r\n\t\t\t\tvar objects = alasql.databases[alasql.useid].objects;\r\n\t\t\t\twhile (queue.length > 0) {\r\n\t\t\t\t\tvar q = queue.shift()\r\n\t\t\t\t\tvar node = q.node;\r\n\t\t\t\t\tvar stack = q.stack;\r\n\t\t\t\t\tvar r = processSelector(sel.args,0,node);\r\n\t\t\t\t\tif(r.length > 0) {\r\n\t\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\t\treturn stack;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tvar rv = [];\r\n\t\t\t\t\t\t\tif(stack && stack.length > 0) {\r\n\t\t\t\t\t\t\t\tstack.forEach(function(stv){\r\n\t\t\t\t\t\t\t\t\trv = rv.concat(processSelector(selectors,sidx+1,stv));\r\n\t\t\t\t\t\t\t\t});\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\treturn rv;\t\t\t\t\t\t\t\r\n//\t\t\t\t\t\t\treturn processSelector(selectors,sidx+1,stack);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(typeof visited[node.$id] !== 'undefined') {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t} else {\r\n//\t\t\t\t\t\t\tconsole.log(node.$id, node.$out);\r\n\t\t\t\t\t\t\tvisited[node.$id] = true;\r\n\t\t\t\t\t\t\tif(node.$out && node.$out.length > 0) {\r\n\t\t\t\t\t\t\t\tnode.$out.forEach(function(edgeid){\r\n\t\t\t\t\t\t\t\t\tvar edge = objects[edgeid];\r\n\t\t\t\t\t\t\t\t\tvar stack2 = stack.concat(edge);\r\n\t\t\t\t\t\t\t\t\tstack2.push(objects[edge.$out[0]]);\r\n\t\t\t\t\t\t\t\t\tqueue.push({node:objects[edge.$out[0]],\r\n\t\t\t\t\t\t\t\t\t\tstack:stack2});\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}\r\n\t\t\t\t// Else return fail\r\n\t\t\t\treturn [];\r\n\t\t\t} if(sel.selid === 'NOT') {\r\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\r\n\t\t\t\t//console.log(1,nest);\r\n\t\t\t\tif(nest.length>0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn [value];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'DISTINCT') {\r\n\t\t\t\tvar nest;\r\n\t\t\t\tif(typeof sel.args === 'undefined' || sel.args.length === 0) {\r\n\t\t\t\t\tnest = distinctArray(value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnest = processSelector(sel.args,0,value);\r\n\t\t\t\t}\r\n\t\t\t\tif(nest.length === 0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar res = distinctArray(nest);\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn res;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,res);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'AND') {\r\n\t\t\t\tvar res = true;\r\n\t\t\t\tsel.args.forEach(function(se){\r\n\t\t\t\t\tres = res && (processSelector(se,0,value).length>0);\r\n\t\t\t\t});\r\n\t\t\t\tif(!res) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn [value];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'OR') {\r\n\t\t\t\tvar res = false;\r\n\t\t\t\tsel.args.forEach(function(se){\r\n\t\t\t\t\tres = res || (processSelector(se,0,value).length>0);\r\n\t\t\t\t});\r\n\t\t\t\tif(!res) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn [value];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'ALL') {\r\n\t\t\t\tvar nest = processSelector(sel.args[0],0,value);\r\n\t\t\t\tif(nest.length === 0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn nest;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,nest);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'ANY') {\r\n\t\t\t\tvar nest = processSelector(sel.args[0],0,value);\r\n//\t\t\t\tconsole.log(272,nest);\r\n\t\t\t\tif(nest.length === 0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn [nest[0]];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,[nest[0]]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'UNIONALL') {\r\n\t\t\t\tvar nest = [];\r\n\t\t\t\tsel.args.forEach(function(se){\r\n\t\t\t\t\tnest = nest.concat(processSelector(se,0,value));\r\n\t\t\t\t});\r\n\t\t\t\tif(nest.length === 0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn nest;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,nest);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'UNION') {\r\n\t\t\t\tvar nest = [];\r\n\t\t\t\tsel.args.forEach(function(se){\r\n\t\t\t\t\tnest = nest.concat(processSelector(se,0,value));\r\n\t\t\t\t});\r\n\t\t\t\tvar nest = distinctArray(nest);\r\n\t\t\t\tif(nest.length === 0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn nest;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,nest);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else \tif(sel.selid === 'IF') {\r\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\r\n\t\t\t\t//console.log(1,nest);\r\n\t\t\t\tif(nest.length===0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\treturn [value];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else \tif(sel.selid === 'REPEAT') {\r\n//\t\t\t\tconsole.log(352,sel.sels);\r\n\t\t\t\tvar \r\n\t\t\t\t\tlvar, \r\n\t\t\t\t\tlmax,\r\n\t\t\t\t\tlmin = sel.args[0].value;\r\n\t\t\t\tif(!sel.args[1]) {\r\n\t\t\t\t\tlmax = lmin; // Add security break\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlmax = sel.args[1].value;\r\n\t\t\t\t}\r\n\t\t\t\tif(sel.args[2]) {\r\n\t\t\t\t\tlvar = sel.args[2].variable;\r\n\t\t\t\t} \r\n\t\t\t\t//var lsel = sel.sels;\r\n//\t\t\t\tconsole.log(351,lmin,lmax,lvar);\r\n\r\n\t\t\t\tvar retval = [];\r\n\r\n\t\t\t\tif (lmin === 0) {\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\tretval = [value];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(lvar){\r\n\t\t\t\t\t\t\talasql.vars[lvar] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,value));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n//\t\t\t\tconsole.log(364,retval);\r\n//console.log(370,sel.sels);\r\n\t\t\t\t\t// var nests = processSelector(sel.sels,0,value).slice();\r\n\t\t\t\tif(lmax > 0) {\r\n\t\t\t\t\tvar nests = [{value:value,lvl:1}];\r\n\t\t\t\t\t\t// if(lvl >= lmin) {\r\n\t\t\t\t\t\t// \tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\t// \t\tretval = retval.concat(nests);\r\n\t\t\t\t\t\t// \t} else {\r\n\t\t\t\t\t\t// \t\tretval = retval.concat(processSelector(selectors,sidx+1,value));\r\n\t\t\t\t\t\t// \t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t// }\r\n\t//console.log(371,nests);\r\n\t\t\t\t\tvar i = 0;\r\n\t\t\t\t\twhile (nests.length > 0) {\r\n\r\n\t\t\t\t\t\tvar nest = nests[0];\r\n\t//console.log(375,nest);\r\n\t\t\t\t\t\tnests.shift();\r\n\t\t\t\t\t\tif(nest.lvl <= lmax) {\r\n\t\t\t\t\t\t\tif(lvar){\r\n\t\t\t\t\t\t\t\talasql.vars[lvar] = nest.lvl;\r\n\t\t\t\t\t\t\t}\r\n//\t\tconsole.log(394,sel.sels);\r\n\t\t\t\t\t\t\tvar nest1 = processSelector(sel.sels,0,nest.value);\r\n//\t\t\t\t\t\tconsole.log(397,nest1);\r\n\r\n\t\t\t\t\t\t\tnest1.forEach(function(n){\r\n\t\t\t\t\t\t\t\tnests.push({value:n,lvl:nest.lvl+1});\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tif(nest.lvl >= lmin) {\r\n\t\t\t\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\t\t\t\tretval = retval.concat(nest1);\r\n\t\t\t\t\t\t\t\t\t//return nests;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tnest1.forEach(function(n){\r\n\t\t\t\t\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Security brake\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\tif(i>SECURITY_BREAK) {\r\n\t\t\t\t\t\t\tthrow new Error('Security brake. Number of iterations = '+i);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn retval;\r\n\r\n\t\t\t} else \tif(sel.selid ==='TO') {\r\n//\t\t\t\tconsole.log(347,value,sel.args[0]);\r\n\t\t\t\tvar oldv = alasql.vars[sel.args[0]];\r\n\t\t\t\tvar newv = [];\r\n\t\t\t\tif(oldv !== undefined) {\r\n//\t\t\t\t\tconsole.log(353,typeof oldv);\r\n\t\t\t\t\tnewv = oldv.slice(0);\r\n//\t\t\t\t\tconsole.log(429, oldv, newv);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnewv = [];\r\n\t\t\t\t}\r\n\t\t\t\tnewv.push(value);\r\n\t\t\t\t// console.log(428,oldv,newv, value);\r\n\t\t\t\t// console.log(435,sidx+1+1,selectors.length);\r\n//\t\t\t\tconsole.log(355,alasql.vars[sel.args[0]]);\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [value];\r\n\t\t\t\t} else {\r\n\t\t\t\t\talasql.vars[sel.args[0]] = newv;\r\n\t\t\t\t\tvar r1 = processSelector(selectors,sidx+1,value);\r\n//\t\t\t\t\tconsole.log('r1 =',r1);\r\n\t\t\t\t\talasql.vars[sel.args[0]] = oldv;\r\n\t\t\t\t\treturn r1;\r\n\t\t\t\t}\r\n/*\r\n\r\nalasql.srch.TO = function(val,args) {\r\n console.log(args[0]);\r\n\r\n alasql.vars[args[0]].push(val);\r\n return {status: 1, values: [val]};\r\n};\r\n\r\n*/\r\n\t\t\t} else if(sel.selid === 'ARRAY') {\r\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length > 0) {\r\n\t\t\t\t\tval = nest;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'SUM') {\r\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length > 0) {\r\n\t\t\t\t\tvar val = nest.reduce(function(sum, current) {\r\n\t \t\t\t\t\treturn sum + current;\r\n\t\t\t\t\t}, 0);\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'AVG') {\r\n\t\t\t\tnest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length > 0) {\r\n\t\t\t\t\tval = nest.reduce(function(sum, current) {\r\n\t \t\t\t\t\treturn sum + current;\r\n\t\t\t\t\t}, 0)/nest.length;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'COUNT') {\r\n\t\t\t\tnest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length > 0) {\r\n\t\t\t\t\tval = nest.length;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else \tif(sel.selid === 'FIRST') {\r\n\t\t\t\tnest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length > 0){\r\n\t\t\t\t\tval = nest[0];\r\n\t\t\t\t} else { \r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else \tif(sel.selid === 'LAST') {\r\n\t\t\t\tnest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length > 0) {\r\n\t\t\t\t\tval = nest[nest.length-1];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'MIN') {\r\n\t\t\t\tnest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length === 0){\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t\tvar val = nest.reduce(function(min, current) {\r\n \t\t\t\t\treturn Math.min(min,current);\r\n\t\t\t\t}, Infinity);\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else \tif(sel.selid === 'MAX') {\r\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(nest.length === 0){\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t\tvar val = nest.reduce(function(max, current) {\r\n \t\t\t\t\treturn Math.max(max,current);\r\n\t\t\t\t}, -Infinity);\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\r\n\t\t\t\t}\r\n\t\t\t} else \tif(sel.selid === 'PLUS') {\r\n\t\t\t\tvar retval = [];\r\n//\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n))\r\n\t\t\t\tvar nests = processSelector(sel.args,0,value).slice();\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\tretval = retval.concat(nests);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnests.forEach(function(n){\r\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\twhile (nests.length > 0) {\r\n//\t\t\t\t\tnest = nests[0];\r\n//\t\t\t\t\tnests.shift();\r\n\t\t\t\t\tvar nest = nests.shift();\r\n\t\t\t\t\t\r\n//\t\t\t\t\tconsole.log(281,nest);\r\n//\t\t\t\t\tconsole.log(nest,nests);\r\n\t\t\t\t\tnest = processSelector(sel.args,0,nest);\r\n//\t\t\t\t\tconsole.log(284,nest);\r\n//\t\t\t\t\tconsole.log('nest',nest,'nests',nests);\r\n\t\t\t\t\tnests = nests.concat(nest);\r\n//console.log(retval,nests);\t\t\t\t\r\n\r\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t\tretval = retval.concat(nest);\r\n\t\t\t\t\t\t//return retval;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnest.forEach(function(n){\r\n//\t\t\t\t\t\t\tconsole.log(293,n);\r\n\t\t\t\t\t\t\tvar rn = processSelector(selectors,sidx+1,n);\r\n//\t\t\t\t\t\t\tconsole.log(294,rn, retval);\r\n\t\t\t\t\t\t\tretval = retval.concat(rn);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Security brake\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tif(i>SECURITY_BREAK) {\r\n\t\t\t\t\t\tthrow new Error('Security brake. Number of iterations = '+i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn retval;\r\n\t\t\t\t//console.log(1,nest);\r\n\t\t\t} else \tif(sel.selid === 'STAR') {\r\n\t\t\t\tvar retval = [];\r\n\t\t\t\tretval = processSelector(selectors,sidx+1,value);\r\n\t\t\t\tvar nests = processSelector(sel.args,0,value).slice();\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\tretval = retval.concat(nests);\r\n\t\t\t\t\t//return nests;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnests.forEach(function(n){\r\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\twhile (nests.length > 0) {\r\n\t\t\t\t\tvar nest = nests[0];\r\n\t\t\t\t\tnests.shift();\r\n//\t\t\t\t\tconsole.log(nest,nests);\r\n\t\t\t\t\tnest = processSelector(sel.args,0,nest);\r\n//\t\t\t\t\tconsole.log('nest',nest,'nests',nests);\r\n\t\t\t\t\tnests = nests.concat(nest);\r\n\r\n\t\t\t\t\tif(sidx+1+1 <= selectors.length) {\r\n\t\t\t\t\t\tnest.forEach(function(n){\r\n\t\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Security brake\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tif(i>SECURITY_BREAK) {\r\n\t\t\t\t\t\tthrow new Error('Loop brake. Number of iterations = '+i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn retval;\r\n\t\t\t} else \tif(sel.selid === 'QUESTION') {\r\n\t\t\t\tvar retval = [];\r\n\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,value))\r\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\r\n\t\t\t\tif(sidx+1+1 <= selectors.length) {\r\n\t\t\t\t\tnest.forEach(function(n){\r\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn retval;\r\n\t\t\t} else if(sel.selid === 'WITH') {\r\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\r\n//\t\t\t\tconsole.log('WITH',nest);\r\n\t\t\t\tif(nest.length===0) {\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// if(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\t// \treturn [nest];\r\n\t\t\t\t\t// } else {\r\n\t\t\t\t\t// \treturn processSelector(selectors,sidx+1,nest);\r\n\t\t\t\t\t// }\r\n\t\t\t\t\tvar r = {status:1,values:nest};\r\n\t\t\t\t}\r\n\t\t\t} else if(sel.selid === 'ROOT') {\r\n\t\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\t\treturn [value];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn processSelector(selectors,sidx+1,fromdata);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Wrong selector '+sel.selid);\r\n\t\t\t}\r\n\r\n\r\n\t\t} else if(sel.srchid) {\r\n\t\t\tvar r = alasql.srch[sel.srchid.toUpperCase()](value,sel.args,stope,params);\r\n//\t\t\tconsole.log(sel.srchid,r);\r\n\t\t} else {\r\n\t\t\tthrow new Error('Selector not found');\r\n\t\t}\r\n//\t\tconsole.log(356,sidx,r);\r\n\t\tif(typeof r === 'undefined') {\r\n\t\t\tr = {status: 1, values: [value]};\r\n\t\t}\r\n\r\n\t\tvar res = [];\r\n\t\tif(r.status === 1) {\r\n\r\n\t\t\tvar arr = r.values;\r\n\r\n\r\n\t\t\tif(sidx+1+1 > selectors.length) {\r\n//\t\t\tif(sidx+1+1 > selectors.length) {\r\n\t\t\t\tres = arr;\t\t\t\t\t\r\n//\t\t\t\tconsole.log('res',r)\r\n\t\t\t} else {\r\n\t\t\t\tfor(var i=0;i<r.values.length;i++) {\r\n\t\t\t\t\tres = res.concat(processSelector(selectors,sidx+1,arr[i]));\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\r\n\tif(selectors !== undefined && selectors.length > 0) {\r\n\r\n//\t\t\tconsole.log(selectors[0].args[0].toUpperCase());\r\n\t\tif(selectors && selectors[0] && selectors[0].srchid === 'PROP' && selectors[0].args && selectors[0].args[0]) {\r\n//\t\t\tconsole.log(selectors[0].args[0]);\r\n\t\t\tif(selectors[0].args[0].toUpperCase() === 'XML') {\r\n\t\t\t\tstope.mode = 'XML';\r\n\t\t\t\tselectors.shift();\r\n\t\t\t} else if(selectors[0].args[0].toUpperCase() === 'HTML') {\r\n\t\t\t\tstope.mode = 'HTML';\r\n\t\t\t\tselectors.shift();\r\n\t\t\t} else if(selectors[0].args[0].toUpperCase() === 'JSON') {\r\n\t\t\t\tstope.mode = 'JSON';\r\n\t\t\t\tselectors.shift();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(selectors.length > 0 && selectors[0].srchid === 'VALUE') {\r\n\t\t\tstope.value = true;\r\n\t\t\tselectors.shift();\r\n\t\t}\r\n\t}\r\n\r\n\t\r\n\tif(this.from instanceof yy.Column) {\r\n\t\tvar dbid = this.from.databaseid || databaseid;\r\n\t\tfromdata = alasql.databases[dbid].tables[this.from.columnid].data;\r\n\t\t//selectors.unshift({srchid:'CHILD'});\r\n\t} else if(\r\n\t\t\t\tthis.from instanceof yy.FuncValue &&\t\t\t\t \r\n\t\t\t\talasql.from[this.from.funcid.toUpperCase()]\r\n\t\t\t) {\r\n\t\tvar args = this.from.args.map(function(arg){\r\n\t\tvar as = arg.toJS();\r\n//\t\t\tconsole.log(as);\r\n\t\tvar fn = new Function('params,alasql','var y;return '+as).bind(this);\r\n\t\treturn fn(params,alasql);\r\n\t\t});\r\n//\t\tconsole.log(args);\r\n\t\tfromdata = alasql.from[this.from.funcid.toUpperCase()].apply(this,args);\r\n//\t\tconsole.log(92,fromdata);\r\n\t} else if(typeof this.from === 'undefined') {\r\n\t\tfromdata = alasql.databases[databaseid].objects;\r\n\t} else {\r\n\t\tvar fromfn = new Function('params,alasql','var y;return '+this.from.toJS());\r\n\t\tfromdata = fromfn(params,alasql);\t\t\t\r\n\t\t// Check for Mogo Collections\r\n\t\tif(\r\n\t\t\ttypeof Mongo === 'object' && typeof Mongo.Collection !== 'object' && \r\n\t\t\tfromdata instanceof Mongo.Collection\r\n\t\t) {\r\n\t\t\tfromdata = fromdata.find().fetch();\r\n\t\t}\r\n//console.log(selectors,fromdata);\r\n//\t\tif(typeof fromdata == 'object' && fromdata instanceof Array) {\r\n//\t\t\tselectors.unshift({srchid:'CHILD'});\t\t\t\t\t\r\n//\t\t}\r\n\t}\r\n\t\r\n\t// If source data is array than first step is to run over array\r\n//\tvar selidx = 0;\r\n//\tvar selvalue = fromdata;\r\n\t\r\n\tif(selectors !== undefined && selectors.length > 0) {\r\n\t\t// Init variables for TO() selectors\r\n\r\n\t\tif(false) {\r\n\t\t\tselectors.forEach(function(selector){\r\n\t\t\t\tif(selector.srchid === 'TO') { //* @todo move to TO selector\r\n\t\t\t\t\talasql.vars[selector.args[0]] = [];\r\n\t\t\t\t\t// TODO - process nested selectors\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tres = processSelector(selectors,0,fromdata);\r\n\t} else {\r\n\t\tres = fromdata; \t\r\n\t}\r\n\t\r\n\tif(this.into) {\r\n\t\tvar a1,a2;\r\n\t\tif(typeof this.into.args[0] !== 'undefined') {\r\n\t\t\ta1 = \r\n\t\t\t\tnew Function('params,alasql','var y;return ' +\r\n\t\t\t\tthis.into.args[0].toJS())(params,alasql);\r\n\t\t}\r\n\t\tif(typeof this.into.args[1] !== 'undefined') {\r\n\t\t\ta2 = \r\n\t\t\t\tnew Function('params,alasql','var y;return ' +\r\n\t\t\t\tthis.into.args[1].toJS())(params,alasql);\r\n\t\t}\r\n\t\tres = alasql.into[this.into.funcid.toUpperCase()](a1,a2,res,[],cb);\r\n\t} else {\r\n\t\tif(stope.value && res.length > 0){\r\n\t\t\tres = res[0];\r\n\t\t}\r\n\t\tif (cb){\r\n\t\t\tres = cb(res);\r\n\t\t}\r\n\t}\r\n\treturn res;\r\n\t\r\n}", "title": "" }, { "docid": "70a53e84efc474299e30fb86ab23a90d", "score": "0.59169", "text": "function searchContains(IDENTIFIERS)\n{\n var $inputBox = $(\"#keyword\");\n for (const i in IDENTIFIERS) {\n if ($inputBox.val().includes(IDENTIFIERS[i]))\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "d1972ec0d97b60619badcba04d580603", "score": "0.58883095", "text": "function searchFullText(datalist, key) {\n const results = [];\n const len = datalist.length;\n for (let i = 0; i < len-1; i += 1) {\n for (var item in datalist[i]) {\n const fn = String(datalist[i][item]).toLowerCase().indexOf(key);\n if (fn >= 0) {\n results.push(datalist[i]);\n break;\n }\n }\n }\n return results;\n}", "title": "" }, { "docid": "625e9cf5733ec644485b5ec56efb180c", "score": "0.58852714", "text": "findBy(searchParam){\n let [searchAttribute, searchValue] = Object.entries(searchParam)[0]\n for (let record of this._records) {\n if (record[searchAttribute] == searchValue ){\n return record; \n } \n }\n \n }", "title": "" }, { "docid": "e7bd18e50b19828bea1f9513225139b9", "score": "0.5883636", "text": "function getSearchList() {\n var ret = [];//array of strings\n for (var idx = 0; idx < ProductData.length; idx++) {\n var dscr = ProductData[idx].name;\n if (dscr.toLowerCase().indexOf(vm.searchString.toLowerCase()) >= 0)\n ret.push(dscr);\n }\n return ret;\n }", "title": "" }, { "docid": "838d49efc29550d27f029a137e70aa87", "score": "0.5876654", "text": "static async search(searchObject) {\n if (Object.keys(searchObject).length === 1 && searchObject.school_handle) {\n if (searchObject.school_handle === \"All Schools\") {\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies from books`\n );\n\n return result.rows;\n } else {\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies from books \n Where school_handle = $1`,\n [searchObject.school_handle]\n );\n return result.rows;\n }\n }\n if (searchObject.school_handle === \"All Schools\") {\n if (searchObject.author) {\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies \n FROM books\n WHERE author ILIKE $1`,\n [searchObject.author]\n );\n return result.rows;\n } else if (searchObject.title) {\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies \n FROM books\n WHERE title ILIKE $1`,\n [searchObject.title]\n );\n return result.rows;\n } else if (searchObject.subject) {\n console.log(\"hello\");\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies \n FROM books\n WHERE subject_type = $1 `,\n [searchObject.subject]\n );\n return result.rows;\n }\n } else if (searchObject.author) {\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies \n FROM books\n WHERE author ILIKE $1 AND school_handle = $2`,\n [searchObject.author, searchObject.school_handle]\n );\n return result.rows;\n } else if (searchObject.title) {\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies \n FROM books\n WHERE title ILIKE $1 AND school_handle = $2`,\n [searchObject.title, searchObject.school_handle]\n );\n return result.rows;\n } else if (searchObject.subject) {\n let result = await db.query(\n `SELECT isbn,book_image,title,author,description,subject_type,edition_number,publisher,copyright_year,language,\n available,school_handle,copies \n FROM books\n WHERE subject_type = $1 AND school_handle = $2`,\n [searchObject.subject, searchObject.school_handle]\n );\n return result.rows;\n }\n }", "title": "" }, { "docid": "602c7b5ed590a34433edc88fc4157c59", "score": "0.58738965", "text": "searchEvents(itemsRef) {\n var searchText = this.state.searchText.toString().toLowerCase();\n var results = [];\n if (searchText == \"\"){\n this.listenForItems(itemsRef);\n } else {\n items = this.state.dataSource;\n items.forEach((parent) => {\n var children = [];\n parent.data.forEach((child) => {\n if (child.name.toLowerCase().includes(searchText) ||\n child.what.toLowerCase().includes(searchText) ||\n child.who.toLowerCase().includes(searchText)) {\n children.push(child);\n }\n });\n if (children.length != 0) {\n results.push({\n data: children,\n key: parent.key.toUpperCase()\n })\n }\n });\n }\n this.setState({data: results});\n }", "title": "" }, { "docid": "749ce6144f9794f29bee0b01bdeefd5c", "score": "0.58711535", "text": "function selectEntries (request, callback) {\n var result = [];\n \n // filter the data for matching entries on the item name\n // Only match if the search string matches from the \n // beginning of the given name.\n result = $.grep(itemList,\n function(value, index) {\n if (request.term.length === 1 && request.term === '*') {\n return value.label.toLowerCase().length > 0; // all of them\n } else {\n return (value.label.toLowerCase().indexOf(\n request.term.toLowerCase()) === 0);\n }\n });\n // return the results\n callback(result);\n}", "title": "" }, { "docid": "dcf4a837c100b831e488e6673eb7555e", "score": "0.5862385", "text": "function searchCols(datalist, key, search_fields) {\n const results = [];\n const len = datalist.length;\n for (let i = 0; i < len; i += 1) {\n for (var item in search_fields) {\n const fn = datalist[i][search_fields[item]].toLowerCase().indexOf(key);\n if (fn >= 0) {\n results.push(datalist[i]);\n break;\n }\n }\n }\n return results;\n}", "title": "" }, { "docid": "d44f73698f97670ffe55715d3232499e", "score": "0.5828807", "text": "function Search(items, search) {\n var result = [];\n for (var i = 0; i < items.length; i++) {\n if (items[i].value.toLowerCase().indexOf(search.toLowerCase()) !== -1) {\n result.push(items[i]);\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "b742cba9badf2f6f1a5476d7abe7108b", "score": "0.58208543", "text": "function local(options) {\n var data = options, // data elements\n dataText,\n tmp,\n text = function (item) { return \"\"+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search\n \n if ($.isArray(data)) {\n tmp = data;\n data = { results: tmp };\n }\n \n if ($.isFunction(data) === false) {\n tmp = data;\n data = function() { return tmp; };\n }\n \n var dataItem = data();\n if (dataItem.text) {\n text = dataItem.text;\n // if text is not a function we assume it to be a key name\n if (!$.isFunction(text)) {\n dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available\n text = function (item) { return item[dataText]; };\n }\n }\n \n return function (query) {\n var t = query.term, filtered = { results: [] }, process;\n if (t === \"\") {\n query.callback(data());\n return;\n }\n \n process = function(datum, collection) {\n var group, attr;\n datum = datum[0];\n if (datum.children) {\n group = {};\n for (attr in datum) {\n if (datum.hasOwnProperty(attr)) group[attr]=datum[attr];\n }\n group.children=[];\n $(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); });\n if (group.children.length || query.matcher(t, text(group), datum)) {\n collection.push(group);\n }\n } else {\n if (query.matcher(t, text(datum), datum)) {\n collection.push(datum);\n }\n }\n };\n \n $(data().results).each2(function(i, datum) { process(datum, filtered.results); });\n query.callback(filtered);\n };\n }", "title": "" }, { "docid": "9827d9a81f3cd059f4a9c45ea8a73646", "score": "0.5816368", "text": "function displaySearchResults() {\n // loop through STORE.data and toggle filtered unless a match is found\n STORE.data.forEach(item => {\n if (!item.name.includes(STORE.data.searchString)) {\n item.filtered = true; // if name doesn't include term filter it out\n } else {\n item.filtered = false; // if name does include term\n }\n });\n}", "title": "" }, { "docid": "40f308d7777a9dad6c808c4472af91ca", "score": "0.5814702", "text": "function searchMatch() {\n const matched = cities.filter(el => {\n return (\n el.city.toLowerCase().includes(this.value) ||\n el.state.toLowerCase().includes(this.value)\n );\n });\n displayMatched(matched, this.value);\n}", "title": "" }, { "docid": "74e4bfa69c89e2f01b25febd413ae379", "score": "0.5812339", "text": "quickSearchFilter(data) {\n const { columns, quickSearch } = this.props;\n return data.filter((item) => {\n for (const col of columns) {\n if (!col.field || (typeof item[col.field] === 'undefined') || typeof item[col.field] !== 'string') {\n continue;\n }\n if (item[col.field].toLowerCase().indexOf(quickSearch.toLowerCase()) !== -1) {\n return true;\n }\n }\n return false;\n });\n }", "title": "" }, { "docid": "cc3c665d77da41051d7a50f0267b79e8", "score": "0.58080685", "text": "initSearchMethod(param, objects) {\n var qryValue = '';\n var parameters = param.split('/');\n for (let i = 0; i < objects.length; i++) {\n qryValue = this.findByRootNode(parameters, objects[i]);\n }\n return qryValue;\n }", "title": "" }, { "docid": "7680f12d2ad672e4e8f7d414635fd920", "score": "0.5807177", "text": "static async all(search, min_salary, min_equity) {\n let startingQuery = `SELECT * FROM jobs`;\n let whereValues = []\n\n if (min_salary) {\n whereValues.push(`salary >= ${min_salary}`)\n }\n if (min_equity) {\n whereValues.push(`equity >= ${min_equity}`);\n }\n if (search) {\n whereValues.push(`title ILIKE '${search}'`);\n }\n\n if (whereValues.length > 0) {\n startingQuery += ' WHERE '\n }\n\n let query = startingQuery + whereValues.join(\" AND \")\n\n let res = await db.query(query)\n return res.rows\n }", "title": "" }, { "docid": "2b2948832694c581e466177616b3c3d0", "score": "0.58054006", "text": "function search(products, term){\n // 1. create output array to collect your output []\n // 2. iterate collection .each or .reduce(hipper) \n return _.reduce(products, function(previousProducts, currentProduct, i, product){\n if(isCollection(currentProduct)){\n if (search(currentProduct, term).length){\n previousProducts.push(currentProduct); \n }\n } \n \n else if (typeof currentProduct === \"string\"){\n if(currentProduct.toLowerCase().search(term.toLowerCase()) > -1){\n previousProducts.push(currentProduct); \n }\n } \n return previousProducts;\n \n }, []);\n\n}", "title": "" }, { "docid": "03fa4331ad2a7e4d44c70269028dcffd", "score": "0.5798926", "text": "function search_users(search_term){\r\n let results = [];\r\n for(let x of users){\r\n if(x != null){\r\n console.log(x.username);\r\n console.log(search_term);\r\n if(x.username.includes(search_term) == true){\r\n console.log(\"found the letter\")\r\n results.push(x);\r\n }\r\n }\r\n }\r\n return results;\r\n}", "title": "" }, { "docid": "66fcc1ee58d54bf3c323d3b8858b0286", "score": "0.579645", "text": "function getAllFound (db = connection){\n return db('found')\n .select()\n}", "title": "" }, { "docid": "279b5ebf3b18fb01cb0738818c1ba3fa", "score": "0.5792884", "text": "function search(items, query) {\r\n\t // Fuzzy match the items for the query.\r\n\t var scores = matchItems(items, query);\r\n\t // Sort the items based on their score.\r\n\t scores.sort(scoreCmp);\r\n\t // Create the results for the search.\r\n\t return createResults(scores);\r\n\t }", "title": "" }, { "docid": "c83d0f942f0d9694993a0b6ff02dfc98", "score": "0.5791237", "text": "function searchProducts(products, searchtext) {\n for (const product of products) {\n const name = product.name;\n if (name.indexOf(searchtext.toLowerCase()) != -1) {\n console.log(name);\n }\n }\n}", "title": "" }, { "docid": "ea96cff4d30713e02918c64b39cbaf02", "score": "0.5782539", "text": "function searchEverything (theSearch) {\n\n // Create tempData object\n var tempData = [];\n //console.log('Searching everything for', theSearch ,' som är typ: ', typeof(theSearch));\n\n // Main Loop through the json\n for (var i = 0; i < jsonContent.salar.length; i ++) {\n\n // Loop through all the keys to obtain their properties\n for (const key of Object.keys(jsonContent.salar[i])) {\n let val = jsonContent.salar[i][key];\n\n // If the search matches the properties\n if (val.indexOf(theSearch) >= 0) {\n // Push the classroom ID to tempData\n tempData.push(\"Match because of property '\" + val + \"'. Classroom ID for the property is \" + jsonContent.salar[i].Salsnr\n + \" and the classroom name is \" + jsonContent.salar[i].Salsnamn);\n }\n\n }\n\n // set result\n result = tempData;\n }\n //Return the result\n return result;\n}", "title": "" }, { "docid": "fbeb803ff1606d40020c3f5d422a168c", "score": "0.5779915", "text": "function performSearch(keywords)\n{\n // Check to make sure they entered some search terms\n if (!keywords || keywords.length == 0)\n {\n return ERR_NoSearchTerms;\n }\n\n searchDescription = true;\n searchHeading = true\n\n // Setting up the keywords array for searching\n // Remove common punctuation\n keywords = keywords.replace(\"\\.,'\", \"\");\n\n // get them all into an array so we can loop thru them\n // we assume a space was used to separate the terms\n searchFor = keywords.split(\" \");\n\n // This is where we will be putting the results.\n results = new Array();\n\n // Loop through the db for potential results\n // For every entry in the \"database\"\n for (sDB = 0; sDB < searchDB.length; sDB++)\n {\n\n // For every search term we are working with\n for (t = 0; t < searchFor.length; t++)\n {\n // Check in the heading for the term if required\n if (searchHeading)\n {\n if (searchDB[sDB].heading.toLowerCase().indexOf(searchFor[t].toLowerCase()) != -1)\n {\n if (!in_array(String(sDB), results))\n {\n results[results.length] = String(sDB);\n }\n }\n }\n\n // Check in the description for the term if required\n if (searchDescription)\n {\n if (searchDB[sDB].description.toLowerCase().indexOf(searchFor[t].toLowerCase()) != -1)\n {\n if (!in_array(String(sDB), results))\n {\n results[results.length] = String(sDB);\n }\n }\n }\n }\n }\n\n if (results.length > 0)\n {\n return results;\n }\n else\n {\n return ERR_NoResults;\n }\n}", "title": "" }, { "docid": "bcfa11a94c381dbf089d5862ea5ea1e5", "score": "0.5772624", "text": "function searchSpecific() {\n const editor = getEditor();\n const query = getSelectedText(editor);\n const docsets = getDocsets();\n const dash = new dash_1.Dash(OS, getDashOption());\n child_process_1.exec(dash.getCommand(query, docsets));\n}", "title": "" }, { "docid": "35b64ede55f12d434dc257bda33ff686", "score": "0.57723504", "text": "function search(text, searchType){\n // returns an array-like object of all child elements of the given class\n var docs = document.getElementsByClassName(\"metadatasearch\");\n var holder = document.getElementsByClassName(\"metadataholder\");\n\n for (var i = 0; i < docs.length; i++){\n // textContent gets the content of all elements\n // innerText only shows “human-readable” elements\n var txtValue = docs[i].textContent || docs[i].innerText;\n var textArray = text.split(', ');\n var res = false;\n for (var j = 0; j < textArray.length; j++)\n // If searchType is true - check existing bata for each serch query\n if (searchType){\n if (txtValue.toLowerCase().includes(textArray[j].toLowerCase())){\n res = true;\n } else {\n res = false;\n break;\n }\n // If searchType is false - return all the data\n } else {\n if (txtValue.toLowerCase().includes(textArray[j].toLowerCase()))\n res = true;\n }\n if (res){\n holder[i].style.display = \"\";\n } else {\n holder[i].style.display = \"none\";\n }\n }\n }", "title": "" }, { "docid": "22aba167f771414fc9f7d8326d34ad3a", "score": "0.5768077", "text": "onSearch(){\n\n // Getting the user input from the client\n let searchedUser = this.store.get(\"$page.filter.user\");\n\n // Getting the date input from the client\n let searchedDate = this.store.get('$page.filter.date');\n\n // Getting the description input from the client\n let searchedDocumentName = this.store.get('$page.filter.description');\n \n // Getting the full list of store data\n let data = [];\n let entries = Object.entries(this.store.get(\"$page.data\"));\n entries.forEach( item => data.push(item[1]));\n\n // the array used to gather all filtered data\n let finalResult = [];\n\n // full search for users, lastModified and description\n if(searchedUser != null && searchedDate != null && searchedDocumentName != null){\n console.log(\"1\") // used for debugging purposes\n let desiredDateFormat = this.formatDate(searchedDate); \n data.forEach(item => {\n if(item.user == searchedUser &&\n this.compareDates(desiredDateFormat, item.lastModified) && \n ((item.document).toLowerCase().includes(searchedDocumentName)) || item.description.includes(searchedDocumentName)) finalResult.push(item);\n });\n }\n\n // couples - filtering by input of two given search fields\n if(searchedDocumentName, searchedDate != null && searchedUser == null){\n console.log(\"2A\") // used for debugging purposes\n let desiredDateFormat = this.formatDate(searchedDate);\n data.forEach(item => {\n if (this.compareDates(desiredDateFormat, item.lastModified) && (item.document).toLowerCase().includes(searchedDocumentName)) finalResult.push(item);\n })\n }\n if(searchedDocumentName, searchedUser != null && searchedDate == null){\n console.log(\"2B\") // used for debugging purposes\n data.forEach(item => {\n if(item.user == searchedUser && (item.document).toLowerCase().includes(searchedDocumentName)) finalResult.push(item);\n });\n }\n if(searchedUser, searchedDate != null && searchedDocumentName == null){\n console.log(\"2C\") // used for debugging purposes\n let desiredDateFormat = this.formatDate(searchedDate);\n data.forEach(item => {\n if(this.compareDates(desiredDateFormat, item.lastModified) && item.user == searchedUser) finalResult.push(item);\n });\n }\n\n\n // singles - filtering by input given only by one search field\n\n // single-description\n if(searchedUser, searchedDate == null && searchedDocumentName != null){\n console.log(\"3A\") // used for debugging purposes\n data.forEach(item => {\n if((item.document).toLowerCase().includes(searchedDocumentName)) finalResult.push(item); \n });\n }\n\n // single-lastModified\n if(searchedUser, searchedDocumentName == null && searchedDate != null){\n console.log(\"3B\") // used for debugging purposes\n let desiredDateFormat = this.formatDate(searchedDate);\n data.forEach(item => {\n if(this.compareDates(desiredDateFormat, item.lastModified)) finalResult.push(item); \n });\n }\n // user part not activated because i haven't been able to do the multi-user functionality\n // if(searchedUser, searchedDate != null && searchedDocumentName == null){\n // data.filter(item => {\n // this.compareDates(desiredDateFormat, item.lastModified) && item.user == searchedUser;\n // });\n // }\n \n\n \n // final mapping of filtered data\n \n this.store.set('$page.data', \n finalResult.map((item, i) => ({\n docsId: item.docsId,\n icon: item.hasOwnProperty('folder') || item.document,\n document: item.document, \n folder: item.folder,\n user: item.user,\n lastModified: item.lastModified\n })\n ));\n }", "title": "" }, { "docid": "0678a188a0cca89213d69dcd02975879", "score": "0.5751079", "text": "function searchCoffee() {\n var i, filter, roastSelect;\n var filteredRoast = [];\n var filteredCoffees = [];\n filter = document.getElementById('mySearch').value.toLowerCase();\n roastSelect = document.getElementById('roast-selection').value;\n\n for (i = 0; i < coffees.length; i++) {\n var coffee = coffees[i];\n // console.log(i);\n // console.log(input);\n console.log(filter);\n // if (coffee.name.toLowerCase().indexOf(filter)> -1){\n if (coffee.roast === roastSelect ){\n console.log(coffee.name);\n filteredRoast.push(coffee);\n }\n\n }\n\n // input = document.getElementById('mySearch');\n\n for (i = 0; i < filteredRoast.length; i++) {\n var coffee = coffees[i];\n // console.log(i);\n // console.log(input);\n console.log(filter);\n // if (coffee.name.toLowerCase().indexOf(filter)> -1){\n if (coffee.name.toLowerCase().search(filter) != -1){\n console.log(coffee.name);\n filteredCoffees.push(coffee);\n }\n\n } tbody.innerHTML = renderCoffees(filteredCoffees);\n}", "title": "" }, { "docid": "9fa3eb13b9bc3a3dfdb0c31510de5c8a", "score": "0.574423", "text": "async function search(userInput) {\n const res = await query(\n `SELECT * FROM library WHERE title ILIKE '%${userInput}%' OR \n author ILIKE '%${userInput}%' OR \n series ILIKE '%${userInput}%' OR\n genre ILIKE '%${userInput}%'\n;`\n );\n return res.rows;\n}", "title": "" }, { "docid": "2b8604beb08c90d2726bf85aa5fb3627", "score": "0.57424664", "text": "function getResults() {\n var searchText = document.getElementById('search').value;\n\n odkData.query('femaleClients', 'client_id = ?', [searchText], \n null, null, null, null, null, null, true, cbSRSuccess, cbSRFailure);\n}", "title": "" }, { "docid": "cb05cda333a0788ed0ef1ff7d75d79ea", "score": "0.5739295", "text": "function search(items, query) {\n // Fuzzy match the items for the query.\n var scores = matchItems(items, query);\n // Sort the items based on their score.\n scores.sort(scoreCmp);\n // Create the results for the search.\n return createResults(scores);\n }", "title": "" }, { "docid": "8fde5ce5fc4cbffde9d6423bdb927299", "score": "0.57370335", "text": "static search(str, sourceArray, searchByArray, linkedTableArray=[]) {\n if(!str)\n return sourceArray // pass through if no search string; simplifies chaining\n\n return sourceArray.filter(function(obj) {\n let searchterm = str.toLowerCase()\n for (let field of searchByArray) {\n // console.log('search', str, obj.get(field) )\n if(obj.fields[field]) {\n if(typeof(obj.fields[field]) == 'string') {\n if (obj.fields[field].toLowerCase().includes(searchterm)) return true\n }\n else if(Array.isArray(obj.fields[field])) {\n // if it's an array of strings (e.g. multiple list)\n // linked records are also a list of strings, so we have to check for a string match\n // every time we see an array\n for (let strField of obj.fields[field]) {\n if (strField.toLowerCase().includes(searchterm)) return true\n }\n\n if (linkedTableArray.length > 0) {\n for (let linkedTable of linkedTableArray) {\n const records = Cytosis.getLinkedRecords(obj.fields[field], linkedTable, true)\n // console.log('search array', records)\n for (let record of records) {\n // for linked records, only match against the name\n if (record.fields['Name'].toLowerCase().includes(searchterm)) return true\n }\n }\n }\n\n }\n }\n }\n return false // no match\n\n })\n }", "title": "" }, { "docid": "6f5d8bed96945f451391c4c5e0b79379", "score": "0.57338303", "text": "function doSearch() {\n let searchString = document.getElementById('search-input').value.toLowerCase();\n\n let nameArray = [];\n \n for (let i = 0; i < window.data.results.length; i++) {\n let user = window.data.results[i];\n\n let name = `${user.name.first} ${user.name.last}`.toLowerCase();\n nameArray.push(name);\n }\n\n let resultIndexes = [];\n for (let i = 0; i < nameArray.length; i++) {\n if (nameArray[i].includes(searchString)) {\n resultIndexes.push(i);\n }\n }\n\n\n showResultCards(resultIndexes);\n}", "title": "" }, { "docid": "76e5f8d22cf895027796b9e7bfa0d4a3", "score": "0.573261", "text": "search(searchPhrase, list) {\n return listOfResults;\n }", "title": "" }, { "docid": "4f59b8b654b2ed3fd6232cab78e8aea4", "score": "0.5730769", "text": "searchData(data, searchTerms) {\n\n\t\t\tlet _this = this;\n\t\t\tlet folders = [];\n\t\t\tlet files = [];\n\n\t\t\tlet _searchData = function (data, searchTerms) { \n\t\t\tdata.forEach(function(d){\n\t\t\t\tif(d.type === 'folder') {\n\n\t\t\t\t\t\t_searchData(d.items,searchTerms);\n\n\t\t\t\t\t\tif(d.name.toLowerCase().indexOf(searchTerms) >= 0) {\n\t\t\t\t\t\tfolders.push(d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(d.type === 'file') {\n\t\t\t\t\t\tif(d.name.toLowerCase().indexOf(searchTerms) >= 0) {\n\t\t\t\t\t\tfiles.push(d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t};\n\t\t\t\n\t\t\t_searchData(data, searchTerms);\n\t\t\t\n\t\t\treturn {folders: folders, files: files};\n\t\t}", "title": "" }, { "docid": "b7e5ca8c8d8fad77a3785de0c5cec3bc", "score": "0.5729437", "text": "function runMatch() { \n // console.log(\"Filtering by City\");\n var textInput = document.querySelector('input');\n var wordToMatch = (textInput.value);\n // console.log(\"Found the term: \" + wordToMatch);\n var results = findMatches(wordToMatch, cities); \n console.log(wordToMatch); \n // console.log(\"There were \" + results.length + \" results found.\");\n // console.table(results);\n return results\n}", "title": "" }, { "docid": "05633880cab07c28921080aab8f19146", "score": "0.57269484", "text": "function findByArtist(artist){\n// Create an array to hold any results, empty to start\n let matches=[]; \n // Loop through the `collection` and add any objects with a matching artist to the array.\n for (let i=0; i<collection.length; i++){\n if( artist === collection[i].artist ){\n matches.push( collection[i] );\n } // end match\n // Return the array with the matching results. If no results are found, return an empty array.\n }//end function\n return matches;\n}", "title": "" }, { "docid": "d2936ee6d6a67727d6f9e11a15d326fb", "score": "0.5726617", "text": "function search() {\r\n var arr = []; //create empty array\r\n for (let x of names) {\r\n if ((x.children[0].children[1].textContent).indexOf(input.value) != -1) //if keyword is found...\r\n arr.push(x); //add the names to the array\r\n }\r\n \r\n return arr; //return the updated array of names\r\n \r\n \r\n}", "title": "" }, { "docid": "d6740aa0e35803073642f8fbc92bc3d4", "score": "0.57255524", "text": "function search(text){\n const filteredArray=[];\n for(let i=0; i<data.length; i++){\n let person=data[i];\n let name=`${person.name.title.toUpperCase()} ${person.name.first.toUpperCase()} ${person.name.last.toUpperCase()}`;\n if(name.includes(text.toUpperCase())){\n filteredArray.push(data[i]);\n }\n }\n if(filteredArray.length==0){\n return 'undefined';\n }else{\n return filteredArray;\n }\n}", "title": "" }, { "docid": "85cdbda53cd0bbd51df360ceb5764de9", "score": "0.57214063", "text": "search_results() {\n const param = FlowRouter.getParam('searchParam');\n let findParams = { recipeName: { $regex: `${param}` } };\n if (param === '*') {\n findParams = {};\n }\n const results = Recipes.find(findParams, { sort: { viewcount: -1 } }).fetch();\n\n let tagSearchArr = param.split(',');\n tagSearchArr = _.map(tagSearchArr, function snip(term) { return term[0] === ' ' ? term.substr(1) : term; });\n const tagSearchMap = _.map(tagSearchArr, function searchterm(term) { return { tagName: term }; });\n const tagSearchResults = Tags.find({ $or: tagSearchMap }, { fields: { recipeID: 1 } }).fetch();\n const tagSearchResultsRenamed = _.map(tagSearchResults, function rename(item) { return { _id: item.recipeID }; });\n if (tagSearchResultsRenamed.length > 0) {\n const tagSearch = Recipes.find({ $or: tagSearchResultsRenamed }, { }).fetch();\n results.push(tagSearch);\n }\n const flatresults = _.uniq(_.flatten(results, true), function isUniq(key) {\n return key._id;\n });\n Template.instance().numResults.set(flatresults.length);\n return flatresults;\n }", "title": "" }, { "docid": "724883c84b78545ab123188209ae8ead", "score": "0.5720953", "text": "function performSearch(keywords)\r\n{\r\n // Check to make sure they entered some search terms\r\n if (!keywords || keywords.length == 0)\r\n {\r\n return ERR_NoSearchTerms;\r\n }\r\n\r\n searchDescription = true;\r\n searchHeading = true\r\n\r\n // Setting up the keywords array for searching\r\n // Remove common punctuation\r\n keywords = keywords.replace(\"\\.,'\", \"\");\r\n\r\n // get them all into an array so we can loop thru them\r\n // we assume a space was used to separate the terms\r\n searchFor = keywords.split(\" \");\r\n\r\n // This is where we will be putting the results.\r\n results = new Array();\r\n\r\n // Loop through the db for potential results\r\n // For every entry in the \"database\"\r\n for (sDB = 0; sDB < searchDB.length; sDB++)\r\n {\r\n\r\n // For every search term we are working with\r\n for (t = 0; t < searchFor.length; t++)\r\n {\r\n // Check in the heading for the term if required\r\n if (searchHeading)\r\n {\r\n if (searchDB[sDB].heading.toLowerCase().indexOf(searchFor[t].toLowerCase()) != -1)\r\n {\r\n if (!in_array(String(sDB), results))\r\n {\r\n results[results.length] = String(sDB);\r\n }\r\n }\r\n }\r\n\r\n // Check in the description for the term if required\r\n if (searchDescription)\r\n {\r\n if (searchDB[sDB].description.toLowerCase().indexOf(searchFor[t].toLowerCase()) != -1)\r\n {\r\n if (!in_array(String(sDB), results))\r\n {\r\n results[results.length] = String(sDB);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (results.length > 0)\r\n {\r\n return results;\r\n }\r\n else\r\n {\r\n return ERR_NoResults;\r\n }\r\n}", "title": "" }, { "docid": "66e3cefcd4bfd3f6c38f0a1774615198", "score": "0.5711612", "text": "function _search() {\n return {\n /**\n * Get Record by record_id\n * @method byRecordId\n * @private\n * @param {String} record id\n * @returns {Object} record hash\n */\n byRecordId: function (rid, options) {\n if (rid === undefined) {\n throw 'You must supply a record id'\n }\n\n var institution = (options !== undefined) && (options['institution'] !== undefined) ? options['institution'] : jQuery.PRIMO.session.view.institution.code;\n var index = (options !== undefined) && (options['index'] !== undefined) ? options['index'] : 1;\n var bulkSize = (options !== undefined) && (options['bulkSize'] !== undefined) ? options['bulkSize'] : 10;\n\n\n var result = [];\n\n jQuery.get('/PrimoWebServices/xservice/search/brief?institution=' + institution + '&query=rid,contains,' + rid +\n '&indx=' + index + '&bulkSize=' + bulkSize)\n .done(function (data) {\n result = $(_xml2json(data));\n })\n .fail(function (data) {\n console.log('error searching')\n });\n\n return result;\n },\n /**\n * Get Record by a query in the form of index,match type,query\n * @method byQuery\n * @private\n * @param {String} query\n * @returns {Object} record hash\n */\n byQuery: function (query, options) {\n var result = [];\n try {\n\n var institution = (options !== undefined) && (options['institution'] !== undefined) ? options['institution'] : jQuery.PRIMO.session.view.institution.code;\n var index = (options !== undefined) && (options['index'] !== undefined) ? options['index'] : 1;\n var bulkSize = (options !== undefined) && (options['bulkSize'] !== undefined) ? options['bulkSize'] : 10;\n var apiKey = (options !== undefined) && (options['apiKey'] !== undefined) ? options['apiKey'] : null;\n var regionURL = (options !== undefined) && (options['regionURL'] !== undefined) ? options['regionURL'] : 'https://api-eu.hosted.exlibrisgroup.com';\n\n var restAPI = (options !== undefined) && (options['restAPI'] !== undefined) ? options['restAPI'] : false;\n\n //REGIONURL\n // America https://api-na.hosted.exlibrisgroup.com\n // EU https://api-eu.hosted.exlibrisgroup.com\n // APAC https://api-ap.hosted.exlibrisgroup.com\n\n if (!Array.isArray(query)) {\n query = [query];\n }\n\n if (restAPI) {\n var restURL = 'q=' + query.join(';') + '&inst=' + institution + '&offset=' + index + '&limit=' + bulkSize;\n if (apiKey) {\n restURL = regionURL + '/primo/v1/pnxs?' + restURL + '&apikey=' + apiKey;\n }else{\n restURL = '/primo_library/libweb/webservices/rest/v1/pnxs?' + restURL;\n }\n\n jQuery.ajax({\n async: false,\n cache: false,\n type: 'get',\n dataType: 'json',\n url: restURL,\n beforeSend: function(jqXHR, s){\n // removes auto injected header by ExL, prevents CORS error\n }\n })\n .done(function (data, event, xhr) {\n if (typeof data == \"string\"){\n result = JSON.parse(data);\n } else {\n result = data;\n }\n })\n .fail(function (data, event, xhr) {\n console.log('error searching', e.message)\n });\n \n return result;\n } else {\n var tmpQuery = \"\";\n jQuery.each(query, function (index, value) {\n tmpQuery += '&query=' + value;\n });\n\n query = tmpQuery;\n\n jQuery.ajax(\n {\n async: false,\n cache: false,\n type: 'get',\n dataType: 'xml',\n url: '/PrimoWebServices/xservice/search/brief?institution=' + institution + '&indx=' + index + '&bulkSize=' + bulkSize + query\n })\n .done(function (data, event, xhr) {\n result = $(_xml2json(data));\n })\n .fail(function (data, event, xhr) {\n console.log('error searching', e.message)\n });\n\n\n if (result.length > 0 && result[0].hasOwnProperty('JAGROOT')) {\n return result[0].JAGROOT.RESULT.DOCSET.DOC;\n } else if (result.length > 0 && result[0].hasOwnProperty('MESSAGE')) {\n console.log(result[0].MESSAGE);\n }\n }\n } catch (e) {\n console.log('error searching: ', e.message);\n }\n\n return null;\n }\n }\n}", "title": "" }, { "docid": "9d250e8f251e41cfdf92d7af302967f2", "score": "0.5708609", "text": "function search(items, query) {\r\n // Fuzzy match the items for the query.\r\n var scores = matchItems(items, query);\r\n // Sort the items based on their score.\r\n scores.sort(scoreCmp);\r\n // Create the results for the search.\r\n return createResults(scores);\r\n }", "title": "" }, { "docid": "f3f3e77129824c88d6b22b8ef9366e72", "score": "0.56976354", "text": "function findMatches(items) {\n $('.searchresults').empty();\n var searchVal = $('#searchInput').val();\n // Exits if input is empty, so that it does not also render the starred items in the search results\n if (!searchVal) return;\n\n // Loops through each item in the DB to find matches based on the search, then appends them to ul.searchresults in DOM\n items.forEach(function (item) {\n createLi(item, searchVal, '.searchresults');\n })\n}", "title": "" }, { "docid": "d3f8aa94fc485281bc04f50d20e1f419", "score": "0.5690652", "text": "function searchData(data, searchTerms) {\n\n\t\t\tdata.forEach(function(d){\n\t\t\t\tif(d.type === 'folder') {\n\n\t\t\t\t\tsearchData(d.items,searchTerms);\n\n\t\t\t\t\tif(d.name.toLowerCase().match(searchTerms)) {\n\t\t\t\t\t\tfolders.push(d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(d.type === 'file') {\n\t\t\t\t\tif(d.name.toLowerCase().match(searchTerms)) {\n\t\t\t\t\t\tfiles.push(d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {folders: folders, files: files};\n\t\t}", "title": "" }, { "docid": "f6b9b22485e03c1ca0cc60202b3520bb", "score": "0.56777894", "text": "function SearchByKeyEnter(){\n \n let results = data.filter(element=>element.name.toLowerCase().startsWith(inputValue.value) || element.capital.toLowerCase().startsWith(inputValue.value) || element.region.toLowerCase().startsWith(inputValue.value));\n\n displayData(results);\n \n}", "title": "" }, { "docid": "b1b428aa7ef2a78abe549c55fd7e7b93", "score": "0.5665267", "text": "function searchByAuthor(author) {\n // TODO\n}", "title": "" }, { "docid": "c71316813c791cd483bb3b666b45a66c", "score": "0.56645036", "text": "search(e) {\n let query = e.target.closest(\"input\").value;\n searchFunctions.retrieve(query);\n }", "title": "" }, { "docid": "6e9c880ceef647a3890bed209eabcca9", "score": "0.5662617", "text": "function getEnergyCompanys(res, mysql, context, searched, filters_name, filters_arr, complete){\n if (searched === 0){\n var default_search =\"\";\n name_query = default_search.replace(\";\",\"\");\n var inserts = ['[0-9]*', 0, Math.pow(2,127)];\n }\n else{\n name_query = filters_name.replace(\";\",\"\");//protect against stopping query\n var inserts;\n inserts = filters_arr;\n if (filters_arr[0] === \"-\"){\n inserts[0] = '[0-9]*';\n }\n }\n var sql = \"SELECT DISTINCT c.energy_company_id, c.energy_company_name, c.net_worth FROM energy_company AS c \"\n + \"LEFT JOIN energy_plant_company AS pc ON c.energy_company_id = pc.energy_company_id \"\n + \"WHERE pc.energy_plant_id REGEXP ? AND c.energy_company_name LIKE '%\"+name_query+\"%' AND (c.net_worth>=? AND c.net_worth<=?)\";\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.energy_companys = results;\n complete();\n });\n }", "title": "" }, { "docid": "0e82eb12ca1f9aa4eb6d7edd773e8849", "score": "0.5652595", "text": "function local(options){var data=options, // data elements\ndataText,tmp,text=function text(item){return \"\"+item.text;}; // function used to retrieve the text portion of a data item that is matched against the search\nif($.isArray(data)){tmp=data;data={results:tmp};}if($.isFunction(data)===false){tmp=data;data=function data(){return tmp;};}var dataItem=data();if(dataItem.text){text=dataItem.text; // if text is not a function we assume it to be a key name\nif(!$.isFunction(text)){dataText=dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available\ntext=function text(item){return item[dataText];};}}return function(query){var t=query.term,filtered={results:[]},_process;if(t===\"\"){query.callback(data());return;}_process=function process(datum,collection){var group,attr;datum=datum[0];if(datum.children){group={};for(attr in datum){if(datum.hasOwnProperty(attr))group[attr]=datum[attr];}group.children=[];$(datum.children).each2(function(i,childDatum){_process(childDatum,group.children);});if(group.children.length||query.matcher(t,text(group),datum)){collection.push(group);}}else {if(query.matcher(t,text(datum),datum)){collection.push(datum);}}};$(data().results).each2(function(i,datum){_process(datum,filtered.results);});query.callback(filtered);};} // TODO javadoc", "title": "" }, { "docid": "4333211876b4d1cedf3219452472d65d", "score": "0.5652292", "text": "function ArrObjSearch() {\n // number of objects in the collection\n this._size = 0;\n // search object values\n this._hash = new Object();\n this._size = 0;\n }", "title": "" }, { "docid": "cd6c578609fb8632b912d35e76b7b987", "score": "0.56514406", "text": "function search() {\n var groceryStores = [];\n \n\n // There are 8 different combinations of searches for 3 different search feilds.\n // Fruits are reviews. Fruits only exist if there are reviews.\n // 1 = populated 0 = empty\n // fruit,grocery,location\n // 000 = display some recent fruit and grocery pages in the system for location gotten by ip address or profile indicated location.\n // 001 = display some grocery stores for this location.\n // 010 = display some grocery stores from location gotten by ip address or profile indicated location.\n // 011 = display some grocery stores for the given location\n // 100 = display some fruit-grocery links existing in the database for location gotten by ip address or profile indicated location.\n // 101 = display some fruit-grocery links existing in the database for the given location.\n // 110 = display some fruit-grocery links existing in the database for given grocery store and location gotten by ip address or \n // profile indicated location.\n // 111 = display some fruit-grocery links existing in the database for given fruit, grocery store, and location.\n\n\n if (vm.fruit === \"empty\") {\n vm.searchComb = \"0\";\n } else {\n vm.searchComb = \"1\";\n }\n if (vm.grocery === \"empty\") {\n vm.searchComb += \"0\";\n } else {\n vm.searchComb += \"1\";\n }\n if (vm.location === \"empty\") {\n vm.searchComb += \"0\";\n } else {\n vm.searchComb += \"1\";\n }\n\n switch (parseInt(vm.searchComb, 2)) {\n case 0:\n // TODO: Aggregate all reviews from the grocery stores\n // then display the top ones by fruit.\n var location = default_location;\n if (vm.currentUser && vm.currentUser.location) {\n location = vm.currentUser.location;\n }\n \n GroceryService\n .findGroceryStoresByLocation(location)\n .then(\n function (groceryStores) {\n vm.results = groceryStores;\n }\n );\n break;\n case 1:\n GroceryService\n .findGroceryStoresByLocation(vm.location)\n .then(\n function (groceryStores) {\n vm.results = groceryStores;\n }\n );\n break;\n case 2:\n var location = default_location;\n if (vm.currentUser && vm.currentUser.location) {\n location = vm.currentUser.location;\n }\n\n GroceryService\n .findGroceryStoresByNameAndLocation(vm.grocery, location)\n .then(\n function (groceryStores) {\n vm.results = groceryStores;\n }\n );\n break;\n case 3:\n GroceryService\n .findGroceryStoresByNameAndLocation(vm.grocery, vm.location)\n .then(\n function (groceryStores) {\n vm.results = groceryStores;\n }\n );\n break;\n\n case 4:\n var location = default_location;\n if (vm.currentUser && vm.currentUser.location) {\n location = vm.currentUser.location;\n }\n GroceryService\n .findGroceryStoresByLocation(location)\n .then(\n function (groceryStores) {\n getReviewResultsFromGroceryStores(vm.fruit, groceryStores);\n }\n );\n break;\n case 5:\n GroceryService\n .findGroceryStoresByLocation(vm.location)\n .then(\n function (results) {\n groceryStores = results;\n getReviewResultsFromGroceryStores(vm.fruit, groceryStores);\n }\n );\n break;\n case 6:\n var location = default_location;\n if (vm.currentUser && vm.currentUser.location) {\n location = vm.currentUser.location;\n }\n GroceryService\n .findGroceryStoresByNameAndLocation(vm.grocery, location)\n .then (\n function (results) {\n groceryStores = results;\n getReviewResultsFromGroceryStores(vm.fruit, groceryStores);\n }\n );\n break;\n case 7:\n GroceryService\n .findGroceryStoresByNameAndLocation(vm.grocery, vm.location)\n .then(\n function (results) {\n groceryStores = results;\n getReviewResultsFromGroceryStores(vm.fruit, groceryStores);\n }\n );\n break;\n default:\n // Just display no results found.\n }\n }", "title": "" }, { "docid": "59c22007d368f6f8d7b444ab59aba91e", "score": "0.5645494", "text": "function single_query(collection,form,param){\n var value = form.elements.namedItem(param).value;\n var comp = \"==\"\n if(value == \"\"){\n comp = \">=\";\n }\n console.log(param,comp,value);\n var ids = new Array();\n collection.where(param, comp, value)\n .get()\n .then(function(querySnapshot) {\n querySnapshot.forEach(function(doc) {\n //console.log(doc.data());\n ids.push(doc.id);\n });\n })\n return ids;\n}", "title": "" }, { "docid": "0002a4fb47c3f8b66568425094fdb9b4", "score": "0.5641282", "text": "function search() {\n\t\tconst search = document.querySelector('input').value;\n\t\tlet students = [];\n\t\tfor(let i=0; i<list.length; i++) {\n\t\t\tlet student = `${list[i].name.first} ${list[i].name.last}`;\n\t\t\tif(student.toLowerCase().includes(search.toLowerCase())) {\n\t\t\t\tstudents.push(list[i]);\n\t\t\t}\n\t\t}\n\t\tif(students.length === 0) {\n\t\t\tdocument.querySelector('.student-list').innerHTML = 'No results found';\n\t\t\taddPagination(students);\n\t\t} else {\n\t\t\tshowPage(students, 1);\n\t\t\taddPagination(students);\n\t\t}\n\t}", "title": "" }, { "docid": "6fa61454c7a0989794f8e4c3b0ec93cc", "score": "0.5641255", "text": "function doSearch(databaseid, params, cb) {\n\tvar res;\n\tvar stope = {};\n\tvar fromdata;\n\tvar selectors = cloneDeep(this.selectors);\n\n\tfunction processSelector(selectors, sidx, value) {\n\t\t//\t\tvar val;\n\n\t\tvar val, // temp values use many places\n\t\t\tnest, // temp value used many places\n\t\t\tr, // temp value used many places\n\t\t\tsel = selectors[sidx];\n\n\t\t//\t\tif(!alasql.srch[sel.srchid]) {\n\t\t//\t\t\tthrow new Error('Selector \"'+sel.srchid+'\" not found');\n\t\t//\t\t};\n\n\t\tvar SECURITY_BREAK = 100000;\n\n\t\tif (sel.selid) {\n\t\t\t// TODO Process Selector\n\t\t\tif (sel.selid === 'PATH') {\n\t\t\t\tvar queue = [{node: value, stack: []}];\n\t\t\t\tvar visited = {};\n\t\t\t\t//var path = [];\n\t\t\t\tvar objects = alasql.databases[alasql.useid].objects;\n\t\t\t\twhile (queue.length > 0) {\n\t\t\t\t\tvar q = queue.shift();\n\t\t\t\t\tvar node = q.node;\n\t\t\t\t\tvar stack = q.stack;\n\t\t\t\t\tvar r = processSelector(sel.args, 0, node);\n\t\t\t\t\tif (r.length > 0) {\n\t\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\t\treturn stack;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar rv = [];\n\t\t\t\t\t\t\tif (stack && stack.length > 0) {\n\t\t\t\t\t\t\t\tstack.forEach(function(stv) {\n\t\t\t\t\t\t\t\t\trv = rv.concat(processSelector(selectors, sidx + 1, stv));\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn rv;\n\t\t\t\t\t\t\t//\t\t\t\t\t\t\treturn processSelector(selectors,sidx+1,stack);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (typeof visited[node.$id] !== 'undefined') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvisited[node.$id] = true;\n\t\t\t\t\t\t\tif (node.$out && node.$out.length > 0) {\n\t\t\t\t\t\t\t\tnode.$out.forEach(function(edgeid) {\n\t\t\t\t\t\t\t\t\tvar edge = objects[edgeid];\n\t\t\t\t\t\t\t\t\tvar stack2 = stack.concat(edge);\n\t\t\t\t\t\t\t\t\tstack2.push(objects[edge.$out[0]]);\n\t\t\t\t\t\t\t\t\tqueue.push({\n\t\t\t\t\t\t\t\t\t\tnode: objects[edge.$out[0]],\n\t\t\t\t\t\t\t\t\t\tstack: stack2,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Else return fail\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tif (sel.selid === 'NOT') {\n\t\t\t\tvar nest = processSelector(sel.args, 0, value);\n\n\t\t\t\tif (nest.length > 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'DISTINCT') {\n\t\t\t\tvar nest;\n\t\t\t\tif (typeof sel.args === 'undefined' || sel.args.length === 0) {\n\t\t\t\t\tnest = distinctArray(value);\n\t\t\t\t} else {\n\t\t\t\t\tnest = processSelector(sel.args, 0, value);\n\t\t\t\t}\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tvar res = distinctArray(nest);\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, res);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'AND') {\n\t\t\t\tvar res = true;\n\t\t\t\tsel.args.forEach(function(se) {\n\t\t\t\t\tres = res && processSelector(se, 0, value).length > 0;\n\t\t\t\t});\n\t\t\t\tif (!res) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'OR') {\n\t\t\t\tvar res = false;\n\t\t\t\tsel.args.forEach(function(se) {\n\t\t\t\t\tres = res || processSelector(se, 0, value).length > 0;\n\t\t\t\t});\n\t\t\t\tif (!res) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'ALL') {\n\t\t\t\tvar nest = processSelector(sel.args[0], 0, value);\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn nest;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, nest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'ANY') {\n\t\t\t\tvar nest = processSelector(sel.args[0], 0, value);\n\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn [nest[0]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, [nest[0]]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'UNIONALL') {\n\t\t\t\tvar nest = [];\n\t\t\t\tsel.args.forEach(function(se) {\n\t\t\t\t\tnest = nest.concat(processSelector(se, 0, value));\n\t\t\t\t});\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn nest;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, nest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'UNION') {\n\t\t\t\tvar nest = [];\n\t\t\t\tsel.args.forEach(function(se) {\n\t\t\t\t\tnest = nest.concat(processSelector(se, 0, value));\n\t\t\t\t});\n\t\t\t\tvar nest = distinctArray(nest);\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn nest;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, nest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'IF') {\n\t\t\t\tvar nest = processSelector(sel.args, 0, value);\n\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors, sidx + 1, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'REPEAT') {\n\n\t\t\t\tvar lvar,\n\t\t\t\t\tlmax,\n\t\t\t\t\tlmin = sel.args[0].value;\n\t\t\t\tif (!sel.args[1]) {\n\t\t\t\t\tlmax = lmin; // Add security break\n\t\t\t\t} else {\n\t\t\t\t\tlmax = sel.args[1].value;\n\t\t\t\t}\n\t\t\t\tif (sel.args[2]) {\n\t\t\t\t\tlvar = sel.args[2].variable;\n\t\t\t\t}\n\t\t\t\t//var lsel = sel.sels;\n\n\t\t\t\tvar retval = [];\n\n\t\t\t\tif (lmin === 0) {\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\tretval = [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (lvar) {\n\t\t\t\t\t\t\talasql.vars[lvar] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors, sidx + 1, value));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// var nests = processSelector(sel.sels,0,value).slice();\n\t\t\t\tif (lmax > 0) {\n\t\t\t\t\tvar nests = [{value: value, lvl: 1}];\n\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\twhile (nests.length > 0) {\n\t\t\t\t\t\tvar nest = nests[0];\n\n\t\t\t\t\t\tnests.shift();\n\t\t\t\t\t\tif (nest.lvl <= lmax) {\n\t\t\t\t\t\t\tif (lvar) {\n\t\t\t\t\t\t\t\talasql.vars[lvar] = nest.lvl;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar nest1 = processSelector(sel.sels, 0, nest.value);\n\n\t\t\t\t\t\t\tnest1.forEach(function(n) {\n\t\t\t\t\t\t\t\tnests.push({value: n, lvl: nest.lvl + 1});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (nest.lvl >= lmin) {\n\t\t\t\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\t\t\t\tretval = retval.concat(nest1);\n\t\t\t\t\t\t\t\t\t//return nests;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnest1.forEach(function(n) {\n\t\t\t\t\t\t\t\t\t\tretval = retval.concat(\n\t\t\t\t\t\t\t\t\t\t\tprocessSelector(selectors, sidx + 1, n)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Security brake\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif (i > SECURITY_BREAK) {\n\t\t\t\t\t\t\tthrow new Error('Security brake. Number of iterations = ' + i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn retval;\n\t\t\t} else if (sel.selid === 'OF') {\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [value];\n\t\t\t\t} else {\n\t\t\t\t\tvar r1 = [];\n\t\t\t\t\tObject.keys(value).forEach(function(keyv) {\n\t\t\t\t\t\talasql.vars[sel.args[0].variable] = keyv;\n\t\t\t\t\t\tr1 = r1.concat(processSelector(selectors, sidx + 1, value[keyv]));\n\t\t\t\t\t});\n\t\t\t\t\treturn r1;\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'TO') {\n\n\t\t\t\tvar oldv = alasql.vars[sel.args[0]];\n\t\t\t\tvar newv = [];\n\t\t\t\tif (oldv !== undefined) {\n\n\t\t\t\t\tnewv = oldv.slice(0);\n\n\t\t\t\t} else {\n\t\t\t\t\tnewv = [];\n\t\t\t\t}\n\t\t\t\tnewv.push(value);\n\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [value];\n\t\t\t\t} else {\n\t\t\t\t\talasql.vars[sel.args[0]] = newv;\n\t\t\t\t\tvar r1 = processSelector(selectors, sidx + 1, value);\n\n\t\t\t\t\talasql.vars[sel.args[0]] = oldv;\n\t\t\t\t\treturn r1;\n\t\t\t\t}\n\n\t\t\t} else if (sel.selid === 'ARRAY') {\n\t\t\t\tvar nest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length > 0) {\n\t\t\t\t\tval = nest;\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'SUM') {\n\t\t\t\tvar nest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length > 0) {\n\t\t\t\t\tvar val = nest.reduce(function(sum, current) {\n\t\t\t\t\t\treturn sum + current;\n\t\t\t\t\t}, 0);\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'AVG') {\n\t\t\t\tnest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length > 0) {\n\t\t\t\t\tval =\n\t\t\t\t\t\tnest.reduce(function(sum, current) {\n\t\t\t\t\t\t\treturn sum + current;\n\t\t\t\t\t\t}, 0) / nest.length;\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'COUNT') {\n\t\t\t\tnest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length > 0) {\n\t\t\t\t\tval = nest.length;\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'FIRST') {\n\t\t\t\tnest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length > 0) {\n\t\t\t\t\tval = nest[0];\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'LAST') {\n\t\t\t\tnest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length > 0) {\n\t\t\t\t\tval = nest[nest.length - 1];\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'MIN') {\n\t\t\t\tnest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tvar val = nest.reduce(function(min, current) {\n\t\t\t\t\treturn Math.min(min, current);\n\t\t\t\t}, Infinity);\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'MAX') {\n\t\t\t\tvar nest = processSelector(sel.args, 0, value);\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tvar val = nest.reduce(function(max, current) {\n\t\t\t\t\treturn Math.max(max, current);\n\t\t\t\t}, -Infinity);\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, val);\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'PLUS') {\n\t\t\t\tvar retval = [];\n\t\t\t\t//\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n))\n\t\t\t\tvar nests = processSelector(sel.args, 0, value).slice();\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\tretval = retval.concat(nests);\n\t\t\t\t} else {\n\t\t\t\t\tnests.forEach(function(n) {\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors, sidx + 1, n));\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tvar i = 0;\n\t\t\t\twhile (nests.length > 0) {\n\t\t\t\t\t//\t\t\t\t\tnest = nests[0];\n\t\t\t\t\t//\t\t\t\t\tnests.shift();\n\t\t\t\t\tvar nest = nests.shift();\n\n\t\t\t\t\tnest = processSelector(sel.args, 0, nest);\n\n\t\t\t\t\tnests = nests.concat(nest);\n\n\t\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\t\tretval = retval.concat(nest);\n\t\t\t\t\t\t//return retval;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnest.forEach(function(n) {\n\n\t\t\t\t\t\t\tvar rn = processSelector(selectors, sidx + 1, n);\n\n\t\t\t\t\t\t\tretval = retval.concat(rn);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// Security brake\n\t\t\t\t\ti++;\n\t\t\t\t\tif (i > SECURITY_BREAK) {\n\t\t\t\t\t\tthrow new Error('Security brake. Number of iterations = ' + i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn retval;\n\n\t\t\t} else if (sel.selid === 'STAR') {\n\t\t\t\tvar retval = [];\n\t\t\t\tretval = processSelector(selectors, sidx + 1, value);\n\t\t\t\tvar nests = processSelector(sel.args, 0, value).slice();\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\tretval = retval.concat(nests);\n\t\t\t\t\t//return nests;\n\t\t\t\t} else {\n\t\t\t\t\tnests.forEach(function(n) {\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors, sidx + 1, n));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tvar i = 0;\n\t\t\t\twhile (nests.length > 0) {\n\t\t\t\t\tvar nest = nests[0];\n\t\t\t\t\tnests.shift();\n\n\t\t\t\t\tnest = processSelector(sel.args, 0, nest);\n\n\t\t\t\t\tnests = nests.concat(nest);\n\n\t\t\t\t\tif (sidx + 1 + 1 <= selectors.length) {\n\t\t\t\t\t\tnest.forEach(function(n) {\n\t\t\t\t\t\t\tretval = retval.concat(processSelector(selectors, sidx + 1, n));\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// Security brake\n\t\t\t\t\ti++;\n\t\t\t\t\tif (i > SECURITY_BREAK) {\n\t\t\t\t\t\tthrow new Error('Loop brake. Number of iterations = ' + i);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn retval;\n\t\t\t} else if (sel.selid === 'QUESTION') {\n\t\t\t\tvar retval = [];\n\t\t\t\tretval = retval.concat(processSelector(selectors, sidx + 1, value));\n\t\t\t\tvar nest = processSelector(sel.args, 0, value);\n\t\t\t\tif (sidx + 1 + 1 <= selectors.length) {\n\t\t\t\t\tnest.forEach(function(n) {\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors, sidx + 1, n));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn retval;\n\t\t\t} else if (sel.selid === 'WITH') {\n\t\t\t\tvar nest = processSelector(sel.args, 0, value);\n\n\t\t\t\tif (nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\n\t\t\t\t\tvar r = {status: 1, values: nest};\n\t\t\t\t}\n\t\t\t} else if (sel.selid === 'ROOT') {\n\t\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t\treturn [value];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors, sidx + 1, fromdata);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error('Wrong selector ' + sel.selid);\n\t\t\t}\n\t\t} else if (sel.srchid) {\n\t\t\tvar r = alasql.srch[sel.srchid.toUpperCase()](value, sel.args, stope, params);\n\n\t\t} else {\n\t\t\tthrow new Error('Selector not found');\n\t\t}\n\n\t\tif (typeof r === 'undefined') {\n\t\t\tr = {status: 1, values: [value]};\n\t\t}\n\n\t\tvar res = [];\n\t\tif (r.status === 1) {\n\t\t\tvar arr = r.values;\n\n\t\t\tif (sidx + 1 + 1 > selectors.length) {\n\t\t\t\t//\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\tres = arr;\n\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < r.values.length; i++) {\n\t\t\t\t\tres = res.concat(processSelector(selectors, sidx + 1, arr[i]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}\n\n\tif (selectors !== undefined && selectors.length > 0) {\n\n\t\tif (\n\t\t\tselectors &&\n\t\t\tselectors[0] &&\n\t\t\tselectors[0].srchid === 'PROP' &&\n\t\t\tselectors[0].args &&\n\t\t\tselectors[0].args[0]\n\t\t) {\n\n\t\t\tif (selectors[0].args[0].toUpperCase() === 'XML') {\n\t\t\t\tstope.mode = 'XML';\n\t\t\t\tselectors.shift();\n\t\t\t} else if (selectors[0].args[0].toUpperCase() === 'HTML') {\n\t\t\t\tstope.mode = 'HTML';\n\t\t\t\tselectors.shift();\n\t\t\t} else if (selectors[0].args[0].toUpperCase() === 'JSON') {\n\t\t\t\tstope.mode = 'JSON';\n\t\t\t\tselectors.shift();\n\t\t\t}\n\t\t}\n\t\tif (selectors.length > 0 && selectors[0].srchid === 'VALUE') {\n\t\t\tstope.value = true;\n\t\t\tselectors.shift();\n\t\t}\n\t}\n\n\tif (this.from instanceof yy.Column) {\n\t\tvar dbid = this.from.databaseid || databaseid;\n\t\tfromdata = alasql.databases[dbid].tables[this.from.columnid].data;\n\t\t//selectors.unshift({srchid:'CHILD'});\n\t} else if (this.from instanceof yy.FuncValue && alasql.from[this.from.funcid.toUpperCase()]) {\n\t\tvar args = this.from.args.map(function(arg) {\n\t\t\tvar as = arg.toJS();\n\n\t\t\tvar fn = new Function('params,alasql', 'var y;return ' + as).bind(this);\n\t\t\treturn fn(params, alasql);\n\t\t});\n\n\t\tfromdata = alasql.from[this.from.funcid.toUpperCase()].apply(this, args);\n\n\t} else if (typeof this.from === 'undefined') {\n\t\tfromdata = alasql.databases[databaseid].objects;\n\t} else {\n\t\tvar fromfn = new Function('params,alasql', 'var y;return ' + this.from.toJS());\n\t\tfromdata = fromfn(params, alasql);\n\t\t// Check for Mogo Collections\n\t\tif (\n\t\t\ttypeof Mongo === 'object' &&\n\t\t\ttypeof Mongo.Collection !== 'object' &&\n\t\t\tfromdata instanceof Mongo.Collection\n\t\t) {\n\t\t\tfromdata = fromdata.find().fetch();\n\t\t}\n\n\t\t//\t\tif(typeof fromdata == 'object' && Array.isArray(fromdata)) {\n\t\t//\t\t\tselectors.unshift({srchid:'CHILD'});\n\t\t//\t\t}\n\t}\n\n\t// If source data is array than first step is to run over array\n\t//\tvar selidx = 0;\n\t//\tvar selvalue = fromdata;\n\n\tif (selectors !== undefined && selectors.length > 0) {\n\t\t// Init variables for TO() selectors\n\n\t\tif (false) {\n\t\t\tselectors.forEach(function(selector) {\n\t\t\t\tif (selector.srchid === 'TO') {\n\t\t\t\t\t//* @todo move to TO selector\n\t\t\t\t\talasql.vars[selector.args[0]] = [];\n\t\t\t\t\t// TODO - process nested selectors\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tres = processSelector(selectors, 0, fromdata);\n\t} else {\n\t\tres = fromdata;\n\t}\n\n\tif (this.into) {\n\t\tvar a1, a2;\n\t\tif (typeof this.into.args[0] !== 'undefined') {\n\t\t\ta1 = new Function('params,alasql', 'var y;return ' + this.into.args[0].toJS())(\n\t\t\t\tparams,\n\t\t\t\talasql\n\t\t\t);\n\t\t}\n\t\tif (typeof this.into.args[1] !== 'undefined') {\n\t\t\ta2 = new Function('params,alasql', 'var y;return ' + this.into.args[1].toJS())(\n\t\t\t\tparams,\n\t\t\t\talasql\n\t\t\t);\n\t\t}\n\t\tres = alasql.into[this.into.funcid.toUpperCase()](a1, a2, res, [], cb);\n\t} else {\n\t\tif (stope.value && res.length > 0) {\n\t\t\tres = res[0];\n\t\t}\n\t\tif (cb) {\n\t\t\tres = cb(res);\n\t\t}\n\t}\n\treturn res;\n}", "title": "" }, { "docid": "cc9f46b0bfb6b2b44a4e76ec4bc7742c", "score": "0.5638425", "text": "function fetchResults(searchText) {\n var items = self.$eval(itemExpr),\n term = searchText.toLowerCase();\n\n //if(angular.isFunction(items)){\n // items = items(searchText);\n //}\n\n if(angular.isArray(items)) {\n handleResults(items);\n }else if(items){\n setLoading(true);\n\n $timeout(function(){\n if(items.success){\n items.success(handleResults);\n }\n if(items.then){\n items.then(handleResults);\n }\n if(items.finally){\n items.finally(function(){\n setLoading(false);\n });\n }\n },0);\n }\n\n function handleResults(matches) {\n cache[term] = matches;\n if((searchText || '') !== (self.searchText || '')) {\n return;\n }\n\n self.matches = matches;\n\n $timeout(function() {\n self.hidden = shouldHide();\n });\n\n //if($scope.selectOnMatch){\n // selectItemOnMatch();\n //}\n //positionDropdown();\n }\n }", "title": "" }, { "docid": "7f57d349db42f19cdad8a20e24bb9d92", "score": "0.56355596", "text": "function simpleSearch(ticketId, mustHave, shouldHave, mustHaveAny) {\n var formData = {\n \"@class\" : \"com.firstlinesoftware.base.shared.dto.SearchCriteria\",\n \"type\" : null,\n \"folder\" : null,\n \"folders\" : null,\n \"content\" : null,\n \"orderBy\" : null,\n \"descending\" : false,\n \"limit\" : 0,\n \"maxPermissionChecks\" : -1,\n \"maxPermissionCheckTimeMillis\" : -1,\n \"mustHaveRanges\" : {},\n \"shouldHaveRanges\" : {},\n \"shouldHaveDateRanges\" : [],\n \"mustHaveDateRanges\" : [],\n \"shouldHave\" : shouldHave,\n \"mustHaveGroups\" : [],\n \"mustHave\" : mustHave,\n \"shouldHaveGroups\" : [],\n \"mustNotHave\" : [],\n \"mustBeNull\" : [],\n \"mustBeNotNull\" : [],\n \"shouldHaveDepartments\" : [],\n \"mustHaveDepartments\": [],\n \"shouldHaveAny\" : [],\n \"mustHaveAny\" : mustHaveAny,\n \"mustHaveAspect\" : [],\n \"mustNotHaveAspect\" : [],\n \"shouldHaveParent\" : [],\n \"mustHaveParent\" : [],\n \"mustNotHaveParent\" : [],\n \"id\" : null\n };\n\n $.ajax({\n url: serverUrl + \"/dispatch.rest/usecases/searchDocuments?ticket=\" + ticketId + \"&locale=ru\",\n type: 'POST',\n data: JSON.stringify(formData),\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n success: function (result) {\n $(\"#search_center_tree\").removeClass(\"loading\");\n $(\"#search_button\").prop(\"disabled\", false);\n $(\".cancel_from_search\").prop(\"disabled\", false);\n $(\".new_search\").prop(\"disabled\", false);\n $(\"#full_search\").prop(\"disabled\", false);\n var imageCount = 1;\n $.each(result.dtos, function (key, value) {\n centerTreeAppender(ticketId, value, imageCount, \"search_center_tree\", {});\n imageCount++;\n });\n\n if (result.dtos.length == 0 && $(\"#nothing_found\").length == 0) {\n $(\"#search_center_tree\").append(\"<div id='nothing_found' style='font-style: italic; text-align: center; color: #808080;'>Ничего не найдено</div>\");\n }\n },\n error: function (ex) {\n }\n });\n}", "title": "" }, { "docid": "a1e51ffaf54ffd678f607e6a3e4489bf", "score": "0.56314355", "text": "find( ident ) {\n // if ( id === null && name === null && arguments[ 0 ] ) {\n // console.log(arguments[0])\n // id = arguments[ 0 ] // accept non-object param as id\n // }\n if (this._data.has(ident)) return [ this._data.get(ident) ]\n\n let matches = this.values.filter( v => v.name === ident )\n if ( matches.length > 0 ) return matches \n \n matches = this.values.filter( v => v.name.indexOf( ident ) > -1 )\n return matches\n \n }", "title": "" }, { "docid": "a055273737a67f94104540ba6781e490", "score": "0.56313", "text": "search(value) {\n\t}", "title": "" }, { "docid": "9b03d9649884cdabd68612dbb58b2028", "score": "0.5631277", "text": "static searchOrganizations(keywords, wareType) {\n let query = Organization.query();\n query.where(\"name like '%\" + keywords + \"%'\");\n if (wareType)\n query.where(\"ware_type = \" + wareType);\n else\n query.where(\"ware_type = 2\");\n \n query.order(\"id\", true);\n\n return new Promise( (resolve, reject) => {\n Organization.exec(query).then( list => {\n resolve(list);\n }).catch(error => {\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "65b1910692a98a554c6a04dbdf0be9f5", "score": "0.56286275", "text": "function searchEmployees(input) {\n personGallery.innerHTML = '';\n let filteredResults = [];\n dataArray.forEach(person => {\n let fullName = `${person.name.first} ${person.name.last}`\n if (fullName.toLowerCase().includes(input.toLowerCase())) {\n filteredResults.push(person);\n generateGallery(filteredResults);\n cardHandler(filteredResults);\n }\n });\n if (filteredResults.length === 0) {\n personGallery[0].innerHTML = '<h1>Sorry, no results found.</h1>';\n }\n}", "title": "" }, { "docid": "cae93b8972d3424bd5b411024f0fa551", "score": "0.56118673", "text": "function search(req, res, next) {\n searched_results = []; //reset array to empty\n\n //loops through all the arrays objects\n for(var i = 0; i < result.length; i++) {\n\n //checks if country, state, and date match, accepts all if one or more is left blank\n if(result[i]['Country/Region'] == req.body.country || req.body.country == '') {\n if(result[i]['Province/State'] == req.body.state ||req.body.state == '') {\n if(req.body.date == '' || ReformatDate(result[i]['ObservationDate']) == req.body.date) {\n //checks if confirmed, deaths, and recovered are above minimum values\n if(parseInt(result[i]['Confirmed']) >= parseInt(req.body.Confirmed)) {\n if(parseInt(result[i]['Deaths']) >= parseInt(req.body.Deaths)) { \n if(parseInt(result[i]['Recovered']) >= parseInt(req.body.Recovered)) {\n searched_results.push(result[i]);\n }\n }\n }\n }\n }\n }\n }\n next();\n}", "title": "" }, { "docid": "040f7b9d8d9b3a1c9bc892ba8a380262", "score": "0.5606024", "text": "search(value) {\n // Create a regexp expression with the search value\n const search = new RegExp(this.escapeRegExp(value), \"gi\");\n\n // Runs filter function on Employee Array\n return this.show().filter((element) =>\n\n // Each element is an object. Construct an array of their values for each element\n Object.values(element).some((e) =>\n // Check if search value matches any of the object's values. Return true if it does\n search.test(e)));\n }", "title": "" }, { "docid": "aad59d201b5c0b11065abb511bbd0827", "score": "0.5601772", "text": "function findAllResWithKey(req, res, db, selection) {\n\tswitch (selection) {\n\t\tcase 1:\n\t\t\tdb.collection('rests').find({ \"name\": new RegExp(req.params.keywords) }).toArray(function (err, result) {\n\t\t\t\tif (err) {\n\t\t\t\t\tres.render(\"err.ejs\",{items:\"No Data Found\"});\n\t\t\t\t\tconsole.log(err);\n\n\t\t\t\t} else if (result.length) {\n\t\t\t\t\tmk = result;\n\t\t\t\t\tconsole.log(mk);\n\t\t\t\t\tres.render('search.ejs', { items: mk });\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('No document(s) found with defined \"find\" criteria!');\n\t\t\t\t\tres.render(\"err.ejs\",{items:\"No Data Found\"});\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdb.collection('rests').find({ \"borough\": new RegExp(req.params.keywords) }).toArray(function (err, result) {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tres.render(\"err.ejs\",{items:\"No Data Found\"});\n\t\t\t\t}\n\t\t\t\telse if (result.length) {\n\t\t\t\t\tmk = result;\n\t\t\t\t\tres.render('search.ejs', { items: mk });\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('No document(s) found with defined \"find\" criteria!');\n\t\t\t\t\tres.render(\"err.ejs\",{items:\"No Data Found\"});\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdb.collection('rests').find({ \"restaurant_id\": new RegExp(req.params.keywords) }).toArray(function (err, result) {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tres.render(\"err.ejs\",{items:\"No Data Found\"});\n\t\t\t\t}\n\t\t\t\telse if (result.length) {\n\t\t\t\t\tmk = result;\n\t\t\t\t\tres.render('search.ejs', { items: mk });\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('No document(s) found with defined \"find\" criteria!');\n\t\t\t\t\tres.render(\"err.ejs\",{items:\"No Data Found\"});\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "e234c12011b9d2c7543402bad74628d2", "score": "0.5587133", "text": "function callSearch()\n{\n\tvar inputElement = null;\n\tvar prepKeyword = \"\";\n\t\n\tvar loopIndex = 0;\n\tvar dataObject = {};\n\tvar rowID = \"\";\n\tvar rowElement = null;\n\tvar nameText = \"\";\n\tvar nameMatch = -1;\n\tvar symbolMatch = -1;\n\tvar matchFound = false;\n\t\n\t\n\t// Read search input.\n\tinputElement = document.getElementById(\"txtSearch\");\n\tprepKeyword = inputElement.value.trim();\n\tprepKeyword = prepKeyword.toUpperCase();\n\t\n\t// Remove hidden status from rows.\n\thideList = [];\n\t\n\t\n\t// Loop through current data set.\n\tfor (loopIndex = 0; loopIndex < retrievedDataArray.length; loopIndex = loopIndex + 1)\n\t{\n\t\t// Read current entry.\n\t\tdataObject = retrievedDataArray[loopIndex];\n\t\t\n\t\t// Get current row element.\n\t\trowID = \"row-\" + dataObject.id;\n\t\trowElement = document.getElementById(rowID);\n\t\t\n\t\t// Check for match based on name and symbol.\n\t\tnameText = dataObject.name.toUpperCase();\n\t\tnameMatch = nameText.indexOf(prepKeyword);\n\t\tsymbolMatch = dataObject.symbol.indexOf(prepKeyword);\n\t\tmatchFound = false;\n\t\t\n\t\t\n\t\tif (nameMatch >= 0 && nameMatch < nameText.length)\n\t\t{\n\t\t\t// Name match.\n\t\t\tmatchFound = true;\n\t\t}\n\t\telse if (symbolMatch >= 0 && symbolMatch < dataObject.symbol.length)\n\t\t{\n\t\t\t// Symbol match.\n\t\t\tmatchFound = true;\n\t\t}\n\t\t\n\t\t\n\t\tif (matchFound === true)\n\t\t{\n\t\t\t// Display.\n\t\t\trowElement.style.display = \"table-row\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Hide.\n\t\t\thideList.push(dataObject.id);\n\t\t\trowElement.style.display = \"none\";\n\t\t}\n\t\t\n\t}\n}", "title": "" }, { "docid": "2db1dd4521ea8e93694b9a152e4d6090", "score": "0.55868065", "text": "function search(){\n //get the text value from search input box\n let inputBox = document.querySelector('.student-search input');\n let searchPhrase = inputBox.value;\n\n //use inputBox.value to search in name or email and display the matches\n for(let i=0;i<studentRecords.length;i++){\n let email = studentRecords[i].querySelector('.email').innerText;\n let name = studentRecords[i].querySelector('h3').innerText;\n if(email.includes(searchPhrase) || name.includes(searchPhrase)){\n studentRecords[i].classList.add('matched');\n studentRecords[i].style.display='block';\n }else{\n studentRecords[i].classList.remove('matched');\n\n studentRecords[i].style.display='none';\n }\n }\n appendPageLinks();\n}", "title": "" }, { "docid": "b210bb65adffd38b506c36deea13c125", "score": "0.5585621", "text": "function searchEverythingUltra (theSearch) {\n\n // Create tempData object\n var tempData = [];\n //console.log('Searching everything for', theSearch ,' som är typ: ', typeof(theSearch));\n\n // Main Loop through the json\n for (var i = 0; i < jsonContent.salar.length; i ++) {\n\n // Loop through all the keys to obtain their properties\n for (const key of Object.keys(jsonContent.salar[i])) {\n let val = jsonContent.salar[i][key];\n\n // If the search matches the properties\n if (val.indexOf(theSearch) >= 0) {\n // Push the classroom ID to tempData\n tempData.push(\"Match because of property '\" + val + \"'. Salsnr is \" + jsonContent.salar[i].Salsnr\n + \" .Salsnamn is \" + jsonContent.salar[i].Salsnamn +\n \". Lat is \" + jsonContent.salar[i].Lat + \". Long is \" + jsonContent.salar[i].Long +\n \". Ort is \" + jsonContent.salar[i].Ort + \". Hus is \" + jsonContent.salar[i].Hus +\n \". Våning is \" + jsonContent.salar[i].Våning + \". Typ is \" + jsonContent.salar[i].Typ +\n \". Storlek is \" + jsonContent.salar[i].Storlek + \".\");\n }\n\n }\n\n // set result\n result = tempData;\n }\n //Return the result\n return result;\n}", "title": "" }, { "docid": "2cadecacd7bf076badaf9d036901df29", "score": "0.55844146", "text": "function searchEventListener(event) {\n\n // convert the user-entered query to uppercase\n const userInput = event.target.value.toUpperCase();\n\n // start with a set of 0 results\n const studentList = [];\n\n // loop through the base set and look for matches\n for(let i = 0; i < list.length; i++) {\n const student = list[i];\n\n // create a string with first and last name & convert to uppercase\n const studentName = `${student.name.first} ${student.name.last}`.toUpperCase(); \n\n // add the student to the subset if we found a match\n if(studentName.includes(userInput)) {\n studentList.push(student);\n }\n }\n // show the first page of the subset of students\n activePage = 1;\n showPage(studentList, activePage);\n\n // only add pagination if needed\n if(studentList.length > studentsPerPage) {\n addPagination(studentList);\n } \n else {\n // hide pagination\n document.querySelector('ul.link-list').innerHTML = '';\n }\n }", "title": "" }, { "docid": "baa5b682f63727bcba61ecb151eae895", "score": "0.5583255", "text": "function search(input){\n // if input equals \"undefined\" (no value is assigned to input), or if an empty object was passed (yay for the internet!), return all albums in the collection.\n if(input === undefined){\n return console.log(collection);\n }//end if \n\n\n//create an empty array and call it 'matches' in order to store all the user entered matches.\n let matches = [];\n //create a for loop to loop through the collection and push each match into the new array \n if( typeof input === 'string'){\n for( let i=0; i<collection.length; i++){\n for(let j=0; j<collection[i].tracks.length; j++){\n if(input===collection[i].tracks[j].name){\n matches.push({\n artist: collection[i].artist, \n title: collection[i].title, \n track: collection[i].tracks[j].name\n });\n }\n }\n }//end for loop\n\n if(matches.length===0){\n return console.log(matches);\n }\n else {\n for( let i=0; i<matches.length; i++ ){\n console.log(matches[i]);\n } \n }\n }//end if \n\n else {\n if(Object.keys(input).length === 0){\n return console.log (collection);\n }\n else {\n for (let i=0; i<collection.length; i++){\n if(input.artist === collection[i].artist && input.yearPublished === collection[i].yearPublished){\n matches.push(collection[i]);\n }\n }//end for loop\n }//end else \n \n if(matches.length===0){\n return console.log(matches);\n }\n else {\n for( let i=0; i<matches.length; i++ ){\n console.log(matches[i]);\n }\n }\n }\n}//end function", "title": "" }, { "docid": "9f826f9a4427a3496ba1e313aa33ff68", "score": "0.5582199", "text": "function loadExtendedResults(needle, results){\r\n\t\tif($(\"#searchBox\").val() != needle) return;\r\n\t\tfor(var i=30; i<results.length; i++){\r\n\t\t\tvar item = results[i];\r\n\t\t\tTermManager.addTerms(item.keywords);\r\n\t\t\tDomainManager.addDomain(item.domain.favUrl, item.domain.name);\r\n\t\t\tStreamManager.addStream(item.stream);\r\n item.id = i;\r\n self.results[i] = item;\r\n\t\t\tdisplayItem(item);\r\n\t\t}\r\n\t\tTermManager.display();\r\n\t\tDomainManager.display();\r\n\t\tStreamManager.display();\r\n itemTable.display();\r\n analytics(\"YouPivot\", \"Search: \"+needle, {action: \"search\", needle: needle});\r\n\t}", "title": "" }, { "docid": "3ccf7922e56e93c74b2d28da4735a84f", "score": "0.5581104", "text": "function searchMovie(search_term){\r\n let results = [];\r\n for(let x of movies){\r\n if(x != null){\r\n if(x.title.includes(search_term) == true){\r\n results.push(x);\r\n }\r\n }\r\n }\r\n return results;\r\n}", "title": "" } ]
0ae9b47407b3f47e63941d0ee4b55b1f
Get alarms data function from factory API
[ { "docid": "300625e1f75cf2b4bad427b65753d060", "score": "0.5244876", "text": "function refreshData() {\n Alarms.query({server: $scope.server}, function (data) {\n $scope.alarmsList = data;\n });\n }", "title": "" } ]
[ { "docid": "382c4a922cdcf781d242ceb071ba9563", "score": "0.7195271", "text": "getAll() {\n return {\n alarms: _data\n };\n }", "title": "" }, { "docid": "5909faad05a3a22c8fda1e6aec7a33e0", "score": "0.69939345", "text": "function getAlarms() {\n DataSourceDwr.getAlarms(currentDsId,writeAlarms);\n }", "title": "" }, { "docid": "5684ee0b0f7f0faab06e544f93f16012", "score": "0.57186097", "text": "async makeAlarms(alarm_array){\n // console.log(\"makeAlarms\")\n alarm_array.forEach(async(list_item) => {\n if (list_item.switch == true){\n promise = (await Notifications.scheduleNotificationAsync({\n identifier: list_item.name,\n content: {\n title: list_item.name,\n // Add feature: custom subtitle\n // subtitle: 'Its ' + list_item.alarm_hour + ':' + list_item.alarm_minute + '!',\n },\n // DailyTriggerInput\n trigger: {\n hour: list_item.alarm_hour,\n minute: list_item.alarm_minute,\n repeats: false\n }\n }));\n }\n });\n\n // list is the promise return\n list = (await Notifications.getAllScheduledNotificationsAsync());\n return list;\n }", "title": "" }, { "docid": "ecf7aef04f61313fa32d02bafdb9ba2d", "score": "0.5573032", "text": "async function createAlarm() {\n const alarm = await chrome.alarms.get(ALARM_NAME);\n if (typeof alarm === 'undefined') {\n chrome.alarms.create(ALARM_NAME, {\n delayInMinutes: 1,\n periodInMinutes: 1440\n });\n updateTip();\n }\n}", "title": "" }, { "docid": "d440de429c3aa9552bda78f6d8a6131c", "score": "0.55695695", "text": "function createAlarm() {\r\n createBrowserAlarm(exports.refreshAlarm, { when: new Date().getTime() + refreshDelayInMilliSeconds }, refreshTimestamp);\r\n}", "title": "" }, { "docid": "394b5c921603186cdba8b686b34358c3", "score": "0.5566091", "text": "getSchedule(){\n const overwatch = require('overwatch-api');\n overwatch.owl.getSchedule((err,json)=> {\n if (err) console.log(err);\n else console.log(json);\n })\n }", "title": "" }, { "docid": "fc8aa7bfd33d077011355b846f66e221", "score": "0.5545192", "text": "function getAlarm(date, time, desc)\n {\n reminderDate = date;\n reminderTime = convertTime(time);\n reminderNotif = reminderDate + ' ' + reminderTime;\n notifs.push([reminderNotif, desc]);\n }", "title": "" }, { "docid": "a4510f2192d01057022054063ff6161c", "score": "0.55435085", "text": "async showAlarms(){\n list = (await Notifications.getAllScheduledNotificationsAsync());\n \n if (list.length == 0) {\n console.log(\"list.length == 0\")\n }\n else {\n var print_list_new\n for (var i = 0; i < list.length; i++) {\n print_list_new += \"\\n\"\n print_list_new += list[i].identifier\n }\n console.log(\"showAlarms:\", print_list_new)\n return list;\n }\n }", "title": "" }, { "docid": "1d5bb4370f831afdc9983ce4ff951b1e", "score": "0.5399842", "text": "function getEventReminder() {\n createEventLogic.getEventReminder().then(function (response) {\n //appLogger.log(\"reminders\" + JSON.stringify(response));\n $scope.eventReminders = response;\n }, function (err) {\n appLogger.error('ERR', err);\n });\n }", "title": "" }, { "docid": "ec98a505916b0e655e52de578d758327", "score": "0.53836226", "text": "function addAlarm1()\n{\n\tvar alarm = new tizen.AlarmAbsolute(new Date(2012, 6, 14, 15, 56));\n\t//var service = new tizen.application.ApplicationService(\"http://tizen.org/appsvc/operation/view\", \"http://www.tizen.org\");\n\t//tizen.alarm.add(alarm, \"http://tizen.org/browser\", service);\n\ttizen.alarm.add(alarm, \"http://tizen.org/alarm-clock\");\n\tconsole.log(\"Alarm1 added with id: \" + alarm.id);\n}", "title": "" }, { "docid": "992690ec4838107c62c41fab44d3a9b7", "score": "0.53758717", "text": "function listAlarm(organism) {\n // Todas las alarmas\n\n AlarmsService.query(function (data) {\n\n vm.alarmsEsperando = [];\n vm.alarmsEnAtencion = [];\n vm.alarmsRechazado = [];\n vm.alarmsCanceled = [];\n vm.alarmsAtendido = [];\n vm.alarmsCanceladoCliente = [];\n vm.alarmsCanceladoOperator = [];\n vm.alarmsCanceladoUnidad = [];\n vm.alarms = [];\n\n data.forEach(function(alarm) {\n // la alarma es de este organismo\n if (alarm.organism === organism) {\n // por status\n if (alarm.status === 'esperando') {\n vm.alarmsEsperando.push(alarm);\n }\n\n if (alarm.status === 'en atencion') {\n vm.alarmsEnAtencion.push(alarm);\n }\n\n if (alarm.status === 'rechazado') {\n vm.alarmsRechazado.push(alarm);\n }\n\n if (alarm.status === 'cancelado por el operador') {\n vm.alarmsCanceled.push(alarm);\n }\n\n if (alarm.status === 'atendido') {\n vm.alarmsAtendido.push(alarm);\n }\n\n if (alarm.status === 'cancelado por el cliente') {\n vm.alarmsCanceladoCliente.push(alarm);\n }\n\n if (alarm.status === 'cancelado por la unidad') {\n vm.alarmsCanceladoUnidad.push(alarm);\n }\n\n /* if (alarm.status === 'cancelado por la unidad') {\n vm.alarmsCanceladoUnidad.push(alarm);\n }*/\n\n if (alarm.status === 'esperando' ||\n alarm.status === 'en atencion' ||\n alarm.status === 'cancelado por la unidad') {\n vm.alarms.push(alarm);\n }\n }\n });\n });\n }", "title": "" }, { "docid": "5251e9cc7ba9bb0fe4c916522022a20e", "score": "0.5372086", "text": "function requestAPIData() {\n fetch('https://api.rdo.gg/events/')\n .then(function(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n })\n .then(function(data) {\n // Modify API data into expected schema\n initialise({\n freeRoam: formatAPIData(data.standard),\n role: formatAPIData(data.themed)\n })\n })\n .catch(function(error) {\n console.error(error);\n // Fall back to hard-coded list if fetch has been unsuccessful\n initialise({\n freeRoam: window.rdoEvents.freeRoam,\n role: window.rdoEvents.role\n })\n })\n }", "title": "" }, { "docid": "92fc9b785e0c8f96b34587b82f7ec748", "score": "0.53566", "text": "async function retrieveData() {\r\n return Services.getEvents(date)\r\n .then((response) => {\r\n const events = response.data\r\n return {notices: events[\"notices\"], lessons: events[\"lessons\"][\"value\"], officehours: events[\"officehours\"][\"value\"]}\r\n })\r\n .catch((error) => {\r\n console.log(error)\r\n return {notices: [], lessons: [], officehours: []}\r\n })\r\n }", "title": "" }, { "docid": "853c4c9913eb704d9d6edb6d1f4fe22e", "score": "0.53509325", "text": "function printAlarms(data){\n\n var alarmJSON;\n var toReturn = '';\n\n //For all alarms add to string\n for(i = 0; i<data.length; i++){\n alarmJSON = data[i];\n toReturn += ('<h6>&#8195&#8195&#8195Alarm ' + (i+1) + ': Action: ' + alarmJSON.action + ', Trigger: ' + alarmJSON.trigger + ', numProps: ' + alarmJSON.numProps + '<br></h6>');\n }\n\n return toReturn;\n\n}", "title": "" }, { "docid": "95e17eb27dd673933742b0de7247a6f6", "score": "0.5345107", "text": "getPendingData() {}", "title": "" }, { "docid": "be7273f68c988873d0aab1b52b1db7ef", "score": "0.5338116", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n myId = response.name; // For usage in addAlarm()\n\n document.getElementById('status').innerHTML =\n response.name + '\\'s alarms:';\n getAllAlarms(response.name);\n });\n}", "title": "" }, { "docid": "1a9e6e98135c8a80ad4224732254cca6", "score": "0.5312356", "text": "async function setPullDataAlarm() {\n\tlet date = new Date();\n\tdate.setDate(date.getDate() + 1);\n\tdate.setHours(6, Math.floor(Math.random() * 30) + 1, 0, 0);\n\tawait chrome.alarms.clear('PullData').catch(e => null);\n\tchrome.alarms.create('PullData', {\n\t\twhen: date.getTime()\n\t});\n}", "title": "" }, { "docid": "01ff0062becd467e5557037bff25f322", "score": "0.5301923", "text": "async function getAlarmsToAddToState() {\n // gets alarms from the rest api\n let newIBSAlarms = await fetchNewAlarms();\n\n /**\n * checks if any alarms were returned in\n * the array\n */\n if (newIBSAlarms !== undefined || newIBSAlarms.length !== 0) {\n // puts the IDs of the new alarms in an array\n let newIds = await newIBSAlarms.map(alarm => alarm.id);\n\n // gets the IDs of current alarms\n let currentState = appStore.getState();\n let currentIBSAlarms = currentState.ibsAlarms;\n let rawCurrentIds = currentIBSAlarms.map(alarm => alarm.id);\n\n // array to hold ids from current alarms\n let currentIds = [];\n\n //remove undefined values from array\n currentIds = rawCurrentIds.filter(function (e) { return e });\n\n // removes any existing IDs from the new alarms array\n let ibsAlarmsIDsFiltered = await getFilteredIBSAlarmIds(newIds, currentIds);\n\n let filteredAlarmsArray = [];\n\n newIBSAlarms.forEach(function (alarm) {\n ibsAlarmsIDsFiltered.forEach(function (id) {\n if (parseInt(alarm.id) === parseInt(id)) {\n if (alarm.alarmStatus === 1 || alarm.alarmStatus === 'Pending') {\n alarm.alarmStatus = 'Pending'\n } else {\n alarm.alarmStatus = 'Closed'\n }\n filteredAlarmsArray.push(alarm);\n }\n })\n })\n\n //alarms to be added to state\n return filteredAlarmsArray;\n } else {\n /**\n * No new alarms OR network is down.\n * return empty array\n */\n let filteredAlarmsArray = [];\n return filteredAlarmsArray\n }\n\n}", "title": "" }, { "docid": "6c8aacc580ad682784a13b6927160e66", "score": "0.52771497", "text": "getAlerted () {\n return axios.get(`${ServerStore.data.serverLocation}/api/alertedPeople`)\n }", "title": "" }, { "docid": "8007fdb697806328193cc12fd0577628", "score": "0.5274855", "text": "async fetchAlarms({ commit }) {\n const response = await axios.get(\n 'http://localhost:8000/drones/Alarms'\n );\n commit('setAlarms', response.data);\n }", "title": "" }, { "docid": "74fc53ac7e70d52764611e638c9c950b", "score": "0.52742577", "text": "function getApodData() {\n\t\t\t//the URL needs to have the date as a string in yyyy-mm-dd format\n\t\t\tvm.apodDateStr = vm.urlDateStr(vm.apodDate);\n\t\t\tapodService.get(vm.apikey, vm.apodDateStr)\n\t\t\t\t.then(function (apodObj) {\n\t\t\t\t\tvm.apodData = apodObj.data;\n\t\t\t\t\tvm.apodHeaders = apodObj.headers;\n\t\t\t\t\tvm.video = false;\n\t\t\t\t\tif (vm.apodData.media_type === 'video') {\n\t\t\t\t\t\tvm.video = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "f74e5c23ca467c47396d6221a76558ff", "score": "0.52719826", "text": "function getSchedule(axios, token, format) {\n var query = randomSeedQuery();\n return restAuthGet(axios, \"schedules/\" + token + query);\n}", "title": "" }, { "docid": "3ff0116c699ed58a3710cfaf5147a85d", "score": "0.5266844", "text": "GetOpenSchedule() { }", "title": "" }, { "docid": "374288d006f3b7c4bfd546c275590c35", "score": "0.5251833", "text": "function getEventReminder() {\n editEventLogic.getEventReminder().then(function(response) {\n //appLogger.log(\"reminders\" + JSON.stringify(response));\n $scope.eventReminders = response;\n }, function(err) {\n appLogger.error('ERR', err);\n });\n }", "title": "" }, { "docid": "4bfac99c4bfb6810c1753070a3707b2e", "score": "0.5218815", "text": "function poll_alerts() {\n var alarms = {};\n if (jumpers.cams) alarms['cams'] = cams_polling.alarms;\n if (jumpers.aura) alarms['aura'] = aura_polling.alarms;\n if (jumpers.mode == 0) alarms['elv'] = elv_polling.alarms;\n if (jumpers.mode == 1) alarms['elvp'] = elvp_polling.alarms;\n if (jumpers.mode == 2) alarms['series3'] = series3_polling.alarms;\n if (jumpers.mode == 3) alarms['series4'] = series4_polling.alarms;\n\n var alarms_active = {};\n for (var type in alarms) {\n for (var alarm in alarms[type]) {\n if (alarms[type][alarm].state) {\n if (!(type in alarms_active))\n alarms_active[type] = [];\n alarms_active[type].push(alarm);\n }\n }\n }\n\n // If there are any active alarms retrive the database so we can continue with checks\n db.getAll(get_all_callback.bind(null, alarms_active));\n}", "title": "" }, { "docid": "ceded556e59955a276e38c3538778b05", "score": "0.5189381", "text": "function handleStartup() {\n\ncreateAlarm();\n\n}", "title": "" }, { "docid": "a307e5db52c0f29ae04e06e550d08508", "score": "0.5169213", "text": "function getSchedule() {\n const now = new Date();\n dispatch({type: 'GET_USER', payload: now.getTime()})\n dispatch({type: 'GET_KOAN'})\n }", "title": "" }, { "docid": "0c392ddd83691973d3ffc3aaaf63fe3a", "score": "0.51690257", "text": "function addAlarm () {\n console.log(\"addAlarm\");\n var new_alarm = {\"alarm_hour\": 12, \"alarm_min\": 0, \"light_offset\": 60, \"enabled\": true, name: null};\n\n // self.toggleList();\n self.alarmService.save(new_alarm, function(res) {\n new_alarm = res\n self.alarms.push(new_alarm);\n self.selected = new_alarm;\n });\n }", "title": "" }, { "docid": "a1d5148c68c9906fc30697140556c87f", "score": "0.51560503", "text": "notificationScheduler() {\n schedule.scheduleJob('*/30 * * * * *', function() {\n notificationService.readByTime((allNotifications) => {\n allNotifications.map((notification) => {\n visitorAppointmentModel.visitor_appointment.findAll({\n where: {\n doctorId: notification.userId,\n startTime: {\n [Op.gt]: Date.now()\n }\n }\n }).then((visitorAppointment) => {\n var groups = groupService.getAllGroupsByUserId(visitorAppointment.visitorId);\n return { notification: notification, group: groups[1] };\n });\n });\n });\n });\n }", "title": "" }, { "docid": "2a286290af7e357a001c4cfb90274b83", "score": "0.5143963", "text": "function StockData () {\n const api = ApiCall ()\n\n \n //Api is not working for some reason.\n //I'm using a fake api to return the data.\n\n // function getStocks () {\n // return FakeApi\n // }\n\n async function getRobotList () {\n const endpoint = 'https://api-front-test.k8s.smarttbot.com/api/v1/robot'\n const data = api.get(endpoint);\n return Promise.resolve(data)\n }\n async function getRobotOverview() {\n const endpoint = 'https://api-front-test.k8s.smarttbot.com/api/v1/robot/overview'\n const data = api.get(endpoint);\n return Promise.resolve(data)\n }\n\n return {\n getRobotList,\n getRobotOverview\n \n }\n}", "title": "" }, { "docid": "aeea032c8daedbc4919fdd46832b80bf", "score": "0.5141665", "text": "function getAlarmSystem(subscriber) {\n\n for (var i = 0; i < adapter.config.keys.length; i++) {\n\n var key = adapter.config.keys[i];\n\n if (key.subscriber == subscriber) {\n\n return key.alarmsystem;\n\n }\n\n }\n\n return null;\n\n}", "title": "" }, { "docid": "2b26079a60211b5139f9747f43dd55ed", "score": "0.5141243", "text": "getAppointmentsFromServer() {\n getAppointments()\n .then((resposne) => {\n this.generateEventJson(resposne);\n })\n .catch((error) => {\n console.error({\n message: \"Error occured on getCalendarEventsFromServer\",\n error,\n });\n });\n }", "title": "" }, { "docid": "565fcc356f7a0d970964883af69c197c", "score": "0.5118084", "text": "function handleInstalled(details) {\n\ncreateAlarm();\n\n}", "title": "" }, { "docid": "08e2e48151e05232b8a8217da1da290a", "score": "0.5107351", "text": "async createEvents(dataSet) {\n return Api.request('post', '/events/daily', { dataSet });\n }", "title": "" }, { "docid": "de5de87f2e7ca1ad666c91077205a880", "score": "0.5103187", "text": "getAmbientTemperature() {\n console.log('getAmbientTemperature called');\n\n return this.getTemperatureSensorResURI()\n .then(response => {\n return response.ambientTemperature.temperature;\n });\n }", "title": "" }, { "docid": "770cda2ad1f3823de0e103854f6e67ce", "score": "0.50885624", "text": "function getAttraction(id, event) {\n $.ajax({\n type: \"GET\",\n url: \"https://app.ticketmaster.com/discovery/v2/attractions/\" + id + \".json?apikey=EMZOAA3KlATktn9bwYV8aKh7yFnEm92G\",\n async: true,\n dataType: \"json\",\n success: function (json) {\n showAttraction(event);\n },\n error: function (xhr, status, err) {\n console.log(err);\n }\n });\n }", "title": "" }, { "docid": "2f3b0634b72028c1d9f3e302360d7640", "score": "0.5082493", "text": "function loadTreatmentArmList() {\n return $http.get(matchConfig.treatmentArmApiBaseUrl + '/treatment_arms?active=true&basic=true');\n }", "title": "" }, { "docid": "24b18e6e76a7b5a7a596685ce03b9f75", "score": "0.5078871", "text": "function getMealPlans(callback)\n{\n //replace with getJson when database is implemented.\n callback(MOCK_MEAL_DATA);\n}", "title": "" }, { "docid": "d79478eddb3315ec781f5a52b11beec8", "score": "0.5065233", "text": "getInitialData(e) {\n e.preventDefault();\n\n const eventId = this.state.selectedActivity.ChallengeId * -1;\n const url = `https://api.limeade.com/api/activity/${eventId}/Get?types=1&status=1&attributes=1&contents=31`;\n const headers = {\n Authorization: `Bearer ${this.state.selectedClient.fields['LimeadeAccessToken']}`\n };\n $.ajax(url, {\n type: 'get',\n headers: headers,\n dataType: 'json',\n success: (data) => {\n const event = data.Data[0];\n console.log(event);\n const maxOccurrences = event.Reward.MaxCount;\n\n this.getEventData(maxOccurrences);\n }\n });\n }", "title": "" }, { "docid": "eb33b65b9d74d003a50fef770c0ed5ba", "score": "0.5063762", "text": "async HelperGetSensor(url, id) {\n try {\n const reponse = await axios.get(url + id)\n this.getdata = await reponse.data\n } catch (ex) {\n alert(ex.message)\n }\n }", "title": "" }, { "docid": "6635a7459e8f4b3d533bed29e8d20f4b", "score": "0.5060755", "text": "function me() {\n UsersService.query(function (data) {\n\n if (Authentication.user.roles[0] === 'user') {\n // El cliente logueado\n vm.client = data.filter(function (data) {\n return (data.email.indexOf(Authentication.user.email) >= 0);\n });\n\n AlarmsService.query(function (data) {\n\n vm.clientAlarmsSinCalificar = data.filter(function (data) {\n return ((data.user._id.indexOf(vm.client[0]._id) >= 0) &&\n (data.status.indexOf('atendido') >= 0) &&\n (data.rating.indexOf('sin calificar') >= 0));\n });\n\n vm.clientAlarmsCalificado = data.filter(function (data) {\n return ((data.user._id.indexOf(vm.client[0]._id) >= 0) &&\n (data.status.indexOf('atendido') >= 0) &&\n (data.rating.indexOf('sin calificar') < 0));\n });\n\n });\n }\n if (Authentication.user.roles[0] === 'adminOrganism') {\n // El organismo logueado\n OrganismsService.query(function (data) {\n vm.organism = data.filter(function (data) {\n return (data.rif.indexOf(Authentication.user.organism) >= 0);\n });\n });\n }\n\n if (Authentication.user.roles[0] === 'operator') {\n\n // El operador logueado\n vm.operator = data.filter(function (data) {\n return (data.email.indexOf(Authentication.user.email) >= 0);\n });\n // El organismo al que pertence el operador logueado\n OrganismsService.query(function (data) {\n vm.organism = data.filter(function (data) {\n return (data.rif.indexOf(vm.operator[0].organism) >= 0);\n });\n getMyAlarms(vm.organism[0]._id);\n });\n }\n\n });\n }", "title": "" }, { "docid": "0790665857528e4205866ba59fb1d4a9", "score": "0.5060587", "text": "function dailyEarningsReports() {\n\n //define local variables\n var params = {\n locationId:\"14E8S7P16JQDM\",\n day: {\n start:\"2017-07-01T00:03:00-08:00\",\n end: \"2017-07-02T00:02:59-08:00\"\n }\n };\n \n //hit the api\n api.dailyEarningsReports(params).then(function(result) {\n\n //notify with results\n console.log(result);\n\n });\n\n}", "title": "" }, { "docid": "f8957224becbefe634b2b517b921eaa4", "score": "0.50594175", "text": "function eventlist() {\n console.log('Inside factory now');\n var deferred = $q.defer();\n $http.get(eventUrl + '/events/list/status')\n .then (\n function(response) {\n deferred.resolve(response.data);\n },\n function(errResponse) {\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "fd0c7a1e94ca2753e175b9797c9275bc", "score": "0.5059176", "text": "function ERDDuumyDataService(ERD_CONSTANTS,$q){\n\n function getAll(){\n return DUMMY_ERDS;\n //return [];\n }\n\n function getOne(id){\n id = parseInt(id);\n return _.find(DUMMY_ERDS,function(erd){\n return erd.id === id;\n });\n }\n\n function createOne(obj){\n var deferred = $q.defer();\n\n setTimeout(function() {\n obj.id = _.random(99999999999);\n DUMMY_ERDS.push(obj);\n deferred.resolve();\n }, 1000);\n\n return deferred.promise;\n }\n\n function updateOne(obj){\n\n var deferred = $q.defer();\n\n setTimeout(function() {\n var i = _.findIndex(DUMMY_ERDS, function(erd) {\n return erd.id === obj.id;\n });\n DUMMY_ERDS[i] = obj;\n deferred.resolve();\n }, 1000);\n\n return deferred.promise;\n }\n\n return {\n getAll: getAll,\n getOne: getOne,\n createOne: createOne,\n updateOne: updateOne\n };\n }", "title": "" }, { "docid": "aa578c8db3e15cdee62f960c69806bce", "score": "0.50561243", "text": "function logAllAlarms() {\n return browser.alarms.getAll()\n .then(function(alarms) {\n console.log(\"automaticDark DEBUG: All active alarms: \");\n console.log(alarms);\n });\n}", "title": "" }, { "docid": "bc31e761986ceb6e0799a08ac51749ea", "score": "0.50543696", "text": "function getMockFlightsData () {\n \t//crea la promesa a devolver\n \tvar tabletopResponse = $q.defer();\n \t//inicializa Tabletop y define el callback\n\t window.Tabletop.init({\n\t key: 'https://docs.google.com/spreadsheets/d/1MNkEoLahoi_6bjwi0QkU9-SkYirnI_13jaH63k2Ogok/pubhtml?gid=0&single=true',\n\t simpleSheet: true,\n\t callback: function(data, Tabletop) { tabletopResponse.resolve([data, Tabletop]);\n\t }\n\t });\n\n\t //devuleve la promesa que se resuelve en el callback de Tabletop\n\t return tabletopResponse.promise;\n }", "title": "" }, { "docid": "053c7bc7869bf6a79860055ae1745830", "score": "0.5050684", "text": "getSensorSchedule(sensorId) {\n return this.rest.get(`${this.baseUrl}/sensor/${sensorId}/schedule`);\n }", "title": "" }, { "docid": "b8ccfbea04357986cbef84b0abd70df8", "score": "0.50460416", "text": "async loadData() {\n const rawChannels = _.map(this.channels, (channel) => {\n const isV1Minute = channel.startsWith('alpacadatav1/AM.');\n const isMinute = channel.startsWith('AM.');\n if (!isMinute && !isV1Minute) {\n throw new Error('Only minute aggregates are supported at this time.');\n }\n\n return isMinute ? channel.substring(3) : channel.substring(16);\n });\n\n const channelString = _.join(rawChannels, ',');\n\n const channelData = await this._alpaca.getBars(\n '1Min',\n channelString,\n {\n start: this._startDate,\n end: this._endDate\n }\n );\n\n _.forEach(rawChannels, (channel) => {\n this._marketData.addSecurity(channel, channelData[channel]);\n });\n }", "title": "" }, { "docid": "ad4e78acf101bf3a2a07250a186c36ad", "score": "0.50407875", "text": "getWeather(){\n DarkSkyApi.apiKey = '0c0321e33833aa3705e8d6a1ebeb6b37';\n DarkSkyApi.units = 'ca'; // default 'us'\n DarkSkyApi.lang = 'nb';\n\n DarkSkyApi.postProcessor = (item) => { // default null;\n item.day = item.dateTime.format('ddd');\n return item;\n }\n\n const position = {\n latitude: 63.4305,\n longitude: 10.3951\n };\n\n //Gets the data and sends them to onLoad\n DarkSkyApi.loadCurrent(position).then(\n data => {this.onLoad([(\n data.temperature.toString().split('.')[0] + \"℃\"),\n data.summary,\n data.icon,\n (\"Trondheim \")\n ])}\n );\n }", "title": "" }, { "docid": "127571faed5f8affb6d9b3c457f81ebd", "score": "0.5040172", "text": "getAggregation(sensor,type, from=startTime){\n var url = 'https://vannovervakning.com/api/v1/measurements/'+this.state.node.id +'/'+ from +'?types='+sensor+ '&aggregate=' +type ;\n return axios.get(url)\n .then((res) => {\n return res.data.data[sensor][0][\"value\"];\n })\n .catch( (error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "c28c22a33e56ff2c6cabd8096621da18", "score": "0.5037403", "text": "function getSchedulerData(state) {\n\t\treturn state[/* schedulerData */22];\n\t}", "title": "" }, { "docid": "86794f6251472e9832f63d657d573377", "score": "0.5035897", "text": "function getInverterRealtimeData(id) {\n if (testMode) {\n try {\n let data = apiTest.testInverterRealtimeData3Phase;\n adapter.log.warn('testInverterRealtimeData3Phase -> inverter.testMode.Standard: ' + JSON.stringify(data));\n devObjects.createInverterObjects(adapter, 'testMode.Standard', data.Body.Data);\n fillData(adapter, data.Body.Data, 'inverter.testMode.Standard');\n\n data = apiTest.testInverterRealtimeDataCommon;\n adapter.log.warn('testInverterRealtimeDataCommon -> inverter.testMode.Standard: ' + JSON.stringify(data));\n devObjects.createInverterObjects(adapter, 'testMode.Standard', data.Body.Data);\n fillData(adapter, data.Body.Data, 'inverter.testMode.Standard');\n\n data = apiTest.testInverterRealtimeData3PhaseGen24;\n adapter.log.warn('testInverterRealtimeData3PhaseGen24 -> inverter.testMode.GEN24: ' + JSON.stringify(data));\n devObjects.createInverterObjects(adapter, 'testMode.GEN24', data.Body.Data);\n fillData(adapter, data.Body.Data, 'inverter.testMode.GEN24');\n\n data = apiTest.testInverterRealtimeDataCommonGen24;\n adapter.log.warn('testInverterRealtimeDataCommonGen24 -> inverter.testMode.GEN24: ' + JSON.stringify(data));\n devObjects.createInverterObjects(adapter, 'testMode.GEN24', data.Body.Data);\n fillData(adapter, data.Body.Data, 'inverter.testMode.GEN24');\n\n data = apiTest.testInverterRealtimeDataCumGen24;\n adapter.log.warn('testInverterRealtimeDataCumGen24 -> inverter.testMode.GEN24: ' + JSON.stringify(data));\n devObjects.createInverterObjects(adapter, 'testMode.GEN24', data.Body.Data);\n fillData(adapter, data.Body.Data, 'inverter.testMode.GEN24');\n return;\n } catch (ex) {\n adapter.log.error('Error on getInverterRealtimeDataTest: ' + ex);\n }\n }\n // fallback if no id set\n if (id == '') {\n id = 1; // ensure that it is correct working for symoGEN24\n }\n axios\n .get(requestType + ip + baseurl + 'GetInverterRealtimeData.cgi?Scope=Device&DeviceId=' + id + '&DataCollection=3PInverterData')\n .then(function (response) {\n adapter.log.debug('Response to ' + requestType + ip + baseurl + 'GetInverterRealtimeData.cgi?Scope=Device&DeviceId=' + id + '&DataCollection=3PInverterData: ' + JSON.stringify(response.data));\n if (response.status == 200) {\n if ('Body' in response.data) {\n if (!isObjectsCreated) {\n devObjects.createInverterObjects(adapter, id, response.data.Body.Data);\n }\n fillData(adapter, response.data.Body.Data, 'inverter.' + id + '.');\n } else {\n adapter.log.warn(response.data.Head.Status.Reason + ' 3PInverterData inverter: ' + id);\n }\n }\n })\n .catch(function (error) {\n adapter.log.debug('getInverterRealtimeData (3PInverterData) raised following error: ' + error);\n });\n\n axios\n .get(requestType + ip + baseurl + 'GetInverterRealtimeData.cgi?Scope=Device&DeviceId=' + id + '&DataCollection=CommonInverterData')\n .then(function (response) {\n adapter.log.debug('Response to ' + requestType + ip + baseurl + 'GetInverterRealtimeData.cgi?Scope=Device&DeviceId=' + id + '&DataCollection=CommonInverterData: ' + JSON.stringify(response.data));\n if (response.status == 200) {\n const data = response.data;\n if ('Body' in data) {\n const resp = data.Body.Data;\n if (!isObjectsCreated) {\n devObjects.createInverterObjects(adapter, id, resp);\n }\n\n fillData(adapter, resp, 'inverter.' + id + '.');\n\n setTimeout(\n function (id, resp) {\n if (Object.prototype.hasOwnProperty.call(resp, 'UDC') && Object.prototype.hasOwnProperty.call(resp, 'IDC')) {\n adapter.setState('inverter.' + id + '.PDC', {\n val: Math.round((resp['IDC'].Value * resp['UDC'].Value + Number.EPSILON) * 100) / 100,\n ack: true,\n });\n }\n if (Object.prototype.hasOwnProperty.call(resp, 'UDC_2') && Object.prototype.hasOwnProperty.call(resp, 'IDC_2')) {\n adapter.setState('inverter.' + id + '.PDC_2', {\n val: Math.round((resp['IDC_2'].Value * resp['UDC_2'].Value + Number.EPSILON) * 100) / 100,\n ack: true,\n });\n }\n\n // make sure to reset the values if they are no longer reported by the API\n // Fixes issue #87 from Adapter\n if (!('PAC' in resp)) {\n resetStateToZero(resp, 'inverter.' + id, 'FAC');\n resetStateToZero(resp, 'inverter.' + id, 'IAC');\n resetStateToZero(resp, 'inverter.' + id, 'IAC_L1');\n resetStateToZero(resp, 'inverter.' + id, 'IAC_L2');\n resetStateToZero(resp, 'inverter.' + id, 'IAC_L3');\n resetStateToZero(resp, 'inverter.' + id, 'IDC');\n resetStateToZero(resp, 'inverter.' + id, 'IDC_2');\n resetStateToZero(resp, 'inverter.' + id, 'PAC');\n resetStateToZero(resp, 'inverter.' + id, 'UAC');\n resetStateToZero(resp, 'inverter.' + id, 'UAC_L1');\n resetStateToZero(resp, 'inverter.' + id, 'UAC_L2');\n resetStateToZero(resp, 'inverter.' + id, 'UAC_L3');\n resetStateToZero(resp, 'inverter.' + id, 'UDC');\n resetStateToZero(resp, 'inverter.' + id, 'UDC_2');\n resetStateToZero(resp, 'inverter.' + id, 'PDC');\n resetStateToZero(resp, 'inverter.' + id, 'PDC_2');\n }\n\n const status = resp.DeviceStatus;\n if (status) {\n let statusCode = parseInt(status.StatusCode);\n\n let statusCodeString = 'Startup';\n if (statusCode === 7) {\n statusCodeString = 'Running';\n } else if (statusCode === 8) {\n statusCodeString = 'Standby';\n } else if (statusCode === 9) {\n statusCodeString = 'Bootloading';\n } else if (statusCode === 10) {\n statusCodeString = 'Error';\n }\n if (!Object.prototype.hasOwnProperty.call(status, 'InverterState')) {\n // only needed if not delivered from the API\n adapter.setState('inverter.' + id + '.DeviceStatus.InverterState', {\n val: statusCodeString,\n ack: true,\n });\n }\n\n statusCode = parseInt(status.ErrorCode);\n\n if (statusCode >= 700) {\n statusCodeString = devStrings.getStringErrorCode700(statusCode);\n } else if (statusCode >= 600) {\n statusCodeString = devStrings.getStringErrorCode600(statusCode);\n } else if (statusCode >= 500) {\n statusCodeString = devStrings.getStringErrorCode500(statusCode);\n } else if (statusCode >= 400) {\n statusCodeString = devStrings.getStringErrorCode400(statusCode);\n } else if (statusCode >= 300) {\n statusCodeString = devStrings.getStringErrorCode300(statusCode);\n } else if (statusCode >= 100) {\n statusCodeString = devStrings.getStringErrorCode100(statusCode);\n } else if (statusCode > 0) {\n statusCodeString = 'Unknown error with id ' + statusCode.toString();\n } else {\n statusCodeString = 'No error';\n }\n adapter.setState('inverter.' + id + '.DeviceStatus.InverterErrorState', {\n val: statusCodeString,\n ack: true,\n });\n }\n },\n isObjectsCreated ? 1 : 3000,\n id,\n resp,\n );\n } else {\n adapter.log.warn(data.Head.Status.Reason + ' CommonInverterData inverter: ' + id);\n }\n }\n })\n .catch(function (error) {\n adapter.log.debug('getInverterRealtimeData (CommonInverterData) raised following error: ' + error);\n });\n\n axios\n .get(requestType + ip + baseurl + 'GetInverterRealtimeData.cgi?Scope=Device&DeviceId=' + id + '&DataCollection=MinMaxInverterData')\n .then(function (response) {\n adapter.log.debug('Response to ' + requestType + ip + baseurl + 'GetInverterRealtimeData.cgi?Scope=Device&DeviceId=' + id + '&DataCollection=MinMaxInverterData: ' + JSON.stringify(response.data));\n if (response.status == 200) {\n if ('Body' in response.data) {\n if (!isObjectsCreated) {\n devObjects.createInverterObjects(adapter, id, response.data.Body.Data);\n }\n fillData(adapter, response.data.Body.Data, 'inverter.' + id + '.');\n } else {\n adapter.log.warn(response.data.Head.Status.Reason + ' MinMaxInverterData inverter: ' + id);\n }\n }\n })\n .catch(function (error) {\n adapter.log.debug('getInverterRealtimeData (MinMaxInverterData) raised following error: ' + error);\n });\n}", "title": "" }, { "docid": "e6c49cd59c55a6668326c8507c1e35a1", "score": "0.5029389", "text": "loadData() {\n let data = store.getData( this._options.key );\n if ( !data || !Array.isArray( data ) ) return;\n this._alarms = data;\n this.saveData();\n }", "title": "" }, { "docid": "8cfda5421e861116086e0f69e717e03c", "score": "0.5029143", "text": "activitiesDay(request, reply) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n let res = {\n \"statusCode\": 1,\n \"data\": [\n {\n \"Status\": false,\n \"StartDate\": \"2018-11-11T00:00:00.000Z\",\n \"ProcessStep\": 2,\n \"manulife_lead\": {\n \"Name\": \"Jhonh Hong\"\n }\n },\n {\n \"Status\": false,\n \"StartDate\": \"2018-11-11T00:00:00.000Z\",\n \"ProcessStep\": 1,\n \"manulife_lead\": {\n \"Name\": 'Tu Nguyen'\n }\n }\n ],\n \"msgCode\": \"success\",\n \"msg\": \"success\"\n };\n reply(res);\n }\n catch (ex) {\n let res = {};\n if (ex.code) {\n res = {\n status: 0,\n url: request.url.path,\n error: ex\n };\n }\n else {\n res = {\n status: 0,\n url: request.url.path,\n error: {\n code: code_errors_1.ManulifeErrors.EX_GENERAL,\n msg: 'activity findById have errors'\n }\n };\n }\n reply(res);\n }\n });\n }", "title": "" }, { "docid": "33a35023f68a13873f3d42f64a23c56f", "score": "0.502582", "text": "getAppointments() {\n return axios.get(API_URL + \"appointment/\", { headers: authHeader() });\n }", "title": "" }, { "docid": "197221e80aec2b93ed53fc9abf95d9dc", "score": "0.50249374", "text": "function JAlarm() {}", "title": "" }, { "docid": "d4d8f6965b543cb5721d2017bb9a1e29", "score": "0.50223434", "text": "retrieveAvailabilityObject() {\n const url = 'https://api.resmio.com/v1/facility/the-fish/availability?date__gte=2016-12-31';\n\n get(url).then(function(response) {\n ServerActionCreators.receiveAvailabilityObject(response.data);\n }, function (error) {\n console.error(\"Failed to retrieve availability data!\", error);\n });\n }", "title": "" }, { "docid": "e334cfda46b2ea451160fcc3580585ba", "score": "0.5013362", "text": "function makeAppointment(obj){\n \t\t\t\tvar sendData \t = $.param(obj);\n \t\t\t\tvar deferred = $q.defer();\n \t\t\t\tvar serviceCall = commonService.Create(url+'appointments/create',sendData);\n \t\t\t\treturn serviceCall\n \t\t\t\t.success(function(response){\n \t\t\t\t\tconsole.log(response);\n \t\t\t\t\tdeferred.resolve(response);\n \t\t\t\t})\n \t\t\t\t.error(function(response){\n \t\t\t\t\tdeferred.reject(response);\n \t\t\t\t});\n \t\t\t}", "title": "" }, { "docid": "20bda2e6375cbae611f5610c91214583", "score": "0.5010823", "text": "getAppointmentsFromId(id) {\n return axios.get(API_URL + \"appointment/findbyid/\" + id, {\n headers: authHeader()\n });\n }", "title": "" }, { "docid": "4856986ce1503163ff82a4df3e66e33f", "score": "0.5002834", "text": "function getJsonEventsFromWikipedia(eventCallback) {\n\n console.log(\"vik::::::testing date:\" + new Date());\n var date = new Date();\n console.log(\"ISO date:\" + date.toISOString());\n var today = date.toISOString().substring(0, 10);\n console.log(\"Final date:\" + today);\n //REST paths\n var aptmtPath = \"/salesApi/resources/latest/activities?finder=MyAppointmentsInDateRange;EndDtRFAttr=\" + today + \"T23:59:00-07:00,StartDtRFAttr=\" + today + \"T00:00:00-07:00&orderBy=ActivityStartDate:asc&onlyData=true&fields=ActivityNumber,ActivityStartDate,Subject,Location,ActivityCreatedBy,PrimaryContactName,AccountId\";\n console.log(\"url:\" + aptmtPath);\n\n var options = {\n appid: \"amzn1.echo-sdk-ams.app.your-app-id\",\n host: hostName,\n path: aptmtPath,\n headers: {\n Authorization: 'Basic ' + auth,\n 'Content-Type': 'application/json'\n }\n };\n\n\n //call for appointments\n https.get(options, function(res) {\n console.log(\"vik:::::::::::::::::::::inside data fetch with res:\" + res.toString());\n var body = '';\n\n res.on('data', function (chunk) {\n body += chunk;\n });\n\n res.on('end', function () {\n var retArr = parseJson(body);\n \n retArr[\"this\"] = \"I have added your note to this meeting\";\n retArr[\"deals\"] = \"There are 3 deals that are due close by tomorrow\";\n retArr[\"open opportunities\"] = \"There are 7 open opportunities this week.\";\n retArr[\"traffic\"] = \"There is a moderate traffic. It will take about 15 to 20 min via US 101\";\n retArr[\"thank you\"] = \"Have a nice day!\";\n eventCallback(retArr);\n \n });\n }).on('error', function (e) {\n console.log(\"Got error: \", e);\n eventCallback(\"\");\n });\n}", "title": "" }, { "docid": "e68145465a8f29fd6edeb0cad61f99f6", "score": "0.49883047", "text": "function getData(){\n AlgoService.Get().then( function(dataSet){\n ctrl.dataSet = dataSet;\n }, (error) => {\n ctrl.ErrorMessage = error;\n });\n }", "title": "" }, { "docid": "1041e109578f073ccca475b54363e4c9", "score": "0.49871862", "text": "function getDataFromServer() {\n var urlBase = 'http://localhost:3000/api/tasks';\n dataFactory.getDataServer(urlBase)\n .success(function (rs) {\n mySharedService.prepForBroadcast(rs);\n formatData(rs);\n })\n .error(function (error) {\n console.log('Unable to load customer data: ' + error);\n });\n }", "title": "" }, { "docid": "da34f472fac51a6cbb5bd6811144303a", "score": "0.4967252", "text": "getDemandeRes(){\n return axios.get(BASE_API_EMPLOYEE_URL +'/demanderes')\n }", "title": "" }, { "docid": "7da65df8b42ecdd9de49523288776347", "score": "0.4962332", "text": "function getIoTShadowData()\n{\n return new Promise((resolved, rejected) => {\n iotData.getThingShadow({ thingName : config.shadow.thingName }, (err, data) => {\n if (err)\n rejected(err);\n else \n resolved(JSON.parse(data.payload));\n }); \n });\n}", "title": "" }, { "docid": "b7115debf939724390e477cf362c9402", "score": "0.49612495", "text": "function getNotification(obj){\n \t\t\t\tvar deferred = $q.defer();\n \t\t\t\tvar data = {};\n \t\t\t\tdata.type = 'mobile';\n \t\t\t\tdata.receiverId = obj.id;\n \t\t\t\tdata = $.param(data);\n \t\t\t\tvar serviceCall = commonService.Create(url+'messages/announcement',data);\n \t\t\t\treturn serviceCall\n \t\t\t\t.success(function(response){\n \t\t\t\t\tconsole.log(response);\n \t\t\t\t})\n \t\t\t\t.error(function(response){\n \t\t\t\t\tconsole.log(response);\n \t\t\t\t});\n \t\t\t}", "title": "" }, { "docid": "e01de90117a1fb55b431594ff72c0d2e", "score": "0.49555242", "text": "realtimereport_monitoring_type(id) {\n // const headers = { 'content-type': 'application/json'} \n // const body=JSON.stringify(homepage);\n // console.log(body);\n // alert(body); getPlantDetails/username\n return this.httpclient.get('https://cors-anywhere.herokuapp.com/http://117.211.75.160:8086/rest/api/getPrameterFromStation?plantId=hindalco_lpng&stnType=' + id);\n }", "title": "" }, { "docid": "2cde7f5d310d55d1487db4cf96077172", "score": "0.4952782", "text": "function getAlarmSystem(subscriber) {\n for (let i = 0; i < adapter.config.keys.length; i++) {\n let key = adapter.config.keys[i];\n if (key.subscriber == subscriber) {\n return key.alarmsystem;\n }\n }\n return null;\n}", "title": "" }, { "docid": "dd3af85be76f9319045a235e686ff854", "score": "0.4946841", "text": "async function getDashboardData() {\n const query = `\n\t{\n\t\tsimPricing,\n\t\tpricing,\n\t\tprosumers{\n\t\t\t... prosumerOverviewFields\n\t\t},\n\t\tmarketDemand,\n\t\tme{\n\t\t\t... on manager{\n\t\t\t\tpowerplant{\n\t\t\t\t\t... powerPlantStatusFields\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t${prosumerOverviewFields}\n\t${powerPlantStatusFields}\n\t`;\n const authToken = getCookie(\"authToken\", document.cookie);\n try {\n const response = await fetch(API_ADDRESS, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n authToken\n },\n body: JSON.stringify({\n query\n })\n });\n const json = await response.json();\n if (json.errors != null) {\n throw new Error(json.errors[0].message);\n }\n\n const event = new CustomEvent(POLL_MESSAGE_NAME, {\n detail: { data: json.data }\n });\n document.dispatchEvent(event);\n } catch (err) {\n console.error(`Failed to get poll dashboard data: ${err}`);\n }\n}", "title": "" }, { "docid": "03bebd4cbe20b1295c9c72f477d471c2", "score": "0.49387008", "text": "getData() {\n // return this.doMethod('getData');\n }", "title": "" }, { "docid": "e9ba2b94cfd49c3215ad7bf48cffe860", "score": "0.49370733", "text": "getHospitalsData() {\n return this.httpClient.get(`${this.Rest_API}/hospitals`);\n }", "title": "" }, { "docid": "e9ba2b94cfd49c3215ad7bf48cffe860", "score": "0.49370733", "text": "getHospitalsData() {\n return this.httpClient.get(`${this.Rest_API}/hospitals`);\n }", "title": "" }, { "docid": "5e91cca96ed778f7e5d5d0daeb191eff", "score": "0.4917809", "text": "getOnAPI(){\n /* DEBUG */\n this.debug && this.log(\"[ZIPAC] > Method getOnAPI\", this.debugContext);\n //this.debug && this.log(\"[ZIPAC] [getOn] device UUID and nostatus :\",this.deviceUUID,this.noStatus,this.isOnG);+\n\n /* Before getting the value, we launch the battery check if needed */\n if(this.refreshCount >= 10 && this.batteryLimit > 0){\n this.debug && this.log(\"[ZIPAC] [getOnAPI] RefreshCount =\",this.refreshCount, this.debugContext);\n this.refreshCount = 0;\n if(!this.isOnSector){\n if(!this.batteryBound){ // We already have it bound\n this.bindBatteryLowStatus();\n }\n this.debug && this.log(\"[ZIPAC] [getOnAPI] Getting the battery state\",this.debugContext);\n this.basedService.getCharacteristic(Characteristic.StatusLowBattery).getValue();\n if(this.useEve){\n this.basedService.getCharacteristic(ZHBatteryPercentage).getValue();\n }\n }\n }else{\n this.refreshCount++;\n }\n\n var error = null;\n\n /* Debug for unhandled error */\n this.debug && this.log(\"[ZIPAC] [getOnAPI] Device UUID\",this.deviceUUID,this.debugContext);\n\n /* Starting the get process */\n this.debug && this.log(\"[ZIPAC] [getOnAPI] Starting get process\",this.debugContext);\n return this.getDeviceUUID()\n .then(function launchStatus(deviceUUID){\n return this.zipabox.getDeviceStatus(this.deviceUUID,this.noStatus)\n }.bind(this))\n .catch(function reConnectIfError(error){ // Check if disconnect, if then reconnect\n return this.reconnectAfterError(error);\n }.bind(this)) // end catch if disconnect\n .then(function manageStatus(deviceStatus){\n return new Promise(function(resolve,reject){\n if(deviceStatus == true){ // Device is Online\n resolve(this.uuid);\n }else{ // Device is not online\n error = \"Device not online\";\n reject(error);\n }\n }.bind(this)) // end promise\n }.bind(this)) // end then\n .then(this.zipabox.getAttributesValue.bind(this.zipabox))\n .then(function (accessoryValue){\n /* Reverse the value if requested by the configuration */\n //this.debug && this.log(\"[ZIPAC] [getOn] Accessory Value returned by callback:\",accessoryValue);\n var returnedValue = accessoryValue;\n /* Force boolean for remote access */\n if(returnedValue == \"true\")\n returnedValue = true;\n if(returnedValue == \"false\")\n returnedValue = false;\n /* Manage the reverse value */\n if(this.reverseValue == true){ // User ask to reverse\n if(typeof(returnedValue) != \"boolean\"){ // Check if returnedValue is a Boolean\n var error = new Error(\"[ZIPAC] [getOnAPI] Coding error in getOn: returnedValue is not a boolean in reverseValue\", this.debugContext);\n this.log.error(error);\n throw error;\n }else{\n if(returnedValue == true)\n returnedValue = false;\n else\n returnedValue = true;\n }\n this.debug && this.log(\"[ZIPAC] [getOnAPI] Configuration have request to reverse the value to :\",returnedValue, this.debugContext)\n } // end reverse block\n\n /* Adapt the scale for lux sensor */\n if(this.type == \"ambient\"){ // returned from % to scale\n returnedValue = Math.round(this.min + returnedValue/100 * this.range);\n } // end if ambient\n\n /* Adapt the result for windows and doors */\n if(this.type == \"window\" || this.type == \"door\"){ // Window type, need to return a digit between 0 and 100 and not boolean\n //this.debug && this.log(\"[ZIPAC] [getOn] Window or Door found in get Method. returnedValue :\",returnedValue)\n if(returnedValue)\n returnedValue = 100;\n else\n returnedValue = 0;\n } // end if window || door\n\n /* Adapt the value for a battery */\n if(this.type == \"battery\"){\n if(accessoryValue == undefined)\n this.log.error(\"[ZIPAC] [getOnAPI] Returned value for the battery level is undefined !\", this.debugContext); // TODO add error manage\n else\n returnedValue = parseInt(accessoryValue);\n }\n /* Save the lastValue before give it to homebridge */\n this.lastValue = returnedValue;\n /* Save the backup value for a dimmer accessory */\n if(this.lastValue != 0)\n this.backupValue = this.lastValue;\n //this.getOnOngoing = false;\n // callback(error,returnedValue);\n return returnedValue;\n }.bind(this))\n .catch(function manageError(error){\n /* getOnOngoing true error */\n if(error == \"getOnOngoing\"){\n this.debug && this.log.warn(\"[ZIPAC] [getOnAPI] New get Request before get the previously one. By-passed. Reduce the refresh rate to avoir this.\", this.debugContext);\n //this.getOnOngoing = false;\n // callback(null,this.lastValue);\n return this.lastValue;\n }else if(error == \"Device not online\"){\n this.debug && this.log.warn(\"[ZIPAC] [getOnAPI] Found that the device is not online.\", this.debugContext);\n this.log.error(\"[ZIPAC] [getOnAPI] Device is not online.\",this.debugContext);\n throw error;\n }else{\n //this.log(\"Test Value in manage Error : \",deviceStatus);\n this.log.error(\"[ZIPAC] [getOnAPI] Error on getOn :\",error, this.debugContext);\n //this.getOnOngoing = false;\n // callback(error,undefined);\n return this.lastValue;\n //throw new Error(error);\n }\n }.bind(this));\n }", "title": "" }, { "docid": "4952111cebbdc667d91bc575cf03d94c", "score": "0.49117693", "text": "function getData() {\n Hat.getSenseHatJSON().then(Influx.writeInflux).then(function() {\n Hat.updateLed();\n setTimeout(getData, Delay);\n }).catch(function(e) {\n bot.postMessageToGroup(channel, e.message);\n // Retry\n setTimeout(getData, Delay);\n });\n}", "title": "" }, { "docid": "a332969a72e6efcb34af469e7a92a33f", "score": "0.49095488", "text": "fetchAPIs (){\n\t\tthis.fetchWeatherData.call();\n\t\tthis.fetchForecastData.call();\n\t\tthis.fetchTflData.call();\n\t}", "title": "" }, { "docid": "98cbf7a657a92c8bc3a4775c6cf96758", "score": "0.48981395", "text": "async _getRealtimeData() {\n\t\tawait axios\n\t\t\t.post(config.baseUrl + '/getRealTimeData', {\n\t\t\t\ttest: 'hejsan',\n\t\t\t\tMeterID: config.meterID,\n\t\t\t})\n\t\t\t.then((response) => {\n\t\t\t\tvar watt = response.data.data.ActivePowerPlus;\n\t\t\t\tvar kwh = response.data.kwH;\n\t\t\t\tvar priceToday = kwh * 0.4;\n\t\t\t\tvar kwhWeekData = response.data.kwHWeek;\n\t\t\t\tvar weeklyUse = 0;\n\t\t\t\tfor (x in kwhWeekData) {\n\t\t\t\t\tweeklyUse = weeklyUse + kwhWeekData[x].kwH;\n\t\t\t\t}\n\t\t\t\tvar priceWeek = weeklyUse * 0.4;\n\t\t\t\tkwh = kwh.toFixed(5);\n\t\t\t\tpriceToday = priceToday.toFixed(4);\n\t\t\t\tpriceWeek = priceWeek.toFixed(4);\n\t\t\t\tweeklyUse = weeklyUse.toFixed(5);\n\t\t\t\tthis.setState({ usageToday: kwh });\n\t\t\t\tthis.setState({ currentWatt: watt });\n\t\t\t\tthis.setState({ priceToday: priceToday });\n\t\t\t\tthis.setState({ weekUsage: weeklyUse });\n\t\t\t\tthis.setState({ weekPrice: priceWeek });\n\t\t\t\tconsole.log(this.state.currentWatt);\n\n\t\t\t\t// if (this.state.watt > 2500 && this.state.sendMessage == true) {\n\t\t\t\t// \tthis.sendPushNotification('Effektanvändning', 'Du använder just nu ' + watt + '! Det börjar bli tungt!');\n\t\t\t\t// \tthis.setState({ sendMessage: false });\n\t\t\t\t// }\n\n\t\t\t\t// if (this.state.watt < 2500) {\n\t\t\t\t// \tthis.setState({ sendMessage: true });\n\t\t\t\t// }\n\n\t\t\t\treturn response;\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.log('Got error in _getReatltimeData', error);\n\t\t\t});\n\t}", "title": "" }, { "docid": "f71c5f00f37b363b3381d67ea8c8a5af", "score": "0.48967862", "text": "function scheduleRequest() {\n console.log('schedule refresh alarm to 60 min');\n chrome.alarms.create('refresh', {periodInMinutes: 60});\n}", "title": "" }, { "docid": "b38fcd7a7f8e75fbdc47dcee35a8d9ca", "score": "0.48802528", "text": "function getAlerts(lat, lon) {\n let alertUrl =\n \"https://api.openweathermap.org/data/2.5/onecall?&lat=\" +\n lat +\n \"&lon=\" +\n lon +\n \"&units=\" +\n config.unit +\n \"&lang=\" +\n config.lang +\n \"&appid=\" +\n config.apikey +\n \"&exclude=minutely,hourly,daily\";\n console.log(\"Getting alert from: \" + alertUrl);\n return fetch(alertUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n try {\n var alertData = {\n sender_name: data.alerts[0].sender_name,\n event: data.alerts[0].event,\n start: data.alerts[0].start,\n end: data.alerts[0].end,\n description: data.alerts[0].description,\n };\n } catch (e) {\n console.log(\"No alert found.\");\n return;\n }\n console.log(alertData);\n return alertData;\n });\n}", "title": "" }, { "docid": "50931fa7071423228d61544522fa6f80", "score": "0.48767766", "text": "function createAlarm(cycleTime) {\n if (cycleTime == undefined) { cycleTime = 60; }\n\n chrome.alarms.get(\"spot_notes\", function (alarm) {\n\n if (typeof alarm != \"undefined\") { // alarm has already been created\n return;\n } else {\n console.log(\"creating alarm!\");\n chrome.alarms.create(\"spot_notes\", { when: Date.now(), periodInMinutes: cycleTime });\n }\n });\n}", "title": "" }, { "docid": "f270b841175327a396932c97b95e1259", "score": "0.48749882", "text": "function getEvent(id) {\n return $http.get(utilityService.getBaseUrl() + 'events/' + id);\n }", "title": "" }, { "docid": "b86df2a23db082de02b5f805503ae0c1", "score": "0.48674676", "text": "async HelperGetTimer(url) {\n try {\n const reponse = await axios.get(url)\n this.timers = await reponse.data\n } catch (ex) {\n alert(ex.message)\n }\n }", "title": "" }, { "docid": "5391c526463867acf904841954cfd292", "score": "0.48640835", "text": "function getAllAlarms(userid) {\n clearAlarmDisplay();\n\n // Parse DB query to get all alarms\n var AlarmObject = Parse.Object.extend(\"Alarm\");\n var query = new Parse.Query(AlarmObject);\n query.equalTo('userid', userid);\n\n query.find({\n success: function(results) {\n if (results.length == 0) { // If no alarms set\n $(\"#alarms\").html(\"No Alarms Set\");\n }\n for (var i = 0; i < results.length; i++) { \n insertAlarm(results[i].get(\"time\"), results[i].get(\"alarmName\"));\n }\n }\n });\n}", "title": "" }, { "docid": "9aeb0f6c71733bbf806d6823767704a0", "score": "0.48590362", "text": "function CreateAlarm(TIME) {\n\tif (isInvalidInput(TIME)) {\n\t\tdocument.getElementById('intro').innerHTML = errorStr;\n\t\treturn;\n\t}\n\tchrome.tabs.query({active: true, currentWindow: true}, function(arrayOfTabs) {\n \tactiveTab = arrayOfTabs[0];\n\t\tvar activeTabURL = activeTab.url;\n\t\tvar activeTabID = activeTab.id;\n\t\tvar time = getTime(TIME);\n\t\tvar windID = activeTab.windowId;\n\t\tvar alarmName = activeTabURL + \" \" + windID;\n\t\tchrome.alarms.create(alarmName, {\n\t\t\t\"when\" : time\n\t\t});\n\t\tvar dataObj = {};\n\t\tdataObj[alarmName] = activeTabURL;\n\t\tchrome.storage.sync.set(dataObj);\n\t\tchrome.tabs.remove(activeTabID);\n\t\t\n\t});\n}", "title": "" }, { "docid": "c80ce90313667aeac20d035b6534ce52", "score": "0.48584607", "text": "getUpdateData () {\n\t\treturn {\n\t\t\tname: this.streamFactory.randomName(),\n\t\t\tpurpose: this.streamFactory.randomPurpose()\n\t\t};\n\t}", "title": "" }, { "docid": "d27f6ebb3414e31298573b4dd32e5110", "score": "0.48561662", "text": "getFactForToday () {\n this.fetchFactSource('today')\n }", "title": "" }, { "docid": "882e11859c8d8073d9a7b14592a5e159", "score": "0.48446977", "text": "get1mWeather(ip, response, dtNow){\n\n this._latestRecord().toArray((error, lastRecord) =>{\n if(error){\n lastRecord = \"null\";\n }\n\n this._getDbSize( (sizeResult)=>{\n \n let dtNowUtc = new Date();\n let dtFromUtc = new Date(); \n dtFromUtc.setMonth(dtNowUtc.getMonth() - 1); // minus 1 month\n\n this._samplingPer2hr(dtFromUtc, dtNowUtc).toArray((error, weatherResult) =>{\n if(error){\n\n console.log( timer.convert2IsoInLocaltimeZone(dtNow)\n + \": \" \n + ip \n + \"; \"\n + \"Fail; Get /weather, param={1m}; \"\n + error.toString() \n );\n return response.jstatus(500).json({ \n status: \"error\",\n message: error.toString(),\n });\n }\n response.json({ \n status: \"success\",\n message: \"success\",\n data: weatherResult,\n lastRecord: lastRecord,\n \"size\": sizeResult \n });\n console.log( timer.convert2IsoInLocaltimeZone(dtNow)\n + \": \" \n + ip \n + \"; \"\n + \"Success; Get /weather, param={1m}.\" \n );\n });\n });\n });\n }", "title": "" }, { "docid": "470e1b3c832dd7b68439f438129b4ca8", "score": "0.48446444", "text": "function getAppointmentSettingsData(branchid,userid,apt_set_id){\n params.filter = '{\"where\":{\"branch_id\":'+ branchid +',\"user_id\":'+ userid +',\"id\":'+ apt_set_id +'}}';\n AppoinmentSettingsService.get(params).$promise.then(function (response) {\n if(angular.isDefined(response)){\n $scope.settingValue = response.data[0];\n $scope.settingValue.calendar_slot_id = parseInt(response.data[0].calendar_slot_id);\n $scope.settingValue.is_today_first_day = checkASettingsResponse(response.data[0].is_today_first_day);\n $scope.settingValue.is_two_session = checkASettingsResponse(response.data[0].is_two_session);\n \n $scope.settingValue.practice_open = changeTimeFormat(response.data[0].practice_open);\n $scope.settingValue.practice_close = changeTimeFormat(response.data[0].practice_close);\n $scope.settingValue.lunch_at = changeTimeFormat(response.data[0].lunch_at);\n $scope.settingValue.resume_at = changeTimeFormat(response.data[0].resume_at);\n\n $scope.settingValue.sunday_practice_open = changeTimeFormat(response.data[0].sunday_practice_open);\n $scope.settingValue.sunday_practice_close = changeTimeFormat(response.data[0].sunday_practice_close);\n $scope.settingValue.sunday_lunch_at = changeTimeFormat(response.data[0].sunday_lunch_at);\n $scope.settingValue.sunday_resume_at = changeTimeFormat(response.data[0].sunday_resume_at);\n\n $scope.settingValue.monday_practice_open = changeTimeFormat(response.data[0].monday_practice_open);\n $scope.settingValue.monday_practice_close = changeTimeFormat(response.data[0].monday_practice_close);\n $scope.settingValue.monday_lunch_at = changeTimeFormat(response.data[0].monday_lunch_at);\n $scope.settingValue.monday_resume_at = changeTimeFormat(response.data[0].monday_resume_at);\n\n $scope.settingValue.tuesday_practice_open = changeTimeFormat(response.data[0].tuesday_practice_open);\n $scope.settingValue.tuesday_practice_close = changeTimeFormat(response.data[0].tuesday_practice_close);\n $scope.settingValue.tuesday_lunch_at = changeTimeFormat(response.data[0].tuesday_lunch_at);\n $scope.settingValue.tuesday_resume_at = changeTimeFormat(response.data[0].tuesday_resume_at);\n\n $scope.settingValue.wednesday_practice_open = changeTimeFormat(response.data[0].wednesday_practice_open);\n $scope.settingValue.wednesday_practice_close = changeTimeFormat(response.data[0].wednesday_practice_close);\n $scope.settingValue.wednesday_lunch_at = changeTimeFormat(response.data[0].wednesday_lunch_at);\n $scope.settingValue.wednesday_resume_at = changeTimeFormat(response.data[0].wednesday_resume_at);\n\n $scope.settingValue.thursday_practice_open = changeTimeFormat(response.data[0].thursday_practice_open);\n $scope.settingValue.thursday_practice_close = changeTimeFormat(response.data[0].thursday_practice_close);\n $scope.settingValue.thursday_lunch_at = changeTimeFormat(response.data[0].thursday_lunch_at);\n $scope.settingValue.thursday_resume_at = changeTimeFormat(response.data[0].thursday_resume_at);\n\n $scope.settingValue.friday_practice_open = changeTimeFormat(response.data[0].friday_practice_open);\n $scope.settingValue.friday_practice_close = changeTimeFormat(response.data[0].friday_practice_close);\n $scope.settingValue.friday_lunch_at = changeTimeFormat(response.data[0].friday_lunch_at);\n $scope.settingValue.friday_resume_at = changeTimeFormat(response.data[0].friday_resume_at);\n\n $scope.settingValue.saturday_practice_open = changeTimeFormat(response.data[0].saturday_practice_open);\n $scope.settingValue.saturday_practice_close = changeTimeFormat(response.data[0].saturday_practice_close);\n $scope.settingValue.saturday_lunch_at = changeTimeFormat(response.data[0].saturday_lunch_at);\n $scope.settingValue.saturday_resume_at = changeTimeFormat(response.data[0].saturday_resume_at);\n\n $scope.settingValue.type = checkASettingsResponse(response.data[0].type);\n $scope.settingValue.is_sunday_open = checkASettingsResponse(response.data[0].is_sunday_open);\n $scope.settingValue.sunday_two_session = checkASettingsResponse(response.data[0].sunday_two_session);\n $scope.settingValue.is_monday_open = checkASettingsResponse(response.data[0].is_monday_open);\n $scope.settingValue.monday_two_session = checkASettingsResponse(response.data[0].monday_two_session);\n $scope.settingValue.is_tuesday_open = checkASettingsResponse(response.data[0].is_tuesday_open);\n $scope.settingValue.tuesday_two_session = checkASettingsResponse(response.data[0].tuesday_two_session);\n $scope.settingValue.is_wednesday_open = checkASettingsResponse(response.data[0].is_wednesday_open);\n $scope.settingValue.wednesday_two_session = checkASettingsResponse(response.data[0].wednesday_two_session);\n $scope.settingValue.is_thursday_open = checkASettingsResponse(response.data[0].is_thursday_open);\n $scope.settingValue.thursday_two_session = checkASettingsResponse(response.data[0].thursday_two_session);\n $scope.settingValue.is_friday_open = checkASettingsResponse(response.data[0].is_friday_open);\n $scope.settingValue.friday_two_session = checkASettingsResponse(response.data[0].friday_two_session);\n $scope.settingValue.is_saturday_open = checkASettingsResponse(response.data[0].is_saturday_open);\n $scope.settingValue.saturday_two_session = checkASettingsResponse(response.data[0].saturday_two_session);\n $scope.settingValue.is_active = checkASettingsResponse(response.data[0].is_active); \n }\n });\n }", "title": "" }, { "docid": "50a70d5e86b09f424a9efdf3396a786b", "score": "0.48445383", "text": "appointment({context, entities}) {\n return new Promise(function(resolve, reject) {\n var http = require('http'); \n //var scheduleDateTime=formatDate(date,starttime);\n var url='http://192.168.0.10:8088/api/Appointment?doctorName=Alexander&sDate='+global.date.q+'T'+global.starttime.q+':00'; //scheduleDateTime; //2017-01-31T15:30:00\nhttp.get(url, (res) => {\n\nres.setEncoding('utf8');\n let rawData = '';\n res.on('data', (chunk) => rawData += chunk);\n res.on('end', () => {\n try {\n var parsedData = JSON.parse(rawData);\n // p= (parsedData.list[0].weather[0].description);\n //var datetime=null;\ndelete global.date.q;\ndelete global.starttime.q;\n context.appointment =parsedData;\n \n } \n // console.log(p);\n catch (e) {\n console.log(e.message);\n } \n\n return resolve(context);\n context.name=null;\n context.date=null;\n context.starttime=null;\n });\n\n}).on('error', (e) => {\n console.log(`Got error: ${e.message}`);\n});\n//var p = null;\n });\n }", "title": "" }, { "docid": "6a06768d46411147dba0fce3fde611ff", "score": "0.48406956", "text": "getWeekData(value){\n\nswitch(value){\n\ncase 1:\n \nvar weekId=setLastWeek('DDMMYYYY')\n\nthis.getWeekMeal(weekId)\nbreak;\n\ncase 2:\n\nvar weekId=setWeek('DDMMYYYY')\n\nthis.getWeekMeal(weekId)\nbreak;\n\ncase 3:\n\nvar weekId=setNextWeek('DDMMYYYY')\nthis.getWeekMeal(weekId)\n\n\nbreak;\n\n}\n\n}", "title": "" }, { "docid": "e83ee1cffea7bcdda8ce83cf28a18ef4", "score": "0.483982", "text": "get(expand, payload) {\n if (payload) {\n return providerSchemaToPlatformSchema(payload, expand);\n } else {\n return smartThingsHub.getDeviceDetailsAsync(controlId)\n .then((response) => {\n return providerSchemaToPlatformSchema(response, expand);\n });\n }\n }", "title": "" }, { "docid": "6d200a94f6adbbb0efa25324c0337fba", "score": "0.4837181", "text": "function getTrafficData (uaaToken, startTime, endTime, size) {\n var token = 'Bearer '+ uaaToken;\n // Your traffic api predix zone id.\n var trafficPredixZoneId = '7f6545e2-3a78-4ee8-9390-a6616de09050';\n\n // Traffic Events URL. This will be obtained from HATEOAS model.\n var trafficEventsUrl = 'https://ie-traffic.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000018/events';\n\n var deferred = $q.defer();\n\n // Ajax call to traffic events api.\n $http({\n method: 'GET',\n url: trafficEventsUrl,\n params: {'event-types':'TFEVT', 'start-ts':startTime, 'end-ts':endTime, 'size':size},\n headers: {'Authorization': token, 'Predix-Zone-Id': trafficPredixZoneId},\n timeout: 30000,\n cache: false\n })\n .success(function(data){\n deferred.resolve(data);\n })\n .error(function(err){\n deferred.reject(err);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "bd2b5e258eed43d777eec0df6a4a93e6", "score": "0.48369023", "text": "checkAlarms(time) {\n if (!this._alarms) {\n throw Error('alarms not set =/');\n }\n\n // get current time reference\n const now = time || moment();\n logger.silly(`Time is ${now.format(format)}`);\n\n // look for an active alarm\n const enableAlarm = _.find(this._alarms, alarm => {\n const { hour: alarmHour,\n minute: alarmMinute } = alarm;\n\n // create time reference for the alarm enable\n const alarmEnable = moment()\n .hour(alarmHour)\n .minute(alarmMinute);\n\n return now.isSame(alarmEnable, 'minute');\n });\n\n // look for an active alarm\n const disableAlarm = _.find(this._alarms, alarm => {\n const { hour: alarmHour,\n minute: alarmMinute,\n duration: alarmDuration } = alarm;\n\n // create time reference for the alarm disable\n const alarmDisable = moment()\n .hour(alarmHour)\n .minute(alarmMinute)\n .add(alarmDuration, 'minutes');\n\n return now.isSame(alarmDisable, 'minute');\n });\n\n if (enableAlarm) {\n this.handleChange(true, now.format('dddd hh:mm:ss a'), enableAlarm.name);\n }\n\n if (disableAlarm) {\n this.handleChange(false, now.format('dddd hh:mm:ss a'), disableAlarm.name);\n }\n }", "title": "" }, { "docid": "1b05571ddbbe476bce5165ffa4ffaff6", "score": "0.48365197", "text": "static dataFromAPI(){\n const dataAPI = fetch(DBHelper.DATABASE_URL)\n .then(DBHelper.convertToJson)\n .then(restaurants => {\n DBHelper.saveData(restaurants);\n return restaurants;\n });\n return dataAPI;\n }", "title": "" }, { "docid": "dbc4bdffa17e820992550189be539775", "score": "0.48356596", "text": "get (what) {\n const stats = Object.assign({}, this.stats);\n stats.aob = {Event: this.getEventStats()};\n if (this.ao.notifications) {\n stats.notifications = this.ao.notifications.getStats();\n }\n\n return stats;\n }", "title": "" }, { "docid": "74121c70b9fe473c128a1e99216cd754", "score": "0.48325324", "text": "function handleInstalled(details) {\n\nconsole.log('inside the handleInstalled');\nconst when = nearestMin30();\n\n/*browser.alarms.create(\"my-periodic-alarm-install\", {\n //when,\n //Date.now(),\n periodInMinutes\n});*/\n\n\nconsole.log('next alarm at ::::'+when+\" and the current is::::\"+new Date().getTime());\n\n}", "title": "" }, { "docid": "93d7c58d523639282251c62c54baa5d5", "score": "0.48325104", "text": "run() {\n logger.debug('running wakelight');\n if (!this._alarms) {\n logger.error('alarms not set');\n return;\n }\n this.checkAlarms();\n\n /*\n * set an interval to check the time and see if the alarm\n * should be activated\n */\n this._timer = setInterval(() => {\n this.checkAlarms();\n }, 60000);\n }", "title": "" }, { "docid": "7fec8934702c9dfa7fed93fa56514766", "score": "0.48308405", "text": "get(expand, payload) {\n if (payload) {\n return providerSchemaToPlatformSchema(payload, expand);\n } else {\n return this.winkHub.getDeviceDetailsAsync(this.deviceType, this.controlId)\n .then((response) => {\n return providerSchemaToPlatformSchema(response.data, expand);\n });\n }\n }", "title": "" }, { "docid": "d57190d1c5066577b8f7859773152f1e", "score": "0.48295668", "text": "async addAppointment() {\n\n }", "title": "" }, { "docid": "aa576f50a6ac6bab6291d3ce23d34dff", "score": "0.48250678", "text": "async function getApiAsteroid() {\n let d = new Date();\n let month = (d.getMonth()) + 1;\n let day = d.getDate();\n let year = d.getFullYear();\n var date = `${year}-${month}-${day}`;\n let apiKey = \"f5oRMiVGZ9rWbjcjmxWkOFanJ0bTORX63pEubMrJ\";\n let response = await fetch(`https://api.nasa.gov/neo/rest/v1/feed?start_date=${date}&end_date=${date}&api_key=${apiKey}`);\n let data = await response.json();\n useApiAsteroid(data);\n}", "title": "" }, { "docid": "c72eb52f81c0ac3d4070ad1074ec4d1e", "score": "0.48238614", "text": "function showAlarms() {\n\tclearDisplay();\n\tchrome.storage.sync.get(null, function(items){\n\t\tvar ks = Object.keys(items);\n\t\tvar showAlms = document.createElement(\"div\");\n\t\tshowAlms.id = \"all-alarms\";\n\t\tshowAlms.style.textAlign = \"center\";\n\t\tdocument.body.appendChild(showAlms);\n\t\tfor(i=0; i<ks.length; i++){\n\t\t\tvar item = document.createElement('span');\n\t\t\titem.id = ks[i];\n\t\t\tshowAlms.appendChild(item);\n\t\t\taddAlarmView(ks[i]);\n\t\t}\n\t\tif (ks.length == 0) {\n\t\t\tvar txt = document.createElement('h4');\n\t\t\tvar error = document.createTextNode(\"Sorry, you don't have anything saved!\");\n\t\t\ttxt.appendChild(error);\n\t\t\ttxt.className = \"text\";\n\t\t\tshowAlms.appendChild(txt);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "06c2e51a2f4e80562324e7552228ec63", "score": "0.48238602", "text": "async function getDailyDataForSensorId(sensor_id) {\n let sensor_name = await getSensorNameForId(sensor_id)\n\n\n let sd = new Date()\n sd.setDate(sd.getDate() - 2)\n let start_date_string = sd.toISOString().split('T')[0]\n\n let url = `${SENSOR_DATA_URL}${sensor_name}?&start_ts=${start_date_string}`\n\n let response = await fetch(url)\n let json = await response.json()\n return json.data\n}", "title": "" } ]
7483c518f4b43bdb8c40520d24a03275
Function to update both histogram
[ { "docid": "d5045448390fee80d05e36f49203268b", "score": "0.0", "text": "function updateBoth() {\n\t\tupdateFall();\n\n\t\tupdateSpring();\n\t}", "title": "" } ]
[ { "docid": "c34c16cc7fea2d76c3ddb038a7fc9da9", "score": "0.6723754", "text": "function update() {\n attribute=d3.select(\"#Hist_attribute\").node().value;\n nBin=d3.select(\"#nBin\").node().value;\n wholeData=d3.select(\"#histWholeData\").property(\"checked\");\n histData=plotData;\n if(wholeData)\n histData=allData;\n x.domain([0, d3.max(histData, function(d) { return +d[attribute];})])\n // set the parameters for the histogram\n var histogram = d3.histogram()\n .value(function(d) { return d[attribute]; }) // I need to give the vector of value\n .domain(x.domain()) // then the domain of the graphic\n .thresholds(x.ticks(nBin)); // then the numbers of bins\n\n // And apply this function to data to get the bins\n var bins = histogram(histData);\n\n\n // Y axis: update now that we know the domain\n y.domain([0, d3.max(bins, function(d) { return d.length; })]); // d3.hist has to be called before the Y axis obviously\n\n xAxis\n .transition()\n .duration(1000)\n .call(d3.axisBottom(x));\n yAxis\n .transition()\n .duration(1000)\n .call(d3.axisLeft(y));\n\n // Join the rect with the bins data\n var u = svg.selectAll(\"rect\")\n .data(bins)\n\n // Manage the existing bars and eventually the new ones:\n u\n .enter()\n .append(\"rect\") // Add a new rect for each new elements\n .merge(u) // get the already existing elements as well\n .transition() // and apply changes to all of them\n .duration(1000)\n .attr(\"x\", 1)\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.x0) + \",\" + y(d.length) + \")\"; })\n .attr(\"width\", function(d) { return x(d.x1) - x(d.x0) -1 ; })\n .attr(\"height\", function(d) { return height - y(d.length); })\n .style(\"fill\", \"#69b3a2\")\n\n\n\n // If less bar in the new histogram, I delete the ones not in use anymore\n u\n .exit()\n .remove()\n\n }", "title": "" }, { "docid": "569989f49c4557efbec43bdd3f03677b", "score": "0.65558004", "text": "function update(nBin) {\n\n var colours = [ \"#006837\",\n \"#096336\",\n \"#115d35\",\n \"#1a5834\",\n \"#235233\",\n \"#2b4d33\",\n \"#344732\",\n \"#3d4231\",\n \"#453c30\",\n \"#4e372f\",\n \"#57312e\",\n \"#602c2d\",\n \"#68262c\",\n \"#71212b\",\n \"#7a1b2a\",\n \"#82162a\",\n \"#8b1029\",\n \"#940b28\",\n \"#9c0527\",\n \"#a50026\"];\n\n\n // set the parameters for the histogram\n var histogram = d3.histogram()\n .value(function(d) { return +d.mag; }) // I need to give the vector of value\n .domain(x.domain()) // then the domain of the graphic\n .thresholds(x.ticks(nBin)); // then the numbers of bins\n\n // And apply this function to data to get the bins\n bins = histogram(tjb.earthquakes);\n\n\n // Join the rect with the bins data\n var u = histo_xAxis.selectAll(\".hrects\").data(bins)\n\n y = d3.scaleLinear().range([histoHeight, 0]);\n y.domain([0, Math.ceil((d3.max(bins, function(d) { return d.length; })) / 100) * 100 ]); // d3.hist has to be called before the Y axis obviously\n \n var yAxis = g.append(\"g\")\n .style(\"opacity\" , 1.0)\n .attr(\"class\" , \"yAxis axis histo\")\n .attr(\"transform\", 'translate(' + (margin.left) + ', ' + ((tjb.height*0.8)-histoHeight) + ')');\n // Y axis: initialization\n yAxis.call(d3.axisLeft(y));\n\n mainGraphBottom_yticks = g.selectAll('.yAxis.axis.histo').selectAll('.tick'); \n mainGraphBottom_yticks.append('svg:line')\n .attr( 'class' , \"mainGraphBottom_yticks\" )\n .attr( 'id' , \"yAxisTicks\" )\n .attr( 'y0' , 0 )\n .attr( 'y1' , 0 )\n .attr( 'x1' , chartWidth-margin.left-margin.right )\n .attr( 'x2' , 0 )\n .style(\"opacity\" , 0.333)\n .style(\"stroke-width\" , \"1.0px\")\n .style(\"fill\" , \"none\")\n .style(\"stroke\" , \"#A0A0A0\");\n\n // Manage the existing bars and eventually the new ones:\n u.enter()\n .append(\"rect\") // Add a new rect for each new elements \n .attr(\"class\" , \"basehrects\")\n .merge(u) // get the already existing elements as well\n .transition() // and apply changes to all of them\n .duration(0)\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.x0) + \",\" + (-histoHeight) + \")\"; })\n .attr(\"width\", function(d) { return x(d.x1) - x(d.x0) -1 ; })\n .style(\"stroke-opacity\", 1.00)\n .style(\"fill-opacity\", 0.66)\n .style(\"opacity\", 1.0)\n .transition() // and apply changes to all of them\n .duration(0)\n .attr(\"class\" , \"hrects\")\n .attr(\"x\", 1)\n .attr(\"y\", function(d) { return y(d.length); })\n .attr(\"height\", function(d) { return histoHeight - y(d.length); })\n .style(\"stroke-width\", \"1.25px\")\n .style(\"stroke\", function(d,i){ return \"#abcdef\" /*colours[i]*/; })\n .style(\"fill\", function(d,i){ return \"#abcdef\" /*colours[i]*/; })\n\n // If less bar in the new histogram, I delete the ones not in use anymore\n u\n .exit()\n .remove()\n \n d3.selectAll(\".yAxis.axis.histo text\").attr(\"x\" , \"-15\").style(\"opacity\" , 1.0).style(\"text-anchor\" , \"end\"); \n d3.selectAll('.yAxis.axis.histo').append(\"text\").attr(\"class\" , \"yAxisTitle major\" ).attr(\"x\" , 0).attr(\"y\" , -25)/*.style(\"font-size\" , \"16px\")*/.text(\"Number\")\n\n var sel = d3.selectAll(\".xAxis.axis.histo\");\n sel.moveToFront();\n\n }", "title": "" }, { "docid": "43ba7001d4f4956aed5c360db5bcc027", "score": "0.63141215", "text": "update_graph(){\n this.distribution_graph.selectAll('rect').remove()\n let classRef = this\n let temp = this.data.filter(d => (d['date'] < this.parent.year0) && (d['date'] > this.parent.year0 - this.parent.window)).map(d => d[classRef.y_attribute])\n if(temp.length > 0){\n this.hist = d3.histogram()\n .value(d => d)\n .domain(classRef.y.domain())\n .thresholds(classRef.y.ticks(this.TICKS * 4))\n\n let bins = this.hist(temp)\n let height_scale = d3.scaleLinear()\n .domain([0, d3.max(bins, b => b.length)])\n .range([0, this.W / 5])\n\n this.distribution_graph.selectAll(\"rect\")\n .data(bins)\n .enter()\n .append(\"rect\")\n .attr(\"x\", 1)\n .attr(\"transform\", d => `translate(${classRef.y(d.x1) - classRef.label_height}, ${-height_scale(d.length)})`)\n .attr(\"width\", d => classRef.y(d.x0) - classRef.y(d.x1))\n .attr(\"height\", d => height_scale(d.length))\n .style(\"fill\", this.rgb)\n .style('opacity', 0.7)\n }\n\n }", "title": "" }, { "docid": "d6b486c22d79d50ff6d77fe03a4c4d16", "score": "0.62013197", "text": "function updatehistogram2(data, value1, value2) {\n\n\t\t\t\nvar data = data.filter(function(d) { \n return (d.Site==value2 & d.Abundance==value1 & d.CHX==\"CHX\"); //& d.CHX==value3\n \n });\n\nxFigure6nC.domain(data.map(function(d) { return d.Values; }));\nyFigure6nC.domain([0, d3.max(data, function(d) { return d.Counts; })]);\n\nvar values = function(d) {\n\t\t\t\t\treturn d.Values;\n\t\t\t\t};\n\nfunction closest (num, arr) {\n var curr = arr[0];\n var diff = Math.abs (num - curr);\n for (var val = 0; val < arr.length; val++) {\n var newdiff = Math.abs (num - arr[val]);\n if (newdiff < diff) {\n diff = newdiff;\n curr = arr[val];\n }\n }\n return curr;\n }\n \nvar testnumber=MyApp.thecorr;\n\nvar testarray=data.map(function(d) { return d.Values; });\nvar closestnr=closest(testnumber, testarray);\n \t\t\t\t\t\n \t\t\t\t\t\nvar textFigure6 = svgFigure6nC.selectAll(\"rect\")\n .data(data);\n \n \t textFigure6.attr(\"class\", \"update\")\n \t\t\t.transition()\n \t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n .duration(750)\n \t\t\t\t.attr(\"x\", function(d) { return xFigure6nC(d.Values); })\n \t\t\t\t.attr(\"width\", xFigure6nC.rangeBand())\n \t\t\t\t.attr(\"y\", function(d) { return yFigure6nC(d.Counts); })\n \t\t\t\t.attr(\"height\", function(d) { return heightFigure6C - yFigure6nC(d.Counts)-paddingxFigure6C; }).style(\"fill\", \"#bcbddc\");\n\n textFigure6.enter().append(\"rect\")\n .attr(\"class\", \"enter\")\n .attr(\"x\", function(d) { return xFigure6nC(d.Values); })\n \t\t\t\t.attr(\"width\", xFigure6nC.rangeBand())\n \t\t\t\t.attr(\"y\", function(d) { return yFigure6nC(d.Counts); })\n \t\t\t\t.attr(\"height\", function(d) { return heightFigure6C - yFigure6nC(d.Counts)-paddingxFigure6C; }).style(\"fill\", \"#bcbddc\").style(\"opacity\", .65)\n //.text(function(d) { return d; })\n .transition()\n \t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n .duration(750)\n .attr(\"x\", function(d) { return xFigure6nC(d.Values); })\n \t\t\t\t.attr(\"width\", xFigure6nC.rangeBand())\n \t\t\t\t.attr(\"y\", function(d) { return yFigure6nC(d.Counts); })\n \t\t\t\t.attr(\"height\", function(d) { return heightFigure6C - yFigure6nC(d.Counts)-paddingxFigure6C; }).style(\"fill\", \"#bcbddc\").style(\"opacity\", .65);\n\n\ntextFigure6.exit().attr(\"class\", \"exit\")\n .transition()\n \t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n .duration(750)\n //.style(\"fill\", \"rgb(153,216,201)\")\n .remove();\n \n\n svgFigure6nC.select(\".x.axis\")\n\t\t.transition()\n\t\t\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t.duration(250)\n\t\t.call(xAxisFigure6nC);\n\t\t\n svgFigure6nC.select(\".y.axis\")\n\t\t.transition()\n\t\t\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t.duration(250)\n\t\t.call(yAxisFigure6nC);\n\t\t\nsvgFigure6nC.select(\".xaxislabel\")\n\t\t\t.transition()\n\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t\t.duration(250);\n\n\t\t\nsvgFigure6nC.select(\".r-line2\")\n // .attr(\"class\", \"line\")\n .attr(\"x1\", xFigure6nC(closestnr) + xFigure6nC.rangeBand()/2)\n .attr(\"x2\", xFigure6nC(closestnr) + xFigure6nC.rangeBand()/2)\n .attr(\"y1\", 0)\n .attr(\"y2\", heightFigure6C).style(\"stroke-width\",2)\n \t\t.style(\"stroke\", \"grey\").transition()\n\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t\t.duration(750).attr(\"x1\", xFigure6nC(closestnr) + xFigure6nC.rangeBand()/2)\n .attr(\"x2\", xFigure6nC(closestnr) + xFigure6nC.rangeBand()/2)\n .attr(\"y1\", 0)\n .attr(\"y2\", (heightFigure6C-paddingxFigure6C)).style(\"stroke-width\",2)\n \t\t.style(\"stroke\", \"grey\");\t \n\t\t\t\t\t\n}", "title": "" }, { "docid": "e21de2713c881c273dd37ad00300db67", "score": "0.6196339", "text": "function updateHRV(RR_Histogram,HR_Histogram,RR_s,Freqs,Pxx){\n\n //---RR Histogram---//\n var RR_len_half = RR_Histogram.length/2;\n\t var HR_len_half = HR_Histogram.length/2;\n var RR_counts_points=RR_Histogram.slice(0,RR_len_half);\n\t\tvar RR_limits_points=RR_Histogram.slice(RR_len_half);\n\t\tvar HR_counts_points=HR_Histogram.slice(0,HR_len_half);\n\t\tvar HR_limits_points=HR_Histogram.slice(HR_len_half);\n\t \t\n\t RR_Histogram_Options[\"xAxis\"][0][\"data\"] = RR_limits_points;\n\t RR_Histogram_Options[\"series\"][0][\"data\"] = RR_counts_points;\n\t RR_Histogram_Chart.setOption(RR_Histogram_Options,true);\n\t\t\n\t\tHR_Histogram_Options[\"xAxis\"][0][\"data\"] = HR_limits_points;\n\t HR_Histogram_Options[\"series\"][0][\"data\"] = HR_counts_points;\n\t HR_Histogram_Chart.setOption(HR_Histogram_Options,true);\n\t\t\n\t\t//---Poincare Plot---//\n\t\tvar rr_s_x = RR_s.slice(0,-1);\n var rr_s_y = RR_s.slice(1);\n\t\tvar len_rr_sx = rr_s_x.length;\n\t\tvar rr_ms_xy = [];\n\t\tfor(var i=0;i<len_rr_sx;i++){\n rr_ms_xy.push([rr_s_x[i]*1000,rr_s_y[i]*1000])\n }\n\t\t\n\t\tPoincare_Options[\"series\"][0][\"data\"] = rr_ms_xy;\n\t Poincare_Chart.setOption(Poincare_Options,true);\n\t\t\n\t\t//---Power Spectral Density--///\n\t\tvar freqs = [];\n var step = Freqs[1]/(Freqs[2]-1);\n for(var i=0;i<Freqs[2];i++){\n freqs[i] = step*i;\n }\n\t\t\n\t\tvar freqs_pxx = [];\n\t\tvar len;\n if (freqs.length == Pxx.length){\n len = freqs.length; \n }\n \n for(var i=0;i<len;i++){\n freqs_pxx.push([freqs[i],Pxx[i]])\n }\n\t\t\n\t\tfor(var i=0;i<len;i++){\n if (freqs[i]>0.04){\n ulf_lfSeg = i;\n break;\n }\n }\n for(var i=0;i<len;i++){\n if (freqs[i]>0.15){\n lf_hfSeg = i;\n break;\n }\n }\n\t\t\n\t\tPSD_Options[\"series\"][0][\"data\"] = freqs_pxx.slice(0,ulf_lfSeg+1);\n\t PSD_Options[\"series\"][1][\"data\"] = freqs_pxx.slice(ulf_lfSeg,lf_hfSeg+1);\n\t PSD_Options[\"series\"][2][\"data\"] = freqs_pxx.slice(lf_hfSeg);\n\t PSD_Chart.setOption(PSD_Options,true);\n \n\t\t\n}", "title": "" }, { "docid": "e93df29419770ba16694f4e772bbfe76", "score": "0.61950886", "text": "function update_histogram(feature_name, data, nBin){\n\n var svg = d3.select(\"svg\");\n \n // Reload the fresh data from csv\n load_data(feature_name, data);\n\n // Update X Axis details\n update_max_x();\n update_x_axis(feature_name, data, nBin , svg); \n \n // Add transition to X Axis\n svg.select('#x-axis')\n .transition().duration(axis_transition_time)\n .call(xAxisGen);\n \n // Update Y Axis details\n yaxis_ticks = svg.select('#y-axis');\n update_y_axis();\n\n // Re render the bars of the histogram based upon new bin values\n render_histo_bars(nBin);\n }", "title": "" }, { "docid": "850bb3946ac2bfa6fe0c67fbeed4b92d", "score": "0.61427003", "text": "function updatehistogram1(data, value1, value2) {\n\n\t\t\t\nvar data = data.filter(function(d) { \n return (d.Site==value2 & d.Abundance==value1 & d.CHX==\"non-CHX\"); //& d.CHX==value3\n \n });\n\nxFigure6C.domain(data.map(function(d) { return d.Values; }));\nyFigure6C.domain([0, d3.max(data, function(d) { return d.Counts; })]);\n\nvar values = function(d) {\n\t\t\t\t\treturn d.Values;\n\t\t\t\t};\n\nfunction closest (num, arr) {\n var curr = arr[0];\n var diff = Math.abs (num - curr);\n for (var val = 0; val < arr.length; val++) {\n var newdiff = Math.abs (num - arr[val]);\n if (newdiff < diff) {\n diff = newdiff;\n curr = arr[val];\n }\n }\n return curr;\n }\n \nvar testnumber=MyApp.thecorr;\n\nvar testarray=data.map(function(d) { return d.Values; });\nvar closestnr=closest(testnumber, testarray);\n \t\t\t\t\t\n \t\t\t\t\t\nvar textFigure6 = svgFigure6C.selectAll(\"rect\")\n .data(data);\n \n \t textFigure6.attr(\"class\", \"update\")\n \t\t\t.transition()\n \t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n .duration(750)\n \t\t\t\t.attr(\"x\", function(d) { return xFigure6C(d.Values); })\n \t\t\t\t.attr(\"width\", xFigure6C.rangeBand())\n \t\t\t\t.attr(\"y\", function(d) { return yFigure6C(d.Counts); })\n \t\t\t\t.attr(\"height\", function(d) { return heightFigure6C - yFigure6C(d.Counts)-paddingxFigure6C; }).style(\"fill\", \"#bcbddc\");\n\n textFigure6.enter().append(\"rect\")\n .attr(\"class\", \"enter\")\n .attr(\"x\", function(d) { return xFigure6C(d.Values); })\n \t\t\t\t.attr(\"width\", xFigure6C.rangeBand())\n \t\t\t\t.attr(\"y\", function(d) { return yFigure6C(d.Counts); })\n \t\t\t\t.attr(\"height\", function(d) { return heightFigure6C - yFigure6C(d.Counts)-paddingxFigure6C; }).style(\"fill\", \"#bcbddc\").style(\"opacity\", .65)\n //.text(function(d) { return d; })\n .transition()\n \t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n .duration(750)\n .attr(\"x\", function(d) { return xFigure6C(d.Values); })\n \t\t\t\t.attr(\"width\", xFigure6C.rangeBand())\n \t\t\t\t.attr(\"y\", function(d) { return yFigure6C(d.Counts); })\n \t\t\t\t.attr(\"height\", function(d) { return heightFigure6C - yFigure6C(d.Counts)-paddingxFigure6C; }).style(\"fill\", \"#bcbddc\").style(\"opacity\", .65);\n\n\ntextFigure6.exit().attr(\"class\", \"exit\")\n .transition()\n \t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n .duration(750)\n //.style(\"fill\", \"rgb(153,216,201)\")\n .remove();\n \n\n svgFigure6C.select(\".x.axis\")\n\t\t.transition()\n\t\t\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t.duration(500)\n\t\t.call(xAxisFigure6C);\n\t\t\nsvgFigure6C.select(\".y.axis\")\n\t\t.transition()\n\t\t\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t.duration(500)\n\t\t.call(yAxisFigure6C);\n\t\t\nsvgFigure6C.select(\".xaxis_label\")\n\t\t\t.transition()\n\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t\t.duration(500);\n\n\t\t\nsvgFigure6C.select(\".r-line\")\n // .attr(\"class\", \"line\")\n .attr(\"x1\", xFigure6C(closestnr) + xFigure6C.rangeBand()/2)\n .attr(\"x2\", xFigure6C(closestnr) + xFigure6C.rangeBand()/2)\n .attr(\"y1\", 0)\n .attr(\"y2\", heightFigure6C).style(\"stroke-width\",2)\n \t\t.style(\"stroke\", \"grey\").transition()\n\t\t\t.ease(\"linear\")\n\t\t\t.delay(function(d, i) {\n\t\t\t\t\treturn i / data.length * 500;\n\t\t\t})\n\t\t\t.duration(750).attr(\"x1\", xFigure6C(closestnr) + xFigure6C.rangeBand()/2)\n .attr(\"x2\", xFigure6C(closestnr) + xFigure6C.rangeBand()/2)\n .attr(\"y1\", 0)\n .attr(\"y2\", (heightFigure6C-paddingxFigure6C)).style(\"stroke-width\",2)\n \t\t.style(\"stroke\", \"grey\");\t \n\n\n \t\t\t\t\t\n}", "title": "" }, { "docid": "944ca483300a02342c6f1c29c0e26332", "score": "0.6078236", "text": "function updateHistogram(id, fData, varName) {\n var hgDim={t: 60, b: 30, l: 0, r: 0};\n hgDim.w = 500 - hgDim.l - hgDim.r;\n hgDim.h = 300 - hgDim.t - hgDim.b;\n\n // title of histogram\n d3.select(id).select('h1')\n .html('Histogram of ' + varName);\n\n // select svg of histogram\n var hgSvg = d3.select(id).select('svg').select('g');\n\n // create function for x-axis mapping\n var x = d3.scaleBand().rangeRound([0, hgDim.w])\n .domain(fData.map(function(d) { return d[0]; }));\n\n // add x-axis to histogram\n hgSvg.select('g').call(d3.axisBottom(x));\n\n // create function for y-axis mapping\n var y = d3.scaleLinear().range([hgDim.h - 20, 0])\n .domain([0, d3.max(fData, function(d) { return d[1]; })]);\n\n // remove old bars\n var bars = hgSvg.selectAll('.bar').data(fData, function(d) { return d; });\n bars.exit().remove();\n\n // add new bars\n bars = hgSvg.selectAll('.bar').data(fData).enter()\n .append('g').attr('class', 'bar');\n\n // create rectangles\n bars.append('rect')\n .attr('x', function(d) { return x(d[0]); })\n .attr('y', function(d) { return y(d[1]); })\n .attr('width', x.bandwidth())\n .attr('height', function(d) { return hgDim.h - y(d[1]); })\n .attr('fill', 'steelblue');\n\n // create frequency labels above bars\n bars.append('text').text(function(d) { return d3.format(',')(d[1]) })\n .attr('x', function(d) { return x(d[0]) + x.bandwidth()/2; })\n .attr('y', function(d) { return y(d[1]) - 5; })\n .attr('text-anchor', 'middle');\n}", "title": "" }, { "docid": "e3adf65ad0dd7cf652e2d088388c92f5", "score": "0.5986028", "text": "function refresh(values){\r\n // var values = d3.range(1000).map(d3.random.normal(20, 5));\r\n var data = d3.layout.histogram()\r\n .bins(x.ticks(20))\r\n (values);\r\n // Reset y domain using new data\r\n var yMax = d3.max(data, function(d){return d.length});\r\n var yMin = d3.min(data, function(d){return d.length});\r\n y.domain([0, yMax]);\r\n var colorScale = d3.scale.linear()\r\n .domain([yMin, yMax])\r\n .range([d3.rgb(color).brighter(), d3.rgb(color).darker()]);\r\n var bar = svg.selectAll(\".bar\").data(data);\r\n // Remove object with data\r\n bar.exit().remove();\r\n bar.transition()\r\n .duration(1000)\r\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.x) + \",\" + y(d.y) + \")\"; });\r\n bar.select(\"rect\")\r\n .transition()\r\n .duration(1000)\r\n .attr(\"height\", function(d) { return height - y(d.y); })\r\n .attr(\"fill\", function(d) { return colorScale(d.y) });\r\n bar.select(\"text\")\r\n .transition()\r\n .duration(1000)\r\n .text(function(d) { return formatCount(d.y); });\r\n }", "title": "" }, { "docid": "a99a167028d1f63903028c60cf99f32e", "score": "0.5958034", "text": "function uc1_update(data, g, binSize, minY, mutationTypes, stacked, showTotal, normalize) {\n\n console.log(\"Building an histogram with \"+binSize+\" binSize. Normalize: \"+normalize);\n \n g.svg.select(\"#ylabel\")\n .text(normalize?\"number of mutations per bin / mean\":\"number of mutations per bin\"); \n\n /* In di3.js d3.histogram is called a Layout and shows the distribution of data by grouping\n * discrete data points into * bins. Constructs a new histogram function with a provided value accessor,\n * range function, and bin function. The returned layout object is both an object and a function. \n * That is: you can call it as an object to set additional parameter (e.g. .value(), .domain() ...), \n * or to get the binned data.\n\n https://d3-wiki.readthedocs.io/zh_CN/master/Histogram-Layout/?q=d3.histogram&check_keywords=yes&area=default */\n\n ticks = getTicks(g.xAxisScale.domain()[0], g.xAxisScale.domain()[1], binSize);\n\n // Configure the histogram function\n var histogram = d3.histogram()\n /* The value accessor: for each mutation return the distance from the motif */\n .value(function(d) {\n return d[0];\n })\n /* Then the domain of the graph: 0 to max_x already defined... */\n .domain(g.xAxisScale.domain()) \n /* An array of thresholds defines how values should be split among bins. \n * Each value defines the upper limit of a given bin. xAxisScale.ticks(bins) returns the\n * array representing the xAxis split into (more-or-less) binSize parts (bins). */\n // https://github.com/d3/d3-scale/issues/9\n .thresholds(ticks); \n\n\n /* Apply the defined function to data to get the bins (array of array, nBins x itemsInThatBin)\n * bins[0] is both an array of items (contained into that bin), and an object with properties:\n * - x0: start coordinate of the bin\n * - x1: stop coordinate of the bin */\n var bins = histogram(data);\n\n /* Now, since we can know the maximum value of y, \n * we can complete the definition of yAxisScale and then build the yAxis.\n * The max function iterates over the bins, and for each bin (another array) takes the number of contained items (length * of the array containing the items) */\n \n let avg = null;\n \n if(normalize){\n let fullTicks = getTicks(g.fullXAxisScale.domain()[0], g.fullXAxisScale.domain()[1], binSize);\n let fullHistogram = d3.histogram().value(function(d) {return d[0];}).domain(g.fullXAxisScale.domain()).thresholds(fullTicks); \n \n let normData = showTotal? data : uc1_getFilteredData(data,mutationTypes); \n \n let fullBins = fullHistogram(normData);\n\n avg = d3.mean(fullBins, function(d) { return uc1_yVal(d)});\n } \n \n dataMin = d3.max(bins, function(d) { return uc1_yVal(d,normalize,avg)});\n \n console.log(\"MIN :\"+dataMin)\n console.log(\"minY :\"+minY)\n \n yMin = dataMin + 0.2*dataMin;\n if(minY > dataMin)\n yMin = minY +0.2*minY;\n \n console.log(\"yMin :\"+yMin)\n \n g.yAxisScale.domain([0,yMin])//.domain([0, + 20]);\n\n g.yAxis\n .transition()\n .duration(1000)\n .call(d3.axisLeft(g.yAxisScale).tickFormat(function(d) { return normalize?d3.format(\"\")(d):d3.format(\".2s\")(d)}));\n\n // Adding vertical bars \n\n /* In d3, selection methods, e.g. selectAll are used to select existing objects.\n * Joining Data ( selection.data() ), allows to bind a selection to an array of data, \n * returning another selection, called \"update selection\", that is aware of which data is already represented in the \n * plot, what is missing from the plot, what is in the plot but not in the data. In particular, we can call on the \n * \"update selection\" the following methods:\n * - enter(): if the element is not represented in the data, creates the representation for that data\n * \n * On the result of a selection method you can call:\n * - enter() : to create the DOM elements in the data not present in the plot\n * - exit() : returns the DOM elements with no correspondences in the data\n * - remove() : removes the selected elements from the document. */\n\n\n // Remove all the bars existing in the plot\n g.svg.selectAll(\"rect\").remove();\n g.svg.selectAll(\".legend\").remove();\n\n\n // Create the legend container\n g.legend = g.svg.append(\"g\")\n .attr(\"class\",\"legend\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"1em\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"transform\", \"translate(\"+(g.width)+\",0)\");\n\n // Bars representing the amount of mutations in a bin, independently on the type of mutation\n if (showTotal) {\n uc1_addBars(g, 0, bins, null, \"silver\",normalize,avg);\n uc1_addLegendItem(g, 0, \"silver\", \"ALL\");\n }\n\n // Bars representing the selected types of mutations\n\n alreadyAdded = bins.map(function(bin){return 0;});\n\n filteredArray = [];\n maxInFiltered = 0;\n\n for( var i=0; i<mutationTypes.length; i++) {\n\n type = mutationTypes[i];\n\n filteredData = uc1_getFilteredData(data, [type]);\n filteredArray[i] = histogram(filteredData);\n\n curMax = d3.max( filteredArray[i], function(d) { return uc1_yVal(d, normalize, avg) })\n maxInFiltered = curMax>maxInFiltered?curMax:maxInFiltered;\n\n }\n\n if( !showTotal) {\n g.yAxisScale.domain([0, maxInFiltered + 0.2*maxInFiltered]);\n\n g.yAxis\n .transition()\n .duration(1000)\n .call(d3.axisLeft(g.yAxisScale));\n }\n\n\n for( i=0; i<mutationTypes.length; i++) {\n if(stacked) {\n color = uc1_colors[i];\n legendText = mutationTypes[i].from+\" > \"+mutationTypes[i].to;\n } else {\n color = uc1_colors[0];\n legendText = \"selection\";\n }\n\n alreadyAdded = uc1_addBars(g, i, filteredArray[i], alreadyAdded, color,normalize,avg);\n\n if( stacked || i<1)\n uc1_addLegendItem(g, i+1, color, legendText);\n }\n\n\n}", "title": "" }, { "docid": "47fdf199567371fc67042d1f2e3c7035", "score": "0.5947579", "text": "updateScale(args) {\n if (args !== null) {\n if (UtilsNew.isNotUndefinedOrNull(args.height)) {\n this.histogramHeight = args.height * 0.95;\n }\n if (UtilsNew.isNotUndefinedOrNull(args.histogramMaxFreqValue)) {\n this.maxValue = args.histogramMaxFreqValue;\n }\n }\n this.multiplier = this.histogramHeight / this.maxValue;\n }", "title": "" }, { "docid": "cf9b1f205ee299fd0bb3291153f02ff5", "score": "0.5942598", "text": "redrawBarsAndFrequencies() {\n this.barData.forEach(({ A: aCount, B: bCount }, i) => {\n this.drawBars(i, aCount, bCount, this.totalFrequencyDataCount)\n })\n\n let totalLightA = this.totalFrequencyData[LightTypes.A]\n let totalLightB = this.totalFrequencyData[LightTypes.B]\n\n this.drawFrequencies(totalLightA, totalLightB)\n }", "title": "" }, { "docid": "316a436c4559fcde13b8e92ca4523258", "score": "0.593366", "text": "function refresh(values){\n var values = d3.range(1000).map(d3.random.normal(20, 5));\n var data = d3.layout.histogram()\n .bins(x.ticks(20))\n (values);\n\n // Reset y domain using new data\n var yMax = d3.max(data, function(d){return d.y});\n var yMin = d3.min(data, function(d){return d.y});\n y.domain([0, yMax]);\n var colorScale = d3.scale.linear()\n .domain([yMin, yMax])\n .range([d3.rgb(color).brighter(), d3.rgb(color).darker()]);\n\n var bar = svg.selectAll(\".bar\").data(data.y);\n\n // Remove object with data\n bar.exit().remove();\n\n bar.transition()\n .duration(1000)\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.x) + \",\" + y(d.y) + \")\"; });\n\n bar.select(\"rect\")\n .transition()\n .duration(1000)\n .attr(\"height\", function(d) { return height - y(d.y); })\n .attr(\"fill\", function(d) { return colorScale(d.y) });\n\n bar.select(\"text\")\n .transition()\n .duration(1000)\n .text(function(d) { return formatCount(d.y); });\n\n}", "title": "" }, { "docid": "f250110854a2aa43fcb90c87a547eaae", "score": "0.5765714", "text": "function refresh(values,ID){\n // var values = d3.range(1000).map(d3.random.normal(20, 5));\n var data = d3.layout.histogram()\n .bins(x.ticks(20))\n (values);\n\n // Reset y domain using new data\n var yMax = d3.max(data, function(d){return d.length});\n var yMin = d3.min(data, function(d){return d.length});\n y.domain([0, yMax]);\n var colorScale = d3.scale.linear()\n .domain([yMin, yMax])\n .range([d3.rgb(color).brighter(), d3.rgb(color).darker()]);\n\n var bar = svg.selectAll(\".bar\").data(data);\n\n // Remove object with data\n bar.exit().remove();\n\n bar.transition()\n .duration(1000)\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.x) + \",\" + y(d.y) + \")\"; });\n\n bar.select(\"rect\")\n .transition()\n .duration(1000)\n .attr(\"height\", function(d) { return height - y(d.y); })\n .attr(\"fill\", function(d) { return colorScale(d.y) });\n\n bar.select(\"text\")\n .transition()\n .duration(1000)\n .text(function(d) { return formatCount(d.y); });\n\n}", "title": "" }, { "docid": "7d5ee8f7985b536f19c1bb7429fc1e36", "score": "0.5759199", "text": "function modifyHistogram(values, noOfBins) {\n document.getElementById(\"histogramContainer\").innerHTML = \"\";\n binWidth = 0;\n\n svg = d3.select(\"#histogramContainer\")\n .append(\"svg\")\n .attr(\"class\", \"svg-bkg\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"90%\")\n\n g = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var tip = d3.select(\"#histogramContainer\")\n .append(\"div\")\n .attr(\"class\", \"tip\")\n .style(\"position\", \"absolute\")\n .style(\"visibility\", \"hidden\")\n .style(\"z-index\", \"20\");\n\n var x = d3.scaleLinear()\n .domain(d3.extent(values))\n .rangeRound([0, width])\n\n var histogram = d3.histogram()\n .domain(x.domain())\n .thresholds(d3.range(x.domain()[0],x.domain()[1],(x.domain()[1]-x.domain()[0])/noOfBins));\n \n var bins = histogram(values);\n \n binWidth = Math.round((bins[0].x1 - bins[0].x0) * 100) / 100\n var y = d3.scaleLinear()\n .domain([0, d3.max(bins, function (d) {\n return d.length;\n })])\n .rangeRound([height, 0]);\n\n //x- axis\n g.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + (height) + \")\")\n .call(d3.axisBottom(x).ticks(noOfBins))\n .selectAll(\"text\")\n .attr(\"x\", \"5\")\n .attr(\"y\", \"15\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"transform\", \"rotate(-40)\");\n\n g.append(\"text\")\n .attr(\"y\", height + 70)\n .attr(\"dx\", width / 2 - margin.left)\n .attr(\"text-anchor\", \"start\")\n .text(whatKind + \" (Bin Width: \" + binWidth + \")\")\n\n //y-axis\n g.append(\"g\")\n .call(d3.axisLeft(y).ticks(10))\n\n g.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"x\", -height / 2)\n .attr(\"y\", -40)\n .attr(\"text-anchor\", \"end\")\n .text(\"Count\")\n \n\n //Transform before\n var bar = g.selectAll(\".bar\")\n .data(bins)\n .enter().append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", function (d) {\n return \"translate(\" + x(d.x0) + \",\" + y(d.length) + \")\";\n }).on(\"mouseover\", function (d) {\n\n // Create tip with HTML\n return tip.html(function () {\n return \"<strong> \" + (Math.round(d.x0 * 100) / 100)+ \" - \" + (Math.round(d.x1 * 100) / 100) + \" </strong> : <span style='color:orange'> \"+ d.length +\" </span>\"; //tip.text(d.value)\n }).style(\"visibility\", \"visible\")\n .style(\"top\", (y(d.length) - 32) + 'px')\n .style(\"left\", (x((d.x0 + d.x1)/2) - 30)+ 'px') //x(d.x0 - ((d.x1 - d.x0) * 0.2))\n })\n .on(\"mouseout\", function () {\n return tip.style(\"visibility\", \"hidden\");\n });\n\n bar.append(\"rect\")\n .attr(\"x\", 1)\n .attr(\"width\", x(bins[0].x1) - x(bins[0].x0)-2)\n .attr(\"height\", function (d) {\n return height - y(d.length);\n });\n\n\n}", "title": "" }, { "docid": "277550f5bb079c40b6263379e13b5c0a", "score": "0.5748143", "text": "function updateShotsOnGoal()\n{\n totalShotsOn = T1.shotsOnGoal + T2.shotsOnGoal;\n\n var t1_bar = Math.floor((T1.shotsOnGoal / totalShotsOn) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-shots-on-num\").innerHTML = \"<b>\" + T1.shotsOnGoal + \"</b>\";\n document.querySelector(\".t2-shots-on-num\").innerHTML = \"<b>\" + T2.shotsOnGoal + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-shots-on-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-shots-on-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "47672beb3919e826a342054cc2d7ca6c", "score": "0.57253015", "text": "function updateShotsOffGoal()\n{\n totalShotsOff = T1.shotsOffGoal + T2.shotsOffGoal;\n\n var t1_bar = Math.floor((T1.shotsOffGoal / totalShotsOff) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-shots-off-num\").innerHTML = \"<b>\" + T1.shotsOffGoal + \"</b>\";\n document.querySelector(\".t2-shots-off-num\").innerHTML = \"<b>\" + T2.shotsOffGoal + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-shots-off-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-shots-off-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "b95e1755145766facd8c37b511a9ce25", "score": "0.5643863", "text": "function updateFoulsReceived()\n{\n totalFoulsRec = T1.foulsOn + T2.foulsOn;\n\n var t1_bar = Math.floor((T1.foulsOn / totalFoulsRec) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-foul-rec-num\").innerHTML = \"<b>\" + T1.foulsOn + \"</b>\";\n document.querySelector(\".t2-foul-rec-num\").innerHTML = \"<b>\" + T2.foulsOn + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-foul-rec-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-foul-rec-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "254f9b26f3fdd1481c15e09d80d2805f", "score": "0.56272787", "text": "update() {\n for ( let i = 0; i < this.barNodes.length; i++ ) {\n this.barNodes[ i ].update();\n }\n }", "title": "" }, { "docid": "9203561590bf64602524ca968a3d8df7", "score": "0.5618085", "text": "function rescale() {\n //reset value for tops\n var tops = new Object();\n for (i = 1983; i < 2019; i++) {\n tops[i] = 0;\n }\n //make non-checked hist rects hidden\n slider_svg.selectAll('.bar')\n .attr(\"visibility\", function(d) {\n if (selected_types.includes(d.type)) {\n tops[d.year] += d.total + 2;\n return \"visible\"; \n } else {\n return \"hidden\";\n }\n })\n\n //get max value for a year\n var max = max_top(tops);\n hist_y.domain([0, max]).range([hist_height, 0]);\n\n bin_y.domain([0, max]).range([0, hist_height]);\n\n slider_svg\n .select('.hist-y-axis')\n .call(d3.axisRight(hist_y))\n .attr(\"transform\",\"translate(\" + (slider_width + slider_margin.left) + \",\" + 160 + \")\");\n \n //reset value for tops\n var tops = new Object();\n for (i = 1983; i < 2019; i++) {\n tops[i] = 0;\n }\n slider_svg.selectAll('.bar')\n .attr('y', function(d) {\n if (selected_types.includes(d.type)) {\n tops[d.year] += d.total;\n return hist_y(tops[d.year]);\n }\n })\n //make height match bin number\n .attr('height', function(d) {\n\n return bin_y(d.total)\n })\n\n \n}", "title": "" }, { "docid": "0606d251e17611cf8e3ffc9b4f9c7b0d", "score": "0.560979", "text": "function updateBarColor(t1_bar, t2_bar, bar1, bar2)\n{\n if(t1_bar > t2_bar)\n {\n bar1.background = green;\n bar2.background = red;\n }\n else if(t1_bar < t2_bar)\n {\n bar1.background = red;\n bar2.background = green;\n }\n else\n {\n bar1.background = bar2.background = yellow;\n }\n}", "title": "" }, { "docid": "47c710fbef85efe0efce88f92fa1a767", "score": "0.56096864", "text": "function updateFoulsCommited()\n{\n totalFoulsComm = T1.foulsBy + T2.foulsBy;\n\n var t1_bar = Math.floor((T1.foulsBy / totalFoulsComm) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-foul-comm-num\").innerHTML = \"<b>\" + T1.foulsBy + \"</b>\";\n document.querySelector(\".t2-foul-comm-num\").innerHTML = \"<b>\" + T2.foulsBy + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-foul-comm-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-foul-comm-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "a7797081b61eee2e45ca40fad77f8836", "score": "0.5593418", "text": "update(){\n this.graphics.clear();\n for(let bar of this.healthBars){\n if(!bar.visible){\n continue;\n }\n bar.updatePos();\n bar.outerWidth = bar.barWidth * (bar.track.health/100);\n this.draw(bar);\n }\n for(let bar of this.progressBars){\n if(bar.track.state === \"closed\"){\n bar.visible = true;\n }\n else{\n bar.visible = false;\n }\n if(bar.visible){\n bar.updatePos();\n bar.outerWidth = bar.barWidth * (bar.track.tapCount/bar.track.maxTap);\n this.draw(bar);\n }\n }\n }", "title": "" }, { "docid": "6c4036224b8d34fd5840c01161b993ab", "score": "0.55891544", "text": "function mouseout(d){\n // call the update function of histogram with all data.\n hGW.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGR.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGC.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n }", "title": "" }, { "docid": "048fb41d775a2a839264b9d95c07ca84", "score": "0.5583216", "text": "function drawHistogram() {\n // thumbIndexAngleCount --> y-axis.\n // the first cell in array contains the name that represents the y-axis.\n // length of array is 37: (180/5)'the number of points' + 1 'the name of array'\n var thumbIndexAngleCount = Array(37).fill(0);\n var distalMedialCount = Array(37).fill(0);\n var proximalMedialCount = Array(37).fill(0);\n thumbIndexAngleCount[0] = 'Fingers';\n distalMedialCount[0] = 'DM';\n proximalMedialCount[0] = 'PM';\n\n \n for(var i = 0; i < thumbIndexAngleArrDis.length; i++) {\n \tthumbIndexAngleCount[Math.ceil(thumbIndexAngleArrDis[i]/5)]++;\n }\n for(var i = 0; i < distalMedialArr.length; i++) {\n \tdistalMedialCount[Math.ceil(distalMedialArr[i]/5)]++;\n }\n for(var i = 0; i < medialProximalArr.length; i++) {\n \tproximalMedialCount[Math.ceil(medialProximalArr[i]/5)]++;\n }\n \n // xAxis array is the angles.\n // the first cell contains the name that represents the x-axis.\n var xAxis = [];\n xAxis.push['Angles'];\n \n // each point in x-axis is the [angle, angle+4] where angle is divisible by 5\n for(var i = 1; i < 180; i+=5) {\n var s = i + ' to ' +(i+4);\n xAxis.push(s);\n }\n\n // removes the angles that was never reached by the patient\n for(var i = 1; i < 37; i++) {\n var condition = (thumbIndexAngleCount[i] == 0) && (distalMedialCount[i] == 0) && (proximalMedialCount[i] == 0);\n \tif(condition) {\n thumbIndexAngleCount.splice(i, 1);\n distalMedialCount.splice(i, 1);\n proximalMedialCount.splice(i, 1);\n \t\txAxis.splice(i, 1);\n \t\ti--;\n \t}\n }\n \n var histoDiv = document.getElementById(\"Histogram\");\n // // draws the graph\n histoDiv.style.height = \"50%\";\n histoDiv.style.width = \"80%\";\n var chart = C3.generate({\n bindto: histoDiv,\n data: {\n columns: [\n thumbIndexAngleCount,\n distalMedialCount,\n proximalMedialCount\n ],\n type: 'bar'\n },\n colors: {\n Fingers: '#ff0000',\n DM: '#00ff00',\n PM: '#0000ff'\n },\n axis: {\n x: {\n type: 'category',\n categories: xAxis,\n label: \"Angles\"\n },\n y: {\n label: \"Count\"\n }\n },\n title: {\n text: 'Fingers (Thumb-Index Angles),DM (Distal-Medial Angles), PM(Proximal-Medial Angles) only accurate frames are considered'\n }\n });\n}", "title": "" }, { "docid": "9693e27519a96a56428f875e8d94cc9d", "score": "0.5571474", "text": "function compareHist(a, b){\n \n if (a.id < b.id)\n return -1;\n if (a.id > b.id)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "5d95280b1faa5d230cb7bf0749148ea6", "score": "0.5542853", "text": "function updateSizes(){\n //get date range\n if (brush.empty()){\n revisedDates = datesProvided; //if brush is empty set the new dates to the original dates\n } else {\n let brushExtent = brush.extent(); //store brush positions\n LOWresult = search4key(+brushExtent[0]);\n HIGHresult = search4key(+brushExtent[1]);\n // console.log(\"Date index: \" + LOWresult + \" to \" + HIGHresult);\n revisedDates = newDates1(LOWresult, HIGHresult);\n //console.log(revisedDates)\n }\n let LOWDate = revisedDates[0];\n let HIGHDate = revisedDates[revisedDates.length-1];\n //console.log(LOWDate);\n //console.log(HIGHDate);\n\n console.log(\"BRUSH DATES:\", LOWDate, HIGHDate)\n \n // Update Pie Chart's True and False Percentages based on Brush's low and high date strings\n // Format [{ label: \"True\", value: trueCount/totalFrequency }, { label: \"False\", value: falseCount/totalFrequency }]\n const trueAndFalsePercentsInDateRange = countDatesBetweenBrushLowAndHighForTrueAndFalse(LOWDate, HIGHDate)\n updatePieSVG(trueAndFalsePercentsInDateRange);\n\n // Update TRUE Small Bar Chart's Top 14 Urls based on Brush's low and high date strings\n let top14URLToURLCountArray_TRUE = getTop14URLToURLCountArray_fromEpochToURLDict_inDateStringRange(LOWDate, HIGHDate, window.TRUE_1_EPOCHS_TO_URLS);\n const TRUE_BARCHART_OPTIONS = {selector:\"#BarC_1\", widthOfBarC:\"16.8vw\", heightOfBarC:\"58vh\", lowColor:\"rgb(245,147,34)\", highColor:\"rgb(245,147,34)\", };\n updateSmallBarChart_JSON(top14URLToURLCountArray_TRUE, TRUE_BARCHART_OPTIONS);\n \n // Update FALSE Small Bar Chart's Top 14 Urls based on Brush's low and high date strings\n let top14URLToURLCountArray_FALSE = getTop14URLToURLCountArray_fromEpochToURLDict_inDateStringRange(LOWDate, HIGHDate, window.FALSE_1_EPOCHS_TO_URLS);\n const FALSE_BARCHART_OPTIONS = {selector:\"#BarC_2\", widthOfBarC:\"16.8vw\", heightOfBarC:\"58vh\", lowColor:\"rgb(8,119,189)\", highColor:\"rgb(8,119,189)\", };\n updateSmallBarChart_JSON(top14URLToURLCountArray_FALSE, FALSE_BARCHART_OPTIONS);\n \n\n d3.selectAll(\".node\").select('circle').transition()\n .style('fill', function(d,i){return reviseNetworkColor(d,LOWDate,HIGHDate,d.legitCount,d.notLegitCount);})\n .attr(\"r\", function(d,i){return reviseCircleSize(d,LOWDate,HIGHDate);});\n}", "title": "" }, { "docid": "b9a6c629038ce32f6e6f62f24ffe54d7", "score": "0.5538447", "text": "function updateBinData(chosenXAxis, binNum, histData){\n binTicks = getBinTicks(chosenXAxis, histData);\n var freqCount = [];\n for (var j=0; j<binNum; j++){\n var count = 0;\n histData[chosenXAxis].forEach(d=>{\n if (d>binTicks[j]){\n if (d<=binTicks[j+1]){\n count = count + 1;\n }\n }\n });\n var c = {'bin': j+1, 'freq': count};\n freqCount.push(c);\n };\n freqCount[0]['freq'] = freqCount[0]['freq']+1 //have to do this to count the min\n return freqCount;\n}", "title": "" }, { "docid": "0e7f3059ef196567784c42ac2d3721e1", "score": "0.5531044", "text": "function updateComparisonPlots() {\n updatePieChart(nationDataLatest, sumValue, freezeLegend, arc, arcFocus, arcAnnotation);\n updateAreaChart();\n updateLineChart();\n }", "title": "" }, { "docid": "14b4016971861e9dfd9af8f41acf24a6", "score": "0.5530679", "text": "function mouseover(d){\n // call the update function of histogram with new data.\n hGW.update(fData.map(function(v){ \n return [v.State,v.freq[d.data.type]];}),segColor(d.data.type));\n hGR.update(fData.map(function(v){ \n return [v.State,v.rate[d.data.type]];}),segColor(d.data.type));\n hGC.update(fData.map(function(v){ \n return [v.State,v.count[d.data.type]];}),segColor(d.data.type));\n }", "title": "" }, { "docid": "ce6df58135f2e57ea2665d8d7ee6e88e", "score": "0.5518131", "text": "function updateBarValues(amount1, amount2, string){\n\t$('#fullProgress').css(\"width\",amount1+'%');\n\t$('#partProgress').css(\"width\",amount2+'%');\n\t$('#barMessage').text(string);\n\t//$('#fullMessage').css(\"color\",'black');\n\t$('#fullMessage').text(\"Overall: \"+Math.round(amount1*10)/10+\"%\");\n}", "title": "" }, { "docid": "eda9ba2b36d68b69240fbd5576ba7f71", "score": "0.5517065", "text": "function update() {\n // check values of user settings\n if (min.value < 0) {\n alert(\"Minimum cannot be smaller than 0!\");\n return;\n }\n if (max.value > 1) {\n alert(\"Maximum cannot be bigger than 1!\");\n return;\n }\n if (min.value > max.value) {\n alert(\"Minimum cannot be bigger than Maximum!\");\n return;\n }\n if (windowSize.value > maxWindow) {\n alert(\"Window size cannot be bigger than the whole window!\");\n return;\n }\n if (stepSize.value > maxWindow) {\n alert(\"Step size cannot be bigger than the whole window!\");\n return;\n }\n\n // remove current visualization\n $(\"svg\").empty();\n [links_to_draw, barlinks_to_draw, fdglinks_to_draw] = calculateCorrelation(parseFloat(current.value) - 1, windowSize.value);\n heatmap(categories, links_to_draw);\n\n rangeslider.step = stepSize.value;\n style.innerHTML = \".myslider::-webkit-slider-thumb { width: \" + 100 * windowSize.value / maxWindow + \"% !important;}\";\n modified = false;\n\n finalResult.length = 0;\n\n parallelcalculation();\n }", "title": "" }, { "docid": "ba526834c5d2bcbba20260208d5072ef", "score": "0.5505829", "text": "function histogramRangeChanged() {\n\n // Read values.\n var min = parseInput('#min');\n var max = parseInput('#max');\n\n // Make sure that the values are valid.\n if (min > max) {\n userRangeSet = false;\n toggleAlert(true, 'El valor máximo debe ser mayor al valor mínimo.');\n } else if (max === min) {\n userRangeSet = false;\n toggleAlert(min !== 0 && max !== 0, 'El valor mínimo no puede ser igual al valor máximo.')\n } else {\n userRangeSet = true;\n userHistMin = min;\n userHistMax = max;\n toggleAlert(false, '');\n }\n\n reset();\n\n }", "title": "" }, { "docid": "1bf22f13d44d451aa1122642b4e9b8f5", "score": "0.5485015", "text": "function updateBlockedShots()\n{\n totalBlock = T1.blockedShots + T2.blockedShots;\n\n var t1_bar = Math.floor((T1.blockedShots / totalBlock) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-block-shot-num\").innerHTML = \"<b>\" + T1.blockedShots + \"</b>\";\n document.querySelector(\".t2-block-shot-num\").innerHTML = \"<b>\" + T2.blockedShots + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-block-shot-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-block-shot-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "fea4cd2ce8164f225d2816b8440dff6f", "score": "0.5476614", "text": "function updateHealthbar() {\n let redPos = redBar.components.position;\n redPos.width = (health - currHealth) / health * redPos.height * 4;\n\n let greenPos = greenBar.components.position;\n greenPos.width = greenPos.height * 4 - redPos.width;\n }", "title": "" }, { "docid": "a6877e0de7c472b6dced116346f5d4ca", "score": "0.547228", "text": "function updateOffsides()\n{\n totalOffsides = T1.offsides + T2.offsides;\n\n var t1_bar = Math.floor((T1.offsides / totalOffsides) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-off-num\").innerHTML = \"<b>\" + T1.offsides + \"</b>\";\n document.querySelector(\".t2-off-num\").innerHTML = \"<b>\" + T2.offsides + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-off-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-off-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "000f6cf7c0765f3b7962ab5df204d100", "score": "0.5465911", "text": "function updateValues ()\n{\n\t//Grab each label of the chart\n\tvar labels = color.domain();\n\t\n\treturn labels.map(function(label,index)\n\t{\n\t\t//Map each label name to an average of the values for this label.\n\t\treturn { \n\t\t\tlabel: label, \n\t\t\tvalue: sums[Object.keys(sums)[index]] / triadCount\n\t\t}\n\t});\n}", "title": "" }, { "docid": "872f648f140587fae76ff06043c7b5ac", "score": "0.54626393", "text": "function second_callback(entries) {\r\n //The callback function will return an array of entries, even if observing only one element\r\n entries.forEach(element => {\r\n //returns true if the element is intersecting with viewport\r\n if (element.isIntersecting) {\r\n //Incresing the width when intersecting\r\n $(`.second-bar`).css({ \"width\": \"8vw\" })\r\n } else {\r\n //Decresing the width when not intersecting\r\n $(`.second-bar`).css({ \"width\": \"2vw\" })\r\n }\r\n });\r\n}", "title": "" }, { "docid": "70aac7681fff048176e6b23ce7c6aa0e", "score": "0.5458908", "text": "function onchange()\r\n{\r\n window.updateHeatmap();\r\n window.updateBar();\r\n window.updateLine();\r\n}", "title": "" }, { "docid": "cf4d18858a84d04c8d132f268deb794f", "score": "0.5443385", "text": "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(data.map(function(v) {\n return [v.Range, v.total];\n }), barColor);\n }", "title": "" }, { "docid": "13613c021b0016480b177e15ae51c55c", "score": "0.54426455", "text": "function histogram(img, x1, y1, x2, y2, num_bins)\n{\n if( num_bins == undefined )\n num_bins = 256;\n\n var h = img.h;\n var w = img.w;\n var hist = [];\n for(var i=0;i<num_bins;i++)\n hist[i] = 0;\n\n for(var y=y1;y<y2;y++)\n {\n for(var x=x1;x<x2;x++)\n {\n var idx = (y * w + x) * 4;\n var val = Math.floor((img.data[idx] / 256.0) * num_bins);\n hist[val]++;\n }\n }\n\n return hist;\n}", "title": "" }, { "docid": "03e8f6b91185b6735fa08f73d6429ccb", "score": "0.5440274", "text": "function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Designation,v.total];}), barColor);\n }", "title": "" }, { "docid": "468a6d1cf03a4b9a1e147cb239a73311", "score": "0.544019", "text": "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(data.map(function(v) {\n return [v.Range, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }", "title": "" }, { "docid": "963a77e953cc9decc6f234d5fb3d4d5c", "score": "0.5437511", "text": "onHistogramChanged(data) {\r\n const newStyle = utils.buildStyle(data);\r\n this.setState({ layerStyle: newStyle, hidelayers: false })\r\n }", "title": "" }, { "docid": "322227e3b6ec1940b6593a8a5e024980", "score": "0.54219824", "text": "UpdateMetrics() {\n }", "title": "" }, { "docid": "944eb7d1c64e6fe8b6f30b4d276c0118", "score": "0.54215795", "text": "function updateSpring() {\n\t\tvar spring18Update = g.selectAll('.s18Histogram').data(spring18Histogram);\n\t\tdraw_Update(spring18Update, '.s18Histogram');\n\t}", "title": "" }, { "docid": "41696e6c3c1499d185a1a9c5fef65150", "score": "0.54165685", "text": "function update(data){\n\t\t//each time an empty array is initialsed\n\t\tvar data_set = [];\n\n\t\t//run through the data object that has been passed into the function\n\t\t//if the entry object is not empty then the data is pushed to the\n\t\t//dataset array\n\t\t//the dataset array is used in the rest of the funciton for the data\n\t \tdata.forEach(function(entry){\n\t \t\tif (jQuery.isEmptyObject( entry ) === false){\n\t \t\t\tdata_set.push(entry);\n\t \t\t}\n\t \t})\n\t\n\t\t//these variables hold the updated scales which have been\n\t\t//passed the new data_set\n\t\tvar xScale = xScales(data_set);\n\t\tvar yScale = yScales(data_set);\n\n\t\tvar chart = svg.selectAll('rect')\n\t\t\t.data(data_set);\n\n\t\tchart.enter()\n\t\t\t.append('rect')\n\t\t\t.attr(\"fill\", function(d){ return color(d.economy)})\n\t\t\t.attr('class', 'bar');\n\n\t\tchart.transition()\n\t\t\t.duration(1000)\n\t\t\t.attr({\n\t\t\tx: function(d){ return xScale(d.economy);},\n\t\t\twidth: xScale.rangeBand(),\n\t\t\ty: function(d){ return yScale(+d[this_value])},\n\t\t\theight: function(d){ return height - yScale(+d[this_value]);},\n\t\t\tfill: function(d){ return color(d.economy)}\n\t\t});\n\n\t\tchart.exit()\n\t\t.transition()\n\t\t.duration(1000)\n\t\t.attr('x', width + xScale.rangeBand())\n\t\t.remove();\n\n\t\t//updates the axis\n\t\tsvg.select(\".x.axis\")\n\t\t.call(xA(data_set))\n\t\t\t .selectAll(\".tick text\")\n \t\t.call(wrap, xScales(data_set).rangeBand()); //the wrap function is called to wrap\n \t\t\t\t\t\t\t\t\t\t\t\t\t//the tick text within the width of the bar\n\n\t\tsvg.select(\".y.axis\")\n\t\t\t.transition()\n\t\t\t.duration(1000)\n\t\t\t.call(yA(data_set));\n\t}", "title": "" }, { "docid": "3812c9e3f61fd9ceda9d2c03250f8c8b", "score": "0.5397858", "text": "function updateThrows()\n{\n totalThrows = T1.throwIns + T2.throwIns;\n\n var t1_bar = Math.floor((T1.throwIns / totalThrows) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-throws-num\").innerHTML = \"<b>\" + T1.throwIns + \"</b>\";\n document.querySelector(\".t2-throws-num\").innerHTML = \"<b>\" + T2.throwIns + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-throws-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-throws-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "889b484f0fcac0d5824a03930969ea4d", "score": "0.53801876", "text": "function plotHist(hisB, hisF) {\n var freqB = [],\n freqF = [],\n levels = [],\n maxB = Math.max.apply(Math, hisB),\n maxF = Math.max.apply(Math, hisF);\n for (var i = 0; i < hisB.length; i++) {\n levels[i] = i + 1;\n freqB[i] = hisB[i] / maxB;\n freqF[i] = hisF[i] / maxF;\n }\n\n var traceB = {\n x: levels,\n y: freqB,\n type: \"lines\",\n };\n var traceF = {\n x: levels,\n y: freqF,\n type: \"lines\",\n line: {\n color: \"orange\",\n }\n };\n var dataB = [traceB],\n dataF = [traceF];\n\n var layoutB = {\n title: \"Ocupación de bosones\",\n xaxis: {\n title: \"Nivel de energía\"\n },\n yaxis: {\n title: \"Frecuencia Bosones\"\n },\n margin: {\n l: 40,\n r: 10,\n t: 40,\n b: 30,\n },\n };\n var layoutF = {\n title: \"Ocupación de fermiones\",\n xaxis: {\n title: \"Nivel de energía\"\n },\n yaxis: {\n title: \"Frecuencia Fermiones\"\n },\n margin: {\n l: 40,\n r: 10,\n t: 40,\n b: 30,\n },\n };\n var config = {\n staticPlot: true,\n responsive: true,\n };\n\n // Plotly.newPlot(\"graph\", data, layout, config);\n Plotly.newPlot(\"graphBos\", dataB, layoutB, config);\n Plotly.newPlot(\"graphFer\", dataF, layoutF, config);\n}", "title": "" }, { "docid": "940e85e7e39f36ca16bdda17ee61de37", "score": "0.53767127", "text": "function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Month,v.total];}), barColor);\n }", "title": "" }, { "docid": "b1f176d456446ec3af4718d67181aa8e", "score": "0.5375281", "text": "function clickit(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){\n return [v.Designation,v.freq[d.data.type]];}),segColor(d.data.type));\n }", "title": "" }, { "docid": "9c153040932178e1ae3f0039626c25e7", "score": "0.5374488", "text": "function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){\n return [v.Month,v.freq[d.data.type]];}),segColor(d.data.type));\n }", "title": "" }, { "docid": "88ffb5bf5f718359225cf0b3bc923c6b", "score": "0.5371682", "text": "function update(data) {\n\n // Update the X axis\n xBar.domain(data.map(function(d) { return d.group; }))\n xAxisBar.call(d3.axisBottom(xBar))\n\n // Update the Y axis\n yBar.domain([0, d3.max(data, function(d) { return d.measure}) ]);\n yAxisBar.transition().duration(1000).call(d3.axisLeft(yBar));\n\n // Create the u variable\n const u = svgChart.selectAll(\"rect\")\n .data(data)\n\n u\n .enter()\n .append(\"rect\") // Add a new rect for each new elements\n .merge(u) // get the already existing elements as well\n .transition() // and apply changes to all of them\n .duration(1000)\n .attr(\"x\", function(d) { return xBar(d.group); })\n .attr(\"y\", function(d) { return yBar(d.measure); })\n .attr(\"width\", x.bandwidth())\n .attr(\"height\", function(d) { return heightB - yBar(d.measure); })\n .attr(\"fill\", \"#69b3a2\")\n\n // If less group in the new dataset, I delete the ones not in use anymore\n u\n .exit()\n .remove()\n\n\n}", "title": "" }, { "docid": "5010e1064fd1766130ae7e995af94ce0", "score": "0.5370604", "text": "function updatePlotly2(newdata) {\n Plotly.restyle(\"bar\", \"x\", [newdata.x]);\n Plotly.restyle(\"bar\", \"y\", [newdata.y]);\n}", "title": "" }, { "docid": "ce679323ebc0b2cd26fc01e108cc363b", "score": "0.5357615", "text": "function updateBarCharts()\n {\n // if some sections do not have computed scores (no selections made), then instead of the default\n // string value, we need to pass empty string '' to the plotservice\n var temporalTmp = vm.temporalScore;\n if(temporalTmp == 'NA')\n temporalTmp = '';\n var modImpactTmp = vm.modImpactScore;\n if(modImpactTmp == 'NA')\n modImpactTmp = '';\n var environTmp = vm.environScore;\n if(environTmp == 'NA')\n environTmp = '';\n vm.callService = PlotService.plotMethods.displayScoresAngular(vm.baseScore, vm.impactScore, vm.exploitScore, temporalTmp, environTmp, modImpactTmp, vm.overallScore);\n }", "title": "" }, { "docid": "296eeef8937952f67f431b3b29bf0367", "score": "0.5351161", "text": "function draw_Update(selection, classStr) {\n\t\tselection.exit().remove();\n\t\tselection.enter()\n\t\t.append('rect')\n\t\t\t.attr(\"class\", classStr.substring(1))\n\t\t\t.attr('x', function(d) {\n\t\t\t\tif(classStr == '.f17Histogram')\n\t\t\t\t\treturn x(d.key);\n\t\t\t\telse\n\t\t\t\t\treturn x(d.key) + x.bandwidth() / 2;\n\t\t\t})\n\t\t\t.attr('width', x.bandwidth() / 2)\n\t\t\t.attr('y', function(d) { return y(d.frequency); })\n\t\t\t.attr('height', function(d) { return height - y(d.frequency); })\n\t\t\t.style('fill', function(d) {\n\t\t\t\tif(classStr == '.f17Histogram')\n\t\t\t\t\treturn 'steelblue';\n\t\t\t\telse\n\t\t\t\t\treturn '#dd1c77';\n\t\t\t})\n\t\t\t.attr('data-toggle', 'tooltip')\n\t\t\t.attr('data-placement', 'top')\n\t\t\t.attr('data-html', 'true')\n\t\t\t.attr('data-original-title', function(d) { return 'Range: ' + d.key + '<br>Frequency: ' + d.frequency; })\n\t\t.merge(selection).transition().duration(500)\n\t\t\t.attr('x', function(d) {\n\t\t\t\tif(classStr == '.f17Histogram')\n\t\t\t\t\treturn x(d.key);\n\t\t\t\telse\n\t\t\t\t\treturn x(d.key) + x.bandwidth() / 2;\n\t\t\t})\n\t\t\t.attr('width', x.bandwidth() / 2)\n\t\t\t.attr('y', function(d) { return y(d.frequency); })\n\t\t\t.attr('height', function(d) { return height - y(d.frequency); })\n\t\t\t.style('fill', function(d) {\n\t\t\t\tif(classStr == '.f17Histogram')\n\t\t\t\t\treturn 'steelblue';\n\t\t\t\telse\n\t\t\t\t\treturn '#dd1c77';\n\t\t\t})\n\t\t\t.attr('data-toggle', 'tooltip')\n\t\t\t.attr('data-placement', 'top')\n\t\t\t.attr('data-html', 'true')\n\t\t\t.attr('data-original-title', function(d) { return 'Range: ' + d.key + '<br>Frequency: ' + d.frequency; });\n\n\t\t$(classStr).tooltip({ 'container': 'body'});\n\t}", "title": "" }, { "docid": "69fed5aa4081eda128a570a470703a2f", "score": "0.53502935", "text": "function updateTotalPasses()\n{\n totalPasses = T1.totalPasses + T2.totalPasses;\n\n var t1_bar = Math.floor((T1.totalPasses / totalPasses) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-pass-tot-num\").innerHTML = \"<b>\" + T1.totalPasses + \"</b>\";\n document.querySelector(\".t2-pass-tot-num\").innerHTML = \"<b>\" + T2.totalPasses + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-pass-tot-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-pass-tot-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "3f0808f0626bda1ecb85a3fa2e58b469", "score": "0.53496885", "text": "function update(data) {\n\n\t\n\n // Update the X axis\n x.domain(data.map(function(d) { return d.key; }))\n xAxis.call(d3.axisBottom(x))\n .attr(\"stroke\",\"white\").attr(\"fill\",\"white\")\n .append(\"text\")\n .attr(\"x\", 2)\n .attr(\"y\", 35)\n .attr(\"dy\", \"0.32em\")\n .attr(\"text-anchor\", \"start\")\n .attr(\"style\",\"font-size:15px;\")\n .text(\"Borrower Property Area\");\n\n \n\n // Update the Y axis\n y.domain([0, d3.max(data, function(d) { return d.value }) ]);\n yAxis.transition().duration(1000).call(d3.axisLeft(y))\n .attr(\"stroke\",\"white\").attr(\"fill\",\"white\")\n \n\n svg.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", -margin.left+130)\n .attr(\"x\", -margin.top -80)\n .attr(\"dy\", \"0.32em\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"style\",\"font-size:15px;\")\n .text(\"Total Loans\");\n\n\n\n // Create the u variable\n var u = svg.selectAll(\"rect\")\n .data(data)\n\n u\n .enter()\n .append(\"rect\") // Add a new rect for each new elements\n .merge(u) // get the already existing elements as well\n .on(\"mouseover\", d => {tooltip.text(\"Total loans\" + \" : \" + (d.value)); return tooltip.style(\"visibility\", \"visible\")})\n .on(\"mousemove\", function(){return tooltip.style(\"top\", (d3.event.pageY-10)+\"px\").style(\"left\",(d3.event.pageX+10)+\"px\");})\n .on(\"mouseout\", () => tooltip.style(\"visibility\", \"hidden\"))\n .transition() // and apply changes to all of them\n .duration(1000)\n .attr(\"x\", function(d) { return x(d.key); })\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"width\", x.bandwidth())\n .attr(\"height\", function(d) { return height - y(d.value); })\n \t.attr(\"fill\", function(d) { return z(d.key); })\n // .attr(\"fill\", \"#69b3a2\")\n\n\n\nvar tooltip = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"position\", \"absolute\")\n .style(\"z-index\", 10)\n .style(\"visibility\", \"hidden\")\n .text(\"Simple text\");\n\n // If less group in the new dataset, I delete the ones not in use anymore\n u\n .exit()\n .remove()\n\n}", "title": "" }, { "docid": "20b781be8c165f24d2ea9eb60760c5b3", "score": "0.5345622", "text": "function uc1_addBars(g, groupId, bins, alreadyAddedMutations, color, normalize, avg) {\n\n // Bars representing the amount of mutations in a bin, independently on the type of mutation\n var selection = g.svg.selectAll(\"rect[rect-type='\"+color+\"']\").data(bins) // update selection\n\n\n // Get the vertical position of each bar, depending on the already stacked bars for a given bin (alreadyAddedMutations)\n yPos = function(bin, i) { \n if(alreadyAddedMutations!=null) {\n return g.yAxisScale(uc1_yVal(bin, normalize, avg)+alreadyAddedMutations[i]);\n } else\n return g.yAxisScale(uc1_yVal(bin, normalize, avg));\n }\n\n selection\n .enter()\n .append(\"rect\") // Add a new rect for each new element\n //.merge(total) // merge the new elements added with enter() with elements already existing in the selection and apply changes to all of them\n //.transition().duration(1) // transition effect lasting 1 seond\n .attr(\"rect-type\", \"group-\"+groupId)\n .attr(\"x\", 1) // starting distance of each element from y-axis (then will be translated...)\n .attr(\"transform\", function(d,i) { return \"translate(\" + g.xAxisScale(d.x0) + \",\" + yPos(d,i) + \")\"; }) // we move each rectangle depending on where the associated bin starts, and \n .attr(\"width\", function(d) { return g.xAxisScale(d.x1) - g.xAxisScale(d.x0) -1 ; }) // width of the rect\n .attr(\"height\", function(d) { return g.height - g.yAxisScale(uc1_yVal(d,normalize,avg)) }) // height of the rect\n\n .style(\"fill\", color)\n\n if(alreadyAddedMutations!=null)\n for(i in alreadyAddedMutations) {\n alreadyAddedMutations[i] += uc1_yVal(bins[i],normalize,avg);\n }\n\n return alreadyAddedMutations;\n\n\n // selection.exit().remove()\n}", "title": "" }, { "docid": "9f624879c9dc8fbc568a4ec68dc56349", "score": "0.5330278", "text": "function updateGKSaves()\n{\n totalSaves = T1.GKSaves + T2.GKSaves;\n\n var t1_bar = Math.floor((T1.GKSaves / totalSaves) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-gk-save-num\").innerHTML = \"<b>\" + T1.GKSaves + \"</b>\";\n document.querySelector(\".t2-gk-save-num\").innerHTML = \"<b>\" + T2.GKSaves + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-gk-save-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-gk-save-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "b2069277c7a9329d25f6cec5a224da78", "score": "0.53214926", "text": "function showHistAll() {\n // ensure the axis to histogram one\n showAxis(xAxisHist);\n\n g.selectAll('.cough')\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n // named transition to ensure\n // color change is not clobbered\n g.selectAll('.hist')\n .transition('color')\n .duration(500)\n .style('fill', '#008080');\n\n g.selectAll('.hist')\n .transition()\n .duration(1200)\n .attr('y', function (d) { return yHistScale(d.length); })\n .attr('height', function (d) { return height - yHistScale(d.length); })\n .style('opacity', 1.0);\n }", "title": "" }, { "docid": "b70216b83a9c38ed2360e8236643fe5d", "score": "0.530867", "text": "function histogram(){\n\n\t$(\"#hist\").hide();\n\t$(\"#bar-chart\").css(\"width\", \"99.5%\");\n\t$(\"#bar-chart\").css(\"height\", \"500px\");\n\n\t// load original image\n\t// ctx.drawImage(myImg, 0, 0);\n\n\t// read img data\n\tvar imgData = ctx.getImageData(0, 0, cvs.width, cvs.height);\n\tvar hist = {\"red\":[], \"green\":[], \"blue\":[]};\n\tvar pr = [], prrk = {\"red\":[], \"green\":[], \"blue\":[]};\n\tfor(var n=0; n <= 255; n++){\n\t\thist.red.push(0); hist.green.push(0); hist.blue.push(0);\n\t\tprrk.red.push(0); prrk.green.push(0); prrk.blue.push(0);\n\t\tpr.push(n/255);\n\t}\n\n\t// hitung nk\n\tfor (var i = 0; i < imgData.data.length; i+=4) {\n\t\tfor(var n=0; n <= 255; n++){\n\t\t\tif(imgData.data[i] == n) hist.red[n]++;\n\t\t\tif(imgData.data[i+1] == n) hist.green[n]++;\n\t\t\tif(imgData.data[i+2] == n) hist.blue[n]++;\n\t\t}\n\n\t}\n\n\t// Pr(rk)\n\tfor(i=0; i<3; i++){\n\t\tfor(var n=0; n <= 255; n++){\n\t\t\tif(i==0) prrk.red[n] = hist.red[n] / (imgData.data.length / 4);\n\t\t\tif(i==1) prrk.green[n] = hist.green[n] / (imgData.data.length / 4);\n\t\t\tif(i==2) prrk.blue[n] = hist.blue[n] / (imgData.data.length / 4);\n\t\t}\n\t}\n\n\t/* Bar Chart starts */\n\n\tvar d1 = [];\n\tfor (i = 0; i <= 255; i += 1)\n\t\td1.push([i, hist.red[i]]);\n\n\tvar d2 = [];\n\tfor (i = 0; i <= 255; i += 1)\n\t\td2.push([i, hist.green[i]]);\n\n\tvar d3 = [];\n\tfor (i = 0; i <= 255; i += 1)\n\t\td3.push([i, hist.blue[i]]);\n\n\tvar stack = 0, bars = true, lines = false, steps = false;\n\n\tfunction plotWithOptions() {\n\t\t$.plot($(\"#bar-chart\"), [ d1, d2, d3 ], {\n\t\t\tseries: {\n\t\t\t\tstack: stack,\n\t\t\t\tlines: { show: lines, fill: true, steps: steps },\n\t\t\t\tbars: { show: bars, barWidth: 0.8 }\n\t\t\t},\n\t\t\tgrid: {\n\t\t\t\tborderWidth: 0, hoverable: true, color: \"#777\"\n\t\t\t},\n\t\t\tcolors: [\"#FF0000\", \"#00FF00\", \"#0000FF\"],\n\t\t\tbars: {\n\t\t\t\t show: true,\n\t\t\t\t lineWidth: 0,\n\t\t\t\t fill: true,\n\t\t\t\t fillColor: { colors: [ { opacity: 0.9 }, { opacity: 0.8 } ] }\n\t\t\t}\n\t\t});\n\t}\n\n\tplotWithOptions();\n\n\t$(\".stackControls input\").click(function (e) {\n\t\te.preventDefault();\n\t\tstack = $(this).val() == \"With stacking\" ? true : null;\n\t\tplotWithOptions();\n\t});\n\t$(\".graphControls input\").click(function (e) {\n\t\te.preventDefault();\n\t\tbars = $(this).val().indexOf(\"Bars\") != -1;\n\t\tlines = $(this).val().indexOf(\"Lines\") != -1;\n\t\tsteps = $(this).val().indexOf(\"steps\") != -1;\n\t\tplotWithOptions();\n\t});\n\n\t/* Bar chart ends */\n\n\t$(\"#hist\").slideDown('400');\n\n}", "title": "" }, { "docid": "bfc0603254bea9d6a52a387594c9ed8b", "score": "0.5308578", "text": "function updateVariables () {\n dataset = filterData();\n numBars = calcNumBars();\n barWidth = ( (chartWidth ) / numBars) - barPadding; \n}", "title": "" }, { "docid": "f5228d600704eb52c602cea6059b2f26", "score": "0.5300849", "text": "function changeOneHisto(newDep){\n\tif(newDep != dep1 & newDep != dep2){\n\t if(lastChanged == dep1){\n\t\t\tdep2 = newDep;\n\t\t\tupDateHisto(\"#histDroite\");\n\t\t\tupDateTexteDroite();\n\t \tlastChanged = dep2;\n\t\t}else{\n\t\t\tdep1 = newDep;\n\t\t\tupDateHisto(\"#histGauche\");\n\t\t\tupDateTexteGauche();\n\t\t\tlastChanged = dep1;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "beb41acb8a1e69f06da1e3db237eff57", "score": "0.52998453", "text": "function checkHistogramDiff(reads, writes, commands) {\n var thisHistogram = getHistogramStats();\n assert.eq(thisHistogram.reads.ops - lastHistogram.reads.ops, reads);\n assert.eq(thisHistogram.writes.ops - lastHistogram.writes.ops, writes);\n // Running the server status itself will increment command stats by one.\n assert.eq(thisHistogram.commands.ops - lastHistogram.commands.ops, commands + 1);\n return thisHistogram;\n}", "title": "" }, { "docid": "d88c1c2443d26063181dfed989d5aae6", "score": "0.52975553", "text": "function process(a, b, evaluator) {\n // Create a histogram of 'a'.\n var hist = Object.create(null), out = [], ukey, k;\n a.forEach(function(value) {\n ukey = uid.call(value);\n if(!hist[ukey]) {\n hist[ukey] = { value: value, freq: 1 };\n }\n });\n // Merge 'b' into the histogram.\n b.forEach(function(value) {\n ukey = uid.call(value);\n if (hist[ukey]) {\n if (hist[ukey].freq === 1) {\n hist[ukey].freq = 3;\n }\n } else {\n hist[ukey] = { value: value, freq: 2 };\n }\n });\n // Call the given evaluator.\n if (evaluator) {\n for (k in hist) {\n if (evaluator(hist[k].freq)) {out.push(hist[k].value);}\n }\n return out;\n } else {\n return hist;\n }\n }", "title": "" }, { "docid": "4cd7dec50c4b90b6bbec5bb4ab382642", "score": "0.529265", "text": "function refreshSlideBar(a, b) {\n var preisRange = urlParameters['preis'].split('-');\n var leftPreis = parseInt(preisRange[0]);\n var rightPreis = parseInt(preisRange[1]);\n $(function () {\n $(a).slider('values' ,[leftPreis, rightPreis]);\n\n $(b).val(\"€\" + $(a).slider(\"values\", 0) +\n \" - €\" + $(a).slider(\"values\", 1));\n\n })\n}", "title": "" }, { "docid": "999abbfdb74085ed270bd73b47f93b9b", "score": "0.5289021", "text": "function render_histo_bars(nBin){\n\n\n d3.select('#ref-line').remove();\n d3.select('#ref-text').remove();\n d3.select('.d3-tip').remove();\n\n var chart = d3.select('svg').select('g');\n keyValueMapper = [];\n for(i=0;i<valuesX.length;i++){\n keyValueMapper[i] = {};\n keyValueMapper[i].key = valuesX[i]; \n keyValueMapper[i].value = valuesY[valuesX[i]];\n }\n\n // Color schema for the bars\n var colorSchema = d3.scaleOrdinal()\n .domain(valuesX)\n .range(d3.schemeSet3);\n\n var rectWidth;\n if(nBin == 1){\n // Width of a bar is maximum X value for nBin = 1\n rectWidth = Math.ceil(parseInt(enhanced_xscale(maximumX)));\n }\n else {\n // Width of a bar is the xScale value for nBin > 1\n rectWidth = Math.ceil(enhanced_xscale(valuesX[1]));\n }\n\n var x_bar_val = {};\n var nextVal = 0;\n for(i=0;i<valuesX.length;i++){\n x_bar_val[valuesX[i]] = nextVal;\n nextVal += rectWidth;\n }\n\n\n // Tip on the bar when hovered upon\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) { \n return \"<span style='color:\"+colorSchema(d.key)+\"'> Range - [\" + d.key + \", \" + (parseInt(d.key) + parseInt(bandwidth)) + \") <br> Frequency - \" + d.value + \"</span>\";\n })\n \n chart.call(tip);\n\n\n // Remove the existing bars\n d3.selectAll(\"rect\").remove();\n\n // Render the bars\n chart.selectAll()\n .data(keyValueMapper)\n .enter()\n .append('rect')\n .attr('x', (s) => enhanced_xscale(s.key)+margin)\n .attr('y', (s) => height)\n .attr('height', 0)\n .attr(\"opacity\", 0.8)\n .attr('width', rectWidth)\n .attr(\"fill\", (s) => colorSchema(s.key))\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .on('mouseenter', function (s, i) {\n d3.select(this).raise();\n\n // Increase width and make it higher\n d3.select(this)\n .transition()\n .duration(200)\n .attr('opacity', 1)\n .attr('x', (s) => enhanced_xscale(s.key) + margin -5)\n .attr('y', (s) => yScale(s.value))\n .attr('width', rectWidth + 10)\n .attr('height', (s) => height - yScale(s.value) + 10)\n .style(\"transform\", \"scale(1,0.979)\"); \n\n // Reference line for y values of rect \n d3.select('svg').select('g')\n .append('line')\n .attr('id','ref-line')\n .attr('x1', 0)\n .attr('y1', yScale(s.value))\n .attr('x2', width)\n .attr('y2', yScale(s.value))\n .attr('transform','translate('+margin+',0)')\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", \"red\");\n\n // Y value for hovered bar on the right\n d3.select('svg').select('g')\n .append('text')\n .attr('id','ref-text')\n .attr('x', width + margin + 5)\n .attr('y', yScale(s.value))\n .style('fill','white')\n .text(s.value);\n \n })\n .on('mouseleave', function (actual, i) {\n\n // Reset the bar width and height\n d3.select(this)\n .attr(\"opacity\", 0.8)\n .transition()\n .duration(200)\n .attr('x', (s) => enhanced_xscale(s.key) + margin)\n .attr('y', (s) => yScale(s.value))\n .attr('width',rectWidth)\n .attr('height', (s) => height - yScale(s.value))\n .style(\"transform\", \"scale(1,1)\");\n\n // Remove ref line\n d3.select('#ref-line').remove();\n d3.select('#ref-text').remove();\n \n })\n\n // Add transition when rendering the bars\n const t = d3.transition()\n .duration(axis_transition_time);\n\n chart.selectAll('rect')\n .transition(t)\n .attr('height', (s) => height - yScale(s.value))\n .attr('y', (s) => yScale(s.value));\n }", "title": "" }, { "docid": "933c3f948dba06eb0a8e21bf43020d5d", "score": "0.5284995", "text": "function updateCompletePasses()\n{\n totalComplPasses = T1.completedPasses + T2.completedPasses;\n\n var t1_bar = Math.floor((T1.completedPasses / totalComplPasses) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-pass-compl-num\").innerHTML = \"<b>\" + T1.completedPasses + \"</b>\";\n document.querySelector(\".t2-pass-compl-num\").innerHTML = \"<b>\" + T2.completedPasses + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-pass-compl-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-pass-compl-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "c9a949348daf9157d5f9c67c93aa4d78", "score": "0.52841496", "text": "function loadVitalHistograms(vital, ranges) {\n\n\tdataset = vitalData[vital.id + \"-\" + ranges.name];\n\tvar formatCount = d3.format(\",.0f\");\n\tvar formatAsPercentage = d3.format(\"1%\");\n\n minData = d3.min(dataset);\n maxData = d3.max(dataset);\n\n var xData = d3.scale.linear()\n .domain([ minData , maxData ])\n .range([ 0, histogramWidth ]);\n\n var x = d3.scale.linear()\n .domain([ 0, maxData - minData ])\n .range([ 0, histogramWidth ]);\n\n xHistScaleFunctions[vital.id + '-' + ranges.name] = x;\n\n data = d3.layout.histogram()\n .bins(xData.ticks(15))\n (dataset);\n\n var y = d3.scale.linear()\n .domain([0, d3.max(data, function(d) { \n return d.y / dataset.length; \n })])\n .range([histogramHeight, 0]);\n\n yScaleFunctions[vital.id + '-' + ranges.name] = y;\n\n var xAxis = d3.svg.axis()\n .scale(xData)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .ticks(4)\n .tickFormat(formatAsPercentage);\n\n var svg = d3.select('.vital-stats.' + vital.id).append(\"svg\")\n .attr(\"width\", histogramWidth + margin.left + margin.right)\n .attr(\"height\", histogramHeight + margin.top + margin.bottom)\n .attr(\"class\", \"histogram \" + ranges.name)\n \t.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var bar = svg.selectAll(\".bar\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", function(d) { \n return \"translate(\" + xData(d.x) + \", 0)\";\n });\n\n bar.append(\"rect\")\n .attr(\"x\", 1)\n .attr(\"y\", histogramHeight)\n .attr(\"width\", x(data[0].dx) - 1)\n .attr(\"height\", 0)\n .attr(\"fill\", function(d) {\n var xBucket = d.x + d.dx;\n var threshold0 = ranges.value[0][0];\n var threshold1 = ranges.value[1][0];\n var threshold2 = ranges.value[2][0];\n if (xBucket <= (threshold0)) {\n return \"#F7A649\";\n } else if(xBucket <= threshold1) {\n return \"#78BB66\";\n } else if(xBucket <= threshold2) {\n return \"#F7A649\";\n } else {\n return \"#ED5A69\";\n }\n });\n\n svg.append(\"g\")\n .attr(\"class\", \"x histogram-axis\")\n .attr(\"transform\", \"translate(0,\" + histogramHeight + \")\")\n .call(xAxis);\n\n svg.append(\"text\")\n .attr(\"class\", \"x histogram-label\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"x\", histogramWidth / 2)\n .attr(\"y\", histogramHeight + 30)\n .text(ranges.name.toUpperCase() + \" \" + vital.name.toUpperCase());\n\n svg.append(\"g\")\n .attr(\"class\", \"y histogram-axis\")\n .call(yAxis);\n\n svg.append(\"text\")\n .attr(\"class\", \"y histogram-label\")\n .attr(\"x\", -histogramHeight + 12)\n .attr(\"y\", -33)\n .text(\"PERCENT OF PEOPLE LIKE YOU\");\n\n addPersonToHistogram(bar, vital.id, ranges.name);\n\n}", "title": "" }, { "docid": "a346d63c47933d7aebbd507f01c1c900", "score": "0.5281012", "text": "function secondPowerChecker(a,b){\n let myHistogram = {};\n // we create a key based on the second array, which is already to the power of 2.\n b.forEach(function (num){\n if (myHistogram[num]){\n myHistogram[num] += 1;\n }else{\n myHistogram[num] = 1;\n }\n })\n // then we compare the frequency each number in the first array, to the power of two.\n a.forEach(function (num){\n if (myHistogram[num ** 2]){\n myHistogram[num ** 2] -= 1;\n }else{\n return false;\n };\n });\n return myHistogram;\n}", "title": "" }, { "docid": "41ad8afb63d115bd280ec4b54409995a", "score": "0.52767146", "text": "function updateIncompletePasses()\n{\n totalIncPasses = T1.incompletePasses + T2.incompletePasses;\n\n var t1_bar = Math.floor((T1.incompletePasses / totalIncPasses) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-pass-inc-num\").innerHTML = \"<b>\" + T1.incompletePasses + \"</b>\";\n document.querySelector(\".t2-pass-inc-num\").innerHTML = \"<b>\" + T2.incompletePasses + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-pass-inc-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-pass-inc-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "dbe845725a6409ec75c2938db9b69f7b", "score": "0.5275207", "text": "function updateDeathPrecentSlider(valA, valB){\n $('.deathPercentage-slider').slider(\"values\", 0, valA)\n $(\".deathPercentage-rate-slider.lower-handle\").text(valA)\n $('.deathPercentage-slider').slider(\"values\", 1, valB)\n $(\".deathPercentage-rate-slider.upper-handle\").text(valB)\n}", "title": "" }, { "docid": "8a360cc9b2f5bc863afad3283e95e58d", "score": "0.5273072", "text": "function update(data, i, j) {\r\n var rect = svg.selectAll('rect').data(data);\r\n\r\n /* Update */\r\n rect.attr(\"y\", function (d) { return y(d); })\r\n .attr(\"height\", function (d) { return height - y(d); })\r\n .attr(\"class\", function (d, index) {\r\n if (index === i) {\r\n return \"selector\";\r\n }\r\n if (index > j) {\r\n return \"done\";\r\n }\r\n return \"bar\";\r\n });\r\n\r\n /* Remove */\r\n rect.exit().remove();\r\n\r\n /* Add */\r\n rect.enter().append(\"rect\")\r\n .attr(\"x\", function (d, i) { return i * barWidth; })\r\n .attr(\"y\", function (d) { return y(d); })\r\n .attr(\"height\", function (d) { return height - y(d); })\r\n .attr(\"width\", barWidth - 1)\r\n .attr(\"class\", \"bar\");\r\n}", "title": "" }, { "docid": "1fb78594dff1cedf027fa934a38060e8", "score": "0.52720886", "text": "function updateAll() {\n\tfilteredData = getFilteredData();\n\tinit_table(filteredData);\n\tupdateMap(filteredData);\n\tdrawBarChart(filteredData);\n}", "title": "" }, { "docid": "f8b10e48cae2af5464f186ed1ecd2697", "score": "0.52663815", "text": "function update() {\n \n // data\n var key = Object.keys(ids).find( key => ids[key] == this.value) ;\n var newId = data.id[key];\n var newValue = data.value[key];\n var newDemo = data.demographics[key];\n \n // bar chart\n Plotly.restyle('bar', 'x', [newValue.slice(0,10).reverse()]);\n Plotly.restyle('bar', 'y', [newId.slice(0,10).reverse().map( i => 'OTU ' + i.toString() )]);\n\n // bubble chart\n Plotly.restyle('bubble', 'x', [newId]);\n Plotly.restyle('bubble', 'y', [newValue]);\n\n // info panel\n d3.selectAll('#sample-metadata text').remove();\n Object.entries(newDemo).forEach( v => {\n d3.select('#sample-metadata')\n .append('text')\n .text(`${v[0]} : ${v[1]}`)\n .append('br');\n });\n\n // gauge\n Plotly.restyle('gauge', 'value', [newDemo.wfreq]);\n Plotly.restyle('gauge', 'title', [{ text: `Scrubs per Week | Participant: ${newDemo.id}` }]);\n\n }", "title": "" }, { "docid": "b73abe7cef1e5e10bbb0abaf7ff45314", "score": "0.5265101", "text": "function plot2HB(attribute1, attribute2, data1, data2) {\n var margin = {\n top: 32,\n right: 100,\n bottom: 20,\n left: 100\n };\n\n var divBarchartLength = document.getElementById(\"barchart\").offsetWidth;\n var labelArea = 100;\n var width = (divBarchartLength - margin.left - labelArea - margin.right) / 2;\n bar_height = 20,\n height = bar_height * data1.length;\n var rightOffset = margin.left + width + labelArea;\n\n var lCol = attribute1;\n var rCol = attribute2;\n var xFrom = d3.scale.linear()\n .range([0, width]);\n var xTo = d3.scale.linear()\n .range([0, width]);\n var y = d3.scale.ordinal()\n .rangeBands([20, height]);\n\n d3.select(\"#barchart\").selectAll('svg').remove();\n var chart = d3.select(\"#barchart\")\n .append('svg')\n .attr('class', 'chart')\n .attr('width', divBarchartLength)\n .attr('height', height + margin.top + margin.bottom);\n\n xFrom.domain([0, d3.max(data1, function (d) {\n return d[lCol];\n })]);\n xTo.domain([0, d3.max(data2, function (d) {\n return d[rCol];\n })]);\n\n y.domain(data1.map(function (d) {\n return d.date;\n }));\n\n var yPosByIndex = function (d) {\n return y(d.date) + margin.top;\n };\n\n function handleBarHover(d, attribute) {\n // Use D3 to select element, change color and size\n //console.log(attribute);\n //console.log(d);\n // TODO: change the color of the bar\n\n updateInfoBoxBar(d, 0, attribute);\n }\n\n function handleBarOut(d, i) {\n // remove info box\n updateInfoBoxBar(d, -1);\n }\n\n chart.selectAll(\"rect.left\")\n .data(data1)\n .enter().append(\"rect\")\n .attr(\"x\", function (d) {\n return margin.left + width - xFrom(d[lCol]);\n })\n .attr(\"y\", yPosByIndex)\n .attr(\"class\", \"left\")\n .attr(\"width\", function (d) {\n return xFrom(d[lCol]);\n })\n .attr(\"height\", y.rangeBand())\n .on(\"mouseover\", function (d) {\n d.game = games[leftSelectedGame]; // !!! game name order inside games matters\n handleBarHover(d, leftAttribute);\n })\n .on(\"mouseout\", handleBarOut);\n\n chart.selectAll(\"text.leftscore\")\n .data(data1)\n .enter().append(\"text\")\n .attr(\"x\", function (d) {\n return margin.left + width - xFrom(d[lCol]) - 40;\n })\n .attr(\"y\", function (d) {\n return y(d.date) + y.rangeBand() / 2 + margin.top;\n })\n .attr(\"dx\", \"20\")\n .attr(\"dy\", \".36em\")\n .attr(\"text-anchor\", \"end\")\n .attr('class', 'leftscore')\n .text(function (d) {\n return d[lCol];\n });\n chart.selectAll(\"text.name\")\n .data(data1)\n .enter().append(\"text\")\n .attr(\"x\", (labelArea / 2) + width + margin.left)\n .attr(\"y\", function (d) {\n return y(d.date) + y.rangeBand() / 2 + margin.top;\n })\n .attr(\"dy\", \".20em\")\n .attr(\"text-anchor\", \"middle\")\n .attr('class', 'name')\n .text(function (d) {\n return d.date;\n });\n\n chart.selectAll(\"rect.right\")\n .data(data2)\n .enter().append(\"rect\")\n .attr(\"x\", rightOffset)\n .attr(\"y\", yPosByIndex)\n .attr(\"class\", \"right\")\n .attr(\"width\", function (d) {\n return xTo(d[rCol]);\n })\n .attr(\"height\", y.rangeBand())\n .on(\"mouseover\", function (d) {\n d.game = games[rightSelectedGame]; // !!! game name order inside games matters\n handleBarHover(d, rightAttribute);\n })\n .on(\"mouseout\", handleBarOut);\n\n chart.selectAll(\"text.score\")\n .data(data2)\n .enter().append(\"text\")\n .attr(\"x\", function (d) {\n return xTo(d[rCol]) + rightOffset + 50;\n })\n .attr(\"y\", function (d) {\n return y(d.date) + y.rangeBand() / 2 + margin.top;\n })\n .attr(\"dx\", -5)\n .attr(\"dy\", \".36em\")\n .attr(\"text-anchor\", \"end\")\n .attr('class', 'score')\n .text(function (d) {\n return d[rCol];\n });\n\n }", "title": "" }, { "docid": "df20255ae77d69fb96f91ab8f6ceef07", "score": "0.5260239", "text": "function updateGoalAttempts()\n{\n totalGoalAttempts = T1.totalShots + T2.totalShots;\n\n var t1_bar = Math.floor((T1.totalShots / totalGoalAttempts) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-goal-att-num\").innerHTML = \"<b>\" + T1.totalShots + \"</b>\";\n document.querySelector(\".t2-goal-att-num\").innerHTML = \"<b>\" + T2.totalShots + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-goal-att-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-goal-att-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "title": "" }, { "docid": "aad7588b7547d6e6bfc3b650af4493dc", "score": "0.5254723", "text": "function update(selected_term_keys) {\n console.log(\"updating...\");\n // get value for y scale\n var yMax = document.getElementById('count_value').value / 100\n // update domain of y scale\n yScale.domain([0, yMax]);\n // remove old y axis\n svg.selectAll(\".y.axis\").remove();\n // add y axis\n svg\n .append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .attr(\"dx\", \".71em\")\n .style(\"text-anchor\", \"beginning\")\n // text label for the y axis\n svg.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 29 - margin.left)\n .attr(\"x\", 0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"20px\")\n .text(\"Percentage of Titles with Term\");\n // get value for x axis domain\n var min_decade = document.getElementById('min_decade').value;\n var max_decade = document.getElementById('max_decade').value;\n // check if min_decade value is between 1500-1800\n if (min_decade > stan_max_decade || min_decade < stan_min_decade) {\n min_decade = stan_min_decade;\n document.getElementById('min_decade_text').innerHTML = \"INVALID: enter decade between 1500 and 1800\";\n }\n // check if max_decade value is between 1500-1800\n if (max_decade > stan_max_decade || max_decade < stan_min_decade) {\n max_decade = stan_max_decade;\n document.getElementById('max_decade_text').innerHTML = \"INVALID: enter decade between 1500 and 1800\";\n }\n // check if max_decade is less than or equal min_decade \n if (max_decade <= min_decade) {\n min_decade = stan_min_decade;\n max_decade = stan_max_decade;\n document.getElementById('max_decade_text').innerHTML = \"INVALID: enter decade greater than min decade\";\n } else {\n document.getElementById('max_decade_text').innerHTML = \"Enter value between 1500 and 1800, greater than min decade\";\n }\n // update x scale domain\n xScale.domain([min_decade, max_decade]);\n // remove old x axis\n svg.selectAll(\".x.axis\").remove();\n // add x axis\n svg\n .append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n // text label for the x axis\n svg.append(\"text\")\n .attr(\"transform\",\n \"translate(\" + (width / 2) + \" ,\" +\n (height + margin.top) + \")\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"20px\")\n .text(\"Decade\");\n // get chosen language\n var select_lang = document.getElementById(\"languages\");\n var chosen_lang = select_lang.options[select_lang.selectedIndex].value;\n // get new data\n var new_data = clean_key_data(selected_term_keys, min_decade, max_decade, chosen_lang);\n // remove old lines\n svg.selectAll(\".line\").remove();\n // add new lines\n var all_lines = svg\n .selectAll(\".line\")\n .data(new_data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"line\");\n all_lines\n .append(\"path\")\n .attr(\"d\", function (d) {\n return line(d.datapoints);\n })\n .style(\"stroke\", function (d) {\n return color(d.term)\n })\n .attr(\"fill\", \"none\");\n }", "title": "" }, { "docid": "08cd9f22b869502d51d225c96c86cf66", "score": "0.5254235", "text": "function updateFall() {\n\t\tvar fall17Update = g.selectAll('.f17Histogram').data(fall17Histogram);\n\t\tdraw_Update(fall17Update, '.f17Histogram');\n\t}", "title": "" }, { "docid": "14a059846eb3e456f5e32d63db35509e", "score": "0.5253577", "text": "componentDidUpdate(prevProps) {\n\n // remove any nulls or NaNs from the data\n \tlet data = this.props.data.filter(value => value != null && !isNaN(value))\n\n // TODO for performance: as a quick hack we're currently just wiping and rebuilding the svg; instead\n // we should have it just update the existing svg elements\n \tthis.svg.remove()\n \tthis.svg = d3.select(`#${this.getDivId()}`).append('svg')\n\n // the following code is modified from the histogram example here: https://bl.ocks.org/mbostock/3048450\n\n\t let margin = {top: 10, right: 0, bottom: 30, left: 0}\n let width = parseFloat(d3.select(`#${this.getDivId()}`).style(\"width\")) - margin.left - margin.right\n let height = parseFloat(d3.select(`#${this.getDivId()}`).style(\"height\")) - margin.top - margin.bottom\n let g = this.svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n\n var x = d3.scaleLinear()\n \t.domain([Math.min(...data), Math.max(...data)])\n .rangeRound([0, width]);\n\n var bins = d3.histogram()\n .domain(x.domain())\n .thresholds(x.ticks(40))\n (data);\n\n var y = d3.scaleLinear()\n .domain([0, d3.max(bins, function(d) { return d.length; })])\n .range([height, 0]);\n\n var bar = g.selectAll(\".bar\")\n .data(bins)\n .enter().append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.x0) + \",\" + y(d.length) + \")\"; });\n\n let rect = bar.append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"width\", d => x(d.x1) - x(d.x0))\n .attr(\"height\", function(d) { return height - y(d.length); });\n if(this.props.colorFunction) {\n \trect.attr(\"fill\", d => this.props.colorFunction(d.x0))\n }\n\n\n g.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x));\n\n (this.props.lines || []).forEach(lineValue => {\n g.append(\"line\")\n .attr(\"x1\", x(lineValue))\n .attr(\"x2\", x(lineValue))\n .attr(\"y1\", 0)\n .attr(\"y2\", height)\n .attr(\"stroke\", \"blue\")\n })\n }", "title": "" }, { "docid": "95131d1115af300f12eed63a6cb306e0", "score": "0.52513164", "text": "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v) {\n return [v.State, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }", "title": "" }, { "docid": "1ae540e0f45b0a2db3df4531dcac689f", "score": "0.5247811", "text": "function drawChartImperv(data) {\n\n //grab the values you need and bin them\n histogramData = d3.layout.histogram()\n .bins(xScale.ticks(10))\n (data.features.map(function (d) {\n return d.properties.Imperv_P}));\n\n window.histogramData = histogramData;\n\n yScale.domain([0, d3.max(histogramData, function(d) { return d.y; })])\n .nice();\n yAxis.scale(yScale);\n yAxis2.call(yAxis);\n\n xAxis2.select(\".xLabel\")\n .text(\"Impervious Percentage\")\n\n bar.remove();\n\n //bind the data once\n bar = svg.selectAll(\".bar\")\n .data(histogramData)\n\n //handle new elements\n bar.enter()\n .append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", function(d) { return \"translate(\" + xScale(d.x) + \",\" + yScale(d.y) + \")\"; });\n\n bar.append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"y\", function (d) { (height - padding) - yScale(d.y);})\n .attr(\"width\", xScale(histogramData[0].dx)/2)\n .attr(\"height\", function (d) { return (height - padding) - yScale(d.y); })\n //color the bars using the color function for the layer\n .style(\"fill\", \"#309195\")\n\n // handle updated elements\n bar.transition()\n .duration(3000)\n .attr(\"transform\", function(d) { return \"translate(\" + xScale(d.x) + \",\" + yScale(d.y) + \")\"; });\n\n // handle removed elements\n bar.exit()\n .remove();\n}", "title": "" }, { "docid": "06c72695f4804fdc94325d9c0b639c5e", "score": "0.5241332", "text": "function update(data) {\n\t\t\tx.domain(data.map((d) => d.name));\n\t\t\ty.domain([0, d3.max(data, (d) => d.height)]);\n\n\t\t\t// Defines the axes\n\t\t\tconst xAxisCall = d3.axisBottom(x);\n\t\t\txAxisGroup\n\t\t\t\t.call(xAxisCall)\n\t\t\t\t.selectAll(\"text\")\n\t\t\t\t.attr(\"y\", \"10\")\n\t\t\t\t.attr(\"x\", \"-5\")\n\t\t\t\t.attr(\"text-anchor\", \"end\")\n\t\t\t\t.attr(\"transform\", \"rotate(-40)\");\n\n\t\t\tconst yAxisCall = d3\n\t\t\t\t.axisLeft(y)\n\t\t\t\t.ticks(3)\n\t\t\t\t.tickFormat((d) => d + \"m\");\n\t\t\tyAxisGroup.call(yAxisCall);\n\n\t\t\t// Generates data visualisation as a bar chart (D3 UPDATE PATTERN)\n\t\t\t// 1. JOIN new data with old elements\n\t\t\tconst bars = g.selectAll(\"rect\").data(data);\n\n\t\t\t// 2. EXIT old elements not present in new data\n\t\t\tbars.exit()\n\t\t\t\t.attr(\"fill\", \"red\")\n\t\t\t\t.transition(d3.transition().duration(500))\n\t\t\t\t.attr(\"height\", 0)\n\t\t\t\t.attr(\"y\", y(0))\n\t\t\t\t.remove();\n\n\t\t\t// 3. UPDATE old elements present in new data\n\t\t\tbars.transition(d3.transition().duration(500))\n\t\t\t\t.attr(\"x\", (d) => x(d.name))\n\t\t\t\t.attr(\"y\", (d) => y(d.height))\n\t\t\t\t.attr(\"width\", x.bandwidth)\n\t\t\t\t.attr(\"height\", (d) => HEIGHT - y(d.height));\n\n\t\t\t// 4. ENTER new elements present in new data\n\t\t\tbars.enter()\n\t\t\t\t.append(\"rect\")\n\t\t\t\t.attr(\"x\", (d) => x(d.name))\n\t\t\t\t.attr(\"height\", (d) => HEIGHT - y(d.height))\n\t\t\t\t.attr(\"width\", x.bandwidth)\n\t\t\t\t.attr(\"fill\", (d) => {\n\t\t\t\t\tif (d.name === \"Burj Khalifa\") {\n\t\t\t\t\t\treturn \"red\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn \"pink\";\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.attr(\"fill-opacity\", 0)\n\t\t\t\t.transition(d3.transition().duration(500))\n\t\t\t\t.attr(\"fill-opacity\", 1)\n\t\t\t\t.attr(\"y\", (d) => y(d.height));\n\t\t}", "title": "" }, { "docid": "f7758f0771c2e26049e966f82b669b1b", "score": "0.5230424", "text": "function update2(data) {\n\n // Update the X axis\n x2.domain(data.map(function(d) { return d.group; }))\n xAxis2.call(d3.axisBottom(x2))\n\n // Update the Y axis\n y2.domain([0, d3.max(data, function(d) { return d.value }) ]);\n yAxis2.transition().duration(1000).call(d3.axisLeft(y2));\n\n // Create the u variable\n var u2 = svg2.selectAll(\"rect\")\n .data(data)\n\n u2\n .enter()\n .append(\"rect\") // Add a new rect for each new elements\n .merge(u2) // get the already existing elements as well\n .transition() // and apply changes to all of them\n .duration(1000)\n .attr(\"x\", function(d) { return x2(d.group); })\n .attr(\"y\", function(d) { return y2(d.value); })\n .attr(\"width\", x2.bandwidth())\n .attr(\"height\", function(d) { return height - y2(d.value); })\n .attr(\"fill\", \"#5F9EA0\")\n\n // If less group in the new dataset, I delete the ones not in use anymore\n u2\n .exit()\n .remove()\n}", "title": "" }, { "docid": "7199834a9ca5853eb245c6cd2c03e124", "score": "0.52229923", "text": "function loadVitalHistograms(vital, ranges) {\n\n\tdataset = vitalData[vital.id + \"-\" + ranges.name];\n\tvar formatCount = d3.format(\",.0f\");\n\tvar formatAsPercentage = d3.format(\"1%\");\n\t//var formatAsThousands = d3.format(\"1000r\")\n\n minData = d3.min(dataset);\n maxData = d3.max(dataset);\n\n var xData = d3.scale.linear()\n .domain([ minData , maxData ])\n .range([ 0, histogramWidth ]);\n\n var x = d3.scale.linear()\n .domain([ 0, maxData - minData ])\n .range([ 0, histogramWidth ]);\n\n xHistScaleFunctions[vital.id + '-' + ranges.name] = x;\n\n data = d3.layout.histogram()\n .bins(xData.ticks(15))\n (dataset);\n\n // var y = d3.scale.linear()\n // .domain([0, d3.max(data, function(d) { \n // return d.y / dataset.length; \n // })])\n // .range([histogramHeight, 0]);\n var y = d3.scale.linear()\n \t\t.domain([0, d3.max(data, function(d) {\n \t\t\treturn d.y;\n \t\t})])\n \t\t.range([histogramHeight, 0]);\n\n yScaleFunctions[vital.id + '-' + ranges.name] = y;\n\n var xAxis = d3.svg.axis()\n .scale(xData)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .ticks(4)\n //.tickFormat(formatAsThousands);\n\n var subVital = '';\n if (ranges.name != \"\") {\n \tsubVital = '.' + ranges.name\n }\n\n var svg = d3.select('.vital-histogram.' + vital.id + subVital).append(\"svg\")\n .attr(\"width\", histogramWidth + margin.left + margin.right)\n .attr(\"height\", histogramHeight + margin.top + margin.bottom)\n .attr(\"class\", \"histogram \" + ranges.name)\n \t.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var bar = svg.selectAll(\".bar\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", function(d) { \n return \"translate(\" + xData(d.x) + \", 0)\";\n });\n\n bar.append(\"rect\")\n .attr(\"x\", 1)\n .attr(\"y\", histogramHeight)\n .attr(\"width\", x(data[0].dx) - 1)\n .attr(\"height\", 0)\n .attr(\"fill\", function(d) {\n var xBucket = d.x + d.dx;\n var threshold0 = ranges.value[0][0];\n var threshold1 = ranges.value[1][0];\n var threshold2 = ranges.value[2][0];\n if (xBucket <= (threshold0)) {\n return \"#F7A649\";\n } else if(xBucket <= threshold1) {\n return \"#78BB66\";\n } else if(xBucket <= threshold2) {\n return \"#F7A649\";\n } else {\n return \"#ED5A69\";\n }\n });\n\n svg.append(\"g\")\n .attr(\"class\", \"x histogram-axis\")\n .attr(\"transform\", \"translate(0,\" + histogramHeight + \")\")\n .call(xAxis);\n\n svg.append(\"text\")\n .attr(\"class\", \"x histogram-label\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"x\", histogramWidth / 2)\n .attr(\"y\", histogramHeight + 35)\n .text(ranges.name.toUpperCase() + \" \" + vital.name.toUpperCase());\n\n svg.append(\"g\")\n .attr(\"class\", \"y histogram-axis\")\n .call(yAxis);\n\n svg.append(\"text\")\n .attr(\"class\", \"y histogram-label\")\n .attr(\"dy\", \".71em\")\n .attr(\"y\", 6)\n\t .style(\"text-anchor\", \"end\")\n .text(\"NUMBER OF PEOPLE LIKE YOU\");\n\n addPersonToHistogram(bar, vital.id, ranges.name);\n\n}", "title": "" }, { "docid": "0ec49e28cc6e3240900493aab775943c", "score": "0.5214291", "text": "function checkHistogramDiff(lastHistogram, thisHistogram, fields) {\n for (let key in fields) {\n if (fields.hasOwnProperty(key)) {\n assert.eq(thisHistogram[key].ops - lastHistogram[key].ops, fields[key]);\n }\n }\n return thisHistogram;\n}", "title": "" }, { "docid": "09f18002ceff94ce54b8b64795116a14", "score": "0.52110296", "text": "async function updateHistogram(widget, fieldName, features, { numberLike } = {}) {\n var {layer, view} = state;\n let values;\n if (features) {\n\n let valueExpression;\n let sqlExpression;\n if (numberLike) {\n // copy features and cast string field to number\n // features = features.map(f => {\n // const clone = f.clone();\n // const value = Number(clone.getAttribute(fieldName));\n // clone.setAttribute(fieldName, value);\n // // clone.sourceLayer = null;\n // return clone;\n // });\n valueExpression = `Number($feature.${fieldName})`;\n sqlExpression = `CAST(${fieldName} AS FLOAT})`;\n }\n\n let params = {\n layer,\n view,\n features,\n field: valueExpression ? null : fieldName,\n valueExpression,\n // field: fieldName,\n // sqlExpression,\n numBins: 30,\n // minValue: widget.min,\n // maxValue: widget.max,\n // values: [widget.values[0], widget.values[1]]\n // values: [widget.min, widget.max]\n // sqlWhere: concatWheres()\n // sqlWhere: where\n };\n try {\n values = await generateHistogram(params);\n if (values.bins) {\n widget.bins = values.bins;\n }\n } catch(e) {\n console.log('e:', e)\n }\n }\n }", "title": "" }, { "docid": "989e3a068cb6d62a3aa6e6992241e1b1", "score": "0.52036643", "text": "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }", "title": "" }, { "docid": "325d325eb84d7f9abaae52e15d35713d", "score": "0.51995397", "text": "function update() {\n var minValue;\n var maxValue;\n var delta;\n\n /* Find all the bars that go in this timeline. We\n * reverse the list so bars are placed bottom-up. */\n scope.barList = _.flatten(_.map(nameList, function (name) {\n return TimelineManager.barList(name);\n }), true).reverse();\n\n /* Find the min start and max end of events in the\n * timeline. */\n minValue = _.min(_.invoke(scope.barList, 'start'));\n maxValue = _.max(_.invoke(scope.barList, 'end'));\n\n /* If the min and max are infinite, it's an indicator\n * that there isn't any data yet. */\n if (minValue === Infinity || maxValue === -Infinity) {\n scope.minLabel = undefined;\n scope.maxLabel = undefined;\n scope.unitWidth = undefined;\n\n scope.labelList = [];\n }\n /* Otherwise, compute the scale for the timeline. */\n else {\n scope.minLabel = Math.floor(minValue);\n scope.maxLabel = Math.ceil(maxValue);\n\n delta = scope.maxLabel - scope.minLabel;\n percent = 100 / delta;\n scope.unitWidth = Math.floor(percent * 1000) / 1000;\n\n scope.labelList = _.range(scope.minLabel, scope.maxLabel + 1);\n }\n }", "title": "" }, { "docid": "7c6fdcd2e34530866d8c60d7c1d06a61", "score": "0.5188687", "text": "function updateDashboard() {\n\n\n d3.csv(\"./data/years.csv\").then(function (full) {\n // TODO: Update the x1 axis domain with the max count of the provided data\n console.log(full);\n let data = full.slice(cur_start_year - 2000, cur_end_year - 2000 + 1);\n console.log(data);\n console.log(cur_start_year - 2000, cur_end_year - 2000 + 1);\n\n // Update the x1 axis domain with the max count of the provided data\n x1.domain([0, d3.max(data, function (d) {\n return parseInt(d.count);\n })]);\n // Update the y1 axis domains with the desired attribute\n y1.domain(data.map(function (d) {\n return d.year\n }));\n color1.domain(data.map(function (d) {\n return d.year\n }));\n\n // Render y1-axis label\n y1_axis_label.call(d3.axisLeft(y1).tickSize(0).tickPadding(10));\n let bars = svg1.selectAll(\"rect\").data(data);\n\n // Render the bar elements on the DOM\n bars.enter()\n .append(\"rect\")\n .merge(bars)\n .transition()\n .duration(1000)\n .attr(\"fill\", function (d) {\n return color1(d.year)\n })\n .attr(\"x\", x1(0))\n .attr(\"y\", function (d) {\n return y1(d.year);\n })\n .attr(\"width\", function (d) {\n return x1(parseInt(d.count));\n })\n .attr(\"height\", y1.bandwidth())\n .attr(\"id\", function (d) {\n return `rect-${d.id}`\n });\n /*\n In lieu of x1-axis labels, display the count of the artist next to its bar on the\n bar plot.\n */\n let counts = countRef.selectAll(\"text\").data(data);\n // Render the text elements on the DOM\n counts.enter()\n .append(\"text\")\n .merge(counts)\n .transition()\n .duration(1000)\n .attr(\"x\", function (d) {\n return x1(parseInt(d.count)) + 10;\n })\n .attr(\"y\", function (d) {\n return y1(d.year) + 10;\n })\n .style(\"text-anchor\", \"start\")\n .text(function (d) {\n return parseInt(d.count);\n });\n // Add y1-axis text and chart title\n y_axis_text.text(\"Year\");\n title1.text(\"Number of football games played each year\");\n // Remove elements not in use if fewer groups in new dataset\n bars.exit().remove();\n counts.exit().remove();\n });\n}", "title": "" }, { "docid": "2d3909925dc89749aa4f56ff45e35cf7", "score": "0.51878273", "text": "function updateCounts() {\n const counts = knnClassifier.getCountByLabel();\n\n document.querySelector(\"#exampleA\").textContent = counts.A || 0;\n document.querySelector(\"#exampleB\").textContent = counts.B || 0;\n}", "title": "" }, { "docid": "738050ae3d9fa091d4101320681b0f21", "score": "0.5178831", "text": "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function (v) {\n return [v.month, v.total];\n }), barColor);\n }", "title": "" }, { "docid": "505e917f55e241eec9a980bd4d470fc2", "score": "0.5178304", "text": "function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v) {\n return [v.State, v.total];\n }), barColor);\n }", "title": "" }, { "docid": "62af91f4c1584998a390fe6cc3dd309c", "score": "0.5170422", "text": "function updateSloshBuckets(aComponent1, aButton1, aComponent2, aButton2) { \n // the user has selected an item from component1, clear out component 2...\n setItemsUnselected(aComponent2);\n \n // activate/deactivate button 1...\n setButtonContext(aComponent1, aButton1); \n \n // activate/deactivate button 2...\n setButtonContext(aComponent2, aButton2); \n}", "title": "" }, { "docid": "2f298282450b4573ac530642e3494596", "score": "0.51646864", "text": "updateChart () {\n const chartIds = ['fixed', 'variable', 'event'];\n const charts = this.state.charts;\n chartIds.forEach(id => {\n const budget = this.state.budgets[id];\n if (budget) {\n const amount = budget.filledPercentage;\n charts[id][0].amount = amount >= 100 ? 100 : amount;\n charts[id][1].amount = amount >= 100 ? 0 : 100 - amount;\n }\n });\n this.setState({ charts });\n }", "title": "" }, { "docid": "4d70c44804671b33f99496cd8290dfba", "score": "0.51546824", "text": "function update() {\n // var data = badgesFromQuery(query);\n if (!query) query = [];\n\n var rows_join = container\n .selectAll(\"div.badge-row\")\n .data(query, function(f){return f.field});\n\n var rows_enter = rows_join\n .enter()\n .append(\"div\")\n .attr(\"class\", \"row badge-row\");\n\n\n rows_enter.append(\"div\").attr(\"class\", \"badge-row-prefix\").text(function(f){return field_name_dictionary[f.field] + \": \"});\n rows_enter\n .append(\"div\").attr(\"class\", \"badge-items-container\")\n .classed(\"order-colored-items\", function(f){return color_fields.indexOf(f.field) >=0 });\n\n rows_join.exit().remove();\n\n var rows_update = rows_enter\n .merge(rows_join);\n\n //\n // Badges for list controls\n //\n var rows_update_list = rows_update\n .filter(function(f) {return f.verb === \"in\"});\n\n var items_join_list = rows_update_list\n .select(\".badge-items-container\")\n .selectAll(\"div.badge-item\")\n .data(function(f){return f.values}, function(d){return d});\n\n items_join_list.exit().remove();\n\n var items_enter_list = items_join_list\n .enter()\n .append(\"div\");\n\n items_enter_list\n .attr(\"class\", \"badge-item list-filter-badge\")\n .text(function(d){\n var filter = d3.select(this.parentNode).datum();\n if (display_value_dictionary[filter.field]) return display_value_dictionary[filter.field][d];\n return d;\n })\n .on(\"click\", function(d) {\n var filter = d3.select(this.parentNode).datum();\n var change = {field: filter.field, value: d};\n dispatcher.call(\"change\", this, change);\n });\n\n //\n //\n //f\n\n //\n // Badges for range controls\n //\n\n var rows_update_range = rows_update\n .filter(function(f) {return f.verb === \"between\"});\n\n rows_update_range.selectAll(\".badge-item\").remove();\n\n var items_join_range = rows_update_range\n .select(\".badge-items-container\")\n .selectAll(\".badge-item\")\n .data(function(f){ return [f.values] });\n\n items_join_range.exit().remove();\n\n var items_enter_range = items_join_range\n .enter()\n .append(\"div\");\n\n items_enter_range\n .attr(\"class\", \"badge-item range-filter-badge\")\n .text(function(d){\n var filter = d3.select(this.parentNode).datum();\n\n return (d.extent.length ? \"від \" + d.extent[0] + \" до \" + d.extent[1] + \", \" : \"\") +\n (d.show_empty ? \"показувати пусті\" : \"сховати пусті\");\n })\n .on(\"click\", function(d) {\n var filter = d3.select(this.parentNode).datum();\n var change = {field: filter.field, value: d};\n dispatcher.call(\"change\", this, change);\n });\n\n return my;\n }", "title": "" }, { "docid": "c22a8867440c87c37b8600977a57b52a", "score": "0.51498324", "text": "function updateData(){\r\n\r\n //generating an arry of 100 random, unique numbers between 1 and 1000\r\n var randomSet = [...new Set(d3.range(100).map(function() {\r\n return Math.round(Math.random()*1000)\r\n }))];\r\n while (randomSet.length < 100) {\r\n var randomSet = [...new Set(randomSet.concat([...new Set(d3.range(100-randomSet.length).map(function() {\r\n return Math.round(Math.random()*1000)\r\n }))]))];\r\n }\r\n\r\n simData = fullData.filter(function(d,i){ return randomSet.indexOf(d.SimNum) >= 0 })\r\n\r\n //add 1-100 rowNum for plot ying axis\r\n var i = 1;\r\n while (i <= 100) {\r\n simData.forEach(function(d) {\r\n d.rowNum = i;\r\n i++;\r\n });\r\n }\r\n\r\n //count wins by trump, count wins by biden\r\n TrumpWins = simData.filter(function(d,i){ return d.SimpleCanidate == \"Trump\"}).length\r\n BidenWins = simData.filter(function(d,i){ return d.SimpleCanidate == \"Biden\"}).length\r\n\r\n //updating left results\r\n d3.selectAll(\"#leftResults\")\r\n .style(\"opacity\",0)\r\n .text(function(d){\r\n return TrumpWins + \" IN 100\"; //new results\r\n })\r\n //delaying \r\n .transition()\r\n .duration(1)\r\n .delay(3200) //waiting until dots are all showing\r\n .style(\"opacity\",1)\r\n\r\n\r\n //updating right results\r\n d3.selectAll(\"#rightResults\")\r\n .style(\"opacity\",0)\r\n .text(function(d){\r\n return BidenWins + \" IN 100\"; //new results\r\n })\r\n //delaying \r\n .transition()\r\n .duration(1)\r\n .delay(3200) //waiting until dots are all showing\r\n .style(\"opacity\",1)\r\n\r\n\r\n //defining scales\r\n var xScale = d3.scaleLinear()\r\n .domain([-150,150]) //input is -100 to 100 \r\n .range([leftMargin,w_dots-rightMargin]) //plot output along whole width of svg\r\n\r\n var yScale = d3.scaleLinear()\r\n .domain([0,100]) //1 to 100 rows\r\n .range([topMargin,h_dots-bottomMargin*3]) \r\n\r\n\r\n //updating dots\r\n d3.selectAll(\"circle\")\r\n .data(simData) \r\n .style(\"opacity\",0)\r\n .transition()\r\n .duration(1)\r\n .attr(\"cx\",function(d){\r\n return xScale(d.WinningMargin);\r\n })\r\n .attr(\"cy\",function(d){\r\n return yScale(d.rowNum);\r\n })\r\n .attr(\"r\",7)\r\n .attr(\"fill\",function(d){\r\n if(d.WinningMargin < 0){\r\n return red;\r\n } else if(d.WinningMargin == 0) {\r\n return \"#B8BABC\"; //gray\r\n } else {\r\n return blue;\r\n }\r\n })\r\n .transition()\r\n .delay(function(d,i){ return i * 30 })\r\n .duration(100)\r\n .style(\"opacity\",1)\r\n\r\n\r\n\r\n } //end of update function", "title": "" }, { "docid": "6b27a06db8fa99fc708541e97954aff4", "score": "0.5148809", "text": "function averageDeviceBookingPeriod() {\n var data = google.visualization.arrayToDataTable(averageDeviceBookingPeriod_arr);\n\n var options = {\n height: 400,\n backgroundColor: \"#f9e7d5\",\n histogram: {bucketSize: 3},\n hAxis: {\n title: gon.averageDeviceBookingPeriod_hAxis_title,\n minValue: 0,\n },\n vAxis: {\n title: gon.averageDeviceBookingPeriod_vAxis_title,\n minValue: 0,\n },\n legend: {position: 'none'},\n };\n var chart = new google.visualization.Histogram(document.getElementById('g-chart-averageDeviceBookingPeriod'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "e6b152d2a58a855998991b89047d90de", "score": "0.5148071", "text": "function changeTwoSidedDataAvailable() {\r\n \r\n // remove the bars\r\n removeBarsTwoSided(\"rect.left\", dataMale);\r\n removeBarsTwoSided(\"rect.right\", dataFemale);\r\n\r\n // remove all text\r\n removeAllTextTwoSided();\r\n svgTwoSided.selectAll(\".graphTitle\").remove();\r\n \r\n // add the bars again\r\n var xLeft = function(d) { return marginT.left + widthTside - xT(d); }\r\n var xRight = marginT.left + widthTside + labelArea;\r\n\r\n addBarsTwoSided(\"rect.left\", dataMale, xLeft, \"left\");\r\n addBarsTwoSided(\"rect.right\", dataFemale, xRight, \"right\");\r\n\r\n // add the titles again\r\n addTitlesTwoSided();\r\n\r\n // add percentages as axis title\r\n addPercentages(\"text.leftscore\", dataMale, 0);\r\n addPercentages(\"text.rightscore\", dataFemale, marginT.left + widthT + marginT.right);\r\n}", "title": "" }, { "docid": "6b11bf64fe89d227dccde518f079659f", "score": "0.5147372", "text": "function _updateBar(sel) {\n sel.each(function(dd) {\n var bar = d3.select(this).selectAll('.bar')\n .data(dd)\n\n // exit\n bar.exit().remove()\n\n // enter\n bar.enter().append('rect').attr('class', 'bar')\n\n // update\n var sumX = 0\n bar\n .attr('x', function(d) {\n var x = sumX\n sumX += scale(d.duration)\n return x\n })\n .attr('y', 0)\n .attr('width', function(d) {\n return scale(d.duration)\n })\n .attr('height', barHeight)\n .style('fill', function(d) {\n return color(d.actionType)\n })\n\n })\n }", "title": "" } ]
7788576afb0e5dd9c39a846a5c78c69d
2. When the children contains constructs that always generated nested Arrays, e.g. , , vfor, or when the children is provided by user with handwritten render functions / JSX. In such cases a full normalization is needed to cater to all possible types of children values.
[ { "docid": "2466694c877d06b9d61c5c2b8cdab869", "score": "0.0", "text": "function normalizeChildren(children) {\n return isPrimitive(children) ? [createTextVNode(children)] :\n Array.isArray(children) ?\n normalizeArrayChildren(children) :\n undefined\n }", "title": "" } ]
[ { "docid": "aec60bfa4c2029b9913b4504c0330f8e", "score": "0.81380504", "text": "function simpleNormalizeChildren(children){for(var i=0;i<children.length;i++){if(Array.isArray(children[i])){return Array.prototype.concat.apply([],children);}}return children;}// 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "aec60bfa4c2029b9913b4504c0330f8e", "score": "0.81380504", "text": "function simpleNormalizeChildren(children){for(var i=0;i<children.length;i++){if(Array.isArray(children[i])){return Array.prototype.concat.apply([],children);}}return children;}// 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "9782d7316774d9c1bcf352cc5aa5ab5a", "score": "0.8134328", "text": "function simpleNormalizeChildren(children){for(var i=0;i<children.length;i++){if(Array.isArray(children[i])){return Array.prototype.concat.apply([],children);}}return children;}// 2. When the children contains constrcuts that always generated nested Arrays,", "title": "" }, { "docid": "e62200e7ee1994ae15e958a0dc7a909c", "score": "0.78624725", "text": "function normalizeChildren(children){return isPrimitive(children)?[createTextVNode(children)]:Array.isArray(children)?normalizeArrayChildren(children):undefined;}", "title": "" }, { "docid": "e62200e7ee1994ae15e958a0dc7a909c", "score": "0.78624725", "text": "function normalizeChildren(children){return isPrimitive(children)?[createTextVNode(children)]:Array.isArray(children)?normalizeArrayChildren(children):undefined;}", "title": "" }, { "docid": "e62200e7ee1994ae15e958a0dc7a909c", "score": "0.78624725", "text": "function normalizeChildren(children){return isPrimitive(children)?[createTextVNode(children)]:Array.isArray(children)?normalizeArrayChildren(children):undefined;}", "title": "" }, { "docid": "3adc2ee748f371500bb94d93e0680a87", "score": "0.78456676", "text": "function simpleNormalizeChildren(children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children);\n }\n }\n\n return children;\n} // 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "3adc2ee748f371500bb94d93e0680a87", "score": "0.78456676", "text": "function simpleNormalizeChildren(children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children);\n }\n }\n\n return children;\n} // 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "3adc2ee748f371500bb94d93e0680a87", "score": "0.78456676", "text": "function simpleNormalizeChildren(children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children);\n }\n }\n\n return children;\n} // 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "3adc2ee748f371500bb94d93e0680a87", "score": "0.78456676", "text": "function simpleNormalizeChildren(children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children);\n }\n }\n\n return children;\n} // 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "3adc2ee748f371500bb94d93e0680a87", "score": "0.78456676", "text": "function simpleNormalizeChildren(children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children);\n }\n }\n\n return children;\n} // 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "ecf770a8698f2cb6c36f9d3d9e72cfd9", "score": "0.7833955", "text": "function simpleNormalizeChildren(children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children);\n }\n }\n\n return children;\n } // 2. When the children contains constructs that always generated nested Arrays,", "title": "" }, { "docid": "90575469dcbe7419948019b8f35ec2ba", "score": "0.78132695", "text": "function normalizeChildren (children) {\n\t return isPrimitive(children)\n\t ? [createTextVNode(children)]\n\t : Array.isArray(children)\n\t ? normalizeArrayChildren(children)\n\t : undefined\n\t}", "title": "" }, { "docid": "90575469dcbe7419948019b8f35ec2ba", "score": "0.78132695", "text": "function normalizeChildren (children) {\n\t return isPrimitive(children)\n\t ? [createTextVNode(children)]\n\t : Array.isArray(children)\n\t ? normalizeArrayChildren(children)\n\t : undefined\n\t}", "title": "" }, { "docid": "90575469dcbe7419948019b8f35ec2ba", "score": "0.78132695", "text": "function normalizeChildren (children) {\n\t return isPrimitive(children)\n\t ? [createTextVNode(children)]\n\t : Array.isArray(children)\n\t ? normalizeArrayChildren(children)\n\t : undefined\n\t}", "title": "" }, { "docid": "90575469dcbe7419948019b8f35ec2ba", "score": "0.78132695", "text": "function normalizeChildren (children) {\n\t return isPrimitive(children)\n\t ? [createTextVNode(children)]\n\t : Array.isArray(children)\n\t ? normalizeArrayChildren(children)\n\t : undefined\n\t}", "title": "" }, { "docid": "90575469dcbe7419948019b8f35ec2ba", "score": "0.78132695", "text": "function normalizeChildren (children) {\n\t return isPrimitive(children)\n\t ? [createTextVNode(children)]\n\t : Array.isArray(children)\n\t ? normalizeArrayChildren(children)\n\t : undefined\n\t}", "title": "" }, { "docid": "90575469dcbe7419948019b8f35ec2ba", "score": "0.78132695", "text": "function normalizeChildren (children) {\n\t return isPrimitive(children)\n\t ? [createTextVNode(children)]\n\t : Array.isArray(children)\n\t ? normalizeArrayChildren(children)\n\t : undefined\n\t}", "title": "" }, { "docid": "08d7722802cca80a4fb1e8e2fa88e07c", "score": "0.77820766", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n }", "title": "" }, { "docid": "b3bf33b42a6510483cc2a22b7b1a9fe3", "score": "0.77763766", "text": "function normalizeChildren (children) {\r\n return isPrimitive(children)\r\n ? [createTextVNode(children)]\r\n : Array.isArray(children)\r\n ? normalizeArrayChildren(children)\r\n : undefined\r\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" }, { "docid": "bcea8d353759dbdedb53749b70c180f6", "score": "0.7762118", "text": "function normalizeChildren (children) {\n return isPrimitive(children)\n ? [createTextVNode(children)]\n : Array.isArray(children)\n ? normalizeArrayChildren(children)\n : undefined\n}", "title": "" } ]
4e940e2fcb09bed4f30d915e870f4786
const fib = require("./fib");
[ { "docid": "5ceb33607b8c0e91c34fef6179958bd0", "score": "0.5381056", "text": "function fib(n) {\n if (n <= 2) {\n return 1;\n } else {\n return fib(n - 1) + fib(n - 2);\n }\n}", "title": "" } ]
[ { "docid": "0c86d9ff22fa83bf002808eaa5a671e2", "score": "0.7439533", "text": "function fib() {\n\n}", "title": "" }, { "docid": "cec6421c7be89f4108293e1d3910fe5b", "score": "0.67125124", "text": "function run() {\n try {\n Fibonacci.main();\n } catch (exception) {\n Logger.logException(exception);\n }\n}", "title": "" }, { "docid": "9e9cdbaeb23a2488c3059bb8fad36a49", "score": "0.63492316", "text": "function fib(n) {\n return fib_iter(1, 0, n);\n}", "title": "" }, { "docid": "11075d59fa59adbf8d857c4073bd23a9", "score": "0.6284142", "text": "function fibonacci(n) {\n // TODO: IMPLEMENT ME!\n return n;\n}", "title": "" }, { "docid": "06296c009858174dc96f61a76f8aa056", "score": "0.6233739", "text": "require() {}", "title": "" }, { "docid": "f3092b77272c5cb4ee69baa93bff55d9", "score": "0.619213", "text": "function fibonacci(numArr){\n\n}", "title": "" }, { "docid": "93ca249f29de06093bbafa241bd3867a", "score": "0.6093143", "text": "function runtime() {\n require(\"./runtime\");\n}", "title": "" }, { "docid": "54d295e664286fbefdd3b5a839809786", "score": "0.5919744", "text": "function module(){\r\n var sample = require(\"./sample\");\r\n sample.fun();\r\n console.log(sample);\r\n}", "title": "" }, { "docid": "6fa6757950235e2ff213bf2ec7fc863e", "score": "0.59080863", "text": "function fibIterative(index) {}", "title": "" }, { "docid": "9971254dd60d1042dd2f1e4821bb8eb5", "score": "0.5875246", "text": "function fib(variables){\n if(typeof(variables) != \"object\") variables = [variables];\n return salfunction(variables, fibelements, fibcache);\n}", "title": "" }, { "docid": "91b420acd2312d514fd48bc5db11605f", "score": "0.5870569", "text": "function fibonaccif() {\n this.first = 0;\n this.second = 1;\n\n function step() {\n let next = this.first + this.second;\n this.first = this.second;\n this.second = next;\n }\n\n return () => {\n let retval = this.first;\n step();\n return retval;\n }\n}", "title": "" }, { "docid": "39698e003eb52a7cb04909f5b0fc4d38", "score": "0.5866932", "text": "function test(n) {\n console.log(fib(n));\n console.log(fibonacci_recursion_fast(n));\n}", "title": "" }, { "docid": "aba4d5167e2abd0244132f1bfd6428fd", "score": "0.58651793", "text": "function fibb(num) {\n if (num === 0) {\n return 0;\n }\n if (num === 1) {\n return 1;\n }\n return fibb(num - 1) + fibb(num - 2);\n}", "title": "" }, { "docid": "5940573f38b373c1c100c9192c11e6fb", "score": "0.57339126", "text": "function fib(n){\n let f0 = 0, f1 = 1 , fn = n;\n for(let i = 1;i < n;i++){\n fn = f0 + f1;\n f0 = f1;\n f1 = fn;\n }\n return fn;\n}", "title": "" }, { "docid": "8659842842a4bc605df3cc6827784907", "score": "0.56962705", "text": "function fib(n) {\n if (n === 0) {\n return 0;\n } else if (n === 1) {\n return 1;\n } else {\n return fib(n - 1) + fib(n - 2)\n }\n}", "title": "" }, { "docid": "287659312601709d2d0bc4de65c1103c", "score": "0.5681676", "text": "function fib(n) {\n\tvar a = 1,\n\tb = 0,\n\ttemp;\n\n\twhile (n >= 0) {\n\t\ttemp = a;\n\t\ta = a + b;\n\t\tb = temp;\n\t\tn--;\n\t}\n\treturn b;\n}", "title": "" }, { "docid": "199ab5c9f6f764e6dc8106c6d0a34a9a", "score": "0.5678613", "text": "function fib(index) {\n if (index === 0) {\n return 0;\n }\n if (index === 1) {\n return 1;\n }\n\n return fib(index-1) + fib(index-2)\n}", "title": "" }, { "docid": "ee3442c8d111d8b2db4f58f2cb443baf", "score": "0.56633615", "text": "function fib(n) {\n if(n === 0) {\n return 0\n }\n let f1 = 0;\n let f2 = 1;\n let numberFib = 1;\n for(let i = 2; i <=n; i++) {\n numberFib = f1 + f2;\n f1 = f2;\n f2 = numberFib;\n }\n return numberFib;\n}", "title": "" }, { "docid": "a0e0d4e48743d22481fd68d0786b1801", "score": "0.56632394", "text": "function fib(num){\n\tif(num <= 2) return 1\nreturn fib(num - 1) + fib(num - 2)\n}", "title": "" }, { "docid": "651d86f31785f1ba7ad30c9c40918321", "score": "0.5656798", "text": "function fibon(x){\n if (x===0 || x===1)\n return 1\n\n return fibon(x-1) + fibon(x-2)\n }", "title": "" }, { "docid": "fe1f23676ea9365501fe7a24c483e79c", "score": "0.5653556", "text": "function require() { }", "title": "" }, { "docid": "ddbf66af086bdc9fb7153473d6543c1b", "score": "0.5634792", "text": "function fib(n){\n if(n === 0) return 0\n if(n === 1) return 1\nreturn fib(n -1 ) + fib(n-2)\n}", "title": "" }, { "docid": "2ca7022c591550e477b3a60ff126cbad", "score": "0.5598352", "text": "function fibonacci(num) {\n // if num is negative\n if (isNaN(num)) {\n throw \"Please enter a NUMBER\"\n }\n if (num < 0) {\n throw \"Please enter a NON-NEGATIVE number\"\n }\n let num1 = 0;\n let num2 = 1;\n if (num == 0) { // fib(0) = 0\n return num1;\n }\n if (num == 1) { // fib(1) = 1\n return num2;\n }\n // fib(>1) = compute\n let result = 0;\n for (i = 0; i < num - 1; i++) {\n result = num1 + num2;\n num1 = num2;\n num2 = result;\n }\n return num2;\n }", "title": "" }, { "docid": "3c581a9366c30d6f9e9cc76ce4595973", "score": "0.55893016", "text": "function calculateFibonacci(order) {\n return new Promise((resolve) => {\n let result = 0;\n let next = 1;\n\n //Return 0 for order 1 (or less to handle invalid input)\n for(let i=2; i<=order; i++) {\n result = result + next;\n next = result - next;\n }\n resolve(result);\n });\n}", "title": "" }, { "docid": "b99f2545d3ce8a0e2c1c8782e8f02add", "score": "0.55750465", "text": "function fibonacci(n) {\n if (isNaN(n) || !isFinite(n))\n return 0.0;\n if (n <= 0)\n return 0;\n if (n > 70)\n return NaN; // will work around this in the future\n // note that for small, Math.pow is less efficient - also, for larger n, you will generate numbers too large to be represented\n // as machine numbers - we have to round due to possible roundoff error in the generating-function computation. This illustrates some of the things\n // you might have to think about in production applications.\n //\n // Alternative to requiring arbitrary-precision floating-point is a good integer algorithm - best I've found is here: https://bosker.wordpress.com/2011/07/27/computing-fibonacci-numbers-using-binet%E2%80%99s-formula/\n return Math.round(exports.sqrt_5_inv * (Math.pow(exports.f_arg1, n)));\n}", "title": "" }, { "docid": "0f80c1b286f22249a29fc9b16ea252d3", "score": "0.557007", "text": "function fib(n) {\n const result = [0, 1];\n for (let i = 2; i <= n; i++) result.push(result[i - 1] + result[i - 2]);\n return result[n];\n}", "title": "" }, { "docid": "0ffb4f5658e017667858e28fee2a8c9a", "score": "0.5564199", "text": "_fib (num) {\n let result = 0\n if (num < 2) {\n result = num\n } else {\n result = this._fib(num - 1) + this._fib(num - 2)\n }\n return result\n }", "title": "" }, { "docid": "85afb07b104ce26e195b9b22975a07c4", "score": "0.55544484", "text": "static fibonacci(n) {\n if (typeof n !== 'number' || n < 1) {\n return [];\n }\n if (n === 1) {\n return [0];\n }\n if (n > 79) {\n console.error('Fibonacci numbers above 79 are too high for normal integers, a bigint implementation is needed');\n return [];\n }\n const sequence = [0, 1];\n for (let i = 2; i < n; i++) {\n sequence.push(sequence[i - 2] + sequence[i - 1]);\n }\n return sequence;\n }", "title": "" }, { "docid": "8d587ff72c35b3517030fbede9577c32", "score": "0.554985", "text": "function fibonnaci(f) {\n var ab = [1, 1];\n while (ab.length < ARGSMAX) {\n ab.push(ab[ab.length - 2] + ab[ab.length - 1]);\n }\n\n while (f.apply(null, ab)) {\n ab.shift();\n ab.push(ab[2] + ab[3]);\n }\n }", "title": "" }, { "docid": "708f254259aad7a47f146f097e7f5c62", "score": "0.55456686", "text": "function fib(num) {\n if (num <= 1) {\n return 1;\n }\n return fib(num - 1) + fib(num - 2);\n}", "title": "" }, { "docid": "708f254259aad7a47f146f097e7f5c62", "score": "0.55456686", "text": "function fib(num) {\n if (num <= 1) {\n return 1;\n }\n return fib(num - 1) + fib(num - 2);\n}", "title": "" }, { "docid": "9930da5320cc62157edf0e8643d4136d", "score": "0.55410665", "text": "function fib(n){\n let arr = [0, 1];\n\n for (let i = 2; i <= n; i++){\n arr.push(arr[i - 2] + arr[i - 1]);\n }\n return arr[n];\n}", "title": "" }, { "docid": "bbe6aa7eb25062161eafe3928a5f89c6", "score": "0.5537586", "text": "function fib(num) {\n if (num <= 2) return 1;\n else return fib(num - 1) + fib(num - 2);\n}", "title": "" }, { "docid": "757df4d9237c8ecb8368d474c81ba9e3", "score": "0.55359477", "text": "function fib(n){\n if(n<=2) return 1;\n let fibNums = [0,1,1];\n for(let i=3; i<=n; i++){\n fibNums[i] = fibNums[i-1] + fibNums[i-2];\n }\n return fibNums[n]\n}", "title": "" }, { "docid": "d345bad9967f3c45f75ed01575db87ba", "score": "0.5522721", "text": "function fib(n) {\r\n if (n === 0) return 0;\r\n if (n === 1) return 1;\r\n \r\n return fib(n - 1) + fib(n - 2);\r\n }", "title": "" }, { "docid": "a2899b24ae42e44bfe4e8ac884849b80", "score": "0.55131364", "text": "function fib(num) {\n let arr = [0, 1];\n for (let i = 2; i < num + 1; i++) {\n arr.push(arr[i - 2] + arr[i - 1]);\n }\n return arr;\n}", "title": "" }, { "docid": "2b9ccf59671c8e4c8571a07b21f58052", "score": "0.5511017", "text": "function fibon(num){\r\n\tif (num<=1){\r\n\t\treturn 1;\r\n\t}\r\n\t{\r\n\t\r\n\t\treturn (fibon(num-1)+fibon(num-2));\r\n\t}\r\n}", "title": "" }, { "docid": "fdb5db9cc6897ed94ee55ae8f051a484", "score": "0.55041254", "text": "function fibonacci(num) {\n // EDGE CASE\n if (num == 0) return 0\n\n // BASE CASE\n if (num == 1){\n zeroIdxVal = 0\n firstIdxVal = 1\n return zeroIdxVal + firstIdxVal\n }\n\n // FORWARD PROGRESS & RECURSIVE CALL\n nextIdxVal = fibonacci(num - 1) + fibonacci(num - 2)\n return nextIdxVal\n}", "title": "" }, { "docid": "b8c01af9afc616acab8309c4e53877da", "score": "0.55035985", "text": "function fib(N) {\n if(N===0){\n return 0;\n } \n \n if(N===1){\n return 1;\n }\n let i=2;\n let a=0;\n let b=1;\n while(i<=N){\n let temp=a+b;\n a=b;\n b=temp;\n i++;\n }\n return b;\n}", "title": "" }, { "docid": "70bebd5cf5749f98bee6a871ad3d20d5", "score": "0.54974735", "text": "function iFibonacci(n) {\n let fib = [0, 1];\n for (let i = 0; i < n; i++) {\n fib.push(fib[0] + fib[1])\n fib.shift();\n }\n return fib[0]\n}", "title": "" }, { "docid": "8b20aeff02af61f1be184f033efd622d", "score": "0.54912114", "text": "function main() {\n\n}", "title": "" }, { "docid": "58560684ef0702997945d06a020f15e9", "score": "0.5482934", "text": "function fib(n) {\n //base case\n if (n <= 0) return 0;\n if (n == 1) return 1;\n return fib(n - 1) + fib(n - 2);\n}", "title": "" }, { "docid": "45317cccda505643f35c482605951591", "score": "0.54823655", "text": "function fibonacci(indice) {\n\n if (indice == 0) {\n return 0;\n } else if (indice == 1) {\n return 1;\n }\n // si no entró en ninguna de las anteriores,\n // sabemos que indice > 1\n return fibonacci(indice - 1) + fibonacci(indice - 2);\n }", "title": "" }, { "docid": "bbceadf7232d653f0e5ab8f56e2eb65c", "score": "0.54802305", "text": "function fib(n){\n // add whatever parameters you deem necessary - good luck!\n if(n===0){\n return 0;\n }\n if(n===1){\n return 1;\n }\n return fib(n-1)+fib(n-2);\n }", "title": "" }, { "docid": "b48e3ee9fb848b422b19852a291f9b78", "score": "0.5477576", "text": "function findFibonacci(n) {\n // create an array to store fibonacci numbers\n const arr = [0, 1]\n // iterate from 2 to n\n for (let i = 2; i < n; i++) {\n arr.push(arr[i - 1] + arr[i - 2]);\n }\n return arr[n - 1]\n}", "title": "" }, { "docid": "f4542d8ab8058201ff0ceddfa7e621fc", "score": "0.5476613", "text": "function fib(n){\n if(n<=2) return 1;\n var fibNums = [0,1,1];\n for(var i =3; i<=n; i++){\n fibNums[i] = fibNums[i-1]+ fibNums[i-2];\n }\n return fibNums[n]\n}", "title": "" }, { "docid": "7d64b3fc679c6e69ab72f3f9608fb8c1", "score": "0.54760885", "text": "function fibonacciMaster() {\n let cache = {};\n // return function - JS closure\n return function fib(n) {\n if (n in cache) {\n return cache[n];\n } else {\n if (n < 2) {\n return n;\n } else {\n cache[n] = fib(n - 1) + fib(n - 2);\n return cache[n];\n }\n }\n };\n}", "title": "" }, { "docid": "9138bb025d615b06399de5b182261d6f", "score": "0.54733425", "text": "function fib(x) {\n if (x == 0) { return 0; }\n if (x == 1) { return 1; }\n return fib(x - 1) + fib(x - 2);\n}", "title": "" }, { "docid": "cbdd2805c40e2150889bc8f8cbc6a86f", "score": "0.5472945", "text": "function fib(x) {\n var fibs = [bigInt(0), bigInt(1)];\n if (x == 0) {\n return fibs[0];\n }\n\n for (var i=2; i <= x; i++) {\n if (i >= fibs.length) {\n var f = fibs.shift().add(fibs[0]);\n fibs.push(f);\n }\n }\n return fibs[1];\n }", "title": "" }, { "docid": "4c9d3aacd2baf4c41b540f7232ae11e8", "score": "0.5471475", "text": "function fibonacci(n, cb) {\n\tif (n < 3) {\n\t\t// return the number in the callback\n\t\t// as resources allow\n\t\tsetImmediate(cb, 1);\n\t\treturn;\n\t}\n\tvar sum = 0;\n\tfunction end(subN) {\n\t\tif (sum !== 0) {\n\t\t\tsetImmediate(cb, sum + subN);\n\t\t} else {\n\t\t\tsum += subN;\n\t\t}\n\t}\n\t// Start calculation of previous two numbers\n\tsetImmediate(fibonacci, n - 1, end);\n\tsetImmediate(fibonacci, n - 2, end);\n}", "title": "" }, { "docid": "3a7d06b57395cc18c8a7178f0050773e", "score": "0.54645723", "text": "function fib(index){\n if(index < 2) return 1;\n return fib(index-1)+fib(index-2); \n}", "title": "" }, { "docid": "34329fa851608245a89c0fb679f533c5", "score": "0.5457981", "text": "function fib(num) {\n if (num <= 2) {\n return 1;\n }\n return fib(num - 1) + fib(num - 2)\n}", "title": "" }, { "docid": "42a31c96899a260f1dc0c37da2f3019b", "score": "0.54541844", "text": "function fib(n){\n if(n <= 2) return 1 \n return fib(n-1) + fib(n-2)\n}", "title": "" }, { "docid": "8a97317f46359d5b977525d3ff6d9a58", "score": "0.5453471", "text": "function fib(n) {\n if (n <= 2){\n return 1\n }\n return fib(n - 1) + fib (n - 2)\n}", "title": "" }, { "docid": "bb0485996be732e87e0b6295da8c58a7", "score": "0.5449272", "text": "function fib(n) {\n\n // Compute the nth Fibonacci number\n if (n < 0) {\n throw new Error('Index is negative, that cant happen!');\n } else if (n === 0 || n === 1) {\n return n;\n }\n\n let prevPrev = 0;\n let prev = 1;\n let current;\n\n for (let i = 1; i < n; i++) {\n current = prevPrev + prev;\n prevPrev = prev;\n prev = current;\n }\n\n return current;\n}", "title": "" }, { "docid": "80523bf550cdc9902326bfcd38cabfe7", "score": "0.54460645", "text": "function fibonacci(num)\n{\n var fib = [0,1];\n for(let i = 2; i <= num; i++ )\n {\n fib.push(fib[i - 1] + fib[i - 2]);\n }\n return fib[num];\n}", "title": "" }, { "docid": "601c032d8cd3835625cd95a813bc548b", "score": "0.5444249", "text": "function fib(){\r\n let x=0; //el contador de iteraciones//\r\n while(x<=10){\r\n x+=1\r\n }\r\n y[0]=0;\r\n y[1]=1;\r\n y[x]=y[x-2] + y[x-1];\r\n console.log(y[i]);\r\n}", "title": "" }, { "docid": "3d6966f718c3e7a505e9eba7b9c1d5eb", "score": "0.54388034", "text": "function fib(n) {\n if (n == 0) {\n return 0;\n }\n if (n == 1) {\n return 1;\n }\n\n return fib(n - 2) + fib(n - 1);\n}", "title": "" }, { "docid": "3883b6304873ffc3b94931a9edc0ccb8", "score": "0.5435332", "text": "function fib(n) {\n if (n === 0 || n === 1) {\n return 1;\n }\n return fib(n - 1) + fib(n - 2);\n}", "title": "" }, { "docid": "56c0c6941ecfcb3edde9ee0a0cc9c32a", "score": "0.5434632", "text": "function fib(n) {\n if (n < 0) {\n throw new Error('Index was negative. No such thing as a negative index in a series.');\n } else if (n === 0 || n === 1) {\n return n;\n }\n let prevPrev = 0;\n let prev = 1; \n let current; \n\n for (let i = 1; i < n; i++) {\n current = prev + prevPrev;\n prevPrev = prev;\n prev = current;\n }\n return current;\n}", "title": "" }, { "docid": "e97eae0b6807f060a4c2b8d3fa140472", "score": "0.5432072", "text": "function fib(n) {\n if (n <= 2) {\n return 1;\n } else {\n return fib(n - 1) + fib(n - 2)\n }\n}", "title": "" }, { "docid": "d29a01cda23842c37c4770f8406288a1", "score": "0.54278916", "text": "function fib(index) {\n if (index < 2) return 1;\n return fib(index - 1) + fib(index - 2);\n}", "title": "" }, { "docid": "d29a01cda23842c37c4770f8406288a1", "score": "0.54278916", "text": "function fib(index) {\n if (index < 2) return 1;\n return fib(index - 1) + fib(index - 2);\n}", "title": "" }, { "docid": "63cafae8a8e639702079e67409b9841c", "score": "0.5413926", "text": "function fib(n) {\n if (n <= 0) return 0;\n if (n <= 2) return 1;\n return fib(n - 1) + fib(n - 2);\n}", "title": "" }, { "docid": "607afe169b6765bf6c5df0f97b1f1532", "score": "0.54053336", "text": "function fib_fifty(x) {\n var i = 1;\n while (i <= 50) {\n\n\n console.log(x);\n i++;\n }\n}", "title": "" }, { "docid": "d1dbdabaf25cda77b0dec2539644ef57", "score": "0.5404695", "text": "function fib(n) {\n let arr = [0, 1];\n for (let i = 2; i < n + 1; i++) {\n arr.push(add(arr[(subtract(i, 2))], arr[(subtract(i, 1))]))\n }\n return arr[add(n, -1)]\n}", "title": "" }, { "docid": "73d40ccaf436c7bc98c270714ed3861c", "score": "0.5401228", "text": "function fibonacci(num) \r\n{\r\n var num1=0; \r\n var num2=1; \r\n var sum; \r\n var i=0; \r\n for (i = 0; i < num; i++) { \r\n \r\n sum=num1+num2; \r\n num1=num2; \r\n num2=sum; \r\n } \r\n return num2; \r\n}", "title": "" }, { "docid": "c161e4a05eca4309b82021bbf96d42b9", "score": "0.5400531", "text": "function fibonacci(num) {\n // -------------------- Your Code Here --------------------\n\n var fib = [];\n for (var i = 0; i < num; i++) {\n if (i <= 1) {\n fib.push(i)\n } else {\n var newFib = fib[i-2] + fib[i-1]\n fib.push(newFib);\n }\n }\n return fib;\n \n // --------------------- End Code Area --------------------\n}", "title": "" }, { "docid": "6ebed3b8d8963985c121e0e91df28b04", "score": "0.53989977", "text": "function fibonacci(numero){\n if(numero < 2){\n return numero;\n }\n return fibonacci(numero - 1) + fibonacci(numero-2);\n}", "title": "" }, { "docid": "fd6b069e4b2ef9b9349be8fc1c20f266", "score": "0.5398833", "text": "function fibonacci(num){\n var a = 1, b = 0, temp;\n\n while (num >= 0){\n temp = a;\n a = a + b;\n b = temp;\n num--;\n }\n\n return b;\n}", "title": "" }, { "docid": "a0d3de3b274f665df40a111ce68395b4", "score": "0.5398792", "text": "function run() {\n require(\"coffee-script\")\n require(\"./main\").run()\n}", "title": "" }, { "docid": "0cbd8b201aa0cfadac96e54c92e47cde", "score": "0.5393574", "text": "function suiteFibonacci(nbr){\n\n let a = 0\n let b = 1\n let resu = 1\n\n for(i=2; i<=nbr; i++){\n resu = a + b;\n a = b;\n b = resu;\n}\n return resu\n\n }", "title": "" }, { "docid": "0e9a4cfd62e213ca24e548137b198d83", "score": "0.53883904", "text": "function fib(n) {\n if (n == 1 || n == 0) {\n return n;\n }\n return fib(n - 1) + fib(n - 2)\n}", "title": "" }, { "docid": "8259736ca80d87034f26577815d51077", "score": "0.5379911", "text": "function fibonacci(num) {\n if(num === 0) {\n return 0;\n }\n if(num === 1) {\n return 1;\n }\n return fibonacci(num - 1) + fibonacci(num - 2);\n }", "title": "" }, { "docid": "346c728b25dab713059925d9ee2f07f0", "score": "0.5379327", "text": "function getFibonacciNumber(index){\n\n if(index === null || index === undefined || index < 0)\n return null;\n\n var previous_first = 0, previous_second = 1, next = 1;\n\n for(var i = 2; i <= index; i++) {\n next = previous_first + previous_second;\n previous_first = previous_second;\n previous_second = next;\n }\n return next;\n}", "title": "" }, { "docid": "5aabfc6177b71c09b073d6af7d9258b7", "score": "0.5371733", "text": "function fib(n) {\n let series = [0,1];\n\n let index = 2;\n\n while(index <= n) {\n const nextNumber = series[index-1] + series[index-2];\n series.push(nextNumber);\n index++;\n }\n\n return series[n];\n}", "title": "" }, { "docid": "bf9a924ddc311e6d539de2ff4abf6d88", "score": "0.5368534", "text": "function fib_btup(n){\n const fn = {};\n fn[1] = fn[2] = 1;\n for (let i = 3; i <= n; i++){\n fn[i] = fn[i-2] + fn[i-1];\n }\n return fn[n];\n}", "title": "" }, { "docid": "e2978b033935dcaacd9502136aa1201a", "score": "0.53636765", "text": "function fib(n) {\n if (n === 1) return 1;\n if (n === 2) return 1;\n return fib(n - 1) + fib(n - 2);\n}", "title": "" }, { "docid": "2143975114a8433292eaeb044d7bb6d5", "score": "0.53624666", "text": "function fib(deg) {\n //2. Establish a base case\n if (deg <= 2) return 1\n //3. Establish answer via recursive calls\n return fib(deg - 1) + fib(deg - 2)\n}", "title": "" }, { "docid": "e1f3a5bbd80697fc020b2b000b23591e", "score": "0.5359553", "text": "function fibonacci(num) {\n if (num <= 1) return 1;\n console.log(num);\n return fibonacci(num - 1) + fibonacci(num - 2);\n}", "title": "" }, { "docid": "20ef7127e306c198df4de118f7a55022", "score": "0.53582543", "text": "function fib(n) {\n if (n <= 2) return 1;\n var fibNums = [0, 1, 1];\n for (var i = 3; i <= n; i++) {\n fibNums[i] = fibNums[i - 1] + fibNums[i - 2];\n }\n return fibNums[n];\n}", "title": "" }, { "docid": "6818fd8871b937e4fb08638beef0625e", "score": "0.5357728", "text": "function fib(n) {\n // add whatever parameters you deem necessary - good luck!\n if (n <= 2) return 1;\n return fib(n - 1) + fib(n - 2);\n}", "title": "" }, { "docid": "7da52ff4ef06b53b1d4c9e58c8a8e7e4", "score": "0.53568417", "text": "function fib(n){\n if (n<=2) return 1;\n return fib(n-1) + fib(n-2);\n}", "title": "" }, { "docid": "cff3fe5f52d8423a47b6807cdaf42cc4", "score": "0.53568125", "text": "function fibonacci(num) {\n var a = 1, b = 0, temp;\n\n while (num >= 0) {\n temp = a;\n a = a + b;\n b = temp;\n num--;\n }\n\n return b;\n}", "title": "" }, { "docid": "5ac1b0835de394ade105f6cf2389cf7a", "score": "0.53521484", "text": "function fibonacci(num) {\n if (num <= 1) return 1; //this is the base case \n return fibonacci(num - 1) + fibonacci(num - 2);\n }", "title": "" }, { "docid": "43097298b9b917c7b37301d7287c0be4", "score": "0.5351751", "text": "function fib(n) {\n if(n <=2) return 1;\n var fibNums [0,1,1];\n for(var i=3; i<=n; i++) {\n fibNums[i] = fibNums[i-1] + fibNums[i-2];\n }\n return fibNums[n];\n}", "title": "" }, { "docid": "03ef2df65d39fb12ce4a7e982af496e1", "score": "0.53482664", "text": "function fib(n) {\n var table = [];\n table.push(1);\n table.push(1);\n for (var i = 2; i < n; ++i) {\n table.push(table[i - 1] + table[i - 2]);\n }\n console.log(\"Fibonacci #%d = %d\", n, table[n - 1]);\n}", "title": "" }, { "docid": "e934a85f84ecda5b49eada9fe40123f3", "score": "0.53478396", "text": "function fib(n) {\n if (n <= 1) return n\n return fib(n - 1) + fib(n - 2)\n}", "title": "" }, { "docid": "ee10d49b68129d04d3ccb2332f3e13c7", "score": "0.53472525", "text": "function fib(n) {\n return mapAccumL(([a, b]) => [\n [b, a + b], b\n ], [0, 1], range(1, n))[0][0];\n }", "title": "" }, { "docid": "1e88e4430b11684fe4d600cc9d88782a", "score": "0.5340855", "text": "function fib(n){\n if (n <= 2) return 1;\n return fib(n-1) + fib(n-2);\n}", "title": "" }, { "docid": "1e88e4430b11684fe4d600cc9d88782a", "score": "0.5340855", "text": "function fib(n){\n if (n <= 2) return 1;\n return fib(n-1) + fib(n-2);\n}", "title": "" }, { "docid": "3e256dd8f0dd1ec8c25850ac09092199", "score": "0.53397083", "text": "function recurFib(n) {\n\n }", "title": "" }, { "docid": "f230731dc009f7de6c6f579bfe950da6", "score": "0.53283167", "text": "function fib(n){\n if(n <= 2) return 1\n return fib(n -1) + fib(n-2)\n}", "title": "" }, { "docid": "0da6f1ec1b2fe451b3ec067e4b719869", "score": "0.532683", "text": "get Bookcase() { return require('./Bookcase.js'); }", "title": "" }, { "docid": "5b979bae6498b03f5e36f89416e2e84c", "score": "0.5322284", "text": "function fibonacciTable(min,max){\n for(let i = min;i <= max;i++){\n console.log(\"fib(\" + i + \") = \"+ fib(i));\n }\n}", "title": "" }, { "docid": "2f00ba3f7c53613847129de5cc593b7b", "score": "0.5316514", "text": "function fib(n){\n if(n <= 2) return 1;\n return fib(n - 1) + fib(n - 2); \n}", "title": "" }, { "docid": "43ecf9c7e65fd8b9238bce7dfbe0df6c", "score": "0.5316022", "text": "function fib (index) {\n if (index < 2) return 1;\n return fib(index -1) + fib(index -2); //this function is very slow (recursively), for testing puposes only\n}", "title": "" }, { "docid": "d3b89f1c838e775c14bf06ec527075ce", "score": "0.5310979", "text": "function fib(n) {\n if (n > 1) {\n return fib(n - 1) + fib(n - 2);\n }\n\n return n;\n}", "title": "" }, { "docid": "91a6b99e059ddfc71890b90d859b51a7", "score": "0.5307015", "text": "function fib(n) {\n if (n < 1) return 0;\n if (n < 3) return 1;\n\n return fib(n - 2) + fib(n - 1);\n}", "title": "" }, { "docid": "c83d0b0c2b6dea4f409984c9065e8eef", "score": "0.5306422", "text": "function fib(n) {\n if(n <= 2){\n return 1;\n } \n return fib(n-1) + fib(n-2);\n}", "title": "" } ]
4d0a322b13c530ff9f8ada212dd1be1c
Callback to process the next function invocation.
[ { "docid": "f691448cb9680ab5c4d6b86df38d44e6", "score": "0.7498776", "text": "function next() {\n\t\tvar j;\n\t\tidx += 1;\n\t\tj = idx;\n\t\t__debug_3712( 'Invocation number: %d', j );\n\t\tfcn.call( opts.thisArg, j, cb );\n\n\t\t/**\n\t\t* Callback invoked once a provided function completes.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further invocations:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tout[ j ] = result;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" } ]
[ { "docid": "f149207e727dd0a31d82b833c37f0781", "score": "0.69589525", "text": "function callnext() {\n\t\t\t// console.log(\"in call next\");\n\t\t\tcallbackBase = 0;\n\t\t\tloop.next();\n\t\t}", "title": "" }, { "docid": "220ef2825d8548cb9dcb8c04ec1c039e", "score": "0.6694561", "text": "function next(){\n\n}", "title": "" }, { "docid": "c54a4ac8ff86851879ce94f541d45813", "score": "0.6675792", "text": "function next() {\n\t\tif (arguments[0]) {\n\t\t\tif (!(arguments[0] instanceof Error)) {\n\t\t\t\targuments[0] = new Error(''+arguments[0]);\n\t\t\t}\n\t\t\t\n\t\t\t// Check if there are no steps left\n\t\t\tif (!steps.length || errorHandler) {\n\t\t\t\tthrow arguments[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Get the next step to execute\n\t\tvar fn = steps.shift();\n\t\tvar args = arguments;\n\t\tif (errorHandler) {\n\t\t\tArray.prototype.splice.call(args, 0, 1);\n\t\t}\n\t\tcounter = 0;\n\t\tresults = [];\n\t\tlock = true;\n\t\t\n\t\tvar result = fn.apply(next, args);\n\t\t// If a synchronous return is used, pass it to the callback\n\t\tif (result !== undefined) {\n\t\t\tnext(undefined, result);\n\t\t}\n\t\tlock = false;\n\t}", "title": "" }, { "docid": "d80ed6373c86ff1b4c9300cd9ebc61cf", "score": "0.6643429", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n next.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "ce17188c2b1e20a618933a77bc2e4e13", "score": "0.66395295", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n next.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "ce17188c2b1e20a618933a77bc2e4e13", "score": "0.66395295", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n next.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "aeb19f0f0716105b839921787a3dc1de", "score": "0.65622175", "text": "function passOn(a) {\n maybeProgress(a, 'onDone');\n a.sequenceIndex += 1;\n // console.log('passOn: sequenceIndex: ', a.sequenceIndex, 'callSequence: ', a.callSequence);\n // pass on the object `a` to the next function in the sequence, if such a function exists\n if ($.isArray(a.callSequence) && (typeof a.sequenceIndex != 'undefined') && (typeof a.callSequence[a.sequenceIndex] != 'undefined') && (typeof a.callSequence[a.sequenceIndex].f == 'function')) {\n maybeProgress(a, 'beforeStart');\n (a.callSequence[a.sequenceIndex].f)(a); // this is the line that executes the next function in the sequence.\n } else {\n console.log('No more to do in sequence, finished.');\n maybeProgress(a, 'sequenceDone');\n }\n }", "title": "" }, { "docid": "c4ad70c14db161a8249749d3fe6828bc", "score": "0.65370864", "text": "next(){ /** todo */ }", "title": "" }, { "docid": "c8bb04e58503b20206ecf49053ca3df7", "score": "0.64594555", "text": "function simulatedNextFunc() {}", "title": "" }, { "docid": "f05d2ed4cb76fb8c982fe8ce2d614384", "score": "0.6438169", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3819( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\t__debug_3819( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "9008046b57ccd462d0004a92277987d9", "score": "0.64358294", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3824( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\t__debug_3824( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "c9a5bb77680c9ee7bc6645b749d430af", "score": "0.6403005", "text": "next() {\n\n }", "title": "" }, { "docid": "bbfe248646bc7d945179fe2145bdc2f7", "score": "0.6402366", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3609( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}", "title": "" }, { "docid": "03d1a269f785a8bdf6218d3192aa5190", "score": "0.63881963", "text": "next(value){if(!this.done&&this.nextFn){this.nextFn(value);this.done=true;this.finish();}}", "title": "" }, { "docid": "924c5602bf7417b3dfaf9fe0d6f60c1c", "score": "0.63650113", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3614( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}", "title": "" }, { "docid": "15c919b17f1ab8a3d7c8e17c9544a8e8", "score": "0.634916", "text": "function next() {\n\t\tvar j;\n\t\tidx -= 1;\n\t\tj = idx;\n\t\t__debug_3696( 'Collection element %d: %s.', j, JSON.stringify( collection[ j ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tcollection[ j ] = result;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "acdd560009323702aad73ec53119b11c", "score": "0.63394326", "text": "function next() {\n\t\tvar j;\n\t\tidx += 1;\n\t\tj = idx;\n\t\t__debug_3691( 'Collection element %d: %s.', j, JSON.stringify( collection[ j ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tcollection[ j ] = result;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "4d35338dbe6534da79d51808a30815b9", "score": "0.63248295", "text": "step_func(func) { func(); }", "title": "" }, { "docid": "66087b5a618bbe968adcb7869f69095a", "score": "0.63067466", "text": "next() {\n\n\t}", "title": "" }, { "docid": "e0d7211bcd4092f6c0851a40f4e3d1ab", "score": "0.6260903", "text": "function runback(arg) {\n it.next(arg)\n }", "title": "" }, { "docid": "db1f093988f6e480eff6cceb1d3f0045", "score": "0.6180542", "text": "next() {\n this.currentLineNumber = this.nextLineNumber;\n if (this.noop) {\n this.noop = false;\n } else {\n eval(this.funcModel.getLine(this.currentLineNumber)[\"impl\"])(this);\n }\n }", "title": "" }, { "docid": "d85dd77431cd5895e143957cb6528945", "score": "0.6172656", "text": "function next(err) {\n\t var fn = fns[++index];\n\t var params = slice$1.call(arguments, 0);\n\t var values = params.slice(1);\n\t var length = input.length;\n\t var pos = -1;\n\n\t if (err) {\n\t done(err);\n\t return\n\t }\n\n\t // Copy non-nully input into values.\n\t while (++pos < length) {\n\t if (values[pos] === null || values[pos] === undefined) {\n\t values[pos] = input[pos];\n\t }\n\t }\n\n\t input = values;\n\n\t // Next or done.\n\t if (fn) {\n\t wrap_1(fn, next).apply(null, input);\n\t } else {\n\t done.apply(null, [null].concat(input));\n\t }\n\t }", "title": "" }, { "docid": "73aa5833f789eb1d8cb61e2b642eea63", "score": "0.61361456", "text": "function fn1(next) { ran.push(1) ; next() }", "title": "" }, { "docid": "73aa5833f789eb1d8cb61e2b642eea63", "score": "0.61361456", "text": "function fn1(next) { ran.push(1) ; next() }", "title": "" }, { "docid": "fc8563eadb7bc9cd13e73b202739cb6f", "score": "0.6135382", "text": "function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }", "title": "" }, { "docid": "effd179b727084e8d645a04ac49603ca", "score": "0.6125193", "text": "callback() {}", "title": "" }, { "docid": "63c85582e61da3584a70525be451a2d9", "score": "0.61235446", "text": "function next(param1) {\n return param1 + 1;\n}", "title": "" }, { "docid": "eaa2c4a9834baace410fa235dd317612", "score": "0.6106637", "text": "function next() {\n if (!q.length) {\n // done with this q\n return nextCb();\n }\n var cmd = p.shift();\n cmd[0](cmd[1], next);\n }", "title": "" }, { "docid": "af709b4f519bcb5ee37ea9e6d99dbd1d", "score": "0.6104626", "text": "step_func_done(func) { func(); }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.6102352", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.6102352", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.6102352", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.6102352", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "5c52b32b289f226de8eb8480406f2482", "score": "0.60852414", "text": "function next() {\n\t\tvar b = new _$Benchmark_340( name, opts, benchmark );\n\t\tb.on( 'result', onResult );\n\t\tb.once( 'end', onEnd );\n\t\tb.run();\n\t}", "title": "" }, { "docid": "60737cba41553999b5760c3d16145f3a", "score": "0.60305446", "text": "function next() {\n console.log( \"next\" );\n if ( index < components.length -1 ) {\n executeComponent( components, index +1, callback );\n }\n\n else {\n callback();\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.6029111", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.6029111", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.6029111", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.6029111", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.6029111", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.6029111", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "521c21a2676ea9609195d73a7ff7de49", "score": "0.60156465", "text": "function next (result) {\n // VVVIP: the list of tasks or functions actually start their execution from here , i.e. from the array\n var currentTask = tasks.shift(); /* next task comes from array of tasks. shift does FIFO */\n if (currentTask) {\n currentTask(result);\n }\n}", "title": "" }, { "docid": "43ebe71998ccf4d53b8ce0034d5a0ce8", "score": "0.5997599", "text": "function next() {\n\t\ti += 1;\n\t\tdebug( 'Processing file %d of %d: %s', i+1, total, files[ i ] );\n\t\treadJSON( files[ i ], onRead );\n\t}", "title": "" }, { "docid": "760ad91ee298f5a0cbf9a14a26e378ea", "score": "0.5918205", "text": "function next() {\n\t\tvar key;\n\t\tidx += 1;\n\t\tkey = keys[ idx ];\n\t\t__debug_3726( '%s: %s', key, JSON.stringify( obj[ key ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], key, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], key, obj, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes transforming a property value.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [value] - transformed value\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, value ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of properties:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\t__debug_3726( 'Transform result => %s: %s', key, JSON.stringify( value ) );\n\t\t\tout[ key ] = value;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "bb50f29921030220319f7d2a8b2d0460", "score": "0.5917294", "text": "function invokeCallback() {\n // Invoke original function.\n callback.apply.apply(callback, leadCall);\n\n leadCall = null;\n\n // Schedule new invocation if there was a call during delay period.\n if (edgeCall) {\n proxy.apply.apply(proxy, edgeCall);\n\n edgeCall = null;\n }\n }", "title": "" }, { "docid": "fb7ec5801a9f88e597e6dba48a2d59a9", "score": "0.5897025", "text": "function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n } // Copy non-nully input into values.\n\n\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values; // Next or done.\n\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }", "title": "" }, { "docid": "3d9bca0b7235ee664905a2ab24358e37", "score": "0.58501506", "text": "function callBack(acc, curr) {\r\n return acc + curr;\r\n}", "title": "" }, { "docid": "e4cdb532b0f858a7fcd44cb452fb6514", "score": "0.5822614", "text": "function runnext(idx, err, data) {\n runningCnt -= 1;\n if( !err ) { \n results[idx] = data; \n } else { \n seqNum = len;\n runningCnt = 0;\n //error=err; \n results.err = idx; \n results[idx] = err; \n }\n //console.log('runningCnt', runningCnt, '; seqNum', seqNum, '; len', len);\n //if( runningCnt === 0 && seqNum === len ) {\n if( !runningCnt ) {\n cb(err, results);\n } \n /* else if( seqNum < len ) {\n runningCnt++;\n fns[seqNum](mybind(seqNum), err, data);\n }\n */\n }", "title": "" }, { "docid": "c51f18a13e9677f583668f2e38df4458", "score": "0.5812434", "text": "function handleOneNext(prevResult) {\n handleOneIter(function() {\n return genObj.next(prevResult);\n });\n }", "title": "" }, { "docid": "70785be830da741d765f5b9a600c3f72", "score": "0.58109176", "text": "function callNext(fl) {\n\tsubfiles[cycle] = [thefiles[cycle].lemain.fileinfo].concat(fl);\n\t//else subfiles[cycle] = fl;\n\tcon.write('\\n\\n>>>>>>>>>>>>>>>finished scanning file #'+cycle+'. The files are: \\n');\n\tcon.write(JSON.stringify(subfiles[cycle].showFilename(),null,'\\t'));\n\tmanifest = manifest.concat(subfiles[cycle]);\n\tif (cycle < mainpages.length-1) {\n\t\tcycle++;\n\t\taddFragment(cycle);\n\t}else{\n\t\tspeakUp('Scanning complete. Checking common files.');\n\t\tbeginVulcanize();\n\t}\n}", "title": "" }, { "docid": "21d3b2a847ec3ac5b12940b867b562d2", "score": "0.5792669", "text": "function ExecuteOneFuncOne(request,reply) {\n\treply.next();\n}", "title": "" }, { "docid": "061c8dc0253051296462c983398eebf3", "score": "0.57820284", "text": "function doNextAction() {\n if (i < listOfCallableActions.length) {\n // Save the current value of i, so we can put the result in the right place\n var actionIndex = i++;\n var nextAction = listOfCallableActions[actionIndex];\n return Promise.resolve(nextAction())\n .then(result => { // Save results to the correct array index.\n resultArray[actionIndex] = result;\n return;\n }).then(doNextAction);\n }\n }", "title": "" }, { "docid": "154eed23c29cf63eb33355eb208f946f", "score": "0.5774212", "text": "function run() {\n var index = -1;\n var input = slice.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done);\n }\n\n next.apply(null, [null].concat(input)); // Run the next `fn`, if any.\n\n function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n } // Copy non-nully input into values.\n\n\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values; // Next or done.\n\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n } // Add `fn` to the list.", "title": "" }, { "docid": "6ee466b0181d37c6644f46ef86028385", "score": "0.5772066", "text": "function next() {\n\t\tvar value;\n\t\tvar key;\n\n\t\tidx += 1;\n\t\tkey = keys[ idx ];\n\n\t\tvalue = obj[ key ];\n\t\t__debug_3719( '%s: %s', key, JSON.stringify( value ) );\n\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, key, cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, key, value, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, key, value, obj, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes transforming a property.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [key] - transformed key\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, key ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of properties:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\t__debug_3719( 'Transform result => %s: %s', key, JSON.stringify( value ) );\n\t\t\tout[ key ] = value;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "12ca254c7cfeeb6455d7cc41b7b00e8c", "score": "0.57543546", "text": "function nextStep ()\n{\n\n}", "title": "" }, { "docid": "c75b2423785fe893e47995e7fe187103", "score": "0.5735569", "text": "function incrementStep (_next)\n{\n\n}", "title": "" }, { "docid": "6ff40de387398269f946b5cc8869d513", "score": "0.57233435", "text": "visit(func) {\n if (!this.visiting) {\n this.visiting = true;\n func(this);\n this.params.forEach(p => p.visit(func));\n if (this.hasPrev()) {\n this.prev.visit(func);\n }\n if (this.hasNext()) {\n this.next.visit(func);\n }\n this.visiting = false;\n }\n }", "title": "" }, { "docid": "7aadd94e31a089937679253229639a97", "score": "0.5718987", "text": "function cb() {// ...\n }", "title": "" }, { "docid": "c675988abcfbf6b0c4d387d3be194854", "score": "0.5709956", "text": "function run() {\n\t var index = -1;\n\t var input = slice$1.call(arguments, 0, -1);\n\t var done = arguments[arguments.length - 1];\n\n\t if (typeof done !== 'function') {\n\t throw new Error('Expected function as last argument, not ' + done)\n\t }\n\n\t next.apply(null, [null].concat(input));\n\n\t // Run the next `fn`, if any.\n\t function next(err) {\n\t var fn = fns[++index];\n\t var params = slice$1.call(arguments, 0);\n\t var values = params.slice(1);\n\t var length = input.length;\n\t var pos = -1;\n\n\t if (err) {\n\t done(err);\n\t return\n\t }\n\n\t // Copy non-nully input into values.\n\t while (++pos < length) {\n\t if (values[pos] === null || values[pos] === undefined) {\n\t values[pos] = input[pos];\n\t }\n\t }\n\n\t input = values;\n\n\t // Next or done.\n\t if (fn) {\n\t wrap_1(fn, next).apply(null, input);\n\t } else {\n\t done.apply(null, [null].concat(input));\n\t }\n\t }\n\t }", "title": "" }, { "docid": "caf59b398bd0509ce80b37420ec7dab8", "score": "0.569219", "text": "function parallelCallback(err, result) {\r\n console.log('received result for function', result);\r\n results.push(result);\r\n\r\n if (results.length === totalFuncs) {\r\n console.timeEnd('Parallel processing')\r\n console.log('Finished processing', results); \r\n }\r\n}", "title": "" }, { "docid": "864f26ce578ef3816a1ea9ebea9dd6db", "score": "0.5683823", "text": "function crazyCallbackExample(a, b, c, d) {\n a()\n b()\n c()\n d()\n}", "title": "" }, { "docid": "c118e1d7577f75da8caf73a637721c49", "score": "0.5680444", "text": "advance() {}", "title": "" }, { "docid": "5140f15baf78413431572f630758230d", "score": "0.5676759", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "5140f15baf78413431572f630758230d", "score": "0.5676759", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "5140f15baf78413431572f630758230d", "score": "0.5676759", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "5140f15baf78413431572f630758230d", "score": "0.5676759", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "7a20c1d860eaad87d163902be1c8336f", "score": "0.56759614", "text": "function nextItem(err, result) {\n var item = gen.next(result);\n\n if (!item.done) {\n // I use the thunk I got from the previous generator yield\n // and pass it the reference to nextItem as a callback to be called\n // from within the method which was thunked\n item.value(nextItem);\n }\n }", "title": "" }, { "docid": "472a489633f74a1cc2c957044204bdf8", "score": "0.5671419", "text": "function run() {\n var index = -1;\n var input = slice.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done);\n }\n\n next.apply(null, [null].concat(input));\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "title": "" }, { "docid": "ff30f026f3554107ec5139f0777f0626", "score": "0.5657169", "text": "function done() {\n\t if (!invoked) {\n\t invoked = true;\n\n\t callback.apply(null, arguments);\n\t }\n\t }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.56456465", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.56456465", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.56456465", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.56456465", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.56456465", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.56456465", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "fd4d965d66dbdc2113c18594af5d1fc6", "score": "0.56370395", "text": "function invoke()\n\t\t{\n\t\t\tvar lastReturn = undefined;\n\t\t\tvar invokeArgs = arguments;\n\t\t\tlink(invokeList).each(function(v) {\n\t\t\t\tlastReturn = v.handler.apply(v.thisObj, invokeArgs);\n\t\t\t});\n\n\t\t\t// mirror return value of the last handler called\n\t\t\treturn lastReturn;\n\t\t}", "title": "" }, { "docid": "aaaa6a686ef361bb174b5058f20fa344", "score": "0.5632174", "text": "function iterator (fn, next) {\n var compile = 'function' === typeof fn.compile ? fn.compile : fn;\n log.strat('[' + (fn.name || 'custom') + '](magenta)');\n compile.call(fn, source, log, function (err, src) {\n if (err) return next(err);\n source = src;\n next();\n });\n }", "title": "" }, { "docid": "aacdf6fce1d59c1486a3c592222263a2", "score": "0.56201", "text": "function exec(iter, handler) {\n let state = iter.next();\n while (!state.done) {\n let eff = state.value;\n if (eff instanceof Return) {\n return eff.value;\n }\n let selector = 'handle' + eff._kindName;\n let result = handler[selector](eff);\n state = iter.next(result);\n }\n}", "title": "" }, { "docid": "874570b923d04b14a996ac5228ebcbfd", "score": "0.5604255", "text": "function done() {\n\t\t\tvar f = queue.shift();\n\t\t\tif (queue.length > 0) {\n\t\t\t\tqueue[0]();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "0ea9d35f52800761883f84b06e1184bd", "score": "0.5602423", "text": "function _next() {\n\t\t\t\t\t\t\tlet filename = filenames.shift();\n\n\t\t\t\t\t\t\tswitch ( filename ) {\n\t\t\t\t\t\t\t\tcase \".\" :\n\t\t\t\t\t\t\t\tcase \"..\" :\n\t\t\t\t\t\t\t\t\tprocess.nextTick( filenames.length ? _next : done );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t\t\t_collectJobsInFolder( Path.join( src, filename ), Path.join( relPath, filename ), jobs, ( filenames.length ? _next : done ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "title": "" }, { "docid": "c7990697ef8964d1927683bcd2c5b0fc", "score": "0.55882317", "text": "function LOOPCALL(state) {\n var stack = state.stack;\n var fn = stack.pop();\n var c = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'LOOPCALL[]', fn, c);\n }\n\n // saves callers program\n var cip = state.ip;\n var cprog = state.prog;\n\n state.prog = state.funcs[fn];\n\n // executes the function\n for (var i = 0; i < c; i++) {\n exec(state);\n\n if (exports.DEBUG) {\n console.log(\n ++state.step,\n i + 1 < c ? 'next loopcall' : 'done loopcall',\n i\n );\n }\n }\n\n // restores the callers program\n state.ip = cip;\n state.prog = cprog;\n }", "title": "" }, { "docid": "2a9c330a7571867621146c3fe31eaa18", "score": "0.5579796", "text": "callback(error, result, next) {\n\t\tthis.completedRequests += 1;\n\t\tif (this.options.maxRequests) {\n\t\t\tif (this.completedRequests == this.options.maxRequests) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\tif (this.requests > this.options.maxRequests) {\n\t\t\t\tlog.debug('Should have no more running clients');\n\t\t\t}\n\t\t}\n\t\tif (this.running && next) {\n\t\t\tnext();\n\t\t}\n\t\tif (this.options.statusCallback) {\n\t\t\tthis.options.statusCallback(error, result, this.latency.getResults());\n\t\t}\n\t}", "title": "" }, { "docid": "b38ca2aac976a2b0e7d44dcf4af599a8", "score": "0.55718094", "text": "function recFn() {\n console.log(2)\n recFn();\n}", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.5526265", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "04c0fc6b5607c77baeb69d53b7c20e88", "score": "0.552472", "text": "function next() {\n\t\t_$nextTick_372( onTick );\n\t}", "title": "" }, { "docid": "dcf3bf2504e425256eb64ebb23fa83ec", "score": "0.5511053", "text": "onGotoNext() {\n return this.gotoNext();\n }", "title": "" }, { "docid": "0e0e7b542c62258bff96611323c1bd5e", "score": "0.55100715", "text": "function execute(){\n\tstack.shift().callback.call(this, null, (maxItems-stack.length));\n}", "title": "" }, { "docid": "3b24328d8b65d34bd43b256a72f5206d", "score": "0.5495255", "text": "function fnA(n,callback) {\n\tconsole.log('fnA().......');\n\treturn fnB(callback)\n}", "title": "" }, { "docid": "1ae94335624c26451899e11091c5bffa", "score": "0.54891646", "text": "function doManyFunc(funs, finalcallback){\n var done = 0, total = funs.length;\n for(var i=0; i<total; i++){\n funs[i](function(){\n done++;\n if(done == total){\n finalcallback();\n }\n });\n }\n if(total === 0){\n finalcallback();\n }\n }", "title": "" }, { "docid": "e5b11d4a0c9899110f04e3db176ba18b", "score": "0.5476446", "text": "function callback(err) {\n if (err) {\n error = err;\n }\n --count || fn(error);\n }", "title": "" }, { "docid": "d205f58c2b0f334fa3bb7c271ce4b14e", "score": "0.5467634", "text": "ProcessOnScroll() {\r\n // Loop each callback\r\n ForEach(this.scrollCallbacks, function(item) {\r\n // Call the callback\r\n item();\r\n });\r\n }", "title": "" }, { "docid": "d3d694611616cab8f1b4bccb7847cbc4", "score": "0.54653656", "text": "function executor(funcion){\r\n funcion();\r\n }", "title": "" }, { "docid": "6a8e9be323f83e9c42faaffc01689278", "score": "0.54644656", "text": "runSequence() {\n\t\tvar args = [];\n\t\tif(arguments.length > 0) {\n\t\t\targs = _.toArray(arguments);\n\t\t}\n\t\treturn CallbackHandler.runSequence(this._getFunctions(), args);\n\t}", "title": "" } ]
674c7481913b584fbdd23f66685c1ef8
make scatter plot with trend line
[ { "docid": "154eea084d4756fc639063ad5ca8a196", "score": "0.51561826", "text": "function makeScatterPlot(csvData) {\n data = csvData // assign data as global variable\n\n // get arrays of fertility rate data and life Expectancy data\n let defense_data = data.map((row) => parseFloat(row[\"Sp. Def\"]));\n let total_data = data.map((row) => parseFloat(row[\"Total\"]));\n\n // find data limits\n let axesLimits = findMinMax(defense_data, total_data);\n\n // draw axes and return scaling + mapping functions\n let mapFunctions = drawAxes(axesLimits, \"Sp. Def\", \"Total\");\n\n // plot data as points and add tooltip functionality\n plotData(mapFunctions);\n\n // draw title and axes labels\n makeLabels();\n }", "title": "" } ]
[ { "docid": "6e0f54573d4fd8274034cdd20e7170c9", "score": "0.6676948", "text": "function createTrendline(trendData){\n var trendline = svg.selectAll(\".trendline\")\n .data(trendData);\n\n trendline.enter()\n .append(\"line\")\n .attr(\"class\", \"trendline\")\n .attr(\"x1\", function (d){ return x(d[0]); })\n .attr(\"y1\", function (d){ return y(d[1]); })\n .attr(\"x2\", function (d){ return x(d[2]); })\n .attr(\"y2\", function (d){ return y(d[3]); })\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", 1);\n}", "title": "" }, { "docid": "1e021758a95f46ebd9d08801a6d452bf", "score": "0.6297812", "text": "function linearRegression(y, scatterPlot){\n // let lr = {}; defined globally\n let n = 0;\n let sum_x = 0;\n let sum_y = 0;\n let sum_xy = 0;\n let sum_xx = 0;\n let sum_yy = 0;\n\n for (i = 78; i < y.length; i++) {\n // skip days we didn't collect data\n if (!(isNaN(y[i]))){\n sum_x += day;\n sum_y += y[i];\n sum_xy += (day*y[i]);\n sum_xx += (day*day);\n sum_yy += (y[i]*y[i]);\n n += 1;\n\n scatterPlot.push({x: day, y: y[i]});\n }\n\n day += 1;\n }\n\n lr['slope'] = (n * sum_xy - sum_x * sum_y) / (n*sum_xx - sum_x * sum_x);\n lr['intercept'] = (sum_y - lr.slope * sum_x)/n;\n lr['r2'] = Math.pow((n*sum_xy - sum_x*sum_y)/Math.sqrt((n*sum_xx-sum_x*sum_x)*(n*sum_yy-sum_y*sum_y)),2);\n }", "title": "" }, { "docid": "c1ec49f3df6893389807af1e5f35cf41", "score": "0.6226424", "text": "findSlopeIntercept(xValues, yValues, trendline, points) {\n let xAvg = 0;\n let yAvg = 0;\n let xyAvg = 0;\n let xxAvg = 0;\n let index = 0;\n let slope = 0;\n let intercept = 0;\n while (index < points.length) {\n // To fix trendline not rendered issue while Nan Value is provided for y values.\n if (isNaN(yValues[index])) {\n yValues[index] = ((yValues[index - 1] + yValues[index + 1]) / 2);\n }\n xAvg += xValues[index];\n yAvg += yValues[index];\n xyAvg += xValues[index] * yValues[index];\n xxAvg += xValues[index] * xValues[index];\n index++;\n }\n const type = trendline.type;\n if (trendline.intercept && (type === 'Linear' || type === 'Exponential')) {\n intercept = trendline.intercept;\n switch (type) {\n case 'Linear':\n slope = ((xyAvg) - (trendline.intercept * xAvg)) / xxAvg;\n break;\n case 'Exponential':\n slope = ((xyAvg) - (Math.log(Math.abs(trendline.intercept)) * xAvg)) / xxAvg;\n break;\n }\n }\n else {\n slope = ((points.length * xyAvg) - (xAvg * yAvg)) / ((points.length * xxAvg) - (xAvg * xAvg));\n slope = (type === 'Linear' ? slope : Math.abs(slope));\n if (type === 'Exponential' || type === 'Power') {\n intercept = Math.exp((yAvg - (slope * xAvg)) / points.length);\n }\n else {\n intercept = (yAvg - (slope * xAvg)) / points.length;\n }\n }\n return { slope: slope, intercept: intercept };\n }", "title": "" }, { "docid": "77b025e79e4512856987b213f607a949", "score": "0.6201667", "text": "function trendLineSlope(arr) {\n //https://classroom.synonym.com/calculate-trendline-2709.html\n let a = 0; //97.5\n for (var i = 1; i <= arr.length; i++) {\n a += i * arr[i - 1];\n }\n a = arr.length * a;\n\n let b = 0; // 87\n arr.forEach(item => {\n b += Number(item);\n });\n //b = (b*28).toFixed(2) // Summation of x values\n let sigma = 0;\n for (var i = 1; i <= arr.length; i++) {\n sigma += i;\n }\n b = Number((b * sigma).toFixed(2)); // Summation of x values\n\n let c = 0; //42\n for (var i = 1; i <= arr.length; i++) {\n c += Math.pow(i, 2);\n }\n c = c * arr.length;\n\n let d = 0; // 36\n for (var i = 1; i <= arr.length; i++) {\n d += i;\n }\n d = d ** 2;\n\n let slope = Number((a - b) / (c - d));\n return slope;\n}", "title": "" }, { "docid": "8c142b6583c847201d64c862598c5de9", "score": "0.6140176", "text": "function drawChart() {\n \"use strict\";\n var high = averageNumTouches(\".grid\") + 1000; //create the high for the Y axis\n\n //create the data and give it an x, y format\n var data = google.visualization.arrayToDataTable([\n ['Number of Cells', 'Average Number of Iterations to Win'],\n [100, averageNumTouches(\".grid\")],\n [400, averageNumTouches(\".gridTwo\")],\n [900, averageNumTouches(\".gridThree\")]\n ]);\n\n //add some options to the chart like a legend, equation of the line, min and max values, etc.\n var options = {\n title: 'Average Number of Iterations vs. Number of Cells',\n hAxis: {title: 'Average Number of Iterations', minValue: 0, maxValue: high},\n vAxis: {title: 'Number of Cells', minValue: 0, maxValue: 900},\n legend: true,\n\n //3rd order polynomial trendline for the points\n trendlines: {\n 0: {\n type: 'polynomial',\n degree: 3,\n color: 'green',\n lineWidth: 3,\n opacity: 0.3,\n showR2: true,\n visibleInLegend: true\n }\n }\n };\n\n var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));\n\n chart.draw(data, options);\n}", "title": "" }, { "docid": "42c0dd32d6a42fe8c8058eb692f1db0d", "score": "0.6109113", "text": "function winrate_scatter_plot(\n svg, data, f1, f2, f3,\n title_text, x_text, y_text) {\n var rightMargin = 20; // seperate incase we add a y2 axis label.\n var margin = {top: 25, right: rightMargin, bottom: 50, left: 40};\n var width = svg.node().getBoundingClientRect().width -\n margin.left - margin.right;\n var height = svg.node().getBoundingClientRect().height -\n margin.bottom - margin.top;\n\n graph_group = svg.append('g')\n .attr('width', width)\n .attr('height', height - margin.top - margin.bottom)\n .attr('transform', translate(margin.left, margin.top));\n\n graph_group.append('rect')\n .attr('width', width)\n .attr('height', height)\n .attr('fill', '#fff');\n\n var tool_tip = d3.tip()\n .attr('class', 'd3-tip scatter-text')\n .offset([8, 0])\n .direction('s')\n .html((d) => 'Model ' + d[0]);\n\n function add_dots(x, y, f1, f2, f3, colorScale) {\n var entering = graph_group.selectAll('scatter-point')\n .data(data).enter();\n\n var g = entering.append('g')\n .attr('transform', (d) => translate(x(f1(d)), y(f2(d))))\n .call(tool_tip);\n\n g.append('circle')\n .attr('r', function(d) { return (colorScale.domain()[1] - f3(d) < 50) ? 3 : 2; })\n .attr('fill', (d) => colorScale(f3(d)));\n g.append('circle')\n .attr('r', 6)\n .attr('fill-opacity', 0)\n .attr('x', '20px')\n .attr('y', '5px')\n .on('mouseover', function(e) {\n tool_tip.show(e);\n setTimeout(tool_tip.hide, 3000);\n });\n }\n\n // Scale the range of the data\n var x = d3.scaleLinear().range([0, width]);\n x.domain([0, 1]);\n\n var y = d3.scaleLinear()\n .domain([0, 1])\n .range([height, 0]);\n\n // TODO(sethtroisi): decide on new to old color scheme\n var colorScale = d3.scaleLinear()\n .domain(d3.extent(data, f3))\n .range(['#000', '#2D2'])\n .interpolate(d3.interpolateHcl);\n\n add_dots(x, y, f1, f2, f3, colorScale);\n\n var line = d3.line()\n .x((d) => x(d[0]))\n .y((d) => y(d[1]));\n\n var paths_group = graph_group.append('g');\n function add_segment(x0, y0, x1, y1, stroke) {\n paths_group.append('path')\n .attr('class', 'data-line')\n .data([[[x0, y0], [x1, y1]]])\n .attr('d', line)\n .attr('stroke', stroke);\n }\n\n add_segment(0, 0, 1, 1, '#000');\n add_segment(0, 0.5, 1, 0.5, '#999');\n add_segment(0.5, 0, 0.5, 1, '#999');\n\n add_labels(\n svg, margin, height, width,\n x, y, false /* y2 */,\n x_text, y_text, title_text);\n}", "title": "" }, { "docid": "50b83cd55fb7f2ef54e9c2ef995a2c7b", "score": "0.6011287", "text": "getDataPoint(x, y, series, index) {\n const trendPoint = new Points();\n trendPoint.x = series.xAxis.valueType === 'DateTime' ? new Date(Number(x)) : x;\n trendPoint.y = y;\n trendPoint.xValue = Number(x);\n trendPoint.color = series.fill;\n trendPoint.index = index;\n trendPoint.yValue = Number(y);\n trendPoint.visible = true;\n series.xMin = Math.min(series.xMin, trendPoint.xValue);\n series.yMin = Math.min(series.yMin, trendPoint.yValue);\n series.xMax = Math.max(series.xMax, trendPoint.xValue);\n series.yMax = Math.max(series.yMax, trendPoint.yValue);\n series.xData.push(trendPoint.xValue);\n return trendPoint;\n }", "title": "" }, { "docid": "c3fa4042c3c7c6f13bbf515eb29b00a3", "score": "0.5995893", "text": "function drawTrendline(sctx, options) {\n // if we have options, merge trendline options in with precedence\n options = $.extend(true, {}, this.trendline, options);\n\n if (this.trendline && options.show) {\n var fit;\n // this.renderer.setGridData.call(this);\n var data = options.data || this.data;\n fit = fitData(data, this.trendline.type);\n var gridData = options.gridData || this.renderer.makeGridData.call(this, fit.data);\n this.trendline.renderer.draw.call(this.trendline, sctx, gridData, {showLine:true, shadow:this.trendline.shadow});\n }\n }", "title": "" }, { "docid": "2d443180d11a4c6b768fc9afbe3dc04f", "score": "0.5971715", "text": "getLinearPoints(trendline, points, xValues, yValues, series, slopeInterceptLinear) {\n const pts = [];\n const max = xValues.indexOf(Math.max.apply(null, xValues));\n const min = xValues.indexOf(Math.min.apply(null, xValues));\n const x1Linear = xValues[min] - trendline.backwardForecast;\n const y1Linear = slopeInterceptLinear.slope * x1Linear + slopeInterceptLinear.intercept;\n const x2Linear = xValues[max] + trendline.forwardForecast;\n const y2Linear = slopeInterceptLinear.slope * x2Linear + slopeInterceptLinear.intercept;\n pts.push(this.getDataPoint(x1Linear, y1Linear, series, pts.length));\n pts.push(this.getDataPoint(x2Linear, y2Linear, series, pts.length));\n return pts;\n }", "title": "" }, { "docid": "be7ce258273588c797edc8cfc47ff9d1", "score": "0.5920197", "text": "function regressionLineYPoints(dataset, chosenXAxis, chosenYAxis) {\n\n let xArray = dataset.map(data => data[chosenXAxis]);\n let yArray = dataset.map(data => data[chosenYAxis]);\n let x = dataset.map(data => data[chosenXAxis]);\n let regressionLineStats = linearRegression(xArray, yArray);\n let m = regressionLineStats.slope;\n let b = regressionLineStats.intercept;\n let r2 = regressionLineStats.r2;\n let yPoints;\n let sortedXArray;\n if (m > 0) {\n yPoints = x.map(point => m * point + b).sort((a, b) => a - b);\n sortedXArray = x.sort((a, b) => a - b);\n }\n else if (m < 0) {\n yPoints = x.map(point => m * point + b).sort((a, b) => b - a);\n sortedXArray = x.sort((b, a) => b - a);\n };\n\n let regressionLineArray = []\n\n for (let i = 0; i < xArray.length; i++) {\n regressionLineArray.push({\n x: sortedXArray[i],\n y: yPoints[i]\n });\n };\n // Calculating correction constants to be used to scale the line of best fit\n // to the scale currently defined for the chartGroup\n let yMaxConst = d3.max(yArray) / d3.max(yPoints);\n let yMinConst = d3.min(yArray) / d3.min(yPoints);\n\n // Calculating the scale for the line of best fit\n let xdata = d3.scaleLinear()\n .domain([d3.min(regressionLineArray, data => data.x) ,\n d3.max(regressionLineArray, data => data.x)])\n .range([0, width]);\n\n // Calculating the scale for the line of best fit adjusted to match the\n // the scale currently defined for the chartGroup\n let ydata = d3.scaleLinear()\n .domain([d3.max(regressionLineArray, data => data.y) * yMaxConst * 1.02,\n d3.min(regressionLineArray, data => data.y) * yMinConst * 0.80])\n .range([0, height]);\n\n // Initializing a variable with the x and y coordinates of the line of best fit\n let drawLine = d3.line()\n .x(data => xdata(data.x))\n .y(data => ydata(data.y));\n\n // Initializing a variable with the line data for the line of best fit\n let lineData = drawLine(regressionLineArray);\n\n return [lineData, m, b, r2];\n}", "title": "" }, { "docid": "08a6559034d79b208a59e2851a286a66", "score": "0.5917348", "text": "getPolynomialPoints(trendline, points, xValues, yValues, series) {\n let pts = [];\n let polynomialOrder = points.length <= trendline.polynomialOrder ? points.length : trendline.polynomialOrder;\n polynomialOrder = Math.max(2, polynomialOrder);\n polynomialOrder = Math.min(6, polynomialOrder);\n trendline.polynomialOrder = polynomialOrder;\n trendline.polynomialSlopes = [];\n trendline.polynomialSlopes.length = trendline.polynomialOrder + 1;\n let index = 0;\n while (index < xValues.length) {\n const xVal = xValues[index];\n const yVal = yValues[index];\n let subIndex = 0;\n while (subIndex <= trendline.polynomialOrder) {\n if (!trendline.polynomialSlopes[subIndex]) {\n trendline.polynomialSlopes[subIndex] = 0;\n }\n trendline.polynomialSlopes[subIndex] += Math.pow(xVal, subIndex) * yVal;\n ++subIndex;\n }\n index++;\n }\n const numArray = [];\n numArray.length = 1 + 2 * trendline.polynomialOrder;\n const matrix = [];\n matrix.length = trendline.polynomialOrder + 1;\n let newIndex = 0;\n while (newIndex < (trendline.polynomialOrder + 1)) {\n matrix[newIndex] = [];\n matrix[newIndex].length = 3;\n newIndex++;\n }\n let nIndex = 0;\n while (nIndex < xValues.length) {\n const d = xValues[nIndex];\n let num2 = 1.0;\n let nIndex2 = 0;\n while (nIndex2 < numArray.length) {\n if (!numArray[nIndex2]) {\n numArray[nIndex2] = 0;\n }\n numArray[nIndex2] += num2;\n num2 *= d;\n ++nIndex2;\n }\n ++nIndex;\n }\n let nnIndex = 0;\n while (nnIndex <= trendline.polynomialOrder) {\n let nnIndex2 = 0;\n while (nnIndex2 <= trendline.polynomialOrder) {\n matrix[nnIndex][nnIndex2] = numArray[nnIndex + nnIndex2];\n ++nnIndex2;\n }\n ++nnIndex;\n }\n if (!this.gaussJordanElimination(matrix, trendline.polynomialSlopes)) {\n trendline.polynomialSlopes = null;\n }\n pts = this.getPoints(trendline, points, xValues, series);\n return pts;\n }", "title": "" }, { "docid": "679391f7f6df4fd52b4532a653739908", "score": "0.5890974", "text": "function makeScatterPlot(year) {\n filterByYear(year);\n\n // get arrays of fertility rate data and life Expectancy data\n let fertility_rate_data = data.map(row =>\n parseFloat(row[\"fertility_rate\"])\n );\n let life_expectancy_data = data.map(row =>\n parseFloat(row[\"life_expectancy\"])\n );\n\n // find data limits\n let axesLimits = findMinMax(fertility_rate_data, life_expectancy_data);\n\n // draw axes and return scaling + mapping functions\n let mapFunctions = drawAxes(\n axesLimits,\n \"fertility_rate\",\n \"life_expectancy\",\n svgScatterPlot,\n { min: 50, max: 450 },\n { min: 50, max: 450 }\n );\n\n // plot data as points and add tooltip functionality\n plotData(mapFunctions);\n\n // draw title and axes labels\n makeLabels();\n }", "title": "" }, { "docid": "f2e76a3909b1939b7ba2c770a5915286", "score": "0.58855325", "text": "function drawRevenueTrend() {\n var ctx = document.getElementById(\"revenueTrend\").getContext(\"2d\");\n\n var data = {\n labels: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\"],\n datasets: [\n {\n label: \"My First dataset\",\n fillColor: \"rgba(220,220,220,0.2)\",\n strokeColor: \"rgba(220,220,220,1)\",\n pointColor: \"rgba(220,220,220,1)\",\n pointStrokeColor: \"#fff\",\n pointHighlightFill: \"#fff\",\n pointHighlightStroke: \"rgba(220,220,220,1)\",\n data: [65, 59, 80, 81, 56, 55, 40]\n },\n {\n label: \"My Second dataset\",\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: [28, 48, 40, 19, 86, 27, 90]\n }\n ]\n };\n\n var myLineChart = new Chart(ctx).Line(data, trendChartOptions);\n}", "title": "" }, { "docid": "ff93120c8fd0a7b777d2c2f4c02aeea1", "score": "0.58647513", "text": "getPoints(trendline, points, xValues, series) {\n const polynomialSlopes = trendline.polynomialSlopes;\n const pts = [];\n let x1 = 1;\n let index = 1;\n let xValue;\n let yValue;\n // We have to sort the points in ascending order. Because, the data source of the series may be random order.\n points.sort((a, b) => { return a.xValue - b.xValue; });\n xValues.sort((a, b) => { return a - b; });\n while (index <= polynomialSlopes.length) {\n if (index === 1) {\n xValue = xValues[0] - trendline.backwardForecast;\n yValue = this.getPolynomialYValue(polynomialSlopes, xValue);\n pts.push(this.getDataPoint(xValue, yValue, series, pts.length));\n }\n else if (index === polynomialSlopes.length) {\n xValue = xValues[points.length - 1] + trendline.forwardForecast;\n yValue = this.getPolynomialYValue(polynomialSlopes, xValue);\n pts.push(this.getDataPoint(xValue, yValue, series, pts.length));\n }\n else {\n x1 += (points.length + trendline.forwardForecast) / polynomialSlopes.length;\n xValue = xValues[parseInt(x1.toString(), 10) - 1];\n yValue = this.getPolynomialYValue(polynomialSlopes, xValue);\n pts.push(this.getDataPoint(xValue, yValue, series, pts.length));\n }\n index++;\n }\n return pts;\n }", "title": "" }, { "docid": "5abf43ba0b77a32200bf299a285177d2", "score": "0.5862514", "text": "setLinearRange(points, trendline, series) {\n const xValues = [];\n const yValues = [];\n let index = 0;\n while (index < points.length) {\n const point = points[index];\n xValues.push(point.xValue);\n yValues.push(point.yValue);\n index++;\n }\n const slopeIntercept = this.findSlopeIntercept(xValues, yValues, trendline, points);\n series.points = this.getLinearPoints(trendline, points, xValues, yValues, series, slopeIntercept);\n }", "title": "" }, { "docid": "26df1a3da3c8b7ed6476da7d17238391", "score": "0.5833095", "text": "function PriceOccupancyscatterplot(body) {\n var margin = {left:60, right:50, top:50, bottom:100};\n var height = 490 - margin.top - margin.bottom,\n width = 500 - margin.left - margin.right;\n \n var svg = d3.select(body)\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 \n // The API for scales have changed in v4. There is a separate module d3-scale which can be used instead. The main change here is instead of d3.scale.linear, we have d3.scaleLinear.\n var xScale = d3.scaleLinear()\n .range([0, width]);\n \n var yScale = d3.scaleLinear()\n .range([height, 0]);\n \n // square root scale.\n var radius = d3.scaleSqrt()\n .range([2,5]);\n \n // the axes are much cleaner and easier now. No need to rotate and orient the axis, just call axisBottom, axisLeft etc.\n var xAxis = d3.axisBottom()\n .scale(xScale);\n \n var yAxis = d3.axisLeft()\n .scale(yScale);\n \n // again scaleOrdinal\n var color = d3.scaleOrdinal(d3.schemeCategory20);\n \n d3.csv('data_json/scatter_price_occupancy_rate.csv', function(error, data){\n data.forEach(function(d){\n d.Occupancy_rate = +d.Occupancy_rate;\n d.Daily_price = +d.Daily_price;\n d.Size = +d.Size;\n d.Area = d.Area;\n });\n \n xScale.domain(d3.extent(data, function(d){\n return d.Occupancy_rate;\n })).nice();\n \n yScale.domain(d3.extent(data, function(d){\n return d.Daily_price;\n })).nice();\n \n radius.domain(d3.extent(data, function(d){\n return d.Size;\n })).nice();\n \n svg.append(\"text\")\n .attr(\"x\", (width / 2)) \n .attr(\"y\", 0 - (margin.top / 2))\n .attr(\"text-anchor\", \"middle\") \n .style(\"font-size\", \"16px\") \n .style(\"text-decoration\", \"none\") \n .text(\"Daily price VS Occupancy rate (estimated)\");\n\n // adding axes is also simpler now, just translate x-axis to (0,height) and it's alread defined to be a bottom axis. \n svg.append('g')\n .attr('transform', 'translate(0,' + height + ')')\n .attr('class', 'x axis')\n .call(xAxis);\n \n // y-axis is translated to (0,0)\n svg.append('g')\n .attr('transform', 'translate(0,0)')\n .attr('class', 'y axis')\n .call(yAxis);\n \n \n var bubble = svg.selectAll('.bubble')\n .data(data)\n .enter().append('circle')\n .attr('class', 'bubble')\n .attr('cx', function(d){return xScale(d.Occupancy_rate);})\n .attr('cy', function(d){ return yScale(d.Daily_price); })\n .attr('r', function(d){ return radius(d.Size); })\n .style('fill', function(d){ return color(d.Area); });\n \n bubble.append('title')\n .attr('x', function(d){ return radius(d.Size); })\n .text(function(d){\n return d.Area;\n });\n \n // adding label. For x-axis, it's at (10, 10), and for y-axis at (width, height-10).\n svg.append('text')\n .attr('x', 10)\n .attr('y', 10)\n .attr('class', 'label')\n .text('Daily price');\n \n \n svg.append('text')\n .attr('x', width)\n .attr('y', height - 10)\n .attr('text-anchor', 'end')\n .attr('class', 'label')\n .text('Occupancy rate (Estimated)');\n \n // I feel I understand legends much better now.\n // define a group element for each color i, and translate it to (0, i * 20). \n var legend = svg.selectAll('legend')\n .data(color.domain())\n .enter().append('g')\n .attr('class', 'legend')\n .attr('transform', function(d,i){ return 'translate(0,' + i * 20 + ')'; });\n \n // give x value equal to the legend elements. \n // no need to define a function for fill, this is automatically fill by color.\n legend.append('rect')\n .attr('x', width)\n .attr('width', 18)\n .attr('height', 18)\n .style('fill', color);\n \n // add text to the legend elements.\n // rects are defined at x value equal to width, we define text at width - 6, this will print name of the legends before the rects.\n legend.append('text')\n .attr('x', width - 6)\n .attr('y', 9)\n .attr('dy', '.2em')\n .style('text-anchor', 'end')\n .text(function(d){ return d; });\n \n \n // d3 has a filter fnction similar to filter function in JS. Here it is used to filter d3 components.\n legend.on('click', function(type){\n d3.selectAll('.bubble')\n .style('opacity', 0.15)\n .filter(function(d){\n return d.Area == type;\n })\n .style('opacity', 1);\n })\n \n \n })\n }", "title": "" }, { "docid": "be97cc276607288532cdebe9655a78f0", "score": "0.582374", "text": "getLogarithmicPoints(trendline, points, xValues, yValues, series, slopeInterceptLog) {\n const midPoint = Math.round((points.length / 2));\n const pts = [];\n const x1Log = xValues[0] - trendline.backwardForecast;\n const x1 = x1Log ? Math.log(x1Log) : 0;\n const y1Log = slopeInterceptLog.intercept + (slopeInterceptLog.slope * x1);\n const x2Log = xValues[midPoint - 1];\n const x2 = x2Log ? Math.log(x2Log) : 0;\n const y2Log = slopeInterceptLog.intercept + (slopeInterceptLog.slope * x2);\n const x3Log = xValues[xValues.length - 1] + trendline.forwardForecast;\n const x3 = x3Log ? Math.log(x3Log) : 0;\n const y3Log = slopeInterceptLog.intercept + (slopeInterceptLog.slope * x3);\n pts.push(this.getDataPoint(x1Log, y1Log, series, pts.length));\n pts.push(this.getDataPoint(x2Log, y2Log, series, pts.length));\n pts.push(this.getDataPoint(x3Log, y3Log, series, pts.length));\n return pts;\n }", "title": "" }, { "docid": "285ac4def04df83e24fe244947e28b55", "score": "0.5821402", "text": "function PriceAvailabilityscatterplot(body) {\n var margin = {left:60, right:50, top:50, bottom:100};\n var height = 490 - margin.top - margin.bottom,\n width = 500 - margin.left - margin.right;\n \n var svg = d3.select(body)\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 \n // The API for scales have changed in v4. There is a separate module d3-scale which can be used instead. The main change here is instead of d3.scale.linear, we have d3.scaleLinear.\n var xScale = d3.scaleLinear()\n .range([0, width]);\n \n var yScale = d3.scaleLinear()\n .range([height, 0]);\n \n // square root scale.\n var radius = d3.scaleSqrt()\n .range([2,5]);\n \n // the axes are much cleaner and easier now. No need to rotate and orient the axis, just call axisBottom, axisLeft etc.\n var xAxis = d3.axisBottom()\n .scale(xScale);\n \n var yAxis = d3.axisLeft()\n .scale(yScale);\n \n // again scaleOrdinal\n var color = d3.scaleOrdinal(d3.schemeCategory20);\n \n d3.csv('data_json/scatter_price_availability.csv', function(error, data){\n data.forEach(function(d){\n d.Availability = +d.Availability;\n d.Daily_price = +d.Daily_price;\n d.Size = +d.Size;\n d.Area = d.Area;\n });\n \n xScale.domain(d3.extent(data, function(d){\n return d.Availability;\n })).nice();\n \n yScale.domain(d3.extent(data, function(d){\n return d.Daily_price;\n })).nice();\n \n radius.domain(d3.extent(data, function(d){\n return d.Size;\n })).nice();\n \n // adding axes is also simpler now, just translate x-axis to (0,height) and it's alread defined to be a bottom axis. \n svg.append('g')\n .attr('transform', 'translate(0,' + height + ')')\n .attr('class', 'x axis')\n .call(xAxis);\n \n // y-axis is translated to (0,0)\n svg.append('g')\n .attr('transform', 'translate(0,0)')\n .attr('class', 'y axis')\n .call(yAxis);\n \n \n var bubble = svg.selectAll('.bubble')\n .data(data)\n .enter().append('circle')\n .attr('class', 'bubble')\n .attr('cx', function(d){return xScale(d.Availability);})\n .attr('cy', function(d){ return yScale(d.Daily_price); })\n .attr('r', function(d){ return radius(d.Size); })\n .style('fill', function(d){ return color(d.Area); });\n \n bubble.append('title')\n .attr('x', function(d){ return radius(d.Size); })\n .text(function(d){\n return d.Area;\n });\n \n // adding label. For x-axis, it's at (10, 10), and for y-axis at (width, height-10).\n svg.append(\"text\")\n .attr(\"x\", (width / 2)) \n .attr(\"y\", 0 - (margin.top / 2))\n .attr(\"text-anchor\", \"middle\") \n .style(\"font-size\", \"16px\") \n .style(\"text-decoration\", \"none\") \n .text(\"Daily price VS Availability\");\n \n svg.append('text')\n .attr('x', 10)\n .attr('y', 10)\n .attr('class', 'label')\n .text('Daily price');\n \n \n svg.append('text')\n .attr('x', width)\n .attr('y', height - 10)\n .attr('text-anchor', 'end')\n .attr('class', 'label')\n .text('Availability');\n \n // I feel I understand legends much better now.\n // define a group element for each color i, and translate it to (0, i * 20). \n var legend = svg.selectAll('legend')\n .data(color.domain())\n .enter().append('g')\n .attr('class', 'legend')\n .attr('transform', function(d,i){ return 'translate(0,' + i * 20 + ')'; });\n \n // give x value equal to the legend elements. \n // no need to define a function for fill, this is automatically fill by color.\n legend.append('rect')\n .attr('x', width)\n .attr('width', 18)\n .attr('height', 18)\n .style('fill', color);\n \n // add text to the legend elements.\n // rects are defined at x value equal to width, we define text at width - 6, this will print name of the legends before the rects.\n legend.append('text')\n .attr('x', width - 6)\n .attr('y', 9)\n .attr('dy', '.2em')\n .style('text-anchor', 'end')\n .text(function(d){ return d; });\n \n \n // d3 has a filter fnction similar to filter function in JS. Here it is used to filter d3 components.\n legend.on('click', function(type){\n d3.selectAll('.bubble')\n .style('opacity', 0.15)\n .filter(function(d){\n return d.Area == type;\n })\n .style('opacity', 1);\n })\n \n \n })\n }", "title": "" }, { "docid": "79f4a2c6902ad3e54d6af8332a3751e5", "score": "0.58208865", "text": "function scatterline(data, category, container){\n\t// console.log('drawing scatterline >>>>>>>>>>');\n\t// console.log(category);\n\n\t// const container = d3.select(container);\n\t\n\tconst bbox = d3.select(container).node().getBoundingClientRect(),\n\t\tcircleRadius = 6,\n\t\theight=bbox.height,\n\t\twidth=bbox.width,\n\t\tmargin={top:0,right:20,bottom:20,left:20},\n\t\tinnerHeight = height - margin.top - margin.bottom,\n\t\tinnerWidth = width - margin.right - margin.left;\n\n\tconst axisFormat = category == \"year_built\" ? \"d\" : \",\";\n\n\tconst extent = d3.extent(data, d => parseInt(d[category]));\n\t\t\n\tconst scatterScale = d3.scaleLinear()\n\t\t.domain(extent)\n\t\t.range([0,innerWidth])\n\t\t.nice();\n\n\tconst xAxis = d3.axisBottom(scatterScale)\n\t .tickSize(circleRadius * 2)\n\t .tickFormat(d3.format(axisFormat));\n\n\t// ----------------------------------\n\t// START MESSING WITH SVGs\n\t// ----------------------------------\n\n\t//Inserts svg and sizes it\n\tconst svg = d3.select(container)\n\t\t.append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n\tconst chartInner = svg.append('g')\n\t\t.classed('chartInner', true)\n\t\t.attr(\"width\",innerWidth)\n\t\t.attr(\"height\",innerHeight)\n\t\t.attr(`transform`,`translate(${margin.left},${margin.top})`);\n\n\tsvg.append('g')\n\t\t.classed('x', true)\n\t\t.classed('axis', true)\n\t\t.attr(`transform`,`translate(${margin.left},${margin.top + innerHeight / 2})`)\n\t\t.call(xAxis);\n\n\t\n\tchartInner.append('line')\n\t\t.classed('scatterline__line', true)\n\t\t.attr('x1', 0)\n\t\t.attr('x2', innerWidth)\n\t\t.attr('y1', innerHeight / 2)\n\t\t.attr('y2', innerHeight / 2)\n\t\t.style('stroke', 'black')\n\t\t.style('stroke-width', 1);\n\n\tchartInner.selectAll('circle')\n\t\t.data(data)\n\t\t.enter()\n\t\t\t.append('circle')\n\t\t\t.classed('scatterline__circle', true)\n\t\t\t.attr('r', circleRadius)\n\t\t\t.style('fill', getTribColors('trib-blue2'))\n\t\t\t.style('opacity', .3)\n\t\t\t.attr('cx', d => scatterScale(d[category]))\n\t\t\t.attr('cy', innerHeight / 2)\n\t\t\t.attr('data-value', d => d[category]);\n\t\n}", "title": "" }, { "docid": "7d6bca8a01fb1e3aea3a8a813ce253e4", "score": "0.57269967", "text": "function plotAverageLine(greScores, admitRates, limits, scale) {\r\n\r\n let sum = admitRates.reduce(function(a, b) { return a + b; }, 0) \r\n let avg = sum / admitRates.length\r\n let final = Math.round(avg * 10) / 10\r\n\r\n // find and initial and end points for the trend line\r\n let x1 = limits.greMin;\r\n let x2 = limits.greMax;\r\n let y = final\r\n\r\n let trendData = [[x1,y,x2,y]];\r\n\r\n // append trend line to SVG and assign attributes\r\n let xScale = scale.xScale;\r\n let yScale = scale.yScale;\r\n let trendLine = svgContainer.selectAll('.trendLine')\r\n .data(trendData)\r\n .enter()\r\n .append('line')\r\n .attr('x1', function(d) { return xScale(d[0]) - 8})\r\n .attr(\"y1\", function(d) { return yScale(d[1])})\r\n\t\t\t .attr(\"x2\", function(d) { return xScale(d[2]) + 20})\r\n .attr(\"y2\", function(d) { return yScale(d[3])})\r\n .attr('stroke-dasharray', '8,8')\r\n .attr('stroke', 'green')\r\n .attr('stroke-width', 2)\r\n\r\n svgContainer.append(\"text\")\r\n .attr(\"x\",671)\r\n .attr(\"y\", 252)\r\n .attr(\"height\",30)\r\n .attr(\"width\",100)\r\n .style('font-size', '10pt')\r\n .style('font-weight', 'bold')\r\n .style('font-family', 'Arial')\r\n .text(\"13.5\");\r\n\r\n svgContainer.append(\"rect\")\r\n .attr(\"x\", 671)\r\n .attr(\"y\", 240)\r\n .attr(\"width\", 27)\r\n .attr(\"height\", 15)\r\n .style(\"fill\", \"#e7e7e7\")\r\n .style(\"opacity\", \"0.6\")\r\n\r\n }", "title": "" }, { "docid": "045db9a7e039df769585bd4ed82cbcce", "score": "0.57118857", "text": "function renderLineChart() {\n\t\tvar dataLen = data.length;\n\t\tvar points = [];\n\n\t\tif (!opChart.danger) {\n\t\t\tsetBackground(opBackground.gradation, getColor(opChart, \"background\", 0));\n\t\t} else {\n\t\t\tctx.fillStyle = 'white';\n\t\t\tctx.fillRect(0, 0, width, height);\n\t\t}\n\t\tsetMinMax();\n\t\tdrawAxes();\t\t\n\n\t\tctx.lineWidth = opLine.lineWidth;\n\t\tctx.lineJoin = opLine.lineJoin;\n\t\tctx.strokeStyle = opLine.lineColor;\n\n\t\tfor (var i = 0; i < dataLen; i++) {\t\n\t\t\tvar x = getXForIndex(i, dataLen);\n\t\t\tvar y = getYForValue(data[i]);\n\t\t\tvar point = { x: x, y: y };\n\t\t\tvar color = getColor(opChart, \"chart\", (opChart.colorIdx + i) % opChart.colors.length);\n\n\t\t\tpoints.push(point);\n\t\t\tsetColorType(ctx, opChart.gradation, color);\n\n\t\t\tif (i > 0) {\n\t\t\t\tif (i == 1) cy = y;\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.moveTo(prevX, prevY);\n\t\t\t\t\n\t\t\t\tif(i == dataLen - 1 && opAnimation.on){\n\t\t\t\t\tvar animPoints = calcWayPoints(prevX, prevY, x, y);\n\t\t\t\t\tanimateLine(ctx, opChart, opLine, animPoints, opAnimation.step, 0, i);\n\t\t\t\t} else if (opLine.lineShape == \"smooth\") {\n\t\t\t\t\tcy = renderSmoothLine(cy, x, y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.lineTo(x, y);\n\t\t\t\t}\n\t\t\t ctx.stroke();\n\t\t\t\tctx.closePath();\n\t\t\t}\n\t\n\t\t\tprevX = x;\n\t\t\tprevY = y;\n\t\t}\n\n\t\tfor (var i = 0; i < dataLen; i++) {\n\t\t\tif (opLine.dotOn && (!opAnimation.on || i < dataLen - 1)) {\n\t\t\t\tdrawCirclePoint(ctx, opLine, points[i]);\n\t\t\t}\n\t\t}\n\n\t\tif (opChart.danger) drawDanger();\n\t}", "title": "" }, { "docid": "626622f4c0d12b2051f2dd195f9d33c1", "score": "0.5707884", "text": "function initScatterPlot() {\n\n // set margins for plot\n marginScatter = {\n top: 20,\n right: 130,\n bottom: 50,\n left: 70,\n };\n\n // initialize tooltip\n tipScatter = d3.tip().attr('class', 'd3-tip text-center').html(function(d) {\n var rv = '<b>Country: </b>' + d.ISO + '<br><b>' + cleanText(scatterInternet) \n + ': </b>' + d.x + '<br><b>' + cleanText(scatterHpi) + ': </b>' + d.y;\n return rv;\n });\n\n // set width and height of plot\n widthScatter = $('#scatter').width() - marginScatter.left - marginScatter.right;\n heightScatter = $('#scatter').height() - marginScatter.top - marginScatter.bottom;\n\n // initialize x-scale\n xScatter = d3.scale.linear()\n .range([0, widthScatter]);\n\n // initialize y-scale\n yScatter = d3.scale.linear()\n .range([heightScatter, 0]);\n\n // set up scatter plot\n colorScatter = d3.scale.category20();\n\n svgScatter = d3.select('#scatter')\n .append('g')\n .attr('transform', 'translate(' + marginScatter.left + ',' + marginScatter.top + ')');\n svgScatter.call(tipScatter);\n\n // set initial countries to add to plot\n countryScatter = ['USA', 'KOR', 'AUS', 'BRA', 'NLD'];\n\n // get initial data\n var data = addScatterData('average broadband download', 'hpi');\n var xData = data.map(function(d) { return d.x; });\n var yData = data.map(function(d) { return d.y; });\n var regression = leastSquaresequation(xData, yData);\n\n // set domain of scatter plot\n xScatter.domain(d3.extent(data, function(d) {\n return +d.x;\n })).nice();\n yScatter.domain(d3.extent(data, function(d) {\n return +d.y;\n })).nice();\n\n // create line function\n lineScatter = d3.svg.line()\n .x(function(d) { return xScatter(d.x); })\n .y(function(d) { return yScatter(regression(d.x)); });\n\n // set domain of colors\n colorScatter.domain(countryScatter);\n\n // create line\n svgScatter.selectAll('path')\n .data([data])\n .enter().append('path')\n .attr('class', 'line')\n .attr('d', lineScatter);\n\n svgScatter.append('g')\n .attr('class', 'scatter-legend')\n .attr('transform', 'translate(' + (widthScatter + marginScatter.right / 2) + ',0)')\n .call(d3.legend.color().scale(colorScatter).labels(countryScatter));\n\n svgScatter.append('g')\n .attr('class', 'x axis')\n .attr('transform', 'translate(0,' + heightScatter + ')')\n .call(d3.svg.axis().scale(xScatter).orient('bottom').ticks(5));\n\n // set y-axis\n svgScatter.append('g')\n .attr('class', 'y axis')\n .call(d3.svg.axis().scale(yScatter).orient('left'));\n\n // add dots\n svgScatter.selectAll('.dot')\n .data(data)\n .enter().append('circle')\n .attr('class', 'dot')\n .style('fill', function(d) {\n return colorScatter(d.ISO);\n })\n .attr('r', 3.5)\n\n // set position\n .attr('cx', function(d) {\n return xScatter(d.x);\n })\n .attr('cy', function(d) {\n return yScatter(d.y);\n })\n\n // add tooltip\n .on('mouseover', tipScatter.show)\n .on('mouseout', tipScatter.hide)\n\n // remove country on click\n .on('click', function(d) { addCountryScatter(d.ISO, false); });\n\n // write axis labels\n svgScatter.select('.x')\n .append('text')\n .attr('class', 'scatter-label')\n .text(cleanText(scatterInternet))\n .attr('text-anchor', 'end')\n .attr('transform', 'translate(' + widthScatter + ',' + 40 +')');\n\n svgScatter.select('.y')\n .append('text')\n .attr('class', 'scatter-label')\n .text(cleanText(scatterHpi))\n .attr('text-anchor', 'end')\n .attr('transform', 'rotate(-90) translate(0,' + (-50) + ')');\n\n}", "title": "" }, { "docid": "7d3b8ac410a4cb909d16ff721d913a89", "score": "0.56760335", "text": "function plotScatter(data) {\n \n // Create arrays \n var xData = [];\n var yData = [];\n \n\n var device_type = data[device_type];\n var parseTime = d3.timeParse(\"%m/%d/%Y\");\n\n data[\"accidents\"].forEach(function(data){\n if (data.device_type && data.date){\n data.date = parseTime(data.date);\n xData.push(data.date);\n yData.push(data.device_type);\n }\n });\n\n console.log(xData);\n console.log(yData);\n/////// Adding colors to al of the plots\n var trace = []\n var device = []\n\n for (let i = 0; i < xData.length; i += 1) {\n if (device.indexOf(yData[i]) === -1) {\n trace.push({ x: [],\n y: [],\n mode: 'markers',\n name: yData[i],\n type:'scatter',\n title: 'Ride type and injries'\n \n });\n device.push(yData[i]);\n } else {\n trace[device.indexOf(yData[i])].x.push(xData[i]);\n trace[device.indexOf(yData[i])].y.push(yData[i]);\n }\n}\nconsole.log(trace)\nPlotly.newPlot('scatterDiv', trace);\n\n\n}", "title": "" }, { "docid": "0655c5d8f099b9bb545f5d6d59f8dffa", "score": "0.5662604", "text": "setSeriesProperties(series, trendline, name, fill, width, chart) {\n series.name = trendline.name;\n series.xName = 'x';\n series.yName = 'y';\n series.fill = fill || 'blue';\n series.width = width;\n series.dashArray = trendline.dashArray;\n series.clipRectElement = trendline.clipRectElement;\n series.points = [];\n series.enableTooltip = trendline.enableTooltip;\n series.index = trendline.index;\n series.sourceIndex = trendline.sourceIndex;\n series.interior = series.fill;\n series.animation = trendline.animation;\n series.legendShape = 'HorizontalLine';\n series.marker = trendline.marker;\n series.category = 'TrendLine';\n series.chart = chart;\n series.xMin = Infinity;\n series.xMax = -Infinity;\n series.yMin = Infinity;\n series.yMax = -Infinity;\n series.xData = [];\n series.yData = [];\n trendline.targetSeries = series;\n if (chart.isBlazor) {\n trendline.targetSeries.border = {}; // To avoid console error in blazor\n trendline.targetSeries.connector = {}; // To avoid console error in blazor\n }\n }", "title": "" }, { "docid": "0af73d3c572be09016ad9f27249a90d7", "score": "0.5658869", "text": "function appendLineDotsCharts() {\r\n // define the line\r\n var valueline = d3.line()\r\n .x(function(d) { \r\n return x(d.year); \r\n })\r\n .y(function(d) { \r\n return y(d.goals); \r\n });\r\n\r\n // Define the div for the tooltip\r\n var div = d3.select(\"body\").append(\"div\")\t\r\n .attr(\"class\", \"tooltip\")\t\t\t\t\r\n .style(\"opacity\", 0); \r\n\r\n // Add the valueline path.\r\n svg.append(\"path\")\r\n .data([totalGoals])\r\n .attr(\"class\", \"line\")\r\n .attr(\"d\", valueline);\r\n\r\n // Appends a circle for each datapoint \r\n svg.selectAll(\".dot\")\r\n .data(totalGoals)\r\n .enter().append(\"circle\")\r\n .attr(\"class\", \"dot\")\r\n .attr(\"r\", 5)\r\n .attr(\"cx\", function(d) { return x(d.year); })\r\n .attr(\"cy\", function(d) { return y(d.goals); })\r\n .on(\"mouseover\", function(d) {\t //Add a tooltip for each datapoint\t\r\n div.transition()\t\t\r\n .duration(200)\t\t\r\n .style(\"opacity\", .9);\t\t\r\n div\t.html(\"Año: \" + d.year + \"<br/>\" + \"Goles: \" + d.goals)\t\r\n .style(\"left\", (d3.event.pageX) + \"px\")\t\t\r\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\t\r\n })\t\t\t\t\t\r\n .on(\"mouseout\", function(d) {\t\t\r\n div.transition()\t\t\r\n .duration(500)\t\t\r\n .style(\"opacity\", 0);\t\r\n });\r\n\r\n \r\n}", "title": "" }, { "docid": "37cc82613bbf10fb37f1ec52e9377ae2", "score": "0.5643", "text": "function drawLineChart() {\n var data = google.visualization.arrayToDataTable(dataToPlot);\n\n var options = {\n title: '30 Day History',\n curveType: 'function',\n legend: { position: 'right' },\n colors: ['#009688']\n };\n\n var chart = new google.visualization.LineChart(document.getElementById('priceChart'));\n\n chart.draw(data, options);\n}", "title": "" }, { "docid": "63cf22667902719be2cd6caebbbb49c5", "score": "0.5642448", "text": "function addCountryScatter(country, addData=true) {\n \n // decide what to do when calling this function\n if (countryScatter.includes(String(country)) && addData) return false;\n else if (addData) countryScatter.push(String(country));\n\n // pass or continue doesn't work\n else if (country == false);\n else countryScatter.splice(countryScatter.indexOf(String(country)), 1);\n\n // get data and update domain\n var data = addScatterData(scatterInternet, scatterHpi);\n xScatter.domain(d3.extent(data, function(d) { return +d.x; }));\n yScatter.domain(d3.extent(data, function(d) { return +d.y; }));\n colorScatter.domain(countryScatter);\n\n // get regression data\n var xData = data.map(function(d) { return d.x; });\n var yData = data.map(function(d) { return d.y; });\n var regression = leastSquaresequation(xData, yData);\n\n // set the scatter line function\n lineScatter.x(function(d) { return xScatter(d.x); })\n .y(function(d) { return yScatter(regression(d.x)); });\n\n // create teh line element\n var lineElement = svgScatter.selectAll('path').data([data]);\n\n // remove the old line\n lineElement.exit().remove().transition().duration(750);\n\n // update existing line\n lineElement\n .transition().duration(750)\n .attr('d', lineScatter);\n\n // add new line\n lineElement.enter().append('path') \n .transition().duration(750)\n .attr('class', 'line')\n .attr('d', lineScatter);\n\n // update data in plot\n var circles = svgScatter.selectAll('circle').data(data);\n\n // delete the unneeded data\n circles.exit().remove().transition().duration(750);\n\n // update existing points to new scale\n circles.transition().duration(750)\n .attr('cx', function(d) { return xScatter(d.x); })\n .attr('cy', function(d) { return yScatter(d.y); })\n .style('fill', function(d) { return colorScatter(d.ISO); });\n\n // add new data points\n circles.enter().append('circle')\n .transition().duration(750)\n .attr('class', 'dot')\n .attr('r', 3.5)\n .style('fill', function(d) { return colorScatter(d.ISO); })\n .attr('cx', function(d) { return xScatter(d.x); })\n .attr('cy', function(d) { return yScatter(d.y); })\n\n circles.on('mouseover', tipScatter.show)\n .on('mouseout', tipScatter.hide)\n .on('click', function(d) { addCountryScatter(d.ISO, addData=false); });\n \n // update x-axis\n svgScatter.select('.x.axis')\n .transition()\n .duration(750)\n .call(d3.svg.axis().scale(xScatter).orient('bottom').ticks(5));\n\n // update y-axis\n svgScatter.select('.y.axis')\n .transition()\n .duration(750)\n .call(d3.svg.axis().scale(yScatter).orient('left'));\n\n // remove old axis labels\n svgScatter.selectAll('.scatter-label').remove();\n\n // add new x-label\n svgScatter.select('.x')\n .append('text')\n .attr('class', 'scatter-label')\n .text(cleanText(scatterInternet))\n .attr('text-anchor', 'end')\n .attr('transform', 'translate(' + widthScatter + ',' + 40 +')');\n\n // add new y-label\n svgScatter.select('.y')\n .append('text')\n .attr('class', 'scatter-label')\n .text(cleanText(scatterHpi))\n .attr('text-anchor', 'end')\n .attr('transform', 'rotate(-90) translate(0,' + (-50) + ')');\n svgScatter.select('.scatter-legend').call(d3.legend.color().scale(colorScatter).labels(countryScatter));\n}", "title": "" }, { "docid": "4cf3ea5c77f9f642786995a5c1d10b46", "score": "0.5639883", "text": "function makeAmountSpentScatterPlot(data) {\n //console.log(\"Making Spent ScatterPlot: \" + JSON.stringify(data));\n $('#scatterplotcontainer').highcharts({\n title: {\n text: 'Average Amount Spent per Month',\n x: -20 //center\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n yAxis: {\n title: {\n text: 'Average Spent (USD)'\n },\n min: 0,\n plotLines: [{\n value: 0,\n width: 1,\n color: '#808080'\n }]\n },\n tooltip: {\n valuePrefix: '$'\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n },\n series: data\n });\n}", "title": "" }, { "docid": "ff0d5a3148e7a91d339424a32d045fce", "score": "0.5623434", "text": "function renderRegression(LinearReg, LinearRegdata,xLinearScale,yLinearScale) {\n\n LinearReg.datum(LinearRegdata)\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { \n // console.log('x',d.x);\n return ( xLinearScale(d.x));}) \n .y(function(d) { \n // console.log('y',d.yhat);\n return ( yLinearScale(d.yhat));}));\n return LinearReg;\n}", "title": "" }, { "docid": "db348945e3d0596d0e67c2ef625f299a", "score": "0.560677", "text": "function xy_plot(dat,canvas) { return scatter(dat,canvas,\"x\",\"y\");}", "title": "" }, { "docid": "e8960e15cb5519365a4e23366d1b35d2", "score": "0.55916625", "text": "function addTrend(runId, columnY) {\n var trendData = extractTrendLineData(runId, columnY);\n\n //create new trend\n var trend = timeSeriesTrendService.addTrend(runId, columnY, d3.scaleLinear(), d3.scaleLinear(), 'Time', columnY, trendData);\n //setup new trend range\n trend.scaleY.range([height, 0]);\n //setup new trends domains\n calculateYDomain(trend.scaleY, trend.data);\n calculateXDomain(x, trend.data);\n\n //if new trend added is the active trend reset offsetLine co-ordinates\n if (runId == activeColumn.getRun() && columnY == activeColumn.getColumn()) {\n\n offsetLine.xcoor = trend.data[0].x;\n offsetLine.ycoor = trend.data[0].y;\n }\n\n //create linear transition of 750 seconds \n var transition = d3.transition().duration(750).ease(d3.easeLinear);\n //rescale the axis to show the new trend\n graph.select('.axis--x').transition(transition).call(xAxis.scale(x));\n graph.select('.axis--y').transition(transition).call(yAxis.scale(trend.scaleY));\n\n //add new trend to the graph DOM\n var run = graph.select('.run-group')\n .selectAll('run')\n .data([trend])\n .enter().append('g')\n .attr('class', function (d) {\n var id = $filter('componentIdClassFilter')(d.id);\n var columnName = $filter('componentIdClassFilter')(d.yLabel);\n return 'run ' + id + ' ' + columnName;\n });\n\n var trendLength = (timeSeriesTrendService.getTrends().length - 1) % trendLineColours.length;\n var trendColour = trendLineColours[trendLength];\n\n //add trend data to the run \n run.append('path')\n .attr('class', 'line')\n .attr('d', function (trend) {\n var line = d3.line()\n .x(function (d) { return x(d.x); })\n .y(function (d) { return trend.scaleY(d.y); })\n return line(trend.data)\n })\n .style('stroke', trendColour)\n\n //transition the graph to show the new trend\n svg.call(zoom).transition()\n .call(zoom.transform, d3.zoomIdentity\n .scale(1)\n .translate(0, 0)\n )\n }", "title": "" }, { "docid": "3cbf5230c3c1a5df9e97d36f8797b5d8", "score": "0.55590034", "text": "function calcLinear(data, x, y, minX, minY){\r\n/////////\r\n//SLOPE//\r\n/////////\r\n\r\n// Let n = the number of data points\r\nvar n = data.length;\r\n\r\n// Get just the points\r\nvar pts = [];\r\ndata.forEach(function(d,i){\r\n var obj = {};\r\n obj.x = d[x];\r\n obj.y = d[y];\r\n obj.mult = obj.x*obj.y;\r\n pts.push(obj);\r\n});\r\n\r\n// Let a equal n times the summation of all x-values multiplied by their corresponding y-values\r\n// Let b equal the sum of all x-values times the sum of all y-values\r\n// Let c equal n times the sum of all squared x-values\r\n// Let d equal the squared sum of all x-values\r\nvar sum = 0;\r\nvar xSum = 0;\r\nvar ySum = 0;\r\nvar sumSq = 0;\r\npts.forEach(function(pt){\r\n sum = sum + pt.mult;\r\n xSum = xSum + pt.x;\r\n ySum = ySum + pt.y;\r\n sumSq = sumSq + (pt.x * pt.x);\r\n});\r\nvar a = sum * n;\r\nvar b = xSum * ySum;\r\nvar c = sumSq * n;\r\nvar d = xSum * xSum;\r\n\r\n// Plug the values that you calculated for a, b, c, and d into the following equation to calculate the slope\r\n// slope = m = (a - b) / (c - d)\r\nvar m = (a - b) / (c - d);\r\n\r\n/////////////\r\n//INTERCEPT//\r\n/////////////\r\n\r\n// Let e equal the sum of all y-values\r\nvar e = ySum;\r\n\r\n// Let f equal the slope times the sum of all x-values\r\nvar f = m * xSum;\r\n\r\n// Plug the values you have calculated for e and f into the following equation for the y-intercept\r\n// y-intercept = b = (e - f) / n\r\nvar b = (e - f) / n;\r\n\r\n// Print the equation below the chart\r\n//\tdocument.getElementsByClassName(\"equation\")[0].innerHTML = \"y = \" + m + \"x + \" + b;\r\n//\tdocument.getElementsByClassName(\"equation\")[1].innerHTML = \"x = ( y - \" + b + \" ) / \" + m;\r\n\r\n// return an object of two points\r\n// each point is an object with an x and y coordinate\r\nreturn {\r\n ptA : {\r\n x: minX,\r\n y: m * minX + b\r\n },\r\n ptB : {\r\n y: minY,\r\n x: (minY - b) / m\r\n }\r\n}\r\n\r\n}", "title": "" }, { "docid": "ed8c51d3921f24613c2dc4dddc900fc5", "score": "0.5530648", "text": "getPowerPoints(trendline, points, xValues, yValues, series, slopeInterceptPower) {\n const midPoint = Math.round((points.length / 2));\n const pts = [];\n let x1 = xValues[0] - trendline.backwardForecast;\n x1 = x1 > -1 ? x1 : 0;\n const y1 = slopeInterceptPower.intercept * Math.pow(x1, slopeInterceptPower.slope);\n const x2 = xValues[midPoint - 1];\n const y2 = slopeInterceptPower.intercept * Math.pow(x2, slopeInterceptPower.slope);\n const x3 = xValues[xValues.length - 1] + trendline.forwardForecast;\n const y3 = slopeInterceptPower.intercept * Math.pow(x3, slopeInterceptPower.slope);\n pts.push(this.getDataPoint(x1, y1, series, pts.length));\n pts.push(this.getDataPoint(x2, y2, series, pts.length));\n pts.push(this.getDataPoint(x3, y3, series, pts.length));\n return pts;\n }", "title": "" }, { "docid": "11197bfc3154fb0d4bd628f2ec5e2610", "score": "0.5522373", "text": "function getData() {\n var dropdownMenu = d3.select(\"#selDataset2\");\n // // Assign the value of the dropdown menu option to a variable\n var dataset2 = dropdownMenu.property(\"value\");\n // // Initialize an empty array for the country's data\n // var data = [];\n pricearray = []\n odometerarray = []\n data1.forEach(element => {\n if (element.Manufacturer == dataset2) {\n pricearray.push(element.Price)\n odometerarray.push(element.Odometer)\n }\n });\n console.log(pricearray)\n console.log(odometerarray)\n \n trace1 = {\n type: 'scatter',\n x: pricearray,\n y: odometerarray,\n mode: 'markers',\n //name: dataset2,\n //line: {\n // color: 'rgb(219, 64, 82)',\n // width: 3\n }\n \n }", "title": "" }, { "docid": "9c8ca211d83859cfb69a29170401893b", "score": "0.55054367", "text": "setLogarithmicRange(points, trendline, series) {\n const xLogValue = [];\n const yLogValue = [];\n const xPointsLgr = [];\n let index = 0;\n while (index < points.length) {\n const point = points[index];\n const xDataValue = point.xValue ? Math.log(point.xValue) : 0;\n xPointsLgr.push(point.xValue);\n xLogValue.push(xDataValue);\n yLogValue.push(point.yValue);\n index++;\n }\n const slopeIntercept = this.findSlopeIntercept(xLogValue, yLogValue, trendline, points);\n series.points = this.getLogarithmicPoints(trendline, points, xPointsLgr, yLogValue, series, slopeIntercept);\n }", "title": "" }, { "docid": "2a831d3cee5b046b39e67cfa1349e172", "score": "0.55013394", "text": "static linear_reg(points) {\n let x = [];\n let y = [];\n let i = 0;\n points.forEach((point) => {\n x[i] = point.x;\n y[i] = point.y;\n i++;\n });\n\n let a = anomaly_detection_util.cov(x,y) / anomaly_detection_util.var(x);\n let b = anomaly_detection_util.avg(y) - math.multiply(a, anomaly_detection_util.avg(x));\n\n return new line(a, b);\n }", "title": "" }, { "docid": "19e31359f70df8d37aa35060f4011d80", "score": "0.5485334", "text": "function drawTrend(data,heightFactor) {\n\tvar canvas = document.getElementById(\"trendGraph\");\n\tvar context = canvas.getContext(\"2d\");\n\tvar radius=4;\n\tcontext.fillStyle ='#00F';\n\tvar sum=0;\n\tfor(var j=0;j<data.length;j++){\n\t\tsum+=data[j][1];\n\t}\n\tcontext.font = \"14pt Calibri\";\n\tfor(var i=0;i<data.length;i++)\n\t{\n\t\tcontext.save();\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(150,220-data[0][1]*heightFactor+60);\n\t\tcontext.arc(150, 220-data[0][1]*heightFactor+60, radius, 0, 2 * Math.PI, false);\n\t\tcontext.fillText(data[0][1],142,220-data[0][1]*heightFactor-20+60);\n\t\tcontext.fillText(monthname[0],140,250+30);\n\t\tfor(var k=1;k<data.length;k++){\n\t\t\tcontext.arc(k*70+150, 220-data[k][1]*heightFactor+60, radius, 0, 2 * Math.PI, false);\n\t\t\tcontext.fillText(monthname[k],k*70+142,250+30);\t\t//draw month\n\t\t\tcontext.fillText(data[k][1],k*70+140,220-data[k][1]*heightFactor-20+60); //draw number\n\t\t\tcontext.lineTo(k*70+150,220-data[k][1]*heightFactor+60);\n\t\t}\n\t\tcontext.lineWidth=4;\n\t\tcontext.strokeStyle = \"blue\";\n\t\tcontext.lineWidth=1;\n\t\tcontext.stroke();\n\t\tcontext.restore();\n\t}\t\t\n}", "title": "" }, { "docid": "deb6eb48456410c0d69a328cd4fcc7b0", "score": "0.54733706", "text": "initTrendLines() {\n this.isProtectedOnChange = true;\n for (const series of this.visibleSeries) {\n let trendIndex = 0;\n for (const trendline of series.trendlines) {\n const trendLine = trendline;\n if (this.trendLineModule) {\n trendLine.index = trendIndex;\n trendLine.sourceIndex = series.index;\n this.trendLineModule.initSeriesCollection(trendLine, this);\n if (trendLine.targetSeries) {\n trendLine.targetSeries.xAxisName = series.xAxisName;\n trendLine.targetSeries.yAxisName = series.yAxisName;\n this.visibleSeries.push(trendLine.targetSeries);\n }\n }\n trendIndex++;\n }\n }\n this.isProtectedOnChange = false;\n }", "title": "" }, { "docid": "e619204dcaf29ba300f70c8fdcbe7efd", "score": "0.5469629", "text": "function plotDataPoints(){\n svg.selectAll(\".dot\")\n .data(datatorender)\n .enter().append(\"circle\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", 2.5) //specifying the radius of the circle/data point\n .attr(\"cx\", function(d) {\n return x(d.date); })\n .attr(\"cy\", function(d) {\n return y(d.yVal); })\n\t .style(\"opacity\", 1)\n\t .style(\"stroke\", \"none\")\n .style(\"fill\", function(d) { \n\t\treturn color(d.category);}) //giving color to the datapoints depending on the catagory\n\t\t.append(\"svg:title\")\n\t\t//shows date and exchange rate when mouse is placed on the dots \n\t\t.text(function(d) {\n\t\t\treturn (\"(\" + d.date + \" , \" + d.yVal + \")\");})\n\t\n}", "title": "" }, { "docid": "0290e2dd0a51e5df77377a33ae58b73f", "score": "0.5432635", "text": "function plotTraj(){\n var lineData={Player:[]}\n var N_player = simulated_traj[0].length/2\n //feed the location data of each trajectory\n for (var jj=0; jj< timestep;++jj){\n for (var ii=0; ii<N_player;++ii){\n if (jj==0) lineData.Player.push([])\n lineData.Player[ii].push({\"x\":simulated_traj[jj][ii*2]*scale+offsetX, \"y\": simulated_traj[jj][ii*2+1]*scale+offsetY})\n }\n }\n\n //add line component to the svg\n var lineFunction = d3.svg.line().x(function(d){return d.x;})\n .y(function(d){return d.y;})\n .interpolate(\"linear\");\n\n for (ii=0;ii<lineData.Player.length;++ii){\n if (lineData.Player[ii].length==0){\n continue\n }\n svg.append(\"path\")\n .attr(\"d\",lineFunction(lineData.Player[ii]))\n .attr(\"stroke\", colorList[ii])\n .attr(\"stroke-width\", 4)\n .attr(\"fill\", \"None\");\n }\n}", "title": "" }, { "docid": "02c79b5dd31a4dc7a7df6846b26fb2a8", "score": "0.5424858", "text": "function mousemoveScatter(d) {\n\t\tvar x0 = parseInt(x2.invert(d3.mouse(this)[0]));\n\t\tarr = Object.keys(runtimes_by_year).map(y => parseInt(y))\n\t\tvar i = d3.bisect(arr, x0);\n\t\tselectedData = Object.keys(runtimes_by_year)[i]\n\t\tfocus\n\t\t\t.attr(\"cx\", x2(selectedData))\n\t\t\t.attr(\"cy\", y2(runtimes_by_year[selectedData]))\n\t\tTooltipScatter\n\t\t\t.html(`<div><strong>Year:</strong> ${selectedData}</div>\n\t\t\t\t<div><strong>Number of Films:</strong> ${countyear[selectedData]}</div>\n\t\t\t\t<div><strong>Mean Duration:</strong> ${(Math.round(runtimes_by_year[selectedData] * 10) / 10).toFixed(1)} minutes</div>\n\t\t\t\t<div><strong>Std. Deviation:</strong> ${(Math.round(devs_by_year[selectedData] * 10) / 10).toFixed(1)} minutes</div>\n\t\t\t\t<div><strong>25<sup>th</sup> Percentile:</strong> ${(Math.round(low_by_year[selectedData] * 10) / 10).toFixed(1)} minutes</div>\n\t\t\t\t<div><strong>75<sup>th</sup> Percentile:</strong> ${(Math.round(high_by_year[selectedData] * 10) / 10).toFixed(1)} minutes</div>`)\n\t\t\t.style(\"left\", (d3.event.pageX - 200) + \"px\")\n\t\t\t.style(\"top\", (d3.event.pageY - 20) + \"px\")\n\t}", "title": "" }, { "docid": "917888c93b94adbfee63348371a032e5", "score": "0.54218394", "text": "function hgiScatter() {\n\n\n\n //// Properties\n var margin = {top: 20, right: 20, bottom: 40, left: 50},\n width = 425,\n height = 415,\n mapping = ['x','y'],\n xDomain = 0,\n yDomain = 0,\n addLOESS = false,\n xTicks, yTicks,\n xLabel, yLabel;\n\n\n\n //// D3 Helper functions\n // Scales\n var xScale = d3.scale.linear(),\n yScale = d3.scale.linear();\n\n // Axes\n var xAxis = d3.svg.axis().scale(xScale).orient(\"bottom\"),\n yAxis = d3.svg.axis().scale(yScale).orient(\"left\");\n\n\n\n //// Internal auxilary functions\n // Map data to x,y1,y2\n var xValue = function(d) { return d[mapping[0]]; },\n yValue = function(d) { return d[mapping[1]]; };\n\n\n\n //// Chart building function\n function chart(selection) {\n selection.each(function(data) {\n\n // DEBUG info\n if(DEBUG) {\n console.log('--hgiScatter');\n console.log('properties:');\n console.log({'margin': margin,'size':[width,height],'mapping':mapping,'xDomain':xDomain,'yDomain':yDomain,'addLOESS':addLOESS});\n console.log('selection:');\n console.log(selection);\n console.log('data:');\n console.log(data);\n }\n data = sortByKey(data, 'meetmoment');\n\n if(addLOESS) {\n data = sortByKey(data, mapping[0]);\n }\n\n // Convert data to nondeterministic array using mapping\n data = data.map(function(d, i) {\n return [xValue.call(data, d, i), yValue.call(data, d, i)];\n });\n\n if(DEBUG) {\n console.log('mapped data:');\n console.log(data);\n }\n\n\n // Update scales\n minX = d3.min(data, function(d) { return d[0]});\n maxX = d3.max(data,function(d) { return d[0];});\n margeX = (maxX-minX)/20;\n\n minY = d3.min(data, function(d) { return d[1]})\n maxY = d3.max(data, function(d) { return d[1]})\n margeY = (maxY-minY)/20;\n\n (xDomain==0) ? xScale.domain([minX-margeX,maxX+margeX]) : xScale.domain(xDomain);\n (yDomain==0) ? yScale.domain([minY-margeY,maxY+margeY]) : yScale.domain(yDomain);\n xScale.range([0, width - margin.left - margin.right]);\n yScale.range([height - margin.top - margin.bottom, 0]);\n\n // Update axis\n if(typeof xTicks != undefined) xAxis.ticks(xTicks);\n if(typeof yTicks != undefined) yAxis.ticks(yTicks);\n\n // Create SVG with data appended\n var svg = d3.select(this).selectAll(\"svg\").data([data]);\n var gChart = svg.enter().append(\"svg\").append(\"g\").attr(\"class\",\"scatter\");\n\n // Append chart with axes and lines\n gChart.append(\"g\").attr(\"class\", \"dots\");\n gChart.append(\"g\").attr(\"class\", \"x axis\");\n gChart.append(\"g\").attr(\"class\", \"y axis\");\n\n\n\n // Set chart width and height\n svg.attr({'width': width,'height':height});\n\n // Translate chart to adjust for margins\n var gChart = svg.select(\"g\")\n .attr(\"transform\",\"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n // Update the dots\n var gDots = gChart.select(\".dots\").selectAll(\".dot\").data(data.filter(function(d) { return (isNaN(d[0])||isNaN(d[1])||d[0]==null||d[1]==null) ? 0:1;})).enter();\n\n gDots.append(\"circle\")\n .attr(\"class\", \"bubble\")\n .attr(\"cx\", function(d) { return xScale(d[0]) })\n .attr(\"cy\", function(d) { return yScale(d[1]) })\n .attr(\"r\", 3.5);//function(d) { 3.5 })\n\n // LOESS fitted curve\n if(addLOESS) {\n\n // Render the fitted line\n gChart.append('path')\n .datum(function() {\n var loess = science.stats.loess();\n loess.bandwidth(0.7);\n\n var dataNARM = data.filter(function(d) { return (isNaN(d[0])||isNaN(d[1])||d[0]==null||d[1]==null) ? 0:1;});\n\n var xValues = dataNARM.map(function(d) { return xScale(d[0]); });\n var yValues = dataNARM.map(function(d) { return yScale(d[1]) });\n var yValuesSmoothed = loess(xValues, yValues);\n\n return d3.zip(xValues, yValuesSmoothed);\n })\n .attr('class', 'line')\n .attr('d', d3.svg.line()\n .interpolate('basis')\n .x(function(d) { return d[0]; })\n .y(function(d) { return d[1]; }));\n }\n\n // Axes\n if(typeof xAxis == 'function') {\n gChart.select(\".x.axis\")\n .attr(\"transform\",\"translate(0,\" + (height - margin.top - margin.bottom) + \")\")\n .call(xAxis);\n\n // Add x axis label\n if(typeof xLabel != undefined) {\n gChart.select(\".x.axis\")\n .append(\"text\")\n .attr(\"x\", (width-margin.left-margin.right)/2)\n .attr(\"y\", margin.bottom)\n .attr(\"dy\",\"-0.2em\")\n .style(\"text-anchor\",\"middle\")\n .text(xLabel);\n }\n }\n\n if(typeof yAxis == 'function') {\n // Draw y axis\n gChart.select(\".y.axis\")\n .call(yAxis);\n\n // Add y axis label\n if(typeof xLabel != undefined) {\n gChart.select(\".y.axis\")\n .append(\"text\")\n .attr(\"transform\",\"rotate(-90)\")\n .attr(\"x\", 0- ((height-margin.bottom-margin.top)/2) )\n .attr(\"y\", 0 - margin.left)\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\",\"middle\")\n .text(yLabel);\n }\n }\n\n\n });\n }\n\n\n // Getter setter methods\n chart.margin = function(_) { if (!arguments.length) {return margin;} margin = _; return chart; };\n chart.width = function(_) { if (!arguments.length) {return width;} width = _; return chart; };\n chart.height = function(_) { if (!arguments.length) {return height;} height = _; return chart; };\n chart.mapping = function(_) { if (!arguments.length) {return mapping;} mapping = _; return chart; };\n chart.xDomain = function(_) { if (!arguments.length) {return xDomain;} xDomain = _; return chart; };\n chart.yDomain = function(_) { if (!arguments.length) {return yDomain;} yDomain = _; return chart; };\n chart.legend = function(_) { if (!arguments.length) {return legend;} legend = _; return chart; };\n chart.xAxis = function(_) { if (!arguments.length) {return xAxis;} xAxis = _; return chart; };\n chart.yAxis = function(_) { if (!arguments.length) {return yAxis;} yAxis = _; return chart; };\n chart.addLOESS = function(_) { if (!arguments.length) {return addLOESS;} addLOESS = _; return chart; };\n chart.xTicks = function(_) { if (!arguments.length) {return xTicks;} xTicks = _; return chart; };\n chart.yTicks = function(_) { if (!arguments.length) {return yTicks;} yTicks = _; return chart; };\n chart.xLabel = function(_) { if (!arguments.length) {return xLabel;} xLabel = _; return chart; };\n chart.yLabel = function(_) { if (!arguments.length) {return yLabel;} yLabel = _; return chart; };\n\n\n\n return chart;\n}", "title": "" }, { "docid": "38ce28fc14e723edd3794fc2e6e7ee75", "score": "0.54171336", "text": "function drawScatterPlot(e){\r\n e.preventDefault();\r\n var newArray = generateData();\r\n\r\n //Just for fun, let's generate a new random color every time we draw a new scatter plot\r\n var r=Math.round(Math.random()*255),\r\n g=Math.round(Math.random()*255),\r\n b=255;\r\n var newColor = 'rgb('+r+','+g+','+b+')'; //e.g. \"rgb(100,100,100)\"\r\n\r\n //now onto the for loop\r\n for(var i = 0; i<numOfDataPoints; i++){\r\n scatterPlot.append('circle')\r\n .attr('class','data-point')\r\n .attr('r',3)\r\n .attr('cx',plotWidth/numOfDataPoints*i)\r\n .attr('cy',newArray[i])\r\n .style('fill',newColor);\r\n }\r\n}", "title": "" }, { "docid": "bd0e16bef9afb77f91a0e0217151b98e", "score": "0.5393896", "text": "setPowerRange(points, trendline, series) {\n const xValues = [];\n const yValues = [];\n const powerPoints = [];\n let index = 0;\n while (index < points.length) {\n const point = points[index];\n const xDataValue = point.xValue ? Math.log(point.xValue) : 0;\n const yDataValue = point.yValue ? Math.log(point.yValue) : 0;\n powerPoints.push(point.xValue);\n xValues.push(xDataValue);\n yValues.push(yDataValue);\n index++;\n }\n const slopeIntercept = this.findSlopeIntercept(xValues, yValues, trendline, points);\n series.points = this.getPowerPoints(trendline, points, powerPoints, yValues, series, slopeIntercept);\n }", "title": "" }, { "docid": "46421a284fc3b4f160221440d1530ae8", "score": "0.5380053", "text": "function drawScatterplot(){\n\t// calculate data\n\tdict_dataset_scatter = {};\n\tdict_dataset_scatter[data_1] = {};\n\tdict_dataset_scatter[data_2] = {};\n\tdataset_year.forEach(function(x) {\n\t\tdict_dataset_scatter[data_1][x[\"id\"]] = x[data_1];\n\t\tdict_dataset_scatter[data_2][x[\"id\"]] = x[data_2];\t\t\n\t});\t\n\t\n\t// Setup settings for graphic\t\n\t$(\"#scatterplot\").html(\"\");\n\tvar canvas_width = 600;\n\tvar canvas_height = 500;\n\tvar padding = 60; // for chart edges\n\n\t// Create scale functions\n\txScale = d3.scaleLinear() // xScale is width of graphic\n\t\t\t\t.domain([minVar1, maxVar1])\n\t\t\t\t.range([padding, canvas_width - padding * 2]); // output range\n\n\tyScale = d3.scaleLinear() // yScale is height of graphic\n\t\t\t\t.domain([minVar2, maxVar2])\n\t\t\t\t.range([canvas_height - padding, padding]); // remember y starts on top going down so we flip\n\n\t// Define X axis\n\txAxis = d3.axisBottom()\n\t\t\t\t.scale(xScale)\n\t\t\t\t.ticks(7);\n\n\t// Define Y axis\n\tyAxis = d3.axisLeft()\n\t\t\t\t.scale(yScale);\n\n\t// Create SVG element\n\tsvgScatterplot = d3.select(\"#scatterplot\") // This is where we put our vis\n\t.append(\"svg\")\n\t.attr(\"width\", canvas_width)\n\t.attr(\"height\", canvas_height)\n\t\n\t// add the tooltip area to the webpage\n\ttooltip = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n\t// Create Circles with mouse inteaction and tooltip\n\tsvgScatterplot.selectAll(\"circle\")\n\t\t.data(dataset_year)\n\t\t.enter()\n\t\t.append(\"circle\") // Add circle svg\n\t\t.attr(\"cx\", function(d) {\n\t\t\treturn xScale(d[data_1]); // Circle's X\n\t\t})\n\t\t.attr(\"cy\", function(d) { // Circle's Y\n\t\t\treturn yScale(d[data_2]);\n\t\t})\n\t\t.attr(\"id\", function(d) {\n\t\t\treturn \"scatter_\"+d.id;\n\t\t})\n\t\t.attr(\"class\", \"circle_scatter\")\n\t\t.attr(\"r\", 5)\n\t\t.on(\"mouseover\", function(d) {\n\t\t\td3.select(this)\n\t\t\t\t.transition()\n\t\t\t\t.duration(100)\n\t\t\t\t.style(\"fill\", function(d) {\n\t\t\t\t\tif(d.id != selected) { return \"red\"; }\n\t\t\t\t\telse { return \"#F57F17\"; }\n\t\t\t\t});\n \ttooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n tooltip.html(d[\"name\"] + \"<br/> (\" + dict_dataset_scatter[data_1][d.id]\n\t \t+ \", \" + dict_dataset_scatter[data_2][d.id]+ \")\")\n .style(\"left\", (d3.event.pageX + 5) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n })\n .on(\"mouseout\", function(d) {\n\t\t\td3.select(this)\n\t\t\t\t.transition()\n\t\t\t\t.duration(100)\n\t\t\t\t.style(\"fill\", function(d) {\n\t\t\t\t\tif(d.id != selected) { return \"black\"; }\n\t\t\t\t\telse { return \"#F57F17\"; }\n\t\t\t\t});\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0)\n\t\t})\n\t\t.on(\"click\", function(d) {\n\t for(var i in topodata)\n\t {\n\t if(topodata[i].id == d.id)\n\t {\n\t mouseClicked(topodata[i]);\n\t }\n\t }\n \t});\n\n\t// Add to X axis\n\tsvgScatterplot.append(\"g\")\n\t.attr(\"class\", \"x axis\")\n\t.attr(\"transform\", \"translate(0,\" + (canvas_height - padding) +\")\")\n\t.call(xAxis)\n\t.append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(\"x\", 250)\n\t.attr(\"y\", 30)\n .attr(\"dx\", \"0.71em\")\n .style(\"text-anchor\", \"end\")\n .text(metadata_labels[data_1] + \" →\");\n\n\t// Add to Y axis\n\tsvgScatterplot.append(\"g\")\n\t.attr(\"class\", \"y axis\")\n\t.attr(\"transform\", \"translate(\" + padding +\",0)\")\n\t.call(yAxis)\n\t.append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", -50)\n\t.attr(\"x\", -200)\n .attr(\"dy\", \"0.71em\")\n .style(\"text-anchor\", \"end\")\n .text(metadata_labels[data_2] + \" →\");\n}", "title": "" }, { "docid": "0c8debd31c62afe6e9a8651a7d165f30", "score": "0.53742695", "text": "createTrendLineElements(chart, trendline, index, element, clipRectElement) {\n trendline.trendLineElement = element;\n trendline.targetSeries.clipRectElement = clipRectElement;\n trendline.targetSeries.seriesElement = element;\n if (chart.trendLineElements) {\n chart.trendLineElements.appendChild(trendline.trendLineElement);\n }\n }", "title": "" }, { "docid": "552722e1146e2092fa6c335320d799fb", "score": "0.5363574", "text": "function ls_regression_slope(values_x, values_y) {\n\tvar sum_x = 0;\n\tvar sum_y = 0;\n\tvar sum_xy = 0;\n\tvar sum_xx = 0;\n\tvar count = 0;\n\t\n\t/*\n\t * We'll use those variables for faster read/write access.\n\t */\n\tvar x = 0;\n\tvar y = 0;\n\tvar values_length = values_x.length;\n\t\n\tif (values_length != values_y.length) {\n\t\tthrow new Error('The parameters values_x and values_y need to have same size!');\n\t}\n\t\n\t/*\n\t * Nothing to do.\n\t * LDP mod - Return 0. Consider an error state in the future.\n\t */\n\tif (values_length === 0) {\n\t\t// use this if you're interested in returning the line itself\n\t\t// return [[], []]\n\t\treturn 0;\n\t}\n\t\n\t/*\n\t* Calculate the sum for each of the parts necessary.\n\t*/\n\tfor (var v = 0; v < values_length; v++) {\n\t\tx = values_x[v];\n\t\ty = values_y[v];\n\t\tsum_x += x;\n\t\tsum_y += y;\n\t\tsum_xx += x*x;\n\t\tsum_xy += x*y;\n\t\tcount++;\n\t}\n\t\n\t/*\n\t * Calculate m and b for the formular:\n\t * y = x * m + b\n\t */\n\tvar m = (count*sum_xy - sum_x*sum_y) / (count*sum_xx - sum_x*sum_x);\n\treturn m;\n\t\n\t// use the following if you're interested in returning the line itself\n\t//var b = (sum_y/count) - (m*sum_x)/count;\n\t\t\n\t/*\n\t * We will make the x and y result line now\n\t */\n\t//var result_values_x = [];\n\t//var result_values_y = [];\n\t\n\t//for (var v = 0; v < values_length; v++) {\n\t//\tx = values_x[v];\n\t//\ty = x * m + b;\n\t//\tresult_values_x.push(x);\n\t//\tresult_values_y.push(y);\n\t//}\n\t\n\t//return [result_values_x, result_values_y];\n}", "title": "" }, { "docid": "e24d7a7040908cc9f45ef47335b53155", "score": "0.5360867", "text": "initDataSource(trendline) {\n const points = trendline.points;\n if (points && points.length) {\n //prepare data\n const trendlineSeries = trendline.targetSeries;\n switch (trendline.type) {\n case 'Linear':\n this.setLinearRange(points, trendline, trendlineSeries);\n break;\n case 'Exponential':\n this.setExponentialRange(points, trendline, trendlineSeries);\n break;\n case 'MovingAverage':\n this.setMovingAverageRange(points, trendline, trendlineSeries);\n break;\n case 'Polynomial':\n this.setPolynomialRange(points, trendline, trendlineSeries);\n break;\n case 'Power':\n this.setPowerRange(points, trendline, trendlineSeries);\n break;\n case 'Logarithmic':\n this.setLogarithmicRange(points, trendline, trendlineSeries);\n break;\n }\n if (trendline.type !== 'Linear' && trendline.type !== 'MovingAverage') {\n trendlineSeries.chart.splineSeriesModule.findSplinePoint(trendlineSeries);\n }\n }\n }", "title": "" }, { "docid": "9cdf61d84e85d90c707de773d9734483", "score": "0.53593826", "text": "function buildLinesScatterPlot() {\n // Clear an existing plot\n jQuery('#lines-scatter-plot').html('');\n\n // set the dimensions and margins of the graph\n var margin = {top: 10, right: 10, bottom: 10, left: 10},\n width = jQuery('#plots').width() - margin.left - margin.right,\n height = jQuery(window).height() - 500 - margin.top - margin.bottom;\n\n // append the svg object to the body of the page\n svg_lines = d3.select(\"#lines-scatter-plot\")\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\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n // Brushing code referenced from https://www.d3-graph-gallery.com/graph/interactivity_brush.html#changecss\n // Add brushing\n linesBrush = d3.brush() // Add the brush feature using the d3.brush function\n .extent( [ [0,0], [width,height] ] ) // initialise the brush area: start at 0,0 and finishes at width,height: it means I select the whole graph area\n .on(\"start brush\", updateChartBrushing) // Each time the brush selection changes, trigger the 'updateChartBrushing' function\n svg_lines.call( linesBrush )\n\n // Function that is triggered when brushing is performed\n function updateChartBrushing() {\n extent = d3.event.selection\n myCircle_lines.classed(\"selected-scatter-point\", function(d){ return isBrushed(extent, x(d.x), y(d.y), d ) } )\n }\n\n // A function that return TRUE or FALSE according if a dot is in the selection or not\n // Also handles highlighting text in the lyrics block\n function isBrushed(brush_coords, cx, cy, datum) {\n if (brush_coords == null) { return false; }\n var x0 = brush_coords[0][0],\n x1 = brush_coords[1][0],\n y0 = brush_coords[0][1],\n y1 = brush_coords[1][1];\n\n let line_ind = String(datum.line_index_in_song);\n let song_ind = String(datum.song_index);\n let selector = 'div.lyric-line[line_index=\"' + line_ind + '\"][song_index=\"' + song_ind + '\"]';\n\n // If brushed, do stuff\n if (x0 <= cx && cx <= x1 && y0 <= cy && cy <= y1) {\n jQuery(selector).addClass('selected-in-scatter-plot');\n } else {\n jQuery(selector).removeClass('selected-in-scatter-plot');\n }\n\n return x0 <= cx && cx <= x1 && y0 <= cy && cy <= y1; // This return TRUE or FALSE depending on if the points is in the selected area\n }\n\n // Get the varuables to use in the scatter plot\n let x_var = jQuery('#x-var-lines-select option:selected').val();\n let y_var = jQuery('#y-var-lines-select option:selected').val();\n\n // Get the data ready\n let data = JSON.parse(JSON.stringify(lines0.concat(lines1))); // Copy lyrics object\n data.forEach(function(a) { a['x'] = a[x_var]; });\n data.forEach(function(a) { a['y'] = a[y_var]; });\n\n // // Add X axis\n var x = d3.scaleLinear()\n .domain(d3.extent(data, function(d) { return +d.x; }))\n .range([ 0, width ]);\n // var xAxis = svg_lines.append(\"g\")\n // .attr(\"transform\", \"translate(0,\" + height + \")\")\n // .call(d3.axisBottom(x));\n\n // // Add Y axis\n var y = d3.scaleLinear()\n .domain(d3.extent(data, function(d) { return +d.y; }))\n .range([ height, 0]);\n // var yAxis = svg_lines.append(\"g\")\n // .call(d3.axisLeft(y));\n\n // Add a tooltip div. Here I define the general feature of the tooltip: stuff that do not depend on the data point.\n // Its opacity is set to 0: we don't see it by default.\n var tooltip = d3.select(\"#lines-scatter-plot\")\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"background-color\", \"white\")\n .style(\"border\", \"solid\")\n .style(\"border-width\", \"1px\")\n .style(\"border-radius\", \"5px\")\n .style(\"width\", \"12em\")\n .style(\"padding\", \"10px\")\n\n\n // Tool tip example from https://www.d3-graph-gallery.com/graph/scatter_tooltip.html\n // A function that change this tooltip when the user hover a point.\n // Its opacity is set to 1: we can now see it. Plus it set the text and position of tooltip depending on the datapoint (d)\n var mouseoverlines = function(d) {\n tooltip.style(\"opacity\", 1)\n }\n var mousemovelines = function(d) {\n tooltip.html(d.line_original)\n .style(\"left\", (d3.mouse(this)[0]-40) + \"px\") // It is important to put the +90: other wise the tooltip is exactly where the point is an it creates a weird effect\n .style(\"top\", (d3.mouse(this)[1]+40) + \"px\")\n }\n // A function that change this tooltip when the leaves a point: just need to set opacity to 0 again\n var mouseleavelines = function(d) {\n tooltip.style(\"opacity\", 0)\n }\n\n // // Add X axis label:\n // svg_lines.append(\"text\")\n // .attr(\"text-anchor\", \"end\")\n // .attr(\"x\", width/2 + margin.left)\n // .attr(\"y\", height + margin.top + 20)\n // .attr('fill', '#000')\n // // .text('Line Positivity');\n // .text(x_var);\n // // Y axis label:\n // svg_lines.append(\"text\")\n // .attr(\"text-anchor\", \"end\")\n // .attr(\"transform\", \"rotate(-90)\")\n // .attr(\"y\", -margin.left + 20)\n // .attr(\"x\", -margin.top - height/2 + 20)\n // .attr('fill', '#000')\n // // .text('Word Positivity');\n // .text(y_var);\n\n // Add dots\n myCircle_lines = svg_lines.append('g')\n .selectAll(\"dot\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", function (d) { return x(d.x); } )\n .attr(\"cy\", function (d) { return y(d.y); } )\n .attr(\"r\", 5)\n .style(\"fill\", function (d) { return d.song_index == 0 ? \"#69b3a280\" : \"#9869b380\"; })\n .on(\"mouseover.tooltip\", mouseoverlines )\n .on(\"mousemove.tooltip\", mousemovelines )\n .on(\"mouseleave.tooltip\", mouseleavelines )\n .on('click', function(d, i) {\n let selector = 'div.lyric-line[line_classified=\"' + d.line_classified + '\"]'\n if (d3.select(this).attr('class') == 'selected-scatter-point') {\n // Un select\n jQuery(selector).removeClass('selected-in-scatter-plot');\n d3.select(this).attr('class', '');\n } else {\n // select\n jQuery(selector).addClass('selected-in-scatter-plot');\n d3.select(this).attr('class', 'selected-scatter-point');\n }\n });\n}", "title": "" }, { "docid": "733f9c62ba841e72bc54350fbd74fba9", "score": "0.5358347", "text": "function plot(params) {\n\t//create the axis\n\tthis.append(\"g\")\n\t\t\t.classed(\"x axis\", true)\n\t\t\t.attr(\"transform\", \"translate(0, \" + height + \")\")\n\t\t\t.call(params.axis.x);\n\tthis.append(\"g\")\n\t\t\t.classed(\"y axis\", true)\n\t\t\t.attr(\"transform\", \"translate(0, 0)\")\n\t\t\t.call(params.axis.y);\n\n\t//enter\n\t\t//area\n\t\tthis.selectAll(\".area\")\n\t\t\t\t\t.data([params.data])\n\t\t\t\t\t.enter()\n\t\t\t\t\t\t.append(\"path\")\n\t\t\t\t\t\t.classed(\"area\", true);\n\t\t//path\n\t\tthis.selectAll(\".trendline\")\n\t\t\t\t\t.data([params.data])\n\t\t\t\t\t.enter()\n\t\t\t\t\t\t.append(\"path\")\n\t\t\t\t\t\t.classed(\"trendline\", true);\n\t\t//circle\n\tthis.selectAll(\".point\")\n\t\t\t.data(params.data)\n\t\t\t.enter()\n\t\t\t\t.append(\"circle\")\n\t\t\t\t.classed(\"point\", true)\n\t\t\t\t.attr(\"r\", 2);\n\n\t//update\n\tthis.selectAll(\".area\")\n\t\t\t.attr(\"d\", function(d) {\n\t\t\t\treturn area(d);\n\t\t\t})\n\n\tthis.selectAll(\".trendline\")\n\t\t\t.attr(\"d\", function(d) {\n\t\t\t\treturn line(d);\n\t\t\t})\n\n\tthis.selectAll(\".point\")\n\t\t\t.attr(\"cx\", function(d) {\n\t\t\t\tvar date = datePaser(d.date);\n\t\t\t\treturn x(date);\n\t\t\t})\n\t\t\t.attr(\"cy\", function(d) {\n\t\t\t\treturn y(d.value);\n\t\t\t})\n\n\t//exit\n\tthis.selectAll(\".area\")\n\t\t\t.data([params.data])\n\t\t\t.exit()\n\t\t\t.remove();\n\n\tthis.selectAll(\".trendline\")\n\t\t\t.data([params.data])\n\t\t\t.exit()\n\t\t\t.remove();\n\n\tthis.selectAll(\".point\")\n\t\t\t.data(params.data)\n\t\t\t.ext()\n\t\t\t.remove();\n}", "title": "" }, { "docid": "7a74ee7d358296fb0b57b84ed11bdc12", "score": "0.5352137", "text": "function School_Pillar_trends(\n school,\n pillar1Score,\n pillar2Score,\n pillar3Score,\n pillar4Score,\n inspections\n) {\n if (trendChart) {\n trendChart.destroy();\n }\n\n var trendChart = new Chart(document.getElementById(\"line-chart\"), {\n type: \"line\",\n data: {\n labels: inspections,\n datasets: [\n {\n data: [8, 14, 22, 30, 32],\n label: \"hide\",\n borderColor: \"#00000000\",\n fill: false,\n lineTension: 0,\n pointStyle: \"line\"\n },\n {\n data: pillar1Score,\n label: \"Pillar 1\",\n borderColor: \"#e41a1c\",\n fill: false,\n lineTension: 0,\n pointStyle: \"line\"\n },\n {\n data: pillar2Score,\n label: \"Pillar 2\",\n borderColor: \"#377eb8\",\n fill: false,\n lineTension: 0,\n pointStyle: \"line\"\n },\n {\n data: pillar3Score,\n label: \"Pillar 3\",\n borderColor: \"#4daf4a\",\n fill: false,\n lineTension: 0,\n pointStyle: \"line\"\n },\n {\n data: pillar4Score,\n label: \"Pillar 4\",\n borderColor: \"#984ea3\",\n fill: false,\n lineTension: 0,\n pointStyle: \"line\"\n }\n ]\n },\n options: {\n title: {\n display: true,\n text: school\n },\n scales: {\n xAxes: [\n {\n display: true,\n scaleLabel: {\n display: false,\n labelString: \"Term\"\n }\n }\n ],\n yAxes: [\n {\n display: true,\n scaleLabel: {\n display: true,\n labelString: \"Grade\"\n },\n ticks: {\n // min: 0,\n // max: 5,\n stepSize: 10,\n // suggestedMin: 0,\n // suggestedMax: 15,\n callback: function(label, index, labels) {\n if (label < 1) {\n return \"\";\n } else if (label <= 16) {\n return \"D\";\n } else if (label > 16 && label < 28) {\n return \"C\";\n } else if (label > 28 && label < 32) {\n return \"B\";\n } else if (label >= 32) {\n return \"A\";\n } else if (label < 1) {\n return \"\";\n }\n }\n },\n gridLines: {\n display: true\n }\n }\n ]\n },\n legend: {\n display: true,\n position: \"bottom\",\n labels: {\n // fontColor: '#FFA500'\n filter: function(item, chart) {\n // Logic to remove a particular legend item goes here\n return !item.text.includes(\"hide\");\n }\n }\n }\n }\n });\n\n $(document).on(\"change\", \"#pillarsTrend\", function() {\n // console.log($(this).val());\n // Does some stuff and logs the event to the console\n\n if ($(this).val() === \"0\") {\n trendChart.data.datasets[0].data = trendPlot[0][0];\n trendChart.data.datasets[0].label = \"Pillar 1\";\n } else if ($(this).val() === \"1\") {\n trendChart.data.datasets[0].data = trendPlot[0][1];\n trendChart.data.datasets[0].label = \"Pillar 2\";\n } else if ($(this).val() === \"2\") {\n trendChart.data.datasets[0].data = trendPlot[0][2];\n trendChart.data.datasets[0].label = \"Pillar 3\";\n } else if ($(this).val() === \"3\") {\n trendChart.data.datasets[0].data = trendPlot[0][3];\n trendChart.data.datasets[0].label = \"Pillar 4\";\n } else if ($(this).val() === \"4\") {\n trendChart.data.datasets[0].data = trendPlot[0][4];\n trendChart.data.datasets[0].label = \"Pillar Summary\";\n }\n\n trendChart.update();\n });\n}", "title": "" }, { "docid": "9d5531f4e527d32a256c7aac096c7dc0", "score": "0.53519523", "text": "function prepareLineTooltip(e) {\n if (pointValues.length === 0) {\n return;\n }\n\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 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 Array.prototype.forEach.call(pointElements, function (point) {\n yPositions.push(point.getAttribute(\"y1\"));\n });\n closestPointOnY = getClosestNumberFromArray(currentYPosition, yPositions);\n pointElement = chart.container.querySelector(\".\" + chart.options.classNames.point + '[x1=\"' + closestPointOnX + '\"][y1=\"' + closestPointOnY + '\"]');\n }\n\n if (!pointElement || hoveredElement === pointElement) {\n return;\n }\n\n if (hoveredElement) {\n options.onMouseLeave(Object.assign({}, e, {\n target: hoveredElement\n }));\n }\n\n hoveredElement = pointElement;\n var seriesName = pointElement.parentNode.getAttribute(\"ct:series-name\");\n var seriesGroups = Array.prototype.slice.call(pointElement.parentNode.parentNode.children);\n var seriesIndex = options.dataDrawnReversed ? seriesGroups.reverse().indexOf(pointElement.parentNode) : seriesGroups.indexOf(pointElement.parentNode);\n var valueGroup = Array.prototype.slice.call(pointElement.parentNode.querySelectorAll(\".\" + getDefaultTriggerClass()));\n var valueIndex = valueGroup.indexOf(pointElement); // clone the series array\n\n var seriesData = chart.data.series.slice(0);\n seriesData = chart.options.reverseData ? seriesData.reverse()[seriesIndex] : seriesData[seriesIndex];\n seriesData = !Array.isArray(seriesData) && _typeof(seriesData) == \"object\" && seriesData.data ? seriesData.data : seriesData;\n\n if (!seriesData) {\n return;\n }\n\n var itemData = !Array.isArray(seriesData) && _typeof(seriesData) == \"object\" ? seriesData : seriesData[valueIndex];\n\n if (itemData == null) {\n return;\n }\n\n options.onMouseEnter(Object.assign({}, e, {\n target: pointElement\n }), itemData.hasOwnProperty(\"value\") ? {\n meta: itemData.meta,\n value: itemData.value\n } : itemData);\n }", "title": "" }, { "docid": "75107874fd5fa6f47feb5d34d3fdc2dd", "score": "0.5351493", "text": "function rating_scatter_plot(\n svg, data, f1, f2, bucket_fn, model_fn,\n title_text, x_text, y_text) {\n var rightMargin = 20; // seperate in case we add a y2 axis label.\n var margin = {top: 25, right: rightMargin, bottom: 50, left: 60};\n var width = svg.node().getBoundingClientRect().width -\n margin.left - margin.right;\n var height = svg.node().getBoundingClientRect().height -\n margin.bottom - margin.top;\n\n graph_group = svg.append('g')\n .attr('width', width)\n .attr('height', height - margin.top - margin.bottom)\n .attr('transform', translate(margin.left, margin.top));\n\n graph_group.append('rect')\n .attr('width', width)\n .attr('height', height)\n .attr('fill', '#fff');\n\n var tool_tip = d3.tip()\n .attr('class', 'd3-tip scatter-text')\n .offset([8, 0])\n .direction('s')\n .html((d) => 'Model ' + model_fn(d) + ' ranking: ' + Math.round(f1(d)));\n\n function add_dots_and_bars(group, points, x, y, funct, error_funct, colorScale, size) {\n var entering = group.selectAll('scatter-point')\n .data(points)\n .enter();\n\n var g = entering\n .append('g')\n .attr('transform', (d) => translate(x(model_fn(d)), y(funct(d))))\n .call(tool_tip);\n\n g.append('circle')\n .attr('r', size)\n .attr('fill', (d) => colorScale(funct(d)));\n g.append('circle')\n .attr('r', 6)\n .attr('fill-opacity', 0)\n .attr('x', '20px')\n .attr('y', '5px')\n .on('mouseover', function(e) {\n tool_tip.show(e);\n setTimeout(tool_tip.hide, 3000);\n });\n\n if (error_funct) {\n var error_shift = function(d) {\n // NOTE: y heads DOWN the screen.\n return y(0) - y(error_funct(d))\n }\n var negative_error_shift = function(d) {\n return -error_shift(d);\n }\n var visibility = function(d) {\n return Math.abs(error_shift(d)) > 10 ? \"visible\" : \"hidden\";\n };\n var add_line = function(class_name, x1, y1, x2, y2) {\n g.append('line')\n .attr('class', class_name)\n .attr('stroke', (d) => colorScale(funct(d)))\n .attr('x1', x1)\n .attr('y1', y1)\n .attr('x2', x2)\n .attr('y2', y2)\n .attr('visibility', visibility);\n };\n\n add_line('error-line', '0', error_shift, '0', negative_error_shift);\n\n var x_scale = x(1) - x(0);\n add_line('', x_scale, error_shift,\n -x_scale, error_shift);\n add_line('', x_scale, negative_error_shift,\n -x_scale, negative_error_shift);\n }\n }\n\n // Scale the range of the data\n var x = d3.scaleLinear().range([0, width]);\n x.domain(d3.extent(data, model_fn));\n\n var y1;\n if (f1) {\n // Consider adding a little cushion to y1 if error bars are on.\n y1 = d3.scaleLinear()\n .domain(d3.extent(data, f1))\n .range([height, 0]);\n\n var colorScale = d3.scaleQuantile()\n .domain(data.map(f1))\n .range(['#F00', '#B00', '#222', '#2B2', '#2F2']);\n\n var bucket_data = d3.nest()\n .key(bucket_fn)\n .entries(data);\n\n var bucket_color = d3.schemeCategory10;\n var solo = bucket_data.length == 1;\n\n bucket_data.forEach(function(d, i) {\n var color = bucket_color[i];\n\n var bucket_group = graph_group\n .append('g')\n .attr('class', 'bucket-' + d.key);\n\n add_dots_and_bars(\n bucket_group,\n d.values,\n x, y1,\n f1, f2,\n solo ? colorScale : () => color,\n solo ? 3 : 1);\n\n var trailing_avg_data = add_weighted_average(\n bucket_group,\n d.values.filter(function(d) { return model_fn(d) > 10; }),\n model_fn, f1,\n x, y1,\n solo ? '#111' : color);\n });\n\n // Add legend.\n if (!solo) {\n var legend = graph_group.append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"height\", 100)\n .attr(\"width\", 100)\n .attr('transform', 'translate(20, 10)')\n\n legend.selectAll('rect')\n .data(bucket_data)\n .enter()\n .append(\"rect\")\n .attr(\"x\", 20)\n .attr(\"y\", (d, i) => height - i * 20 - 50)\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .style(\"fill\", (d, i) => bucket_color[i]);\n\n legend.selectAll('text')\n .data(bucket_data)\n .enter()\n .append(\"text\")\n .attr(\"x\", 35)\n .attr(\"y\", (d, i) => height - i * 20 - 40)\n .text((d) => d.key)\n .style(\"fill\", (d, i) => bucket_color[i])\n .on(\"click\", function(d) {\n var toggled = d.active == 0 ? 1 : 0;\n d.active = toggled;\n d3.selectAll(\".bucket-\" + d.key)\n .transition()\n .duration(500)\n .style(\"opacity\", toggled);\n });\n\n var active = 1;\n legend\n .append(\"text\")\n .attr(\"x\", 35)\n .attr(\"y\", height - 20)\n .text(\"click to toggle all\")\n .on(\"click\", function() {\n var toggled = active == 0 ? 1 : 0;\n active = toggled;\n d3.selectAll(\"[class^='bucket-'\")\n .transition()\n .duration(500)\n .style(\"opacity\", toggled);\n });\n }\n }\n\n add_labels(\n svg, margin, height, width,\n x, y1, false /* y2 */,\n x_text, y_text, title_text);\n}", "title": "" }, { "docid": "66681b8ea2fdb20793e57c385fd55cb7", "score": "0.5349318", "text": "function drawPoints(svg_scatterplot, coordPoints, xScale, yScale, gradientColorScale) {\n svg_scatterplot.selectAll(\"circle\")\n .data(coordPoints)\n .enter()\n .append(\"circle\")\n .attr(\"id\", function(d, i) {\n return \"scatterplot-city-\" + i;\n })\n .filter(function(d, i) {\n // filter according to division value\n if (division_value > 0) {\n return public_dataset[d.id].division == division_value;\n }\n // display all divisions\n else {\n return public_dataset[d.id].division;\n }\n \n })\n .attr(\"cx\", function (d,i){\n return xScale(d.x);\n })\n .attr(\"cy\", function (d,i){\n return yScale(d.y);\n })\n .attr(\"r\", 4)\n .attr(\"fill\", function(d, i) {\n return gradientColorScale(d.colorVal);\n })\n\n .attr(\"class\", \"unclicked\")\n\n .on(\"click\", scatterClickedFn)\n .on(\"mouseover\", scatterMouseOverFn)\n .on(\"mouseout\", scatterMouseOutFn);\n\n\n}", "title": "" }, { "docid": "4722b82595fdbc5f1fe4946f0b13d53a", "score": "0.53490424", "text": "function populateTrendsChartData() {\n\t\t$scope.eventTrendsCCO.series = [];\n\t\t/*angular.forEach($scope.eventsData, function(series, index) {\n\t\t\t$scope.eventTrendsCCO.series.push(series);\n\t\t});\t \t\n\t\t//console.log($scope.eventTrendsCCO.series);\n\t\t*/\n\t\tvar days = moment($scope.eventsTrend.dateRange.endDate).diff(moment($scope.eventsTrend.dateRange.startDate), 'days');\n for (var j = 0; j < $scope.events.length; j++) {\n var series = {'name': $scope.events[j].label, 'data':[], color: $scope.eventTrendsCCO.options.colors[j]};\n\t\t\tfor (var i = 0; i < days; i++) {\n\t\t\t\tvar d = moment($scope.eventsTrend.dateRange.startDate).add(i, 'days').unix()*1000;\n\t\t\t\tseries.data.push([d, getRandomIntFromInterval(3000, 15000)]);\n\t\t\t}\n $scope.eventTrendsCCO.series.push(angular.copy(series)); \n }\n\t\t$scope.eventTrendsCCO.options.chart.type = 'line';\n\t\t$scope.eventTrendsCCO.options.legend.enabled = true;\t\t\n\t\t$scope.eventTrendsCCO.options.chart.height = 500;\n\t}", "title": "" }, { "docid": "6f5ec3f97d3e21c308b34226800ba545", "score": "0.53481483", "text": "function processScatterTrendlines(trendGroup) {\r\n // Group contains one or more trendline pathItems\r\n var pCount = trendGroup.pathItems.length;\r\n for (var pNo = 0; pNo < pCount; pNo++) {\r\n setPathAttributes(trendGroup.pathItems[pNo]);\r\n }\r\n // Single trendline stands alone in content layer; otherwise move entire group\r\n if (pCount === 1) {\r\n trendGroup.pathItems[0].move(contentLayer, ElementPlacement.PLACEATBEGINNING);\r\n } else {\r\n trendGroup.move(contentLayer, ElementPlacement.PLACEATBEGINNING);\r\n }\r\n}", "title": "" }, { "docid": "37f4027b95d291ec0a6ca1e1873f4794", "score": "0.5332052", "text": "function appendPointCharts(){\n svg.selectAll('dot')\n .data(totalSales)\n .enter().append('circle')\n .style('fill','darkblue')\n .attr('r', 4.5)\n .attr('cx', d => x(d.month))\n .attr('cy', d =>y(d.sales))\n .on('mouseover',d=>{\n //Show the tooltip\n tooltip.transition()\t\t\n .duration(200)\t\t\n .style('opacity', .9);\n\n // Add text and position to tooltip\n tooltip.html(`<span>${d.sales}</span>`)\t\n .style('left', (d3.event.pageX) + 'px')\t\t\n .style('top', (d3.event.pageY - 28) + 'px');\n }).on('mouseout',d=>{\n //Hide the tooltip\n tooltip.transition()\t\t\n .duration(500)\n .style('opacity', 0);\n }).on('click',d=>{\n //Add the date in month and the sales to the detail\n detail.html(`${d.month.toLocaleString(\"en-us\", { month: \"long\" })}: ${d.sales}`)\n });\n}", "title": "" }, { "docid": "7558a8b3766d46526edf48fe4907d54f", "score": "0.53231555", "text": "function slr(data) {\n y_mean = d3.mean(data,function(d) {\n return +d.y;\n });\n \n x_mean = d3.mean(data,function(d) {\n return +d.x;\n });\n \n beta_num = d3.sum(data,function(d) {\n return (+d.x - x_mean) * (+d.y - y_mean);\n });\n \n beta_den = d3.sum(data,function(d) {\n return (+d.x - x_mean) * (+d.x - x_mean);\n });\n \n if (beta_den !== 0) {\n beta = beta_num / beta_den;\n }\n else {\n beta = 0;\n }\n \n alpha = y_mean - beta * x_mean;\n \n return data.map(function(d) {\n d.y_fit = alpha + beta * (+d.x);\n d.res = +d.y - d.y_fit;\n return d;\n });\n}", "title": "" }, { "docid": "c3dbdef81db3de1d30e95f219722427a", "score": "0.5322497", "text": "function makeScatterPlot(csvData) {\n data = csvData // assign data as global variable\n\n // get arrays of fertility rate data and life Expectancy data\n let defense_data = data.map((row) => parseFloat(row[\"sp_defense\"]));\n let total_data = data.map((row) => parseFloat(row[\"Total\"]));\n\n // find data limits\n let axesLimits = findMinMax(defense_data, total_data);\n\n // draw axes and return scaling + mapping functions\n let mapFunctions = drawAxes(axesLimits, \"sp_defense\", \"Total\");\n\n // plot data as points and add tooltip functionality\n plotData(mapFunctions);\n\n // draw title and axes labels\n makeLabels();\n\n drawLegend(data); \n }", "title": "" }, { "docid": "d57cbb6d4cce82f5f95b6586f436fa6c", "score": "0.5313559", "text": "function line(l) {\n l\n .attr(\"x1\",function(d){\n return d[vars.edges.source].d3plus.edges[d[vars.edges.target][vars.id.value]].x;\n })\n .attr(\"y1\",function(d){\n return d[vars.edges.source].d3plus.edges[d[vars.edges.target][vars.id.value]].y;\n })\n .attr(\"x2\",function(d){\n return d[vars.edges.target].d3plus.edges[d[vars.edges.source][vars.id.value]].x;\n })\n .attr(\"y2\",function(d){\n return d[vars.edges.target].d3plus.edges[d[vars.edges.source][vars.id.value]].y;\n });\n }", "title": "" }, { "docid": "1175fefe8c603cdb73c7591e938a4343", "score": "0.52921146", "text": "function PriceBookingscatterplot(body) {\n var margin = {left:60, right:50, top:50, bottom:100};\n var height = 490 - margin.top - margin.bottom,\n width = 500 - margin.left - margin.right;\n \n var svg = d3.select(body)\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 \n // The API for scales have changed in v4. There is a separate module d3-scale which can be used instead. The main change here is instead of d3.scale.linear, we have d3.scaleLinear.\n var xScale = d3.scaleLinear()\n .range([0, width]);\n \n var yScale = d3.scaleLinear()\n .range([height, 0]);\n \n // square root scale.\n var radius = d3.scaleSqrt()\n .range([2,5]);\n \n // the axes are much cleaner and easier now. No need to rotate and orient the axis, just call axisBottom, axisLeft etc.\n var xAxis = d3.axisBottom()\n .scale(xScale);\n \n var yAxis = d3.axisLeft()\n .scale(yScale);\n \n // again scaleOrdinal\n var color = d3.scaleOrdinal(d3.schemeCategory20);\n \n d3.csv('data_json/scatter_price_booking.csv', function(error, data){\n data.forEach(function(d){\n d.Bookings = +d.Bookings;\n d.Daily_price = +d.Daily_price;\n d.Size = +d.Size;\n d.Area = d.Area;\n });\n \n xScale.domain(d3.extent(data, function(d){\n return d.Bookings;\n })).nice();\n \n yScale.domain(d3.extent(data, function(d){\n return d.Daily_price;\n })).nice();\n \n radius.domain(d3.extent(data, function(d){\n return d.Size;\n })).nice();\n \n svg.append(\"text\")\n .attr(\"x\", (width / 2)) \n .attr(\"y\", 0 - (margin.top / 2))\n .attr(\"text-anchor\", \"middle\") \n .style(\"font-size\", \"16px\") \n .style(\"text-decoration\", \"none\") \n .text(\"Daily price VS Number of bookings (estimated)\");\n\n // adding axes is also simpler now, just translate x-axis to (0,height) and it's alread defined to be a bottom axis. \n svg.append('g')\n .attr('transform', 'translate(0,' + height + ')')\n .attr('class', 'x axis')\n .call(xAxis);\n \n // y-axis is translated to (0,0)\n svg.append('g')\n .attr('transform', 'translate(0,0)')\n .attr('class', 'y axis')\n .call(yAxis);\n \n \n var bubble = svg.selectAll('.bubble')\n .data(data)\n .enter().append('circle')\n .attr('class', 'bubble')\n .attr('cx', function(d){return xScale(d.Bookings);})\n .attr('cy', function(d){ return yScale(d.Daily_price); })\n .attr('r', function(d){ return radius(d.Size); })\n .style('fill', function(d){ return color(d.Area); });\n \n bubble.append('title')\n .attr('x', function(d){ return radius(d.Size); })\n .text(function(d){\n return d.Area;\n });\n \n // adding label. For x-axis, it's at (10, 10), and for y-axis at (width, height-10).\n svg.append('text')\n .attr('x', 10)\n .attr('y', 10)\n .attr('class', 'label')\n .text('Daily price');\n \n \n svg.append('text')\n .attr('x', width)\n .attr('y', height - 10)\n .attr('text-anchor', 'end')\n .attr('class', 'label')\n .text('Number of bookings (Estimated)');\n \n // I feel I understand legends much better now.\n // define a group element for each color i, and translate it to (0, i * 20). \n var legend = svg.selectAll('legend')\n .data(color.domain())\n .enter().append('g')\n .attr('class', 'legend')\n .attr('transform', function(d,i){ return 'translate(0,' + i * 20 + ')'; });\n \n // give x value equal to the legend elements. \n // no need to define a function for fill, this is automatically fill by color.\n legend.append('rect')\n .attr('x', width)\n .attr('width', 18)\n .attr('height', 18)\n .style('fill', color);\n \n // add text to the legend elements.\n // rects are defined at x value equal to width, we define text at width - 6, this will print name of the legends before the rects.\n legend.append('text')\n .attr('x', width - 6)\n .attr('y', 9)\n .attr('dy', '.2em')\n .style('text-anchor', 'end')\n .text(function(d){ return d; });\n \n \n // d3 has a filter fnction similar to filter function in JS. Here it is used to filter d3 components.\n legend.on('click', function(type){\n d3.selectAll('.bubble')\n .style('opacity', 0.15)\n .filter(function(d){\n return d.Area == type;\n })\n .style('opacity', 1);\n })\n \n \n })\n }", "title": "" }, { "docid": "ee839168449800737ddd7c279925235b", "score": "0.52858514", "text": "function initScatterPlot(Data, elevationData) {\n var name = getFilename(Data);\n var container = document.getElementById(name);\n var ctx = container.querySelector(\"canvas\");\n if (typeof ctx !== \"undefined\") {\n ctx.height = 150;\n ElevationChart = new Chart(ctx, {\n type: 'scatter',\n data: {\n datasets: [\n {\n label: null,\n data: elevationData,\n showLine: true,\n backgroundColor: \"rgba(0, 148, 50, 0.5)\",\n borderColor: \"rgba(0, 148, 50, 0.75)\",\n pointRadius: 0\n }\n ]\n },\n options: {\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n scaleLabel: {\n display: true,\n labelString: \"Elevation (m)\"\n },\n ticks: {\n callback: function(value, index, values) {\n return value.toLocaleString() + \"m\";\n }\n }\n }],\n xAxes: [{\n scaleLabel: {\n display: true,\n labelString: \"Distance (km)\"\n },\n ticks: {\n min: 0,\n max: parseFloat(ElevationData[ElevationData.length - 1].x)\n }\n }]\n },\n customLine: {\n color: '#009432'\n },\n legend: {\n display: false\n },\n tooltips: {\n mode: \"index\",\n intersect: false,\n callbacks: {\n label: function(tooltipItem, Data) {\n var latLng = [\n Data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index].lat,\n Data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index].lng\n\n ];\n ElevationMarker.setLatLng(latLng);\n var label = [\n \"Distance: \" + tooltipItem.xLabel + \"km\",\n \"Elevation: \" + tooltipItem.yLabel.toLocaleString() + \"m\"\n ];\n return label;\n }\n },\n custom: function( tooltip ) {\n if( tooltip.opacity > 0 ) {\n ElevationMarker.setOpacity(1);\n } else {\n ElevationMarker.setOpacity(0);\n }\n return;\n }\n }\n },\n plugins: [{\n beforeEvent: function(chart, e) {\n if ((e.type === 'mousemove')\n && (e.x >= e.chart.chartArea.left)\n && (e.x <= e.chart.chartArea.right)\n ) {\n chart.options.customLine.x = e.x;\n }\n },\n afterDraw: function(chart, easing) {\n var ctx = chart.chart.ctx;\n var chartArea = chart.chartArea;\n var x = chart.options.customLine.x;\n\n if (!isNaN(x)) {\n ctx.save();\n ctx.strokeStyle = chart.options.customLine.color;\n ctx.moveTo(chart.options.customLine.x, chartArea.bottom);\n ctx.lineTo(chart.options.customLine.x, chartArea.top);\n ctx.stroke();\n ctx.restore();\n }\n }\n }]\n });\n }\n\n}", "title": "" }, { "docid": "95e83a2b83d36b9769bb0ec01927d750", "score": "0.5278716", "text": "function line(year) {\n return d3.svg.line()\n .x(function(d) { return curve(plot(d, year)); })\n .y(function(d) {\n switch(d.name) {\n case \"Hamilton County High\":\n return y(d.name);\n case \"Lookout Mountain Elementary\":\n return y(d.name) + y.rangeBand();\n default:\n return y(d.name) + y.rangeBand() / 2;\n }\n })\n .interpolate(\"basis\");\n }", "title": "" }, { "docid": "255910a60fb1e14759f30700e4e1a549", "score": "0.5275003", "text": "function makeScatterPlot(csvData) {\n data = csvData // assign data as global variable\n \n\n // get arrays of fertility rate data and life Expectancy data\n let total_data = data.map((row) => parseFloat(row[\"Total\"]));\n let sp_data = data.map((row) => parseFloat(row[\"Sp. Def\"]));\n\n // find data limits\n let axesLimits = findMinMax(sp_data, total_data);\n\n // draw axes and return scaling + mapping functions\n let mapFunctions = drawAxes(axesLimits, \"Sp. Def\", \"Total\");\n\n // plot data as points and add tooltip functionality\n plotData(mapFunctions);\n\n // draw title and axes labels\n makeLabels();\n}", "title": "" }, { "docid": "9682a481d3772c49f984edf094c4f7f0", "score": "0.52732104", "text": "function plotLine(datapoints, xoffset, yoffset, axisx, axisy, forecastdata) {\n // End: HPE Elements code added new parameter(futuredata) - Different color for forecasts\n var points = datapoints.points,\n ps = datapoints.pointsize,\n prevx = null, prevy = null, forecastpoints = 0;\n\n // Start: HPE Elements code added - Different color for forecasts\n if(forecastdata) {\n forecastpoints = forecastdata.length * datapoints.pointsize;\n }\n // End: HPE Elements code added - Different color for forecasts\n\n ctx.beginPath();\n // Start: HPE Elements code added( minus(-) futurepoints) - Different color for forecasts\n for (var i = ps; i < points.length - forecastpoints; i += ps) {\n // End: HPE Elements code added( minus(-) futurepoints) - Different color for forecasts\n var x1 = points[i - ps], y1 = points[i - ps + 1],\n x2 = points[i], y2 = points[i + 1];\n\n if (x1 == null || x2 == null)\n continue;\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min) {\n if (y2 < axisy.min)\n continue; // line segment is outside\n // compute new intersection point\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n }\n else if (y2 <= y1 && y2 < axisy.min) {\n if (y1 < axisy.min)\n continue;\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max) {\n if (y2 > axisy.max)\n continue;\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n }\n else if (y2 >= y1 && y2 > axisy.max) {\n if (y1 > axisy.max)\n continue;\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min)\n continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n }\n else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min)\n continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max)\n continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n }\n else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max)\n continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (x1 != prevx || y1 != prevy)\n ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);\n\n prevx = x2;\n prevy = y2;\n ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);\n }\n // Start: HPE Elements code added - Different color for forecasts\n ctx.strokeStyle = series.color;\n ctx.stroke();\n if(series.forecastData) {\n ctx.closePath();\n\n ctx.beginPath();\n for (var i = points.length - forecastpoints -ps; i < points.length; i += ps) {\n var x1 = points[i - ps], y1 = points[i - ps + 1],\n x2 = points[i], y2 = points[i + 1];\n\n prevx = x2;\n prevy = y2;\n ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);\n }\n if(!series.forecastDashStyle) {\n series.forecastDashStyle = [5];\n }\n ctx.setLineDash(series.forecastDashStyle);\n ctx.strokeStyle = series.forecastColor;\n ctx.stroke();\n ctx.closePath();\n }\n // End: HPE Elements code added - Different color for forecasts\n }", "title": "" }, { "docid": "6c62372c1ceb62ce4d608ee65ad78424", "score": "0.52709305", "text": "setExponentialRange(points, trendline, series) {\n const xValue = [];\n const yValue = [];\n let index = 0;\n while (index < points.length) {\n const point = points[index];\n const yDataValue = point.yValue ? Math.log(point.yValue) : 0;\n xValue.push(point.xValue);\n yValue.push(yDataValue);\n index++;\n }\n const slopeIntercept = this.findSlopeIntercept(xValue, yValue, trendline, points);\n series.points = this.getExponentialPoints(trendline, points, xValue, yValue, series, slopeIntercept);\n }", "title": "" }, { "docid": "6bfc8e51726d0a493c220359b732f7f2", "score": "0.5261669", "text": "function regressionSlope(xx,yy) {\n\treturn jStat.covariance(xx,yy)/jStat.variance(xx);\n}", "title": "" }, { "docid": "a0207af8495a970d09a182ac038362f6", "score": "0.52515423", "text": "function visualize(theData) {\n var curX = \"poverty\";\n var curY = \"healthcare\";\n\n // save empty variables for our the min and max values of x and y\n var xMin;\n var xMax;\n var yMin;\n var yMax;\n\n\n\n // PART 2:\n // reducing some repitition from later code\n\n // a. change the min and max for x\n function xMinMax() {\n // min will grab the smallest datum \n xMin = d3.min(theData, function(d) {\n return parseFloat(d[curX]) * 0.90;\n });\n\n // .max will grab the largest datum \n xMax = d3.max(theData, function(d) {\n return parseFloat(d[curX]) * 1.10;\n });\n }\n\n // b. change the min and max for y\n function yMinMax() {\n // min will grab the smallest datum \n yMin = d3.min(theData, function(d) {\n return parseFloat(d[curY]) * 0.90;\n });\n\n // .max will grab the largest datum \n yMax = d3.max(theData, function(d) {\n return parseFloat(d[curY]) * 1.10;\n });\n }\n\n // Part 3: Incorporate the Scatter Plot\n // grab the min and max values of x and y.\n xMinMax();\n yMinMax();\n\n // With the min and max values now defined we can create our scales\n var xScale = d3\n .scaleLinear()\n .domain([xMin, xMax])\n .range([margin + labelArea, width - margin]);\n var yScale = d3\n .scaleLinear()\n .domain([yMin, yMax])\n .range([height - margin - labelArea, margin]);\n\n var xAxis = d3.axisBottom(xScale);\n var yAxis = d3.axisLeft(yScale);\n\n // We next append the axes in group elements\n svg\n .append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\"transform\", \"translate(0,\" + (height - margin - labelArea) + \")\");\n svg\n .append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + (margin + labelArea) + \", 0)\");\n\n // make a grouping for our dots and their labels\n var theCircles = svg.selectAll(\"g theCircles\").data(theData).enter();\n\n // We append the circles for each row of data\n theCircles\n .append(\"circle\")\n // These attr's specify location, size, and class\n .attr(\"cx\", function(d) {\n return xScale(d[curX]);\n })\n .attr(\"cy\", function(d) {\n return yScale(d[curY]);\n })\n .attr(\"r\", circRadius)\n .attr(\"class\", function(d) {\n return \"stateCircle \" + d.abbr;\n })}", "title": "" }, { "docid": "7ca788efec78da0fc758a01d95a5e009", "score": "0.5250449", "text": "function regressionPlots(regression, resid, data, opts, xrange, yrange,\n diagnostic, xlab, ylab, stats) {\n xlab = xlab || \"\";\n ylab = ylab || \"\";\n stats = stats || {};\n\n // Reset regression and resid in case they currently have any content.\n regression.text(\"\");\n resid.text(\"\");\n\n // Scales\n var xScale = d3.scale.linear()\n .domain(xrange)\n .range([opts.padding, opts.width - opts.padding]);\n var yScale = d3.scale.linear()\n .domain(yrange)\n .range([opts.padding, opts.height - opts.padding]);\n\n var xAxis = d3.svg.axis()\n .scale(xScale)\n .orient(\"bottom\")\n .ticks(5);\n var yAxis = d3.svg.axis()\n .scale(yScale)\n .orient(\"left\")\n .ticks(4);\n\n var minX = xScale.invert(opts.padding);\n var maxX = xScale.invert(opts.width - opts.padding);\n\n var svg = regression.append(\"svg\")\n .attr(\"width\", opts.width)\n .attr(\"height\", opts.height);\n var rsvg = resid.append(\"svg\")\n .attr(\"width\", opts.width)\n .attr(\"height\", opts.height);\n\n // Mouse behaviors\n var drag = d3.behavior.drag()\n .origin(function(d) { return {x: xScale(d[0]),\n y: yScale(d[1])}; })\n .on(\"drag\", dragmove);\n\n var dataHover = function(d, i) {\n d3.select(regression.selectAll(\"circle\")[0][i])\n .transition()\n .attr(\"r\", opts.hoverRadius)\n .attr(\"fill\", opts.hoverColor);\n d3.select(resid.selectAll(\"circle\")[0][i])\n .transition()\n .attr(\"r\", opts.hoverRadius)\n .attr(\"fill\", opts.hoverColor);\n };\n var dataHoverOut = function(d, i) {\n d3.select(regression.selectAll(\"circle\")[0][i])\n .transition()\n .attr(\"r\", opts.ptRadius)\n .attr(\"fill\", opts.ptColor);\n d3.select(resid.selectAll(\"circle\")[0][i])\n .transition()\n .attr(\"r\", opts.ptRadius)\n .attr(\"fill\", opts.ptColor);\n };\n\n function dragmove(d, i) {\n var mx = d3.event.x;\n var my = d3.event.y;\n\n d[0] = boundBetween(xScale.invert(mx), xrange[0], xrange[1]);\n d[1] = boundBetween(yScale.invert(my), yrange[1], yrange[0]);\n\n d3.select(this)\n .attr(\"cx\", xScale(d[0]))\n .attr(\"cy\", yScale(d[1]));\n\n var pts = regression.selectAll(\"circle\").data();\n var r = regress(pts, minX, maxX, diagnostic);\n setStats(r);\n\n svg.select(\"line\")\n .attr(\"x1\", xScale(minX))\n .attr(\"x2\", xScale(maxX))\n .attr(\"y1\", yScale(r.minY))\n .attr(\"y2\", yScale(r.maxY));\n\n var residData = makeResidData(pts, r.resids, diagnostic);\n\n rsvg.selectAll(\"circle\")\n .data(residData)\n .attr(\"cx\", function(d) { return rxScale(d[0]); })\n .attr(\"cy\", function(d) { return ryScale(d[1]); });\n }\n\n function setStats(r) {\n if (stats.r2 !== undefined) {\n stats.r2.text(r.r2.toPrecision(2));\n }\n if (stats.fstat !== undefined) {\n stats.fstat.text(r.F.toLocaleString(\"en-US\",\n {maximumSignificantDigits: 4}));\n }\n if (stats.fdf2 !== undefined) {\n stats.fdf2.text(data.length - 2);\n }\n if (stats.p !== undefined && stats.pdir !== undefined) {\n if (r.Fp <= 0.001) {\n stats.p.text(\"0.001\");\n stats.pdir.text(\"<\");\n } else {\n stats.p.text(r.Fp.toPrecision(2));\n stats.pdir.text(\"=\");\n }\n }\n if (stats.intercept !== undefined) {\n stats.intercept.text(r.intercept.toLocaleString(\"en-US\",\n {maximumSignificantDigits: 3}));\n }\n if (stats.slope !== undefined) {\n stats.slope.text(r.slope.toLocaleString(\"en-US\",\n {maximumSignificantDigits: 3}));\n }\n }\n\n // Draw data\n var r = regress(data, xScale.invert(opts.padding),\n xScale.invert(opts.width - opts.padding), diagnostic);\n setStats(r);\n\n svg.append(\"line\")\n .attr(\"x1\", xScale(minX))\n .attr(\"x2\", xScale(maxX))\n .attr(\"y1\", yScale(r.minY))\n .attr(\"y2\", yScale(r.maxY))\n .attr(\"class\", \"rline\");\n\n svg.append(\"g\")\n .attr(\"id\", \"data\")\n .selectAll(\"circle\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"r\", opts.ptRadius)\n .attr(\"cx\", function(d) { return xScale(d[0]); })\n .attr(\"cy\", function(d) { return yScale(d[1]); })\n .attr(\"fill\", opts.ptColor)\n .attr(\"stroke\", opts.ptBorderColor)\n .attr(\"stroke-width\", \"0.5px\")\n .attr(\"class\", \"datapt\")\n .on(\"mouseover\", dataHover)\n .on(\"mouseout\", dataHoverOut)\n .call(drag);\n\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0, \" + (opts.height - opts.padding + 5) + \")\")\n .call(xAxis);\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + opts.padding + \", 0)\")\n .call(yAxis);\n\n // Add axes labels\n svg.append(\"text\")\n .attr(\"class\", \"x label\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"x\", opts.width - opts.padding)\n .attr(\"y\", opts.height - opts.padding)\n .text(xlab);\n\n svg.append(\"text\")\n .attr(\"class\", \"y label\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"y\", opts.padding)\n .attr(\"x\", -opts.padding)\n .attr(\"dy\", \"1em\")\n .attr(\"transform\", \"rotate(-90)\")\n .text(ylab);\n\n // Now for residuals!\n var ryScale, rxScale;\n var residRange = 1.5 * d3.max(r.resids, Math.abs);\n if (diagnostic === \"cooks\" || diagnostic === \"leverage\") {\n // Leverage is bounded between 0 and 1, and 1 is a common cutoff for\n // outlying points when using Cook's distance, so make sure the scale\n // includes [0,1].\n ryScale = d3.scale.linear()\n .domain([Math.max(1, residRange), 0])\n .range([opts.padding, opts.height - opts.padding])\n .nice();\n rxScale = xScale;\n } else if (diagnostic === \"rstandard\" || diagnostic === \"residuals\" ||\n diagnostic === \"rstudent\") {\n ryScale = d3.scale.linear()\n .domain([residRange, -residRange])\n .range([opts.padding, opts.height - opts.padding])\n .nice();\n rxScale = xScale;\n } else if (diagnostic === \"qqnorm\") {\n ryScale = d3.scale.linear()\n .domain([3, -3])\n .range([opts.padding, opts.height - opts.padding])\n .nice();\n rxScale = d3.scale.linear()\n .domain([-3, 3])\n .range([opts.padding, opts.width - opts.padding])\n .nice();\n }\n\n var rxAxis = d3.svg.axis()\n .scale(rxScale)\n .orient(\"bottom\")\n .ticks(4);\n\n var ryAxis = d3.svg.axis()\n .scale(ryScale)\n .orient(\"left\")\n .ticks(4);\n\n rsvg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0, \" + (opts.height - opts.padding + 5) + \")\")\n .call(rxAxis);\n\n rsvg.append(\"g\")\n .attr(\"class\", \"axis ry\")\n .attr(\"transform\", \"translate(\" + opts.padding + \", 0)\")\n .call(ryAxis);\n\n // Horizontal line at y = 0. Not needed for Cook's distance, Q-Q,\n // and leverage\n if (diagnostic !== \"cooks\" && diagnostic !== \"leverage\" &&\n diagnostic !== \"qqnorm\") {\n rsvg.append(\"line\")\n .attr(\"x1\", rxScale(minX))\n .attr(\"x2\", rxScale(maxX))\n .attr(\"y1\", ryScale(0))\n .attr(\"y2\", ryScale(0))\n .attr(\"class\", \"rline\");\n }\n if (diagnostic === \"qqnorm\") {\n // Add a diagonal line at y = x.\n rsvg.append(\"line\")\n .attr(\"x1\", rxScale(-3))\n .attr(\"x2\", rxScale(3))\n .attr(\"y1\", ryScale(-3))\n .attr(\"y2\", ryScale(3))\n .attr(\"class\", \"rline\");\n }\n if (diagnostic === \"rstudent\") {\n // Add outlier test lines.\n var outline = outlierLine(data.length);\n rsvg.append(\"line\")\n .attr(\"x1\", rxScale(minX))\n .attr(\"x2\", rxScale(maxX))\n .attr(\"y1\", ryScale(outline))\n .attr(\"y2\", ryScale(outline))\n .attr(\"class\", \"rline dashed\");\n\n rsvg.append(\"line\")\n .attr(\"x1\", rxScale(minX))\n .attr(\"x2\", rxScale(maxX))\n .attr(\"y1\", ryScale(-outline))\n .attr(\"y2\", ryScale(-outline))\n .attr(\"class\", \"rline dashed\");\n }\n\n var residData = makeResidData(data, r.resids, diagnostic);\n\n rsvg.append(\"g\")\n .attr(\"id\", \"resids\")\n .selectAll(\"circle\")\n .data(residData)\n .enter()\n .append(\"circle\")\n .attr(\"r\", opts.ptRadius)\n .attr(\"cx\", function(d) { return rxScale(d[0]); })\n .attr(\"cy\", function(d) { return ryScale(d[1]); })\n .attr(\"fill\", opts.ptColor)\n .attr(\"stroke\", opts.ptBorderColor)\n .attr(\"stroke-width\", \"0.5px\")\n .attr(\"class\", \"datapt\")\n .on(\"mouseover\", dataHover)\n .on(\"mouseout\", dataHoverOut);\n\n // Diagnostic axes labels\n var rxlab = xlab, rylab;\n if (diagnostic === \"residuals\") {\n rylab = \"Residuals\";\n } else if (diagnostic === \"rstandard\") {\n rylab = \"Standardized residuals\";\n } else if (diagnostic === \"rstudent\") {\n rylab = \"Studentized residuals\";\n } else if (diagnostic === \"cooks\") {\n rylab = \"Cook's distance\";\n } else if (diagnostic === \"leverage\") {\n rylab = \"Leverage\";\n } else if (diagnostic === \"qqnorm\") {\n rxlab = \"Theoretical quantiles\";\n rylab = \"Sample quantiles\";\n }\n\n rsvg.append(\"text\")\n .attr(\"class\", \"x label\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"x\", opts.width - opts.padding)\n .attr(\"y\", opts.height - opts.padding)\n .text(rxlab);\n\n rsvg.append(\"text\")\n .attr(\"class\", \"y label\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"y\", opts.padding)\n .attr(\"x\", -opts.padding)\n .attr(\"dy\", \"1em\")\n .attr(\"transform\", \"rotate(-90)\")\n .text(rylab);\n}", "title": "" }, { "docid": "2591e7920464946540ec0ab530a5e778", "score": "0.52490544", "text": "createHistoryScatterData() {\n let _seriesData = this.getSeriesData()\n if (_seriesData && _seriesData.length % 2 === 0) {\n let _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"history\"\n for (let r = 0; r < _seriesData.length; r += 2) {\n // first entity hols the attributes\n const _attr = this.entities[r]\n let _data = []\n _seriesData[r].forEach(function (e, i) {\n if (_seriesData[r][i] && _seriesData[r + 1][i]) {\n _data.push({\n x: parseFloat(_seriesData[r + 0][i].y) || 0.0,\n y: parseFloat(_seriesData[r + 1][i].y || 0.0)\n })\n }\n })\n let _options = {\n label: _attr.name || \"\",\n unit: _attr.unit || \"\",\n hoverRadius: 20,\n radius: 15,\n hitRadius: 20,\n backgroundColor: _attr.backgroundColor || DEFAULT_COLORS[10 + r],\n borderColor: _attr.borderColor || DEFAULT_COLORS[10 + r]\n // TODO: min, max, avg values ???\n }\n if (_attr && _attr.pointStyle) {\n _options.pointStyle = _attr.pointStyle\n _options.pointRadius = 6\n }\n if (_attr && _attr.pointRadius) {\n _options.pointRadius = _attr.pointRadius\n }\n if (this.entityOptions) {\n // simple merge the default with the global options\n _options = { ..._options, ...this.entityOptions }\n _graphData.config.options = this.entityOptions\n }\n _options.data = _data\n _graphData.data.datasets.push(_options)\n }\n if (_graphData.data.datasets.length) {\n _graphData.config.options.bubble = true\n return _graphData\n }\n }\n console.error(\"ScatterChart setting not valid\", this.entities)\n return null\n }", "title": "" }, { "docid": "8c24e21fb3152491c57ceffcd3274970", "score": "0.52350676", "text": "function scatterPlot(width, height, margin, data, color, radius, xAxis, yAxis) {\n\n var svg = d3.select(\"body\").select(\"svg\")\n\n\tvar xScale = d3.scale.linear()\n\t\t.domain([d3.min(data, function(d) { return d[xAxis]; }) - 1,\n\t\t\t\t d3.max(data, function(d) { return d[xAxis]; }) + 1])\n\t\t.range([0, width - margin.right])\n\t\t.nice();\n\n\tvar yScale = d3.scale.linear()\n\t\t.domain([0,\n\t\t\t\t d3.max(data, function(d) { return d[yAxis]; }) + 1])\n\t\t.range([height - margin.top, 0])\n\t\t.nice();\n\n\tvar circles = svg.selectAll(\"circle\")\n\t\t.data(data)\n\t\t.enter()\n\t\t.append(\"circle\")\n\t\t.attr(\"cx\", function(d) {\n\t\t\treturn xScale(d[xAxis]);\n\t\t})\n\t\t.attr(\"cy\", function(d) {\n\t\t\treturn yScale(d[yAxis]);\n\t\t})\n\t\t.attr(\"r\", radius)\n\t\t.attr(\"fill\", color)\n\t\t.attr(\"stroke\", color);\n\n\tvar labels = svg.selectAll(\"text\")\n\t\t.data(data)\n\t\t.enter()\n\t\t.append(\"text\")\n\t\t.text(function(d) {\n\t\t\t\treturn d[\"name\"];\n\t\t\t})\n\t\t\t.attr(\"x\", function(d) {\n\t\t\t\treturn xScale(d[xAxis]) + 5;\n\t\t\t})\n\t\t\t.attr(\"y\", function(d) {\n\t\t\t\treturn yScale(d[yAxis]);\n\t\t\t})\n\t\t.attr(\"font-family\", \"sans-serif\")\n\t\t.attr(\"font-size\", \"11px\")\n\t\t.attr(\"fill\", \"black\");\n\n\tvar xAx = d3.svg.axis()\n\t\t.scale(xScale)\n\t\t.orient(\"bottom\")\n\t\t.tickFormat(d3.format(\"0000\"))\n\t\t.ticks(width / 50);\n\n\tsvg.append(\"text\")\n \t.text(xAxis)\n \t.attr(\"x\", width/2)\n \t.attr(\"y\", height - 10)\n \t.attr(\"font-family\", \"sans-serif\")\n\t\t.attr(\"font-size\", \"11px\")\n\t\t.attr(\"fill\", \"black\");\n\n\tvar yAx = d3.svg.axis()\n\t\t.scale(yScale)\n\t\t.orient(\"left\")\n\t\t.ticks(height / 50);\n\n\tsvg.append(\"text\")\n \t.text(yAxis)\n \t.attr(\"transform\", \"translate(10,\" + height/2 + \")rotate(-90)\")\n \t.attr(\"font-family\", \"sans-serif\")\n\t\t.attr(\"font-size\", \"11px\")\n\t\t.attr(\"fill\", \"black\");\n\n\tsvg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + (height - 40) + \")\")\n .call(xAx);\n\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(40,-10)\")\n .call(yAx);\n\n $(\".axis path\").css(\"fill\", \"none\");\n $(\".axis path\").css(\"stroke\", \"black\");\n $(\".axis path\").css(\"shape-rendering\", \"cripsEdges\");\n\n $(\".axis line\").css(\"fill\", \"none\");\n $(\".axis line\").css(\"stroke\", \"black\");\n $(\".axis line\").css(\"shape-rendering\", \"crispEdges\");\n\n $(\".axis text\").css(\"font-family\", \"sans-serif\");\n $(\".axis text\").css(\"font-size\", \"11px\");\n}", "title": "" }, { "docid": "0ff6333a19be26987d73c4c562a5a1b9", "score": "0.5232901", "text": "function updateGraph(offset, comparison){\n\n x.domain(d3.extent(data, function(d) {\n return d[\"position\"];\n }));\n \n y.domain([offset, d3.max(data, function (d){\n return d[comparison];\n })]);\n\n //changing the graph to the new graph using transition's\n svg.selectAll(\"circle\")\n .data(data)\n .transition()\n .duration(1000)\n .attr(\"cx\", function (d){\n return x(d[\"position\"]);\n })\n .attr(\"cy\", function (d){\n return y(d[comparison]);\n });\n \n //updating the title\n svg.select(\".p.title\")\n .transition()\n .duration(1000)\n .text(chartTitle);\n\n //updating the x axis\n svg.select(\".x.axis\")\n .transition()\n .duration(1000)\n .call(d3.axisBottom(x));\n\n //updating the y axis\n svg.select(\".y.axis\")\n .transition()\n .duration(1000)\n .call(d3.axisLeft(y).tickFormat(function (d){\n return d3.format(\"\") (d)\n }));\n\n //updating the tredline\n var xSeries = d3.range(1, 51);\n var ySeries = data.map(function (d) { return parseFloat(d[comparison]); });\n\n var leastSquaresCoeff = leastSquares(xSeries, ySeries);\n\n var x1 = 1;\n var y1 = leastSquaresCoeff[0] + leastSquaresCoeff[1];\n var x2 = 50;\n var y2 = leastSquaresCoeff[0] * 50 + leastSquaresCoeff[1];\n var trendData = [[x1, y1, x2, y2]];\n\n modifyTrendLine(trendData);\n }", "title": "" }, { "docid": "1a7ea78b49c488afd658ccee0264184a", "score": "0.52316517", "text": "function generateLine(lineData) {\n var chart = this,\n svg = chart.svg;\n\n svg.selectAll('g.' + chart.config.type + '-container').remove();\n var lines = svg.append('g')\n .attr('class', chart.config.type + '-container')\n .selectAll('g');\n\n var dataHeaders = lineData.legendData;\n\n if (chart._vars.seriesFlipped && chart._vars.flippedLegendHeaders) {\n dataHeaders = chart._vars.flippedLegendHeaders;\n } else if (chart._vars.legendHeaders) {\n dataHeaders = chart._vars.legendHeaders;\n }\n\n var lineDataNew = jvCharts.getToggledData(lineData, dataHeaders);\n\n //If it's an area chart, add the area\n if (chart.config.type === 'area') {\n chart.fillArea(lineDataNew);\n }\n\n generateLineGroups(lines, lineDataNew, chart);\n var eventGroups = jvCharts.generateEventGroups(lines, lineDataNew, chart);\n\n eventGroups\n .on('mouseover', function (d, i, j) { //Transitions in D3 don't support the 'on' function They only exist on selections. So need to move that event listener above transition and after append\n if (chart.showToolTip) {\n //Get tip data\n var tipData = chart.setTipData(d, i);\n\n //Draw tip\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n chart.tip.d = d;\n chart.tip.i = i;\n }\n })\n .on('mousemove', function (d, i) {\n if (chart.showToolTip) {\n if (chart.tip.d === d && chart.tip.i === i) {\n chart.tip.showTip(d3.event);\n } else {\n //Get tip data\n var tipData = chart.setTipData(d, i);\n //Draw tip line\n chart.tip.generateSimpleTip(tipData, chart.data.dataTable);\n }\n }\n })\n .on('mouseout', function (d) {\n chart.tip.hideTip();\n svg.selectAll('.tip-line').remove();\n });\n\n chart.displayValues();\n chart.generateClipPath();\n chart.generateLineThreshold();\n\n return lines;\n}", "title": "" }, { "docid": "91ad082bc95f00c1a97f892b4a9dc9c9", "score": "0.5224518", "text": "function drawChartNeutron() {\n var dataNeutron = new google.visualization.DataTable();\n var timeAdvance = new Date();\n timeAdvance.setTime(timeStamp.getTime());\n dataNeutron.addColumn('date', 'Time');\n dataNeutron.addColumn('number','Rolling Average')\n\n\tfor (i = 0; i < spanArrayNeutron.length-1; i++) {\n\t timeAdvance.setTime(timeAdvance.getTime()+(span*60000));\n\t dataNeutron.addRow([\n\t\t\t\t// new Date(timeAdvance.getTime()),\n\t\t\t\t(timeArray[i]),\n\t\t\t\t(smaArrayNeutron[i])\n\t\t\t\t]);\n\t}\n\n var optionsNeutron = {\n\t// chart:{\n\t// title: 'Double Paddle Detector',\n\t// subtitle: 'Start Time: ' + startDate.toString(),\n\t// },\n\ttitle: 'Liquid scintillator test stand (neutron counts)',\n\ttitleTextStyle:{\n\t // color: '#839496',\n\t fontName: '\"Avant Garde\",Avantgarde,\"Century Gothic\",CenturyGothic,AppleGothic,sans-serif',\n\t fontSize: '30',\n\t bold: false\n\t},\n\tvAxis: {\n\t title: '% Variation in Neutrons',\n\t titleTextStyle: {\n\t\tfontSize: 16,\n\t\t// color: '#93a1a1'\n\t },\n\t // gridlines: {\n\t // color: '073642'\n\t // },\n\t viewWindowMode:'explicit',\n\t viewWindow:{\n\t\t//\tmax: 30,\n\t\t//\tmin: -30\n\t }//,\n\t // textStyle:{\n\t // color: '#93a1a1'\n\t // }\n\t},\n\thAxis: {\n\t title: 'Time (UTC)',\n\t titleTextStyle: {\n\t\tfontSize: 16 //,\n\t\t// color: '#93a1a1'\n\t } //,\n\t // gridlines: {\n\t // color: '073642'\n\t // },\n\t // textStyle:{\n\t // color: '#93a1a1'\n\t // }\n\t},\n\texplorer: {\n\t axis: 'horizontal',\n\t keepInBounds: true,\n\t maxZoomOut: 1\n\t \n\t},\n\tseries: {\n\t 0: {\n\t\taxis: 'Rolling Average',\n\t\tlineWidth: 1,\n\t\t// color: '#6c71c4',\n\t\t// pointSize: 1,\n\t\tpointsVisible: 0\n\t }\n\t},\n\tbackgroundColor: 'transparent',\n\t//\theight:600,\n\t//\twidth:1000,\n\tlegend: {\n\t position: 'none'\n\t}\n };\n\n var chart = new google.visualization.ScatterChart(document.getElementById('neutron_counts'));\n\n chart.draw(dataNeutron, optionsNeutron);\n // console.log(smaArrayNeutron[4].toString());\n\n}", "title": "" }, { "docid": "6e7214acdf3a218a656e65eca01a4d96", "score": "0.52223444", "text": "function drawLineChart() {\n\n\n // The line graph will be appended to div of class \"l_DIV\"\n var linegraph = d3.select(\"#l_DIV\").\n append(\"svg\").\n attr(\"class\", \"graph\").\n attr(\"width\", width + padding).\n attr(\"height\", height).\n attr(\"id\", \"l_graph\");\n\n var g = linegraph.append(\"g\");\n\n // Define axes for lin graph\n var l_xAxis = d3.axisBottom(l_x);\n var l_yAxis = d3.axisLeft(l_y);\n // Draw the axes\n g.append(\"g\").\n attr(\"class\", \"x axis\").\n attr(\"transform\", \"translate(0\" + \",\" + (height - padding) + \")\").\n call(l_xAxis);\n g.append(\"g\").\n attr(\"class\", \"y axis\").\n attr(\"transform\", \"translate(\" + padding + \",0)\").\n call(l_yAxis);\n\n // Label the axes \n g.append(\"text\").\n attr(\"transform\", \"translate(\" + (width/2) + \",\" + (height - padding/2) + \")\").\n attr(\"font-weight\", \"bold\").\n text(\"Years\");\n g.append(\"text\").\n attr(\"transform\", \"rotate(-90)\").\n attr(\"y\", padding / 3).\n attr(\"x\", 0 - height / 2).\n attr(\"dy\", \"1em\").\n attr(\"font-weight\", \"bold\").\n style(\"text-anchor\", \"middle\").\n text(\"Frequency\");\n\n // Each thinker\n var thinker = g.selectAll(\".thinker\").\n data(thinkers_sh).\n enter().\n append(\"g\").\n attr(\"class\", \"thinker\");\n\n // For each thinker, draw a line using the values \n // Here, values defined in initLine function as thinkers was created\n thinker.append(\"path\").\n attr(\"class\", \"line\").\n attr(\"id\", function(d) { return d.id; }).\n attr(\"d\", function(d) {\n return line(d.values); }).\n style(\"stroke\", function(d) { return l_z(d.id); }).\n on(\"mouseover\", function(d, i) {\n // When the user hovers over a line, display the appropriate name at the top center of the graph\n thinker.append(\"text\").\n datum(function(d, i) { \n // Don't use this part right now, but we will want to use this in the future\n }).\n attr(\"transform\", \"translate(\"+ (width/2) + \",\" + padding + \")\").\n attr(\"x\", 3).\n attr(\"dy\", \"0.35em\").\n style(\"font\", \"20px sans-serif\").\n style(\"text-anchor\", \"middle\").\n text(this.id).\n attr(\"id\", \"bigName\");\n\n }).\n on(\"mouseout\", function(d) {\n // Clear the name at the top center of the graph\n thinker.select(\"#bigName\").remove();\n }).\n on(\"click\", function(d, i) {\n window.open(\"https://digitalricoeur.org/search/\" + thinkers_sh[i].id);\n });\n\n\n // Variables used to display the \"legend\"\n var fontSize = 15;\n var extraMargin = 2;\n // Append the name of the thinker as the legend at the upper right corner of the graph, with some margin between\n thinker.append(\"text\").\n datum(function(d) {return {id: d.id, value: d.values[d.values.length - 1]};}).\n attr(\"transform\", function(d, i) {return \"translate(\" + l_x(d.value.year) + \",\" + (padding + i * (fontSize + extraMargin)) +\")\";}).\n attr(\"x\", fontSize).\n attr(\"dy\", \"0.35em\").\n style(\"font\", fontSize + \"px sans-serif\").\n style(\"font-weight\", \"bold\").\n style(\"fill\", \"black\").\n text(function(d) {return d.id;}).\n on(\"mouseover\", function(d) {\n this.style.fill = \"red\";\n }). \n on(\"mouseout\", function(d) {\n this.style.fill = \"black\"\n }).\n on(\"click\", function(d) {\n window.open(\"https://digitalricoeur.org/search/\" + d.id);\n });\n \n // Append circles of appropriate color to the legend \n var legendOffset = 10;\n var radius = 5;\n thinker.append(\"circle\").\n datum(function(d) {return {id: d.id, value: d.values[d.values.length - 1]};}).\n attr(\"transform\", function(d, i) {return \"translate(\" + l_x(d.value.year) + \",\" + (padding + i * (fontSize + extraMargin)) + \")\";}).\n attr(\"cx\", legendOffset).\n attr(\"r\", radius).\n attr(\"fill\", function(d, i) { return l_z(d.id);});\n \n}", "title": "" }, { "docid": "2136b8f49068e6fb67f0d57fd62f0043", "score": "0.5220855", "text": "function addValueline(){\n svg.append(\"path\")\n .data([totalSales])\n .attr(\"class\", \"line\")\n .attr(\"d\", valueline);\n}", "title": "" }, { "docid": "c8b340809160b30eb68d7893aebcc926", "score": "0.5220705", "text": "function drawScatterplot(dataset, dataArray1, dataArray2, dataArray3) {\n\n var xArray = makeFieldObject(dataset, x_axis_label);\n var yArray = makeFieldObject(dataset, y_axis_label);\n var colorValueArray = makeFieldObject(dataset, color_value_label);\n\n var xDomain = [xArray.min, xArray.max];\n var xRange = [padding.left, width-padding.right]; \n var xScale = d3.scale.linear()\n .range(xRange)\n .domain(xDomain);\n\n var yDomain = [yArray.min, yArray.max];\n var yRange = [height-padding.bottom, padding.top];\n var yScale = d3.scale.linear()\n .range(yRange)\n .domain(yDomain);\n\n drawXAxis(xScale);\n drawYAxis(yScale);\n drawScatterplotLabel();\n\n var coordPoints = convertToCoords(dataArray1, dataArray2, dataArray3);\n\n\n // A color gradient scale. Using the method call gradientColorScale(value), this will\n // plot a data value and determine a color in between green and red.\n gradientColorScale = d3.scale.linear()\n .range([\"green\", \"red\"])\n .domain(colorValueArray.data);\n\n drawColorScale(gradientColorScale, dataArray3);\n\n drawPoints(svg_scatterplot, coordPoints, xScale, yScale, gradientColorScale);\n\n}", "title": "" }, { "docid": "14150818150458bd818a79c3f199bf94", "score": "0.52094936", "text": "function ScatterChart(container, data, selection) {\n //console.log(\"in scatter plots\"); \n //console.log(data);\n scatterData = data;\n // margins and dimensions for the graph\n var margin = {\n top: 50,\n right: 10,\n bottom: 100,\n left: 150\n },\n width = 800,\n height = 300;\n\n var xScale = d3.scaleTime()\n .domain(d3.extent(data, function (d) {\n return (d[\"launched2\"]);\n }))\n .range([0, width]),\n xAxis = d3.axisBottom(xScale);\n\n // y axis\n var yScale = d3.scaleLinear()\n .domain([0, d3.max(data, function (d) {\n return d[\"usd_pledged\"];\n })])\n .range([height, 0]),\n yAxis = d3.axisLeft(yScale);\n scatterScaleX = xScale;\n scatterScaleY = yScale;\n\n\n // add graph canvas to body\n var svg = d3.select(\".scatter\")\n .append(\"svg\")\n .attr(\"class\", \"scatterPlot\")\n .attr(\"width\", width + margin.left + margin.right + 100)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n .attr(\"id\", \"circleholder\");\n\n var scatter = svg.append(\"g\")\n .attr(\"id\", \"scatterplot\")\n .attr(\"clip-path\", \"url(#clip)\");\n\n // allow for brushing and zooming --> credit to https://bl.ocks.org/EfratVil/d956f19f2e56a05c31fb6583beccfda7\n var clip = svg.append(\"defs\").append(\"svg:clipPath\")\n .attr(\"id\", \"clip\")\n .append(\"svg:rect\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"x\", 0)\n .attr(\"y\", 0);\n\n // append the x and y axis\n svg.append(\"g\")\n .attr('id', \"axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n var xAxisText = height + 40;\n svg.append(\"text\")\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + xAxisText + \")\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Date\");\n\n svg.append(\"g\")\n .attr('id', \"axis--y\")\n .call(yAxis);\n\n svg.append(\"text\")\n .attr(\"transform\", \"translate(-150,\" + height / 2 + \")\")\n .text(\"USD Pledged\");\n\n // draw the dots\n var circles = scatter.selectAll(\".dot\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"r\", function (d) {\n var num = d[\"data_diff_days\"];\n return num / 4;\n })\n .style(\"opacity\", function (d) {\n return (d[\"data_diff_days\"] / 155).toFixed(2);\n })\n .attr(\"cx\", function (d) {\n return xScale(d[\"launched2\"])\n })\n .attr(\"cy\", function (d) {\n return yScale(d[\"usd_pledged\"])\n })\n .style(\"fill\", function (d) {\n if (d[\"state\"] == \"failed\")\n return \"#C2151B\";\n else if (d[\"state\"] == \"successful\")\n return \"#29cf6c\"\n })\n .attr(\"class\", function (d) {\n if (d[\"state\"] == \"failed\")\n return \"Red \" + \"a\" + d[\"launched\"].getFullYear() + \" isEnabled\";\n else if (d[\"state\"] == \"successful\")\n return \"Green \" + \"a\" + d[\"launched\"].getFullYear() + \" isEnabled\";\n })\n .attr(\"id\", function (d) {\n return d[\"main_category\"];\n });\n // add brush credit to: https://bl.ocks.org/EfratVil/d956f19f2e56a05c31fb6583beccfda7\n var brush = d3.brush().extent([\n [0, 0],\n [width, height]\n ])\n .on(\"brush\", function (d) {\n if (d3.event.selection != null) {\n\n // revert circles to initial style\n circles.attr(\"class\", function(d){\n return \"non_brushed \" + \"a\" + d[\"launched\"].getFullYear();\n })\n .attr(\"id\", function (d) {\n return d[\"main_category\"];\n });\n\n var brush_coords = d3.brushSelection(this);\n\n // style brushed circles\n circles.filter(function () {\n\n var cx = d3.select(this).attr(\"cx\"),\n cy = d3.select(this).attr(\"cy\");\n\n return isBrushed(brush_coords, cx, cy);\n })\n .attr(\"class\", function(d){\n return \"brushed \" + \"a\" + d[\"launched\"].getFullYear();\n })\n .attr(\"id\", function (d) {\n return d[\"main_category\"];\n });\n }\n })\n .on(\"end\", brushended),\n idleTimeout,\n idleDelay = 350;\n\n // allow for brushing and zooming --> credit to https://bl.ocks.org/EfratVil/d956f19f2e56a05c31fb6583beccfda7\n scatter.append(\"g\")\n .attr(\"class\", \"brush\")\n .call(brush);\n // create the legend\n var moveRect = 3;\n var legend = d3.select(\"body\").select(\".scatterPlot\").append(\"g\")\n .selectAll(\"g\")\n .data([\"#C2151B\", \"#29cf6c\"])\n .enter()\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function (d, i) {\n var rectheight = 18;\n var x = 0;\n var y = i * rectheight + moveRect + 50;\n moveRect += 3;\n return \"translate(\" + x + ',' + y + ')';\n });\n\n legend.append(\"rect\")\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", function (d) {\n return d;\n })\n .attr(\"value\", function (d) {\n if (d == \"#C2151B\")\n return \"Failure\";\n else if (d == \"#29cf6c\")\n return \"Success\";\n })\n .on(\"click\", function (stateType) {\n if (stateType == \"#29cf6c\") {\n // get only successful kickstarters\n d3.select(\"body\")\n .select(\".scatterPlot\")\n .select(\"#circleholder\")\n .select(\"#scatterplot\")\n .selectAll(\".Red\")\n .data(data, function (d) {\n return d[\"state\"] != \"failed\"\n })\n .exit()\n .remove();\n // get the last dot\n d3.select(\"body\")\n .select(\".Red\")\n .remove();\n } else if (stateType == \"#C2151B\") {\n // get only failed kickstarters\n d3.select(\"body\")\n .selectAll(\".Green\")\n .data(data, function (d) {\n return d[\"state\"] != \"successful\"\n })\n .exit()\n .remove();\n\n // get the last dot\n d3.select(\"body\")\n .select(\".Green\")\n .remove();\n }\n });\n\n legend.append(\"text\")\n .attr(\"x\", 22)\n .attr(\"y\", 15)\n .text(function (d) {\n if (d == \"#C2151B\")\n return \"Failure\";\n else if (d == \"#29cf6c\")\n return \"Success\";\n });\n\n function isBrushed(brush_coords, cx, cy) {\n\n var x0 = brush_coords[0][0],\n x1 = brush_coords[1][0],\n y0 = brush_coords[0][1],\n y1 = brush_coords[1][1];\n\n return x0 <= cx && cx <= x1 && y0 <= cy && cy <= y1;\n }\n\n function selectCircles() {\n \n }\n // allow for brushing and zooming --> credit to https://bl.ocks.org/EfratVil/d956f19f2e56a05c31fb6583beccfda7\n function brushended() {\n\n selectCircles();\n\n\n\n var s = d3.event.selection;\n if (!s) {\n //console.log(\"test brush if\")\n if (!idleTimeout) return idleTimeout = setTimeout(idled, idleDelay);\n xScale.domain(d3.extent(data, function (d) {\n return d[\"launched2\"];\n })).nice();\n \n yScale.domain(d3.extent(data, function (d) {\n return d[\"usd_pledged\"];\n })).nice();\n //console.log(\"test brush if if\")\n // reset the scatterplot\n d3.select(\"body\")\n .select(\".scatterPlot\")\n .select(\"#circleholder\")\n .select(\"#scatterplot\")\n .selectAll(\"circle\")\n .style(\"opacity\", function(d){\n return (d[\"data_diff_days\"] / 155).toFixed(2);\n });\n // reset checked years\n // scatterCheckedYears = [\"2014\", \"2015\", \"2016\", \"2017\"];\n scatterCheckedYears = [ \"2015\", \"2016\", \"2017\"];\n\n currentCategory = null;\n ctx.clearRect(0,0,width,height);\n Interaction_Selected_Data = originalData;\n render(Interaction_Selected_Data);\n\n // reset the checkboxes to be checked\n //document.getElementById(\"check2014\").checked = true;\n document.getElementById(\"check2015\").checked = true;\n document.getElementById(\"check2016\").checked = true;\n document.getElementById(\"check2017\").checked = true;\n\n d3.select(\".radarChart\").selectAll('*').remove();\n \t\tmakeRadar(scatterCheckedYears);\n \n } else {\n //console.log(\"test brush else\")\n xScale.domain([s[0][0], s[1][0]].map(xScale.invert, xScale));\n yScale.domain([s[1][1], s[0][1]].map(yScale.invert, yScale));\n scatter.select(\".brush\").call(brush.move, null);\n \n var d_brushed = d3.selectAll(\".brushed\").data();\n\n var newdata = d_brushed.filter(function(d){\n console.log(scatterCheckedYears);\n // no category selected\n if(!currentCategory){\n return (scatterCheckedYears.indexOf(String(d[\"launched\"].getFullYear())) > -1);\n }\n // otherwise isolate the currently checked years and the current category\n return (d[\"main_category\"] == currentCategory && scatterCheckedYears.indexOf(String(d[\"launched\"].getFullYear())) > -1);\n })\n // ESSENTIALLY FIGURE OUT A WAY TO FILTER THE DATA TO SEE ONLY THE YEAR'S DATA\n console.log(newdata);\n ctx.clearRect(0,0,width,height);\n render(newdata);\n }\n zoom();\n\n }\n\n function idled() {\n idleTimeout = null;\n }\n\n function zoom() {\n var t = scatter.transition().duration(750);\n svg.select(\"#axis--x\").transition(t).call(xAxis);\n svg.select(\"#axis--y\").transition(t).call(yAxis);\n scatter.selectAll(\"circle\").transition(t)\n .attr(\"cx\", function (d) {\n return xScale(d[\"launched2\"]);\n })\n .attr(\"cy\", function (d) {\n return yScale(d[\"usd_pledged\"]);\n });\n }\n}", "title": "" }, { "docid": "ee0885f5216bf850f000b592e0815c59", "score": "0.5202271", "text": "function drawScatterChart(did, xlabel, ylabel) {\n if ($('#' + did + \" svg\").length === 0)\n $('#' + did).html('<svg></svg>');\n\n nv.addGraph(function() {\n var chart = nv.models.scatterChart()\n //.xScale(d3.scale.log())\n .forceX([0,2000]) // scale error so fix to 2 Mbytes/sec for demo\n .forceY([0,25]) // scale error so fix to 25 % usage:w\n .showDistX(true) //showDist, when true, will display those little distribution lines on the axis.\n .showDistY(true)\n //.transitionDuration(350) // transitionDuration is not a function error\n .duration(800) // substition for transitionDuration()\n .color(d3.scale.category10().range());\n\n chart.xAxis.tickValues([0,1,10,100,1000,10000,100000,1000000]);\n\n // nvd3.js 1.8.1\n chart.tooltip.contentGenerator(function(obj) {\n var html = '<h3>' + obj.series[0].key + '</h3>';\n html += '<p>CPU : ' + (Math.round(obj.series[0].values[0].y * 100) / 100) + '%<br>';\n html += 'Disk : ' + (Math.round(obj.series[0].values[0].x * 100) / 100) + 'KB/s<br>';\n html += 'Network : ' + (Math.round(obj.series[0].values[0].network * 100) / 100) + 'KB/s<br>';\n html += 'No. of CPU : ' + obj.series[0].values[0].size + '<br></p>';\n return html;\n });\n\n /*\n // nvd3.js 1.8.0\n chart.tooltipContent(function (key, x, y, e, graph) {\n var html = '<h3>' + key + '</h3><p>';\n html += 'CPU : ' + y + '%<br>';\n html += 'Disk : ' + x + 'KB/s<br>';\n html += 'Network : ' + (Math.round(graph.series.values[0].network * 100) / 100) + 'KB/s<br>';\n html += 'No. of CPU : ' + graph.series.values[0].size + '<br></p>';\n return html;\n });\n */\n\n //Axis settings\n chart.xAxis.axisLabel(xlabel).tickFormat(d3.format('.02f'));\n chart.yAxis.axisLabel(ylabel).tickFormat(d3.format('.02f'));\n\n chartByDid[did] = chart;\n\n return chart;\n });\n}", "title": "" }, { "docid": "a699c73a5d328814e108ad208757494a", "score": "0.5199716", "text": "function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "title": "" }, { "docid": "d2d9b41086aefe4bfb381eabad17d770", "score": "0.5198426", "text": "function drawScatter(DataSelection, results, day_results, weather_day, weather){\n var graph = d3.select(\"#container_scatter\")\n .style(\"opacity\", \"1\")\n var info = d3.select(\".infobox\")\n .style(\"opacity\", \"0\")\n\n var svg = d3.select(\"#scatter_results\").append(\"g\")\n\n // reach the data with d3.\n var parseTime = d3.time.format(\"%H:%M\").parse\n d3.json(DataSelection, function() {\n DataSelection.forEach(function(d) {\n d.baan =+ d[4]\n d.startTijd = parseTime(d[1])\n \n d.crew = d[5]\n d.finishtime = d.crew[\"results\"][\"finish\"][\"time\"]\n d.finishPos =+ d.crew[\"results\"][\"finish\"][\"position\"]\n d.radius = 20-3*d.finishPos\n })\n\n // Set the domain\n var xDomain = d3.extent(DataSelection, function(d) { return d.baan; })\n var yDomain = d3.extent(DataSelection, function(d) { return d.startTijd; })\n\n // Set the scale\n var xScale = d3.scale.linear().range([left_pad, width - padding*2]).domain(xDomain).nice()\n var yScale = d3.time.scale().range([padding, height - padding]).domain(yDomain).nice()\n\n // create the axis\n var yAxis = d3.svg.axis().scale(yScale).orient('left')\n var xAxis = d3.svg.axis().scale(xScale).orient('bottom')\n .ticks(6)\n .tickFormat(function (d, i) {\n return ['0', '1', '2', '3', '4', '5', '6', '7'][d];\n });\n \n \n // Create the Axis for the graph.\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0, 20)\")\n .call(xAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"y\", \"-7\")\n .attr(\"x\", \"250\")\n .style(\"text-anchor\", \"left\")\n .text(\"Baan\");\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(\"+ (left_pad - padding/2) + \",0)\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", height)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Tijd\")\n\n // Add the data to the graph as ellipses.\n svg.selectAll(\".dot\")\n .data(DataSelection)\n .enter().append(\"ellipse\")\n .attr(\"class\", \"dot\")\n .attr(\"ry\", 5)\n .attr(\"rx\", function (d) { return d.radius*1.5; })\n .attr(\"cx\", function(d) { return xScale(d.baan); })\n .attr(\"cy\", function(d) { return yScale(d.startTijd); })\n .attr('pointer-events', 'all')\n .style(\"fill\", \"red\")\n .on(\"mouseover\", function(d){\n showCrewTooltip()\n })\n .on(\"mouseout\", function(d){\n hideCrewTooltip()\n })\n eventlistener(results, weather_day, DataSelection, yDomain, yScale)\n})\n}", "title": "" }, { "docid": "5d8980b08d8a23b4e8a87cdc3b25b9e6", "score": "0.5188418", "text": "function createScatter(scatterYear) {\n\n // Sets x and y location of datapoints\n svg.selectAll(\".datapoint\").data(years[start_year])\n .attr(\"cx\", function(d) {\n return xScale(d.teenPregnancy) + margin.left;\n })\n .attr(\"cy\", function(d) {\n return yScale(d.teenViolence) + margin.top;\n })\n\n // Sets the surface area of the circles\n .attr(\"r\", function(d) {\n return Math.sqrt(d.GDP) / 30;\n })\n .attr(\"fill\", \"#3399ff\");\n\n // Add hover effect on mouse over\n circles.on('mouseover',\n function(d, i) {\n d3.select(\n this).transition(\"barOpacity\")\n .attr('opacity', '.5')\n\n // Makes div appear on hover\n div.transition(\"divAppear\")\n .style(\"opacity\", 1)\n div.html(d.country + \"\\n$\" + Math.round(d.GDP))\n .style(\"left\", (\n d3.event.pageX + 10) + \"px\")\n .style(\"top\", (\n d3.event.pageY - 15) + \"px\");\n })\n\n // Disable hover effect on mouse out\n .on('mouseout', function(d, i) {\n d3.select(this).transition(\n \"barDisappear\")\n .attr('opacity', '1');\n\n // Make the div disappear\n div.transition(\"divAppear\")\n .style(\"opacity\", 0);\n });\n return;\n }", "title": "" }, { "docid": "4cc0486a6f2b32299a607d7351211621", "score": "0.51710063", "text": "function updateGraph(offset, comparison){\n\n if (offset === 0 && comparison === 0){\n svg2.selectAll(\"circle\")\n .data(data)\n .transition()\n .duration(1000)\n .attr(\"cx\", function (d){\n return (0);\n })\n .attr(\"cy\", function (d){\n return (0);\n })\n .style(\"fill\", \"white\");\n\n svg2.selectAll(\".trendline2\")\n .transition()\n .duration(1000)\n .style(\"fill\", \"white\")\n .style(\"opacity\", \"0\");\n }\n else{\n x.domain(d3.extent(data, function(d) {\n return d[\"position\"];\n }));\n \n y.domain([offset, d3.max(data, function (d){\n return d[comparison];\n })]);\n\n //changing the graph to the new graph using transition's\n svg2.selectAll(\"circle\")\n .data(data)\n .transition()\n .duration(1000)\n .attr(\"cx\", function (d){\n return x(d[\"position\"]);\n })\n .attr(\"cy\", function (d){\n return y(d[comparison]);\n })\n .style(\"fill\", \"green\");\n\n //updating the y axis\n svg2.select(\".y2.axis\")\n .transition()\n .duration(1000)\n .call(d3.axisRight(y).tickFormat(function (d){\n return d3.format(\"\") (d)\n }));\n\n //updating the tredline\n var xSeries = d3.range(1, 51);\n var ySeries = data.map(function (d) { return parseFloat(d[comparison]); });\n\n var leastSquaresCoeff = leastSquares(xSeries, ySeries);\n\n var x1 = 1;\n var y1 = leastSquaresCoeff[0] + leastSquaresCoeff[1];\n var x2 = 50;\n var y2 = leastSquaresCoeff[0] * 50 + leastSquaresCoeff[1];\n var trendData2 = [[x1, y1, x2, y2]];\n\n modifyTrendLine2(trendData2);\n }\n}", "title": "" }, { "docid": "84f38671741378a131829ff5b2e663c8", "score": "0.5163555", "text": "function initPlot(){\n chart = new Highcharts.chart({\n chart: {\n renderTo: 'mainPlot',\n type: 'scatter',\n height: 450\n },\n exporting: {\n enabled: false\n },\n title:{\n text:null\n }\n });\n chart.showLoading();\n setTimeout(function(){\n chart = Highcharts.chart('mainPlot', {\n chart: {\n type: 'scatter',\n zoomType: 'xy',\n backgroundColor: 'transparent',\n events: {\n click: unselectByClick,\n },\n height: 450\n },\n tooltip: {\n useHTML:true,\n formatter:function(){\n var tooltipStr = \"<div class='customTooltip'>\";\n tooltipStr += '<b> ' + this.series.name +'</b><br>';\n tooltipStr += 'Title: ' + this.point.title + '<br/> Sentiment Score: ' + this.point.sentimentValue +\n '<br/> Rating: ' + this.point.rating + '<br/> Cost(USD): ' + this.point.price;\n\n tooltipStr += '</div>';\n return tooltipStr;\n },\n crosshairs: true,\n // headerFormat: '<b>{series.name}</b><br>',\n // pointFormat: 'Title: {point.title} <br/> Sentiment Score: {point.sentimentValue} <br/> Rating: {point.rating}<br/> Cost(USD): {point.price}',\n // style: {\n // textOverflow: 'ellipsis'\n // }\n },\n title:{\n text: null\n },\n xAxis: {\n title: {\n enabled: true,\n text: 'Average Sentiment',\n style:{\n color: \"#ffffff\",\n fontSize: '13px'\n }\n },\n startOnTick: false,\n gridLineWidth: false,\n showFirstLabel: true,\n showLastLabel: true,\n lineColor: \"#ffffff\",\n labels:{\n style:{\n color: \"#ffffff\",\n fontSize: '12px'\n }\n }\n },\n yAxis: {\n title: {\n text: 'Average Rating',\n style:{\n color: \"#ffffff\",\n fontSize: '13px'\n }\n },\n gridLineWidth: false,\n showFirstLabel: false,\n showLastLabel: false,\n lineColor: \"#ffffff\",\n labels:{\n style:{\n color: \"#ffffff\",\n fontSize: '12px'\n }\n }\n },\n legend: {\n enabled: false\n // layout: 'vertical',\n // align: 'left',\n // verticalAlign: 'top',\n // x: 100,\n // y: 70,\n // floating: true,\n // backgroundColor: Highcharts.defaultOptions.chart.backgroundColor,\n // borderWidth: 1\n },\n plotOptions: {\n scatter: {\n marker: {\n radius: 8,\n states: {\n hover: {\n enabled: true,\n lineColor: 'rgb(100,100,100)'\n },\n select:{\n //fillColor: 'rgb(255,250,250,0.7)',\n fillColor: colour,\n lineWidth: 1,\n lineColor: '#ffffff',\n radius: 10\n }\n }\n },\n states: {\n hover: {\n marker: {\n enabled: false\n }\n }\n },\n tooltip: {\n crosshairs: true,\n },\n jitter:{\n x: 0.015,\n y: 0.01,\n }\n },\n series:{\n allowPointSelect: true,\n cursor: 'pointer',\n point: {\n events:{\n select: function(e) {\n\n $(\"#displayText\").html(e);\n var modal = document.getElementById(\"myModal\");\n modal.style.display = \"block\";\n var modaljq = $('#myModal');\n var span = document.getElementsByClassName(\"close\")[0];\n var spn3 = modaljq.find('.col-md-3');\n if(e.target.options.new_image == \"null\")\n spn3.empty().append('<img src=\"'+ e.target.options.image[0] +'\" height=\"64px\" width=\"64px\">');\n else\n spn3.empty().append('<img src=\"'+ e.target.options.new_image +'\" height=\"250px\" width=\"150px\">');\n modaljq.find('.modal-header h4').text(e.target.options.title);\n modaljq.find('.card button').unbind();\n modaljq.find('.card button').click(function() {\n window.open(\"https://www.amazon.com/dp/\"+e.target.options.asin+\"/\");\n });\n modaljq.find('.card h4').text(e.target.options.title);\n modaljq.find('.card .price').text(e.target.options.price);\n modaljq.find('.card #brand').text(\"Brand - \" + e.target.options.brand);\n\n // var text = \"\";\n // for (var i=0; i< e.target.options.reviews.length;i++){\n // text = e.target.options.reviews[i]['reviewText'] + \" \"+ text ;\n // }\n // console.log(text);\n var text = e.target.options.wordcloud;\n var lines = text.split(/[,\\. ]+/g);\n var data = Highcharts.reduce(lines, function (arr, word) {\n var obj = Highcharts.find(arr, function (obj) {\n return obj.name === word;\n });\n if (obj) {\n obj.weight += 1;\n } else {\n arr.push({\n name: word,\n weight: 1\n });\n }\n return arr;\n }, []);\n\n data.sort(function(a,b){\n if(a['weight'] > b['weight']) return -1;\n if(a['weight'] < b['weight']) return 1;\n return 0;\n });\n\n\n\n data = data.slice(0, 40);\n\n // Highcharts.chart('worcloud-container', {\n // series: [{\n // type: 'wordcloud',\n // data: data,\n // name: 'Occurrences'\n // }],\n // title: {\n // text: 'Wordcloud of the product reviews'\n // }\n // });\n var makeScale = function (domain, range) {\n var minDomain = domain[0];\n var maxDomain = domain[1];\n var rangeStart = range[0];\n var rangeEnd = range[1];\n\n return (value) => {\n return rangeStart + (rangeEnd - rangeStart) * ((value - minDomain) / (maxDomain - minDomain));\n }\n };\n /**\n * Find min and max weight using reduce on data array\n */\n var minWeight = data.reduce((min, word) =>\n (word.weight < min ? word.weight : min),\n data[0].weight\n );\n var maxWeight = data.reduce((max, word) =>\n (word.weight > max ? word.weight : max),\n data[0].weight\n );\n var scale = makeScale([minWeight, maxWeight], [0.3, 1]);\n /**\n * creating a new, scaled data array\n */\n var scaledData = data.map(word =>\n ({ name: word.name, weight: word.weight, color: `rgb(0,0,0,${scale(word.weight)})` })\n );\n\n Highcharts.chart('worcloud-container', {\n series: [{\n type: 'wordcloud',\n data: scaledData,\n rotation: {\n from: 0,\n to: 0,\n },\n minFontSize: 7,\n style: {\n fontFamily: 'Arial',\n },\n name: 'Occurrences'\n }],\n exporting: {\n enabled: false\n },\n chart:{\n events: {\n click: null,\n }\n },\n title: {\n text: 'Wordcloud of the product review',\n style :{\n color:'#000000',\n fontWeight: \"bold\"\n }\n }\n });\n }\n }\n }\n }\n },\n exporting: {\n enabled: false\n },\n series: [{\n data: processChartData(null),\n color: colour,\n name: 'Amazon Fashion'\n }]\n })\n\n }, 3000);\n\n}", "title": "" }, { "docid": "333b9a923b9575c22f4821a0367fa995", "score": "0.51611686", "text": "addDots(){\n //find first data column\n const First = this.allGroup[1]\n const Initial = this.data.map(function(d){return {time: d.time, value:d[First]} })\n\n //create points and append them\n this.dot = this.plot\n .selectAll(\"circle\")\n .data(Initial)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", (d => this.xScale(+d.time)))\n .attr(\"cy\", (d => this.yScale(+d.value)))\n .attr(\"r\", 5)\n .style(\"fill\", \"#69b3a2\")\n .on(\"mouseover\",this.mouseover)\n .on(\"mousemove\",this.mousemove)\n .on(\"mouseleave\",this.mouseleave)\n\n}", "title": "" }, { "docid": "568a14d1d634aa776033a5d1629219b7", "score": "0.5154035", "text": "function drawChart(data) {\n var svgWidth = 1200, svgHeight = 600;\n var margin = { top: 20, right: 20, bottom: 30, left: 50 };\n var width = svgWidth - margin.left - margin.right;\n var height = svgHeight - margin.top - margin.bottom;\n \n var svg = d3.select('svg')\n .attr(\"width\", svgWidth)\n .attr(\"height\", svgHeight);\n \n var g = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n \n var x = d3.scaleTime()\n .rangeRound([0, width]);\n \n var y = d3.scaleLinear()\n .rangeRound([height, 0]);\n\n var focus = svg.append(\"g\") // **********\n .style(\"display\", \"none\"); \n\n focus.append(\"circle\") // **********\n .attr(\"class\", \"y\") // **********\n .style(\"fill\", \"none\") // **********\n .style(\"stroke\", \"blue\") // **********\n .attr(\"r\", 4); \n \n var line = d3.line()\n .x(function(d) { return x(d.date)})\n .y(function(d) { return y(d.value)})\n x.domain(d3.extent(data, function(d) { return d.date }));\n y.domain(d3.extent(data, function(d) { return d.value }));\n \n g.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x))\n .select(\".domain\");\n\n \n g.append(\"g\")\n .call(d3.axisLeft(y))\n .append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \"0.71em\")\n .attr(\"text-anchor\", \"end\")\n .text(\"Price ($USD)\");\n \n g.append(\"path\")\n .datum(data)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"steelblue\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"stroke-width\", 1.5)\n .attr(\"d\", line);\n}", "title": "" }, { "docid": "5b41d32b69557e9888b804bede385095", "score": "0.5150679", "text": "function regLine(x) {\n return (parseFloat(x) * slope) + intercept;\n }", "title": "" }, { "docid": "c2a979b485caabad64fad7d353e89859", "score": "0.51467204", "text": "addLine() {\n\n //find first data column\n const First = this.allGroup[1]\n const Initial = this.data.map(function(d){return {time: d.time, value:d[First]} })\n\n //create line and append it\n this.line = this.plot\n .append('path')\n // use data stored in `this`\n .datum(Initial)\n .classed('line',true)\n .attr('d',d3.line()\n .x(d => this.xScale(+d.time))\n .y(d => this.yScale(+d.value)))\n .attr(\"stroke\", \"black\")\n .style(\"stroke-width\", 2)\n .style(\"fill\", \"none\")\n}", "title": "" }, { "docid": "f424fe751b8e8997195898d34a6bdd1c", "score": "0.51370806", "text": "function drawBackgroundColor(deathMX) {\n //console.log(deathMX)\n let datosDeath = []\n for (let i = 0; i < deathMX.length; i++) {\n datosDeath.push([i, parseInt(deathMX[i])])\n if (i == deathMX.length - 1) {\n //console.log(datosDeath)\n }\n }\n var data = new google.visualization.DataTable();\n data.addColumn('number', \"Days\");\n data.addColumn('number', 'Mexico');\n\n data.addRows(datosDeath);\n\n var options = {\n colors: [\"green\"],\n hAxis: {\n title: '# of Days since the 100th Case'\n },\n vAxis: {\n title: 'Total Deaths'\n },\n legend: {\n position: \"top\"\n },\n chartArea: { width: \"75%\" },\n\n trendlines: {\n 0: {\n type: \"exponential\",\n showR2: true,\n visibleInLegend: true,\n color: \"red\",\n lineWidth: 10,\n opacity: 0.2,\n }\n }\n };\n\n var chart = new google.visualization.LineChart(document.getElementById(\"graficaGoogle\"));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "7c75d88f25f81e2f33b4b06891c39950", "score": "0.513504", "text": "getExponentialPoints(trendline, points, xValues, yValues, series, slopeInterceptExp) {\n const midPoint = Math.round((points.length / 2));\n const ptsExp = [];\n const x1 = xValues[0] - trendline.backwardForecast;\n const y1 = slopeInterceptExp.intercept * Math.exp(slopeInterceptExp.slope * x1);\n const x2 = xValues[midPoint - 1];\n const y2 = slopeInterceptExp.intercept * Math.exp(slopeInterceptExp.slope * x2);\n const x3 = xValues[xValues.length - 1] + trendline.forwardForecast;\n const y3 = slopeInterceptExp.intercept * Math.exp(slopeInterceptExp.slope * x3);\n ptsExp.push(this.getDataPoint(x1, y1, series, ptsExp.length));\n ptsExp.push(this.getDataPoint(x2, y2, series, ptsExp.length));\n ptsExp.push(this.getDataPoint(x3, y3, series, ptsExp.length));\n return ptsExp;\n }", "title": "" }, { "docid": "7c28964e24270b75c47a2837b4801080", "score": "0.5134437", "text": "function plotData(map) {\n // get population data as array\n let pop_data = data.map((row) => +row[\"pop_mlns\"]);\n let pop_limits = d3.extent(pop_data);\n // make size scaling function for population\n let pop_map_func = d3.scaleLinear()\n .domain([pop_limits[0], pop_limits[1]])\n .range([3, 20]);\n\n // mapping functions\n let xMap = map.x;\n let yMap = map.y;\n\n // make tooltip\n let div = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n // add circles\n svgScatterPlot.selectAll('circle')\n .data(data)\n .enter()\n .append('circle')\n .attr('cx', xMap)\n .attr('cy', yMap)\n .attr('r', (d) => pop_map_func(d[\"pop_mlns\"]))\n .attr('fill', \"#4286f4\")\n // add tooltip functionality to points\n .on(\"mouseover\", (d) => {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div.html(d.location + \"<br/>\" + numberWithCommas(d[\"pop_mlns\"]*1000000))\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n //makeLineGraph(d[\"location\"]);\n })\n .on(\"mouseout\", (d) => {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n}", "title": "" }, { "docid": "528536895dbde0146d99a77a9d584acd", "score": "0.5128105", "text": "function addNewPoint(pointType, competitorName, newX, newY, newPointCategory) {\n var xScale = rawDataObject.xScale,\n yScale = rawDataObject.yScale,\n\t\tpointData = rawDataObject.pointData,\n\t\tminPriceX = rawDataObject.minPriceX,\n minRangeX = rawDataObject.minRangeX,\n maxRangeX = rawDataObject.maxRangeX,\n minRangeY = rawDataObject.minRangeY,\n maxRangeY = rawDataObject.maxRangeY,\n\t\tsettings = rawDataObject.settings,\n\t\txName = settings.xName,\n yName = settings.yName,\n\t\tformat = d3.format(\",f\");\n\n\t// Initialize tooltip for new point\n\tvar newPointTooltip = d3.select(\"#data_visualization\").append(\"div\").attr(\"class\", \"tooltip\");\n\t// Calculate predicted y and grid deviation\n\tfor (var i = 0; i < pointData.length; i++) {\n\t\tif (pointData[i][\"category\"] == newPointCategory) {\n\t\t\tif (pointType == \"askPrice\" || pointType == \"compPrice\") {\n\t\t\t\tif (isNaN(newX) & isNaN(newY)) {\n\t\t\t\t\treturn;\n\t\t\t\t} else if (isNaN(newX) || isNaN(newY)) {\n\t\t\t\t\t$.alert(\"Please specify values for both axes!\");\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tvar predY = pointData[i][\"intercept\"] + pointData[i][\"slope\"] * log10(newX);\n\t\t\t\t\tvar gridDev = (newY - predY) / predY;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isNaN(newX) & isNaN(newY)) {\n\t\t\t\t\t$.alert(\"At most one empty field is allowed!\");\n\t\t\t\t\treturn;\n\t\t\t\t} else if (isNaN(newX) & !isNaN(newY)) {\n\t\t\t\t\tvar predY = newY;\n\t\t\t\t\tvar predX = Math.pow(10, (predY - pointData[i][\"intercept\"]) / pointData[i][\"slope\"]);\n\t\t\t\t} else if (!isNaN(newX) & isNaN(newY)) {\n\t\t\t\t\tvar predX = newX;\n\t\t\t\t\tvar predY = pointData[i][\"intercept\"] + pointData[i][\"slope\"] * log10(predX);\n\t\t\t\t} else {\n\t\t\t\t\tvar predX = newX;\n\t\t\t\t\tvar predY = newY;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Add new point to svg\n\td3.select(\"g\").append(\"g\").attr(\"class\", \"newpoints\");\n\tif (pointType == \"askPrice\") { // if new customer ask price\n\t\tvar newPoint = d3.select(\".newpoints\").append(\"path\").attr(\"d\", d3.svg.symbol().type(\"diamond\").size(100));\n\t} else if (pointType == \"compPrice\") {\n\t\tvar newPoint = d3.select(\".newpoints\").append(\"path\").attr(\"d\", d3.svg.symbol().type(\"cross\").size(100));\n\t} else { // if new grid point\n\t\tvar newPoint = d3.select(\".newpoints\").append(\"path\").attr(\"d\", d3.svg.symbol().type(\"square\").size(100));\n\t}\n\tnewPoint.attr(\"id\", \"new_point_\" + newX.toString().replace(/\\./g, \"_\") + \"_\" + newY.toString().replace(/\\./g, \"_\"))\n\t\t.attr(\"class\", \"new_dot\")\n\t\t.style(\"zIndex\", 10)\n\t\t.style(\"fill\", $(\"#legend_\" + newPointCategory.replace(/'|;| /g, \"\") + \" rect\").attr(\"fill\"))\n\t\t.style(\"stroke\", \"black\")\n\t\t.style(\"stroke-width\", \"2px\")\n\t\t.on(\"contextmenu\", function () {\n\t\t\td3.event.preventDefault(); // prevent right click menu from showing\n\t\t\td3.select(this).remove(); // remove dot\n\t\t\td3.select(\"#comp_price_text_\" + newX.toString().replace(/\\./g, \"_\") + \"_\" + newY.toString().replace(/\\./g, \"_\")).remove(); // remove text\n\t\t\td3.select(\"#new_point_tooltip_\" + newX.toString().replace(/\\./g, \"_\") + \"_\" + newY.toString().replace(/\\./g, \"_\")).remove(); // remove associated tooltip\n\t\t\tif (pointType == \"newPoint\") {\n\t\t\t\tvar id = pointType + \"| \" + newPointCategory + \"| \" + competitorName + \"| \" + predX + \"| \" + predY;\n\t\t\t} else {\n\t\t\t\tvar id = pointType + \"| \" + newPointCategory + \"| \" + competitorName + \"| \" + newX + \"| \" + newY;\n\t\t\t}\n\t\t\tdelete rawDataObject.newPointList[id];\n\t\t})\n\t\t.on(\"mouseover\", function () {\n\t\t\tvar tooltipText = \"\";\n\t\t\tif (pointType == \"askPrice\") {\n\t\t\t\ttooltipText += \"<u>Customer Ask Price</u><br/>\" + xName + \": \" + format(newX) + \"<br/>\" + yName + \": \" + newY.toFixed(2) + \"<br/>\";\n\t\t\t\ttooltipText += \"Predicted \" + yName + \": \" + predY.toFixed(2) + \"<br/>\" + \"Grid Deviation: \" + gridDev.toFixed(2);\n\t\t\t} else if (pointType == \"compPrice\") {\n\t\t\t\ttooltipText += \"<u>Competitor Price</u><br/>\";\n\t\t\t\ttooltipText += (competitorName == \"\" ? \"\" : \"Competitor Name: \" + competitorName + \"<br/>\");\n\t\t\t\ttooltipText += \"Competitor Revenue: \" + format(newX) + \"<br/>\" + \"Competitor Price: \" + newY.toFixed(2) + \"<br/>\";\n\t\t\t\ttooltipText += \"Predicted Competitor Price: \" + predY.toFixed(2) + \"<br/>\" + \"Grid Deviation: \" + gridDev.toFixed(2);\n\t\t\t} else {\n\t\t\t\ttooltipText += \"<u>New Grid Point</u><br/>\" + \"Predicted \" + xName + \": \" + format(predX) + \"<br/>\";\n\t\t\t\ttooltipText += \"Predicted \" + yName + \": \" + predY.toFixed(2) + \"<br/>\";\n\t\t\t}\n\t\t\tnewPointTooltip.attr(\"id\", \"new_point_tooltip_\" + newX.toString() + \"_\" + newY.toString().replace(/\\./g, \"_\")).transition().style(\"opacity\", 0.9).style(\"display\", \"block\");\n\t\t\tnewPointTooltip.html(tooltipText)\n\t\t\t\t.style(\"left\", ($(this).position()[\"left\"] + 15) + \"px\")\n\t\t\t\t.style(\"top\", ($(this).position()[\"top\"] - 30) + \"px\");\n\t\t})\n\t\t.on(\"mouseout\", function () {\n\t\t\tnewPointTooltip.transition().style(\"opacity\", 0).style(\"display\", \"none\");\n\t\t});\n\tif ($.inArray(pointType, [\"askPrice\", \"compPrice\"]) > -1) {\n\t\t// Pass new point information to global\n\t\tvar id = pointType + \"| \" + newPointCategory + \"| \" + competitorName + \"| \" + newX + \"| \" + newY;\n\t\trawDataObject.newPointList[id] = {\"type\":pointType, \"category\":newPointCategory, \"compName\":competitorName, \"x\":newX, \"y\":newY};\n\t\t// Move point to position\n\t\tvar textLabel = d3.select(\".newpoints\").append(\"text\").text(competitorName)\n\t\t\t.attr(\"id\", \"comp_price_text_\" + newX.toString() + \"_\" + newY.toString().replace(/\\./g, \"_\"))\n\t\t\t.attr(\"fill\", $(\"#legend_\" + newPointCategory.replace(/'|;| /g, \"\") + \" rect\").attr(\"fill\"))\n\t\t\t.style(\"font-size\", \"14px\")\n\t\t\t.style(\"stroke\", \"black\")\n\t\t\t.style(\"stroke-width\", \"0.5px\");\n\t\ttextLabel.transition().duration(1000).ease(\"elastic\").attr(\"transform\", function (d) {return \"translate(\" + (xScale(newX) + 12) + \",\" + (yScale(newY) + 5) + \")\";});\n\t\tnewPoint.transition().duration(1000).ease(\"elastic\").attr(\"transform\", function (d) {return \"translate(\" + xScale(newX) + \",\" + yScale(newY) + \")\";});\n/*\t\tnewPoint.on(\"click\", function (d) {\n\t\t\trawDataObject.competitorCategory = newPointCategory;\n\t\t\trawDataObject.competitorRevenue = newX;\n\t\t\t$(\".externalObject\").remove();\n\t\t\tvar clickCoord = d3.mouse(this);\n\t\t\tvar divText = \"\";\n\t\t\tdivText += \"<div id=competitor_price_div class=externalTextbox><b>Add Competitor Price for:</b><br/>\";\n\t\t\tdivText += newPointCategory + \"<br/>\";\n\t\t\tdivText += \"Competitor Revenue: \" + format(newX) + \"<br/>\";\n\t\t\tdivText += \"<input type='text' id=competitor_name class=externalTextbox placeholder='enter competitor name'></input><br/>\";\n\t\t\tdivText += \"<input type='text' id=competitor_price class=externalTextbox placeholder='enter competitor price' onchange=addCompetitorPrice()></input></div>\";\n\t\t\t\n\t\t\td3.select(\"svg\").append(\"foreignObject\")\n\t\t\t\t.attr(\"class\", \"externalObject\")\n\t\t\t\t.attr(\"x\", (xScale(newX) - 10) + \"px\")\n\t\t\t\t.attr(\"y\", (yScale(newY) - 60) + \"px\")\n\t\t\t\t.attr(\"width\", 300)\n\t\t\t\t.attr(\"height\", 150)\n\t\t\t\t.append(\"xhtml:div\")\n\t\t\t\t.html(divText);\n\t\t});\n*/\n\t} else {\n\t\t// Pass new point information to global\n\t\tvar id = pointType + \"| \" + newPointCategory + \"| \" + competitorName + \"| \" + predX + \"| \" + predY;\n\t\trawDataObject.newPointList[id] = {\"type\":pointType, \"category\":newPointCategory, \"compName\":competitorName, \"x\":predX, \"y\":predY};\n\t\t// Move point to position\n\t\tnewPoint.transition().duration(1000).ease(\"elastic\").attr(\"transform\", function (d) {return \"translate(\" + xScale(predX) + \",\" + yScale(predY) + \")\";});\n\t}\n\t$(\"#new_point_div\").hide();\n}", "title": "" }, { "docid": "825c69f8dbdc095a868c8724ec7a9a1a", "score": "0.5119641", "text": "function renderScatterChart(myData, id, xAxisCol, yHeightCol, location){\n\n console.log(myData);\n console.log(myData[0]);\n \n\n d3.select(\"#\"+ id).selectAll(\"svg\").remove();\n\n var svgWidth = 737;\n var svgHeight = 463;\n\n \n var margin = {\n top: 20,\n right: 20,\n bottom: 30,\n left: 60\n };\n \n\n const svg = d3.select(\"#\" + id)\n .append(\"svg\")\n .attr(\"width\", svgWidth)\n .attr(\"height\", svgHeight);\n\n // Append an SVG group\n var chartGroup = svg.append(\"g\")\n .attr(\"transform\", `translate(${margin.left}, ${margin.top})`); \n \n var width = svgWidth - margin.left - margin.right;\n var height = svgHeight - margin.top - margin.bottom; \n\n // Create scaling functions\n var xLinearScale = d3.scaleLinear()\n // .domain([0, d3.max(myData, d => d[xAxisCol])])\n .domain([0, 100])\n .range([0, width]);\n\n var yLinearScale = d3.scaleLinear()\n // .domain([0, d3.max(myData, d => d[yHeightCol])])\n .domain([0, 40000])\n .range([height, 0]);\n\n \n // Create axis functions\n var bottomAxis = d3.axisBottom(xLinearScale);\n var leftAxis = d3.axisLeft(yLinearScale);\n\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([10, -15])\n .html(function(d) {\n // console.log(d)\n return (`<div style=\"background-color: black;\"><p class=\"toolTip\" style=\"margin-top: 0em; margin-bottom: 0em;\">${d.child}</p><hr style=\"border-color: azure; margin-top: 0em; margin-bottom: 0em;\"><p class=\"toolTip\" style=\"margin-top: 0em; margin-bottom: 0em;\">Accidents : ${d.value}</p><p class=\"toolTip\" style=\"margin-top: 0em; margin-bottom: 0em;\">Population: ${d.population}</p><div>`);\n });\n\n // https://github.com/Caged/d3-tip/issues/187\n // Step 2: Create the tooltip in chartGroup.\n chartGroup.call(toolTip);\n\n // Add x-axis\n var xAxis = chartGroup.append(\"g\")\n .attr(\"transform\", `translate(0, ${height})`)\n .call(bottomAxis);\n\n // Add y1-axis to the left side of the display\n var yAxis = chartGroup.append(\"g\")\n // Define the color of the axis text\n .classed(\"green\", true)\n .call(leftAxis);\n\n // append initial circles\n var circlesGroup = chartGroup.selectAll(\"circle\")\n .data(myData)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", d => xLinearScale(d[xAxisCol]))\n // .attr(\"cy\", d => yLinearScale(d[yHeightCol]))\n .attr(\"cy\", function(d){\n // console.log(d);\n return yLinearScale(d[yHeightCol]);\n })\n .attr(\"r\", 10)\n .attr(\"fill\", \"#00008b\")\n .attr(\"opacity\", \".9\"); \n\n // here I am using .text in selectALl; there is no such class as such called .text\n // but if I use text, there are already other text attributes exists in html page\n // due to which when I am doing data binding, and calling enter()\n // it is considering prior text dom elements and ignoring them\n // so enter method is finding only few orphan text and binding data against it\n // which is in-correct. we need d3 to bind all data points to new text\n // and to ignore earlier existing text dom elements\n // since in below case there is no .text class exists, d3 will consider no \n // dom elements exists for data bind, so it will create those many dom elements\n // [by calling append method ] based on available data elemeents\n// var textGroups = chartGroup.selectAll(\".text\")\n// .data(data)\n// .enter()\n// .append(\"text\")\n// // .attr(\"x\", d => xLinearScale(d.poverty))\n// .attr(\"x\", function(d){\n// // console.log(d)\n// return xLinearScale(d.poverty)\n// })\n// .attr(\"y\", d => yLinearScale(d.healthcare)) \n// .text(d => d.abbr)\n// .attr(\"font-family\", \"sans-serif\")\n// .attr(\"font-size\", \"10px\")\n// .attr(\"fill\", \"white\")\n// .attr(\"weight\", \"bold\")\n// // https://stackoverflow.com/questions/16620267/how-to-center-text-in-a-rect-element-in-d3\n// .attr(\"text-anchor\", \"middle\");\n\ncirclesGroup.on(\"mouseover\", function(d){\n toolTip.show(d, this)\n })// onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n\n\n}//end of barTreeMap", "title": "" }, { "docid": "e293c149ab95fe3df6d492da9699dacc", "score": "0.5083118", "text": "function renderLineChart() {\n const svg = d3.select(\".line-chart\");\n\n // Value selectors\n const xValue = (d) => d.date;\n const yValue = (d) => d.new_confirmed;\n\n // console.log(xValue(covidData[0]));\n\n const height = +svg.attr(\"height\");\n const width = +svg.attr(\"width\");\n\n const margin = {\n top: 70,\n left: 100,\n right: 50,\n bottom: 80,\n };\n\n const innerHeight = height - margin.top - margin.bottom;\n const innerWidth = width - margin.left - margin.right;\n\n const numberFormat = (num) => d3.format(\".4s\")(num);\n\n const dates = [];\n for (let obj of covidData) {\n dates.push(new Date(obj.date));\n }\n // console.log(dates);\n\n // SCALES\n const xScale = d3.scaleTime().domain(d3.extent(dates)).range([0, innerWidth]);\n\n const yScale = d3\n .scaleLinear()\n .domain(d3.extent(covidData, (d) => yValue(d)))\n .range([innerHeight, 0]);\n\n const xAxis = d3.axisBottom(xScale).ticks(18).tickPadding(10);\n\n const yAxis = d3.axisLeft().scale(yScale).ticks(20);\n\n // APPENDING CONTENTS\n const g = svg\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left}, ${margin.top})`);\n\n // For line charts you dont have to do a data bind as you are only making a single path where the data points are the points you want that single line to pass through - need to make use of d3.line()\n\n const lineGenerator = d3\n .line()\n .x((d) => xScale(new Date(xValue(d)))) // NOTE: HAVE to convert to date object - using a string throws error\n .y((d) => yScale(yValue(d)))\n .curve(d3.curveBasis); // Rounds the edges so theyre not a jagged. Many other options to chose from\n\n // CREATING CUSTOM GRADIENT - one of many ways to do this\n // SVG gradients created w/ <lineargradient> which contains <stop> tags inside it which define at which point the colours begin and what the colour is\n g.append(\"linearGradient\")\n .attr(\"id\", \"line-gradient\") // ID needed so that the gradient can be attached to an element\n .attr(\"gradientUnits\", \"userSpaceOnUse\")\n .attr(\"x1\", 0)\n .attr(\"y1\", yScale(0))\n .attr(\"x2\", 0)\n .attr(\"y2\", yScale(d3.max(covidData, (d) => yValue(d))))\n .selectAll(\"stop\")\n .data([\n { offset: \"0%\", color: \"#1780A1\" },\n { offset: \"10%\", color: \"#2E6F95\" },\n { offset: \"20%\", color: \"#455E89\" },\n { offset: \"30%\", color: \"#5C4D7D\" },\n { offset: \"40%\", color: \"#723C70\" },\n { offset: \"50%\", color: \"#892B64\" },\n { offset: \"60%\", color: \"#A01A58\" },\n { offset: \"70%\", color: \"#B7094C\" },\n ])\n .enter()\n .append(\"stop\")\n .attr(\"offset\", function (d) {\n return d.offset;\n })\n .attr(\"stop-color\", function (d) {\n return d.color;\n });\n\n // console.log(lineGenerator(covidData));\n\n // CREATING RECTS IN THE BACKGROUND\n g.selectAll(\"rect\")\n .data(covidData)\n .enter()\n .append(\"rect\")\n // .attr(\"x\", (d) => xScale(xValue(d)))\n .attr(\"y\", (d) => yScale(yValue(d)))\n .attr(\"height\", (d) => innerHeight - yScale(yValue(d)))\n .attr(\"width\", innerWidth / covidData.length)\n .attr(\n \"transform\",\n (d, i) => `translate(${(innerWidth / covidData.length) * i},0)`\n )\n .attr(\"fill\", \"rgba(211, 211, 211, 0.678)\");\n\n // CREATING PATH\n g.append(\"path\")\n .attr(\"d\", lineGenerator(covidData))\n .attr(\"stroke\", \"url(#line-gradient)\") // ID of custom gradient\n .attr(\"stroke-width\", 3)\n .attr(\"stroke-linejoin\", \"round\") // Smoothes the joints\n .attr(\"fill\", \"none\");\n // AXES & LABELS\n\n // Tick customization is added where the axes are called\n const yAxisGroup = g.append(\"g\").call(yAxis);\n // Make grid lines\n yAxisGroup.selectAll(\".tick line\").attr(\"x2\", innerWidth);\n\n const xAxisGroup = g\n .append(\"g\")\n .attr(\"transform\", `translate(0,${innerHeight})`)\n .call(xAxis);\n\n xAxisGroup.selectAll(\".tick line\").attr(\"y2\", 10);\n\n // Y axis\n yAxisGroup\n .append(\"text\")\n .attr(\"fill\", \"black\") // NOTE: Originally appended in white for whatever reason\n .attr(\"y\", -55)\n .attr(\"x\", -innerHeight / 2)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"font-size\", \"1.5rem\")\n .attr(\"transform\", \"rotate(-90)\")\n .text(`Number of Cases`);\n\n // X Axis\n xAxisGroup\n .append(\"text\")\n .attr(\"fill\", \"black\")\n .attr(\"x\", innerWidth / 2)\n .attr(\"font-size\", \"1.5rem\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"y\", 60)\n .text(`Time`);\n\n // Heading\n svg\n .append(\"text\")\n .attr(\"fill\", \"black\")\n .text(`Covid Cases Per Day in RSA`)\n .attr(\"font-size\", \"2rem\")\n .attr(\"x\", width / 2)\n .attr(\"text-anchor\", \"middle\") // Done so that text is aligned exactly in the middle\n .attr(\"y\", 50);\n\n // Total\n svg\n .append(\"text\")\n .attr(\"fill\", \"black\")\n .text(\n `Total Cases : ${numberFormat(\n covidData.reduce((acc, day) => (acc += yValue(day)), 0)\n )}`\n )\n .attr(\"x\", width)\n .attr(\"y\", 100)\n .attr(\"text-anchor\", \"end\");\n}", "title": "" }, { "docid": "2596c76fa93dbfc482516801e585cebd", "score": "0.5082862", "text": "function line(df, options) {\n options = _.defaults(options || {}, { groupBy: false,\n strokeWidth: 2 });\n\n var xName = _.keys(df[0])[0];\n var yName = _.keys(df[0])[1];\n\n // TODO: assert that groupBy variable is actually in the df\n\n var vlSpec = {\n \"data\": { values: df },\n \"mark\": \"line\",\n \"config\": {\n \"mark\": { \"strokeWidth\": options.strokeWidth }\n },\n \"encoding\": {\n \"x\": { \"field\": xName, axis: { title: options.xLabel || xName }, \"type\": \"quantitative\" },\n \"y\": { \"field\": yName, axis: { title: options.yLabel || yName }, \"type\": \"quantitative\" }\n }\n };\n\n var filter = [];\n //var filteredDf = df;\n if (options.xBounds) {\n //filteredDf = _.filter(filteredDf, function(d){ return d[xName] >= min && d[xName] <= max });\n filter.push({ \"field\": xName, \"range\": options.xBounds });\n vlSpec.encoding.x.scale = { domain: options.xBounds, zero: false };\n }\n if (options.yBounds) {\n //filteredDf = _.filter(filteredDf, function(d){ return d[yName] >= min && d[yName] <= max });\n filter.push({ \"field\": yName, \"range\": options.yBounds });\n vlSpec.encoding.y.scale = { domain: options.yBounds, zero: false };\n }\n if (filter.length) {\n vlSpec.transform = { \"filter\": filter };\n }\n\n //vlSpec.data = {values: filteredDf};\n\n if (options.groupBy) {\n vlSpec.encoding.color = {\n field: options.groupBy,\n type: 'nominal'\n };\n }\n\n renderSpec(vlSpec, options);\n}", "title": "" }, { "docid": "20dc697ed7facfda6da48197cef11bbc", "score": "0.5082481", "text": "function jitteryLinePoints(x1, y1, x2, y2, dev, j, ctx) {\n\tvar points = [];\n\tvar step = j;\n\tvar t = step;\n\tvar Delta_x = Math.abs(x2 - x1);\n\tvar Delta_y = Math.abs(y2 - y1);\n\tvar theta = Math.atan(Delta_y/Delta_x);\n\tvar line_length = distanceFormula(x1, y1, x2, y2);\n\n\tpoints.push([x1, y1]);\n\n\t// for each pt' along the way, get a small, random d\n\twhile ((t + step) < line_length) {\n\t\tvar pts = alongLine(x1, y1, x2, y2, t);\n\t\tvar x_prime = pts[0];\n\t\tvar y_prime = pts[1];\n\t\tvar d = Math.random() * dev; \n\t\tvar new_y = y_prime - (d * Math.cos(theta));\n\t\tvar new_x = x_prime + (d * Math.sin(theta));\n\t\tpoints.push([new_x, new_y]);\n\t\tt += step;\n\t}\n\tpoints.push([x2, y2]);\n\treturn points;\n}", "title": "" }, { "docid": "c1e301c7a972c0487c97764919ef6056", "score": "0.50819737", "text": "function processScatterSeries(group, contentLayer) {\r\n // Group contains a subgroup for each series, so...\r\n for (var gNo = group.groupItems.length - 1; gNo >= 0; gNo--) {\r\n var seriesGroup = group.groupItems[gNo];\r\n if (seriesGroup.name.search('trendline') >= 0) {\r\n processScatterTrendlines(seriesGroup, contentLayer);\r\n } else {\r\n processOneScatterSeries(seriesGroup, contentLayer);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "23e07a694585b739a8b212c827024553", "score": "0.50791025", "text": "function make_line(d, i) {\r\n\r\n var source_x = partners.map(function (v) {\r\n if (d.source.name === v.target.name) {\r\n return (d.source.x + v.source.x) / 2;\r\n }\r\n }).filter(function(e) {\r\n return e !== undefined;\r\n });\r\n\r\n linedata = [{\r\n x: d.target.x,\r\n y: d.target.y\r\n }, {\r\n x: d.source.x,\r\n y: d.source.y\r\n }];\r\n\r\n var fun = d3.svg.line().x(function (d) {\r\n return d.x;\r\n }).y(function (d) {\r\n return d.y;\r\n }).interpolate(\"linear\");\r\n return fun(linedata);\r\n}", "title": "" }, { "docid": "5c8d4e66bda194455572ff6b5c64fed9", "score": "0.5075065", "text": "function plotUsersData(days) {\n\t\t$scope.usersTrendCCO.series = [];\n\t\tvar eUsers = {'name': 'Existing', 'data':[], color: '#1F77B4'};\n\t\tvar nUsers = {'name': 'New', 'data':[], color: '#FF7F0E'};\n\t\tfor (var i = 0; i < days; i++) {\n\t\t\tvar d = moment($scope.usersTrend.dateRange.startDate).add(i, 'days').unix()*1000;\n\t\t\teUsers.data.push([d, getRandomIntFromInterval(3000, 15000)]);\n\t\t\tnUsers.data.push([d, getRandomIntFromInterval(0, 4000)]);\n\t\t}\n\t\t$scope.usersTrendCCO.series.push(eUsers);\t\n\t\t$scope.usersTrendCCO.series.push(nUsers);\t\n\t\t$scope.usersTrendCCO.options.chart.type = 'line';\n\t\t$scope.usersTrendCCO.options.legend.enabled = true;\n\t}", "title": "" }, { "docid": "4c4d67987b89bd93cea8126b95c0572b", "score": "0.5066609", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Year', 'Sales', 'Expenses'],\n ['2013', 5000, 1000],\n ['2014', 100, 5000],\n ['2015', 8000, 1900],\n ['2016', 12000, 1000]\n ]);\n\n var options = {\n title: 'Company Performance',\n curveType: 'function',\n legend: { position: 'bottom' }\n }\n \n var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));\n\n chart.draw(data, options);\n \n \t}", "title": "" } ]
058984042e4b08306a62885f7defcddd
unused harmony export tagClassForUri This is a port of: Parse and return the entity class for a given source URI.
[ { "docid": "59d4ac415ca7880a6466b9b92d9614a3", "score": "0.6787128", "text": "function tagClassForUri(uri) {\n if (!uri) {\n return null;\n }\n const regex = /\\/topics\\/(?:virtual:)?([A-Za-z_+-].+)\\//;\n const matches = regex.exec(uri);\n if (!matches) {\n return null;\n }\n\n if (matches.length > 1) {\n return matches[1];\n } else {\n return null;\n }\n}", "title": "" } ]
[ { "docid": "11fbc61d7084a1d70696cee2af73b7d1", "score": "0.68130606", "text": "function tagClassForUri(uri) {\n if (!uri) {\n return null;\n }\n const regex = /\\/topics\\/(?:virtual:)?([A-Za-z_+-].+)\\//;\n const matches = regex.exec(uri);\n\n if (!matches) {\n return null;\n }\n\n if (matches.length > 1) {\n return matches[1];\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "2191d26cbfa8d43d0cb9799829122245", "score": "0.51352143", "text": "parse_class (token) {\n let clazz = token.peek()\n if (!clazz.match(/^[_a-zA-Z$][_a-zA-Z$0-9]*(?:\\.[_a-zA-Z$][_a-zA-Z$0-9]*)*$/))\n throw new Error(`validate: parse error: invalid class type \"${clazz}\"`)\n token.skip()\n return { type: \"class\", name: clazz }\n }", "title": "" }, { "docid": "f1058f09b737fa8f0f71e2934a4496cc", "score": "0.48109826", "text": "function convertEntity(entity) {\n switch (entity[0]) {\n case '\"': return { literal: entity };\n case '_': return { blank: entity.replace('b', '') };\n default: return { token: 'uri', value: entity, prefix: null, suffix: null };\n };\n}", "title": "" }, { "docid": "bc4a8a66d9cb78e9d95bb2cd12e9f38e", "score": "0.47098333", "text": "getClassName(){return \"BayrellLang.LangBay.HtmlToken\";}", "title": "" }, { "docid": "24bbb29000f3ba73556ad3c515c98cf8", "score": "0.46617624", "text": "function getNameFromUri(uri) {\n return uri.replace(/http:\\/\\//g, \"\").replace(/.tumblr\\.com/g, \"\").replace(/media|data|www/g, \"\");\n }", "title": "" }, { "docid": "7d40b4fadeba09d1b68a097005516062", "score": "0.46098533", "text": "function parse_uri_into_search_engine (s) {\n\tlet m;\n\n\t// Some replacement because damn it, template strings. Taken from here:\n\t// https://source.chromium.org/chromium/chromium/src/+/master:components/search_engines/template_url.cc;drc=df87046cb8ae4dbd62cda6e56d317016a6fa02c7;l=695\n\ts = s.replace('{google:pathWildcard}', '');\n\n\t// Try to find the domain name\n\tm = /:\\/\\/(.*?)\\/(.*)/.exec(s);\n\tif (m === null) { return \"domain\" }\n\n\tlet domain = m[1];\n\ts = m[2];\n\n\t// Try to get path\n\tm = /(.*)\\?(.*)/.exec(s);\n\tif (m === null) { return \"path\" }\n\n\tlet path = m[1];\n\ts = m[2];\n\n\t// Try to get key\n\tm = /(?:^|&)([^&]+)=%s/.exec(s);\n\tif (m === null) { return \"key\" }\n\n\tlet key = m[1];\n\n\treturn new SearchEngine(domain, path, key)\n}", "title": "" }, { "docid": "9739637cde74e4e5502ce22900d58a9a", "score": "0.46075186", "text": "function getClass(){\n\n\t}", "title": "" }, { "docid": "0aae67a53d248b45cc42c7bf4355f537", "score": "0.45899564", "text": "get _type() {\n let result = \"LinkEntity\";\n if (this.constructor && this.constructor.name) {\n result = this.constructor.name;\n }\n return result;\n }", "title": "" }, { "docid": "0aae67a53d248b45cc42c7bf4355f537", "score": "0.45899564", "text": "get _type() {\n let result = \"LinkEntity\";\n if (this.constructor && this.constructor.name) {\n result = this.constructor.name;\n }\n return result;\n }", "title": "" }, { "docid": "b47a839e99fccb3b0aecae6e6840bb92", "score": "0.4555434", "text": "function _getEntityClass(entityJSON) {\n if (entityJSON.url || entityJSON.learningObjectives || entityJSON.title) {\n validatorService.validateLearningObject(entityJSON);\n return 'LearningObject'\n } else {\n validatorService.validateFolder(entityJSON);\n return 'Folder'\n }\n}", "title": "" }, { "docid": "864c2e9118d66c4b2ca9fab75c84c87c", "score": "0.45331836", "text": "get uri() {\n return this.getStringAttribute('uri');\n }", "title": "" }, { "docid": "69cfa089b827aee99f8968c3273817ce", "score": "0.44451198", "text": "function parse(uri) {\n var result = { baseUri: '', fragment: '#' };\n\n if (uri.slice(0, 4).toLowerCase() === 'urn:') {\n result.kind = 'urn';\n var parts = uri.match(URN_REGEX);\n if (parts) {\n result.baseUri = parts[1] + (parts[2] || '');\n result.host = parts[1];\n if (parts[2]) { result.pathname = parts[2]; }\n if (parts[3]) { result.fragment = parts[3]; }\n }\n } else {\n result.kind = 'url';\n var parsed = url.parse(uri);\n if (parsed.hash) {\n result.fragment = parsed.hash;\n delete parsed.hash;\n }\n result.absolute =\n (parsed.host && parsed.pathname && parsed.pathname[0] === '/') ?\n true : false;\n result.baseUri = url.format(parsed);\n }\n\n return result;\n}", "title": "" }, { "docid": "580f8b8a7dae9933aee928f6df56940f", "score": "0.4430609", "text": "function getContentClass(asset) {\n\n // Validate we have something to work with.\n if (!asset.contentClass) {\n $log.error('Playback: no content class supplied', asset);\n return null;\n }\n\n // Normalize incoming content class.\n return asset.contentClass.toLowerCase();\n }", "title": "" }, { "docid": "5910d965fd0b8099b8b4da56eb59d8bb", "score": "0.43955597", "text": "function intentClass(intent) {\r\n // debugger;\r\n if (intent == null || intent === Intent.NONE) {\r\n return undefined;\r\n }\r\n return NS + \"-intent-\" + intent.toLowerCase();\r\n}", "title": "" }, { "docid": "a6e69d5c5d85fd23d7bdff94f60e1e29", "score": "0.43742996", "text": "function getClassFromCard(card){\n return card[0].firstChild.className;\n }", "title": "" }, { "docid": "5e4fcfbd24d589d937de8a27386ec032", "score": "0.43739432", "text": "getClassParent(ast) {\n }", "title": "" }, { "docid": "90fd4711c7217a68b9fd8f41a18c9493", "score": "0.4370234", "text": "function create(uri) {\r\n return { uri: uri };\r\n }", "title": "" }, { "docid": "1d6e467f217aee803a4885f35fb30f27", "score": "0.43645975", "text": "function getClassForEdge(classHash){\n let userIMLEdits = pattern.userIMLEdits\n if(userIMLEdits.hasOwnProperty(classHash)) return userIMLEdits[classHash].classes\n else return CLASS_UNRATED\n}", "title": "" }, { "docid": "0cd7077e37f5106756101b569a769b31", "score": "0.4358819", "text": "resolveComponentClass(component, type) {\n switch (type) {\n case 'component':\n return component;\n case 'function':\n return this.resolvePureComponentClass(component);\n case 'symbol':\n return this.resolveLoadedClass(String(component).slice(7, -1));\n default:\n throw new Error(`Unsupported component type: ${type}`);\n }\n }", "title": "" }, { "docid": "5b24e868d2e58458c7d9ad3d4b3d9850", "score": "0.43578616", "text": "function create(uri) {\n return { uri: uri };\n }", "title": "" }, { "docid": "43de7120f35a72fe150cac111668b300", "score": "0.4348146", "text": "static getEntityFromQN(query) {\n\t\tfor (let entity of model.getAllEntities().values()) {\n\t\t\tif (entity.qualifiedName == query) return entity;\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "8ec07d35e1f2b88c20032cff06b62bd3", "score": "0.43320066", "text": "function parseAndGetType(type, fqdn) {\n if (/\\[.+?\\]/.test(type)) {\n return type.replace(/\\[(.+?)\\]/g, (match, entity) => getLinkToDocEntity(entity, fqdn))\n } else {\n return type;\n }\n}", "title": "" }, { "docid": "dfea8b3de1fe42d09ccfddd49c9bfff1", "score": "0.43274418", "text": "function makeClassFromName(name) {\n return name.replace('[', '').replace(']', '');\n }", "title": "" }, { "docid": "731332498cb7a5e2cba7e75609e1f974", "score": "0.43171197", "text": "scan_tag_uri(name, start_mark) {\n var char, chunks, length;\n chunks = [];\n length = 0;\n char = this.peek(length);\n while (('0' <= char && char <= '9') || ('A' <= char && char <= 'Z') || ('a' <= char && char <= 'z') || indexOf.call('-;/?:@&=+$,_.!~*\\'()[]%', char) >= 0) {\n if (char === '%') {\n chunks.push(this.prefix(length));\n this.forward(length);\n length = 0;\n chunks.push(this.scan_uri_escapes(name, start_mark));\n } else {\n length++;\n }\n char = this.peek(length);\n }\n if (length !== 0) {\n chunks.push(this.prefix(length));\n this.forward(length);\n length = 0;\n }\n if (chunks.length === 0) {\n throw new exports.ScannerError(`while parsing a ${name}`, start_mark, `expected URI but found ${char}`, this.get_mark());\n }\n return chunks.join('');\n }", "title": "" }, { "docid": "3e00da90c945f766a8aff7576171024f", "score": "0.4313307", "text": "function getFormat(uri) {\n const parts = uri.split(/\\./g);\n const format = parts[parts.length - 1];\n return format;\n}", "title": "" }, { "docid": "a64328fc7aa39504f98891ac3ebabcc4", "score": "0.43129274", "text": "function Dependency(uri) {\n if (!(this instanceof Dependency)) return new Dependency(uri)\n\n this.uri = uri\n // basename\n this.type =\n this.basename = path.basename(uri)\n}", "title": "" }, { "docid": "552cdbfe4061d1fed3b3d7feb9f9fd92", "score": "0.43102008", "text": "function create(uri) {\n return { uri: uri };\n }", "title": "" }, { "docid": "552cdbfe4061d1fed3b3d7feb9f9fd92", "score": "0.43102008", "text": "function create(uri) {\n return { uri: uri };\n }", "title": "" }, { "docid": "5e9eefb2f1333df247963852b59aa9aa", "score": "0.43098792", "text": "resolve() {\n if (this.Class === undefined) {\n this.Class = require(this.modulePath)[this.className];\n if (!this.Class) {\n throw new Error(`No class ${this.className} exported from ${this.modulePath}.`);\n }\n }\n return this.Class;\n }", "title": "" }, { "docid": "a4e30557768310df35573bc3470ab04a", "score": "0.43000603", "text": "function getUri(scope, ident) {\n var node = {\n type: 'Url',\n info: ident.info,\n // name: ident.name,\n value: null\n };\n\n eat(TokenType.LeftParenthesis); // (\n\n readSC();\n\n if (scanner.token.type === TokenType.String) {\n node.value = getString();\n readSC();\n } else {\n var rawInfo = getInfo();\n var raw = '';\n\n for (; scanner.token !== null; scanner.next()) {\n var type = scanner.token.type;\n\n if (type === TokenType.Space ||\n type === TokenType.LeftParenthesis ||\n type === TokenType.RightParenthesis) {\n break;\n }\n\n raw += scanner.token.value;\n }\n\n node.value = {\n type: 'Raw',\n info: rawInfo,\n value: raw\n };\n\n readSC();\n }\n\n eat(TokenType.RightParenthesis); // )\n\n return node;\n}", "title": "" }, { "docid": "4bc3842d47998e4cb80e1349c522a1d2", "score": "0.42850125", "text": "function loadUriModule (filepath, method, uri) {\n const moduleName = `${filepath}/${method}-${uri}`\n try {\n return require(moduleName)\n } catch (err) {\n Logger.error(err, `error loading ${moduleName}`)\n return null\n }\n}", "title": "" }, { "docid": "3244821a13748190551b43a178db16d8", "score": "0.42833894", "text": "function resolver(prefix) {\n\t\tswitch (prefix) {\n\t\tcase 'thr':\n\t\t\treturn 'http://purl.org/syndication/thread/1.0';\n\t\tcase 'snx':\n\t\t\treturn 'http://www.ibm.com/xmlns/prod/sn';\n\t\tcase 'td':\n\t\t\treturn 'urn:ibm.com/td';\n\t\tcase 'opensearch':\n\t\t\treturn 'http://a9.com/-/spec/opensearch/1.1';\n\t\tdefault:\n\t\t\treturn 'http://www.w3.org/2005/Atom';\n\t\t}\n\t}", "title": "" }, { "docid": "edca4d6ad58ab6458696033276e46d30", "score": "0.42825708", "text": "static getClass(name) {\n\t\tfor (let i = 0; i < BaseItem.syncItemDefinitions_.length; i++) {\n\t\t\tif (BaseItem.syncItemDefinitions_[i].className == name) {\n\t\t\t\tconst classRef = BaseItem.syncItemDefinitions_[i].classRef;\n\t\t\t\tif (!classRef) throw new Error(`Class has not been loaded: ${name}`);\n\t\t\t\treturn BaseItem.syncItemDefinitions_[i].classRef;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(`Invalid class name: ${name}`);\n\t}", "title": "" }, { "docid": "12b499423f2bc25658bb729343a4c21e", "score": "0.4278459", "text": "function parseRegexClassAtom() {\n if (tryConsume(\"\\\\\")) {\n consume(\"regex_class_escape\");\n return;\n }\n consume(\"regex_source_character\");\n }", "title": "" }, { "docid": "296c79baf306c44c82ff33665d945161", "score": "0.42603505", "text": "get uri() {\n\t\treturn this.__uri;\n\t}", "title": "" }, { "docid": "e039d24cc4212a5ffe426a8824e35cfd", "score": "0.42592803", "text": "convertFromRDFXML(rdfxml){\n let triples = sem.rdfParse(rdfxml,\"rdfxml\");\n let inverseMap = this.inverseMap();\n let newTriples = Array.from(triples).map((triple)=>{\n let subject = sem.tripleSubject(triple);\n subject = (String(subject)).match(/\\/Class$/)?sem.iri(String(subject).replace(/\\/Class$/,\"/\")):subject;\n let predicate = sem.triplePredicate(triple);\n let object = sem.tripleObject(triple);\n object = !(sem.isLiteral(object)||sem.isBlank(object))?(String(object)).match(/\\/Class$/)?sem.iri(String(object).replace(/\\/Class$/,\"/\")):object:object;\n return sem.triple(subject,predicate,object);\n });\n return this.dedup(newTriples);\n}", "title": "" }, { "docid": "f8d69961c2d04e690fd2be29b42073e2", "score": "0.42572585", "text": "function getModel(uri) {\n return __WEBPACK_IMPORTED_MODULE_5__standaloneServices_js__[\"b\" /* StaticServices */].modelService.get().getModel(uri);\n}", "title": "" }, { "docid": "d3825ba3c77e77c6c5457175ada048fe", "score": "0.4248783", "text": "function RemoteUriCodeSource(feedInfo, timeoutInterval) {\n this.id = feedInfo.srcUri.spec;\n this.timeoutInterval = timeoutInterval;\n this._feedInfo = feedInfo;\n this._req = null;\n this._hasCheckedRecently = false;\n this._cache = null;\n}", "title": "" }, { "docid": "0e05da1dbedc0adb6df40f7f762320b3", "score": "0.42470723", "text": "function make(uri) {\n if (!registry.hasOwnProperty(uri.protocol))\n throw new Error('Unrecognized transport protocol: ' + uri.protocol);\n return new registry[uri.protocol](uri);\n }", "title": "" }, { "docid": "793d306f3145570e4524728872dcae8e", "score": "0.42429507", "text": "function loadclass(path_class){\n\t\treturn builtins.loadclass(path_class);\n\t}", "title": "" }, { "docid": "1a6b849b851d10c1b9eefb720a6fb388", "score": "0.42421356", "text": "get ei_class() {\n return this.buffer[0x04];\n }", "title": "" }, { "docid": "b77b79dd3458076080da0bd00f773751", "score": "0.42331916", "text": "static getUri(uri) {\n return `url('${uri}')`;\n }", "title": "" }, { "docid": "e3e0a0a12f160771094de67b95803203", "score": "0.42215854", "text": "getClassName(){return \"Core.FileSystem.Provider.FileSystemProvider\";}", "title": "" }, { "docid": "a59238b811846ee8db20d174d4511a3d", "score": "0.4220456", "text": "importUri(type) {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n } // Runtime type\n\n\n return `./${stringify(type)}`;\n }", "title": "" }, { "docid": "27330cdf67ecb8a7f4af712231f34481", "score": "0.42108786", "text": "function getClassFromExpression(expression){\n console.log(`getClassFromExpression(${expression})`)\n let isLex = expression.includes('\\\"')\n let isVar = expression.includes('<')\n let isStop = false // TODO\n \n if(isStop) return CLASS_STOPWORD\n else if(isLex && isVar) return CLASS_VARIABLIZED_LEXICALIZED\n else if(isLex) return CLASS_LEXICALIZED\n else if(isVar) return CLASS_VARIABLIZED\n else return CLASS_UNRATED\n}", "title": "" }, { "docid": "581f14679ccbe669c32d349ec342673f", "score": "0.41843677", "text": "getClassString(filter) {\n switch (filter) {\n case 'all': return '.'+this._runID+'.'+this._className;\n case 'nodes': {\n let str = '.'+this._runID+'.'+this._className+'.'+this.nodeClass;\n for (let name of this._styleHandler.getNodeNames()) {\n str += ', .'+this._runID+'.'+this._className+'.'+name;\n }\n return str;\n } break;\n case 'links': {\n let str = '.'+this._runID+'.'+this._className+'.'+this.linkClass;\n for (let name of this._styleHandler.getLinkNames()) {\n str += ', .'+this._runID+'.'+this._className+'.'+name;\n }\n return str;\n } break;\n default: console.log('layout.js - invalid class filter'); return '';\n }\n }", "title": "" }, { "docid": "6158408487dc18e6e17bd4dcf6accfb2", "score": "0.41614038", "text": "function decideClass() {\r\n\tconst pathname = location.pathname\r\n\r\n\tif (\r\n\t\t(hasNavigated &&\r\n\t\t\t(location.search.indexOf('tagged') !== -1 ||\r\n\t\t\t\tlocation.search.indexOf('taken-by=') !== -1)) ||\r\n\t\t$('body > div > div[role=\"dialog\"]') !== null\r\n\t)\r\n\t\treturn (currentClass = '')\r\n\r\n\t// home page\r\n\tif (pathname === '/') return (currentClass = 'home')\r\n\r\n\t// stories\r\n\tif (pathname.indexOf('/stories/') !== -1) return (currentClass = 'stories')\r\n\r\n\t// single post\r\n\tif (pathname.indexOf('/p/') !== -1) return (currentClass = 'post')\r\n\r\n\t// search results\r\n\tif (pathname.indexOf('/explore/') !== -1) return (currentClass = 'explore')\r\n\r\n\t// profile page\r\n\treturn (currentClass = 'profile')\r\n}", "title": "" }, { "docid": "a3d50c795b50f8438889c88b2e814863", "score": "0.41536748", "text": "getSingleClass(id) {\n return this.http.get('/api/class/' + id);\n }", "title": "" }, { "docid": "4c5f6786b01796a9521cb6ae64b6571c", "score": "0.41484493", "text": "function fromMagnet(uri) {\n var parsed = magnet.decode(uri);\n var infoHash = parsed.infoHash.toLowerCase();\n var tags = [];\n tags.push(\"SD\");\n if(uri.match())\n if (uri.match(/720p/i)) tags.push(\"720p\");\n //if (uri.match(/1080p/i)) tags.push(\"1080p\");\n return {\n infoHash: infoHash,\n sources: (parsed.announce || []).map(function(x) { return \"tracker:\"+x }).concat([\"dht:\"+infoHash]),\n tag: tags,\n title: \"SD\", // show quality in the UI\n }\n}", "title": "" }, { "docid": "f0ae1a6a3d55437e3ea5e53c150a24cd", "score": "0.41483063", "text": "importUri(type) {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }", "title": "" }, { "docid": "f0ae1a6a3d55437e3ea5e53c150a24cd", "score": "0.41483063", "text": "importUri(type) {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }", "title": "" }, { "docid": "f0ae1a6a3d55437e3ea5e53c150a24cd", "score": "0.41483063", "text": "importUri(type) {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }", "title": "" }, { "docid": "f0ae1a6a3d55437e3ea5e53c150a24cd", "score": "0.41483063", "text": "importUri(type) {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }", "title": "" }, { "docid": "f0ae1a6a3d55437e3ea5e53c150a24cd", "score": "0.41483063", "text": "importUri(type) {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }", "title": "" }, { "docid": "f0ae1a6a3d55437e3ea5e53c150a24cd", "score": "0.41483063", "text": "importUri(type) {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }", "title": "" }, { "docid": "3815cfb299c25f5034feeb7f62869ab3", "score": "0.41449323", "text": "function Parser( tokenStream ){\n \n var debug = false;\n\n var currentToken, lastComment, types = [];\n \n function isAnyOf( type, possibleTypes ){\n for(var i = 0; i < possibleTypes.length; i++) {\n if ( possibleTypes[i] === type ){ \n return true;\n }\n }\n \n return false;\n }\n\n function error( message ){\n throw new Error( message + \n \"\\nAt line: \" + currentToken.line + \", col: \" + currentToken.col + \"\\n\\n\" +\n tokenStream.neighborhood()\n );\n }\n\n function consume( expectedType ){\n currentToken = tokenStream.consume();\n\n if (debug) console.log(\"currentToken\", currentToken);\n\n if ( expectedType && !isAnyOf( currentToken.type, Array.prototype.slice.call(arguments) )){\n error( \"syntax error - expected \\\"\" + Array.prototype.join.call( arguments, \", \") + \"\\\", but got \\\"\" + currentToken.type + \"\\\"\" ); \n } \n\n return currentToken;\n }\n\n function peak(){\n return tokenStream.peak();\n }\n\n function parseExtendsList(){\n \n consume(\"extends\");\n\n return parseIdList();\n }\n \n\n function parseExtends(){\n \n consume(\"extends\");\n\n // get the type name\n var r = consume();\n return r.contents;\n }\n \n function parseIdList(){\n\n var idlist = []\n , peaked;\n\n do {\n consume();\n\n if ( currentToken.type === \"id\" ){\n idlist.push( currentToken.contents );\n }\n } while ( (peaked = peak()) && (peaked.type === \"id\" || peaked.type === \",\") )\n\n return idlist;\n }\n\n function parseImplements(){\n \n consume(\"implements\");\n return parseIdList();\n\n }\n\n function parseClass( visibility ){\n \n // get visibility from current token or default\n visibility = visibility || \"public\";\n \n consume(\"class\"); \n \n // get the type name for the class\n var typeName = consume().contents;\n \n // build the class type\n var def = new Class( typeName, visibility ); \n def.line = currentToken.line;\n \n // set the description\n def.description = getLastComment();\n\n var peaked = peak(); \n var parsedExtends = false;\n \n // parent class\n if ( peaked.type === \"extends\" ){\n parsedExtends = true;\n def.parentClass = parseExtends();\n peaked = peak();\n }\n \n // parse interfaces\n if ( peaked.type === \"implements\" ){\n def.interfaces = parseImplements(); \n peaked = peak();\n }\n \n // parent class\n if ( peaked.type === \"extends\" ){\n if (parsedExtends) error(\"Duplicate extends encountered\");\n def.parentClass = parseExtends();\n } \n\n parseClassBody( def );\n\n if (debug) console.log(def);\n\n return def; \n }\n\n function consumeBlock(){\n\n consume(\"{\");\n var parenCount = 1;\n\n while ( parenCount != 0 ){\n consume();\n\n if (currentToken.type === \"{\") {\n parenCount++;\n } else if (currentToken.type === \"}\"){\n parenCount--;\n }\n }\n }\n\n function consumeWhile(){\n \n var possibleTypes = Array.prototype.slice.call(arguments);\n \n var consumed = [];\n while (isAnyOf( peak().type, possibleTypes)){\n consumed.push(consume.apply(null, arguments));\n }\n return consumed;\n }\n\n function consumeIf(){\n\n var possibleTypes = Array.prototype.slice.call(arguments);\n var peaked = peak();\n if (isAnyOf(peaked.type, possibleTypes)) consume();\n }\n\n function consumeUntil(){\n\n var possibleTypes = Array.prototype.slice.call(arguments);\n var peaked;\n while ( (peaked = peak()) && !isAnyOf( peaked.type, possibleTypes) ){\n consume();\n }\n }\n\n function consumeUntilInclusive(char){\n consumeUntil(char);\n consume(char);\n }\n\n function parseProperty( isStatic ){\n\n var currentLine = currentToken.line;\n\n consume(\"var\");\n\n var name = consume().contents;\n var type;\n\n var peaked = peak();\n \n if (peaked.type === \":\"){\n \n consume(\":\");\n type = consume(\"id\").contents; \n peaked = peak();\n \n }\n \n consumeUntilInclusive(\";\");\n\n var prop = new Property( name, type, getLastComment() ); \n prop.line = currentLine;\n return prop;\n }\n \n function parseMethodArgument(){\n \n // id : Type = expression\n var name = consume(\"id\").contents;\n \n var peaked = peak();\n\n var type;\n if (peaked.type === \":\"){\n type = parseTypeAnnotation();\n peaked = peak();\n }\n\n var defaultVal;\n if (peaked.type === \"=\"){ \n consume(\"=\");\n defaultVal = consume(\"number\", \"string\", \"boolean\", \"null\").contents; \n }\n\n return new MethodArgument(name, type, defaultVal);\n }\n\n function parseTypeAnnotation(){\n consume(\":\");\n var ids = consumeWhile(\"id\",\"->\");\n return ids.reduce((a,x) => x.contents + a, \"\");\n }\n\n function parseMethodArguments(){\n\n // ( methodArgument, methodArgument )\n consume(\"(\");\n\n var peaked, args = [];\n\n while ( (peaked = peak()) && peaked.type != \")\"){\n \n if (peaked.type === \"id\"){\n args.push( parseMethodArgument() );\n } else if (peaked.type === \",\"){\n consume(\",\"); // consume the \",\"\n } else {\n error(\"Failed to parse method arguments!\"); \n }\n\n }\n \n consume(\")\");\n return args;\n }\n\n function getLastComment(){\n\n var lc = lastComment;\n lastComment = undefined;\n return lc ? lc.contents : lc;\n\n }\n\n function parseMethod( isStatic ){\n \n var currentLine = currentToken.line;\n\n // function MethodName( methodArgument, methodArgument ) : ExpectedType { ... } \n consume(\"function\");\n\n var name = consume(\"id\", \"new\").contents;\n \n var args = parseMethodArguments();\n\n peaked = peak();\n \n var type;\n if (peaked.type === \":\"){\n type = parseTypeAnnotation(); \n }\n \n consumeBlock();\n\n var method = new Method( name, args, type, getLastComment() );\n method.line = currentLine;\n method.isStatic = isStatic;\n return method;\n }\n\n function parseClassMember( def, visibility ){\n\n // parse \"public\" or \"private\"\n var visibility = visibility ? visibility : consume(\"visibility\").contents; \n\n // hack to ignore private members\n if ( visibility === \"private\"){\n def = new Class();\n }\n\n var peaked = peak();\n var isStatic = false;\n \n if ( peaked.type === \"static\" ){\n isStatic = true;\n \n consume(\"static\");\n peaked = peak();\n }\n\n if ( peaked.type === \"inline\" ){\n \n // TODO - parse inline\n consume(\"inline\");\n peaked = peak();\n }\n \n if ( peaked.type === \"var\" ){\n return def.properties.push( parseProperty( isStatic ));\n } else if (peaked.type === \"function\"){\n return def.methods.push( parseMethod( isStatic )); \n }\n\n throw new Error(\"Unknown class member encountered\" + JSON.stringify( peaked ));\n }\n\n function parseClassBody( def ){\n\n consume(\"{\");\n\n var peaked; \n\n while ( (peaked = peak()) && peaked.type != \"}\"){\n if (peaked.type === \"comment\"){ \n parseComment();\n continue;\n } else if (peaked.type === \"visibility\"){\n parseClassMember( def );\n continue;\n } else if (peaked.type === \"function\"){\n parseClassMember( def, \"private\" );\n continue;\n } else if (peaked.type === \"var\"){\n parseClassMember( def, \"private\" );\n continue;\n } else if (peaked.type === \"static\"){\n parseClassMember( def, \"private\" );\n continue; \n }\n\n consume();\n }\n\n consume(\"}\");\n }\n\n function parseMethodDefinition(){\n \n // function MethodName( methodArgument, methodArgument ) : ExpectedType; \n consume(\"function\");\n\n var currentLine = currentToken.line;\n var name = consume(\"id\", \"new\").contents;\n \n var args = parseMethodArguments();\n\n peaked = peak();\n \n var type;\n if (peaked.type === \":\"){\n type = parseTypeAnnotation(); \n }\n \n consumeUntilInclusive(\";\");\n\n var method = new Method( name, args, type, getLastComment() );\n method.line = currentLine;\n return method;\n }\n\n function parseInterfaceMember( def, visibility ){\n\n var visibility = visibility ? visibility : consume(\"visibility\").contents; \n\n // hack to ignore private members\n if ( visibility === \"private\"){\n def = new Interface();\n }\n\n var peaked = peak();\n \n if ( peaked.type === \"var\" ){\n return def.properties.push( parseProperty());\n } else if (peaked.type === \"function\"){\n return def.methods.push( parseMethodDefinition()); \n }\n\n throw new Error(\"Unknown interface member type encountered\" + JSON.stringify( peaked ));\n }\n \n function parseInterfaceBody( def ){\n\n consume(\"{\");\n\n var peaked; \n\n while ( (peaked = peak()) && peaked.type != \"}\"){\n if (peaked.type === \"comment\"){ \n parseComment();\n continue;\n } else if (peaked.type === \"visibility\"){\n parseInterfaceMember( def );\n continue;\n } else if (peaked.type === \"function\"){\n parseInterfaceMember( def, \"public\" );\n continue;\n } \n\n consume();\n }\n\n consume(\"}\");\n }\n\n function parseInterface( visibility ){\n\n visibility = visibility || \"public\";\n \n consume(\"interface\"); \n \n // get the type name for the class\n var typeName = consume().contents;\n \n var def = new Interface( typeName, visibility ); \n def.line = currentToken.line; \n def.description = getLastComment();\n \n if ( peak().type === \"extends\" ){\n def.interfaces = parseExtendsList();\n }\n \n parseInterfaceBody( def );\n\n if (debug) console.log( def );\n\n return def; \n }\n\n function parseTypedefBody( def ){\n\n def.isAnonymousObject = true;\n consume(\"{\");\n\n var peaked; \n\n while ( (peaked = peak()) && peaked.type != \"}\"){\n if (peaked.type === \"comment\"){ \n parseComment();\n continue;\n } else if (peaked.type === \"var\"){\n def.anonymousObject.properties.push(parseProperty());\n continue;\n } \n\n consume();\n }\n\n consume(\"}\");\n }\n\n function parseTypedef( visibility ){\n \n visibility = visibility || \"public\";\n \n consume(\"typedef\"); \n \n var typeName = consume().contents;\n \n consume(\"=\");\n\n var def = new Typedef( typeName, visibility ); \n def.line = currentToken.line;\n def.description = getLastComment();\n \n // anonymous object body\n if (peak().type === \"{\"){\n parseTypedefBody( def );\n } else {\n def.alias = consume(\"id\").contents;\n }\n\n if( debug ) console.log( def );\n\n return def; \n }\n\n function parseComment() {\n var squashed = consume(\"comment\");\n\n var peaked;\n while ( (peaked = peak()) && peaked.type === \"comment\" ){\n currentToken = consume();\n \n squashed.contents += \"\\n\";\n squashed.contents += currentToken.contents; \n }\n \n return lastComment = squashed;\n }\n\n function parseType(){ \n \n var peaked = peak();\n var visibility = \"public\";\n \n if (peaked.type === \"visibility\"){\n consume(\"visibility\");\n peaked = peak();\n }\n\n if (peaked.type === \"class\"){\n return parseClass( visibility ); \n } else if (peaked.type === \"interface\"){\n return parseInterface( visibility ); \n } else if (peaked.type === \"typedef\"){\n return parseTypedef( visibility ); \n } \n\n error(\"Parser for type not implemented\"); \n }\n \n this.parse = () => {\n \n var peaked;\n\n var types = [];\n \n while ( (peaked = peak()) ){\n if (peaked.type === \"expose\"){\n consume(\"expose\"); \n types.push( parseType() ); \n } else if (peaked.type === \"class\"){\n parseClass(); \n } else if (peaked.type === \"typedef\"){\n types.push( parseTypedef() ); \n } else if (peaked.type === \"interface\"){\n types.push( parseInterface() ); \n } else if ( peaked.type === \"visibility\" ){\n if (peaked.contents === \"private\") {\n // parse, but don't add to types\n parseType();\n continue;\n }\n types.push( parseType() ); \n } else if (peaked.type === \"comment\"){\n parseComment();\n } else {\n consume();\n }\n }\n\n return types;\n }\n}", "title": "" }, { "docid": "543c80852f0e812444ea1f190ab2213c", "score": "0.41447008", "text": "function handleUriObject(resource) {\r\n\r\n}", "title": "" }, { "docid": "c8250e9b1d96f4a464192a4e69226f47", "score": "0.41290098", "text": "static parse(uri)\r\n {\r\n uri = Grammar.parse(uri, 'SIP_URI');\r\n\r\n if (uri !== -1)\r\n {\r\n return uri;\r\n }\r\n else\r\n {\r\n return undefined;\r\n }\r\n }", "title": "" }, { "docid": "f06cda9d84609344db2a862227d717ba", "score": "0.41163033", "text": "resolveUri(uri) {\n let filename = uri;\n if (filename.substring(0, 7) === 'file://') {\n filename = filename.substring(7);\n }\n if (filename.startsWith(this.path)) {\n filename = filename.substring(this.path.length);\n if (filename[0] === '/') {\n filename = filename.substring(1);\n }\n }\n return filename;\n }", "title": "" }, { "docid": "1b1f4efaf18eac8069e04e54c37af605", "score": "0.41152176", "text": "function getClass(_class, num){\r\n \tvar className = _class.split(' '),\r\n \t className = className[num];\r\n \treturn className;\r\n }", "title": "" }, { "docid": "d70eb752904e653be9cbee754062ca67", "score": "0.4113812", "text": "function githubTypeToClass(type) {\n if (/_CHANNEL/.test(type)) return 'icon-hash';\n else if (/REPO/.test(type)) return 'octicon-repo';\n else if (/ORG/.test(type)) return 'octicon-organization';\n else return 'default';\n}", "title": "" }, { "docid": "e79cb3af9ac6d9bed57fa50460711201", "score": "0.410433", "text": "function parseUri(obj) {\n return (typeof obj == 'string') ? url.parse(obj) : obj;\n}", "title": "" }, { "docid": "5ec3582a69ce80852dee8e7f72f54655", "score": "0.4102105", "text": "getLinkClass(id) {\n let n = this.link(id);\n if (n && n.styleClass) {\n let s = n.styleClass.lastIndexOf('-');\n return n.styleClass.slice(0, s);\n }\n }", "title": "" }, { "docid": "650c5a8549a8702707916e694c442331", "score": "0.4080087", "text": "function uri() {\n return from(String).format(JsonFormatTypes.URI);\n}", "title": "" }, { "docid": "d66bfa2ed4f4d3b7cc53b6889899122e", "score": "0.4072165", "text": "function tagFromClassName(className) {\n const uppercaseRegEx = /([A-Z])/g;\n const tag = \"elix\" + className.replace(uppercaseRegEx, \"-$1\").toLowerCase();\n return tag;\n}", "title": "" }, { "docid": "4dc3e5bc791f99cefcb845ad992995b9", "score": "0.40619648", "text": "function normalizeUri(uri) {\n return vscode_uri_1.URI.parse(uri).toString();\n}", "title": "" }, { "docid": "afe77a3f4f5c7d99a8596bfc46749c31", "score": "0.40562457", "text": "function idToClass(idName) {\n return idName.replace(/\\//g,\"_\").replace(\":\",\"___\");\n}", "title": "" }, { "docid": "8039c8898aee001c8834301df6e6b164", "score": "0.4053646", "text": "function parseQuery (query) {\n var chunks = query.split(/([#.])/);\n var tagName = '';\n var id = '';\n var classNames = [];\n\n for (var i = 0; i < chunks.length; i++) {\n var chunk = chunks[i];\n if (chunk === '#') {\n id = chunks[++i];\n } else if (chunk === '.') {\n classNames.push(chunks[++i]);\n } else if (chunk.length) {\n tagName = chunk;\n }\n }\n\n return {\n tag: tagName || 'div',\n id: id,\n className: classNames.join(' ')\n };\n}", "title": "" }, { "docid": "3206ababe07114caf12cb3e28863947b", "score": "0.40458557", "text": "function parseUri(str){var o=parseUri.options,m=o.parser[o.strictMode?\"strict\":\"loose\"].exec(str),uri={},i=14;while(i--){uri[o.key[i]]=m[i]||\"\"}uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){if($1){uri[o.q.name][$1]=$2}});return uri}", "title": "" }, { "docid": "16a457bdbd61c839d240b720486c3ea7", "score": "0.4044328", "text": "function getCEClass(node) {\n var doc = hyper.document;\n var ce = doc.customElements || doc.defaultView.customElements;\n return ce && ce.get(node.nodeName.toLowerCase());\n }", "title": "" }, { "docid": "95a5a1fcc4e034c5b7f33818dd2fe782", "score": "0.40384537", "text": "function create(uri, version) {\r\n return { uri: uri, version: version };\r\n }", "title": "" }, { "docid": "7068b7cb3561d69bdb5c5983aa396022", "score": "0.40356866", "text": "function extend(entity_name) {\n var Class = (function (_super) {\n __extends(Class, _super);\n function Class() {\n _super.apply(this, arguments);\n }\n return Class;\n }(Entity));\n /**\n * spring data rest entity path\n */\n Class.entityName = entity_name;\n return Class;\n}", "title": "" }, { "docid": "419f511c87cf314a62882c3d7f49432d", "score": "0.40344703", "text": "static fetchLocation(uri, config) {\n if (_runtime_is_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n return this.fetchLocation_node(uri, config);\n } else {\n return this.fetchLocation_xhr(uri, config);\n }\n }", "title": "" }, { "docid": "055d95527aee16dc5308e4d8a5f827bd", "score": "0.40305", "text": "function create(uri, version) {\n return { uri: uri, version: version };\n }", "title": "" }, { "docid": "2da2e1ad7614bc24bb48bce030fb7030", "score": "0.4030466", "text": "static create(lang, def) {\n const program = lang.getProgram();\n const sourceFile = program === null || program === void 0 ? void 0 : program.getSourceFile(def.fileName);\n if (!program || !sourceFile) {\n return null;\n }\n const defClass = utils_2.findContainingNode(sourceFile, def.textSpan, typescript_1.default.isClassDeclaration);\n if (!defClass) {\n return null;\n }\n const typeChecker = program.getTypeChecker();\n const classType = typeChecker.getTypeAtLocation(defClass);\n if (!classType) {\n return null;\n }\n return new JsOrTsComponentInfoProvider(typeChecker, classType);\n }", "title": "" }, { "docid": "a776180f62036385588a71048fef855c", "score": "0.40303552", "text": "function create(uri, range) {\r\n return { uri: uri, range: range };\r\n }", "title": "" }, { "docid": "e7a71cb43fa89f9789efb93d8511e9b9", "score": "0.4027615", "text": "function create(uri, range) {\n return { uri: uri, range: range };\n }", "title": "" }, { "docid": "16be48f82864b70520c9f03e794d0fb8", "score": "0.40270677", "text": "function parseRegexClassRange() {\n parseRegexClassAtom();\n while (matchAnyOf([\"-\", \"regex_source_character\", \"\\\\\"]) && !match(\"]\")) {\n tryConsume(\"-\");\n parseRegexClassAtom();\n }\n }", "title": "" }, { "docid": "bf9ff862876f925474d1eabcbc1ef66e", "score": "0.40177017", "text": "async parse(url) {\n throw new Error('parse must be implemented')\n }", "title": "" }, { "docid": "f058a06582ab78924b21a1009386457b", "score": "0.40164948", "text": "getClassName(ast) {\n logging.taskInfo(this.constructor.name, `getClassName ${ast}`);\n\n logging.taskInfo(this.constructor.name, `getClassName keys ${_.keys(ast)}`);\n }", "title": "" }, { "docid": "ff130844d759fead5d1b2f2d7a76a460", "score": "0.40089482", "text": "function parseUri$static(uriStr/*:String*/)/*:URI*/ {\n if (!uriStr) {\n uriStr = window.location.toString();\n }\n var uri/*:URI*/ = null;\n try {\n uri = net.jangaroo.net.URIUtils.parse(uriStr);\n } catch(e){if(AS3.is(e,AS3.Error)) {\n // ignore, uri will stay null\n }else throw e;}\n return uri;\n }", "title": "" }, { "docid": "5bebaf4f987e83c7674accfbc0eafea8", "score": "0.40038288", "text": "_parseClassDef(decorators) {\n const classToken = this._getKeywordToken(\n 7\n /* Class */\n );\n let nameToken = this._getTokenIfIdentifier();\n if (!nameToken) {\n this._addError(localize_1.Localizer.Diagnostic.expectedClassName(), this._peekToken());\n nameToken = tokenizerTypes_1.IdentifierToken.create(\n 0,\n 0,\n \"\",\n /* comments */\n void 0\n );\n }\n let typeParameters;\n const possibleOpenBracket = this._peekToken();\n if (possibleOpenBracket.type === 15) {\n typeParameters = this._parseTypeParameterList();\n if (!this._parseOptions.isStubFile && this._getLanguageVersion() < pythonVersion_1.PythonVersion.V3_12) {\n this._addError(localize_1.Localizer.Diagnostic.classTypeParametersIllegal(), typeParameters);\n }\n }\n let argList = [];\n const openParenToken = this._peekToken();\n if (this._consumeTokenIfType(\n 13\n /* OpenParenthesis */\n )) {\n argList = this._parseArgList().args;\n if (!this._consumeTokenIfType(\n 14\n /* CloseParenthesis */\n )) {\n this._addError(localize_1.Localizer.Diagnostic.expectedCloseParen(), openParenToken);\n }\n }\n const suite = this._parseSuite(\n /* isFunction */\n false,\n this._parseOptions.skipFunctionAndClassBody\n );\n const classNode = parseNodes_1.ClassNode.create(classToken, parseNodes_1.NameNode.create(nameToken), suite, typeParameters);\n classNode.arguments = argList;\n argList.forEach((arg) => {\n arg.parent = classNode;\n });\n if (decorators) {\n classNode.decorators = decorators;\n if (decorators.length > 0) {\n decorators.forEach((decorator) => {\n decorator.parent = classNode;\n });\n (0, parseNodes_1.extendRange)(classNode, decorators[0]);\n }\n }\n return classNode;\n }", "title": "" }, { "docid": "4b519a6fdcc148d89e99846dec99cb33", "score": "0.39998162", "text": "convert(sourceFilePath, chunk) {\n const ast = transform(chunk, this.options.options).ast;\n\n if (this.hasClass(ast)) {\n if (DERP) {\n logging.taskInfo(this.constructor.name, `convert found class ${className}, ${sourceFilePath}`);\n logging.taskInfo(this.constructor.name, `AST: ${circularJSON.stringify(ast)}`);\n\n const className = this.getClassName(ast);\n\n this.addClass(className);\n\n this.setClassParent(className, ast);\n this.setClassMethods(className, ast);\n DERP = false;\n }\n }\n\n throw new Error('Not yet implemented');\n }", "title": "" }, { "docid": "1e94d7f456992eccec078fb43948f7a1", "score": "0.39950606", "text": "function getRdfClasses(rdfTxt){\n\tvar rdfClasses = rdfTxt.getElementsByTagName(\"owl:Class\");\n\tvar classArray = new Array();\n\tfor(var i = 0 ; i < rdfClasses.length; i++){\n\t\tvar uri = rdfClasses[i].getAttribute(\"rdf:about\");\n\n\t\tvar tmp = new Object();\n\t\ttmp.type = \"Class\";\n\t\ttmp.uri = uri;\n\t\ttmp.name = getLastStringAfterHash(uri);\n\n\t\tvar childNodes = rdfClasses[i].childNodes;\n\t\tvar tmpParents = new Array();\n\t\tfor(var j = 0 ; j < childNodes.length; j++){\n\t\t\tif(childNodes[j].nodeName == \"rdfs:subClassOf\"){\n\t\t\t\t//alert(tmp.name + \" - \" + childNodes[j].getAttribute(\"rdf:resource\"));\n\t\t\t\ttmpParents.push(childNodes[j].getAttribute(\"rdf:resource\"));\n\t\t\t}\n\t\t}\n\t\ttmp.parents = tmpParents;\n\t\ttmp.children = new Array();\n\t\tclassArray.push(tmp);\n\t}\n\tgetChildrenClasses(classArray);\n\treturn classArray;\n}", "title": "" }, { "docid": "fe54de1c7126dd81c6d9c94500575d9f", "score": "0.39932004", "text": "function _getClassById(classId) {\n return _idToClass[classId];\n }", "title": "" }, { "docid": "fe54de1c7126dd81c6d9c94500575d9f", "score": "0.39932004", "text": "function _getClassById(classId) {\n return _idToClass[classId];\n }", "title": "" }, { "docid": "1c68a9f78272e2cab7b3939d8f69ef13", "score": "0.39886886", "text": "function create(uri, version) {\n return { uri: uri, version: version };\n }", "title": "" }, { "docid": "1c68a9f78272e2cab7b3939d8f69ef13", "score": "0.39886886", "text": "function create(uri, version) {\n return { uri: uri, version: version };\n }", "title": "" }, { "docid": "1c68a9f78272e2cab7b3939d8f69ef13", "score": "0.39886886", "text": "function create(uri, version) {\n return { uri: uri, version: version };\n }", "title": "" }, { "docid": "ccc9623025c6ce40d59de2f799544bf6", "score": "0.39744887", "text": "function getNativeClass(arg) {\n try {\n return (\n arg &&\n arg.isKindOfClass &&\n typeof arg.class === \"function\" &&\n String(arg.class())\n );\n } catch (err) {\n return undefined;\n }\n}", "title": "" }, { "docid": "fd517b5f89667ddd8839a73d3ec61796", "score": "0.39731938", "text": "function fullyQualifiedName(className) {\n var shortToLongMap = {\n 'GlobFunction': 'co.redseal.gremlinnode.function.GlobFunction',\n 'GroovyLambda': 'co.redseal.gremlinnode.function.GroovyLambda',\n 'TestClass': 'co.redseal.gremlinnode.testing.TestClass',\n 'StringInputStream': 'co.redseal.util.StringInputStream',\n 'Binding': 'groovy.lang.Binding',\n 'Closure': 'groovy.lang.Closure',\n 'DelegatingMetaClass': 'groovy.lang.DelegatingMetaClass',\n 'GroovyClassLoader': 'groovy.lang.GroovyClassLoader',\n 'GroovyCodeSource': 'groovy.lang.GroovyCodeSource',\n 'GroovyObjectSupport': 'groovy.lang.GroovyObjectSupport',\n 'GroovyResourceLoader': 'groovy.lang.GroovyResourceLoader',\n 'IntRange': 'groovy.lang.IntRange',\n 'MetaBeanProperty': 'groovy.lang.MetaBeanProperty',\n 'MetaClass': 'groovy.lang.MetaClass',\n 'MetaMethod': 'groovy.lang.MetaMethod',\n 'MetaProperty': 'groovy.lang.MetaProperty',\n 'Range': 'groovy.lang.Range',\n 'Reference': 'groovy.lang.Reference',\n 'ByteArrayOutputStream': 'java.io.ByteArrayOutputStream',\n 'FileInputStream': 'java.io.FileInputStream',\n 'FileOutputStream': 'java.io.FileOutputStream',\n 'InputStream': 'java.io.InputStream',\n 'OutputStream': 'java.io.OutputStream',\n 'Boolean': 'java.lang.Boolean',\n 'Class': 'java.lang.Class',\n 'ClassLoader': 'java.lang.ClassLoader',\n 'Double': 'java.lang.Double',\n 'Enum': 'java.lang.Enum',\n 'Float': 'java.lang.Float',\n 'Integer': 'java.lang.Integer',\n 'Iterable': 'java.lang.Iterable',\n 'Long': 'java.lang.Long',\n 'Object': 'java.lang.Object',\n 'Array': 'java.lang.reflect.Array',\n 'Short': 'java.lang.Short',\n 'String': 'java.lang.String',\n 'Charset': 'java.nio.charset.Charset',\n 'StandardCharsets': 'java.nio.charset.StandardCharsets',\n 'AbstractCollection': 'java.util.AbstractCollection',\n 'AbstractList': 'java.util.AbstractList',\n 'AbstractMap': 'java.util.AbstractMap',\n 'AbstractSet': 'java.util.AbstractSet',\n 'ArrayList': 'java.util.ArrayList',\n 'Collection': 'java.util.Collection',\n 'Comparator': 'java.util.Comparator',\n 'BiConsumer': 'java.util.function.BiConsumer',\n 'BiFunction': 'java.util.function.BiFunction',\n 'BinaryOperator': 'java.util.function.BinaryOperator',\n 'BiPredicate': 'java.util.function.BiPredicate',\n 'Consumer': 'java.util.function.Consumer',\n 'Function': 'java.util.function.Function',\n 'Predicate': 'java.util.function.Predicate',\n 'Supplier': 'java.util.function.Supplier',\n 'UnaryOperator': 'java.util.function.UnaryOperator',\n 'HashMap': 'java.util.HashMap',\n 'HashSet': 'java.util.HashSet',\n 'Iterator': 'java.util.Iterator',\n 'LinkedHashMap': 'java.util.LinkedHashMap',\n 'List': 'java.util.List',\n 'ListIterator': 'java.util.ListIterator',\n 'Map': 'java.util.Map',\n 'Map$Entry': 'java.util.Map$Entry',\n 'NoSuchElementException': 'java.util.NoSuchElementException',\n 'Optional': 'java.util.Optional',\n 'Set': 'java.util.Set',\n 'AbstractScriptEngine': 'javax.script.AbstractScriptEngine',\n 'Bindings': 'javax.script.Bindings',\n 'CompiledScript': 'javax.script.CompiledScript',\n 'ScriptContext': 'javax.script.ScriptContext',\n 'ScriptEngine': 'javax.script.ScriptEngine',\n 'ScriptEngineFactory': 'javax.script.ScriptEngineFactory',\n 'GComparator': 'org.apache.tinkerpop.gremlin.groovy.function.GComparator',\n 'GFunction': 'org.apache.tinkerpop.gremlin.groovy.function.GFunction',\n 'GSupplier': 'org.apache.tinkerpop.gremlin.groovy.function.GSupplier',\n 'GUnaryOperator': 'org.apache.tinkerpop.gremlin.groovy.function.GUnaryOperator',\n 'GremlinGroovyScriptEngine': 'org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine',\n 'ClusterCountMapReduce': 'org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.ClusterCountMapReduce',\n 'ClusterCountMapReduce$Builder': 'org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.ClusterCountMapReduce$Builder',\n 'ClusterPopulationMapReduce': 'org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.ClusterPopulationMapReduce',\n 'ClusterPopulationMapReduce$Builder': 'org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.ClusterPopulationMapReduce$Builder',\n 'PeerPressureVertexProgram': 'org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram',\n 'PeerPressureVertexProgram$Builder': 'org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram$Builder',\n 'ComputerResult': 'org.apache.tinkerpop.gremlin.process.computer.ComputerResult',\n 'GraphComputer': 'org.apache.tinkerpop.gremlin.process.computer.GraphComputer',\n 'GraphComputer$Exceptions': 'org.apache.tinkerpop.gremlin.process.computer.GraphComputer$Exceptions',\n 'GraphComputer$Features': 'org.apache.tinkerpop.gremlin.process.computer.GraphComputer$Features',\n 'GraphComputer$Persist': 'org.apache.tinkerpop.gremlin.process.computer.GraphComputer$Persist',\n 'GraphComputer$ResultGraph': 'org.apache.tinkerpop.gremlin.process.computer.GraphComputer$ResultGraph',\n 'KeyValue': 'org.apache.tinkerpop.gremlin.process.computer.KeyValue',\n 'MapReduce': 'org.apache.tinkerpop.gremlin.process.computer.MapReduce',\n 'MapReduce$MapEmitter': 'org.apache.tinkerpop.gremlin.process.computer.MapReduce$MapEmitter',\n 'MapReduce$NullObject': 'org.apache.tinkerpop.gremlin.process.computer.MapReduce$NullObject',\n 'MapReduce$ReduceEmitter': 'org.apache.tinkerpop.gremlin.process.computer.MapReduce$ReduceEmitter',\n 'MapReduce$Stage': 'org.apache.tinkerpop.gremlin.process.computer.MapReduce$Stage',\n 'Memory': 'org.apache.tinkerpop.gremlin.process.computer.Memory',\n 'Memory$Admin': 'org.apache.tinkerpop.gremlin.process.computer.Memory$Admin',\n 'Memory$Exceptions': 'org.apache.tinkerpop.gremlin.process.computer.Memory$Exceptions',\n 'MessageCombiner': 'org.apache.tinkerpop.gremlin.process.computer.MessageCombiner',\n 'MessageScope': 'org.apache.tinkerpop.gremlin.process.computer.MessageScope',\n 'MessageScope$Global': 'org.apache.tinkerpop.gremlin.process.computer.MessageScope$Global',\n 'MessageScope$Local': 'org.apache.tinkerpop.gremlin.process.computer.MessageScope$Local',\n 'MessageScope$Local$ReverseTraversalSupplier': 'org.apache.tinkerpop.gremlin.process.computer.MessageScope$Local$ReverseTraversalSupplier',\n 'Messenger': 'org.apache.tinkerpop.gremlin.process.computer.Messenger',\n 'PageRankMapReduce': 'org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMapReduce',\n 'PageRankMapReduce$Builder': 'org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMapReduce$Builder',\n 'PageRankMessageCombiner': 'org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMessageCombiner',\n 'PageRankVertexProgram': 'org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram',\n 'PageRankVertexProgram$Builder': 'org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram$Builder',\n 'SingleMessenger': 'org.apache.tinkerpop.gremlin.process.computer.traversal.SingleMessenger',\n 'TraversalVertexProgram': 'org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram',\n 'TraversalVertexProgram$Builder': 'org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram$Builder',\n 'TraversalVertexProgramMessageCombiner': 'org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgramMessageCombiner',\n 'TraverserExecutor': 'org.apache.tinkerpop.gremlin.process.computer.traversal.TraverserExecutor',\n 'VertexTraversalSideEffects': 'org.apache.tinkerpop.gremlin.process.computer.traversal.VertexTraversalSideEffects',\n 'VertexProgram': 'org.apache.tinkerpop.gremlin.process.computer.VertexProgram',\n 'VertexProgram$Builder': 'org.apache.tinkerpop.gremlin.process.computer.VertexProgram$Builder',\n 'VertexProgram$Features': 'org.apache.tinkerpop.gremlin.process.computer.VertexProgram$Features',\n 'Compare': 'org.apache.tinkerpop.gremlin.process.traversal.Compare',\n 'Contains': 'org.apache.tinkerpop.gremlin.process.traversal.Contains',\n '__': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__',\n 'DefaultGraphTraversal': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal',\n 'EmptyGraphTraversal': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.EmptyGraphTraversal',\n 'GraphTraversal': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal',\n 'GraphTraversal$Admin': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal$Admin',\n 'GraphTraversalSource': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource',\n 'GraphTraversalSource$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource$Builder',\n 'GraphTraversalSource$GraphTraversalSourceStub': 'org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource$GraphTraversalSourceStub',\n 'ComputerTraversalEngine': 'org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine',\n 'ComputerTraversalEngine$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine$Builder',\n 'ComputerTraversalEngine$ComputerResultStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine$ComputerResultStrategy',\n 'StandardTraversalEngine': 'org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine',\n 'StandardTraversalEngine$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine$Builder',\n 'Operator': 'org.apache.tinkerpop.gremlin.process.traversal.Operator',\n 'Order': 'org.apache.tinkerpop.gremlin.process.traversal.Order',\n 'P': 'org.apache.tinkerpop.gremlin.process.traversal.P',\n 'Path': 'org.apache.tinkerpop.gremlin.process.traversal.Path',\n 'Path$Exceptions': 'org.apache.tinkerpop.gremlin.process.traversal.Path$Exceptions',\n 'Pop': 'org.apache.tinkerpop.gremlin.process.traversal.Pop',\n 'Scope': 'org.apache.tinkerpop.gremlin.process.traversal.Scope',\n 'Step': 'org.apache.tinkerpop.gremlin.process.traversal.Step',\n 'AbstractStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep',\n 'BulkSet': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet',\n 'CollectingBarrierStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.CollectingBarrierStep',\n 'ComputerAwareStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep',\n 'ComputerAwareStep$EndStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep$EndStep',\n 'ElementFunctionComparator': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementFunctionComparator',\n 'ElementValueComparator': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementValueComparator',\n 'EmptyPath': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyPath',\n 'EmptyStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep',\n 'CallbackRegistry': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.CallbackRegistry',\n 'ConsoleMutationListener': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.ConsoleMutationListener',\n 'Event': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event',\n 'Event$EdgeAddedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$EdgeAddedEvent',\n 'Event$EdgePropertyChangedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$EdgePropertyChangedEvent',\n 'Event$EdgePropertyRemovedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$EdgePropertyRemovedEvent',\n 'Event$EdgeRemovedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$EdgeRemovedEvent',\n 'Event$ElementPropertyChangedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$ElementPropertyChangedEvent',\n 'Event$ElementPropertyEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$ElementPropertyEvent',\n 'Event$VertexAddedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$VertexAddedEvent',\n 'Event$VertexPropertyChangedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$VertexPropertyChangedEvent',\n 'Event$VertexPropertyPropertyChangedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$VertexPropertyPropertyChangedEvent',\n 'Event$VertexPropertyPropertyRemovedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$VertexPropertyPropertyRemovedEvent',\n 'Event$VertexPropertyRemovedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$VertexPropertyRemovedEvent',\n 'Event$VertexRemovedEvent': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event$VertexRemovedEvent',\n 'EventCallback': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.EventCallback',\n 'ListCallbackRegistry': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.ListCallbackRegistry',\n 'MutationListener': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.event.MutationListener',\n 'ExpandableStepIterator': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator',\n 'HasContainer': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer',\n 'ImmutablePath': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ImmutablePath',\n 'MapHelper': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.MapHelper',\n 'MutablePath': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.MutablePath',\n 'NoOpBarrierStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.NoOpBarrierStep',\n 'PathIdentityStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.PathIdentityStep',\n 'ReducingBarrierStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep',\n 'ReducingBarrierStep$DefaultMapReduce': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep$DefaultMapReduce',\n 'ReducingBarrierStep$FinalGet': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep$FinalGet',\n 'SupplyingBarrierStep': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.SupplyingBarrierStep',\n 'TraversalComparator': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.TraversalComparator',\n 'Tree': 'org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree',\n 'ConjunctionStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConjunctionStrategy',\n 'ElementIdStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategy',\n 'ElementIdStrategy$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategy$Builder',\n 'EventStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy',\n 'EventStrategy$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy$Builder',\n 'EventStrategy$DefaultEventQueue': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy$DefaultEventQueue',\n 'EventStrategy$EventQueue': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy$EventQueue',\n 'EventStrategy$EventStrategyCallback': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy$EventStrategyCallback',\n 'EventStrategy$TransactionalEventQueue': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy$TransactionalEventQueue',\n 'PartitionStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy',\n 'PartitionStrategy$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy$Builder',\n 'SubgraphStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy',\n 'SubgraphStrategy$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy$Builder',\n 'EngineDependentStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.EngineDependentStrategy',\n 'LazyBarrierStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.LazyBarrierStrategy',\n 'MatchAlgorithmStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.MatchAlgorithmStrategy',\n 'MatchAlgorithmStrategy$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.MatchAlgorithmStrategy$Builder',\n 'ProfileStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy',\n 'AdjacentToIncidentStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy',\n 'DedupBijectionStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.DedupBijectionStrategy',\n 'IdentityRemovalStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IdentityRemovalStrategy',\n 'IncidentToAdjacentStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy',\n 'MatchPredicateStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.MatchPredicateStrategy',\n 'RangeByIsCountStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RangeByIsCountStrategy',\n 'ComputerVerificationStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy',\n 'LambdaRestrictionStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LambdaRestrictionStrategy',\n 'ReadOnlyStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy',\n 'StandardVerificationStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.StandardVerificationStrategy',\n 'VerificationException': 'org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException',\n 'Traversal': 'org.apache.tinkerpop.gremlin.process.traversal.Traversal',\n 'Traversal$Admin': 'org.apache.tinkerpop.gremlin.process.traversal.Traversal$Admin',\n 'Traversal$Exceptions': 'org.apache.tinkerpop.gremlin.process.traversal.Traversal$Exceptions',\n 'TraversalEngine': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine',\n 'TraversalEngine$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine$Builder',\n 'TraversalEngine$Type': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine$Type',\n 'TraversalSideEffects': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects',\n 'TraversalSideEffects$Exceptions': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects$Exceptions',\n 'TraversalSource': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalSource',\n 'TraversalSource$Builder': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalSource$Builder',\n 'TraversalStrategies': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies',\n 'TraversalStrategies$GlobalCache': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies$GlobalCache',\n 'TraversalStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy',\n 'TraversalStrategy$DecorationStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy$DecorationStrategy',\n 'TraversalStrategy$FinalizationStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy$FinalizationStrategy',\n 'TraversalStrategy$OptimizationStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy$OptimizationStrategy',\n 'TraversalStrategy$VendorOptimizationStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy$VendorOptimizationStrategy',\n 'TraversalStrategy$VerificationStrategy': 'org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy$VerificationStrategy',\n 'Traverser': 'org.apache.tinkerpop.gremlin.process.traversal.Traverser',\n 'Traverser$Admin': 'org.apache.tinkerpop.gremlin.process.traversal.Traverser$Admin',\n 'TraverserGenerator': 'org.apache.tinkerpop.gremlin.process.traversal.TraverserGenerator',\n 'AndP': 'org.apache.tinkerpop.gremlin.process.traversal.util.AndP',\n 'ConjunctionP': 'org.apache.tinkerpop.gremlin.process.traversal.util.ConjunctionP',\n 'DefaultTraversal': 'org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal',\n 'DefaultTraversalSideEffects': 'org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalSideEffects',\n 'DefaultTraversalStrategies': 'org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies',\n 'DependantMutableMetrics': 'org.apache.tinkerpop.gremlin.process.traversal.util.DependantMutableMetrics',\n 'EmptyTraversal': 'org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversal',\n 'EmptyTraversalSideEffects': 'org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversalSideEffects',\n 'EmptyTraversalStrategies': 'org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversalStrategies',\n 'FastNoSuchElementException': 'org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException',\n 'ImmutableMetrics': 'org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics',\n 'Metrics': 'org.apache.tinkerpop.gremlin.process.traversal.util.Metrics',\n 'MutableMetrics': 'org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics',\n 'OrP': 'org.apache.tinkerpop.gremlin.process.traversal.util.OrP',\n 'SideEffectHelper': 'org.apache.tinkerpop.gremlin.process.traversal.util.SideEffectHelper',\n 'StandardTraversalMetrics': 'org.apache.tinkerpop.gremlin.process.traversal.util.StandardTraversalMetrics',\n 'StepPosition': 'org.apache.tinkerpop.gremlin.process.traversal.util.StepPosition',\n 'TraversalClassFunction': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalClassFunction',\n 'TraversalHelper': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper',\n 'TraversalMatrix': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMatrix',\n 'TraversalMetrics': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics',\n 'TraversalObjectFunction': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalObjectFunction',\n 'TraversalRing': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalRing',\n 'TraversalScriptFunction': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptFunction',\n 'TraversalScriptHelper': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptHelper',\n 'TraversalUtil': 'org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil',\n 'Direction': 'org.apache.tinkerpop.gremlin.structure.Direction',\n 'Edge': 'org.apache.tinkerpop.gremlin.structure.Edge',\n 'Edge$Exceptions': 'org.apache.tinkerpop.gremlin.structure.Edge$Exceptions',\n 'Element': 'org.apache.tinkerpop.gremlin.structure.Element',\n 'Element$Exceptions': 'org.apache.tinkerpop.gremlin.structure.Element$Exceptions',\n 'Graph': 'org.apache.tinkerpop.gremlin.structure.Graph',\n 'Graph$Exceptions': 'org.apache.tinkerpop.gremlin.structure.Graph$Exceptions',\n 'Graph$Features': 'org.apache.tinkerpop.gremlin.structure.Graph$Features',\n 'Graph$Features$DataTypeFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$DataTypeFeatures',\n 'Graph$Features$EdgeFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$EdgeFeatures',\n 'Graph$Features$EdgePropertyFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$EdgePropertyFeatures',\n 'Graph$Features$ElementFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$ElementFeatures',\n 'Graph$Features$FeatureSet': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$FeatureSet',\n 'Graph$Features$GraphFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$GraphFeatures',\n 'Graph$Features$PropertyFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$PropertyFeatures',\n 'Graph$Features$VariableFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$VariableFeatures',\n 'Graph$Features$VertexFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$VertexFeatures',\n 'Graph$Features$VertexPropertyFeatures': 'org.apache.tinkerpop.gremlin.structure.Graph$Features$VertexPropertyFeatures',\n 'Graph$Hidden': 'org.apache.tinkerpop.gremlin.structure.Graph$Hidden',\n 'Graph$OptIn': 'org.apache.tinkerpop.gremlin.structure.Graph$OptIn',\n 'Graph$OptIns': 'org.apache.tinkerpop.gremlin.structure.Graph$OptIns',\n 'Graph$OptOut': 'org.apache.tinkerpop.gremlin.structure.Graph$OptOut',\n 'Graph$OptOuts': 'org.apache.tinkerpop.gremlin.structure.Graph$OptOuts',\n 'Graph$Variables': 'org.apache.tinkerpop.gremlin.structure.Graph$Variables',\n 'Graph$Variables$Exceptions': 'org.apache.tinkerpop.gremlin.structure.Graph$Variables$Exceptions',\n 'AbstractIoRegistry': 'org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry',\n 'GraphMigrator': 'org.apache.tinkerpop.gremlin.structure.io.GraphMigrator',\n 'GraphMLIo': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo',\n 'GraphMLIo$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo$Builder',\n 'GraphMLMapper': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLMapper',\n 'GraphMLMapper$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLMapper$Builder',\n 'GraphMLReader': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLReader',\n 'GraphMLReader$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLReader$Builder',\n 'GraphMLWriter': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter',\n 'GraphMLWriter$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter$Builder',\n 'GraphMLWriterHelper$IndentingXMLStreamWriter': 'org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLWriterHelper$IndentingXMLStreamWriter',\n 'GraphReader': 'org.apache.tinkerpop.gremlin.structure.io.GraphReader',\n 'GraphReader$ReaderBuilder': 'org.apache.tinkerpop.gremlin.structure.io.GraphReader$ReaderBuilder',\n 'GraphSONIo': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo',\n 'GraphSONIo$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo$Builder',\n 'GraphSONMapper': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper',\n 'GraphSONMapper$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper$Builder',\n 'GraphSONReader': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader',\n 'GraphSONReader$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader$Builder',\n 'GraphSONTokens': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens',\n 'GraphSONUtil': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONUtil',\n 'GraphSONVersion': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion',\n 'GraphSONWriter': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter',\n 'GraphSONWriter$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter$Builder',\n 'LegacyGraphSONReader': 'org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader',\n 'LegacyGraphSONReader$Builder': 'org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader$Builder',\n 'LegacyGraphSONReader$GraphSONTokensTP2': 'org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader$GraphSONTokensTP2',\n 'GraphWriter': 'org.apache.tinkerpop.gremlin.structure.io.GraphWriter',\n 'GraphWriter$WriterBuilder': 'org.apache.tinkerpop.gremlin.structure.io.GraphWriter$WriterBuilder',\n 'GryoIo': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo',\n 'GryoIo$Builder': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo$Builder',\n 'GryoMapper': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper',\n 'GryoMapper$Builder': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper$Builder',\n 'GryoPool': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool',\n 'GryoPool$Type': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool$Type',\n 'GryoReader': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader',\n 'GryoReader$Builder': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader$Builder',\n 'GryoWriter': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter',\n 'GryoWriter$Builder': 'org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter$Builder',\n 'VertexByteArrayInputStream': 'org.apache.tinkerpop.gremlin.structure.io.gryo.VertexByteArrayInputStream',\n 'VertexTerminator': 'org.apache.tinkerpop.gremlin.structure.io.gryo.VertexTerminator',\n 'Io': 'org.apache.tinkerpop.gremlin.structure.io.Io',\n 'Io$Builder': 'org.apache.tinkerpop.gremlin.structure.io.Io$Builder',\n 'Io$Exceptions': 'org.apache.tinkerpop.gremlin.structure.io.Io$Exceptions',\n 'IoCore': 'org.apache.tinkerpop.gremlin.structure.io.IoCore',\n 'IoRegistry': 'org.apache.tinkerpop.gremlin.structure.io.IoRegistry',\n 'Mapper': 'org.apache.tinkerpop.gremlin.structure.io.Mapper',\n 'Mapper$Builder': 'org.apache.tinkerpop.gremlin.structure.io.Mapper$Builder',\n 'Property': 'org.apache.tinkerpop.gremlin.structure.Property',\n 'Property$Exceptions': 'org.apache.tinkerpop.gremlin.structure.Property$Exceptions',\n 'PropertyType': 'org.apache.tinkerpop.gremlin.structure.PropertyType',\n 'T': 'org.apache.tinkerpop.gremlin.structure.T',\n 'Transaction': 'org.apache.tinkerpop.gremlin.structure.Transaction',\n 'Transaction$CLOSE_BEHAVIOR': 'org.apache.tinkerpop.gremlin.structure.Transaction$CLOSE_BEHAVIOR',\n 'Transaction$Exceptions': 'org.apache.tinkerpop.gremlin.structure.Transaction$Exceptions',\n 'Transaction$READ_WRITE_BEHAVIOR': 'org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR',\n 'Transaction$Status': 'org.apache.tinkerpop.gremlin.structure.Transaction$Status',\n 'Transaction$Workload': 'org.apache.tinkerpop.gremlin.structure.Transaction$Workload',\n 'AbstractTransaction': 'org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction',\n 'AbstractTransaction$TransactionException': 'org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction$TransactionException',\n 'Attachable': 'org.apache.tinkerpop.gremlin.structure.util.Attachable',\n 'Attachable$Exceptions': 'org.apache.tinkerpop.gremlin.structure.util.Attachable$Exceptions',\n 'Attachable$Method': 'org.apache.tinkerpop.gremlin.structure.util.Attachable$Method',\n 'Comparators': 'org.apache.tinkerpop.gremlin.structure.util.Comparators',\n 'DetachedEdge': 'org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge',\n 'DetachedElement': 'org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement',\n 'DetachedFactory': 'org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory',\n 'DetachedPath': 'org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath',\n 'DetachedProperty': 'org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty',\n 'DetachedVertex': 'org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex',\n 'DetachedVertexProperty': 'org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty',\n 'ElementHelper': 'org.apache.tinkerpop.gremlin.structure.util.ElementHelper',\n 'FeatureDescriptor': 'org.apache.tinkerpop.gremlin.structure.util.FeatureDescriptor',\n 'GraphFactory': 'org.apache.tinkerpop.gremlin.structure.util.GraphFactory',\n 'GraphFactoryClass': 'org.apache.tinkerpop.gremlin.structure.util.GraphFactoryClass',\n 'GraphVariableHelper': 'org.apache.tinkerpop.gremlin.structure.util.GraphVariableHelper',\n 'Host': 'org.apache.tinkerpop.gremlin.structure.util.Host',\n 'StringFactory': 'org.apache.tinkerpop.gremlin.structure.util.StringFactory',\n 'Vertex': 'org.apache.tinkerpop.gremlin.structure.Vertex',\n 'Vertex$Exceptions': 'org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions',\n 'VertexProperty': 'org.apache.tinkerpop.gremlin.structure.VertexProperty',\n 'VertexProperty$Cardinality': 'org.apache.tinkerpop.gremlin.structure.VertexProperty$Cardinality',\n 'VertexProperty$Exceptions': 'org.apache.tinkerpop.gremlin.structure.VertexProperty$Exceptions',\n 'TinkerGraphComputer': 'org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer',\n 'TinkerGraphComputerView': 'org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputerView',\n 'TinkerMapEmitter': 'org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerMapEmitter',\n 'TinkerMemory': 'org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerMemory',\n 'TinkerMessenger': 'org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerMessenger',\n 'TinkerReduceEmitter': 'org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerReduceEmitter',\n 'TinkerWorkerPool': 'org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerWorkerPool',\n 'TinkerEdge': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge',\n 'TinkerElement': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement',\n 'TinkerFactory': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory',\n 'TinkerGraph': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph',\n 'TinkerGraph$DefaultIdManager': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$DefaultIdManager',\n 'TinkerGraph$IdManager': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$IdManager',\n 'TinkerGraph$TinkerGraphEdgeFeatures': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$TinkerGraphEdgeFeatures',\n 'TinkerGraph$TinkerGraphFeatures': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$TinkerGraphFeatures',\n 'TinkerGraph$TinkerGraphGraphFeatures': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$TinkerGraphGraphFeatures',\n 'TinkerGraph$TinkerGraphVertexFeatures': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$TinkerGraphVertexFeatures',\n 'TinkerGraph$TinkerGraphVertexPropertyFeatures': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph$TinkerGraphVertexPropertyFeatures',\n 'TinkerGraphVariables': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraphVariables',\n 'TinkerHelper': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerHelper',\n 'TinkerProperty': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerProperty',\n 'TinkerVertex': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex',\n 'TinkerVertexProperty': 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertexProperty',\n 'ArrayListSupplier': 'org.apache.tinkerpop.gremlin.util.function.ArrayListSupplier',\n 'BulkSetSupplier': 'org.apache.tinkerpop.gremlin.util.function.BulkSetSupplier',\n 'ChainedComparator': 'org.apache.tinkerpop.gremlin.util.function.ChainedComparator',\n 'ConstantSupplier': 'org.apache.tinkerpop.gremlin.util.function.ConstantSupplier',\n 'FunctionUtils': 'org.apache.tinkerpop.gremlin.util.function.FunctionUtils',\n 'HashMapSupplier': 'org.apache.tinkerpop.gremlin.util.function.HashMapSupplier',\n 'HashSetSupplier': 'org.apache.tinkerpop.gremlin.util.function.HashSetSupplier',\n 'MeanNumberSupplier': 'org.apache.tinkerpop.gremlin.util.function.MeanNumberSupplier',\n 'ScriptEngineLambda': 'org.apache.tinkerpop.gremlin.util.function.ScriptEngineLambda',\n 'ThrowingBiConsumer': 'org.apache.tinkerpop.gremlin.util.function.ThrowingBiConsumer',\n 'ThrowingConsumer': 'org.apache.tinkerpop.gremlin.util.function.ThrowingConsumer',\n 'ThrowingFunction': 'org.apache.tinkerpop.gremlin.util.function.ThrowingFunction',\n 'ThrowingSupplier': 'org.apache.tinkerpop.gremlin.util.function.ThrowingSupplier',\n 'TraversableLambda': 'org.apache.tinkerpop.gremlin.util.function.TraversableLambda',\n 'TreeSupplier': 'org.apache.tinkerpop.gremlin.util.function.TreeSupplier',\n 'TriConsumer': 'org.apache.tinkerpop.gremlin.util.function.TriConsumer',\n 'TriFunction': 'org.apache.tinkerpop.gremlin.util.function.TriFunction',\n 'Gremlin': 'org.apache.tinkerpop.gremlin.util.Gremlin',\n 'ScriptEngineCache': 'org.apache.tinkerpop.gremlin.util.ScriptEngineCache',\n 'Serializer': 'org.apache.tinkerpop.gremlin.util.Serializer',\n 'TimeUtil': 'org.apache.tinkerpop.gremlin.util.TimeUtil',\n 'ClassNode': 'org.codehaus.groovy.ast.ClassNode',\n 'CompilerConfiguration': 'org.codehaus.groovy.control.CompilerConfiguration',\n 'CompilationCustomizer': 'org.codehaus.groovy.control.customizers.CompilationCustomizer',\n 'NullObject': 'org.codehaus.groovy.runtime.NullObject',\n 'Groovysh': 'org.codehaus.groovy.tools.shell.Groovysh',\n 'ManagedReference': 'org.codehaus.groovy.util.ManagedReference',\n 'ReferenceBundle': 'org.codehaus.groovy.util.ReferenceBundle'\n };\n return shortToLongMap[className];\n }", "title": "" }, { "docid": "49859867e34b4a71707e527cdbc052f6", "score": "0.39711308", "text": "function create(uri, range) {\n return { uri: uri, range: range };\n }", "title": "" }, { "docid": "49859867e34b4a71707e527cdbc052f6", "score": "0.39711308", "text": "function create(uri, range) {\n return { uri: uri, range: range };\n }", "title": "" }, { "docid": "f13fb432bd802020ed8333d71e059f39", "score": "0.39691612", "text": "function getPositionFromClass(nodeClass){}", "title": "" }, { "docid": "229383ed7d1e2e3cb304fd5ec7bb8861", "score": "0.3967568", "text": "function ClassHandle() {\n}", "title": "" }, { "docid": "0c52e8c6b1237e749a4a1f40c20b91a7", "score": "0.3964837", "text": "function toFeed(source, responseBody) {\n switch(source.parser) {\n case Constants.Feed.Parser.Reddit:\n return Integrations.Reddit.parseFeedItems(responseBody)\n\n case Constants.Feed.Parser.Instagram:\n return Integrations.Instagram.parseFeedItems(responseBody)\n\n default:\n return Promise.resolve([])\n }\n}", "title": "" }, { "docid": "d88c0e28af2c584ddf79bf8c6915dbfa", "score": "0.3950877", "text": "function parseClass(node, isStatement) {\n next();\n node.id = tokType === _name ? parseIdent() : isStatement ? unexpected() : null;\n node.superClass = eat(_extends) ? parseExpression() : null;\n var classBody = startNode();\n classBody.body = [];\n expect(_braceL);\n while (!eat(_braceR)) {\n var method = startNode();\n if (tokType === _name && tokVal === \"static\") {\n next();\n method['static'] = true;\n } else {\n method['static'] = false;\n }\n var isGenerator = eat(_star);\n parsePropertyName(method);\n if (tokType !== _parenL && !method.computed && method.key.type === \"Identifier\" &&\n (method.key.name === \"get\" || method.key.name === \"set\")) {\n if (isGenerator) unexpected();\n method.kind = method.key.name;\n parsePropertyName(method);\n } else {\n method.kind = \"\";\n }\n method.value = parseMethod(isGenerator);\n classBody.body.push(finishNode(method, \"MethodDefinition\"));\n eat(_semi);\n }\n node.body = finishNode(classBody, \"ClassBody\");\n return finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\");\n }", "title": "" }, { "docid": "d88c0e28af2c584ddf79bf8c6915dbfa", "score": "0.3950877", "text": "function parseClass(node, isStatement) {\n next();\n node.id = tokType === _name ? parseIdent() : isStatement ? unexpected() : null;\n node.superClass = eat(_extends) ? parseExpression() : null;\n var classBody = startNode();\n classBody.body = [];\n expect(_braceL);\n while (!eat(_braceR)) {\n var method = startNode();\n if (tokType === _name && tokVal === \"static\") {\n next();\n method['static'] = true;\n } else {\n method['static'] = false;\n }\n var isGenerator = eat(_star);\n parsePropertyName(method);\n if (tokType !== _parenL && !method.computed && method.key.type === \"Identifier\" &&\n (method.key.name === \"get\" || method.key.name === \"set\")) {\n if (isGenerator) unexpected();\n method.kind = method.key.name;\n parsePropertyName(method);\n } else {\n method.kind = \"\";\n }\n method.value = parseMethod(isGenerator);\n classBody.body.push(finishNode(method, \"MethodDefinition\"));\n eat(_semi);\n }\n node.body = finishNode(classBody, \"ClassBody\");\n return finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\");\n }", "title": "" }, { "docid": "202f387f21ecbff3d2677e108de22e84", "score": "0.3949785", "text": "function extractIdFromUri( uri ) {\n if ( !uri ) {\n return;\n }\n //var matches = rPlayerUri;\n\n var matches = uri.match( rPlayerUri );\n\t alert(\"URI \" + matches);\n\t return matches ? matches[0].substr(25) : \"\";\n\t //return matches;\n }", "title": "" }, { "docid": "1bcfdb228bc6e570b3aa9922bfa53196", "score": "0.3946276", "text": "function getClassDeclarationOfSignature(signature) {\n let node = signature.getDeclaration();\n // Handle signatures which don't have an actual declaration. This happens if a class\n // does not have an explicitly written constructor.\n if (!node) {\n return null;\n }\n while (!ts.isSourceFile((node = node.parent))) {\n if (ts.isClassDeclaration(node)) {\n return node;\n }\n }\n return null;\n}", "title": "" } ]
74dd2db907c8f755ffce8d071739f401
see editDistance.js for discussion
[ { "docid": "41df874d08ee9d6870cf0189dc823313", "score": "0.0", "text": "function decideLastCharactes(i, j, matrix, actions){\n if(i === text.length && j === pattern.length ){\n matrix[i][j] = 0\n } else if(i === text.length ){\n actions[i][j] = [`insert final ${pattern.slice(j)}`, [i, pattern.length +1]]\n matrix[i][j] = pattern.length - j\n } else if(j === pattern.length ){\n actions[i][j] = [`delete last ${text.slice(i)} `, [text.length, j+1]]\n matrix[i][j] = text.length - i\n }\n}", "title": "" } ]
[ { "docid": "0c585febd3343e306269d4f49814f7a7", "score": "0.7014018", "text": "calculateDistance() {}", "title": "" }, { "docid": "55285bf89b86c0e73839fa7d1a9e78d9", "score": "0.68501616", "text": "function editDistance(str1, str2) {\n // YOUR CODE HERE\n}", "title": "" }, { "docid": "a54fb5de71b5810f547a1394bf034f9b", "score": "0.6487703", "text": "set distance(value) {\n this._distance = value;\n }", "title": "" }, { "docid": "63c9c6013dcd43af3814b5af62b9b51e", "score": "0.64039236", "text": "function distance() {\r\n \talert($('.distance').val());\r\n \t$('.dist').val($('.distance').val());\r\n }", "title": "" }, { "docid": "6a525ba59e15241fe06b09fbf65d74fa", "score": "0.6333683", "text": "function EXP_EXTDISTANCE()\r\n\t{\r\n\t}", "title": "" }, { "docid": "e99894806ec59fe3d493679e2fc39e10", "score": "0.633271", "text": "function saveDistance(e){\n\t\tvar item = e.section.getItemAt(e.itemIndex);\n\t\tTi.API.info('Saving distance for ' + e.source.itemId+ \" as \" + e.value);\n\t\tfleet = e.source.itemId.charAt(0);\n\t\tdistances[fleet] = e.value;\n\t}", "title": "" }, { "docid": "db5cefe98af8bb25eac617b6633d3980", "score": "0.6314501", "text": "function calculateDistance() {\n\n\tvar line = [];\n\n\tthis.getPath().forEach(function (latLng) {\n\t\tline.push(latLng);\n\t});\n\n\tvar polylineLengthMiles = calculateLineLength(line);\n\n\tvar lineCenter = google.maps.geometry.spherical.interpolate(line[0], line[1], 0.5);\n\tvar content = this.objInfo.parent + \"<br/>\" + this.objInfo.child;\n\n\tif (content.indexOf('-') == -1) {\n\t\tcontent = content.replace(\"<br/>\", \" to \");\n\t}\n\n\tinfowindow.setContent('<p class=\"marginTop\"><b>Distance</b> ' + polylineLengthMiles.toFixed(2) + ' miles</p><p class=\"smlMarginBottom\">' + content + '</p>');\n\tinfowindow.setPosition(lineCenter);\n\tinfowindow.open(map);\n}", "title": "" }, { "docid": "92d3db88304940f34694ed654363e9d9", "score": "0.6313627", "text": "function calcEditDistances(current,currentStart,currentEnd,old,oldStart,oldEnd){// \"Deletion\" columns\n// \"Addition\" rows. Initialize null column.\nfor(var rowCount=oldEnd-oldStart+1,columnCount=currentEnd-currentStart+1,distances=Array(rowCount),_i31=0;_i31<rowCount;_i31++){distances[_i31]=Array(columnCount);distances[_i31][0]=_i31}// Initialize null row\nfor(var j=0;j<columnCount;j++){distances[0][j]=j}for(var _i32=1;_i32<rowCount;_i32++){for(var _j=1;_j<columnCount;_j++){if(equals(current[currentStart+_j-1],old[oldStart+_i32-1]))distances[_i32][_j]=distances[_i32-1][_j-1];else{var north=distances[_i32-1][_j]+1,west=distances[_i32][_j-1]+1;distances[_i32][_j]=north<west?north:west}}}return distances}// This starts at the final weight, and walks \"backward\" by finding", "title": "" }, { "docid": "bb464036504b63c2dadfe9606feb9032", "score": "0.6310606", "text": "function spliceOperationsFromEditDistances(distances){var i=distances.length-1,j=distances[0].length-1,current=distances[i][j],edits=[];while(0<i||0<j){if(0==i){edits.push(EDIT_ADD);j--;continue}if(0==j){edits.push(EDIT_DELETE);i--;continue}var northWest=distances[i-1][j-1],west=distances[i-1][j],north=distances[i][j-1],min=void 0;if(west<north)min=west<northWest?west:northWest;else min=north<northWest?north:northWest;if(min==northWest){if(northWest==current){edits.push(EDIT_LEAVE)}else{edits.push(EDIT_UPDATE);current=northWest}i--;j--}else if(min==west){edits.push(EDIT_DELETE);i--;current=west}else{edits.push(EDIT_ADD);j--;current=north}}edits.reverse();return edits}", "title": "" }, { "docid": "a33ed13853d7771535dadb38c22941c0", "score": "0.6256459", "text": "static giveDistance(objeName, distance) {\r\n kobliSystem.change(objeName, \"DISTANCE\", distance);\r\n }", "title": "" }, { "docid": "abd00474d2f15dabe67e19059ca4d80a", "score": "0.61118805", "text": "linkdistance_change() {\r\n linkdistance_change_d3();\r\n }", "title": "" }, { "docid": "402f8dd13fcd2520d5c484a90c7fa399", "score": "0.6109892", "text": "function updateDistance(){\n game.distance += game.delta*game.speed;\n var t = game.distance/2;\n time.innerHTML = Math.floor(t);\n}", "title": "" }, { "docid": "8313a81c8781a662c8ee36068b9a62a4", "score": "0.6069528", "text": "set forceAppPointDistance(value) {}", "title": "" }, { "docid": "8ed0e66056a9cebd9a0079bef1f59442", "score": "0.6059211", "text": "function setDistance() {\n let x = document.getElementById('selectedDistance').value;\n swimDistance = `${distance[x][1]}`;\n bikeDistance = `${distance[x][2]}`;\n runDistance = `${distance[x][3]}`;\n document.getElementById(\"swim-distance\").innerHTML = `${swimDistance} m`;\n document.getElementById(\"bike-distance\").innerHTML = `${bikeDistance} km`;\n document.getElementById(\"run-distance\").innerHTML = `${runDistance} km`;\n \n swimTime = calcSwimTime(swimPace);\n bikeTime = calcBikeTime(bikePace);\n runTime = calcRunTime(runPace);\n \n document.getElementById(\"swim-time\").setAttribute('value',swimTime);\n document.getElementById(\"bike-time\").setAttribute('value',bikeTime);\n document.getElementById(\"run-time\").setAttribute('value',runTime);\n final();\n }", "title": "" }, { "docid": "67ad739f3e104b4f1fae19c13add3049", "score": "0.60461277", "text": "set maxDistance(value) {}", "title": "" }, { "docid": "1ff8cdc6a1050c3a0ad79bb87691c4e3", "score": "0.60405064", "text": "function handleDirectionsChange() {\n computeTotalDistance(directionsDisplay.getDirections());\n}", "title": "" }, { "docid": "ecaeca5247e256be96ab4e0e6a38b17a", "score": "0.60181016", "text": "function caluculateDistance()\r\n\t\t\t{\r\n\t\t\t\treturn Math.round(Math.sqrt(Math.pow(end.x - start.x,2) + Math.pow(end.y - start.y,2)));\r\n\t\t\t}", "title": "" }, { "docid": "03b740702ee08a7a0293cafd04d1d655", "score": "0.5981714", "text": "function spliceOperationsFromEditDistances(distances) {\n var i = distances.length - 1;\n var j = distances[0].length - 1;\n var current = distances[i][j];\n var edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n var northWest = distances[i - 1][j - 1];\n var west = distances[i - 1][j];\n var north = distances[i][j - 1];\n\n var min = void 0;\n if (west < north) min = west < northWest ? west : northWest;else min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}", "title": "" }, { "docid": "708a6437e3baefa16bc5e29212a6c56f", "score": "0.5979093", "text": "function minimumDistance_handler( event ) \n\t\t{ \n\t\t\t_appBase.setMinDistance( Math.round( event.getValue() ) );\n\t\t}", "title": "" }, { "docid": "b252031de9fdf8eeb582fb9c022422d9", "score": "0.59704953", "text": "function spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north)\n min = west < northWest ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}", "title": "" }, { "docid": "b252031de9fdf8eeb582fb9c022422d9", "score": "0.59704953", "text": "function spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north)\n min = west < northWest ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}", "title": "" }, { "docid": "792003471f01293e59d4dc2a720a7d79", "score": "0.5968381", "text": "function routeDistance(dist) {\n html += '<div style=\"text-align: left; padding-bottom: 0.3em;\">' + dist + '</div>';\n }", "title": "" }, { "docid": "ac202f6b81b6161cd432e82be6e783b8", "score": "0.5949752", "text": "function spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n const edits = [];\n while (i > 0 || j > 0) {\n if (i === 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j === 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n const northWest = distances[i - 1][j - 1];\n const west = distances[i - 1][j];\n const north = distances[i][j - 1];\n let min;\n if (west < north) {\n min = west < northWest ? west : northWest;\n }\n else {\n min = north < northWest ? north : northWest;\n }\n if (min === northWest) {\n if (northWest === current) {\n edits.push(EDIT_LEAVE);\n }\n else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n }\n else if (min === west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n }\n else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n edits.reverse();\n return edits;\n}", "title": "" }, { "docid": "6fd337e7ca1c457e5e7764911f8d9908", "score": "0.5949704", "text": "function printDistance(distance, name, id) {\n // If distance isn't calculated properly, don't print `NaN`\n if (isNaN(distance)) {\n console.log('Distance not calculated properly, please refresh.');\n var distance = '';\n } else {\n var distance = distance + ' miles away'\n }\n $('#'+id+' .distance').text(distance); // Find corresponding div inside table and print distance\n allInfoObject[name] += '<span>'+distance+'<span>' // Append distances to infowindows object\n}", "title": "" }, { "docid": "fd3c1b9feb64dc7a3eeedff957d40132", "score": "0.59492576", "text": "distance() {\r\n let dist = Math.abs(this.x - this.state.end_x) + Math.abs(this.y - this.state.end_y);\r\n return dist;\r\n }", "title": "" }, { "docid": "2d411ebcbcb834d326ad7f6926e23cb2", "score": "0.5932579", "text": "adapt(distance){\n if (distance > this.desiredActionStddev){\n this.currentStddev /= this.adoptionCoefficient;\n }\n else{\n this.currentStddev *= this.adoptionCoefficient;\n }\n }", "title": "" }, { "docid": "1fea519360a358f97cc6f51d92ef87d9", "score": "0.59158266", "text": "function spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n const edits = [];\n\n while (i > 0 || j > 0) {\n if (i === 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n\n if (j === 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n\n const northWest = distances[i - 1][j - 1];\n const west = distances[i - 1][j];\n const north = distances[i][j - 1];\n let min;\n\n if (west < north) {\n min = west < northWest ? west : northWest;\n } else {\n min = north < northWest ? north : northWest;\n }\n\n if (min === northWest) {\n if (northWest === current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n\n i--;\n j--;\n } else if (min === west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}", "title": "" }, { "docid": "fdcfe3e2626047404f097da9fbccd204", "score": "0.59064", "text": "updateMarkerDistance(distance) {\n this.laserMarker.position.z = distance;\n }", "title": "" }, { "docid": "f45d78e96f0c81314a8254749ea57b94", "score": "0.58961076", "text": "function showDistance(distance) {\n return Math.round(distance/100) / 10 + \" km (\" + Math.round((distance*0.621371192)/100) / 10 + \" miles)\";\n}", "title": "" }, { "docid": "beaaaaa2b023452c70f8f6ecbf47d189", "score": "0.5871633", "text": "function renderPlaces(places) {\n let scene = document.querySelector('a-scene');\n\n places.forEach((place) => {\n let latitude = place.location.lat;\n let longitude = place.location.lng;\n\n let model = document.createElement('a-entity');\n\n////////////////////\n\n\n\n\n ///// CANNOT FIGURE OUT HOW TO GET DISTANCE\n \n \n\n\n // let lat1 = position.coords.latitude;\n // let long1 = position.coords.longitude;\n \n // if(navigator.geolocation) {\n // navigator.geolocation.getCurrentPosition(showLocation, errorHandler, options); {}}\n \n let f = location.lng;\n let q = location.lat;\n \n ///////// Try to fine tune and get a good distance\n///Get F and Q to work\n // function distanceLong() {\n // if(longitude > location.long) {\n // let f = longitude - location.long;}\n // else{\n // let f = location.long - longitude;}\n // console.log(location.long); \n // };\n\n\n // function distanceLat() {\n // if(latitude > location.lat) {\n // let q = latitude - location.lat;}\n // else{\n // let q = location.lat - latitude;}\n // console.log(location.lat); \n // };\n\n\n\n\n\n // navigator.geolocation.getCurrentPosition((position.coords.longitude))\n\n\n // const R = 6371e3; // metres\n // const v = latitude * Math.PI/180; // φ, λ in radians\n // const w = location.lat * Math.PI/180;\n // const b = (location.lat-latitude) * Math.PI/180;\n // const l = (location.lng-longitude) * Math.PI/180;\n \n // const a = Math.sin(b/2) * Math.sin(b/2) +\n // Math.cos(v) * Math.cos(w) *\n // Math.sin(l/2) * Math.sin(l/2);\n // const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n \n // const d = R * c; // in metres\n\n\n //let e = d/1000;\n\n\n // let e = f+q;\n//let p = location.lat/100;\n let p = location.lat + latitude;\n let t = location.long - longitude;\n\n //let e = f + q / 10;\n\n\n// Allows above perspective camera +5 let size = (p + t)/-0.6;\n \n//Colleseum style camera +70\nlet modelHeight = [(p + t) * 0.3];\n\n //another below view camera 0\n // let size = (p - t) - 120;\n\n //allows below perspective amera +120\n // let size = (p + t)/0.6;\n\n// let size = (p + t)/0.6;\n//////////////TRYING TO PUT INTERSECTION HERE\n\n\n\n\n \n console.log(location.long);\n \n console.log(modelHeight);\n //let size = '0.1, 0.1, 0.1';\n\n // model.addEventListener('clickhandler2');\n // this.addEventListener(\"click\", clickhandler2);\n\n model.setAttribute('position', `0 ${modelHeight} 0;`);\n\n model.setAttribute('gps-entity-place', `latitude: ${latitude}; longitude: ${longitude};`);\n model.setAttribute('gltf-model', 'models/coffeeCup8-10-20.gltf');\n \n //model.setAttribute('material', 'shader: my-custom;', 'opacity: 0.5;');\n\n \n\n \n //allows to rotate\n model.setAttribute('animation', 'property: rotation; to: 0 360 0; loop:true; dur: 6000; easing: linear');\n\n // model.setAttribute('scale', `${e} ${e} ${e};`);\n model.setAttribute('scale', `0.1 0.1 0.1;`);\n // model.setAttribute('scale', `${t} ${t} ${t};`);\n // model.setAttribute('scale', `${size} ${size} ${size};`);\n \n\n // model.setAttribute('animation-mixer','clip: Take 001; loop:repeat');\n // model.tree.rotateY(0.01);\n // model.setAttribute.tree.rotateY(0.01);\n // model.object3D.rotation.y = THREE.Math.degToRad(360);\n // this.animate('properties[rotate]');\n // this.setAttribute('animate',{rotateY: \"*\",loop: \"repeat\", repetitions: 2});\n // model.object3D.rotation.divideScalar(2);\n // model.setAttribute('rotation', '180');\n\n \n //model.setAttribute('scale', size);\n //model.object3D.scale.z += 2.5;\n // model.object3D.scale = [10, 10, 10];\n\n\n\n\n // model.setAttribute('color', 'green');\n // model.setAttribute('opacity', '0.75');\n\n // model.setAttribute('animation-loop', {action: e.action, loopDelta: e.loopDelta});\n\n // model.setAttribute('animation-mixer',{clip: \"*\",loop: \"repeat\", repetitions: 2});\n // model.setAttribute('rotation', loop=\"repeat\", {x: 0 , y: 360, z: 0,});\n // model.addEventListener('raycaster-intersection',\n // function () {\n // window.alert('Player hit something!');\n model.addEventListener('loaded', () => {\n window.dispatchEvent(new CustomEvent('gps-entity-place-loaded'))\n \n });\n\n // model.object3D.rotation.set(\n // THREE.Math.degToRad(15),\n // THREE.Math.degToRad(30),\n // THREE.Math.degToRad(90)\n // );\n // model.object3D.rotation.y += Math.PI;\n \n // With .setAttribute (less recommended).\n // model.setAttribute('rotation', {x: 15, y: 30, z: 90});\n\n\n\n//removes model when clicked\nmodel.addEventListener('click', () => {\n model.remove();\n //window.open(\"https://www.starbucks.com/menu?_branch_match_id=713537451166389183\", \"Starbucks Order\");\n document.getElementById(\"hwPopup\").style.display =\"unset\";\n\n\n\n\n\n\n\n //modelHeight<=18.19\n// document.getElementById(\"hwPopup\").style.display =\"unset\";\n\n //HAS TO BE CONNECTED TO ANSCHUTZ WIFI TO WORK - Building floor plans\n //window.open(\"maps/Q20_Building_Start_Page.html#\", \"new win\");\n \n });\n\n scene.appendChild(model);\n\n\n\n let camHeight = document.querySelector(\"a-camera\"); \n let camHeight2 = camHeight.object3D.position;\n\n // if ([(p + t) * 0.3]<=23.805){\n // if (model.modelHeight<=23.805){\n if (modelHeight<=camHeight2.y-16.316){ \n //score++;\n // scene.removeChild(model); \n // this.object3D.remove();\n this.model.remove();\n console.log(camHeight2.y);\n }\n\n\n\n\n\n\n //if (model.position.y >= 22000){\n\n // model.object3D.position.y\n\n//if (this.position.y<=10){\n\n // score++;\n // scene.removeChild(model);\n //this.el.remove();\n //}\n\n\n });\n}", "title": "" }, { "docid": "b46cfd3356fdecaa8a81e9bf048b126d", "score": "0.5859621", "text": "function setDistance(scope) {\n sign_limit = 30 + (scope.distance - 1) * 20;\n /** * Number of sign image to show.\n * Time taken to discharge electron\n * value will change based on the slider value */\n if (distance > scope.distance && turn_on && pluse_sign_count >= sign_limit) { /** To show spark while decrease distance between domes */\n getCBN(\"spark\").alpha = 1;\n }\n distance = scope.distance;\n getCBN(\"dome_movable\").x = initiaXY[0].domeX - (scope.distance - 1) * 5; /** Adjust the position of small dome */\n container_small_dome.x = initiaXY[0].domeX - (scope.distance - 1) * 5; /** Adjust the position of minus sign with respect to position of small dome */\n stage.update();\n}", "title": "" }, { "docid": "b57e7ec2c20feb9f6f7a181ea0efc5d7", "score": "0.5844226", "text": "function updateDistance(div, location) {\n var lon,\n lat,\n divLocation,\n text;\n\n lon = parseFloat(div.children('.lon').html());\n lat = parseFloat(div.children('.lat').html());\n\n divLocation = {\n lon: lon,\n lat: lat\n };\n\n text = E.generate.distanceInner(divLocation, location);\n\n div.removeClass('location_data').addClass('distance');\n div.html(text);\n\n }", "title": "" }, { "docid": "78f4a7f6f8d62fe04de11527d0712a75", "score": "0.58341175", "text": "distance(actor) {\n let x1 = (this.x * TILE_SIZE) + this.renderOff.x;\n let y1 = (this.y * TILE_SIZE) + this.renderOff.y;\n let x2 = (actor.x * TILE_SIZE) + actor.renderOff.x;\n let y2 = (actor.y * TILE_SIZE) + actor.renderOff.y;\n // console.log(Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)));\n return (Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)));\n }", "title": "" }, { "docid": "267ec2f8d2ed4a5bb57bc49c770d0d93", "score": "0.58336216", "text": "setViewDistance(viewDistance) {\n this.m_viewDistance = viewDistance;\n }", "title": "" }, { "docid": "49cc5ceeb42f6664a1908b1a1790a534", "score": "0.58193094", "text": "get_distance(enemies){\n let xDistance = this.x - enemies.x;\n let yDistance = this.y - enemies.y;\n \n return Math.sqrt(Math.pow(xDistance,2)+Math.pow(yDistance,2));\n }", "title": "" }, { "docid": "26961236f8da5a26a4b2e73de4446afa", "score": "0.5795125", "text": "function setDistance(p1, p2) {\n\t\t\t\tvar x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null,\n\t\t\t\t\ty = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null,\n\t\t\t\t\tr = (x || 0) + (y || 0);\n\n\t\t\t\tp2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE;\n\t\t\t\tp2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE;\n\t\t\t}", "title": "" }, { "docid": "11a5fefbdfd758456503433c6991f972", "score": "0.5780367", "text": "function calculateDistances() {\n var service = new google.maps.DistanceMatrixService();\n service.getDistanceMatrix(\n { \n origins: [document.getElementById(\"origins\").value],\n destinations: [document.getElementById(\"destinations\").value],\n travelMode: google.maps.TravelMode.DRIVING, \n unitSystem: google.maps.UnitSystem.METRIC,\n avoidHighways: false,\n avoidTolls: false\n }, callback);\n }", "title": "" }, { "docid": "04f3c55c696878259eae25f7f8557e9b", "score": "0.5767672", "text": "getPosition(distance : number): void{\n console.log('My position is ' + distance + 'miles from the start');\n }", "title": "" }, { "docid": "267c6d7245050e359798dd6f0c616a07", "score": "0.5756953", "text": "function calcDist(){\n var distance = (google.maps.geometry.spherical.computeDistanceBetween(marker.position, streetViewLoc)).toFixed(2);\n if(distance < 5280){\n console.log(distance + 'ft');\n } else{\n distance = (distance / 5280).toFixed(2);\n console.log(distance + 'mi');\n }\n\n var coordsArray = [];\n coordsArray.push(marker.position, streetViewLoc);\n roundResults(coordsArray, distance);\n }", "title": "" }, { "docid": "c208fd5e8b63bba66203231b3cd89f75", "score": "0.5756515", "text": "constructor(points){\n /*\n POINTS: n*d matrix (2d array) where rows are points and columns are dimensions\n */\n \n this.points = points\n this.n = points.length\n this.distances = calculateDistances(points)\n this.maxDistance = Math.max(...this.distances[0])\n console.log(this.maxDistance)\n console.log(this.distances)\n\n this.k = 10 // number of nearest points to display at one time (size of neighbourhood)\n this.selected = 0 //index of currently viewed point\n this.sortedIndices = [...Array(this.n).keys()]\n this.nn = []\n this.nnWeights = new Array(this.n).fill(1)\n\n this.range = 10\n this.springConstant = 3\n this.repulsionConstant = 0.25\n this.mass = 0.1\n this.dragConstant = 0.1\n this.scaleModifier = 0.2 //TEMPORARY\n this.weighByDistance = true // springs are stronger for nearer points\n\n var positionsMatrix = getRandomPoints(this.n, 3, this.range)\n this.positions = positionsMatrix.map(p => new THREE.Vector3(p[0], p[1], p[2]))\n this.velocities = []\n for (var i = 0; i < this.n; i++) this.velocities.push(new Vector3())\n this.forces = []\n for (var i = 0; i < this.n; i++) this.forces.push(new Vector3())\n\n //changeFocus(i)\n }", "title": "" }, { "docid": "2a80654ca0ae7d43487f4040c4bc3e41", "score": "0.57499313", "text": "function setPointCoordinates()\n{\n if(map.projection != \"EPSG:4326\")\n {\n var fromProjection = new OpenLayers.Projection(map.projection);\n var toProjection = new OpenLayers.Projection(\"EPSG:4326\");\n\n var pt1 = new OpenLayers.Geometry.Point(lyrDistancePoints.features[0].geometry.x, lyrDistancePoints.features[0].geometry.y).transform(fromProjection, toProjection);\n var pt2 = new OpenLayers.Geometry.Point(lyrDistancePoints.features[1].geometry.x, lyrDistancePoints.features[1].geometry.y).transform(fromProjection, toProjection);\n }\n else\n {\n var pt1 = new OpenLayers.Geometry.Point(lyrDistancePoints.features[0].geometry.x, lyrDistancePoints.features[0].geometry.y);\n var pt2 = new OpenLayers.Geometry.Point(lyrDistancePoints.features[1].geometry.x, lyrDistancePoints.features[1].geometry.y);\n }\n\n var Stellen = 4;\n var fktr = Math.pow(10,Stellen);\n var Msg = Math.round(pt1.x*fktr)/fktr + \",\" + Math.round(pt1.y*fktr)/fktr + \",\" + Math.round(pt2.x*fktr)/fktr + \",\" + Math.round(pt2.y*fktr)/fktr;\n var Coordinates = window.prompt(\"new coordinates in grad\", Msg);\n\n if(Coordinates != Msg && Coordinates!=null)\n {\n var tmp = Coordinates.split(\",\");\n\n if(map.projection != \"EPSG:4326\")\n {\n var toProjection = new OpenLayers.Projection(map.projection);\n var fromProjection = new OpenLayers.Projection(\"EPSG:4326\");\n\n var pt1 = new OpenLayers.Geometry.Point(parseFloat(tmp[0]), parseFloat(tmp[1])).transform(fromProjection, toProjection);\n var pt2 = new OpenLayers.Geometry.Point(parseFloat(tmp[2]), parseFloat(tmp[3])).transform(fromProjection, toProjection);\n }\n else\n {\n var pt1 = new OpenLayers.Geometry.Point(parseFloat(tmp[0]), parseFloat(tmp[1]));\n var pt2 = new OpenLayers.Geometry.Point(parseFloat(tmp[2]), parseFloat(tmp[3]));\n }\n\n lyrDistancePoints.features[0].geometry.x = pt1.x;\n lyrDistancePoints.features[0].geometry.y = pt1.y;\n lyrDistancePoints.features[1].geometry.x = pt2.x;\n lyrDistancePoints.features[1].geometry.y = pt2.y;\n }\n lyrDistancePoints.drawFeature(lyrDistancePoints.features[0]);\n lyrDistancePoints.drawFeature(lyrDistancePoints.features[1]);\n}", "title": "" }, { "docid": "ef6c46318fc4cc0524ba2dad277c1171", "score": "0.57318324", "text": "function setDistance(p1, p2) {\n\t\t\tvar x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null,\n\t\t\t\ty = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null,\n\t\t\t\tr = (x || 0) + (y || 0);\n\n\t\t\tp2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE;\n\t\t\tp2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE;\n\t\t}", "title": "" }, { "docid": "f7ce4f69b33c4e86d1ec8d82b58364a4", "score": "0.5729471", "text": "function setDistance(p1, p2) {\n var x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null,\n y = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null,\n r = (x || 0) + (y || 0);\n\n p2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE;\n p2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE;\n }", "title": "" }, { "docid": "acb5f8134b68369288b883bf3c96b20b", "score": "0.56815064", "text": "function calculateDistance(event) {\n // prevent form from submitting\n event.preventDefault();\n\n // get value from input with id=\"screen-size\"\n // and convert from string to number to get\n // screen size in inches\n let screenSize = Number($(\"input#screen-size\").val());\n\n // minimum viewing distance is 1.2 x screen size\n let minDistance = 1.2 * screenSize;\n\n // maximum viewing distance is 2.5 x screen size\n let maxDistance = 2.5 * screenSize;\n\n // convert both from inches to feet\n minDistance /= 12;\n maxDistance /= 12;\n\n // output selected TV size\n $(\"p#output-size\").text(`Selected TV screen size: ${screenSize}`);\n\n // output rounded values\n $(\"p#output-min\").text(`Minimum viewing distance: ${Math.round(minDistance)} feet`);\n $(\"p#output-max\").text(`Maximum viewing distance: ${Math.round(maxDistance)} feet`);\n}", "title": "" }, { "docid": "bfec57911113fe795b7008dc2608fa59", "score": "0.5651879", "text": "function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) {\n // \"Deletion\" columns\n const rowCount = oldEnd - oldStart + 1;\n const columnCount = currentEnd - currentStart + 1;\n const distances = new Array(rowCount);\n let north;\n let west; // \"Addition\" rows. Initialize null column.\n\n for (let i = 0; i < rowCount; ++i) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n } // Initialize null row\n\n\n for (let j = 0; j < columnCount; ++j) {\n distances[0][j] = j;\n }\n\n for (let i = 1; i < rowCount; ++i) {\n for (let j = 1; j < columnCount; ++j) {\n if (current[currentStart + j - 1] === old[oldStart + i - 1]) {\n distances[i][j] = distances[i - 1][j - 1];\n } else {\n north = distances[i - 1][j] + 1;\n west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n} // This starts at the final weight, and walks \"backward\" by finding", "title": "" }, { "docid": "acfb2674a8beb68b04fb9701d44dd4d6", "score": "0.5646094", "text": "function setDistance(p1, p2) {\n var x = (defined(p1[kdX]) && defined(p2[kdX])) ?\n Math.pow(p1[kdX] - p2[kdX], 2) :\n null,\n y = (defined(p1[kdY]) && defined(p2[kdY])) ?\n Math.pow(p1[kdY] - p2[kdY], 2) :\n null,\n r = (x || 0) + (y || 0);\n\n p2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE;\n p2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE;\n }", "title": "" }, { "docid": "423c6c4505e3cabbdf76658c4a3ff7c9", "score": "0.564569", "text": "function setDistance(p1, p2) {\n var x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null,\n y = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null,\n r = (x || 0) + (y || 0);\n\n p2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE;\n p2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE;\n }", "title": "" }, { "docid": "423c6c4505e3cabbdf76658c4a3ff7c9", "score": "0.564569", "text": "function setDistance(p1, p2) {\n var x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null,\n y = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null,\n r = (x || 0) + (y || 0);\n\n p2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE;\n p2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE;\n }", "title": "" }, { "docid": "d6a966aee05147587ed0c4c52fa6d186", "score": "0.56391484", "text": "get maxDistance() {}", "title": "" }, { "docid": "d32b166f497f510cc53a87f8454bcef5", "score": "0.5630764", "text": "function DistanceInput() {\n this.proxyA = new DistanceProxy();\n this.proxyB = new DistanceProxy();\n this.transformA = null;\n this.transformB = null;\n this.useRadii = false;\n}", "title": "" }, { "docid": "3f548fc0aff33c38f1c6604a29995583", "score": "0.5622643", "text": "get distance() {\n return this.controls.stingLengthControl.control.value();\n }", "title": "" }, { "docid": "e3a0e264e7de592476b866c4a82665a8", "score": "0.56002015", "text": "function updateSpeed(){\n\n\tshowPath=false;\n\tconsole.log('rangeee speed'+showPath);\n\tvar minSpeed=document.getElementById('lowrange').value;\n\tvar maxSpeed=document.getElementById('highrange').value;\n\n\tif(theMarker.length>0){\n\t\tfor(var i=0;i<theMarker.length;i++){\n\t\t\t map.removeLayer(theMarker[i]);\n\t\t}\n\n\t}\n\n if (streetNames != undefined)\n {\n map.removeLayer(streetNames)\n }\n\n\tshowLayers();\n\tdocument.getElementById('chkYes').checked = false;\n\tfor(i=0;i<trips.features.length;i++){\n if(trips.features[i].properties.avspeed >= minSpeed && trips.features[i].properties.avspeed<= maxSpeed){\n trips.features[i].properties.highlight =true;\n\n\t }\n\t}\n\thideLayers();\n\n}", "title": "" }, { "docid": "0df7807d4ebaff7e3ff326083183068c", "score": "0.5599149", "text": "function getDistance() {\r\n\t//getDistanceFromPoint is the function called once the distance has been found\r\n\tnavigator.geolocation.getCurrentPosition(getDistanceFromPoint);\r\n}", "title": "" }, { "docid": "3b5977c6ade8d603b79203f822f874cb", "score": "0.559831", "text": "distance_trajet(trajet) {}", "title": "" }, { "docid": "e75c1ef9835eaa4401e7dafd8fb0785e", "score": "0.5590946", "text": "get trainer_Form_Distance() {return browser.element(\"//android.widget.ScrollView/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.TextView[4]\");}", "title": "" }, { "docid": "e5d663e62ecff23443cad4336a627dc8", "score": "0.557933", "text": "function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) {\n // \"Deletion\" columns\n var rowCount = oldEnd - oldStart + 1;\n var columnCount = currentEnd - currentStart + 1;\n var distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (var i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (var j = 0; j < columnCount; j++) {\n distances[0][j] = j;\n }for (var _i = 1; _i < rowCount; _i++) {\n for (var _j = 1; _j < columnCount; _j++) {\n if (equals(current[currentStart + _j - 1], old[oldStart + _i - 1])) distances[_i][_j] = distances[_i - 1][_j - 1];else {\n var north = distances[_i - 1][_j] + 1;\n var west = distances[_i][_j - 1] + 1;\n distances[_i][_j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n}", "title": "" }, { "docid": "049a13878f9c81ae5f4ec35e7651c622", "score": "0.5576", "text": "function dispDistance(route) {\n document.getElementById(\"dist\").innerHTML = \"Total distance you will travel is: \" +\n Math.round(metersToMiles(routeDistance(route))) + \" miles\";\n}", "title": "" }, { "docid": "2bcb38f2a7914d1665d652ee50dcf9c6", "score": "0.55704534", "text": "function checkLocation() {\t// Checking the current status of the location\n\tif (distance!=null & distance!=\"unavailable\") {\n\t\t$(\"#location_summary\").val(distance+\"m\");\n\t};\n}", "title": "" }, { "docid": "1db5d2fe6739c17b4b15f13c1ce51f2a", "score": "0.5564835", "text": "function setDistances() {\n for (var i = 1; i < points.length; i++) {\n distances.push(distance(points[i - 1].x, points[i - 1].y, points[i].x, points[i].y))\n }\n}", "title": "" }, { "docid": "6e089c8a2f8d260d6a39796faae8936a", "score": "0.555882", "text": "function collectTimeAndDistance() {\n // Reset previous values\n directionsModel.duration.value = 0;\n directionsModel.distance.value = 0;\n // Collect time and distance information\n for (var i = 0; i < directionsModel.route.legs.length; i++) {\n directionsModel.duration.value += directionsModel.route.legs[i].duration.value; // seconds\n directionsModel.distance.value += directionsModel.route.legs[i].distance.value; // meters\n }\n directionsModel.duration.text = secondsToTimeFormat(directionsModel.duration.value);\n directionsModel.distance.text = metersToKmFormat(directionsModel.distance.value) + ' km'; // to km\n }", "title": "" }, { "docid": "9f77f4a288b7b64cdf29422abf89f5aa", "score": "0.5557696", "text": "function fittsDistanceMouseMove(interactive,distanceCalculation) {\n return () => {\n\n let colors,\n coordinates,\n fittsResults,\n roundedDistance,\n scale;\n\n interactive.indicator\n .deEmphasize();\n\n interactive.distanceText\n .killPulse();\n\n\n interactive.tooltip\n .show();\n\n colors = fittsColors();\n\n fittsResults = interactive.calculations\n .calculateFittsLaw(interactive.target,interactive.cursor);\n\n //TODO: FIGURE OUT WHAT'S UP HERE\n if(fittsResults) {\n\n roundedDistance = fittsResults.distance.toFixed(0);\n\n\n interactive.equations.distance\n .updateDistance(roundedDistance);\n\n distanceCalculation\n .update({\n \"distance\":roundedDistance,\n });\n }\n\n scale = interactive\n .getCurrentScale();\n\n coordinates = {\n \"x\":(1 / scale) * d3.event.offsetX,\n \"y\":(1 / scale) * d3.event.offsetY\n };\n\n interactive.tooltip\n .move({\n \"x\":coordinates.x,\n \"y\":coordinates.y + 20\n });\n\n interactive.cursor\n .move({\n \"x\":coordinates.x,\n \"y\":coordinates.y\n });\n\n // TODO: UPDATE DISTANCE TEXT\n interactive.distanceText\n .update(\"\");\n\n interactive.distanceLine\n .move(\n {\n \"x1\":fittsResults.cursorCoordinates.x,\n \"y1\":fittsResults.cursorCoordinates.y,\n \"x2\":fittsResults.nearestIntersection.x,\n \"y2\":fittsResults.nearestIntersection.y\n }\n );\n\n\n };\n}", "title": "" }, { "docid": "588143cf4ad7d8498ade894ced022807", "score": "0.55575615", "text": "attenuateDistance(distance) {\n const f = distance / this.radius;\n return 1 / (f * f);\n }", "title": "" }, { "docid": "e3ae1ce72ddff2d0398a2a19d30d26be", "score": "0.55566126", "text": "get forceAppPointDistance() {}", "title": "" }, { "docid": "36722b67164b57506a8fd11903267467", "score": "0.55523777", "text": "function GMapsDistanceMarkers() {\r\n\tDistanceMarkerPointsCalculator.apply( this, arguments );\r\n}", "title": "" }, { "docid": "f063fb3a717e6f507e2733a0ff20449a", "score": "0.5534846", "text": "function getDistance(id) {\n\tlet otherPos = userMap[id].avatar.model.position;\n\treturn (otherPos.x - camera.position.x) ** 2 +\n\t\t(otherPos.z - camera.position.z) ** 2;\n}", "title": "" }, { "docid": "4c3fb5973990bbf12fbea2137bdb2d41", "score": "0.5520245", "text": "get directDistanceTraveled() {\n return this.getDistanceToCoord(this.startX, this.startY);\n }", "title": "" }, { "docid": "a42cce186fd417263873e33469aac11c", "score": "0.5514471", "text": "function updatePosition(latlng)\n{ \n jQuery('#lat').val(latlng.lat());\n jQuery('#long').val(latlng.lng());\n}", "title": "" }, { "docid": "655904c4a1f8136c2f4fcc5cb390aec6", "score": "0.5503577", "text": "function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) {\n // \"Deletion\" columns\n const rowCount = oldEnd - oldStart + 1;\n const columnCount = currentEnd - currentStart + 1;\n const distances = new Array(rowCount);\n let north;\n let west;\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; ++i) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n // Initialize null row\n for (let j = 0; j < columnCount; ++j) {\n distances[0][j] = j;\n }\n for (let i = 1; i < rowCount; ++i) {\n for (let j = 1; j < columnCount; ++j) {\n if (current[currentStart + j - 1] === old[oldStart + i - 1]) {\n distances[i][j] = distances[i - 1][j - 1];\n }\n else {\n north = distances[i - 1][j] + 1;\n west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n return distances;\n}", "title": "" }, { "docid": "0c5db2a6866d3e4b077765a364ccb8e9", "score": "0.549174", "text": "update() {\n\t\tif (this.position.x != this.point.x || this.position.y != this.point.y) {\n\t\t\tthis.position.x -= this.distance_x;\n\t\t\tthis.position.y -= this.distance_y;\n\t\t} else {\n\t\t\tthis.ready = true;\n\t\t}\n\t}", "title": "" }, { "docid": "30c2fd42ed9cd4ef0c227f234df9c925", "score": "0.54810554", "text": "get viewDistance() {\n return this.m_viewDistance;\n }", "title": "" }, { "docid": "447ef0ae0dc34c0a157b5c8a0e0446e2", "score": "0.54774654", "text": "function calcDistance(m,n){\n\treturn ((xCenter - m)**2+(yCenter - n)**2)**0.5;\n} //distance from the center", "title": "" }, { "docid": "7b5de14ab265a1a867956245b4b24750", "score": "0.54754263", "text": "getDistanceBetween (clueMarker) {\n let distanceResult = google.maps.geometry.spherical.computeDistanceBetween(clueMarker.getLatLng(), this.getLatLng())\n return distanceResult\n }", "title": "" }, { "docid": "f79ced93c64a387c25bd1096a9c38d46", "score": "0.54727936", "text": "function computeDistance() {\r\n\tvar distance = 0;\r\n\tvar dist1 = 0;\r\n\tvar dist2 = 0;\r\n\t\r\n\tfor(var i = 0; i < (drumDescris.length-1) ; i++)\r\n\t{\r\n\t\tdist1 = drumDescris[i];\r\n\t\tdist2 = drumDescris[i+1];\r\n\t\t\r\n\t\tdistance += google.maps.geometry.spherical.computeDistanceBetween(dist1, dist2);\r\n\t}\r\n\t\r\n\tdistanceR = Math.round((distance/1000)*100)/100;\r\n\tvar summaryPanel = document.getElementById('distanta');\r\n\tsummaryPanel.innerHTML = '';\r\n\tsummaryPanel.innerHTML += (distanceR + ' km');\r\n}", "title": "" }, { "docid": "7340f01c1824904d8d0eb9c6ccc10370", "score": "0.5470702", "text": "function closestFormUnansweredPoint(position) {\r\n // take the leaflet formdata layer\r\n // go through each point one by one\r\n // and measure the distance to Warren Street\r\n // for the closest point show the pop up of that point\r\n var minDistance = 10;\r\n var closestFormUnansweredPoint = 0;\r\n\r\n // for this example, use the latitude/longitude of warren street\r\n // in your assignment replace this with the user's location var userlng = -0.139924;\r\n unansweredLayer.eachLayer(function(layer) {\r\n var distance = calculateDistance(position.coords.latitude, position.coords.longitude,layer.getLatLng().lat, layer.getLatLng().lng, 'K');\r\n if (distance < minDistance){\r\n minDistance = distance;\r\n closestFormUnansweredPoint = layer.feature.properties.id;\r\n }\r\n });\r\n // for this to be a proximity alert, the minDistance must be\r\n // closer than a given distance - you can check that here\r\n // using an if statement\r\n // show the popup for the closest point\r\n unansweredLayer.eachLayer(function(layer) {\r\n if (layer.feature.properties.id == closestFormUnansweredPoint){\r\n layer.openPopup();\r\n\r\n // mymap.setView([position.coords.latitude, position.coords.longitude], 13);\r\n\r\n }\r\n });\r\n}", "title": "" }, { "docid": "4d2b69b6ca58e9d748157fcbff87edae", "score": "0.5465716", "text": "function calcRoute(start, dest) {\n directionsDisplay.setOptions( { suppressMarkers: true } );\n var request = {\n origin: start.toString(),\n destination: dest.toString(),\n travelMode: google.maps.TravelMode.DRIVING\n };\n\n directionsService.route(request, function (response, status) {\n if (status === google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n document.getElementById('distance').value = response.routes[0].legs[0].distance.value / 1000;\n }\n });\n }", "title": "" }, { "docid": "5f5f31b6365078c54908b7deeb9ce12f", "score": "0.5465528", "text": "function wayPointClick(e)\n{\n if(addNewPoint)\n {\n findNearestPoint([e.latlng.lng, e.latlng.lat]);\n addPointToMap = true;\n if(baseMarker===null)\n baseMarker = new L.Marker([e.latlng.lat, e.latlng.lng]).addTo(myMap);\n document.getElementById(\"addText\").textContent = \"Веберите место на карте\";\n }\n else if(deleteSomePoint)\n {\n deletePopup.style.display = \"none\";\n myMap.removeLayer(e.target);\n findNearestPoint([e.latlng.lng, e.latlng.lat]);\n var index = points.indexOf(chosenPoint);\n if (index !== -1)\n {\n points.splice(index, 1);\n }\n changeLocation();\n deleteSomePoint = false;\n document.getElementById(\"addPointBtn\").disabled = false;\n }\n else\n {\n if(currentMarker===null)\n {\n findNearestPoint([e.latlng.lng, e.latlng.lat]);\n showMarker(chosenPoint);\n currentMarker.on('dragend', dragendMarker);\n editPopup.style.display = \"block\";\n currentMarker.addTo(myMap);\n myMap.removeLayer(e.target);\n } \n }\n}", "title": "" }, { "docid": "875f2bbfa5bc34c8a02e256e0172fcb9", "score": "0.5458008", "text": "function reportDistance()\n{\n var dx = global.x2 - global.x1;\n var dy = global.y2 - global.y1;\n\n var dist = calculateDistance(global.x1,global.y1,global.x2, global.y2);\n var angle = calculateAngle(global.x1,global.y1,global.x2, global.y2);\n\n setPromptPrefix(qsTr(\"Distance\") + \" = \" + dist.toString() + \", \" + qsTr(\"Angle\") + \" = \" + angle.toString());\n appendPromptHistory();\n setPromptPrefix(qsTr(\"Delta X\") + \" = \" + dx.toString() + \", \" + qsTr(\"Delta Y\") + \" = \" + dy.toString());\n appendPromptHistory();\n}", "title": "" }, { "docid": "ce38997d63c608089f7e4fe6fb18c820", "score": "0.5455369", "text": "function computeTotalDistance(result) {\n let total = 0;\n let myroute = result.routes[0];\n for (let i = 0; i < myroute.legs.length; i++) {\n total += myroute.legs[i].distance.value;\n }\n total = total / 1000;\n // it displays in km, in future we will converting to miles\n document.getElementById('total').innerHTML = total + ' km';\n}", "title": "" }, { "docid": "6a65cf91a6a71029c64e760cc7f9bba6", "score": "0.5455236", "text": "function calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n}", "title": "" }, { "docid": "6a65cf91a6a71029c64e760cc7f9bba6", "score": "0.5455236", "text": "function calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n}", "title": "" }, { "docid": "cb58fec01d3c83377a6949be0c98bd0a", "score": "0.5453644", "text": "function calcDist(){\n\tuserInput = distance.value ;\n\tvar editDist = levenshteinDist(userInput.toLowerCase() , word.toLowerCase() , 0, 0)\n\tdocument.getElementById('levisteinDist').innerHTML = 'You are distance away : <b>'+editDist+'</b>' ;\n\tif(editDist==0){\n\t\talert('CORRECT');\n\t\tdistance.value='';\n\t\t\n\t\tchrome.storage.local.set({'word_selected': 'F' }, function() \n\t\t{\n \tconsole.log('word has reset');\n \t\t});\n\n \t\t//after correct guess close and reload window\n\n\t\tchrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n chrome.tabs.sendMessage(tabs[0].id,{Message: \"word has been de-selected\"}, function (response) {\n ;\n })\n\t}) ;\n\n\t\twindow.close();\n\t}\n}", "title": "" }, { "docid": "792927b204de276a3ae1a2ba5be44496", "score": "0.5452242", "text": "function adjust_distance(distance, correct) {\n if(correct == true) {\n //var adjustment = 0.15;\n var adjustment = 0.05;\n distance -= (distance*adjustment);\n } else {\n //var adjustment = 0.176471;\n var adjustment = 0.0526316;\n distance += (distance*adjustment);\n }\n var max = 0.33;\n if (distance > max) {distance = max}\n return distance;\n }", "title": "" }, { "docid": "9b664778a9182a5c1a3cd7bd72af05d4", "score": "0.5450471", "text": "calDistance() {\n const lat1 = this.currCordinates[0]['lat'];\n const lon1 = this.currCordinates[0]['lng'];\n const lat2 = this.currCordinates[1]['lat'];\n const lon2 = this.currCordinates[1]['lng'];\n\n return this.radius * (Math.acos((Math.sin(lat1) * Math.sin(lat2)) + (Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon1 - lon2))));\n }", "title": "" }, { "docid": "77fa298cf5fe95b4b54f02087ae1eeb4", "score": "0.5449827", "text": "function updateInfo(widget)\n{\n\t$(\"#newGeozonePosition\").val(widget.get('position'));\n\t$(\"#newGeozoneRadius\").val(widget.get('distance')*1000);\n}", "title": "" }, { "docid": "6853a3ea3cdd15e53f24435c206366d1", "score": "0.5443582", "text": "function utilEditDistance(a, b) {\n a = remove$1(a.toLowerCase());\n b = remove$1(b.toLowerCase());\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n var matrix = [];\n for (var i = 0; i <= b.length; i++) { matrix[i] = [i]; }\n for (var j = 0; j <= a.length; j++) { matrix[0][j] = j; }\n for (i = 1; i <= b.length; i++) {\n for (j = 1; j <= a.length; j++) {\n if (b.charAt(i-1) === a.charAt(j-1)) {\n matrix[i][j] = matrix[i-1][j-1];\n } else {\n matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, // substitution\n Math.min(matrix[i][j-1] + 1, // insertion\n matrix[i-1][j] + 1)); // deletion\n }\n }\n }\n return matrix[b.length][a.length];\n}", "title": "" }, { "docid": "8f2114f5e44f1e3d5838b342a89af779", "score": "0.5433591", "text": "function getCoords(lat, lng, markId = \"\") {\n\n // Update latitude text box.\n $('.latitud').val(lat);\n\n // Update longitude text box.\n $('.longitude').val(lng);\n\n if (markers) {\n if (markers.length <= 1 || markId === \"markerInit\") {\n $('#ai_init_latitude').val(lat);\n\n // Update longitude text box.\n $('#ai_init_longitude').val(lng);\n } else {\n $('#ai_end_latitude').val(lat);\n\n // Update longitude text box.\n $('#ai_end_longitude').val(lng);\n }\n } \n setDistance(); \n}", "title": "" }, { "docid": "de0251faa2556b4a2f527474b457d433", "score": "0.5428148", "text": "findDistance(wayPoints) {\n if (wayPoints.length <= 1) {\n return wayPoints[0];\n }\n\n let currentWayPoint = wayPoints[0],\n currentDistance = Point.distance(currentWayPoint.position, this.target.position),\n distance;\n\n _.each(wayPoints, wayPoint => {\n distance = Point.distance(wayPoint.position, this.target.position);\n if (distance <= currentDistance) {\n currentDistance = distance;\n currentWayPoint = wayPoint;\n }\n });\n return currentWayPoint;\n }", "title": "" }, { "docid": "8aa74f2649cfa5cd6f02de98bb167dfd", "score": "0.54266745", "text": "function byDistance (c1, c2) {\n return c1.d - c2.d\n }", "title": "" }, { "docid": "5e791f64c340ec2933c756efc234b29f", "score": "0.54223007", "text": "getDistance(another) {\n return Math.sqrt((this.x-another.x)*(this.x-another.x)+(this.y-another.y)*(this.y-another.y)+(this.z-another.z)*(this.z-another.z));\n }", "title": "" }, { "docid": "1e2659a80afe2da6e1e4abd278f2fcb4", "score": "0.54187423", "text": "function distMiles(new_curr_lat, new_curr_lng, dist_lat, dist_lng) {\n\tvar pi180 = Math.PI / 180;\n\tvar lat_1 = new_curr_lat *= pi180;\n\tvar lng_1 = new_curr_lng *= pi180;\n\tvar lat_2 = dist_lat *= pi180;\n var lng_2 = dist_lng *= pi180;\n\tvar earth_radius = 6372.797; // mean radius of Earth in km\n\tvar new_lat = lat_2 - lat_1;\n\tvar new_lng = lng_2 - lng_1;\n\tvar a = Math.sin(new_lat / 2) * Math.sin(new_lat / 2) + Math.cos(lat_1) * Math.cos(lat_2) * Math.sin(new_lng / 2) * Math.sin(new_lng / 2);\n\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\tvar km = earth_radius * c; // find km\n\tvar miles = km * 0.621371192; // find miles\n\tvar distance = Math.round(miles);\n\treturn distance;\n}", "title": "" }, { "docid": "5b2a878c4a3851fcbcea438847c19598", "score": "0.54181045", "text": "updatePosition() {}", "title": "" }, { "docid": "59f068129562fc643f4b9fecd4aef9a2", "score": "0.5410067", "text": "setDistance(point) {\n\t\tthis.point = point;\n\t\tthis.distance_x = (this.position.x - this.point.x) / this.speed;\n\t\tthis.distance_y = (this.position.y - this.point.y) / this.speed;\n\t}", "title": "" }, { "docid": "9f9181233b029b389618367d1038fd6c", "score": "0.5406162", "text": "distance(movable) {\n if (movable instanceof Movable) {\n let dx = abs(this.pos.x - movable.pos.x)\n if (dx > width / 2) dx = width - dx\n\n let dy = abs(this.pos.y - movable.pos.y)\n if (dy > height / 2) dy = height - dy\n\n return sqrt(sq(dx) + sq(dy))\n } else {\n let dx = abs(this.pos.x - movable.x)\n if (dx > width / 2) dx = width - dx\n\n let dy = abs(this.pos.y - movable.y)\n if (dy > height / 2) dy = height - dy\n\n return sqrt(sq(dx) + sq(dy))\n }\n }", "title": "" }, { "docid": "a621f53884c11b0238571cf9c35ec473", "score": "0.5404874", "text": "function enhance_fleet_movement_common(combo)\r\n{\r\n if (combo == undefined) return;\r\n var br = document.createElement('br');\r\n var inputElement = document.createElement('input');\r\n var half_dist = document.createElement('a');\r\n half_dist.innerHTML = \"1/2\";\r\n half_dist.setAttribute(\"href\",\"\");\r\n var anchors = combo.parentNode.parentNode.getElementsByTagName(\"a\");\r\n for (i= 0; i <anchors.length; i++)\r\n CP_Log(FA_POS,LOG,i+\":\"+anchors[i].innerHTML);\r\n inputElement.setAttribute(\"type\",\"text\"); inputElement.setAttribute(\"size\",\"36\");\r\n inputElement.setAttribute(\"id\",\"posDetails\"); inputElement.setAttribute(\"name\",\"posDetails\");\r\n inputElement.setAttribute(\"style\",\"text-align: center;\");\r\n combo.parentNode.insertBefore(br, combo.nextSibling);\r\n br.parentNode.insertBefore(inputElement, br.nextSibling);\r\n CP_Log(FA_POS,LOG,combo.parentNode.parentNode.innerHTML);\r\n combo.addEventListener('change',tgt_bookmark_changed,true);\r\n// combo.parentNode.setAttribute(\"align\",\"center\");\r\n CP_Log(FA_POS,LOG,\"Bookmarks combo hooked\");\r\n var distanceElement = document.createElement('div');\r\n distanceElement.setAttribute(\"id\",\"target_distance\");\r\n anchors[0].parentNode.insertBefore(distanceElement,anchors[0]);\r\n inputElement.addEventListener('keyup',setup_target_position,true);\r\n CP_Log(FA_POS,LOG,\"position input hooked\");\r\n anchors[0].addEventListener('click',fake_posid,true);\r\n distanceElement.parentNode.insertBefore(half_dist,distanceElement);\r\n half_dist.addEventListener('click',half_distance,true);\r\n // trigger filling in\r\n tgt_bookmark_changed();\r\n g_starting_position = getTgtPositionValues();\r\n update_distance();\r\n}", "title": "" }, { "docid": "53cf7cb671927205d915bd0e0ea64160", "score": "0.54025114", "text": "function getOffsetDistanceInPx(distance) {\n return -(distance - 10) + 'px';\n}", "title": "" }, { "docid": "53cf7cb671927205d915bd0e0ea64160", "score": "0.54025114", "text": "function getOffsetDistanceInPx(distance) {\n return -(distance - 10) + 'px';\n}", "title": "" }, { "docid": "406b848db3c55af0d56ac03022f129f5", "score": "0.53895223", "text": "updateLaserLine(distance) {\n const laserLine = this.laserLine,\n positionArray = laserLine.geometry.attributes.position.array;\n laserLine.geometry.attributes.position.setZ(1, distance);\n laserLine.geometry.attributes.position.needsUpdate = true;\n }", "title": "" }, { "docid": "161d1d7834a9ffae1d46dfcf36cf00ee", "score": "0.5382897", "text": "function calcDistance (loc1, loc2) {\n return google.maps.geometry.spherical.computeDistanceBetween(\n new google.maps.LatLng(loc1['lat'], loc1['lng']), new google.maps.LatLng(loc2['lat'],loc2['lng']));\n }", "title": "" }, { "docid": "64c372bd94cd3630e9859a0372c36a17", "score": "0.538244", "text": "function distanceKm(){\n /* var scontoMinorenne = userDistanceEl * 0.17; */\n var userDistanceEl = document.getElementById('km').value;\n console.log(userDistanceEl);\n document.getElementById('costo_totale').innerHTML = userDistanceEl;\n var eta = document.getElementById('age').value;\n //console.log(eta);\n\n console.log(minorenne, maggiorenne, anziano);\n // Prezzo calcolato\n\n if(eta === \"minorenne\"){\n document.getElementById('offerta').innerHTML = 'Sconto minorenne';\n document.getElementById('costo_totale').innerHTML = userDistanceEl * 0.17 + '&euro;';\n }else if (eta === \"anziano\"){\n document.getElementById('offerta').innerHTML = 'Sconto Anziani';\n document.getElementById('costo_totale').innerHTML = userDistanceEl * 0.13 + '&euro;';\n } else {\n document.getElementById('offerta').innerHTML = 'Nessuno sconto';\n document.getElementById('costo_totale').innerHTML = userDistanceEl * 0.21 + '&euro;';\n }\n \n}", "title": "" }, { "docid": "f4ddb46e588d3a354e08a7db96d8a36a", "score": "0.538213", "text": "function calculateDistance()\r\n{\r\n\tfor (city in citiesData)\r\n\t{\r\n\t\tvar deltaX = parseInt(currCityXcoord) - parseInt(citiesData[city][2]);\r\n\t\tvar deltaY = parseInt(currCityYcoord) - parseInt(citiesData[city][3]);\r\n\t\tvar hops = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\r\n\t\t\r\n\t\tvar distanceInMinutes = 0;\r\n\t\tvar hours\t = \"00\";\r\n\t\tvar minutes = \"00\";\r\n\t\t\r\n\t\tif (hops > 0) \r\n\t\t{\r\n\t\t\tdistanceInMinutes = Math.round(20 * hops)\r\n\t\t\thours = Math.floor(distanceInMinutes / 60);\r\n\t\t\tif (hours < 10)\r\n\t\t\t{\r\n\t\t\t\thours = \"0\" + hours;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tminutes = distanceInMinutes % 60;\r\n\t\t\tif (minutes < 10)\r\n\t\t\t{\r\n\t\t\t\tminutes = \"0\" + minutes;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcitiesData[city][0] = hours + \":\" + minutes;\r\n\t}\r\n}", "title": "" }, { "docid": "9bc77f1a2759859149d56ba78d74b1bd", "score": "0.53808933", "text": "update(viewDistance) {\n if (!this.initialized && viewDistance !== undefined) {\n this.initializeRenderStates();\n }\n this.setViewDistance(viewDistance);\n }", "title": "" } ]
255a618751caaade07b9cac1ebb064bd
In here, we have to take into account two different pythagoric triangles: one that goes from the player position (lateral view) to the fake 3d world and another that goes from the player position, to the proyected view, aka the screen. By taking the properties of angles and triangles, we know that A/B = C/D, where A represents the y value of the triangle of the proyected view and B represents the value of such triangle, whereas C is the y of the other triangle and D is the x. Therefore, we calculte the proyected height as A = (C/D)B Status: working
[ { "docid": "ee8f538eb22ba0573f77cb7fc201224c", "score": "0.0", "text": "renderWall() {\n // The real size of a wall (in the fake 3d world) in pixels\n var wallHeight = 500;\n // We use tan() = x/y for determing the proyection plane distance\n var proyectionPlaneDistance = canvasWidth / 2 / Math.tan(halfFOV);\n var proyectedWallHeight =\n (wallHeight / this.distance) * proyectionPlaneDistance;\n\n // Now we calculate where start and end the lines that draw the walls\n var y0 = parseInt(canvasHeight / 2) - parseInt(proyectedWallHeight / 2);\n var y1 = y0 + proyectedWallHeight;\n // The columns represent the vertical lines that form the fake 3d world\n var x = this.column;\n\n // Texture rendering\n\n var textureHeight = 64;\n var imageHeight = y0 - y1;\n\n // We disable smotthing, so we avoid blurs on textures\n ctx.imageSmoothingEnabled = false;\n\n this.ctx.drawImage(\n tiles, // texture\n this.texturePixel, // x clipping\n (this.textureId - 1) * textureHeight, // y clipping\n 1, // clipping width\n textureHeight - 1, // clipping height\n x, // x where the rendering starts\n y1, // y where the rendering starts\n 1, // Real pixel width\n imageHeight\n );\n\n /*\n // We draw each column (no textures rendered)\n this.ctx.beginPath();\n this.ctx.moveTo(x, y0);\n this.ctx.lineTo(x, y1);\n this.ctx.strokeStyle = \"#666\";\n this.ctx.stroke();\n */\n }", "title": "" } ]
[ { "docid": "533eb545f7d9b89c9c74c02369a5ffa2", "score": "0.5983371", "text": "get height() {\n return this.dimensions[3] - this.dimensions[1];\n }", "title": "" }, { "docid": "f7f1b5a4734a7b9478a17329418162f2", "score": "0.59317315", "text": "function three_module_area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "title": "" }, { "docid": "f7f1b5a4734a7b9478a17329418162f2", "score": "0.59317315", "text": "function three_module_area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "title": "" }, { "docid": "32ee000eadd3c48d98900a28ea5a5bb4", "score": "0.5914727", "text": "function calculateTriangleArea(width, height) {\n return (width * height) / 2;\n }", "title": "" }, { "docid": "d8fd85bf53ee3b39645e114944c94883", "score": "0.58603555", "text": "function eqtHeight(side_length) {\n return side_length * Math.sqrt(3) / 2\n}", "title": "" }, { "docid": "a7f6795200f19885d1570d15210c1886", "score": "0.5814962", "text": "function getAreaOfTriangle(base,height){\n let area = base * height / 2;\n return(area);\n}", "title": "" }, { "docid": "b910bfdc3da019620de141dc07affaff", "score": "0.5808491", "text": "function triArea(base, height) {\r\n return (base * height) /2; \r\n }", "title": "" }, { "docid": "ce80bbd6a920c87ecf545897399f5659", "score": "0.578472", "text": "function triArea(b,h){\n var area = .5*b*h;\n return area;\n}", "title": "" }, { "docid": "bd0f819963620ddb4e2fc233672b8f71", "score": "0.5781327", "text": "function triangle_area(vertexA, vertexB, vertexC) {\n return Math.abs(((vertexA.x - vertexC.x) * (vertexB.y - vertexA.y) - (\n vertexA.x - vertexB.x) * (vertexC.y - vertexA.y)) * 0.5);\n}", "title": "" }, { "docid": "50889463f8863abb2c07b221fd06812b", "score": "0.5780826", "text": "function computeAreaOfATriangle(base, height) {\n // your code here\n return (base * height) / 2;\n}", "title": "" }, { "docid": "8a16b655f3f866cb5e1e69bfbd753a9c", "score": "0.5764213", "text": "function triArea(base, height) {\n return (base * height) / 2;\n}", "title": "" }, { "docid": "c1a900791c5dcc9ef34f929d8e9f8d85", "score": "0.57601434", "text": "function calculateAreaHerons() {\n let sideAValue = Number(sideA.value);\n let sideBValue = Number(sideB.value);\n let sideCValue = Number(sideC.value);\n\n //Herons consitions are fulfilled\n if (\n sideAValue + sideBValue > sideCValue &&\n sideBValue + sideCValue > sideAValue &&\n sideCValue + sideAValue > sideBValue\n ) {\n let semiPerimeter = (sideAValue + sideBValue + sideCValue) / 2;\n console.log(semiPerimeter);\n let areaHerons = Math.sqrt(\n semiPerimeter *\n (semiPerimeter - sideAValue) *\n (semiPerimeter - sideBValue) *\n (semiPerimeter - sideCValue)\n );\n\n result.innerText = `Area of the triangle is ${areaHerons}`;\n } else {\n result.innerText =\n \"Invalid Angles. The sum of one of the 2 angles must be greater than third angle\";\n }\n}", "title": "" }, { "docid": "98d9968e6fa2ea84f8252ec804004a85", "score": "0.575775", "text": "getHeight() {\n if (this.object3D && this.object3D.geometry) {\n if (this.object3D.geometry.boundingBox == null) {\n this.object3D.geometry.computeBoundingBox();\n }\n return Math.abs(this.object3D.geometry.boundingBox.max.y - this.object3D.geometry.boundingBox.min.y);\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "005a3983a7a9624fe197bfe882c05a2b", "score": "0.575035", "text": "get length() {\n // dx and dy are two sides of a right triangle.\n // the length of the hypotenuse is what we want.\n // The Pythogorean theorem calculates this length: a*a+b*b=c*c.\n var dx=this.dx, dy=this.dy;\n return Math.sqrt(dx*dx + dy*dy);\n }", "title": "" }, { "docid": "303a85b7ae2eaf215838fb86f73b1b26", "score": "0.5744932", "text": "function getTriangleArea(a, h) {\n if ((a > 0) && (h > 0)) {\n // console.log('dane prawidlowe, licze pole');\n\treturn a*h/2;\n } else {\n return 'Nieprawidłowe dane';\n }\n}", "title": "" }, { "docid": "1c9e7e6793ca5fc3a1064c36fcf02200", "score": "0.57334", "text": "function t(t,l){const c=t.vertex.code;l.verticalOffsetEnabled?(t.vertex.uniforms.add(\"verticalOffset\",\"vec4\"),l.screenSizePerspectiveEnabled&&(t.include(_util_ScreenSizePerspective_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"ScreenSizePerspective\"]),t.vertex.uniforms.add(\"screenSizePerspectiveAlignment\",\"vec4\")),c.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {\n float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);\n ${1===l.viewingMode?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`vec3 worldNormal = normalize(worldPos + localOrigin);`:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}\n ${l.screenSizePerspectiveEnabled?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n float cosAngle = dot(worldNormal, normalize(worldPos - camPos));\n float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n float verticalOffsetScreenHeight = verticalOffset.x;`}\n // Screen sized offset in world space, used for example for line callouts\n float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);\n return worldNormal * worldOffset;\n }\n\n vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {\n return worldPos + calculateVerticalOffset(worldPos, localOrigin);\n }\n `)):c.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }\n `)}", "title": "" }, { "docid": "1360f3edf410041a3737b06d1bec3010", "score": "0.57245904", "text": "length() {\n return Math.hypot(this.x, this.y, this.z);\n //return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)\n }", "title": "" }, { "docid": "62828f36417f38dd8dda39bf8fc547ef", "score": "0.5723587", "text": "function triangleArea(side1, side2, side3) {\n let s = (side1 + side2 + side3) / 2;\n let area = Math.sqrt(s * (s - side1) * (s - side2) * (s - side3));\n\n return area;\n}", "title": "" }, { "docid": "a5f3aed2c96bc31135f4eab14b9667fc", "score": "0.57206434", "text": "triangleArea(v) {\n return this.parallelogramArea(v) / 2.0;\n }", "title": "" }, { "docid": "1572126698556e87ce78840802dece00", "score": "0.5690106", "text": "function getAreaOfTriangle(base, height) {\n // fill in the function code\n}", "title": "" }, { "docid": "c5fa1eeb6d358a6e50895b5aa471c33f", "score": "0.5687272", "text": "function triArea(base, height) {\n\tlet area = (base*height)/2;\n\tconsole.log(area); \n}", "title": "" }, { "docid": "51f23fab51137f48452bf4c2e5f98d7e", "score": "0.566722", "text": "function calculateTriangleArea(base, height) {\r\n if (base < 0 || height < 0) {\r\n return undefined ;\r\n } else { \r\n return (base * height) / 2 ; //Triangle Area: base × height / 2\r\n }\r\n}", "title": "" }, { "docid": "d80f3659c353e628a1d25ed36509c234", "score": "0.5659521", "text": "function areaTriangle(base, height){\n let area=0;\n area=.5*base*height;\n return area; \n}", "title": "" }, { "docid": "dc7e4b0a7dec4158def46f06494834c8", "score": "0.56575835", "text": "function triArea(base, height) {\n\tlet area = (base * height) / 2;\n\treturn area;\n}", "title": "" }, { "docid": "cf85cc04d86a5652f1d50ca5a7e49932", "score": "0.56452036", "text": "function findHeightOfPills(screen, divide) {\n if (canvas.height > canvas.width) {\n return (screen / (divide * 0.9));\n }\n return (screen / divide);\n}", "title": "" }, { "docid": "c81b74461fc91f04897625de49a59f6e", "score": "0.5641144", "text": "function calculateArea(h, w) {\n var area = h * w;\n document.write(\"Area of the triangle is: \" + area)\n}", "title": "" }, { "docid": "a352c170de8c65eba0509412face98e2", "score": "0.56368065", "text": "function areaOfTriangle(side1,side2,side3)\r\n{\r\n let s = (side1 + side2 + side3)/2;\r\n let area = Math.sqrt(s*(s - side1)(s - side2)(s - side3));\r\n return area;\r\n}", "title": "" }, { "docid": "09278104e5fccf963de0928ba661c391", "score": "0.56338483", "text": "function triArea(base, height) {\n\treturn (base * height) / 2;\n}", "title": "" }, { "docid": "1991a3278f7dbd9be83ddfcb0145d028", "score": "0.5620112", "text": "function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}", "title": "" }, { "docid": "0c6fe4bc00186a3e381655491eb78a6a", "score": "0.56068945", "text": "function areaTriangle(base, height) {\n let area = (base * height) / 2;\n return area;\n}", "title": "" }, { "docid": "72a561532f2df41ec8f77d64f948dcd7", "score": "0.55974054", "text": "function orientationDet(a, b, c) {\r\n return b.x * c.y - a.x * c.y + a.x * b.y - b.y * c.x + a.y * c.x - a.y * b.x;\r\n}", "title": "" }, { "docid": "01cc64be8f55d7486de5c851bd559315", "score": "0.5573974", "text": "sumSquaredDegrees() { return Geometry_1.Geometry.hypotenuseSquaredXYZ(this.yaw.degrees, this.pitch.degrees, this.roll.degrees); }", "title": "" }, { "docid": "f35127d7bf947c2818d8d8b22cbbf3b1", "score": "0.55729246", "text": "setHeight()\n{\n var i = 0;\n var j = 0;\n var p = glMatrix.vec3.create();\n var b = glMatrix.vec3.create();\n var norm = glMatrix.vec3.create();\n var subvec = glMatrix.vec3.create();\n for(j = 0; j <= 100; j++) //Try 100 iterations\n {\n for(i = 0; i < this.numVertices; i++)\n {\n p[0] = Math.floor(Math.random() * this.maxX) + this.minX; //random x between min and max\n p[1] = Math.floor(Math.random() * this.maxY) + this.minY; //random y between min and max\n b = [this.vBuffer[3*i], this.vBuffer[(3*i) + 1]];\n glMatrix.vec3.sub(subvec, b, p);\n norm[0] = Math.floor(Math.random() * this.maxX) + this.minX; //random x norm between min and max\n norm[1] = Math.floor(Math.random() * this.maxY) + this.minY; //random y norm between min and max\n //if (glMatrix.vec3.dot(subvec, norm) > 0) //(b−p)⋅n>0\n if (Math.random() > 0.5)\n {\n this.vBuffer[(3*i) + 2] = this.vBuffer[(3*i) + 2] + 0.005; //Increment height by 0.005\n }\n else\n {\n this.vBuffer[(3*i) + 2] = this.vBuffer[(3*i) + 2] - 0.005; //Decrement height by 0.005\n }\n }\n }\n}", "title": "" }, { "docid": "50e7f3c4f058356bf0fd1c16216bd05f", "score": "0.5570013", "text": "function getTriangleArea(a, h) {\n\tif (a <= 0 || h <= 0) {\n\t\treturn 'Nieprawidłowe dane';\n\t} else {\n\t\treturn a * h / 2;\n\t}\n}", "title": "" }, { "docid": "af4e50f2799707807079b078e0f28871", "score": "0.5555812", "text": "function getHValue(x, y, goal) {\r\n return Math.sqrt(Math.pow(x - goal.x, 2) + Math.pow(y - goal.y, 2));\r\n}", "title": "" }, { "docid": "d8ccbb6ab324964445504c49bced884f", "score": "0.55540496", "text": "function calcCanvasDimensions() {\r\n\t//the half height \r\n\t//the angle in radians\r\n\tcanvasHight = Math.tan(viewAngle * (Math.PI / 180)) / canvasOffset;\r\n\t//how many units has a Pixel in the coordinated system\r\n\tpixelHeight = 2 * canvasHight / height;\r\n\t// use the pixelheight to calc the width\r\n\tcanvasWidth = (width * pixelHeight) / 2;\r\n\t// calc the point\r\n\tcanvasStart = camera.add(viewDirection.multiply(canvasOffset));\r\n\tcanvasStart.addN(canvasHightDirc.multiply(-canvasHight));\r\n\tcanvasStart.addN(canvasWidthDirc.multiply(-canvasWidth));\r\n\t\r\n}", "title": "" }, { "docid": "6ca8271bb81995af0fec416cee7e4420", "score": "0.555339", "text": "function getCoordinates(){\n//loop through \n var x1= [];\n var x2=[];\n var y1=[];\n var y2=[];\n var part1=[];\n var part2=[];\n for( i=0; i<poses[0].skeleton.length; i++){\n x1.push(poses[0].skeleton[i][0].position.x)\n x2.push(poses[0].skeleton[i][1].position.x)\n y1.push(poses[0].skeleton[i][0].position.y)\n y2.push(poses[0].skeleton[i][1].position.y)\n part1.push(poses[0].skeleton[i][0].part)\n part2.push(poses[0].skeleton[i][1].part)\n \n}\n\n //a function to get height\n {\n a=distance(x1[2],x2[2],y1[2],y2[2])\n b=distance(x1[1],x2[1],y1[1],y2[1])\n c=distance(x1[10],x2[10],y1[10],y2[10])\n d=distance(x1[6],x2[6],y1[6],y2[6])\n e=distance(x1[7],x2[7],y1[7],y2[7])\n Height= +a + +b + +c + +d + +e;\n console.log('Height='+Height);\n }\n \n //function to get a scale\n //here 185 is height in cms\n {scale= height/Height * 0.393;\n console.log(scale)\n }\n \n //A function get the distance\n function distance(a,b,c,d){\n var dis = Math.sqrt(Math.pow((a-b),2) +Math.pow((c-d),2))\n \n return dis.toFixed(2);\n \n }\n \n {var dist =[]\n for(i=0; i<x1.length;i++){\n var di= distance(x1[i],x2[i],y1[i],y2[i])*scale;\n \n \n console.log(\"distance between \"+part1[i]+\" and \"+part2[i]+\"=\"+ di.toFixed(1)+\" inches\")\n}\n \n}\n}", "title": "" }, { "docid": "71b7c6985c3502fa90117b7c04737033", "score": "0.55516183", "text": "function PressureToHeight(props) {\n // props.atmPressure is the variable we want the user to access\n const height = metresToFeet * (tStd/lapseRate)*((pStat/(props.atmPressure))**ex1 - 1);\n return <p>The equivalent height is {Math.round(height)} ft.</p>\n}", "title": "" }, { "docid": "3138b39823f87cb45756c29f1144f6f7", "score": "0.5537445", "text": "Length() {\n var dx = this.p0.x - this.p1.x;\n var dy = this.p0.y - this.p1.y;\n return Math.hypot(dx, dy);\n }", "title": "" }, { "docid": "c4c3948377f7b16ed950e5b93439dd47", "score": "0.55241805", "text": "function surfaceCalculation(Length, Width, Height) {\n switch (arguments.length) {\n case 3 :\n return 2 * (Length + Width) * Height + 2 * Length * Height;\n break;\n case 2 :\n return Length * Width;\n break;\n case 1 : \n return Length ** 2;\n break;\n default :\n alert('You have entered the parameters for a shape we are not prepared to understand!');\n }\n}", "title": "" }, { "docid": "dca9d3f413780633df82f89020f5ae22", "score": "0.5517511", "text": "randomHeight(){\n for(var counter = 0; counter < 100; counter++){\n var normalVector = vec3.create();\n normalVector[0] = Math.random() - 0.5;\n normalVector[1] = Math.random() - 0.5; //generate a random normal vector\n normalVector[2] = 0;\n var stdi = Math.floor(Math.random()* this.div);\n var stdj = Math.floor(Math.random()* this.div);\n var stdv = vec3.create(); //generate a random vertex\n this.getVertex(stdv, stdi ,stdj);\n for(var i = 0; i <= this.div; i++){\n for(var j = 0; j <= this.div; j++){\n var vertex = vec3.create();\n this.getVertex(vertex, i, j); // get the vertex\n var sub = vec3.create();\n vec3.subtract(sub, vertex, stdv);\n var value = vec3.dot(sub, normalVector); // compute the dot product\n if(value > 0){\n vertex[2] += 0.006; \n }\n else{\n vertex[2] -= 0.006; // add and sub the contant\n }\n this.setVertex(vertex, i, j);\n }\n }\n }\n this.generateNormals(); //call generateNormals\n //console.log(this.vBuffer);\n }", "title": "" }, { "docid": "1dd7f81930dd9f60b0101a1a77dd75ed", "score": "0.54964155", "text": "area(){\n\t\treturn ((this.p1.x*(this.p3.y-this.p2.y)+this.p3.x*(this.p2.y-this.p1.y)+this.p2.x*(this.p1.y-this.p3.y))/2);\n\t}", "title": "" }, { "docid": "91038b55c3aa5fed05eb7b900ca95f27", "score": "0.5483695", "text": "getHeight() {\n return this.maxY - this.minY;\n }", "title": "" }, { "docid": "ada809b59605408d11f7cbf1fd3b10d4", "score": "0.54687226", "text": "get screenWorldHeight()\n {\n return this.worldHeight * this.scale.y;\n }", "title": "" }, { "docid": "47eae7e47c3e90f9e460d4ac160e60e1", "score": "0.5448179", "text": "getHeight() { return this.hinged_door_axes[1]; }", "title": "" }, { "docid": "676a936935acb89cfbaf0a7558d4a7c4", "score": "0.54236996", "text": "function calculateAreaTwoSides() {\n let baseValue = Number(base.value);\n let heightValue = Number(height.value);\n\n let area = (1 / 2) * baseValue * heightValue;\n if(baseValue > 0 && heightValue > 0) {\n result.innerText = `Area of the triangle is ${area}`;\n } else {\n result.innerText = \"Please enter valid values\";\n }\n \n}", "title": "" }, { "docid": "b7f2b1bec7dad7d511f6583a17d171c9", "score": "0.5419286", "text": "function getQuad(loc) {\n if (loc.x !== Infinity && loc.y !== Infinity) {\n if (loc.y > botLineY && loc.x > triLineX) {\n return 3\n } else if (loc.y > botLineY && loc.x < triLineX) {\n return 2\n } else if (loc.y > topLineY + vertexRadius && loc.y < botLineY - vertexRadius && loc.x > vertexRadius && loc.x < canvas.width - vertexRadius) {\n return 1\n }\n }\n}", "title": "" }, { "docid": "d80924fa8e2157dc0c4bb428fcbdf6ac", "score": "0.54184055", "text": "function calculations(length, width) {\n var height = logFoot / (length * width);\n\n // Returning the height.\n return height;\n}", "title": "" }, { "docid": "9b3ec80f1efc0ac246243492333da43d", "score": "0.5417689", "text": "function computeAreaOfATriangle(base, height) {\n return (base * height) / 2;\n}", "title": "" }, { "docid": "701c4f98d8baa9a68386ea7b0e66185f", "score": "0.5407223", "text": "get height() {}", "title": "" }, { "docid": "701c4f98d8baa9a68386ea7b0e66185f", "score": "0.5407223", "text": "get height() {}", "title": "" }, { "docid": "e94728910591d5fc7940c982e26c8b91", "score": "0.5404705", "text": "generateTriangles()\r\n {\r\n //Your code here\r\n var deltaX = (this.maxX - this.minX) / this.div;\r\n var deltaY = (this.maxY - this.minY) / this.div;\r\n\r\n for(var i = 0; i <= this.div; i++)\r\n for(var j = 0; j <= this.div; j++){\r\n this.vBuffer.push(this.minX + deltaX * j);\r\n this.vBuffer.push(this.minY + deltaY * i);\r\n this.vBuffer.push(0);\r\n \r\n this.cTerrain.push(0);\r\n this.cTerrain.push(0);\r\n this.cTerrain.push(0);\r\n }\r\n\r\n for(var i = 0; i < this.div; i++)\r\n for(var j = 0; j < this.div; j++){\r\n var vid = i * (this.div + 1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + 1 + this.div + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n }\r\n \r\n this.getIndexFromXY(-1,-1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n this.getIndexFromXY(-1,1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n this.getIndexFromXY(1,-1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n this.getIndexFromXY(1,1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n\r\n this.diamondSquare(0,0,1,this.div,this.vBuffer)\r\n\r\n for(var i = 0; i <= this.div; i++) {\r\n for(var j = 0; j <= this.div; j++) {\r\n this.getNormal(this.minX + deltaX * j, this.minY + deltaY * i, this.div, this.vBuffer);\r\n for(var n_i = 0; n_i < 3; n_i++) {\r\n this.nBuffer.push(this.normal[n_i]);\r\n }\r\n }\r\n }\r\n \r\n this.addColorToTerrain(this.vBuffer, this.cTerrain,this.vBuffer.numItems);\r\n\r\n //\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n \r\n this.addColorToTerrain(this.vBuffer, this.cTerrain,this.numVertices);\r\n }", "title": "" }, { "docid": "0639de04b33ae37bafe637fbca8062f3", "score": "0.5400502", "text": "calcularAngulo(p1, p2, p3) {\n return (p3.x - p2.x) * (p2.y - p1.y) - (p2.x - p1.x) * (p3.y - p2.y);\n }", "title": "" }, { "docid": "e9fbc05e2edf9366495e8540075d5893", "score": "0.539985", "text": "function calculateArea(height, width) {\n var area = height * width;\n document.write(\"Area of the triangle is: \" + area)\n}", "title": "" }, { "docid": "169974e2f73a12db45f7ca24a943db84", "score": "0.5393925", "text": "function areaOfIsoTriangle(base,height)\r\n{\r\n let area = 0.5 * base * height;\r\n return area;\r\n}", "title": "" }, { "docid": "d272fcddc2bf5654fe523714b08c350d", "score": "0.5389891", "text": "function areaOfTriangle() {\n a = 5\n b = 6\n c = 7\n\n s = (a + b + c) / 2\n\n A = Math.sqrt(s * (s - a) * (s - b) * (s - c))\n\n console.log(\"Area is \" + A)\n\n}", "title": "" }, { "docid": "ce017025c0ca448929c7f6d253af6800", "score": "0.5381282", "text": "get triangles() {}", "title": "" }, { "docid": "ba8b693c3b6cc46952ab3a6b8861554d", "score": "0.53808546", "text": "function meshgeo(r=0.01) {\n // Triangle Spacing\n let aspect = W/H;\n let w = 3 * r / aspect; // Outer width of a triangle\n let h = 3 * r / SQRT3; // = a/2 // Half Outer height of a triangle\n \n // Number of triangles to generate\n let nx = Math.ceil( (2+r) / w );\n let ny = Math.ceil( 2 / h + 1);\n \n // Offset for centering \n let cx = -1 + (w*nx - 2) / -2 + r/2; \n let cy = -1 + (h*(ny-1) - 2) / -2;\n\n let pos = [];\n let uv = [];\n\n console.log(nx, ny, r);\n\n for (let j=0; j<ny; j++) {\n for (let i=0; i<nx; i++) {\n let flip = (i+j) % 2;\n let ox = w * i + (flip * r/aspect) + cx; // flipped tris are offset by r to the right\n let oy = h * j + cy;\n\n let tri = equitri([ox,oy], r/aspect, r, flip);\n pos = pos.concat( tri );\n\n let c = [1-(ox+1)/2, (oy+1)/2]; // uv coordinates based on triangle center\n uv = uv.concat(c, c, c); // add 3x (for each triangle vertex)\n }\n }\n\n let geo = new THREE.BufferGeometry();\n geo.addAttribute( 'position', new THREE.BufferAttribute(new Float32Array(pos), 3) );\n geo.addAttribute( 'uv', new THREE.BufferAttribute(new Float32Array(uv), 2) );\n return geo;\n}", "title": "" }, { "docid": "ca5bc7f9810c381068a57aca869c90cb", "score": "0.53797674", "text": "generateTriangles()\n{\n //Push XY coordinates normally, push z coordinates from the generated DS array.\n var stepX = (this.maxX - this.minX) / this.div;\n var stepY = (this.maxY - this.minY) / this.div;\n var stepZ = (this.maxZ - this.minZ) / this.div;\n var maxHeight = -100;\n var minHeight = 0;\n var heightOffSet = -0.3\n for (var i = 0; i < this.div + 1; i++){\n for (var j = 0; j < this.div + 1; j++){\n this.vBuffer.push(this.minX + stepX * j);\n this.vBuffer.push(this.minY + stepY * i);\n var zPush = this.DSArray[i][j] + heightOffSet;\n this.vBuffer.push(zPush);\n //Finding the max and min height for later color use.\n \n if (zPush > maxHeight) {\n maxHeight = zPush;\n this.maxHeight = maxHeight;\n }\n if (zPush < minHeight) {\n this.minHeight = zPush;\n }\n\n // this.nBuffer.push(0);\n // this.nBuffer.push(0);\n // this.nBuffer.push(1);\n }\n }\n console.log(\"maxheifht is \", maxHeight)\n console.log(\"this.maxH is \", this.maxHeight)\n for (var i = 0; i < this.div; i++){\n for (var j = 0; j < this.div; j++){\n var vid = i * (this.div + 1) + j;\n this.fBuffer.push(vid);\n this.fBuffer.push(vid + 1);\n this.fBuffer.push(vid + this.div + 1);\n\n this.fBuffer.push(vid + 1);\n this.fBuffer.push(vid + 1 + this.div + 1);\n this.fBuffer.push(vid + this.div + 1);\n }\n }\n //Differnt options to make the color map with three sets of functions.\n //Option 1:Modeling RGB as three trig functions.\n function red(h) {\n var period = (3 * Math.PI) / maxHeight;\n var y_move = 1\n var n = 2\n var offset = 0\n var A = -1\n var r = (A * Math.cos(period * h+ offset) + y_move) / n\n return r;\n }\n function green(h) {\n var period = (Math.PI) / maxHeight;\n var y_move = 1\n var n = 2\n var offset = 0\n var A = -1\n var g = (A * Math.cos(period * h + offset) + y_move) / n\n return g;\n }\n function blue(h) {\n var period = (2 * Math.PI) / maxHeight;\n var y_move = 1\n var n = 2\n var offset = 0\n var A = 1\n var b = (A * Math.cos(period * h + offset) + y_move) / n\n return b;\n }\n //Option 2: Simple color at different height without grident.\n function color(h) {\n var relativeH = (h - heightOffSet)/(maxHeight - heightOffSet);\n //console.log(\"relH is \", relativeH)\n if (relativeH > 0.9) {\n return [1,1,1]\n //White\n }\n if (relativeH > 0.8) {\n return [34/255,44/255,33/255]\n //DarkGreen\n }\n if (relativeH > 0.6) {\n return [49/255,82/255,33/255];\n //lightGreen\n }\n if (relativeH > 0.45) {\n return [178/255, 96/255, 41/255]\n //Brown\n }\n if (relativeH > 0.35) {\n return [165/255, 138/255, 109/255]\n }\n if (relativeH > 0.25) {\n return [1, 223/255, 158/255];\n }\n if (relativeH > 0.2) {\n return [55/255, 209/255, 215/255]\n }\n if (relativeH > 0.15) {\n return [69/255, 168/255, 226/255]\n }\n if (relativeH > 0) {\n return [31/255,113/255,198/255];\n //Blue\n }\n if (relativeH > -0.1) {\n return [31/255, 81/255, 1]\n } else {\n return [21/255,0,1]\n }\n }\n //Option 3: Use linear interpolation to get RGB vals.\n function linInter(h) {\n var lowR = 0;\n var lowG = 0.8;\n var lowB = 0;\n var highR = 0.5;\n var highG = 1;\n var highB = 0.8;\n var k = (h - minHeight) / (maxHeight - minHeight);\n var R=(k * lowR + (1 - k) * highR)\n var G=(k * lowG + (1 - k) * highG)\n var B=(k * lowB + (1 - k) * highB)\n return [R,G,B]\n }\n\n //Calculate the normal of all vertices using the normal_at_point function.\n //Push color RGB value to the cBuffer.\n for (var i = 0; i < this.div + 1; i++){\n for (var j = 0; j < this.div + 1; j++) {\n this.nBuffer.push(this.normal_at_point(i, j)[0]);\n this.nBuffer.push(this.normal_at_point(i, j)[1]);\n this.nBuffer.push(this.normal_at_point(i, j)[2]);\n\n //This call return the height of that point.\n var pt_height = this.returnVertex(i, j)[2];\n // this.cBuffer.push(red(pt_height))\n // this.cBuffer.push(green(pt_height))\n // this.cBuffer.push(blue(pt_height))\n var RGB = color(pt_height);\n\n this.cBuffer.push(RGB[0])\n this.cBuffer.push(RGB[1])\n this.cBuffer.push(RGB[2])\n }\n }\n\n this.numVertices = this.vBuffer.length/3;\n this.numFaces = this.fBuffer.length/3;\n}", "title": "" }, { "docid": "5e1529bca0a0f9ccd2c2bc67e4b92bd1", "score": "0.5374277", "text": "function calculateHypotenuse(a,b){\n // TODO: complete calculateHypotenuse so that it returns the hypotenuse length\n // for a triangle with sides of length a, b, and c, where c is the hypotenuse.\n // The solution should verify that inputs are valid numbers (both above zero).\n if( (a <= 0 || b <= 0) || (!isNumber(a) || !isNumber(b)) ) {\n throw \"error\";\n }\n else {\n return Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2)).toFixed(3);\n }\n\n }", "title": "" }, { "docid": "77fa43d41ff0cdd896371de63ff753dc", "score": "0.5371193", "text": "function triangleL(gen, aX, aY, bX, bY, cX, cY) {\n if (output.isInCanvas(aX, aY, bX, bY, cX, cY)) {\n if (gen >= tiling.maxGen) {\n triangleLAreas.add(aX, aY, bX, bY, cX, cY);\n const surface = (bX - aX) * (cY - aY) - (bY - aY) * (cX - aX);\n if (surface > 0) {\n tiles.regularPolygon(true, tiling.triangleUpperImage, aX, aY, bX, bY, cX, cY);\n } else {\n tiles.regularPolygon(true, tiling.triangleUpperImage, aX, aY, cX, cY, bX, bY);\n }\n } else {\n gen += 1;\n // make directions\n // 0.366025404 = 1 / (1 + rt3);\n const rightX = 0.366025404 * (bX - aX);\n const rightY = 0.366025404 * (bY - aY);\n const upX = rightY;\n const upY = -rightX;\n const nbX = bX - rt32 * rightX + 0.5 * upX;\n const nbY = bY - rt32 * rightY + 0.5 * upY;\n const ncX = cX - upX;\n const ncY = cY - upY;\n rhomb30(gen, bX, bY, ncX, ncY);\n rhomb30(gen, aX, aY, ncX, ncY);\n rhomb30(gen, aX, aY, nbX, nbY);\n rhomb60(gen, cX, cY, bX - 0.5 * rightX + rt32 * upX, bY - 0.5 * rightY + rt32 * upY);\n rhomb60(gen, bX, bY, aX + rightX, aY + rightY);\n triangleR(gen, ncX, ncY, nbX, nbY, aX + rt32 * rightX + 0.5 * upX, aY + rt32 * rightY + 0.5 * upY);\n if (gen === tiling.maxGen) {\n tiles.outlines.addClosed(aX, aY, bX, bY, cX, cY);\n }\n }\n }\n}", "title": "" }, { "docid": "cb1678a68606f56aae85fc33fcdd7f7d", "score": "0.5368136", "text": "function getSupport(height=5) {\n\n\t// define verticies\n\tconst points = [\n\t\t{x: 0, y: 0},\n\t\t{x: 4, y: -4, cpX: 4, cpY: 0},\n\t\t{x: 4, y: -height},\n\t\t{x: 5, y: -height},\n\t\t{x: 5, y: -4},\n\t\t{x: 9, y: 0, cpX: 5, cpY: 0},\n\t\t{x: 9, y: 1},\n\t\t{x: 0, y: 1},\n\t];\n\n\tconst shape = new THREE.Shape();\n\n\t// create shape\n\tfor (let point of points) {\n\n\t\t// check if the point has control points\n\t\tif (point.hasOwnProperty('cpX') && point.hasOwnProperty('cpY')) {\n\t\t\tshape.quadraticCurveTo(point.cpX, point.cpY, point.x, point.y);\n\t\t} else {\n\t\t\tshape.lineTo(point.x, point.y);\n\t\t}\n\t}\n\n\tconst extrudeSettings = { depth: 1, bevelEnabled: false};\n\tconst geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );\n\n\treturn new THREE.Mesh( geometry.center(), new THREE.MeshPhongMaterial({color: 0xfc4425}) );\n}", "title": "" }, { "docid": "bccc1b8829614ba8a0dc416c0b797a00", "score": "0.5366037", "text": "function triangleArea(a = +prompt(\"enter a: \"), b = +prompt(\"enter b: \"), c = +prompt(\"enter c: \")) {\n let s = (a + b + c) / 2;\n let areaRoof = 0;\n areaRoof = Math.sqrt(s*(s-a)*(s-b)*(s-c));\n return areaRoof;\n\n \n}", "title": "" }, { "docid": "25bf2fd63a32dc865547b6464cceb48c", "score": "0.5365574", "text": "get screenHeightInWorldPixels()\n {\n return this.screenHeight / this.scale.y;\n }", "title": "" }, { "docid": "ea423462f14791ed0f387f37e397a237", "score": "0.53643256", "text": "function objHeight (p) {\n if (!p) return -Infinity\n var f = fifths(p) * 7\n var o = focts(p) || -Math.floor(f / 12) - 100\n return f + o * 12\n}", "title": "" }, { "docid": "057e2e7992bea3bf753189be76f2e29b", "score": "0.5363617", "text": "function getHeight$static(rectangle/*:Rectangle*/, referenceRectangle/*:Rectangle*/)/*:Number*/ {\n return parseInt((rectangle.height * referenceRectangle.height).toFixed(0));\n }", "title": "" }, { "docid": "9c3a6e4c96470aa20197f010b94cf601", "score": "0.53620946", "text": "getGameHeight() {\n return 600;\n }", "title": "" }, { "docid": "13dbf9b32f2cdb94c30950e04416c924", "score": "0.5357329", "text": "function calculate_h() {\n var angle = document.getElementById(\"ang\").value || 0;\n var hight = document.getElementById(\"h\").value || 0;\n var width = document.getElementById(\"w\").value || 0;\n\n angle = parseFloat(angle).toFixed(2);\n hight = parseFloat(hight).toFixed(2);\n width = parseFloat(width).toFixed(2);\n\n if (angle > 0) {\n var result = parseFloat(Math.tan(angle * Math.PI / 180) * width).toFixed(2);\n } else {\n var result = parseFloat(hight).toFixed(2);\n }\n\n document.getElementById(\"ch\").value = result;\n}", "title": "" }, { "docid": "4bcd22fc5225f9adfdfccd637b92357d", "score": "0.53547674", "text": "function calculateCoords() {\n coords.a = [0, 0];\n coords.c = [t.sides.b, 0];\n coords.b = [Math.sqrt(t.sides.c * t.sides.c - t.altitudes.b * t.altitudes.b), t.altitudes.b];\n if (t.isObtuse(t.angles.a)) {\n coords.b[0] *= -1;\n moveCoords();\n }\n }", "title": "" }, { "docid": "7178a3333eb0e2e1348f62bc46908cdb", "score": "0.5351732", "text": "function getHeights(){\n //console.log(\"GETING HEIGHTS GETING HEIGHT GETING HEIGHT\");\n for (const [id, vertex] of Object.entries(tree_vertices)) {\n //console.log(\"id:\", id, \"height:\", vertex.height, \"possible root(?):\", !vertex.incomingConns);\n // if there are no incoming connections, it is possible that this vertex is root so lets calculate tree height\n if(!vertex.incomingConns){\n Vertex.treeHeight(vertex);\n //console.log(\"calculating height for\", vertex.vertex_id);\n }\n }\n\n //console.log(\"[getHeights] heights done!\")\n // Vertex.treeHeight(\"prvi vertex\");\n // napolni še za vse ostale vertexe, najdi boljši način kot da n krat kličeš treeHeight(shrajevanje v array)\n}", "title": "" }, { "docid": "ee1e648181ddc586c1f67630ccc8e8a1", "score": "0.5349547", "text": "function areaOfATriangle(height, base){\n return ((height*base)/2)\n}", "title": "" }, { "docid": "7099efb6c4de2fb5da4dde84225947ea", "score": "0.5349318", "text": "static area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n }", "title": "" }, { "docid": "77e0067a59864a8c84eb4990a074b28a", "score": "0.5348997", "text": "get worldHeight()\n {\n if (this._worldHeight)\n {\n return this._worldHeight;\n }\n\n return this.height / this.scale.y;\n }", "title": "" }, { "docid": "0e94119cb1d654d2742c9f676ec5f5da", "score": "0.5347459", "text": "function computeAreaOfATriangle(base, height) {\n return (base * height) * 0.5;\n}", "title": "" }, { "docid": "4c710bf0f0d8e6d64660af19ac59745f", "score": "0.5343858", "text": "function getHeights(){\n // console.log(\"GETING HEIGHTS GETING HEIGHT GETING HEIGHT\");\n for (const [id, vertex] of Object.entries(tree_vertices)) {\n // console.log(\"id:\", id, \"height:\", vertex.height, \"possible root(?):\", !vertex.incomingConns);\n // if there are no incoming connections, it is possible that this vertex is root so lets calculate tree height\n if(!vertex.incomingConns){\n Vertex.treeHeight(vertex);\n // console.log(\"calculating height for\", vertex.vertex_id);\n }\n }\n\n // console.log(\"[getHeights] heights done!\")\n // Vertex.treeHeight(\"prvi vertex\");\n // napolni še za vse ostale vertexe, najdi boljši način kot da n krat kličeš treeHeight(shrajevanje v array)\n}", "title": "" }, { "docid": "bfcc02933278f9a6d1db531ae648f39a", "score": "0.5342703", "text": "getOrientation(a, b, c){\n\t\tvar val = (b.y-a.y) * (c.x-b.x) - (b.x-a.x) * (c.y-b.y);\n\t\tif(val == 0) return 0;\n\t\tif(val > 0) return 1;\n\t\treturn 2;\n\t}", "title": "" }, { "docid": "d676f74e90a86d05a05e54d56f9edbe3", "score": "0.5340992", "text": "getCollisionArea(e) {\n var areas = [];\n for (var i = 0; i < this.getBounds().length; i++) {\n var sideLengths = [];\n var bounds = [];\n\n //get the bounds for each of the triangles\n bounds.push({ x: this.getBounds()[i].x, y: this.getBounds()[i].y });\n if (i != this.getBounds().length - 1) {\n bounds.push({ x: this.getBounds()[i + 1].x, y: this.getBounds()[i + 1].y })\n } else {\n bounds.push({ x: this.getBounds()[0].x, y: this.getBounds()[0].y });\n }\n bounds.push({ x: e.x - canvas.getBoundingClientRect().left, y: e.y - canvas.getBoundingClientRect().top });\n\n for (var j = 0; j < bounds.length; j++) {\n if (j != bounds.length - 1) {\n var vector = { x1: bounds[j].x, y1: bounds[j].y, x2: bounds[j + 1].x, y2: bounds[j + 1].y };\n } else {\n var vector = { x1: bounds[j].x, y1: bounds[j].y, x2: bounds[0].x, y2: bounds[0].y };\n }\n var lengthx = vector.x2 - vector.x1;\n var lengthy = vector.y2 - vector.y1;\n var length = Math.sqrt(Math.pow(lengthx, 2) + Math.pow(lengthy, 2));\n sideLengths.push(length);\n }\n\n var s = 0;\n for (var j = 0; j < sideLengths.length; j++) {\n s += sideLengths[j];\n }\n s = s / 2;\n var a = 0;\n\n for (var j = 0; j < sideLengths.length; j++) {\n if (a == 0) {\n a = s - sideLengths[j];\n } else {\n a *= s - sideLengths[j];\n }\n }\n\n a = s * a;\n a = Math.sqrt(a);\n areas.push(a);\n }\n\n var eventArea = 0\n for (var i = 0; i < areas.length; i++) {\n eventArea += areas[i]\n }\n\n var buffer = 20;\n if (Math.floor(eventArea) - Math.floor(this.area()) < 20) {\n this.colliding = true;\n } else {\n this.colliding = false;\n }\n return this.colliding;\n }", "title": "" }, { "docid": "e9b3bf29a4398d1fa80b0c5d479b464b", "score": "0.53388274", "text": "function Triangle(b, h) {\n Shape.call(this);\n this.base = b;\n this.height = h;\n\n this.area = function () {\n return this.base * this.height / 2;\n }\n}", "title": "" }, { "docid": "0350789e00b3ec7380e0df2247c1547e", "score": "0.53296554", "text": "get_height(x, y) {\r\n\tif (x < 0 || x > this.max || y < 0 || y > this.max) return -1;\r\n\treturn this.hBuffer[x + this.size * y];\r\n}", "title": "" }, { "docid": "81458df5530e55ec6f89b4e7d037a5a6", "score": "0.53260785", "text": "function areaOfTriangle(a,b,c) {\n let s= (a+b+c)/2;\n // console.log(a,b,c,s);\n return Math.sqrt(s*(s-a)*(s-b)*(s-c));\n}", "title": "" }, { "docid": "e48ad3353ccb949ef93966c18352745a", "score": "0.5324444", "text": "function decorHeight() {\n if( $('#decor-triangle').length > 0 ) {\n var $decorTriangle = $('#decor-triangle');\n if( $(window).outerWidth() >= 1200 ) {\n var $height = $decorTriangle.closest('.contact-form-and-map').innerHeight();\n $decorTriangle.css({\n 'border-top-width' : $height,\n 'border-right-width' : 228,//parseInt($height * 0.35),\n });\n } else {\n $decorTriangle.css({\n 'border-top-width' : '',\n 'border-right-width' : '',\n });\n }\n }\n }", "title": "" }, { "docid": "6a5fa2b58592650e0d6e692a4c4c7783", "score": "0.53244084", "text": "function HeightField(gl, xMin, xMax, zMin, zMax, lengthS) {\n //basic properties required to draw the heightField\n this.xMin = xMin;\n this.xMax = xMax; \n this.zMin = zMin;\n this.zMax = zMax; \n this.row = lengthS;\n this.col = lengthS;\n this.lengthDiamond = lengthS; //length of side of terrain\n this.diamondSquare = createDS(this.lengthDiamond); //array of heights\n this.normal = createNormalArr(this.lengthDiamond); // array of normals\n this.origin = (xMin+WIDTH/2) + \",\" + (zMin+WIDTH/2); //hash key for the terrain\n this.maxHeight; //used to set the waterline\n\n //this allows us to easier piece the different tiles together\n this.leftRight = [];\n this.topBottom = [];\n\n //following series of functions are used to set top/bottom/left/right rows of the adjacent terrain\n this.setHeightLR = function (row) {\n for (var i = 0; i < row.length; i++) {\n this.diamondSquare[0][i] = row[i];\n this.diamondSquare[row.length-1][i] = row[i];\n }\n }\n\n this.setHeightTB = function (row) {\n for (var i = 0; i < row.length; i++) {\n this.diamondSquare[i][0] = row[i];\n this.diamondSquare[i][row.length-1] = row[i];\n }\n }\n\n //set normal on left edge using right adjacent tile\n this.setNormalsL = function(normals) {\n for (var i = 0; i < normals[0].length; i++) {\n this.normal[0][i] = normals[normals.length-1][i];\n }\n }\n\n //set normal on right edge using left adjacent tile\n this.setNormalsR = function(normals) {\n for (var i = 0; i < normals[0].length; i++) {\n this.normal[this.normal.length-1][i] = normals[0][i];\n }\n }\n\n //set normal on bottom edge using right adjacent tile\n this.setNormalsB = function(normals) {\n for (var i = 0; i < normals[0].length; i++) {\n this.normal[i][normals[0].length-1] = normals[i][0];\n }\n }\n\n //set normal on top edge using bottom adjacent tile\n this.setNormalsT = function(normals) {\n for (var i = 0; i < normals[0].length; i++) {\n this.normal[i][0] = normals[i][normals[0].length-1];\n }\n }\n\n\n //test function\n this.printDS = function() {\n for (var i = 0; i < this.lengthDiamond+1; i++) {\n for (var j = 0; j < this.lengthDiamond+1; j++) {\n console.log(this.diamondSquare[i][j]);\n }\n }\n }\n\n this.calculateNormal = function() {\n var step = (this.xMax - this.xMin)/this.row;\n var one; var two; var three; var four; //points for each cell\n //vectors\n var a; var b; var normal;\n //add up all the normals for the vertices\n for (var i = 0; i < this.lengthDiamond; i++) {\n for (var j = 0; j < this.lengthDiamond; j++) {\n //Points: top left, top right, bottom right, bottom left\n one = new vec3(this.xMin + j*step, this.diamondSquare[i][j], this.zMin + i*step);\n two = new vec3(this.xMin + (j+1)*step, this.diamondSquare[i][j+1], this.zMin + i*step);\n three = new vec3(this.xMin + (j+1)*step, this.diamondSquare[i+1][j+1], this.zMin + (i+1)*step);\n four = new vec3(this.xMin + j*step, this.diamondSquare[i+1][j], this.zMin + (i+1)*step);\n \n //we calculate the surface normal for the 4 triangles that make up one cell, and add this vector to the\n //vertices involved; going clockwise; i, j represents the top left of each 'cell' we calculate \n //top left\n a = subtract(four, one);\n b = subtract(two, one);\n normal = normalize(cross(a,b));\n this.normal[i][j] = add(this.normal[i][j], normal);\n this.normal[i][j+1] = add(this.normal[i][j+1], normal);\n this.normal[i+1][j] = add(this.normal[i+1][j], normal);\n\n //top right\n a = subtract(one, two);\n b = subtract(three, two);\n normal = normalize(cross(a,b));\n this.normal[i][j] = add(this.normal[i][j], normal);\n this.normal[i][j+1] = add(this.normal[i][j+1], normal);\n this.normal[i+1][j+1] = add(this.normal[i+1][j+1], normal);\n\n // //bottom right\n a = subtract(two, three);\n b = subtract(four, three);\n\n normal = normalize(cross(a,b));\n this.normal[i][j+1] = add(this.normal[i][j+1], normal);\n this.normal[i+1][j+1] = add(this.normal[i+1][j+1], normal);\n this.normal[i+1][j] = add(this.normal[i+1][j], normal);\n\n // //bottom left\n a = subtract(three, four);\n b = subtract(one, four);\n normal = normalize(cross(a,b));\n this.normal[i][j] = add(this.normal[i][j], normal);\n this.normal[i+1][j] = add(this.normal[i+1][j], normal);\n this.normal[i+1][j+1] = add(this.normal[i+1][j+1], normal);\n }\n }\n \n //divide and normalise the normals\n for (var i = 0; i <= this.lengthDiamond; i++) {\n for (var j = 0; j <= this.lengthDiamond; j++) {\n //only divide by 3 for the corner points\n if ((i==0 && j==0) || (i==0 && j==this.lengthDiamond) || (i==this.lengthDiamond && j==0) || \n (i==this.lengthDiamond && j==this.lengthDiamond)) {\n this.normal[i][j][0] /= 3;\n this.normal[i][j][1] /= 3;\n this.normal[i][j][2] /= 3;\n this.normal[i][j] = normalize(this.normal[i][j]);\n }\n //edge rows get divided by 6\n else if (i==0 || i==this.lengthDiamond || j==0 || j==this.lengthDiamond) {\n this.normal[i][j][0] /= 6;\n this.normal[i][j][1] /= 6;\n this.normal[i][j][2] /= 6;\n this.normal[i][j] = normalize(this.normal[i][j]);\n }\n //all other vertexes get divided by 12\n else {\n this.normal[i][j][0] /= 12;\n this.normal[i][j][1] /= 12;\n this.normal[i][j][2] /= 12;\n this.normal[i][j] = normalize(this.normal[i][j]);\n }\n }\n }\n }\n\n //actually calculates values in the diamond square array \n this.calculateDS = function() {\n //set the initial 4 points needed\n this.diamondSquare[0][0] = 1;\n this.diamondSquare[0][this.lengthDiamond] = 1;\n this.diamondSquare[this.lengthDiamond][0] = 1;\n this.diamondSquare[this.lengthDiamond][this.lengthDiamond] = 1;\n\n var counter = 0;\n var r; var average;\n for (var length = this.lengthDiamond; length >= 2; length/=2) {\n //calculate the square side\n r = roughness * length;\n for (var x = 0; x < this.lengthDiamond; x+=length) {\n for (var z = 0; z < this.lengthDiamond; z+=length) {\n //top left + top right + bottom left + bottom right\n if (this.diamondSquare[x+(length/2)][z+(length/2)] == 0) {\n average = \n this.diamondSquare[x][z] + \n this.diamondSquare[x][z+length] + \n this.diamondSquare[x+length][z] + \n this.diamondSquare[x+length][z+length];\n average/=4.0;\n average += (Math.random()*2*r-r);\n this.diamondSquare[x+(length/2)][z+(length/2)] = average;\n }\n }\n }\n \n for (var x = 0; x < this.lengthDiamond; x+=length/2) {\n for (var z = (x+(length/2))%length; z < this.lengthDiamond; z+=length) {\n if (this.diamondSquare[x][z] == 0) {\n average =\n (this.diamondSquare[(x-length/2+this.lengthDiamond)%this.lengthDiamond][z] + \n this.diamondSquare[x][(z-length/2+this.lengthDiamond)%this.lengthDiamond] +\n this.diamondSquare[x][(z+length/2)%this.lengthDiamond] + \n this.diamondSquare[(x+length/2)%this.lengthDiamond][z])/4.0 + (Math.random()*2*r-r);\n this.diamondSquare[x][z] = average;\n //here we copy it onto the other side of the array; \n //I figured that doing so smoothens the sides and also saves some computing\n if (x == 0) {\n this.diamondSquare[this.lengthDiamond][z] = average;\n }\n if (z == 0) {\n this.diamondSquare[x][this.lengthDiamond] = average;\n }\n }\n }\n }\n } \n\n //following are used to add adjacent tiles\n //keep track of the top left point\n for (var i = 0; i < this.diamondSquare[0].length; i++) {\n this.leftRight.push(this.diamondSquare[0][i]);\n }\n\n for (var i = 0; i < this.diamondSquare[0].length; i++) {\n this.topBottom.push(this.diamondSquare[i][0]);\n }\n \n if (count <= 6) {\n roughness += (PerlinNoise.noise(x, z, 0.3)/1000);\n \n }\n else if (count == 12) {\n roughness*= 0.5;\n count = 1;\n\n }\n else {\n roughness -= (PerlinNoise.noise(x, z, 0.3)/1000); //pseudo-random variations\n }\n }\n}", "title": "" }, { "docid": "30add6bbed46fe7ff930c5263c242a91", "score": "0.53217983", "text": "function screenHeight() { return game.height; }", "title": "" }, { "docid": "e1dd8f69025a59e7c27f39bee289b7a1", "score": "0.53112435", "text": "function calcStuff(width, height, s) {\n // because pythagorean theorem\n // h = sqrt(a^2 + b^2)\n // a = sqrt(h^2 - b^2)\n // b = sqrt(h^2 - a^2)\n let a = sqrt(sq(width/2)+sq(height/2));\n let theta = radians(360 / s);\n let o = tan(theta) * a;\n let h = a / cos(theta);\n\n return {a: round(a), o: round(o), h: round(h)};\n}", "title": "" }, { "docid": "90f8b70acb745447fc2fd2576a4aba9c", "score": "0.529763", "text": "function arrowArea(a,b) {\n return (a * (b/2)) / 2;\n}", "title": "" }, { "docid": "bbf169ebc2e0e5f59d13284168ebc672", "score": "0.5297262", "text": "function eqTriangle(x,y,length){ \n\tvar height = (length*Math.sqrt(3))/2;\n\tctx.beginPath();\n\tctx.moveTo(x,y);\n\tctx.lineTo(x+(length/2),y-height);\n\tctx.lineTo(x+length,y);\n\tctx.lineTo(x,y);\n\tctx.lineWidth=0.25;\n\tctx.stroke();\n}", "title": "" }, { "docid": "f438234bba3496077642f7c6d7dc23ff", "score": "0.5297231", "text": "static get SIDE_TMD_HEIGHT() { return 18; }", "title": "" }, { "docid": "a9c931438b96e8b199485e976b1a4ac7", "score": "0.5295074", "text": "function calculateHypotenuse(base, perpendicular) {\n var baseSquare = calculateSquare(base);\n var perpendicularSquare = calculateSquare(perpendicular);\n var hypotenuse = Math.sqrt(baseSquare + perpendicularSquare);\n\n document.write(\"Base: \" + base + \"<br>Perpendicular: \" + perpendicular + \"<br>Hypotenuse: \" + hypotenuse)\n\n}", "title": "" }, { "docid": "557bdcc4f502a55172832380134b2061", "score": "0.5284605", "text": "function getHeight() {\n return height;\n }", "title": "" }, { "docid": "03113e8b85b30f978a4d357fb296eeca", "score": "0.5282312", "text": "function _triangleVolume (triangle) {\n\tvar \n\tv321 = Number(triangle.vert3.x * triangle.vert2.y * triangle.vert1.z),\n\tv231 = Number(triangle.vert2.x * triangle.vert3.y * triangle.vert1.z),\n\tv312 = Number(triangle.vert3.x * triangle.vert1.y * triangle.vert2.z),\n\tv132 = Number(triangle.vert1.x * triangle.vert3.y * triangle.vert2.z),\n\tv213 = Number(triangle.vert2.x * triangle.vert1.y * triangle.vert3.z),\n\tv123 = Number(triangle.vert1.x * triangle.vert2.y * triangle.vert3.z);\n \n\treturn Number(1.0/6.0)*(-v321 + v231 + v312 - v132 - v213 + v123);\n}", "title": "" }, { "docid": "31f99b5afcbd07393f61f5d55824ba83", "score": "0.5280939", "text": "function getHeight(h) {\n const unit = heightUnit.value;\n let unitRatio = 3.281; // default calculations are in feet\n if (unit === \"m\") unitRatio = 1;\n // if meter\n else if (unit === \"f\") unitRatio = 0.5468; // if fathom\n\n let height = -990;\n if (h >= 20) height = Math.pow(h - 18, +heightExponentInput.value);\n else if (h < 20 && h > 0) height = ((h - 20) / h) * 50;\n\n return rn(height * unitRatio) + \" \" + unit;\n }", "title": "" }, { "docid": "4f330040a2ecb1a9e54999618c9e4469", "score": "0.5279941", "text": "function getTrapezoidArea(sideA, sideB, height) {\n if (isNaN(sideA) || isNaN(sideB) || isNaN(height)) {\n return 'Not a number';\n } else {\n return ((sideA * 1 + sideB * 1) * height / 2);\n }\n}", "title": "" }, { "docid": "57c6d70edd40e67e9f67a5077606326d", "score": "0.5277752", "text": "calculateAngle() {\n // These vector represent a new triangle created between\n // the object (sprite) and the player\n var xVector = this.x - player.x;\n var yVector = this.y - player.y;\n\n // We can determine the angle between the object and the\n // player by using the arctangent function, which can give\n // us the angle, with the given vectors\n var angleObjectPlayer = Math.atan2(yVector, xVector);\n // This difference represents the angle between the player's\n // aiming direction and the sprite's aiming direction respect\n // to player\n var angleDifference = player.rotationAngle - angleObjectPlayer;\n\n // It might come the case, where the angle difference in radians\n // give a great value that might imply a bigger distance in\n // radians for reaching the desired value, which is not practical,\n // to avoid that, we use the following conditions\n if (angleDifference < -Math.PI) {\n angleDifference += 2.0 * Math.PI;\n }\n if (angleDifference > Math.PI) {\n angleDifference -= 2.0 * Math.PI;\n }\n\n angleDifference = Math.abs(angleDifference);\n\n // After getting such difference, we can determine either the object\n // will be visible (considering it in the FOV) or not\n if (angleDifference < halfFOV) {\n this.visible = true;\n } else {\n this.visible = false;\n }\n }", "title": "" }, { "docid": "9b3d8cbf8584a7351a36d8b1d62e8d2c", "score": "0.52738434", "text": "function getTerrainHeight(xPos, zPos)\r\n{\r\n\t//check to see if location is within terrain space\r\n\tif (xPos < 0 || zPos < 0)\r\n\t\treturn 0;\r\n\t\r\n\tvar farX = terrain.width * terrain.scaleX;\r\n\tvar farZ = terrain.height * terrain.scaleZ;\r\n\t\r\n\tif (xPos > farX ||\r\n\t zPos > farZ)\r\n\t\treturn 0;\r\n\t\r\n\tvar vertX = Math.floor(xPos / terrain.scaleX);\r\n\tvar vertZ = Math.floor(zPos / terrain.scaleZ);\r\n\t\r\n\treturn terrain.vertices[((vertX * terrain.height + vertZ) * 3) + 1];\r\n}", "title": "" }, { "docid": "d1beb9dcbb597aaefc5a383520d037fc", "score": "0.52730685", "text": "function areaofparllelogram(b,h) {\n var area=b*h;\n return area;\n }", "title": "" }, { "docid": "0632552b58ec3985018c472469e2702c", "score": "0.5270668", "text": "function getZvalueInTriangle(v1,v2,v3,heigh,type,samples){\n\t\n\tvar finalTriangles = [];\n\tvar rise1;\n\tvar rise1;\n\tvar sewEdgesPoints1;\n\tvar sewEdgesPoints2;\n\trise1 = 50;\n\trise2 = 50;\n\tvar value = 1.5;\n\t/* v1 y v2 forman parte de la espina*/\n\tif(type == 1)\n\t{\n\t\t//rise1 = heigh.get(v1)/value;// La altura que va a crecer dado el vertice v1 que es el promedio a todos los vertices externos\n\t\t//rise2 = heigh.get(v2)/value;// La altura que va a crecer dado el vertice v2 que es el promedio a todos los vertices externos\n\t\tsewEdgesPoints1 = getZvalue2(v1,v3,rise1,samples);//Son los puntos con la coordenada en z desde v1 a v3 despues de la costura\n\t\tsewEdgesPoints2 = getZvalue2(v2,v3,rise2,samples);//Son los puntos con la coordenada en z desde v3 a v3 despues de la costura\n\t\tfinalTriangles = getFinalTriangles(sewEdgesPoints1,sewEdgesPoints2,1);\n\t}\n\n\t/* v1 forman parte de la espina*/\n\telse if(type == 0)\n\t{\t\n\t\t\n\t\t//rise1 = heigh.get(v1)/value;// La altura que va a crecer dado el vertice v1 que es el promedio a todos los vertices externos\n\t\tsewEdgesPoints1 = getZvalue2(v1,v3,rise1,samples);//Son los puntos con la coordenada en z desde v1 a v3 despues de la costura\n\t\tsewEdgesPoints2 = getZvalue2(v1,v2,rise1,samples);//Son los puntos con la coordenada en z desde v3 a v3 despues de la costura\n\t\tfinalTriangles = getFinalTriangles(sewEdgesPoints1,sewEdgesPoints2,0);\n\t}\n\treturn finalTriangles;\n}", "title": "" }, { "docid": "8f5c10d0d76ecb36969f6af66829a7b1", "score": "0.52699393", "text": "function getHillHeight(hill, t){\n var x = (t - hill.x) / hill.width;\n var h = hill.height;\n var baseHeight = hill.height;\n \n var data = getNormalizedFunctionValue(hill, x);\n x = data.x;\n if (data.decline){\n h = h * (hill.peak.y - hill.end.y);\n baseHeight *= hill.end.y;\n }\n else{\n h = h * (hill.peak.y - hill.start.y);\n baseHeight *= hill.start.y;\n }\n var percent = x * x / (x * x + (1 - x) * (1 - x));\n return hill.y - h * percent - baseHeight;\n}", "title": "" }, { "docid": "479f35a9673b6eb265d7413ce71e7187", "score": "0.5264846", "text": "getLength() {\n return Math.sqrt((this.x1 - this.x2) ** 2 + (this.y1 - this.y2) ** 2);\n }", "title": "" }, { "docid": "95adb11246127b41148f6ddabaa4f105", "score": "0.52582335", "text": "area() {\n if (this.vertices.length > 3)\n return console.error(\"Error, the area function does not work with polygons beyond triangles!\");\n\n let ab = this.vertices[0].subtract(this.vertices[1]);\n let ac = this.vertices[0].subtract(this.vertices[2]);\n\n return 0.5*ab.cross(ac).length();\n }", "title": "" }, { "docid": "e35a266d9f20f0765d6bd90c3e01d502", "score": "0.52536803", "text": "function areaOfEquilateralTriangle(a)\r\n{\r\n let area = (Math.sqrt(3)/4) * a * a;\r\n return area;\r\n}", "title": "" }, { "docid": "31bc515e2d50edc9564610c238dc9747", "score": "0.52510643", "text": "CalcHeight() {}", "title": "" } ]
f8c57e6fefc9552c9c2decd306eeb78c
Response Time Percentiles Over Time
[ { "docid": "306f0cb3a46562bfbc77c2f8cc2bb63b", "score": "0.0", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 0);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" } ]
[ { "docid": "dc2c9b44572e24fe66cdf6aa1db17793", "score": "0.6267589", "text": "function averageResponseTime() {\n return 200;\n}", "title": "" }, { "docid": "36262531f4638465cb4f0ca933c17516", "score": "0.5969935", "text": "function getGDPGrowthPercentile(req, res) {\n const q = `\n SELECT A.FIPS, ROW_NUMBER() OVER w AS position\n\t\tFROM (SELECT FIPS, GDP FROM GDP WHERE YEAR=2001 AND INDUSTRY_ID=0 AND GDP IS NOT NULL) A\n\t\t\t JOIN\n (SELECT FIPS, GDP FROM GDP WHERE YEAR=2018 AND INDUSTRY_ID=0 AND GDP IS NOT NULL) B\n ON A.FIPS=B.FIPS\n\t\tWINDOW w AS (ORDER BY B.GDP / A.GDP DESC);\n `;\n\n execQueryRow(q).then((ranking) => {\n let result = [];\n for (let i = 0; i < ranking.length; i++) {\n if (ranking[i][\"FIPS\"] === req.query.fips){\n result.push({\n \"PERCENTILE\" : 1 - (ranking[i][\"position\"] / ranking.length)\n });\n break;\n }\n }\n res.json(result);\n });\n}", "title": "" }, { "docid": "bfad430b430370daf8acacac04f929ee", "score": "0.59581846", "text": "function testLatencyPercentiles(callback) {\n\tconst options = {\n\t\tmaxRequests: 10\n\t};\n\tconst latency = new Latency(options, error => {\n\t\ttesting.check(error, 'Error while testing latency percentiles', callback);\n\t\tconst percentiles = latency.getResult().percentiles;\n\n\t\tObject.keys(percentiles).forEach(percentile => {\n\t\t\ttesting.assert(percentiles[percentile] !== false, 'Empty percentile for %s', percentile, callback);\n\t\t});\n\n\t\ttesting.success(percentiles, callback);\n\t});\n\tfor (let ms = 1; ms <= 10; ms++) {\n\t\t(function() {\n\t\t\tconst id = latency.start();\n\t\t\tsetTimeout(() => {\n\t\t\t\tlatency.end(id);\n\t\t\t}, ms);\n\t\t})();\n\t}\n}", "title": "" }, { "docid": "ebe20fc529cc3c41df8f7fe4c6d4d9eb", "score": "0.5918576", "text": "function filterResponseTimes(data) {\n var responseCount = data.length;\n var res = [];\n var timeStamps = [];\n for (let i = 0; i < responseCount; ++i) {\n res.push(data[i][\"responsetime\"]);\n timeStamps.push(data[i][\"timestamp\"]);\n }\n setResponses(res);\n setTimeStamps(timeStamps);\n }", "title": "" }, { "docid": "b6f7c5f3ff0fe2aee222f4e6594153bf", "score": "0.57872486", "text": "calculatePercentages(){\n for(var i = 0 ; i < this.distances.length ; i++){\n var perc = this.deltatime / this.times[i];\n this.percentages[i] = perc;\n }\n }", "title": "" }, { "docid": "f8908ab92041ff56d602fda32feae449", "score": "0.5686254", "text": "_getResolutionTimeStats(models) {\n var ret = {\n min: 0,\n max: 0,\n average: 0\n };\n\n if(models.length) {\n var times = models.map(function(ticket) {\n return Math.abs(_.last(ticket.statuses).created_at - ticket.created_at);\n });\n\n ret.min = _.min(times);\n ret.max = _.max(times);\n\n ret.average = times.reduce(function(a, b) {\n return a + b;\n })/models.length;\n }\n\n return ret;\n }", "title": "" }, { "docid": "8fb61cbb7e8a57d6d6f7ee79e2794a0c", "score": "0.5544731", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "23fa9c71daa61c340084751e0df31dae", "score": "0.55416846", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "23fa9c71daa61c340084751e0df31dae", "score": "0.55416846", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "23fa9c71daa61c340084751e0df31dae", "score": "0.55416846", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "23fa9c71daa61c340084751e0df31dae", "score": "0.55416846", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "23fa9c71daa61c340084751e0df31dae", "score": "0.55416846", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "23fa9c71daa61c340084751e0df31dae", "score": "0.55416846", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e65ba57d67d53dca9f7e425444b78c86", "score": "0.5540164", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 43200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e65ba57d67d53dca9f7e425444b78c86", "score": "0.5540164", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 43200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "ae0eba3563f48ab73414d2d48e19558c", "score": "0.55343693", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e334c67014a4c4fc1a0b3c7be3bb1da7", "score": "0.55332816", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e09d726a8ca4deb8ba5e9fc602702675", "score": "0.55267847", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e09d726a8ca4deb8ba5e9fc602702675", "score": "0.55267847", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e09d726a8ca4deb8ba5e9fc602702675", "score": "0.55267847", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e09d726a8ca4deb8ba5e9fc602702675", "score": "0.55267847", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e09d726a8ca4deb8ba5e9fc602702675", "score": "0.55267847", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e09d726a8ca4deb8ba5e9fc602702675", "score": "0.55267847", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e09d726a8ca4deb8ba5e9fc602702675", "score": "0.55267847", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "e584c61511b9488a6919024d362e50a1", "score": "0.55218434", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "bdd0cce9870d295d83ed232dee921a17", "score": "0.55120313", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "bdd0cce9870d295d83ed232dee921a17", "score": "0.55120313", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "57b757192040b05241cf0f472f02dafb", "score": "0.55119365", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -10800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "57b757192040b05241cf0f472f02dafb", "score": "0.55119365", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -10800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "57b757192040b05241cf0f472f02dafb", "score": "0.55119365", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -10800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" }, { "docid": "feb94fc4d9207d528146b751089aaf81", "score": "0.55089223", "text": "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" } ]
b2556fd2909cc745866dc2d9abea35dc
TODO: refactor, create delegate "Test" method to reduce complexity in the if statement
[ { "docid": "e0a545b6f88b22c9cd51551db6919cf7", "score": "0.0", "text": "checkWinner(positionOne,positionTwo,positionThree) {\n return this.gameBoard[positionOne] != 0 && this.gameBoard[positionOne] == this.gameBoard[positionTwo] && this.gameBoard[positionTwo] == this.gameBoard[positionThree];\n }", "title": "" } ]
[ { "docid": "e6ffbe1d2e81995770b413630f670783", "score": "0.64438236", "text": "function testFunction() {\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "5f3aca8a5a38e9f6481d5bea9e91f0c5", "score": "0.62010235", "text": "function testName()\n {\n if(\"Alexandre\")\n {\n result = true ;\n }\n else\n {\n result = false;\n }\n return result ;\n }", "title": "" }, { "docid": "43a738f002920d15972f66522339bb7a", "score": "0.5979593", "text": "every(callback){\n let test = true;\n this.__traverseAndBreak((node)=>{\n test = callback(node.data);\n return test;\n });\n return test;\n }", "title": "" }, { "docid": "6f50a776a23368813430fd8da9ebeea8", "score": "0.59570116", "text": "canTest(test) {\n return this.hasAttr(test.question) && this.hasAttr(test.answer);\n }", "title": "" }, { "docid": "76988078ff165a4bf2819a6a5580fcd9", "score": "0.58288807", "text": "function do_test() {\n Marionette.is(1, 1);\n Marionette.isnot(1, 2);\n Marionette.ok(1 == 1);\n Marionette.finish();\n}", "title": "" }, { "docid": "4bea808e8d14a3c34e96c31108eae632", "score": "0.58157086", "text": "isValid(){ /** todo */ }", "title": "" }, { "docid": "fc8429729b5b612b90cb3b6ec3f4edf8", "score": "0.5759521", "text": "function toBe(data) {\n var status\n if(data === test) {\n status = true\n } else {\n status = false\n }\n testRes[currDesc].expects.push({\n name: desc,\n status\n })\n }", "title": "" }, { "docid": "fc8429729b5b612b90cb3b6ec3f4edf8", "score": "0.5759521", "text": "function toBe(data) {\n var status\n if(data === test) {\n status = true\n } else {\n status = false\n }\n testRes[currDesc].expects.push({\n name: desc,\n status\n })\n }", "title": "" }, { "docid": "e34235e3e0ac9bcfb71929afb34c4f26", "score": "0.5749124", "text": "function check(testedId) {\n var testId = testedId;\n return function() {\n return document.getElementById(testId) != null;\n }\n }", "title": "" }, { "docid": "5f3ffb5c5ed1ed077b369bfb2f96430e", "score": "0.57383764", "text": "function test (myCondition) {\n if (myCondition) {\n return \"It was true\";\n }\n return \"It was false\";\n}", "title": "" }, { "docid": "de371c5290f5f8c7224451ea13d75506", "score": "0.5719791", "text": "function myFunctionTest(expected, found) {\n if (expected === found) {\n return \"TEST SUCCEEDED\";\n } else {\n return \"TEST FAILED. Expected \" + expected + \" found \" + found;\n }\n }", "title": "" }, { "docid": "b7cd108888f72ff02d08dd5a2de16893", "score": "0.5654092", "text": "test(capture, existingData) {\n let {\n node,\n setProperties: props = {},\n assertedProperties: asserted = {},\n refutedProperties: refuted = {}\n } = capture;\n\n if (existingData?.final || existingData?.['capture.final']) {\n return false;\n }\n\n // Capture settings (final/shy) are the only keys in `setProperties` that\n // matter when testing this capture.\n //\n // TODO: For compatibility reasons, we're still checking tests of the form\n // (#set! test.final) here, but this should be removed before modern\n // Tree-sitter ships.\n for (let key in props) {\n let isCaptureSettingProperty = this.capturePropertyIsCaptureSetting(key);\n let isTest = this.capturePropertyIsTest(key);\n if (!(isCaptureSettingProperty || isTest)) { continue; }\n let value = props[key] ?? true;\n if (isCaptureSettingProperty) {\n if (!this.applyCaptureSettingProperty(key, node, existingData, this)) {\n return false;\n }\n } else {\n // TODO: Remove this once third-party grammars have had time to adapt to\n // the migration of tests to `#is?` and `#is-not?`.\n if (!this.applyTest(key, node, value, existingData, this)) {\n return false;\n }\n }\n }\n\n // Apply tests of the form `(#is? foo)`.\n for (let key in asserted) {\n if (!this.capturePropertyIsTest(key)) { continue; }\n let value = asserted[key] ?? true;\n let result = this.applyTest(key, node, value, existingData, this);\n if (!result) return false;\n }\n\n // Apply tests of the form `(#is-not? foo)`.\n for (let key in refuted) {\n if (!this.capturePropertyIsTest(key)) { continue; }\n let value = refuted[key] ?? true;\n let result = this.applyTest(key, node, value, existingData, this);\n if (result) return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "320428de9cc1337d0892b387adb0b792", "score": "0.5634648", "text": "function ok(test, desc) { expect(test).toBe(true); }", "title": "" }, { "docid": "320428de9cc1337d0892b387adb0b792", "score": "0.5634648", "text": "function ok(test, desc) { expect(test).toBe(true); }", "title": "" }, { "docid": "c31a2ef5122178d9fb1636b1f09d90e2", "score": "0.5622813", "text": "test() {\n switch(this.testType){\n case \"position\":\n // if there's only one coordinate then it's the x value, so we just check that and award xp if it's reached:\n if (this.coords.length === 1) {\n this.achieved = (this.subject.gridX === this.coords[0]);\n // if there are two coordinates we require a match for each:\n } else {\n this.achieved = ((this.subject.gridX === this.coords[0]) && (this.subject.y === this.coords[1]));\n };\n }\n }", "title": "" }, { "docid": "bdbb39ebd0fce669a78c3a2c22e5a1e3", "score": "0.56213343", "text": "function test() {\n runTests0();\n runTests1();\n return true;\n}", "title": "" }, { "docid": "0e92b878f38c1e761001ff70fa3af9a5", "score": "0.56142354", "text": "function checkDataCreation(){\r\n\ttestAlert += \"\\nappropriate creation checking\\n\";\r\n\ttestAlert += isEqual(object2.amount,2);\r\n\ttestAlert += isEqual(object1.name,\"item1\");\r\n}", "title": "" }, { "docid": "62305124ced06157be1bbb757a7cd6e5", "score": "0.56072664", "text": "function myFunctionTest(expected, found){\n if(expected===found){\n return \"TEST SUCCEEDED\";\n }else{\n return \"TEST FAILED. Expected output is \" + expected + \" but found \" + found;\n }\n}", "title": "" }, { "docid": "0835c7cbccc5e6a6019ebbca53deb6e5", "score": "0.5589109", "text": "function test(name , Expected,actual){\n if(Expected === actual){\n console.log(name+ \"\\nTest passed Expected.\"+Expected+\"is equal to actual\"+actual+\".\")\n }\n else{\n console.log(name+ \"\\nTest failes Expected.\"+Expected+\"is equal to actual\"+actual+\".\")\n }\n }", "title": "" }, { "docid": "8e2e7e115fa1fdc5ffdad416842e52ee", "score": "0.5577804", "text": "function foo(){\n console.log(\"inside Foo with testCondition True value\");\n }", "title": "" }, { "docid": "c936eabcbd6cb38cf19cd60a26d6c77d", "score": "0.55706686", "text": "test (actual, expected) {\n throw new TypeError('Not implemented: pass');\n }", "title": "" }, { "docid": "56acec02533089eb2809275a69e27255", "score": "0.556598", "text": "test() {\r\n return new Promise((resolve, reject) => {\r\n var alreadyChecked = false;\r\n\r\n //Call the callback with the testing function\r\n callback((value, message) => {\r\n if (!alreadyChecked) {\r\n alreadyChecked = true;\r\n\r\n //Reject the promise if the test fails\r\n if (!value) {\r\n reject({\r\n //Return the current test with the message\r\n test: this,\r\n message,\r\n });\r\n } else {\r\n resolve(this);\r\n }\r\n }\r\n });\r\n });\r\n }", "title": "" }, { "docid": "dee04bcdb76a3b4fa39ac6a4ae5abf45", "score": "0.55424064", "text": "static run() {\n // Perform each test\n if (zbCultureTest._constructor() === false) { console.log('zbCultureTest.constructor FAILED'); return; }\n if (zbCultureTest._add() === false) { console.log('zbCultureTest.add FAILED'); return; }\n if (zbCultureTest._find() === false) { console.log('zbCultureTest.find FAILED'); return; }\n if (zbCultureTest._default() === false) { console.log('zbCultureTest.default FAILED'); return; }\n }", "title": "" }, { "docid": "b5afd902059ec1968882e01250a0d3c2", "score": "0.5538395", "text": "static run() {\n // Perform each test\n if (zbDateTest._constructor() === false) { console.log('zbDateTest.constructor FAILED'); return; }\n if (zbDateTest._toString() === false) { console.log('zbDateTest.toString FAILED'); return; }\n if (zbDateTest._getDayOfYear() === false) { console.log('zbDateTest.getDayOfYear FAILED'); return; }\n if (zbDateTest._getDayOfWeek() === false) { return; }\n if (zbDateTest._addDays() === false) { console.log('zbDateTest.addDays FAILED'); return; }\n if (zbDateTest._addMonths() === false) { console.log('zbDateTest.addMonths FAILED'); return; }\n if (zbDateTest._addYears() === false) { console.log('zbDateTest.addYears FAILED'); return; }\n if (zbDateTest._format() === false) { console.log('zbDateTest.format FAILED'); return; }\n if (zbDateTest._isLeapYear() === false) { console.log('zbDateTest.isLeapYear FAILED'); return; }\n if (zbDateTest._getDaysInMonth() === false) { console.log('zbDateTest.getDaysInMonth FAILED'); return; }\n if (zbDateTest._getDaysInYear() === false) { console.log('zbDateTest.getDaysInYear FAILED'); return; }\n if (zbDateTest._getToday() === false) { console.log('zbDateTest.getToday FAILED'); return; }\n if (zbDateTest._fromString() === false) { console.log('zbDateTest.fromString FAILED'); return; }\n if (zbDateTest._compare() === false) { console.log('zbDateTest.compare FAILED'); return; }\n }", "title": "" }, { "docid": "b0282aea9622987eaa73ff82b10ba43d", "score": "0.5530092", "text": "function test() {\n // this === instance to test\n return fn(this[propExp], value);\n }", "title": "" }, { "docid": "2be1a537497dca6645fef1462b663fb1", "score": "0.54990697", "text": "skillTestsDone() {\n const currentPosition = this.props.currentUser.currentPosition;\n // if there are no skill tests, must be done with them\n if (!currentPosition || !currentPosition.skillTests) { return true; }\n // if the index of the current test is valid and in bounds, not done with tests\n return parseInt(currentPosition.testIndex, 10) >= currentPosition.skillTests.length;\n }", "title": "" }, { "docid": "879a221831619df04013d8ef8c98fa0d", "score": "0.5498113", "text": "function TestQueryCallback( fixture){\n if( fixture.GetBody().GetType() != b2Body.b2_staticBody){\n if( fixture.GetShape().TestPoint( fixture.GetBody().GetTransform(), myTestPoint)){\n myTestBody = fixture.GetBody();\n return false;\n }\n return true;\n }\n}", "title": "" }, { "docid": "e76b6c9abfef20097851d57102fb36c8", "score": "0.5488716", "text": "function test (foo, bar)\n\t\t\t{\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "f5122ac4c983a885c9cf1283db1e714f", "score": "0.547644", "text": "function test1() {\n\t\t\t\tvar res = BinTree.getValue('string', compFunc, null);\n\t\t\t\tconsole.log('test1: ' + (res == null));\n\t\t}", "title": "" }, { "docid": "66a82394bdc07e595e7fe97836f89121", "score": "0.54638875", "text": "testCheckComment() {\n it('should return `false` for valid comment (e.g. ham)' , () =>\n this._client.checkComment(this._ham).then(res => assert.strictEqual(res, false))\n );\n\n it('should return `true` for invalid comment (e.g. spam)' , () =>\n this._client.checkComment(this._spam).then(res => assert.strictEqual(res, true))\n );\n }", "title": "" }, { "docid": "356c0ccba3d84d87834615935cbadaaf", "score": "0.54347885", "text": "function test (wasItTrue) {\n if (wasItTrue) {\n return \"It was true\";\n }\n return \"It was false\";\n}", "title": "" }, { "docid": "7a1781445042ffde2b1a367a9542f0ba", "score": "0.5430517", "text": "function testAnswer(arr) {\n if (rowTester(arr) && columnTester(arr) && regionTest(arr)) {\n return \"Finished!\";\n }\n return \"Try again!\";\n}", "title": "" }, { "docid": "0cd2657c2c0aed4caece740b7bb3236d", "score": "0.54248357", "text": "function testCases(input, success, fail, nextAction)\n{\n\t\n\tif (input().trim() != '')\n\t{\n\t\tsuccess(input(), nextAction);\n\t}\n\telse\n\t{\n\t\tfail();\n\t}\n}", "title": "" }, { "docid": "8c0c8269ace8ffd3b37efe42a5598eb6", "score": "0.54219335", "text": "function testValidateAux(){\n //Cases to be tested\n const cases = [\n {input:{name:{value:\"\",type:\"\"}, gender:{value:\"\",type:\"\"}, email:{value:\"\",type:\"email\"}, iseasy:{value:\"\",type:\"\"}},\n output:{name:false, gender:false, email:false, iseasy:false}},\n {input:{name:{value:\" \",type:\"\"}, gender:{value:\" \",type:\"\"}, email:{value:\" \",type:\"email\"}, iseasy:{value:\" \",type:\"\"}},\n output:{name:false, gender:false, email:false, iseasy:false}},\n {input:{name:{value:\"Vin\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"vin@vin\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Bob\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"[email protected]\",type:\"email\"}, iseasy:{value:\" \",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:false}},\n {input:{name:{value:\"Vin Ndokaj\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"@.com\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Haidar\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"[email protected]\",type:\"email\"}, iseasy:{value:\"false\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Isabella\",type:\"\"}, gender:{value:\"Female\",type:\"\"}, email:{value:\"[email protected]\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Tyna\",type:\"\"}, gender:{value:\"Female\",type:\"\"}, email:{value:\"[email protected]\",type:\"email\"}, iseasy:{value:\"\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:false}},\n {input:{name:{value:\"Ronnie Coleman\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"[email protected]\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:true, iseasy:true}},\n ]\n\n //goes through test cases and checks for correct output\n console.log(\"Test cases:\");\n var i;\n for(i = 0; i < cases.length; i++){\n if(\n validateAux(cases[i].input.name) != cases[i].output.name ||\n validateAux(cases[i].input.gender) != cases[i].output.gender ||\n validateAux(cases[i].input.email) != cases[i].output.email ||\n validateAux(cases[i].input.iseasy) != cases[i].output.iseasy\n ) {console.log(\"Case \" + i + \" failed.\");}\n else {console.log(\"Case \" + i + \" passed.\");}\n }\n} //end testValidateAux", "title": "" }, { "docid": "8a52d9a7a1931801c50249596bad24b7", "score": "0.5414439", "text": "function testPass(testName, test) {\r\n if (test) {\r\n console.log(testName + \" OK\");\r\n } else {\r\n console.log(testName + \" FAILURE\");\r\n }\r\n}", "title": "" }, { "docid": "380b08f6006c64a05cc2b99bd2ee748a", "score": "0.54136604", "text": "function myFunctionTest(expected, found) {\n if (expected.toString() === found.toString()) {\n return \"TEST SUCCEEDED\";\n } else {\n return \"TEST FAILED. Expected \" + expected + \" found \" + found;\n }\n}", "title": "" }, { "docid": "1e69d2c1ffedf3af7f4e9316dd7328a0", "score": "0.54119575", "text": "function test2()\n{\n\ttry\n\t{\n\t\tvar dummy_server = new DummyServer(8080,devices);\n\n\t\tif(dummy_server.get_port_number() == 80080)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t}\n\t}\n\tcatch(e)\n\t{\n\t\treturn e;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "caf4a6a6022db811163133fbdbd7cbf9", "score": "0.5409162", "text": "some(callback){\n let test = false;\n this.__traverseAndBreak((node)=>{\n test = callback(node.data);\n return !test;\n });\n return test;\n }", "title": "" }, { "docid": "8e212351b37f0eb8b6e3792a2a37d6c3", "score": "0.54047686", "text": "test() {\n return this.hexSHA1(\"abc\") === \"a9993e364706816aba3e25717850c26c9cd0d89d\";\n }", "title": "" }, { "docid": "c0d0ba6eb8097031b0ac1be9c4ad1100", "score": "0.5404104", "text": "static isNeed(source,target) {\n //todo item inflige Toxic\n //todo recette 3x gemdice vert\n return true;\n }", "title": "" }, { "docid": "b542543d33c89b77dea027fa565604ff", "score": "0.53979397", "text": "function testEqual(val) {\n if (val==12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "title": "" }, { "docid": "9b16f9019efa80e0e2d5af0269fcbb61", "score": "0.53972995", "text": "function some(collection, test){\n var bool = false;\n if(typeof test === 'function'){\n each(collection, function(e, i, a) {\n if(test(e, i, a)){\n bool = true;\n }\n });\n } else {\n each(collection, function(e, i, a) {\n if(e)\n bool = true;\n })\n }\n return bool;\n}", "title": "" }, { "docid": "d55e774a24d0fdb60d0c55237ae1433e", "score": "0.5393145", "text": "function nodeTest(current) {\n\t var dataToTest = getLocation(current);\n\n\t // Check selector modifier field for input and determine value to test\n\t if (current.selectorModifier) dataToTest = modifierController(current.selectorModifier, dataToTest);\n\t //if (current.source === 'text') dataToTest = dataToTest.innerText;\n\t if (current.source === 'state') dataToTest = dataToTest.state[current.property];\n\t if (current.source === 'props') dataToTest = dataToTest.props[current.property];\n\t if (current.modifier) dataToTest = modifierController(current.modifier, dataToTest);\n\t return dataToTest;\n\t}", "title": "" }, { "docid": "dc723ed8eb82472d0513116165692117", "score": "0.5392969", "text": "testFactory() {\n // \twUnit.assertTrue(testSprite instanceof Sprite);\n // \twUnit.assertTrue(testSpriteSheet instanceof Sprite);\n // \twUnit.assertTrue(testSpriteSheet instanceof SpriteSheet);\n\n }", "title": "" }, { "docid": "07ae7fdb26ef0054cab2960c61604793", "score": "0.53822017", "text": "static it(t) {\n return X$1.test(t);\n }", "title": "" }, { "docid": "7be7b8e0608dc19ef1c08f7268ed3fa0", "score": "0.53721476", "text": "function createMultiplePropertyTest(testFunc) {\r\n\t return function(o, props) {\r\n\t var i = props.length;\r\n\t while (i--) {\r\n\t if (!testFunc(o, props[i])) {\r\n\t return false;\r\n\t }\r\n\t }\r\n\t return true;\r\n\t };\r\n\t }", "title": "" }, { "docid": "df494cdad887940c711c711dae869c86", "score": "0.53709453", "text": "function logicTest() {\r\n\r\n\tswitch (testMode) {\r\n\t\tcase tmEnemyImageSwitching:\r\n\t\t\tlogicTestImageSwitching();\r\n\t\t\tbreak;\r\n\t\tcase tmCommandSpawnTest:\r\n\t\t\tlogicTestCommandSpawn();\r\n\t\t\tbreak;\r\n\t\tcase tmCommandMove:\r\n\t\t\tlogicTestCommandMove();\r\n\t\t\tbreak;\r\n\t\tcase tmShotCreation:\r\n\t\t\tlogicTestShotCreation();\r\n\t\t\tbreak;\r\n\t\tcase tmPlayerControl:\r\n\t\t\tlogicTestPlayerControl();\r\n\t\t\tbreak;\r\n\t\tcase tmShotCollision:\r\n\t\t\tlogicTestShotCollision();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tconsolePrint(\"Error with test mode.\", \"exit\");\r\n\t}\r\n}", "title": "" }, { "docid": "de07f96c31544d00d69b0d1f679ab6ce", "score": "0.53657407", "text": "\"test If 'if' statement is pruned by the generator\"() {\n var a = 0;\n /*\n * \"qx.test.bool_true\" and \"qx.test.bool_false\" are custom environment\n * keys that are set in config.json for the framework's AUT.\n *\n * Faking \"qx.test.bool_true\" to temporarily evaluate to false here.\n * (Undone in the \"tearDown\" method).\n */\n qx.core.Environment.getChecks()[\"qx.test.bool_true\"] = function () {\n return false;\n };\n /*\n * The 'if' statement should be optimized by the generator, as the value\n * of \"qx.test.bool_true\" is known at compile time, so that only \"a = 1\"\n * makes it into the generated code.\n *\n * If the 'if' is not optimized, the .get call will actually be performed\n * returning 'false' (see above), and the else branch will be executed.\n */\n if (qx.core.Environment.get(\"qx.test.bool_true\")) {\n a = 1;\n } else {\n a = 2;\n }\n // The next will fail if the 'else' branch has been chosen, due to missing\n // or wrong optimization.\n this.assertEquals(1, a);\n }", "title": "" }, { "docid": "9eccf8324a74a44a4da9243449b06b9c", "score": "0.5357227", "text": "verify(resultArr, dataArr) {\n\n\t\t\t\t// dataArr[i] === result[i].data\n\t\t\t\treturn 1 &&\n\t\t\t\t\tresultArr[0].data.username === 'Thanos' && resultArr[1].data.username === 'Thanos' &&\n\t\t\t\t\tdataArr[0].username === 'Thanos' && dataArr[1].username === 'Thanos' &&\n\t\t\t\t1;\n\t\t\t}", "title": "" }, { "docid": "28731cc18d4010b7dac2aa23c31d681d", "score": "0.5344511", "text": "function createMultiplePropertyTest(testFunc) {\r\n\t\treturn function(o, props) {\r\n\t\t\tvar i = props.length;\r\n\t\t\twhile (i--) {\r\n\t\t\t\tif (!testFunc(o, props[i])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "bac7a0c27394e1f81e18e1e4aa19b58a", "score": "0.5323013", "text": "function passCheck() {}", "title": "" }, { "docid": "7a46bfeca0f25078ccb2d32566c0be13", "score": "0.5320655", "text": "doIt() {\n if (typeof this.testFunction !== \"function\") {\n throw new Error(\"Test function not found\");\n }\n\n return this.testFunction.call(this.ctx, ...this.toArgs());\n }", "title": "" }, { "docid": "0a7cd1b2ad21a39cc8d8ad5c413f1734", "score": "0.53159535", "text": "function verifyJson(data, testname, expected) {\n \n}", "title": "" }, { "docid": "c813a8ab22649389ab154ffceaf95aaf", "score": "0.5309377", "text": "function checkOtherwise() {\n assert.strictEqual(1, 1, 'Test otherwise enter');\n QAppStorm.pop();\n }", "title": "" }, { "docid": "f66ea5fa8fcdbf3257d5020e8066d2e1", "score": "0.53047514", "text": "function testFunc(val) {\n return val\n ? console.log('true+', val)\n : console.log('false+', val);\n }", "title": "" }, { "docid": "d437535d51bd3e38d1ffeed1e8e7c736", "score": "0.52995896", "text": "\"test If 'select' call is pruned by the generator\"() {\n // Fake \"qx.test.bool_true\" to be false at run time.\n qx.core.Environment.getChecks()[\"qx.test.bool_true\"] = function () {\n return false;\n };\n // Under optimization, the .select call will have been gone at run time.\n var a = qx.core.Environment.select(\"qx.test.bool_true\", {\n true: 1,\n false: 2\n });\n\n this.assertEquals(1, a);\n }", "title": "" }, { "docid": "ea6be115f7d2b9b0c963ee76216652f0", "score": "0.52994454", "text": "function tester(){\n\tisTest=true;\n donneesRuches=test;\n\tgetListHives(goToListHives);\n}", "title": "" }, { "docid": "5708007f7f201bbf7ca1a002c2068b28", "score": "0.5296757", "text": "function testCase() {\n return 2 + 2;\n}", "title": "" }, { "docid": "ed3564abfc7c005ac57ee8def6faf811", "score": "0.52962255", "text": "function callConditionally( test, callback, callbackContext, path, ancestors, nodeList ) {\n \n var foundNode = test( path, nodeList );\n \n // Possible values for foundNode are now:\n //\n // false: \n // we did not match\n //\n // an object/array/string/number/null: \n // that node is the one that matched. Because json can have nulls, this can \n // be null.\n //\n // undefined: like above, but we don't have the node yet. ie, we know there is a\n // node that matches but we don't know if it is an array, object, string\n // etc yet so we can't say anything about it. Null isn't used here because\n // it would be indistinguishable from us finding a node with a value of\n // null.\n // \n if( foundNode !== false ) { \n \n // change curNode to foundNode when it stops breaking tests\n try{\n callback.call(callbackContext, foundNode, path, ancestors );\n } catch(e) {\n errorHappened(Error('Error thrown by callback ' + e.message));\n }\n } \n }", "title": "" }, { "docid": "3c5f864545349bcf35211d9d9849f0a1", "score": "0.52962035", "text": "function testme(a, b, c) {\n\n console.log(\"a, b, c = \"+a+\", \"+b+\", \"+c);\n\n var x = 0, y = 0, z = 0;\n\n if (a) {\n x = -2;\n }\n if (b < 5) {\n if (!a && c) {\n y = 1;\n if (a) {\n y = 2*y;\n }\n }\n z = 2;\n }\n\n if (x + y + z === 3) {\n console.log(\"Sum is 3\");\n throw new Error(\"************** Test failed *************\");\n } else {\n console.log(\"Sum is not 3\");\n }\n}", "title": "" }, { "docid": "f835885fe36de78cf05ff863cb23e2c3", "score": "0.52921945", "text": "function test1()\n{\n\tif(typeof DummyServer === \"undefined\")\n\t{\n\t\treturn true;\t\n\t}\n\t\n\treturn \"DummyServer undefined\";\n}", "title": "" }, { "docid": "40718274299f8407a6a0b2dbda37c075", "score": "0.52908355", "text": "function mockActive(data) { return data == 1 ? 'Yes' : 'No'; }", "title": "" }, { "docid": "e2352388d3c10e21bcd2ba7fdf6455ea", "score": "0.5281848", "text": "function UnitTest() {}", "title": "" }, { "docid": "59a61df24d3a26ccd3d5ac0b8b73e73f", "score": "0.527683", "text": "function doCheck() { return false; }", "title": "" }, { "docid": "c04ac950b5cf78a8504f46b940b89916", "score": "0.52763164", "text": "function isTesting() {\n var internalData = server.GetUserInternalData({ PlayFabId: currentPlayerId, Keys: [\"Testing\"] }); \n var data = internalData[DATA]; \n var isTesting = false;\n\n if (data.hasOwnProperty(\"Testing\")) {\n var value = data[\"Testing\"];\n isTesting = value[VALUE] == \"true\";\n }\n \n log.info(\"Account Test Status: \" + isTesting);\n\n return isTesting;\n}", "title": "" }, { "docid": "164b9ea5d208a73bd54412d279914b33", "score": "0.52739364", "text": "isAnswerFail(checkAnswer){\t\n if(checkAnswer.passFail === \"fail\"){\n\t return true;\n } \n }", "title": "" }, { "docid": "0335dad48c434dca0b361a182608dd9e", "score": "0.52729493", "text": "function assertEquals() {\n ;\n}", "title": "" }, { "docid": "6db1c3feb96f9501693219924d13ebfe", "score": "0.52677834", "text": "static matches(e)\n {\n return false;\n }", "title": "" }, { "docid": "7738a0c706675f4cc61ffec4bebe194e", "score": "0.5267722", "text": "Check() {\n\n }", "title": "" }, { "docid": "1d2872fffce38eaab0fb3a5cde4c102c", "score": "0.5255695", "text": "objIs( tested, argsObj ){\n\t\tfor( let i in argsObj ){\n\t\t\tif( tested[i] != argsObj[i] )\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "26996ebe411e9b2538d5730393645ead", "score": "0.5238679", "text": "function createMultiplePropertyTest(testFunc) {\r\n return function(o, props) {\r\n var i = props.length;\r\n while (i--) {\r\n if (!testFunc(o, props[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n }", "title": "" }, { "docid": "26996ebe411e9b2538d5730393645ead", "score": "0.5238679", "text": "function createMultiplePropertyTest(testFunc) {\r\n return function(o, props) {\r\n var i = props.length;\r\n while (i--) {\r\n if (!testFunc(o, props[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n }", "title": "" }, { "docid": "8a59b34b256a7c3d1199f5b99cbf1123", "score": "0.523536", "text": "function createMultiplePropertyTest(testFunc) {\r\n return function (o, props) {\r\n var i = props.length;\r\n while (i--) {\r\n if (!testFunc(o, props[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n }", "title": "" }, { "docid": "bbd5b8dd849125153f6a9545a4ef2d58", "score": "0.52249414", "text": "function test() { return('testing salesDays module'); }", "title": "" }, { "docid": "72164600b8041339191c5df98f22208a", "score": "0.521775", "text": "function testLoop(funcToCall, errMsg) {\n\t\t\t\tvalueA.setValue(\"six\");\n\t\t\t\tattrib.setValue(\"six\");\n\t\t\t\tcallFunc(funcToCall, attrib, valueA);\n\t\t\t\tcallFunc(funcToCall, valueA, attrib);\n\t\t\t\tvalueA.setValue(\"seven\");\n\t\t\t\t$A.test.assertEquals(\"seven\", attrib.getValue(), errMsg);\n\t\t\t\t// clean up\n\t\t\t\tattrib.unobserve(valueA);\n\t\t\t}", "title": "" }, { "docid": "7f3a8b77c13fe30c71da95af8861b482", "score": "0.52167386", "text": "function testFunction(a, b) {\n if(a===30 && b===30) {\n return true;\n \n }if (a+b===30) {\n return true;\n }else{\n return false;\n }\n }", "title": "" }, { "docid": "9556ea0e34deffeed53bc62023ae945c", "score": "0.52075773", "text": "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "title": "" }, { "docid": "9556ea0e34deffeed53bc62023ae945c", "score": "0.52075773", "text": "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "title": "" }, { "docid": "9556ea0e34deffeed53bc62023ae945c", "score": "0.52075773", "text": "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "title": "" }, { "docid": "9556ea0e34deffeed53bc62023ae945c", "score": "0.52075773", "text": "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "title": "" }, { "docid": "9556ea0e34deffeed53bc62023ae945c", "score": "0.52075773", "text": "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "title": "" }, { "docid": "9556ea0e34deffeed53bc62023ae945c", "score": "0.52075773", "text": "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "title": "" }, { "docid": "65363e3641a06ad906ba529f94eba67a", "score": "0.52036095", "text": "\"test If simple 'get' call is pruned by the generator\"() {\n // Fake \"qx.test.bool_true\" to be false at run time.\n qx.core.Environment.getChecks()[\"qx.test.bool_true\"] = function () {\n return false;\n };\n // Under optimization, the .get call will have been gone at run time.\n var a = qx.core.Environment.get(\"qx.test.bool_true\");\n this.assertEquals(true, a);\n }", "title": "" }, { "docid": "9bf83361504df0cca89b3751d3d545df", "score": "0.52003515", "text": "function testCalculator(a, b) {\n var calculator = new Calculator();\n\n if (typeof(calculator.sum(a, b)) === 'number') {\n console.log('Ok! chequea si son numeros');\n if (calculator.sum(a, b) === a + b) {\n console.log('SUM ok!' + 'Test: ' + calculator.sum(a, b) + '/ Should be: ' + (a + b));\n } else {\n console.log('SUM failed: ' + calculator.sum(a, b) + '. Result should be ' + (a + b));\n }\n\n if (calculator.sub(a, b) === a - b) {\n console.log('SUB ok!' + 'Test: ' + calculator.sub(a, b) + '/ Should be: ' + (a - b));\n } else {\n console.log('SUB failed: ' + calculator.sub(a, b) + '. Result should be ' + (a - b));\n }\n\n if (calculator.div(a, b) === a / b) {\n console.log('DIV ok!' + 'Test: ' + calculator.div(a, b) + '/ Should be: ' + (a / b));\n } else {\n console.log('DIV failed: ' + calculator.div(a, b) + '. Result should be ' + (a / b));\n }\n\n if (calculator.mul(a, b) === a * b) {\n console.log('MUL ok!' + 'Test: ' + calculator.mul(a, b) + '/ Should be: ' + (a * b));\n } else {\n console.log('MUL failed: ' + calculator.mul(a, b) + '. Result should be ' + (a * b));\n }\n } else if (calculator.sum(a, b) === 'ERROR') {\n console.log('El chequeo ha funcionado. Ha detectado el error');\n\n } else {\n console.log('El chequeo de numeros ha fallado! La funcion acepta NaN');\n }\n}", "title": "" }, { "docid": "a321eeff63ce832f729c61821247c419", "score": "0.51971513", "text": "test() {\n }", "title": "" }, { "docid": "9ebd6a270ecfabe6df60ab9a94ab564e", "score": "0.5197138", "text": "function TestValue() {}", "title": "" }, { "docid": "0cf40ef80fbb90368fd02c2444ef7477", "score": "0.51967025", "text": "function is(args, type, testFn){\n\t\ttestFn || (testFn = function(o){return typeof o === type;})\n\n\t\tvar isValid = true;\n\t\tfor(var i=0; i < args.length; i++){\n\t\t\tif(testFn(args[i]) !== true){\n\t\t\t\tisValid = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn isValid;\n\t}", "title": "" }, { "docid": "9e2749a92fe658139fc5142c15b65eff", "score": "0.51951694", "text": "isAnswerPass(checkAnswer){\t\n if(checkAnswer.passFail === \"pass\"){\n\t return true;\n } \n }", "title": "" }, { "docid": "281d9b6f22dc439d50de7d2c3ccff65b", "score": "0.5194944", "text": "isDone() {\r\n return this.total == this.passed + this.failed + this.missed;\r\n }", "title": "" }, { "docid": "1eb7a86a832170e2b20e4b530d3fd5f4", "score": "0.5191759", "text": "function TestMethods() {}", "title": "" }, { "docid": "9b597c65e76c66c869952762b0a81ede", "score": "0.5178714", "text": "static meetsCondition(receivedText) {\n logger.error(`Not implemented meetsCondition: ${ receivedText }`);\n return false;\n }", "title": "" }, { "docid": "0ba5877ba505397e6a9659729973fb07", "score": "0.517592", "text": "function dummy() {\n return false;\n}", "title": "" }, { "docid": "f986bc2c933aa1e44ef8940a4e3af670", "score": "0.5173743", "text": "function trueCondition() {\n let condition = true;\n // return condition;\n testCondition(condition)\n}", "title": "" }, { "docid": "314e80c4ce13019a339a30df39e0b53a", "score": "0.5156276", "text": "isValid(){\n\t\treturn true;\n\t}", "title": "" }, { "docid": "a1c2d2d7c04ba71677c19ad9654db5f4", "score": "0.51559335", "text": "_check(){\n //if(!this.wasOrdered) console.warn('Was not ordered!');\n //if(!this.wasPacked) console.warn('Was not packed!');\n }", "title": "" }, { "docid": "9bbf263f0d2d60f15e1ec0af0a6c9fb2", "score": "0.51531243", "text": "static function methodRequiresOneSpecialRow() {\n\t\treturn (method == 1);\n\t}", "title": "" }, { "docid": "e0903d5727fe7f8b1191a42baa80488c", "score": "0.5151615", "text": "isValidRecord(){ /** todo */ }", "title": "" }, { "docid": "4427d12ee2d1282f6bccf176e4cf028c", "score": "0.51407", "text": "function testStart(data){\n //console.log(\"testing ready\")\n readyPlayers[data.playerId] = data.ready;\n for(let player in readyPlayers){\n if(!player) return false\n }\n return true\n}", "title": "" }, { "docid": "111fb49d4abe120a260b3ced369e8c80", "score": "0.51367754", "text": "function RunTests() {\n\n var storeIds = [175, 42, 0, 9]\n var transactionIds = [9675, 23, 123, 7]\n\n storeIds.forEach(function (storeId) {\n transactionIds.forEach(function (transactionId) {\n var shortCode = generateShortCode(storeId, transactionId);\n var decodeResult = decodeShortCode(shortCode);\n $(\"#test-results\").append(\"<div>\" + storeId + \" - \" + transactionId + \": \" + shortCode + \"</div>\");\n AddTestResult(\"Length <= 9\", shortCode.length <= 9);\n AddTestResult(\"Is String\", (typeof shortCode === 'string'));\n AddTestResult(\"Is Today\", IsToday(decodeResult.shopDate));\n AddTestResult(\"StoreId\", storeId === decodeResult.storeId);\n AddTestResult(\"TransId\", transactionId === decodeResult.transactionId);\n })\n })\n}", "title": "" }, { "docid": "1924d732dc675a10819837793fbc403a", "score": "0.5125832", "text": "beTrue(){\n\t\tthis.callback('pre');\n\t\tthis.assertions.last().b = true;\n\t\tthis.assertions.last().result = !!this.assertions.last().a;\n\t\tthis.assertions.last().assertion = 'Expected ' + this.assertions.last().a + ' to be true.';\n\t\tthis.callback('post');\n\t\tif (this.verbose) this.result(this.assertions.last());\n\t}", "title": "" }, { "docid": "d0e32db76acfc87773ca6e1bf3d9ebf9", "score": "0.5122708", "text": "function checkHash(currentHash) {\n\t\t//hacky, but works?\n\t\tif (/front-office\\/reservations\\/id\\//gm.test(currentHash)) {\n\t\t\tcurrentHash = \"reservations\";\n\t\t}\n\t\tvar fn;\n\t\t//abusing object literals to keep from having to write an ugly switch block\n\t\tvar tests = {\n\t\t\t'#/sales-and-marketing/marketing/guest': function () {\n\t\t\t\twatch(marketingEmails);\n\t\t\t},\n\t\t\t'#/front-office/supervisor/reports/reservations-by-operator': function () {\n\t\t\t\twatch(walkIn);\n\t\t\t},\n\t\t\t'reservations': function () {\n\t\t\t\twatch(reservationScreen);\n\t\t\t}\n\t\t};\n\t\t//object literal abuse here\n\t\tif (tests[currentHash]) {\n\t\t\tfn = tests[currentHash];\n\t\t} else {\n\t\t\tfn = function () {\n\t\t\t\t// console.log(\"Not in tests\");\n\t\t\t};\n\t\t}\n\t\treturn fn();\n\n\t}", "title": "" } ]
34cd0a828f0368844b0d164e5d372c36
Unsupported. Use `subscribeTopic()` instead.
[ { "docid": "33ce65a5487a79496e49df8a422e79fd", "score": "0.8836555", "text": "subscribe() {\n return (0, _errors.unsupported)(`use subscribeTopic() instead`);\n }", "title": "" } ]
[ { "docid": "d801d9796c7b51ffde8fedb2d270e93e", "score": "0.7572736", "text": "sub(topic) {\n console.log(\"Subscribing on topic \" + topic);\n this.client.subscribe(topic);\n }", "title": "" }, { "docid": "d06a537432ad2d5fd175c7fabc9d06bd", "score": "0.74454534", "text": "transform() {\n return (0, _errors.unsupported)(`use subscribeTopic() instead`);\n }", "title": "" }, { "docid": "4d54eb35e7f53e36aa7486bcd00319b8", "score": "0.7262699", "text": "function subscribe(topic) {\n if (!client) { throw new Error(\"Need to Initialize Mqtt\")}\n if (!topic) { throw new Error(\"Need to define a topic\")}\n\n client.subscribe(topic)\n }", "title": "" }, { "docid": "7094e417694cc46a6aad89554805d3da", "score": "0.7090895", "text": "subscribe(...args) {\n // AppUtil.debug(`${args}`, `${Constants.MODULE}: subscribe`);\n // args atleast should have length 1 (topic)\n if (args.length <= 0) {\n AppUtil.debug('Invalid args passed', null);\n return;\n }\n Meteor.subscribe.apply(null, args);\n }", "title": "" }, { "docid": "ca2027303fc86040fbd03d6ac750405d", "score": "0.7003096", "text": "function subscribe() {\n console.log('Subscribing client ' + clientId + ' to topic: ' + topics.subscribe);\n client.subscribe(topics.subscribe);\n isSubscribed = true;\n}", "title": "" }, { "docid": "8a5aa0f4f76626f03e88f8134aa3e301", "score": "0.6897618", "text": "subscribe() {}", "title": "" }, { "docid": "8a5aa0f4f76626f03e88f8134aa3e301", "score": "0.6897618", "text": "subscribe() {}", "title": "" }, { "docid": "8a5aa0f4f76626f03e88f8134aa3e301", "score": "0.6897618", "text": "subscribe() {}", "title": "" }, { "docid": "0e8995eeefa7c4327860fd755785573f", "score": "0.6789486", "text": "async subscribeToTopic(ctx, topicNumber, newSubscriber) {\n console.info('============= START : Subscribe to a Topic ===========');\n\n const topicAsBytes = await ctx.stub.getState(topicNumber); // get the topic from chaincode state\n if (!topicAsBytes || topicAsBytes.length === 0) {\n throw new Error(`${topicNumber} does not exist`);\n }\n const topic = JSON.parse(topicAsBytes.toString());\n topic.subscribers.push(newSubscriber);\n\n await ctx.stub.putState(topicNumber, Buffer.from(JSON.stringify(topic)));\n console.info('============= END : Subscribe to a Topic ===========');\n }", "title": "" }, { "docid": "63f22ae7f77541ed527fe571e41d300d", "score": "0.6747374", "text": "subscribeToPlatformMqtt(callback) {\n this.subscribe(\"localhost\", PLATFORM_MQTT_TOPIC, callback);\n }", "title": "" }, { "docid": "fd585446780bd1fae1ef052e37a23797", "score": "0.6738963", "text": "subscribeTopic(ctx, store, callback) {\n if (ctx.client._managed_session) {\n this.stack.execute('storeSubscription', ctx, callback);\n } else {\n callback();\n }\n }", "title": "" }, { "docid": "3ed25664cf781f2893c010487b713979", "score": "0.67084306", "text": "function subscribe(topic) {\n kip.debug('subscribing to topic:', topic);\n if (!topics[topic] || !topics[topic].publish) {\n throw new Error(`pub/sub topic \"${topic}\" does not exist`);\n }\n\n var name = process.env.NODE_ENV === 'production' ? topic : topic + '-test';\n\n return rx.Observable.create(observer => {\n var options = {\n ackDeadlineSeconds: 100,\n interval: 1000, // interval in milliseconds to check for new messages\n maxInProgress: 10, // Maximum messages to consume simultaneously\n reuseExisting: true, // If the subscription already exists, reuse it.\n }\n topics[topic].subscribe(name, options, (err, sub) => {\n if (err) throw new Error(err);\n // pass the message from google pub/sub to the rxjs observable\n sub.on('message', m => {\n observer.onNext(m);\n });\n\n sub.on('error', kip.err);\n })\n })\n}", "title": "" }, { "docid": "4e5915b164144221b6c9579c284f3ea6", "score": "0.66970426", "text": "function mqttSub(topic, callback) {\n if (typeof callback === 'function') {\n if (!mqttCallbacks[topic]) {\n mqttCallbacks[topic] = [callback];\n log.debug('mqtt subscribe', topic);\n mqtt.subscribe(topic);\n } else {\n mqttCallbacks[topic].push(callback);\n }\n } else {\n log.debug('mqtt subscribe', topic);\n mqtt.subscribe(topic);\n }\n}", "title": "" }, { "docid": "e0996cfc450b416386718a378f80df0e", "score": "0.66784", "text": "subscribe(topic, func) {\n if (!this._topics[topic]) {\n this._topics[topic] = [];\n }\n\n var token = (++this._subUid).toString();\n this._topics[topic].push({\n token: token,\n func: func\n });\n\n return token;\n }", "title": "" }, { "docid": "039eb5e5944dc7c8790cfb69be9b99e6", "score": "0.6563013", "text": "function subscribe() {\n\t console.log(\"Subscribed to \" + config.number);\n pubnub.subscribe({\n restore : true,\n channel : config.number,\n message : receive,\n disconnect : disconnectcb,\n reconnect : reconnectcb,\n connect : function() { onready(true) }\n });\n }", "title": "" }, { "docid": "d8d5706d47ba17c95c13aaf8568f3fdd", "score": "0.6551433", "text": "subscribe(ip, topic, callback) {\n const client = this._getMqttClient(ip);\n\n const callbackMap = this._getCallbackMap(ip);\n\n // if there is a callback list for the topic, append this callback to it\n if(callbackMap.hasOwnProperty(topic)) {\n callbackMap[topic].push(callback);\n } else {\n // otherwise, add a new callback list\n callbackMap[topic] = [callback];\n\n // subscribe to the mqtt topic\n client.subscribe(topic);\n }\n }", "title": "" }, { "docid": "a037735fd56e3504c38712a69e1ffd1b", "score": "0.6491728", "text": "subscribe(topic, options = {}) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(!this.connected) {\n\t\t\t\treturn reject(new Error('not connected to broker'));\n\t\t\t}\n\n\t\t\toptions = extend({\n\t\t\t\tqos: 0\n\t\t\t}, options);\n\n\t\t\ttopic = this._normalizeTopic(topic);\n\t\t\tthis._mqttClient.subscribe(topic, options, (err, granted) => {\n\t\t\t\tif(err) return reject(err);\n\t\t\t\treturn resolve(granted);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "856a23b0290a7874279eb0cb7a4d163d", "score": "0.64824486", "text": "function subscribe(topic, func){\n\n if(!topics[topic]) {\n topics[topic] = [];\n }\n\n // A token denotes the callback function.\n let token = subId.toString(10);\n\n topics[topic].push({\n token,\n func\n });\n\n return token;\n}", "title": "" }, { "docid": "5e3fd02db4ec63e0cc2521f193f09b71", "score": "0.64301395", "text": "function Subscribable() {}", "title": "" }, { "docid": "262610d73b99a17c2ee5da40a88e3b94", "score": "0.64291835", "text": "subscribe(topic, listenerObj, callbackFct) {\n if (this.observers[topic] == undefined) {\n this.observers[topic] = new Array();\n }\n this.observers[topic].push({\n obj: listenerObj,\n fct: callbackFct,\n });\n }", "title": "" }, { "docid": "669ffbb39fc9972f4caac95307346678", "score": "0.63977915", "text": "function onMHSubscribe(topic, container) {\n\t\tconsole.debug(\" Sub2 function onMHSubscribe(\"+topic+\", \"+container+\") {...\");\n\t\tconsole.debug(\" Sub3 Approving all subscribe requests!!!\"); \n\t\treturn true;\t\t\n\t}", "title": "" }, { "docid": "9f6b6c2c09b9fd72ee27648fcef5a4a5", "score": "0.63812524", "text": "subscribe(listenerCallback, publisherId, context) {\n if (!publisherId) {\n const publisherIds = this.props.configs.pubsub.publishers;\n if (publisherIds && Array.isArray(publisherIds)) {\n publisherIds.forEach(id => this.props.pubSubHub.subscribe(id, listenerCallback));\n }\n } else {\n this.props.pubSubHub.subscribe(publisherId, listenerCallback, context);\n }\n }", "title": "" }, { "docid": "a482807c96901af054c878366439d91b", "score": "0.6363758", "text": "function subscribe () {\n pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(SAFE_APPLICATION_SERVER_KEY)\n })\n .then(function (subscription) {\n console.log('Subscribed!')\n pushSubscription = subscription;\n updateSubscriptionUI(subscription);\n })\n .catch(function (error) {\n console.log('Error occured while subscribing');\n console.error(error);\n updateSubscriptionUI(pushSubscription);\n });\n}", "title": "" }, { "docid": "c67d2288ca0fc0271b19eb64f955b0fe", "score": "0.6357993", "text": "subscribe(name, endpoint, protocol) {\n new subscription_1.Subscription(this, name, {\n topic: this,\n endpoint,\n protocol\n });\n }", "title": "" }, { "docid": "bd8f6000e924eb2a3212a027535f3c8d", "score": "0.63563657", "text": "function subscribe() {\n nest.subscribe(subscribeDone);\n}", "title": "" }, { "docid": "4ef01a608258361f4d6b1004aa740288", "score": "0.63423187", "text": "subscribe(resource, callback) {\n if (this.subscribers[resource]) {\n // We are already subscribed on the server.\n return Promise.resolve(this.subscribers[resource].push({\n callback: callback,\n id: this.subscribers[resource][0].id\n }));\n }\n // We need to subscribe on the server.\n return this.request({ method: 'subscribe', url: resource }).then((response) => {\n // If the subscription failed, we abort.\n if (response.code !== 200) {\n return (Promise.reject(response));\n }\n // Creating subscription for the topic.\n if (!this.subscribers[resource]) {\n this.subscribers[resource] = [];\n }\n // Registering the subscription callback.\n this.subscribers[resource].push({\n callback: callback,\n id: response.payload.id,\n });\n // If the ping `timer` is not armed, schedule it. \n if (!this.timer) this.timer = setInterval(schedulePing.bind(this), this.pingInterval);\n return (Promise.resolve(response));\n });\n }", "title": "" }, { "docid": "e31b7a4d078dc770c1b72ea8936b713d", "score": "0.63342696", "text": "subscribe() {\n //\n }", "title": "" }, { "docid": "21bc1d034a7c5c6f4fd9099856b31662", "score": "0.63341486", "text": "subscribe() {\n\n }", "title": "" }, { "docid": "4816fe82fa13365aabd9c4056b27fb7c", "score": "0.6328473", "text": "subscribe() {\n this.subscription = this.pusher.subscribe(this.name);\n }", "title": "" }, { "docid": "c3a81849354f5aa259dc2c01ba54fa36", "score": "0.6310481", "text": "subscribe(fn) {\n this.subscribeFn = fn;\n }", "title": "" }, { "docid": "41e40053ba59fc04df06f2e0b134ffbe", "score": "0.63039505", "text": "subscribe(cb = () => {\n }) {\n\n this._subscribers.push(cb);\n this._connection.send({\n action: 'topic_subscribe',\n payload: {\n name: this.name,\n }\n }).then(() => {\n // silent nothing to do , just wait for next data\n\n }).catch((err) => {\n return cb(err);\n });\n }", "title": "" }, { "docid": "dfd693e3b78c47886e754474c39c64e9", "score": "0.6302759", "text": "function mqtt_connect() {\n console.log(\"Connexion MQTT\");\n// Appel de la fonction de souscription\n client.subscribe(Topic, mqtt_subscribe);\n}", "title": "" }, { "docid": "9e6341d23902600be2658a1de9ec4df0", "score": "0.62878084", "text": "function subscribe(topic, listener) {\n var callback = listener;\n\n if (typeof topic !== 'string') {\n // first param should be callback function in this case,\n // meaning it gets called for any config change\n callback = topic;\n topic = ALL_TOPICS;\n }\n\n if (typeof callback !== 'function') {\n utils.logError('listener must be a function');\n return;\n }\n\n var nl = {\n topic: topic,\n callback: callback\n };\n listeners.push(nl); // save and call this function to remove the listener\n\n return function unsubscribe() {\n listeners.splice(listeners.indexOf(nl), 1);\n };\n }", "title": "" }, { "docid": "9c6c5b4bc7e91177f67138019ad7a7ab", "score": "0.6274654", "text": "subscribe() {\n Object.values(CHANNELS).forEach(channel => {\n this.subscriber.subscribe(channel); \n });\n }", "title": "" }, { "docid": "bce99938ebd4615098a9a20805fb6c26", "score": "0.6256851", "text": "function subscribe(cb) {\n var subscription;\n\n // Event handlers\n function handleMessage(message) {\n cb(null, message);\n }\n\n function handleError(err) {\n sentryClient.captureMessage(err);\n console.error(err);\n }\n\n getTopic(topicName, function(err, topic) {\n if (err) {\n return cb(err);\n }\n\n topic.subscribe(subscriptionName, {\n autoAck: true,\n reuseExisting: true\n }, function(err, sub) {\n if (err) {\n return cb(err);\n }\n\n subscription = sub;\n\n // Listen to and handle message and error events\n subscription.on('message', handleMessage);\n subscription.on('error', handleError);\n\n console.log('Listening to ' + topicName +\n ' with subscription ' + subscriptionName);\n });\n });\n\n // Subscription cancellation function\n return function() {\n if (subscription) {\n // Remove event listeners\n subscription.removeListener('message', handleMessage);\n subscription.removeListener('error', handleError);\n subscription = undefined;\n }\n };\n}", "title": "" }, { "docid": "8c5194ffc4a047c6e4af9b2c33886e59", "score": "0.624404", "text": "subscribe(onSubscribed) {\n this._onSubscribedCB = onSubscribed; \n\n this._channelsSDK.subscribe(this._channelID, (isOK) => {\n\n if (this._isResubscribing && isOK) {\n\n if (this._lastMessageTimestamp !== -1) {\n this.fetchEventsSince(this._lastMessageTimestamp).then((events) => {\n if (this._onMessage) {\n events.forEach((event) => this._onMessage(event));\n }\n });\n }\n\n this._channelsSDK._log(\"Re-Subscribed to \" + this._channelID);\n } else if (isOK) this._channelsSDK._log(\"Subscribed to \" + this._channelID);\n else this._channelsSDK._log(\"Failed to subscribe to \" + this._channelID);\n\n if (this._onSubscribedCB) {\n\n if (isOK) {\n this._isSubscribed = true;\n }\n\n this._channelsSDK._addSubscribed(this._channelID)\n this._onSubscribedCB(isOK);\n } \n });\n }", "title": "" }, { "docid": "cbb460b302f1da69819b10bc868b3f7d", "score": "0.62149274", "text": "subscribe() {\n // Exit if already subscribed or \n if (this._subscribed && this._client == null)\n return;\n this._logger.trace(null, \"Started listening messages at %s\", this.toString());\n this._client.on('message', (topic, message, packet) => {\n let envelop = this.toMessage(topic, message, packet);\n this._counters.incrementOne(\"queue.\" + this.getName() + \".received_messages\");\n this._logger.debug(message.correlation_id, \"Received message %s via %s\", message, this.toString());\n if (this._receiver != null) {\n try {\n this._receiver.receiveMessage(envelop, this, (err) => {\n if (err)\n this._logger.error(null, err, \"Failed to receive the message\");\n });\n }\n catch (ex) {\n this._logger.error(null, ex, \"Failed to receive the message\");\n }\n }\n else {\n // Keep message queue managable\n while (this._messages.length > 1000)\n this._messages.shift();\n // Push into the message queue\n this._messages.push(envelop);\n }\n });\n // Subscribe to the topic\n this._client.subscribe(this._topic, (err) => {\n if (err)\n this._logger.error(null, err, \"Failed to subscribe to topic \" + this._topic);\n });\n this._subscribed = true;\n }", "title": "" }, { "docid": "c1e8fb7c545dfdd071d04d8cee0f6b20", "score": "0.62141466", "text": "subscribeMC() {\r\n try {\r\n if (this.subscription) {\r\n return;\r\n }\r\n this.subscription = subscribe(\r\n this.messageContext,\r\n CMC,\r\n (message) => this.handleMessage(message),\r\n { scope: APPLICATION_SCOPE }\r\n );\r\n } catch (error) {\r\n console.log('ERROR en suscripcion ', error);\r\n }\r\n }", "title": "" }, { "docid": "f1ff5150f4c684518c4cb7a771fa26aa", "score": "0.62016535", "text": "function onConnect(){\n console.log(\"Connected!\");\n client.subscribe(topic);\n }", "title": "" }, { "docid": "bb0f2b57201412360fff760f5c18ad0a", "score": "0.619976", "text": "function subscribe(topic, listener) {\n var callback = listener;\n\n if (typeof topic !== 'string') {\n // first param should be callback function in this case,\n // meaning it gets called for any config change\n callback = topic;\n topic = ALL_TOPICS;\n }\n\n if (typeof callback !== 'function') {\n utils.logError('listener must be a function');\n return;\n }\n\n listeners.push({ topic: topic, callback: callback });\n\n // save and call this function to remove the listener\n return function unsubscribe() {\n listeners.splice(listeners.indexOf(listener), 1);\n };\n }", "title": "" }, { "docid": "bb0f2b57201412360fff760f5c18ad0a", "score": "0.619976", "text": "function subscribe(topic, listener) {\n var callback = listener;\n\n if (typeof topic !== 'string') {\n // first param should be callback function in this case,\n // meaning it gets called for any config change\n callback = topic;\n topic = ALL_TOPICS;\n }\n\n if (typeof callback !== 'function') {\n utils.logError('listener must be a function');\n return;\n }\n\n listeners.push({ topic: topic, callback: callback });\n\n // save and call this function to remove the listener\n return function unsubscribe() {\n listeners.splice(listeners.indexOf(listener), 1);\n };\n }", "title": "" }, { "docid": "020f4ba47cfcff664d2d4acc1d0431a3", "score": "0.61776924", "text": "function subscribe(topic, element, listenerfn) {\n\n var subscriber = {\n topic : topic,\n element : $(element),\n listenerfn : listenerfn\n };\n\n subscribers.push(subscriber);\n purgePublisherCache(subscriber.topic);\n\n // To prevent memory leaks via closure:\n\n topic = null;\n element = null;\n listenerfn = null;\n\n // Return a function to unsubscribe\n return function() {\n subscribers = _.without(subscribers, subscriber);\n purgePublisherCache(subscriber.topic);\n }\n }", "title": "" }, { "docid": "f7a19129ded64607cd6f9b5647beecf3", "score": "0.6146914", "text": "function Topic ()\n {\n // ====================================================================\n // Initialization\n\n // singleton implementation\n if ( arguments.callee._singletonInstance )\n return arguments.callee._singletonInstance;\n arguments.callee._singletonInstance = this;\n\n // ====================================================================\n // Public members\n \n this.subscribe = function subscribe ( a_object, a_topic )\n {\n // create new topic\n if( !_subscribers[ a_topic ] ){\n _subscribers[ a_topic ] = [];\n }\n\n _subscribers[ a_topic ].push( a_object );\n\n // create an id for the object so it can be unsubscribed easier\n if( !a_object.id )\n a_object.id = _.uniqueId();\n };\n\n this.unsubscribe = function unsubscribe ( a_object, a_topic )\n {\n var unsubscribed = 0;\n\n if( !_subscribers[ a_topic ] ){\n return unsubscribed;\n }\n\n _.each( _subscribers[ a_topic ], function( item, index, list ){\n // find the subscriber object by its ID\n if( item.id === a_object.id ){\n list.splice( index, 1 );\n unsubscribed++;\n }\n });\n\n // return number of unsubscribed objects\n return unsubscribed;\n };\n\n this.publish = function publish ( a_topic, a_data )\n {\n if( !_subscribers[ a_topic ] ){\n return;\n }\n\n // notify all _subscribers\n _.each( _subscribers[ a_topic ], function( item, index, list )\n {\n // if object supports it update it with the passed data\n if( item.update ){\n item.update( a_topic, a_data );\n }\n });\n };\n\n // ====================================================================\n // Private members\n\n var _subscribers = {};\n\n return this;\n }", "title": "" }, { "docid": "c29b20cc91996a62b23efc68252c7a1e", "score": "0.6128863", "text": "subscribeToMessageChannel() {\n this.subscription = subscribe(\n this.messageContext,\n SAMPLEMC,\n (message) => this.handleMessage(message)\n \n );\n console.log('subscribed');\n }", "title": "" }, { "docid": "f449b4b91d3e52a7f93d6de67546a1f6", "score": "0.61209506", "text": "function Subscribable() {\n }", "title": "" }, { "docid": "1002f4ef51d03c63c54a6e65920b7ba6", "score": "0.61172456", "text": "_subscribe(eventType) {\n let subscribed = this._subscribed;\n if (subscribed.has(eventType)) return;\n subscribed.add(eventType);\n\n this._post({\n type: 'subscribe',\n data: { type:eventType },\n });\n }", "title": "" }, { "docid": "cf6a1d8f3dc3c50531100451b4510696", "score": "0.60928774", "text": "async subscribeStreams() {\n await this.changeSubscription(this.streamUrl, 'subscribe')\n }", "title": "" }, { "docid": "c35f0851bb7962a04671181a632dfff3", "score": "0.6090167", "text": "subscribe () {\n\n let subscribe = this.props.source.subscribe;\n\n // If passed a function, run it to get the result\n if (typeof subscribe === 'function') {\n subscribe = subscribe.call(this);\n }\n\n // If we've requested server side pagination, then we must have\n // control of the subscription, as we pass pagination data in the\n // arguments of a subscription\n const failIfServerSidePagination = () => {\n if (this.serverSidePagination()) {\n throw new Error(\"Can't use server side pagination without controlling the subscription\");\n }\n };\n\n // Return a fake \"subscription-like\" object if we don't know\n // anything about the subscription\n if (typeof subscribe === 'undefined' || subscribe === null) {\n failIfServerSidePagination();\n return { ready: () => true };\n }\n\n // If we were passed a subscription or a function which\n // returned one, then return that.\n if (typeof subscribe === 'object' &&\n typeof subscribe.stop === 'function' &&\n typeof subscribe.ready === 'function' &&\n subscribe.hasOwnProperty('subscriptionId')\n ) {\n failIfServerSidePagination();\n return subscribe;\n }\n\n // If we reach here then we know we have to handle subscriptions\n // internally.\n\n let context, name, args;\n\n let additionalArgs = (orig, additional) => {\n return [].concat(orig).concat(additional);\n };\n\n if (typeof subscribe === 'object') {\n context = subscribe.context || Meteor;\n name = subscribe.name;\n args = subscribe.args || [];\n additionalArgs = subscribe.additionalArgs || additionalArgs;\n if (typeof args === 'function') {\n args = args.call(this);\n }\n } else if (typeof subscribe === 'string') {\n context = Meteor;\n name = subscribe;\n args = [];\n } else {\n throw \"Bad subscribe type: \" + typeof(subscribe);\n }\n\n (() => {\n let arg = {\n selector: this.selector(),\n options: this.subscribeOptions(),\n };\n if (!Array.isArray(args)) {\n args = [ args ];\n }\n args = additionalArgs(args, arg);\n })();\n\n return context.subscribe.call(context, name, ...args, {\n onStop: err => { err && this._onStopVar.set(true) },\n });\n }", "title": "" }, { "docid": "39922ba789719fc6e7bd111eb1d5dc86", "score": "0.6089145", "text": "function invokeSubscribePubSubCallback(subscribeMessage) {\n var callbacks = mapPubSubResponders[subscribeMessage.header.topic];\n //@todo consider removing this log. Why log it? Why not log it _onlY_ if the dev wants a particular message logged. This can cause problems.\n if (callbacks === undefined) { // if undefined then may be a matching RegEx topic\n for (var key in mapPubSubResponderRegEx) {\n if (mapPubSubResponderRegEx[key].test(subscribeMessage.header.topic)) {\n callbacks = mapPubSubResponders[key];\n var initialState = mapPubSubResponderState[subscribeMessage.header.topic]; // may already be initial state defined from publish\n if (initialState === undefined) { // if there isn't already state defined then use default from regEx\n initialState = mapPubSubResponderState[key]; // initialize the state from RegEx topic\n }\n mapPubSubResponderState[subscribeMessage.header.topic] = initialState;\n break;\n }\n }\n }\n if (callbacks === undefined) { // if still undefined\n Logger.system.warn(\"RouterClient: no pubsub responder defined for incoming subscribe\", subscribeMessage);\n }\n else {\n if (subscribeMessage.header.error) { // the router service uses the subscribe message in this case to return a pubsub error (ToDO: consider a generic error message)\n Logger.system.warn(\"RouterClient: pubsub error received from router service: \" + JSON.stringify(subscribeMessage.header.error));\n }\n else {\n subscribeMessage.sendNotifyToSubscriber = sendNotifyToSubscriber; // add callback function to message so pubsub responder can respond with Notify message\n if (callbacks.subscribeCallback) {\n subscribeMessage.data = mapPubSubResponderState[subscribeMessage.header.topic];\n callbacks.subscribeCallback(null, subscribeMessage); // invoke the callback (no error)\n }\n else { // since no subscribe callback defined, use default functionality\n subscribeMessage.sendNotifyToSubscriber(null, mapPubSubResponderState[subscribeMessage.header.topic]); // must invoke from message to set this properly\n }\n }\n }\n }", "title": "" }, { "docid": "bcdc3b1dd4b3f3085ce7c43493be3fda", "score": "0.6088451", "text": "function subscribe(subscribeToResource) {\n if (!subscribe.hasBeen) {\n subscribeToResource('uptime');\n }\n\n subscribe.hasBeen = true;\n}", "title": "" }, { "docid": "f9a0cc90577535d755986ea218e62c84", "score": "0.607096", "text": "function addObserver(aTopic)\n{\n if (gActiveTopics.indexOf(aTopic) < 0)\n {\n gObsService.addObserver(gObserver, aTopic, false);\n gActiveTopics.push(aTopic);\n }\n}", "title": "" }, { "docid": "5a6f6d14c5a3b1b443599ca01d0c2d21", "score": "0.6065458", "text": "topic(/*envelope, ...strings*/) {\n\t\tif (DEBUG) { return console.log('ROCKETCHATADAPTER -> topic'.blue); }\n\t}", "title": "" }, { "docid": "05ba32670e61350ef042306030f9e45a", "score": "0.60554", "text": "function subscribeRPCTopic(){\n \n messageSender.subscribe(utils.rpcReqTopic, {qos: 1}, function() {\n // Response it as a callback\n console.log(colors.yellow('[Flow #2] Successfully Subscribe the RPC topic to Smart[Fleet] Platform'));\n console.log(colors.yellow(''));\n \n });\n }", "title": "" }, { "docid": "4f54592218175c5820bf8a5bc6b40547", "score": "0.6047576", "text": "function authorizeSubscribe(client, topic, callback) {\n if(endsWith(topic, '_bc') || endsWith(topic, '_tb') ||\n (client.skynetDevice &&\n ((client.skynetDevice.uuid === 'skynet') || (client.skynetDevice.uuid === topic)))){\n callback(null, true);\n }else{\n callback('unauthorized');\n }\n }", "title": "" }, { "docid": "1646c4fc4c3a7570be6e173df771c6ae", "score": "0.6046483", "text": "subscribeToChannels() {\n Object.values(CHANNELS).forEach((channel) => {\n this.subscriber.subscribe(channel);\n });\n }", "title": "" }, { "docid": "fb89232cd183db5a22a86da6ca6223ac", "score": "0.6045273", "text": "function subscribe() {\n swRegistration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlB64ToUint8Array(applicationKey)\n })\n .then((resSubscription) => {\n console.log(resSubscription);\n console.log('User is subscribed');\n\n saveSubscription(resSubscription);\n\n isSubscribed = true;\n })\n .catch((err) => {\n console.log('Failed to subscribe user: ', err);\n });\n}", "title": "" }, { "docid": "9933cf73502b5d84ab1dff5c01149dc8", "score": "0.6008629", "text": "function onConnect() {\r\n // Fetch the MQTT topic from the form\r\n subscribeTopic = \"#\"; //document.getElementById(\"topic\").value;\r\n\r\n // Print output for the user in the messages div\r\n document.getElementById(\"messages\").innerHTML += '<span class=\"websocket-message-info\">Subscribing to: ' + subscribeTopic + '</span><br/>';\r\n\r\n // Subscribe to the requested topic\r\n client.subscribe(subscribeTopic);\r\n\r\n connected = true;\r\n}", "title": "" }, { "docid": "760267bf3b2a547920253139c6381a01", "score": "0.6008339", "text": "function topicAuth (spark, topic, callback) {\r\n\r\n // if you decide to refuse the subscription...\r\n // return callback({ statusCode : httpstatus.UNAUTHORIZED, message : 'Not authorized to subscribe to this topic' });\r\n\r\n // if you decide to allow the subscription...\r\n return callback();\r\n}", "title": "" }, { "docid": "374ee698c7b6a4799ad64f9e64a389f1", "score": "0.6003889", "text": "tnInitFind() {\n const fnd = this.tinode.getFndTopic();\n fnd.onSubsUpdated = this.tnFndSubsUpdated;\n if (fnd.isSubscribed()) {\n this.tnFndSubsUpdated();\n } else {\n fnd.subscribe(fnd.startMetaQuery().withSub().build()).catch((err) => {\n this.handleError(err.message, 'err');\n });\n }\n }", "title": "" }, { "docid": "ab9ca1bd275dfbb63f35a3a55ceff350", "score": "0.60001445", "text": "function whenConnected() {\n startSubscriber();\n}", "title": "" }, { "docid": "f598b03a90cdd1c6f5651c4a99856a13", "score": "0.59900856", "text": "function Connected() {\n console.log(\"Connected\");\n mqttClient.subscribe(subscription);\n}", "title": "" }, { "docid": "9d2bcb13e019635766b5dedbc131546b", "score": "0.5989085", "text": "function pubSubTest() {\n clientInstance.core_subscribe(\"/wisepaas/test/\", 0);\n\n setTimeout(() => {\n console.log(\"Sending test message...\");\n clientInstance.core_publish(\"/wisepaas/test/\", \"{\\\"Test\\\":{\\\"test1\\\":246,\\\"test2\\\":true}}\");\n }, 5000);\n}", "title": "" }, { "docid": "e169fac7f48ccb421914d34086a05cf0", "score": "0.59866136", "text": "processMessageTopic (message) {\n console.assert(message.parameters[0])\n let channel = this.getChannelFromName(message.parameters[0])\n console.assert(message.parameters[1] !== undefined) // Empty string is allowed.\n channel.topicChanged(message.source, message.parameters[1])\n }", "title": "" }, { "docid": "e9822e9e4d5fd43d39c0ec1be48758ca", "score": "0.5958921", "text": "function subscribe() {\n if (!gSelectedServer) {\n return;\n }\n if (gSelectedServer.type == \"rss\") {\n window.browsingContext.topChromeWindow.openSubscriptionsDialog(\n gSelectedServer.rootFolder\n );\n } else {\n window.browsingContext.topChromeWindow.MsgSubscribe(gSelectedFolder);\n }\n}", "title": "" }, { "docid": "422eb9b62f33b579c7a739f5da02908d", "score": "0.5951184", "text": "if (this.props.isActive && !this.isSubscribed) {\n this.autosubscribe()\n }", "title": "" }, { "docid": "541792421a884d16b761387ecc23c10d", "score": "0.5943487", "text": "handleSubscribe() {\n\t\t// Callback invoked whenever a new event message is received\n\t\tconst messageCallback = (response) => {\n\t\t\tconsole.log('New message received : ', JSON.stringify(response));\n\t\t\t// Response contains the payload of the new message received\n\t\t\tthis.removeMap();\n\t\t};\n\n\t\t// Invoke subscribe method of empApi. Pass reference to messageCallback\n\t\tsubscribe(this.channelName, -1, messageCallback).then(response => {\n\t\t\t// Response contains the subscription information on successful subscribe call\n\t\t\tconsole.log('Successfully subscribed to : ', JSON.stringify(response.channel));\n\t\t});\n\t}", "title": "" }, { "docid": "04f400e60c5a4f3ad5b753bb5d197f27", "score": "0.59368885", "text": "constructor () {\n this._pubsub = PubSub\n this.registry = new TopicRegistry()\n }", "title": "" }, { "docid": "d49c666b16f7cf4c20fde09ea14b8321", "score": "0.5931241", "text": "function deregister(subscription, unsubscribe, callback) {\r\n let error, err_msg;\r\n let parsed_topic = resolve_mqtt_topic(subscription);\r\n if (unsubscribe) {\r\n mqtt_client.unsubscribe(\r\n parsed_topic,\r\n function(error) {\r\n if (!error) {\r\n log.debug(parsed_topic, \"Deregistering topic \");\r\n delete mqtt_cfg[config.TOPICS][parsed_topic];\r\n if (callback) {\r\n callback(error);\r\n }\r\n } else {\r\n if (callback) {\r\n callback(error);\r\n } else {\r\n log.error(subscription, error);\r\n }\r\n }\r\n }\r\n );\r\n } else {\r\n if (callback) {\r\n callback(error);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "3a9034b7ce3c0384d9d7f44c62e7c2e3", "score": "0.5925505", "text": "publish(topic, args) {\n if (!this._topics[topic]) {\n return false;\n }\n\n var subscribers = this._topics[topic];\n var len = subscribers ? subscribers.length : 0;\n\n while (len--) {\n subscribers[len].func(topic, args);\n }\n\n return this;\n }", "title": "" }, { "docid": "d12b354d4ff582b6e20de9cb9dac432a", "score": "0.59198374", "text": "constructor() {\n // Storage for topics that can be broadcast\n // or listened to\n this._topics = {};\n\n // An topic identifier\n this._subUid = -1;\n }", "title": "" }, { "docid": "284a3179cbfdd46d501897dda0a0035d", "score": "0.59148234", "text": "function PubSubMixin() {}", "title": "" }, { "docid": "2f2c88554571881e0bd59ce817f3f0be", "score": "0.5905661", "text": "subscribe(subscriber, message){\n\n this._subscriptions.add(subscriber, message)\n\n }", "title": "" }, { "docid": "87679da98e473d628ed1d46590a6e605", "score": "0.5889996", "text": "function publish(topic, args) {\n\n if(!topics[topic]) {\n return false;\n }\n\n const callbacks = topics[topic];\n\n callbacks.forEach(cb => {\n cb.func(topic, args);\n });\n\n return this;\n}", "title": "" }, { "docid": "2bb9fc88215b4cd33319ab74cefd508c", "score": "0.5889576", "text": "subscribeToMessageChannel() {\n this.subscribed =true;\n if (!this.subscription) {\n this.subscription = subscribe(\n this.messageContext,\n recordSelected,\n (message) => this.handleMessage(message),\n { scope: APPLICATION_SCOPE }\n );\n }\n }", "title": "" }, { "docid": "6e9d0772a5dde60f36077911eaec90c4", "score": "0.5845643", "text": "processMessageReplyNoTopic (message) {\n console.assert(message.parameters[0] === this.client.localUser.nickName)\n console.assert(message.parameters[1])\n\n let channel = this.getChannelFromName(message.parameters[1])\n channel.topicChanged(null, null)\n }", "title": "" }, { "docid": "ab0a6a8a4cd163394dd3cc968280c898", "score": "0.5843495", "text": "handleSubscribe() {\n // Callback invoked whenever a new event message is received\n const messageCallback = (response) => {\n console.log(\"New message received : \", JSON.stringify(response));\n this.payload = JSON.stringify(response);\n console.log(\"this.payload: \" + this.payload);\n // Response contains the payload of the new message received\n this.loadLogs();\n };\n\n // Invoke subscribe method of empApi. Pass reference to messageCallback\n subscribe(CHANNEL_NAME, -1, messageCallback).then(response => {\n // Response contains the subscription information on successful subscribe call\n console.log(\"Successfully subscribed to : \", JSON.stringify(response.channel));\n this.subscription = response;\n this.toggleSubscribeButton(true);\n });\n }", "title": "" }, { "docid": "c9df36880c76f27077b848a14ffdee6e", "score": "0.58401793", "text": "subscribeToMessageChannel() {\n if (!this.subscription) {\n this.subscription = subscribe(\n this.messageContext,\n filteredProducts,\n (message) => this.handleMessage(message),\n {scope: APPLICATION_SCOPE}\n );\n }\n }", "title": "" }, { "docid": "9297a0069d01561349f6567862020635", "score": "0.58400303", "text": "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "title": "" }, { "docid": "9297a0069d01561349f6567862020635", "score": "0.58400303", "text": "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "title": "" }, { "docid": "9297a0069d01561349f6567862020635", "score": "0.58400303", "text": "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "title": "" }, { "docid": "9297a0069d01561349f6567862020635", "score": "0.58400303", "text": "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "title": "" }, { "docid": "9297a0069d01561349f6567862020635", "score": "0.58400303", "text": "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "title": "" }, { "docid": "7e3c3b289866474832cac01df19ebe73", "score": "0.5832919", "text": "function PubSub(){\n this._topics = {}\n }", "title": "" }, { "docid": "76f9f92f5dfb8ecae2bacf645bfefcf6", "score": "0.58323324", "text": "function pubsub(destination) {\n var subscribe = this.value === \"SUBSCRIBE\";\n\n if (!subscribe) {\n this.value = \"SUBSCRIBE\";\n subscriptions[destination].unsubscribe();\n } else {\n subscriptions[destination] = client.subscribe(\"/destination-\" + destination, callback);\n this.value = \"UNSUBSCRIBE\";\n }\n}", "title": "" }, { "docid": "002496ff85dd18be651e057b1a4a6361", "score": "0.58279186", "text": "subscribeQueue(queue) {\n const subscriptionName = queue.id + 'Subscription';\n if (this.tryFindChild(subscriptionName)) {\n throw new Error(`A subscription between the topic ${this.id} and the queue ${queue.id} already exists`);\n }\n // we use the queue name as the subscription's. there's no meaning to subscribing\n // the same queue twice on the same topic.\n const sub = new subscription_1.Subscription(this, subscriptionName, {\n topic: this,\n endpoint: queue.queueArn,\n protocol: subscription_1.SubscriptionProtocol.Sqs\n });\n // add a statement to the queue resource policy which allows this topic\n // to send messages to the queue.\n queue.addToResourcePolicy(new iam.PolicyStatement()\n .addResource(queue.queueArn)\n .addAction('sqs:SendMessage')\n .addServicePrincipal('sns.amazonaws.com')\n .setCondition('ArnEquals', { 'aws:SourceArn': this.topicArn }));\n return sub;\n }", "title": "" }, { "docid": "93f6ee362b186aa7ce6b6dde04f079b4", "score": "0.5826274", "text": "subscribe(fn) {\r\n const hashCode = this.getHashCode(fn);\r\n const notYetSubscribed = this.subscriptionAlreadyExists(hashCode) === false;\r\n if (notYetSubscribed) {\r\n this.listeners.push(new Listener(hashCode, fn));\r\n const unsubscribe = () => {\r\n const candidates = this.listeners.filter(singleListener => singleListener.hashCode === hashCode);\r\n if (candidates.length > 1) {\r\n throw new Error(`Multiple listeners with hashcode '${hashCode}' were found subscribing to model change notifications. This is abnormal and is possibly a bug.`);\r\n }\r\n else if (candidates.length === 1) {\r\n this.listeners.splice(this.listeners.indexOf(candidates[0]), 1);\r\n delete candidates[0];\r\n candidates.splice(0, 1);\r\n }\r\n };\r\n return unsubscribe;\r\n }\r\n else {\r\n const noOp = () => { };\r\n return noOp;\r\n }\r\n }", "title": "" }, { "docid": "28a09ce1c4b589249330b3c1fb288a4a", "score": "0.5808768", "text": "function testSubscribePublish() {\n grr.init();\n\n var success = false;\n var success2 = false;\n\n return;\n // Make a div to hang the callbacks on\n $('#test').append('<div id=\"testSubscribePublish\">Hello</div>');\n\n // Subscribe to the event\n grr.subscribe('testqueue_sp', function(value, event, data) {\n assertEquals(value, 'value');\n assertEquals(event, 'event');\n assertEquals(data, 'data');\n success = true;\n }, 'testSubscribePublish');\n\n // Subscribe again to the event\n grr.subscribe('testqueue_sp', function(value, event, data) {\n assertEquals(value, 'value');\n assertEquals(event, 'event');\n assertEquals(data, 'data');\n success2 = true;\n }, 'testSubscribePublish');\n\n // Now publish the event\n grr.publish('testqueue_sp', 'value', 'event', 'data');\n assertTrue(success);\n assertTrue(success2);\n\n // Remove the node from the DOM\n $('#test').html('');\n success = false;\n\n // Test that now events do not fire\n grr.publish('testqueue_sp', 'value', 'event', 'data');\n assertFalse(success);\n}", "title": "" }, { "docid": "82a0545967118de4853529257102fb83", "score": "0.58061755", "text": "addTopic(topic) {\n if(topic in this.listeners) return;\n var listener = new ROSLIB.Topic({\n ros : ros,\n name : topic,\n messageType : this.constructor._TYPE,\n });\n\n this.listeners[topic] = listener;\n\n this.redrawPlotTraces();\n\n var that = this;\n listener.subscribe(function(message) {\n var data = that.getData(message);\n for(var param in data) {\n var key = topic + '/' + param;\n if(!(key in that.plotData)) {\n that.plotData[key] = {'topic': topic, 'name': param, 'y': [], 'line': { } };\n that.redrawPlotTraces();\n }\n that.plotData[key]['y'].push(data[param]);\n }\n\n for(var key in that.plotData) {\n while(that.plotData[key]['y'].length > that.maxPoints) {\n that.plotData[key]['y'].shift();\n }\n }\n });\n }", "title": "" }, { "docid": "5b9acbba8422449b2c826b4910dd413a", "score": "0.5803781", "text": "subscribe() {\n if( !('PushManager' in window) ) { return false; }\n\n // check if already subscribed\n this._checkSubscription()\n .then( isSubscribed => {\n if( isSubscribed ) { throw new Error( 'User already subscribed' ); }\n\n const serverKey = this._urlB64ToUint8Array( PUBLIC_KEY );\n // prompt user to allow / block\n return this.reg.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: serverKey\n });\n })\n // update server after finish subscribing\n .then( sub => {\n console.log( 'Push Notification Subscribed' );\n this._updateServer( sub );\n })\n .catch( error => console.log( error ) );\n }", "title": "" }, { "docid": "a2624311b85506a1c5a1a0eea1401a70", "score": "0.5792666", "text": "async unsubscribeFromTopic(ctx, topicNumber, subscriber) {\n console.info('============= START : Unsubscribe from a Topic ===========');\n\n const topicAsBytes = await ctx.stub.getState(topicNumber); // get the topic from chaincode state\n if (!topicAsBytes || topicAsBytes.length === 0) {\n throw new Error(`${topicNumber} does not exist`);\n }\n const topic = JSON.parse(topicAsBytes.toString());\n topic.subscribers = topic.subscribers.filter(i => i !== subscriber);\n\n await ctx.stub.putState(topicNumber, Buffer.from(JSON.stringify(topic)));\n console.info('============= END : Unsubscribe from a Topic ===========');\n }", "title": "" }, { "docid": "b790c8164049b0476518d9da7c7aa5bf", "score": "0.5776604", "text": "handleSubscribe() {\n // Callback invoked whenever a new event message is received\n const messageCallback = function (response) {\n console.log(\"New message received: \", JSON.stringify(response));\n this.doProcessPlatformEvent(response.data.payload);\n\n // Response contains the payload of the new message received\n }.bind(this);\n\n // Invoke subscribe method of empApi. Pass reference to messageCallback\n subscribe(this.channelName, -1, messageCallback).then((response) => {\n // Response contains the subscription information on subscribe call\n console.log(\n \"Subscription request sent to: \",\n JSON.stringify(response.channel)\n );\n this.subscription = response;\n this.toggleSubscribeButton(true);\n });\n }", "title": "" }, { "docid": "7e2ee4a8151d7549182ec14dcd9419d3", "score": "0.5773294", "text": "getSubscribe() {\n return {\n supportedModes: ['polling']\n }\n }", "title": "" }, { "docid": "b8ed4b539f7a7718d712046550fd0476", "score": "0.5770237", "text": "function messageEmit(messageTopic) {\r\n console.log(\"Success, \" + messageTopic);\r\n}", "title": "" }, { "docid": "c4b4d418d526a4ec27e99ce035728732", "score": "0.5769323", "text": "function subscribePing() {\n skygear.pubsub.on('ping', (data) => {\n console.log(data);\n let message = `Ping msg: ${data.msg}`\n showPingToast(message);\n\n replyToPing();\n });\n}", "title": "" }, { "docid": "17451b42a560d844b66689c2ff0ef646", "score": "0.57690454", "text": "function _sub( topic, callback ){\n // init subscriber list for this topic if necessary\n if ( !topic_cache.hasOwnProperty( topic ) ){\n topic_cache[topic] = [];\n }\n var id = (++lastUid).toString();\n topic_cache[topic].push( { id : id, func : callback } );\n\n // return ID for unsubscribing\n return id;\n }", "title": "" }, { "docid": "2d2348ff3888fd8e70b866c5b3314d71", "score": "0.57612497", "text": "function PublishSubscribeBroker() {\n this._subscriptions = {};\n this._pendingOps = {};\n //this._calls = 0;\n }", "title": "" }, { "docid": "f3730e32f305bd8d8b6dce343d8eed0f", "score": "0.57568824", "text": "componentDidMount() {\n // listen is a reflux method - can include even though Reflux not included in this component ...\n // ... as has been included in TopicStore\n // this.onChange is calledback with change detected\n // returns a function to remove event listener\n this.unsubscribe = TopicStore.listen(this.onChange);\n }", "title": "" }, { "docid": "6e9eb49878ee08a15d4461e8019c36af", "score": "0.57493895", "text": "function _pub( topic, data ){\n var subscribers = topic_cache[topic],\n len = subscribers && subscribers.length ? subscribers.length : 0;\n setTimeout(function notify(){\n while( len-- ){\n subscribers[len].func( topic, data || [] );\n }\n }, 0 );\n return true;\n }", "title": "" }, { "docid": "82d94916e3b4d126a6abec3231d82e99", "score": "0.5739388", "text": "function isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n }", "title": "" }, { "docid": "70cab59ea810fb0b34372f55bbe74a0e", "score": "0.5724959", "text": "function subscribe(subscribeToResource) {\n if (!subscribe.hasBeen) {\n subscribeToResource('load');\n }\n\n subscribe.hasBeen = true;\n}", "title": "" } ]
7bc1fcb2332d7f6690c13cd843b29c1a
Returns the extra search steps for E. Refer to the paper.
[ { "docid": "5cb30c1727303aed7fe3db42c0f59b8a", "score": "0.0", "text": "function calcToRemove(a, b)\n{\n\tvar subLengths = 0;\n\tfor (var i = 0; i < a.table.length; i++)\n\t{\n\t\tsubLengths += a.table[i].table.length;\n\t}\n\tfor (var i = 0; i < b.table.length; i++)\n\t{\n\t\tsubLengths += b.table[i].table.length;\n\t}\n\n\tvar toRemove = a.table.length + b.table.length;\n\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n}", "title": "" } ]
[ { "docid": "51f4ce28d425d99fcad1f819d9482843", "score": "0.5345199", "text": "function ye(xe){we.push(be(xe,xe.query))}", "title": "" }, { "docid": "acc2e9ca912276c0879f64eab9a08b1a", "score": "0.52957016", "text": "function getSteps() {\n\treturn [\"Name\", \"Email\", \"Pin\", \"Birthday\", \"Review\"];\n}", "title": "" }, { "docid": "37b68c2431f6bdbed304a3ebb2395088", "score": "0.5184425", "text": "function getSteps() {\n return [\n \"Marketplace Integration\",\n \"Shipping Profile\",\n \"Return Settings\",\n \"Import Products\",\n \"Import Customers\",\n ];\n}", "title": "" }, { "docid": "09a3d983a673122d80621f91c432e8e2", "score": "0.5098279", "text": "function hhotelSearchExtra(cluster, lg, price, codetrack, extratitle, extraval, extrashow)\n{\n var args = \"Extrafield=\" + escape(extratitle) + \";\" + extraval + \";\" + extrashow;\n if (codetrack != \"\") args += \"&from=\"+codetrack;\n hhotelSearch(cluster, lg, price, \"\", \"\", \"\", args);\n}", "title": "" }, { "docid": "becd190b2b47d382d7c0b3b25d3bdf55", "score": "0.4948146", "text": "function eEstimate(e) {\n let Q = e[0];\n for (let i = 1; i < e.length; i++) {\n Q += e[i];\n }\n return Q;\n}", "title": "" }, { "docid": "675dcca6f83597fd4693ed2abd63d8de", "score": "0.49358755", "text": "function ee(e,t){if(null==e.$where)return;const n=Object.keys(e.$where),r=n.length;for(let o=0;o<r;++o)t[n[o]]=e.$where[n[o]]}", "title": "" }, { "docid": "96ad26324a758e238f3bf5152de09335", "score": "0.49264312", "text": "function findNextEp() {\n // var eSym = undefined;\n eSym = _.find(_.keys(G), function(key) {\n \treturn _.find(G[key], function(r) {\n \t\treturn (r == '/');\n \t})\n })\n return eSym;\n }", "title": "" }, { "docid": "d1e53487dda95891c41bfe0ec7c04f59", "score": "0.48436084", "text": "function extraInfor() {\n return extraInforIndex;\n}", "title": "" }, { "docid": "5dda8af4dfd0adb8e7fade53addc831b", "score": "0.48249635", "text": "function getSteps() {\n return [`Job application tracker`, `All your information in an organized place`, `Welcome to DreamJob!`];\n}", "title": "" }, { "docid": "629371b60edc5265cd6af95da9b9762a", "score": "0.48150703", "text": "function getSteps() {\r\n return [\"Module Name\", \"Set Project Inputs\", \"Set IL Gates\", \"Set Approval\"];\r\n}", "title": "" }, { "docid": "d0bafa953d31789060ed48af9a031399", "score": "0.479673", "text": "_searchPreviousHandler() {\n const opts = {\n findNext: true,\n forward: false\n };\n this.search(this._lastSearch, opts);\n }", "title": "" }, { "docid": "6b2d4cd8e27421ee462e500f434c4c94", "score": "0.47517374", "text": "getEntries(t, e) {\n return this.Ro(t, e);\n }", "title": "" }, { "docid": "3b05a176f8d166b3c7083c3108c1af6e", "score": "0.47349966", "text": "getEntries(t, e) {\n return this.Ar(t, e);\n }", "title": "" }, { "docid": "df698055bfed0c4cfb5f8276de2f8d14", "score": "0.47204566", "text": "function LE(t,e){var i=Er()(t);if(xr.a){var n=xr()(t);e&&(n=_r()(n).call(n,(function(e){return gr()(t,e).enumerable}))),i.push.apply(i,n)}return i}", "title": "" }, { "docid": "1a5dc0294e0286b8443ce5f71f0ff38e", "score": "0.4701888", "text": "get startIndex() {\n return this._e;\n }", "title": "" }, { "docid": "c71316813c791cd483bb3b666b45a66c", "score": "0.4688822", "text": "search(e) {\n let query = e.target.closest(\"input\").value;\n searchFunctions.retrieve(query);\n }", "title": "" }, { "docid": "bceae59db434e535eaf7a28ea92c7f58", "score": "0.46499813", "text": "steps() { return steps }", "title": "" }, { "docid": "f817350223ba38009d6cfb038bd1cc1d", "score": "0.4619562", "text": "function evalexp(ctx, expression) {\n\treturn m({\n\t\tvalue: search => searchAll(ctx, searchMethod, search),\n\t\t'quoted-value': search => searchAll(ctx, searchExactMethod, search),\n\t\tne: exp => invert(evalexp(ctx, exp), ctx.allSamples),\n\t\tand: (...exprs) => _.intersection(...exprs.map(e => evalexp(ctx, e))),\n\t\tor: (...exprs) => _.union(...exprs.map(e => evalexp(ctx, e))),\n\t\tgroup: exp => evalexp(ctx, exp),\n\t\tfield: (field, exp) => evalFieldExp(ctx, exp, ctx.columns[ctx.fieldMap[field]], ctx.data[ctx.fieldMap[field]])\n\t}, expression);\n}", "title": "" }, { "docid": "7a186b0a8d2097d665aa08cb07e08bee", "score": "0.4603006", "text": "function getSetupSteps()\n{\n var dom = null;\n var url = \"\";\n var curSite = null;\n\n // Try to get the site for the currently selected document\n dom = dw.getDocumentDOM();\n if (dom != null)\n url = dom.URL;\n if (url.length > 0)\n curSite = site.getSiteForURL(url);\n else\n curSite = site.getCurrentSite(); \n if (curSite.length == 0)\n\tcurSite = site.getCurrentServerSite();\n\t\n var title = MM.MSG_Dynamic_InstructionsTitle;\n var step1 = MM.MSG_Dynamic_InstructionsStep1;\n if (curSite.length != 0 && site.getIsServerSite(curSite))\n step1 = MM.MSG_Dynamic_InstructionsStep1A;\n var step2 = MM.MSG_Dynamic_InstructionsStep2;\n var step3 = MM.MSG_ServerDebug_InstructionsStep3;\n if (curSite.length != 0 && site.getIsServerSite(curSite))\n\tstep3 = MM.MSG_Dynamic_InstructionsStep3A;\n\n return new Array(title, step1, step2, step3);\n}", "title": "" }, { "docid": "42abaebf44fcf2daf6e10384d559b34c", "score": "0.4593973", "text": "function $e(t, e, n, r) {\n for (var i = [], o = 0, u = t; o < u.length; o++) {\n var s = u[o], a = s.transform, c = null;\n n instanceof Vt && (c = n.field(s.field)), i.push(Se(a, c, e));\n }\n return i;\n }", "title": "" }, { "docid": "f17d6530c466837a8cbf7777cc582abe", "score": "0.45667177", "text": "async getSteps(filter = {}) {\n return this.locatorForAll(MatStepHarness.with(filter))();\n }", "title": "" }, { "docid": "9d4adc153b6e4a882cf47b32d9ac82b6", "score": "0.45506647", "text": "_searchNextHandler() {\n const opts = {\n findNext: true,\n forward: true\n };\n this.search(this._lastSearch, opts);\n }", "title": "" }, { "docid": "ad7a11d0205eee6d1b96e15584963ec2", "score": "0.45418763", "text": "function e(e,n){return t(e).map(function(){return this.elements?t.makeArray(this.elements):this}).filter(function(){return this.name}).map(n)}", "title": "" }, { "docid": "2fb77f27b22c3db2c6ca2cbb692cf2a7", "score": "0.4529625", "text": "visitExtractExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b86d6a2be1e68258e98d078d9ce37bee", "score": "0.4521296", "text": "function hasE(e) {\n return e.includes('e', 0);\n}", "title": "" }, { "docid": "64c70fc2ca6320018722fce0f95b5cc5", "score": "0.45104566", "text": "function ee(t, n, i, e) {\n ae(t, n, pe(i) + \" argument\", e);\n}", "title": "" }, { "docid": "4d98bf03966bf6cce8d68a05ffeccf1f", "score": "0.45017204", "text": "function getRuleE(V){\n\n\tfor (var i = 0; i < gRules.length; i++) {\n\t\tconsole.log((gRules[i].root),V)\n\t\tif(gRules[i].root == V && gRules[i].rule[0] == \"epsilon\")\n\t\t\treturn gRules[i];\n\t}\n\treturn null;\n\n}", "title": "" }, { "docid": "3bb43af24d1bd08c3a14856c43bdbde0", "score": "0.4498271", "text": "visitExpressionPart(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f8e1e419bfb98b2629b5f8926d581a0e", "score": "0.4481793", "text": "function te(e,t){if(null==e.$where)return;const n=Object.keys(e.$where),r=n.length;for(let o=0;o<r;++o)t[n[o]]=e.$where[n[o]]}", "title": "" }, { "docid": "01fb6556d433bdedb60f579676b540b7", "score": "0.44760308", "text": "function extractEQInfo(earthQuakes){\n\n console.log(\"Extracting E.Q Info\");\n\n for(var i = 0; i < earthQuakes.features.length; i++){\n var long = earthQuakes.features[i].geometry.coordinates[0];\n var lat = earthQuakes.features[i].geometry.coordinates[1];\n\n var longDif = goalLong - long;\n var latDif = goalLat - lat;\n var straightDis = Math.sqrt(Math.pow(longDif,2)+Math.pow(latDif,2));\n straightDis = straightDis * 111;\n\n disArray.push(straightDis);\n magArray.push(earthQuakes.features[i].properties.magnitude);\n depArray.push(earthQuakes.features[i].properties.depth);\n }\n}", "title": "" }, { "docid": "985e8d7c645932fc168e01e8287faf56", "score": "0.44752175", "text": "function getEqFields(formHandler) {\n var requiredEqFields = formHandler.find(\"[data-eq]\");\n if (requiredEqFields.length) {\n return requiredEqFields;\n } else {\n //console.error(\"No form Eq fields to be validated\");\n }\n\n }", "title": "" }, { "docid": "33a59b0d1844dde4565c5a6e8fe3c090", "score": "0.44738537", "text": "function ED(t,e){var i=Er()(t);if(xr.a){var n=xr()(t);e&&(n=_r()(n).call(n,(function(e){return gr()(t,e).enumerable}))),i.push.apply(i,n)}return i}", "title": "" }, { "docid": "40237ce4ffb8c805b23f8573df6df655", "score": "0.44632995", "text": "Ee(t, e) {\n return new fn(this.dt, this.root.Ee(t, e, this.dt).copy(null, null, wn.Te, null, null));\n }", "title": "" }, { "docid": "bf174d2c07dcba120f02d65704d55439", "score": "0.4454653", "text": "function W(e,t){if(null==e.$where)return;const n=Object.keys(e.$where),r=n.length;for(let o=0;o<r;++o)t[n[o]]=e.$where[n[o]]}", "title": "" }, { "docid": "f6088b9d4881a135051e0fbad8a59aea", "score": "0.44384602", "text": "function searchForIterationNodes() {\n\tvar itN = new Array();\n\tfor (var i in JSONData.nodes) {\n\t\tvar el = JSONData.nodes[i];\n\t\tif (el.step_function != null) {\n\t\t\titN.push(el);\n\t\t}\n\t}\n\treturn itN;\n}", "title": "" }, { "docid": "5845dc5cf5547accfa07b94120765844", "score": "0.44342706", "text": "function we(t, e) {\n return function(t, e) {\n var n = e.key.path;\n return null !== t.collectionGroup ? e.key.wt(t.collectionGroup) && t.path.st(n) : it.Et(t.path) ? t.path.isEqual(n) : t.path.it(n);\n }(t, e) && function(t, e) {\n for (var n = 0, r = t.Nt; n < r.length; n++) {\n var i = r[n];\n // order by key always matches\n if (!i.field.ht() && null === e.field(i.field)) return !1;\n }\n return !0;\n }(t, e) && function(t, e) {\n for (var n = 0, r = t.filters; n < r.length; n++) {\n if (!r[n].matches(e)) return !1;\n }\n return !0;\n }(t, e) && function(t, e) {\n return !(t.startAt && !re(t.startAt, pe(t), e)) && (!t.endAt || !re(t.endAt, pe(t), e));\n }(t, e);\n }", "title": "" }, { "docid": "66ffcb6e37da69b8ef38f931fab65a14", "score": "0.44281587", "text": "function E(e){var t=\"function\"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}", "title": "" }, { "docid": "719d706342850398b215c7b2f85464de", "score": "0.44111463", "text": "function yE(t,e){var i=Er()(t);if(xr.a){var n=xr()(t);e&&(n=_r()(n).call(n,(function(e){return gr()(t,e).enumerable}))),i.push.apply(i,n)}return i}", "title": "" }, { "docid": "b2e897e7334796482831948691a3ce0b", "score": "0.44103363", "text": "function ee(e){const t=e.schema&&e.schema.callQueue;if(t.length)for(const n of t)\"pre\"!==n[0]&&\"post\"!==n[0]&&\"on\"!==n[0]&&e[n[0]].apply(e,n[1])}", "title": "" }, { "docid": "35a8766761358e5353d78c79da91aa78", "score": "0.44027993", "text": "function getSteps() {\n return [\"Delivery\", \"Payment\"];\n}", "title": "" }, { "docid": "fa3a17d91f189ec10d5354d3ea0e52b6", "score": "0.4398475", "text": "getExtendedFeatures() {\n\t \treturn this.extendedFeatures;\n\t }", "title": "" }, { "docid": "f7b5e1154254fea42d97b027c24c1b4a", "score": "0.4388882", "text": "visitOC_Where(ctx) {\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "0235b9ea6136cf0aa9dc78227e705a6c", "score": "0.43834215", "text": "function prev_next(step,e){\n if(searchMode == false){\n const modalContianers = Array.from(document.querySelectorAll('.modal-container'));\n let selectedIndex = modalContianers.indexOf(e.target.parentElement.parentElement); // Get index of displaying modal\n if (selectedIndex + step >= 0 && selectedIndex + step <= modalContianers.length -1){ // Display next or previous modal as long as \"current index +step\" from 0 to modalContianers.lenght -1\n modalContianers[selectedIndex].style.display = 'none';\n modalContianers[selectedIndex + step].style.display = '';\n }\n } else {\n const modalContianers = Array.from(document.querySelectorAll('.modal-container'));\n let searchedWord = document.querySelector('#search-input').value;\n let filteredModalContainers = modalContianers.filter(modal => modal.querySelector('h3').innerHTML.toLowerCase().includes(searchedWord)); // Create new array contains match card after search.\n let selectedIndex = filteredModalContainers.indexOf(e.target.parentElement.parentElement); // Get index of displaying modal\n if (selectedIndex + step >= 0 && selectedIndex + step <= filteredModalContainers.length -1){ // Display next or previous modal as long as \"current index +step\" from 0 to filteredModalContainers.lenght -1\n filteredModalContainers[selectedIndex].style.display = 'none';\n filteredModalContainers[selectedIndex + step].style.display = '';\n }\n }\n}", "title": "" }, { "docid": "6485fdf3b92dc1a39bded92936311ef2", "score": "0.4378113", "text": "getSteps(instruction, opt_event) {\n var instructionTokens = instruction.split(' ');\n // TODO: Remove assumption that the instruction follows specific format in\n // which first word is the command and the rest of the instruction is a\n // single argument for the command.\n var statement = [instructionTokens[0], instructionTokens.slice(1, instructionTokens.length).join(' ')]\n\n if (opt_event) {\n var eventTokens = opt_event.split(' ');\n var event = eventTokens.slice(1, eventTokens.length).join(' ');\n // wrap the statement with the event.\n }\n\n return [statement];\n }", "title": "" }, { "docid": "cdfda39b6372d419da5d00d39a51b008", "score": "0.43755132", "text": "getExtraParams() {\n\t \treturn this.extraParams;\n\t }", "title": "" }, { "docid": "2f3593692d852a6371fe1929f649aede", "score": "0.43743676", "text": "function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q: q,\n j: j\n };\n }\n }\n }\n\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }", "title": "" }, { "docid": "f4d817ddfec70180765352d9baeb7fc7", "score": "0.4370583", "text": "function WL(e,t){for(var n=arguments.length,r=0;++r<n;){var i=arguments[r];$L(i)&&VL(i,jL,e)}return e}", "title": "" }, { "docid": "75930ef81d98aeacf26ad368c5026870", "score": "0.4359431", "text": "function Ne(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}", "title": "" }, { "docid": "aa7a4bc7e4ee9e4f435b2262d9d64d25", "score": "0.43488234", "text": "getAllPreviousInstructions() {\n return this.getAllInstructions().map(c => c.previousInstruction).filter(c => c);\n }", "title": "" }, { "docid": "8ca5ba31d60905da23e668c30b29fae8", "score": "0.43389583", "text": "function altSearch (event) {\nevent.stopPropagation();\n\n\n\nvar lookthisup = event.target.textContent;\nsearchApi(lookthisup);\n\n\n}", "title": "" }, { "docid": "ccfa2b65fe06f496a3a0eeefcde49023", "score": "0.4331638", "text": "function _e(t, e) {\n return me(t, e.X());\n }", "title": "" }, { "docid": "4829ab4b1432f0fbeb151c3674dec1a2", "score": "0.43311766", "text": "function getSteps(){\n var result = {};\n try {\n result = Workflow.callMethod(\"AbBldgOpsHelpDesk-StepService-getSteps\");\n } \n catch (e) {\n Workflow.handleError(e);\n }\n \n if (result.code == 'executed') {\n steps = eval('(' + result.jsonExpression + ')');\n }\n else {\n Workflow.handleError(result);\n }\n}", "title": "" }, { "docid": "9173d21dc37104092ee6101a8778ec73", "score": "0.4325882", "text": "function checkForMore() {\n return PlaceSearchModel.more;\n }", "title": "" }, { "docid": "ae2e42eb55f6f04e843ae64956d9e08a", "score": "0.43240803", "text": "function e(){}", "title": "" }, { "docid": "ae2e42eb55f6f04e843ae64956d9e08a", "score": "0.43240803", "text": "function e(){}", "title": "" }, { "docid": "ae2e42eb55f6f04e843ae64956d9e08a", "score": "0.43240803", "text": "function e(){}", "title": "" }, { "docid": "138859f901161a00a89400f0d31eb192", "score": "0.43173474", "text": "function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q: q,\n j: j\n };\n }\n }\n }\n\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }", "title": "" }, { "docid": "138859f901161a00a89400f0d31eb192", "score": "0.43173474", "text": "function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q: q,\n j: j\n };\n }\n }\n }\n\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }", "title": "" }, { "docid": "138859f901161a00a89400f0d31eb192", "score": "0.43173474", "text": "function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q: q,\n j: j\n };\n }\n }\n }\n\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }", "title": "" }, { "docid": "138859f901161a00a89400f0d31eb192", "score": "0.43173474", "text": "function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q: q,\n j: j\n };\n }\n }\n }\n\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }", "title": "" }, { "docid": "8fe1cccc10daeb212162bb8676b2e7d0", "score": "0.43172783", "text": "ph(t, e) {\n return this.Do.Ua(t, e).next(s => this.Qa(t, e, s));\n }", "title": "" }, { "docid": "dcdd19bb568b60a671a41dd6bf4ca59b", "score": "0.4315709", "text": "function searchEvent(episodeArray) {\n\tlet result = search.value.toLowerCase();\n\tnewList = episodeArray.filter((el) => {\n\t\tif (el.summary) {\n\t\t\treturn (\n\t\t\t\t//include if statement to check for presence of summary as with img on line 86\n\t\t\t\tel.name.toLowerCase().includes(result) ||\n\t\t\t\tel.summary.toLowerCase().includes(result)\n\t\t\t);\n\t\t} else if (el.summary && el.genres) {\n\t\t\treturn (\n\t\t\t\tel.name.toLowerCase().includes(result) ||\n\t\t\t\tel.summary.toLowerCase().includes(result) ||\n\t\t\t\tel.genres.toLowerCase().includes(result)\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.log(`No summary for ${el.name} `);\n\t\t\treturn el.name.toLowerCase().includes(result);\n\t\t}\n\t});\n\n\trootElem.innerHTML = \"\";\n\tselector.innerHTML = \"\";\n\tif (showSelect.value === \"Display All\") {\n\t\tdisplayAllShows(newList);\n\t\tshowSelectOption(newList);\n\t} else {\n\t\taddOption(newList);\n\t\tmakePageForEpisodes(newList);\n\t}\n\tsearchResult.innerText = `Displaying ${newList.length}/${episodeArray.length}`;\n}", "title": "" }, { "docid": "97be45a917be903d37dbb7e940fec2ce", "score": "0.43121165", "text": "function E () { }", "title": "" }, { "docid": "92ce00447534a48a0e9b7d90c24d30db", "score": "0.4310098", "text": "function eventFind(extraQuery, extraOperation) {\n let queryWrapper = {\n query: {\n where: {},\n sort: 'id DESC',\n limit: 30,\n populate: [{\n property: 'photos',\n criteria: {\n sort: 'index ASC'\n }\n }]\n }\n };\n angular.extend(queryWrapper.query.where, extraQuery);\n angular.extend(queryWrapper.query, extraOperation);\n return Events.find(queryWrapper).$promise\n .then((eventsWrapper) => {\n console.log(\"eventsWrapper :::\\n\", eventsWrapper);\n return eventsWrapper; //object안에 array가 존재\n });\n }", "title": "" }, { "docid": "60db1985274f6d175dafd61ad40afb3a", "score": "0.4299568", "text": "function findExpressionVariables()\n{\n //initialise to the preceding activity\n let activity = getPreviousActivity(getActiveActivity())\n\n //collection to return\n let variables = []\n\n //while not the end of the route\n while(activity)\n {\n let type = activity.getAttribute('processor-type')\n\n //if 'setter' found\n if(type == \"header\" || type == \"property\"){\n \n //we add to the collection in the format [type.var] (e.g. 'header.h1')\n variables.push(type+\".\"+activity.getElementsByTagName(\"a-text\")[0].firstChild.getAttribute('value').slice(0, -1))\n }\n\n //look next\n activity = getPreviousActivity(activity)\n }\n\n return variables \n}", "title": "" }, { "docid": "953a37ea07665c28bafcfb23834f9f23", "score": "0.42984584", "text": "function getSteps(){\n\t\tvar transaction = db.transaction(object_Store,\"readwrite\");\n\t\tvar objectStore = transaction.objectStore(object_Store);\n\t\tvar request = objectStore.openCursor();\n\t\trequest.onsuccess = function(evt) { \n\t\t\tvar cursor = evt.target.result; \n\t\t\tif (cursor) { \n\t\t\t\t//console.log(cursor);\n\t\t\t\tvar data=cursor.value;\n\t\t\t\tlocalStorage.setItem(\"pedoSteps\",data.Pedosteps);\n\t\t\t\tvar steps=data.Pedosteps;\n\t\t\t\tvar contentText = document.querySelector('#steps-text');\n\t\t\t\tif(contentText!=undefined){\n\t\t\t\t\tcontentText.innerHTML = (steps==\"null\" || steps==undefined)?\"0 Steps\":steps+' Steps';\t\n\t\t\t\t}\n\t\t\t\tcursor.continue(); \n\t\t\t} \n\t\t\telse { \n\t\t\t\tconsole.log(\"No more entries!\"); \n\t\t\t} \n\t\t};\n\t}", "title": "" }, { "docid": "e6a26a7e10bd210a056ce4e02165267d", "score": "0.4298148", "text": "function calcularExtraEjercicio(){\r\n componerArrayExtra()\r\n extraCalcular()\r\n reiniciarExtra()\r\n}", "title": "" }, { "docid": "5fe3f6268dcdf08ac906cf314b34abbc", "score": "0.4295028", "text": "function Mhe(t,e,n){var r=X(!1),a=X(!1),o=A(function(){return Math.ceil((t.foldedMaxPageBtn-1)/2)}),i=A(function(){return Math.ceil((t.foldedMaxPageBtn-1)/2)}),l=A(function(){return 2+o.value<n.value}),u=A(function(){return e.value-1-i.value>n.value});return{prevMore:r,nextMore:a,curPageLeftCount:o,curPageRightCount:i,isPrevMoreShow:l,isNextMoreShow:u}}", "title": "" }, { "docid": "6adeb5ecdc69884d97cbfac730791a04", "score": "0.42856902", "text": "function Ae(t, e) {\n for (var n = null, r = 0, i = t.fieldTransforms; r < i.length; r++) {\n var o = i[r], s = e.data.field(o.field), u = le(o.transform, s || null);\n null != u && (null == n && (n = bt.empty()), n.set(o.field, u));\n }\n return n || null;\n}", "title": "" }, { "docid": "af4565bdd23b5b4b60ebd2b4fad76dea", "score": "0.42853558", "text": "function Ke(t, e, n) {\n for (var r = [], i = 0, o = t; i < o.length; i++) {\n var u = o[i], s = u.transform, a = null;\n n instanceof Pt && (a = n.field(u.field)), r.push(Ee(s, a, e));\n }\n return r;\n}", "title": "" }, { "docid": "af4565bdd23b5b4b60ebd2b4fad76dea", "score": "0.42853558", "text": "function Ke(t, e, n) {\n for (var r = [], i = 0, o = t; i < o.length; i++) {\n var u = o[i], s = u.transform, a = null;\n n instanceof Pt && (a = n.field(u.field)), r.push(Ee(s, a, e));\n }\n return r;\n}", "title": "" }, { "docid": "8549e0ede64192fd79912a0fdd55fecd", "score": "0.42824572", "text": "function pathsToWork (e, s) {\n\n}", "title": "" }, { "docid": "b40c26fa584d0aaa3ce047182ea74a5c", "score": "0.42813566", "text": "function pe(t) {\n var e = x$1(t);\n if (null === e.Ot) {\n e.Ot = [];\n var n = he(e), r = fe(e);\n if (null !== n && null === r) \n // In order to implicitly add key ordering, we must also add the\n // inequality filter field for it to be a valid query.\n // Note that the default inequality field and key ordering is ascending.\n n.ht() || e.Ot.push(new ee(n)), e.Ot.push(new ee(rt.lt(), \"asc\" /* ASCENDING */)); else {\n for (var i = !1, o = 0, u = e.Nt; o < u.length; o++) {\n var s = u[o];\n e.Ot.push(s), s.field.ht() && (i = !0);\n }\n if (!i) {\n // The order of the implicit key ordering always matches the last\n // explicit order by\n var a = e.Nt.length > 0 ? e.Nt[e.Nt.length - 1].dir : \"asc\" /* ASCENDING */;\n e.Ot.push(new ee(rt.lt(), a));\n }\n }\n }\n return e.Ot;\n }", "title": "" }, { "docid": "ccc55fa76239e911b77f218d55495089", "score": "0.42572334", "text": "function getTotalSteps() {\n return TOTALSTEPS - 1;\n }", "title": "" }, { "docid": "88230dfa42427abae44a68739456d462", "score": "0.4256352", "text": "function getFurtherPlaces() {\n if (lastSearchType === 'address') {\n return getNextPlacesWithinByLocation(PlaceSearch.search);\n } else if (lastSearchType === 'placeName') {\n return getNextPlacesWithinByName(PlaceSearch.search);\n } else if (lastSearchType === 'tag') {\n var valueObj = {\n tags: [PlaceSearch.search]\n };\n return getNextPlacesWithinWithTags(valueObj);\n }\n }", "title": "" }, { "docid": "ce2865ab3eb84a9687d96132e3f7b42a", "score": "0.42560515", "text": "function le(t, e, n) {\n let s = 0;\n for (let i = 0; i < t.position.length; i++) {\n const r = e[i], o = t.position[i];\n if (r.field.Dt()) s = _t.dt(_t.kt(o.referenceValue), n.key); else {\n s = bt(o, n.field(r.field));\n }\n if (\"desc\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\n }\n return t.before ? s <= 0 : s < 0;\n }", "title": "" }, { "docid": "590aa1ddcc52576b958dc29ea2cca352", "score": "0.42546898", "text": "get elite() {\n return this.findBest(this.eliteSize);\n }", "title": "" }, { "docid": "e900bfece1910996d360b0c86d395c45", "score": "0.4251087", "text": "enterWhereExpressionOptional(ctx) {\n\t}", "title": "" }, { "docid": "24afdb2f009ab3c410808041f21d678b", "score": "0.4249274", "text": "function i(e){return e}", "title": "" }, { "docid": "24afdb2f009ab3c410808041f21d678b", "score": "0.4249274", "text": "function i(e){return e}", "title": "" }, { "docid": "e2b4781088cc25af4716df5d3ba01b11", "score": "0.42489737", "text": "visitSearchCondition(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "4d051a9b9bdf021fbc9c6b0286420f08", "score": "0.42477393", "text": "function Qu(e) {\n for (var t = e.depth, n = e.hasChildren, r = e.isExpanded, o = e.onExpanderClick, i = [], a = 0; a < t; a += 1)\n i.push(m(\"span\", {\n className: \"fc-icon\"\n }));\n var s = [\"fc-icon\"];\n return n && (r ? s.push(\"fc-icon-minus-square\") : s.push(\"fc-icon-plus-square\")),\n i.push(m(\"span\", {\n className: \"fc-datagrid-expander\" + (n ? \"\" : \" fc-datagrid-expander-placeholder\"),\n onClick: o\n }, m(\"span\", {\n className: s.join(\" \")\n }))),\n m.apply(void 0, function() {\n for (var e = 0, t = 0, n = arguments.length; t < n; t++)\n e += arguments[t].length;\n var r = Array(e)\n , o = 0;\n for (t = 0; t < n; t++)\n for (var i = arguments[t], a = 0, s = i.length; a < s; a++,\n o++)\n r[o] = i[a];\n return r\n }([S, {}], i))\n }", "title": "" }, { "docid": "eae1be1673dbaec54e90e647a2ccfbc5", "score": "0.42451236", "text": "function e(a){return K(a)?a:G(a)?[a]:[]}", "title": "" }, { "docid": "e36946a753a198ff0b4d0f4172028b2c", "score": "0.42353958", "text": "function getSetupSteps()\r\n{\r\n return getSetupStepsForServerObject();\r\n}", "title": "" }, { "docid": "8b780d858f95c638e5f3e730229cd991", "score": "0.42337543", "text": "static eo(t, e) {\n return Me(t.lo, e.lo) || C.F(t.key, e.key);\n }", "title": "" }, { "docid": "f932a64f5f3aa0bab409272cfc5911d1", "score": "0.42192444", "text": "function getInstructions(steps) {\n let newArray = [];\n steps.forEach((s) => {\n newArray.push(s.step);\n })\n return newArray;\n}", "title": "" }, { "docid": "f56647b7fa9c34dffa4c69e3e1aee75f", "score": "0.42155233", "text": "Ae() {\n return this.root.Ae();\n }", "title": "" }, { "docid": "be3e436c7ef05013dce69a2d7d853dee", "score": "0.42058846", "text": "ae(t, e) {\n const s = [];\n Fe(this.fieldTransforms.length === e.length, `server transform result count (${e.length}) ` + `should match field transform count (${this.fieldTransforms.length})`);\n for (let n = 0; n < e.length; n++) {\n const i = this.fieldTransforms[n], r = i.transform;\n let o = null;\n t instanceof St && (o = t.field(i.field)), s.push(r.qt(o, e[n]));\n }\n return s;\n }", "title": "" }, { "docid": "72d9d3c5ecc2b53b20c2ce1d407af25e", "score": "0.42049932", "text": "function he(Ve,Ge){Ge.readingMore||(Ge.readingMore=!0,Te(ge,Ve,Ge))}", "title": "" }, { "docid": "ca0803302db54745e09825cca67112c2", "score": "0.420213", "text": "function searchEventListener(e){\n genericEventListener(e, peopleSearch());\n }", "title": "" }, { "docid": "9e8090facd4d134f75cfcc9123663673", "score": "0.42021093", "text": "function le(xe,Me,Ee){Ee.negative=Me.negative^xe.negative,Ee.length=xe.length+Me.length;var Ie=0,je=0;for(var Ce=0;Ce<Ee.length-1;Ce++){// Sum all words with the same `i + j = k` and accumulate `ncarry`,\n// note that ncarry could be >= 0x3ffffff\nvar Pe=je;je=0;var Te=67108863&Ie,Ne=Math.min(Ce,Me.length-1);for(var Ae=Math.max(0,Ce-xe.length+1);Ae<=Ne;Ae++){var Re=Ce-Ae,Le=0|xe.words[Re],He=0|Me.words[Ae],qe=Le*He,Oe=67108863&qe;Pe=0|Pe+(0|qe/67108864),Oe=0|Oe+Te,Te=67108863&Oe,Pe=0|Pe+(Oe>>>26),je+=Pe>>>26,Pe&=67108863}Ee.words[Ce]=Te,Ie=Pe,Pe=je}return 0===Ie?Ee.length--:Ee.words[Ce]=Ie,Ee.strip()}", "title": "" }, { "docid": "5dd8e71e1ef28d61b8f26642a47c681b", "score": "0.420209", "text": "function oe$1(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}", "title": "" }, { "docid": "914c7a5ce8059207fa6ee25d99d7b99a", "score": "0.4201399", "text": "function Re(t) {\n const e = N$1(t);\n if (null === e.ee) {\n e.ee = [];\n const t = Ae(e), n = Ie(e);\n if (null !== t && null === n) \n // In order to implicitly add key ordering, we must also add the\n // inequality filter field for it to be a valid query.\n // Note that the default inequality field and key ordering is ascending.\n t.Dt() || e.ee.push(new ae(t)), e.ee.push(new ae(lt.Ct(), \"asc\" /* ASCENDING */)); else {\n let t = !1;\n for (const n of e.te) e.ee.push(n), n.field.Dt() && (t = !0);\n if (!t) {\n // The order of the implicit key ordering always matches the last\n // explicit order by\n const t = e.te.length > 0 ? e.te[e.te.length - 1].dir : \"asc\" /* ASCENDING */;\n e.ee.push(new ae(lt.Ct(), t));\n }\n }\n }\n return e.ee;\n }", "title": "" }, { "docid": "ad080be78b87e60f42a53966f740e07c", "score": "0.41994575", "text": "function getSetupSteps()\n{\n return getSetupStepsForServerObject();\n}", "title": "" }, { "docid": "ad080be78b87e60f42a53966f740e07c", "score": "0.41994575", "text": "function getSetupSteps()\n{\n return getSetupStepsForServerObject();\n}", "title": "" }, { "docid": "6263487a5a86f9fa3a8c19e7fc5b11ed", "score": "0.41972682", "text": "hl(t, e) {\n if (Sn(t = this.ol(t, e))) return Dn(\"Unsupported field value:\", e, t), this.nl(t, e);\n if (t instanceof fn) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n return this.cl(t, e), null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.se.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.Gc && 4 /* ArrayArgument */ !== e.zc) throw e.tl(\"Nested arrays are not supported\");\n return this.ll(t, e);\n }\n return this._l(t, e);\n }", "title": "" }, { "docid": "5040d62ad2de80eec7ed647b3042dd45", "score": "0.4194393", "text": "function ValidationCreateStepEnterpriseStepEnterprise() {\n Action.apply( this, arguments );\n }", "title": "" }, { "docid": "f8d8292576fc91729d9cff4b191f8595", "score": "0.41942796", "text": "static fs(t, e, s, n) {\n const i = [];\n return e.forEach(t => {\n i.push({\n type: 0 /* Added */ ,\n doc: t\n });\n }), new le(t, e, ue.hs(e), i, s, n, \n /* syncStateChanged= */ !0, \n /* excludesMetadataChanges= */ !1);\n }", "title": "" }, { "docid": "2cd1e17fdc011d25a2ad7c8e430eda7d", "score": "0.41932505", "text": "function Je(t, n, e) {\n const s = n, r = Ge(\"where\", t);\n return new Ke(r, s, e);\n }", "title": "" }, { "docid": "44e3575cfd93c02648f493e1c4022076", "score": "0.41817555", "text": "function getTwoExpressions( eCo ) {\n\n var angle; \n\n if ( eCo[0] >= 0 && eCo[1] >= 0 ) {\n\n angle = ( 180 / Math.PI ) * ( Math.atan( eCo[ 1 ] / eCo[ 0 ] ));\n\n } else if ( eCo[0] <= 0 && eCo[1] > 0 ) {\n\n angle = 180 + ( 180 / Math.PI ) * ( Math.atan( eCo[ 1 ] / eCo[ 0 ] ));\n\n } else if ( eCo[0] <= 0 && eCo[1] <= 0 ) {\n \n angle = 180 + ( 180 / Math.PI ) * ( Math.atan( eCo[ 1 ] / eCo[ 0 ] ));\n\n } else if ( eCo[0] >= 0 && eCo[1] < 0 ) {\n\n angle = 360 + ( 180 / Math.PI ) * ( Math.atan( eCo[ 1 ] / eCo[ 0 ] ));\n\n }\n\n\n // calculate amount away from far edge going anti-clockwise through wheel to calc ratio of each expression amount\n var amountAwayFromFarEdge;\n var sector;\n if ( angle <= 36 || angle > 324 ) {\n\n sector = 0;\n\n if ( angle <= 36 ) {\n\n amountAwayFromFarEdge = ( 36 - angle ) / 72;\n\n } else {\n\n amountAwayFromFarEdge = ( 36 + 360 - angle ) / 72;\n\n }\n \n\n } else if ( angle <= 108 && angle > 36 ) {\n\n sector = 1;\n amountAwayFromFarEdge = ( 108 - angle ) / 72;\n\n } else if ( angle <= 180 && angle > 108 ) {\n\n sector = 2;\n amountAwayFromFarEdge = ( 180 - angle ) / 72;\n\n } else if ( angle <= 252 && angle > 180 ) {\n\n sector = 3;\n amountAwayFromFarEdge = ( 252 - angle ) / 72;\n\n } else if ( angle <= 324 && angle > 252 ) {\n\n sector = 4;\n amountAwayFromFarEdge = ( 324 - angle ) / 72;\n\n }\n\n return [ sector, amountAwayFromFarEdge ];\n\n}", "title": "" }, { "docid": "f73c7436cc1233c8fd08122db917e30d", "score": "0.41698343", "text": "function Qe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" } ]
d78670c07269219478c5fbe5f2a735d4
Insert a raw character (e.g. ^A)
[ { "docid": "0aa610772b77a8a3414dbadb9f0295b5", "score": "0.0", "text": "function rl_quoted_insert(count, key) {\n _rl_insert_next = true;\n}", "title": "" } ]
[ { "docid": "4bba5cca2692042b2f2c708b56bd8b28", "score": "0.72679216", "text": "function a() {\n \n //place special character in user text\n input.value += \"\\xE1\";\n \n}", "title": "" }, { "docid": "54e291194f4722e4825e0b8a87e4ad2d", "score": "0.6445359", "text": "function Insert(ch)\n{\n str += ch;\n}", "title": "" }, { "docid": "7b251bd383a89da038eced0c94ab4ece", "score": "0.6425366", "text": "function Insert(ch)\n{\n // write code here\n str += ch;\n}", "title": "" }, { "docid": "e5351b349bfa6dec8cd7d3c4390fb026", "score": "0.6404616", "text": "function addChar(target, char)\n {\n // for triggering key events, first extra is char\n target[0].value = target[0].value + char;\n }", "title": "" }, { "docid": "ab98b3f326b598d35eae57f99fa8080e", "score": "0.6401883", "text": "AddInputCharacter(c) { this.native.AddInputCharacter(c); }", "title": "" }, { "docid": "c2bcffdbb01a29f0f692c809604d5ce9", "score": "0.63405865", "text": "function ascii(chr) {\n return (/[ -~]/.test(chr)) ? chr : misc.color('.', 'grey');\n }", "title": "" }, { "docid": "0acbf6e95dbccc2ace8e304510b42d57", "score": "0.62953633", "text": "function encode(data, ch) {\n var term = ace.session.term;\n if (!term.utfMouse) {\n if (ch === 255) return data.push(0);\n if (ch > 127) ch = 127;\n data.push(ch);\n }\n else {\n if (ch === 2047) return data.push(0);\n if (ch < 127) {\n data.push(ch);\n }\n else {\n if (ch > 2047) ch = 2047;\n data.push(0xC0 | (ch >> 6));\n data.push(0x80 | (ch & 0x3F));\n }\n }\n }", "title": "" }, { "docid": "39bbece9ceb371f20b468d5a44f0ff39", "score": "0.60975343", "text": "function cll() {\n return ESC + '[K';\n}", "title": "" }, { "docid": "f9adbd4f22bee4a9e371cf738c549bce", "score": "0.60773116", "text": "function addChar(e) {\n return e + 'a'\n}", "title": "" }, { "docid": "ccc6d00a45c01c134f7a52e2e722b48d", "score": "0.60689", "text": "function _char(c) {\n\t\tif (!_CHARS[c]) {\n\t\t\t_CHARS[c] = '\\\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);\n\t\t}\n\t\treturn _CHARS[c];\n\t}", "title": "" }, { "docid": "3ccfaba20d340f5576d4296b60ebead5", "score": "0.60591954", "text": "function setChar(index, chr)\n {\n // alert(chr);\n this.text = this.text.substring(0, index) + chr + this.text.substring(index + 1);\n this.setText(this.text, false);\n }", "title": "" }, { "docid": "0869ce4d8abf17432aa729ab168264b2", "score": "0.597963", "text": "function insertChar(charCode) {\n var state = getState();\n removeExtraStuff(state);\n var myChar = String.fromCharCode(charCode);\n if (state.selection.start !== state.selection.end) {\n state.value = clearRange(state.value, state.selection.start, state.selection.end);\n }\n dotPos = state.value.indexOf('.');\n if (myChar === '.' && dotPos !== -1) {\n // If there is already a dot in the field, don't do anything\n return;\n }\n if (state.value.length - (dotPos === -1 && myChar !== '.' ? 0 : 1) >= config.digits) {\n // If inserting the new value makes the field too long, don't do anything\n return;\n }\n state.value = state.value.substring(0, state.selection.start) + myChar +\n state.value.substring(state.selection.start);\n addExtraStuff(state, false);\n setState(state);\n }", "title": "" }, { "docid": "46ebe3ea819e2480020c5d54ea1ba4c1", "score": "0.5939299", "text": "function placeHolder(code) {\n if (code >= 32)\n return null;\n if (code == 10)\n return \"\\u2424\";\n return String.fromCharCode(9216 + code);\n}", "title": "" }, { "docid": "4d766d21d67b9596597e4a127ecaa4e2", "score": "0.59380496", "text": "function enterChar()\n {\n var char = chars.shift();\n\n // still have something to type\n if (char)\n {\n // list events to trigger asynchronously\n // and group events needed to be triggered synchronously\n // as second dimension array\n this._triggerEvents(target,\n [\n ['keydown', 'keypress', addChar, 'input'],\n 'keyup'\n ], char, enterChar.bind(this));\n }\n else\n {\n // be done after that\n this._delayedCallback(callback);\n }\n }", "title": "" }, { "docid": "35311c26aadaf1112d2da25f975faa9c", "score": "0.5918545", "text": "function makeChar(charCode) {\n\t\t\tcharCode = charCode|0;\n\t\t\treturn (charCode << 5)|0x11;\n\t\t}", "title": "" }, { "docid": "cccf44c3dc2f6086079ac4b6524d3bc1", "score": "0.59096444", "text": "function escapeChar(ch) {\n\tlet charCode = ch.charCodeAt(0);\n\tif(charCode <= 0xFF) {\n\t\treturn '\\\\x' + pad(charCode.toString(16).toUpperCase());\n\t} else {\n\t\treturn '\\\\u' + pad(charCode.toString(16).toUpperCase(),4);\n\t}\n}", "title": "" }, { "docid": "6e7db1e1fa635f5621a76f3a93ef90ba", "score": "0.58991796", "text": "function ascii(a) {\n return String.fromCharCode(a);\n }", "title": "" }, { "docid": "5225c4bf9dde40d218adc174b8e1f7e8", "score": "0.5898307", "text": "function placeHolder(code) {\n if (code >= 32)\n return null;\n if (code == 10)\n return \"\\u2424\";\n return String.fromCharCode(9216 + code);\n }", "title": "" }, { "docid": "a8ea4e6658ad0d77133642784d182b4b", "score": "0.58759606", "text": "function input(character) {\n\t\tremoveNbsp();\n\t\tscreenDown.innerHTML += character;\n\t}", "title": "" }, { "docid": "f93f2891523d06bd8350cfa3524394e4", "score": "0.5863059", "text": "function show_char(c) /* (c : char) -> string */ {\n var _x24 = (((c < 0x0020)) || ((c > 0x007E)));\n if (_x24) {\n if ((c === 0x000A)) {\n return \"\\\\n\";\n }\n else {\n if ((c === 0x000D)) {\n return \"\\\\r\";\n }\n else {\n if ((c === 0x0009)) {\n return \"\\\\t\";\n }\n else {\n var _x25 = $std_core._int_le(c,255);\n if (_x25) {\n return ((\"\\\\x\") + (show_hex(c, 2, undefined, \"\")));\n }\n else {\n var _x26 = $std_core._int_le(c,65535);\n if (_x26) {\n return ((\"\\\\u\") + (show_hex(c, 4, undefined, \"\")));\n }\n else {\n return ((\"\\\\U\") + (show_hex(c, 6, undefined, \"\")));\n }\n }\n }\n }\n }\n }\n else {\n if ((c === 0x0027)) {\n return \"\\\\\\'\";\n }\n else {\n if ((c === 0x0022)) {\n return \"\\\\\\\"\";\n }\n else {\n return ((c === 0x005C)) ? \"\\\\\\\\\" : string(c);\n }\n }\n }\n}", "title": "" }, { "docid": "425ea1d7f4f39dd91cd46c08d6b213f3", "score": "0.57703906", "text": "function addChar() {\n $(\"success\").classList.add(\"hidden\");\n $(\"error\").classList.add(\"hidden\");\n document.body.style.backgroundColor = \"white\";\n let code = $(\"code\").innerText;\n if(code.length < CODE_LENGTH)\n $(\"code\").innerText += this.innerText;\n }", "title": "" }, { "docid": "384225a37265d4736f21adda40ef50af", "score": "0.57635593", "text": "charPrint (c = 'X') {\n for (let i = 0; i < this.height; i++) {\n for (let j = 0; j < this.width; j++) {\n process.stdout.write(c);\n }\n process.stdout.write('\\n');\n }\n }", "title": "" }, { "docid": "3b6b8c946674f714e4813bc0e7240de8", "score": "0.5736409", "text": "function encode(data, ch) {\n if (!self.utfMouse) {\n if (ch === 255) return data.push(0);\n if (ch > 127) ch = 127;\n data.push(ch);\n } else {\n if (ch === 2047) return data.push(0);\n if (ch < 127) {\n data.push(ch);\n } else {\n if (ch > 2047) ch = 2047;\n data.push(0xC0 | (ch >> 6));\n data.push(0x80 | (ch & 0x3F));\n }\n }\n }", "title": "" }, { "docid": "f3ab394cb12760c7ccee0200ba490d1f", "score": "0.5661396", "text": "function writeAccelerator() {\n\tdocument.getElementById('accelerator').value = accelerator.ctrl ? 'CTRL ' : '';\n\tdocument.getElementById('accelerator').value += accelerator.alt ? 'ALT ' : '';\n\tdocument.getElementById('accelerator').value += accelerator.shift ? 'SHIFT ' : '';\n\tdocument.getElementById('accelerator').value += String.fromCharCode(accelerator.key);\n}", "title": "" }, { "docid": "9fc69714173692984f1152404b9eb281", "score": "0.5652504", "text": "function escapeChar (match) {\n\treturn '\\\\' + escapes[match];\n}", "title": "" }, { "docid": "0e388ca1615778cfb95d1bf17b3fa55a", "score": "0.56510437", "text": "function simulateKeyPress(character) {\r\n\t\tevtype = (character == '+' || character == '-') ? \"keydown\" : \"keypress\";\r\n\t\tjQuery.event.trigger({ type : evtype, which : character.charCodeAt(0)});\r\n\t}", "title": "" }, { "docid": "dd14b2452607c67ae25b3f3976a43435", "score": "0.5622447", "text": "function Char(c) {\n Chars[ this.value = c ] = this;\n}", "title": "" }, { "docid": "80469ead612e4fe706cfe1615932858b", "score": "0.56172", "text": "function convertKeyCode(a) {\r\n var chara = \"\";\r\n if(a == 10){\r\n chara=\"A\"\r\n }\r\n \r\n return chara;\r\n \r\n }", "title": "" }, { "docid": "2328b5857aa7f98421bfda3fb03d5ee2", "score": "0.5614284", "text": "function insertAtCursor(text) {\n let field = document.getElementById(\"user-input\");\n // IE support\n if (document.selection) {\n field.focus();\n let sel = document.selection.createRange();\n sel.text = text;\n }\n // MOZILLA and others\n else if (field.selectionStart || field.selectionStart == '0') {\n let startPos = field.selectionStart;\n let endPos = field.selectionEnd;\n field.value = field.value.substring(0, startPos)\n + text\n + field.value.substring(endPos, field.value.length);\n } else {\n field.value += text;\n }\n}", "title": "" }, { "docid": "79664b368876f5004fa653c704a1c3c5", "score": "0.5610365", "text": "function charPressed(event) {\n chrCode = event.which;\n if (chrCode > 41) {\n return(String.fromCharCode(chrCode));\n } else {\n return(\"\");\n }\n\n}", "title": "" }, { "docid": "de60214411d43ec001e69479a5958eee", "score": "0.5608371", "text": "function encodeASCII(input) {\n return input;\n}", "title": "" }, { "docid": "b3145dc1b79cf7ba288620691844c3a3", "score": "0.5595456", "text": "function chr(i) {\n\treturn String.fromCharCode(i);\n}", "title": "" }, { "docid": "dd1da0054c1a4e8d37bfa7cebc516cf1", "score": "0.5591277", "text": "_aec(code) {\n return String.fromCharCode(27) + \"[\" + code;\n }", "title": "" }, { "docid": "2f617dae01fb84e5e71e9e7024a737df", "score": "0.5573088", "text": "function cursorUp(n) {\n n = typeof n === 'number' ? n : 1;\n return n > 0 ? ESC + '[' + n + 'A' : '';\n}", "title": "" }, { "docid": "337a48bd53b30a6679ab4943ee242ead", "score": "0.5504776", "text": "function fill (length, chr) {\n var result = '', i;\n for (i = 0; i < length; ++i) {\n result += chr;\n }\n return result;\n }", "title": "" }, { "docid": "8237465116d7e6f6fd1ec0b3b79ed602", "score": "0.5498366", "text": "function encodeCharacter (chr) {\n var\n result = '',\n octets = utf8.encode(chr),\n octet,\n index;\n for (index = 0; index < octets.length; index += 1) {\n octet = octets.charCodeAt(index);\n result += '%' + (octet < 0x10 ? '0' : '') + octet.toString(16).toUpperCase();\n }\n return result;\n }", "title": "" }, { "docid": "8237465116d7e6f6fd1ec0b3b79ed602", "score": "0.5498366", "text": "function encodeCharacter (chr) {\n var\n result = '',\n octets = utf8.encode(chr),\n octet,\n index;\n for (index = 0; index < octets.length; index += 1) {\n octet = octets.charCodeAt(index);\n result += '%' + (octet < 0x10 ? '0' : '') + octet.toString(16).toUpperCase();\n }\n return result;\n }", "title": "" }, { "docid": "71cdb7d51b79a07a0120fe43454b9ac5", "score": "0.5495899", "text": "function encodeCharacter (chr) {\r\n var\r\n result = '',\r\n octets = utf8.encode(chr),\r\n octet,\r\n index;\r\n for (index = 0; index < octets.length; index += 1) {\r\n octet = octets.charCodeAt(index);\r\n result += '%' + (octet < 0x10 ? '0' : '') + octet.toString(16).toUpperCase();\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "71cdb7d51b79a07a0120fe43454b9ac5", "score": "0.5495899", "text": "function encodeCharacter (chr) {\r\n var\r\n result = '',\r\n octets = utf8.encode(chr),\r\n octet,\r\n index;\r\n for (index = 0; index < octets.length; index += 1) {\r\n octet = octets.charCodeAt(index);\r\n result += '%' + (octet < 0x10 ? '0' : '') + octet.toString(16).toUpperCase();\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "5f8bb6dc529c4bbf5e0b1075dc16dbde", "score": "0.54952097", "text": "function prependModifier(value, symbol) {\r\n return typeof value === 'string' ? symbol + value : value;\r\n}", "title": "" }, { "docid": "f29ecd747e276fd876b38448739c4e2d", "score": "0.5493308", "text": "encodeSpecials() {\n const value = this.value;\n const regex = /(\\'|\"|\\\\x00|\\\\\\\\(?![\\\\\\\\NGETHLnlr]))/g;\n return value.replace(regex, '\\\\\\\\$0');\n }", "title": "" }, { "docid": "1f502383ce1577cc20bb6c0762c85b0c", "score": "0.54905033", "text": "function insert_a(text, script) {\r\n const a = (script == Script.CYRL) ? '\\u0430' : 'a'; // roman a or cyrl a\r\n text = text.replace(new RegExp(`([ක-ෆ])([^\\u0DCF-\\u0DDF\\u0DCA${a}])`, 'g'), `$1${a}$2`);\r\n text = text.replace(new RegExp(`([ක-ෆ])([^\\u0DCF-\\u0DDF\\u0DCA${a}])`, 'g'), `$1${a}$2`);\r\n return text.replace(/([ක-ෆ])$/g, `$1${a}`); // conso at the end of string not matched by regex above\r\n}", "title": "" }, { "docid": "252a6da061d5e1b35e807591a43fbb4d", "score": "0.54861194", "text": "function readEscapedChar() {\n var ch = input.charCodeAt(++tokPos);\n var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3));\n if (octal) octal = octal[0];\n while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, -1);\n if (octal === \"0\") octal = null;\n ++tokPos;\n if (octal) {\n if (strict) raise(tokPos - 2, \"Octal literal in strict mode\");\n tokPos += octal.length - 1;\n return String.fromCharCode(parseInt(octal, 8));\n } else {\n switch (ch) {\n case 110: return \"\\n\"; // 'n' -> '\\n'\n case 114: return \"\\r\"; // 'r' -> '\\r'\n case 120: return String.fromCharCode(readHexChar(2)); // 'x'\n case 117: return readCodePoint(); // 'u'\n case 116: return \"\\t\"; // 't' -> '\\t'\n case 98: return \"\\b\"; // 'b' -> '\\b'\n case 118: return \"\\u000b\"; // 'v' -> '\\u000b'\n case 102: return \"\\f\"; // 'f' -> '\\f'\n case 48: return \"\\0\"; // 0 -> '\\0'\n case 13: if (input.charCodeAt(tokPos) === 10) ++tokPos; // '\\r\\n'\n case 10: // ' \\n'\n if (options.locations) { tokLineStart = tokPos; ++tokCurLine; }\n return \"\";\n default: return String.fromCharCode(ch);\n }\n }\n }", "title": "" }, { "docid": "252a6da061d5e1b35e807591a43fbb4d", "score": "0.54861194", "text": "function readEscapedChar() {\n var ch = input.charCodeAt(++tokPos);\n var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3));\n if (octal) octal = octal[0];\n while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, -1);\n if (octal === \"0\") octal = null;\n ++tokPos;\n if (octal) {\n if (strict) raise(tokPos - 2, \"Octal literal in strict mode\");\n tokPos += octal.length - 1;\n return String.fromCharCode(parseInt(octal, 8));\n } else {\n switch (ch) {\n case 110: return \"\\n\"; // 'n' -> '\\n'\n case 114: return \"\\r\"; // 'r' -> '\\r'\n case 120: return String.fromCharCode(readHexChar(2)); // 'x'\n case 117: return readCodePoint(); // 'u'\n case 116: return \"\\t\"; // 't' -> '\\t'\n case 98: return \"\\b\"; // 'b' -> '\\b'\n case 118: return \"\\u000b\"; // 'v' -> '\\u000b'\n case 102: return \"\\f\"; // 'f' -> '\\f'\n case 48: return \"\\0\"; // 0 -> '\\0'\n case 13: if (input.charCodeAt(tokPos) === 10) ++tokPos; // '\\r\\n'\n case 10: // ' \\n'\n if (options.locations) { tokLineStart = tokPos; ++tokCurLine; }\n return \"\";\n default: return String.fromCharCode(ch);\n }\n }\n }", "title": "" }, { "docid": "826a8bbe77e45da67f06512d43eb227f", "score": "0.5484323", "text": "function insertAtCaret(ctrl, val)\n {\n if(insertionS != insertionE) deleteSelection(ctrl);\n\n if(gecko && document.createEvent && !window.opera)\n {\n var e = document.createEvent(\"KeyboardEvent\");\n\n if(e.initKeyEvent && ctrl.dispatchEvent)\n {\n e.initKeyEvent(\"keypress\", // in DOMString typeArg,\n false, // in boolean canBubbleArg,\n true, // in boolean cancelableArg,\n null, // in nsIDOMAbstractView viewArg, specifies UIEvent.view. This value may be null;\n false, // in boolean ctrlKeyArg,\n false, // in boolean altKeyArg,\n false, // in boolean shiftKeyArg,\n false, // in boolean metaKeyArg,\n null, // key code;\n val.charCodeAt(0));// char code.\n\n ctrl.dispatchEvent(e);\n }\n }\n else\n {\n var tmp = (document.selection && !window.opera) ? ctrl.value.replace(/\\r/g,\"\") : ctrl.value;\n ctrl.value = tmp.substring(0, insertionS) + val + tmp.substring(insertionS, tmp.length);\n }\n\n setRange(ctrl, insertionS + val.length, insertionS + val.length);\n }", "title": "" }, { "docid": "8ad8a94dc001fbff23a22bfd67f0dd2c", "score": "0.5476411", "text": "function decodeControlCharacter(char) {\n switch (char) {\n case \"t\":\n return 0x09;\n\n case \"n\":\n return 0x0a;\n\n case \"r\":\n return 0x0d;\n\n case '\"':\n return 0x22;\n\n case \"′\":\n return 0x27;\n\n case \"\\\\\":\n return 0x5c;\n }\n\n return -1;\n}", "title": "" }, { "docid": "1c6c28108d2d243b0e0652fed35fd326", "score": "0.5463275", "text": "function ohi_Roman(keyCode) {\n ohi_Insert(0, keyCode);\n}", "title": "" }, { "docid": "2f3c9bcbb2e87ee94f56a8dcc3cd44ce", "score": "0.5446116", "text": "function encode_first_character(string) {\n return '&#' + string.charCodeAt(0) + ';';\n}", "title": "" }, { "docid": "86d09f25f988773c15869d8ec336e052", "score": "0.5429762", "text": "function displayChar(x){\n\t\t\tcharDisplay.value+=x;\n\t\t\tspan.innerHTML+=x;\n\t\t}", "title": "" }, { "docid": "3d283f591f32487c4e4a63868942667c", "score": "0.54215914", "text": "generateSpecialChar() {\n var s = \"!\\\"§$%&/()=?\\u{20ac}\";\n\n return s.substr(Math.floor(s.length * Math.random()), 1);\n }", "title": "" }, { "docid": "32b2b64288f15f9a554aa92450adc0bd", "score": "0.5419218", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n }", "title": "" }, { "docid": "153dec85f278a40585e26dd88217c9be", "score": "0.54178685", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "153dec85f278a40585e26dd88217c9be", "score": "0.54178685", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4ade2ce2de39dd96e692cebb80852fbc", "score": "0.54080176", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n }", "title": "" }, { "docid": "4ade2ce2de39dd96e692cebb80852fbc", "score": "0.54080176", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n }", "title": "" }, { "docid": "4ade2ce2de39dd96e692cebb80852fbc", "score": "0.54080176", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n }", "title": "" }, { "docid": "4ade2ce2de39dd96e692cebb80852fbc", "score": "0.54080176", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n }", "title": "" }, { "docid": "4ade2ce2de39dd96e692cebb80852fbc", "score": "0.54080176", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n }", "title": "" }, { "docid": "4ade2ce2de39dd96e692cebb80852fbc", "score": "0.54080176", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n }", "title": "" }, { "docid": "59d09b69ac34e9984479ad6c90f3bc21", "score": "0.5394814", "text": "function charCode(chr) {\n var esc = /^\\\\[xu](.+)/.exec(chr);\n return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\\\' ? 1 : 0);\n }", "title": "" }, { "docid": "59d09b69ac34e9984479ad6c90f3bc21", "score": "0.5394814", "text": "function charCode(chr) {\n var esc = /^\\\\[xu](.+)/.exec(chr);\n return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\\\' ? 1 : 0);\n }", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "4bc352fbbb5cd7319df1f6043c472d3e", "score": "0.5385577", "text": "function prependModifier(value, symbol) {\n return typeof value === 'string' ? symbol + value : value;\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" }, { "docid": "b578409f2ab11feb6dffa6a025b72617", "score": "0.53828126", "text": "function prependModifier (value, symbol) {\n return typeof value === 'string' ? symbol + value : value\n}", "title": "" } ]
04a185a1b476b990ce3c8fe78e60cae0
return the page name for purposes of figuring out which part of the nav is highlighted/selected
[ { "docid": "d84fffcfc81e1831a3237ab51b6ed97f", "score": "0.63764155", "text": "function normalizePageName (page) {\n // notifications/mentions and settings/foo are a special case; they show as selected in the nav\n return page === 'notifications/mentions'\n ? 'notifications'\n : (page && page.startsWith('settings/'))\n ? 'settings'\n : page\n}", "title": "" } ]
[ { "docid": "7db19f3aaf81a859527e713b15d4ee28", "score": "0.6904159", "text": "function getPageName() {\n var name = document.title;\n return name;\n}", "title": "" }, { "docid": "895d93096b986340880cc04bfea7374b", "score": "0.6835627", "text": "function getPageName(path) {\n\t\t\t\tswitch (path) {\n\t\t\t\t\tcase \"/carousel\":\n\t\t\t\t\t\treturn \"Carousel page\";\n\t\t\t\t\tcase \"/list\":\n\t\t\t\t\t\treturn \"List page\";\n\t\t\t\t\tcase \"/ball\":\n\t\t\t\t\t\treturn \"Ball page\";\n\t\t\t\t\tcase \"/explosion\":\n\t\t\t\t\t\treturn \"Big Bang page\";\n\t\t\t\t\tcase \"/bh\":\n\t\t\t\t\t\treturn \"Black hole page\";\n\t\t\t\t\tcase \"/cannon\":\n\t\t\t\t\t\treturn \"Stars cannon page\";\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn \"Main page\";\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "7f9cf391903d4e68eda1bdd04b1060e6", "score": "0.6556331", "text": "pageTitle(state) {\n\t\t\treturn state.pageTitle;\n\t\t}", "title": "" }, { "docid": "c4ca5922263d503afcdb0188582fc503", "score": "0.633548", "text": "get pageTitle() {return $(\"//div[@class='_SiteNav-a _SiteNav-at _SiteNav-au _SiteNav-av']\")}", "title": "" }, { "docid": "2ec16a799425913f8458022e735b2597", "score": "0.6334571", "text": "getPageActiveState(num) {\n if (this.state.page === num) {\n return \"page-item active\";\n } else {\n return \"page-item\";\n }\n }", "title": "" }, { "docid": "581b6aa1685d3bb5651aeb3199e98d87", "score": "0.6225929", "text": "get pageName () { return $('.//*[contains(@class, \"CheckoutScreenHeader\")]') }", "title": "" }, { "docid": "89bd446fe6daf47da4bc085468a3d5cd", "score": "0.61857927", "text": "function getPage() {\n var fullpath = location.pathname.substring(1).split(\".\")[0];\n var subpath = fullpath.split(\"/\");\n\n var page = subpath.pop();\n\n if (page == \"main\") {\n var queryString = location.search.substring(1);\n page = queryString.split(\"/\")[0];\n }\n\n return page;\n}", "title": "" }, { "docid": "3a86d5b7f8165908afe3c8786fd3e601", "score": "0.60991627", "text": "function getVisiblePage() {\n\tvar split = window.location.href.split(/[/#/?]/);\n\tfor (var i = 0; i < split.length; i++) {\n\t\tif (split[i].startsWith(\"page=\")) {\n\t\t\treturn split[i].substring(5);\n\t\t}\n\t}\n\tif (window.location.href.contains(\"/nation=\")) {\n\t\treturn \"nation\";\n\t}\n\tif (window.location.href.contains(\"/region=\")) {\n\t\treturn \"region\";\n\t}\n\treturn \"unknown\";\n}", "title": "" }, { "docid": "1f431ab0a22ee389ee1ca2391da4248d", "score": "0.6082071", "text": "currentPageClass(path) {\n const currentPath = this.props.location.pathname;\n if (path === currentPath) {\n return 'nav-link-selected';\n }\n return ''; // No custom className\n }", "title": "" }, { "docid": "c2d8aca4b25727f511e623b45d129ff5", "score": "0.6016368", "text": "function pageNameFromURL(url) {\n if (isCLikiURL()) {\n return pageNameFromCLikiURL(url);\n } else {\n return pageNameFromKiwiURL(url);\n }\n}", "title": "" }, { "docid": "816b1afcfcfa6455c81792952f9044a1", "score": "0.60092866", "text": "buildClassName (index) {\n let result = 'page'\n if (index === this.props.page) {\n result += ' current'\n } else if (index === 0) {\n result += ' previous'\n } else {\n result += ' next'\n }\n return result\n }", "title": "" }, { "docid": "bf2103b5178928f6cfac197aa8143101", "score": "0.59217376", "text": "function getSceneName () {\n const urlParts = window.location.href.split('/')\n const sceneName = urlParts[urlParts.length - 1].split('?')[0]\n return sceneName\n}", "title": "" }, { "docid": "fc0289b90ba8d91091c3182ec5d6604e", "score": "0.5921651", "text": "eventToTitleOfPage(){\n document.querySelectorAll(\"#NameOfPage\").forEach((item, i) => {\n item.innerText=this.pageName;\n\n });\n }", "title": "" }, { "docid": "9aba5076d3f95a1069302f4c7c064b27", "score": "0.5903936", "text": "static get PAGE()\n {\n return 'page';\n }", "title": "" }, { "docid": "af36e481d4bf65d282eb43d86dc7df82", "score": "0.58947307", "text": "function getCurrentListName() {\r\n\tvar listname = $(\".s4-titletext h2 a:first\").html(); //requires JQuery to get list name from ribbon breadcrumb\r\n\t//if (isSP2013) listname = $(\".die a:first\").html(); // for SP 2013\r\n\tif (isSP2013) listname = $(\"#pageTitle\").html(); // for SP 2013\r\n\r\n // if all that above didn't work due to messed up sites like HHS...then get it from the URL..\r\n // kinda elaborate...just to get the List Name... such a pain.\r\n\tif (listname==undefined) {\r\n\t\tvar siteURL = decodeURIComponent(window.location.href); // removes all that URL junk\r\n\t\tvar listName = siteURL.split(SP_siteURL)[1].split('/'); // multi-splittin\r\n\t\tif (listName[1]==\"Lists\") {listname=listName[2]} else {listname=listName[1]} //checks for either List or Doc Library\r\n\t}\r\n\treturn listname;\r\n}", "title": "" }, { "docid": "9e1b1324a30203857285faf315079d31", "score": "0.58918375", "text": "function currentTabName() { return $('#tabs > li#current > a').attr(\"name\") }", "title": "" }, { "docid": "ba9dc5a743bda2b77da02616d53f4b8a", "score": "0.58812964", "text": "function currentPage() {\n\treturn pageStack[pageStack.length-1];\n}", "title": "" }, { "docid": "37ac65ea658f6dba615cdcb44dbe876f", "score": "0.58769107", "text": "function getPageFromURI(uri) {\n var splitURI = uri.split('/');\n var pageName = splitURI[splitURI.length - 1].replace('.html', '');\n\n if (!pageName) {\n pageName = \"index\";\n }\n\n return pageName;\n}", "title": "" }, { "docid": "a402d76cfe46a345d39f9f907d1c0aab", "score": "0.5875928", "text": "function detectPage() { \n\t\t\n\t\tswitch( pageName ) { \n\t\t\t\n\t\t\tcase \"home\":\n\t\t\t\tfiles.push({ name: \"iSee Home Page Class\", src: connectURL + \"js/isee/iSeeHome.js\" , type: \"class\" , active: true });\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"sobre\":\n\t\t\t\tfiles.push({ name: \"iSee About Page Class\", src: connectURL + \"js/isee/iSeeSobre.js\" , type: \"class\" , active: true });\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"solucoes\":\n\t\t\t\tfiles.push({ name: \"iSee Solucoes Page Class\", src: connectURL + \"js/isee/iSeeSolucoes.js\" , type: \"class\" , active: true });\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"update\":\n\t\t\t\tfiles.push({ name: \"iSee Update Page Class\", src: connectURL + \"js/isee/iSeeUpdate.js\" , type: \"class\" , active: true });\n\t\t\tbreak;\n\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "2eae960d33059783bcf98b96273176fd", "score": "0.58544636", "text": "function currentPage() {\r\n\t var path = window.location.pathname;\r\n\t var filename = path.substring(path.lastIndexOf('/')+1);\r\n\t if(filename.indexOf('index') == -1){\r\n\t\t if($(window).width()>=992)\r\n\t \t\t$(\"nav li a[href='\" + filename + \"']\").parent().addClass('active');\r\n\t else\r\n\t\t \t$(\"#side_nav li a[href='\" + filename + \"']\").parent().addClass('active');\r\n\t }\r\n}", "title": "" }, { "docid": "d0f620c3b00911eb10718eba6554488f", "score": "0.58213353", "text": "function navigateToTab (pageName) {\n\tcurrentPage.elem.style.display = \"none\";\n\tcurrentPage.navElem.classList.remove(\"nav-selected\");\n\tcurrentPage.navElem.style.borderTop = \"solid 5px rgba(0,0,0,0)\";\n\tcurrentPage.navElem.style.color = \"#fff\";\n\n\t/* importing themeChange object\n\t * from themeChange.js\n\t * to get the current theme color\n\t */\n\tlet theme = require(\"./themeChange\");\n\n\tcurrentPage = pages[pageName];\n\tcurrentPage.elem.style.display = \"block\";\n\tcurrentPage.navElem.classList.add(\"nav-selected\");\n\tcurrentPage.navElem.style.borderTop = `solid 5px ${theme.changes[0].colors[theme.currentThemeCounter]}`;\n\tcurrentPage.navElem.style.color = `${theme.changes[0].colors[theme.currentThemeCounter]}`;\n\n\tif (pageName===\"contact\")\n\t\tdocument.getElementById(\"image-container\").style.opacity = 0.5;\n\telse\n\t\tdocument.getElementById(\"image-container\").style.opacity = 1;\n}", "title": "" }, { "docid": "9eed0e48581bccc2b7e03a0c4b2226ea", "score": "0.57846445", "text": "function setCurrentPageTitle() {\n $('.nav-title').html(document.title);\n}", "title": "" }, { "docid": "14fbd82be6c4ae66ea4db96a3038eaac", "score": "0.5774525", "text": "function showCurrentPage()\n{\n\tvar page = location.href.split('/').pop();\n\treturn page;\n}", "title": "" }, { "docid": "1ffdbab21fa832b997ca9c9dd4289561", "score": "0.5769529", "text": "_getPageElement(page) {\n if (page.num) {\n return (<Link onClick={this._onNavClick} to={`?page=${page.num}`}>{page.label}</Link>)\n } else {\n return (<span>{page.label}</span>)\n }\n }", "title": "" }, { "docid": "0eb36728fcff65c180820d27aed7c637", "score": "0.5752681", "text": "function getPageName(url) {\r\n var index = url.lastIndexOf(\"/\") + 1;\r\n var filenameWithExtension = url.substr(index);\r\n var filename = filenameWithExtension.split(\".\")[0];\r\n return filename; \r\n}", "title": "" }, { "docid": "5981784a8b44807048ad73bf72f9bc31", "score": "0.5739754", "text": "getName() {\n\t\t\tconst altItem = CONTEXT.getCurrentAltItem();\n\n\t\t\tif (altItem != null) return CONTEXT.getCurrentAltName(altItem);\n\n\t\t\treturn cur.options.back;\n\t\t}", "title": "" }, { "docid": "e7d9a83d536b0e0869e2a19a06b0dd4d", "score": "0.5728014", "text": "getPage(name) {\n return this.pages[name]\n }", "title": "" }, { "docid": "4af73500f295425488afc7a49649a3d0", "score": "0.5725917", "text": "function getCurrentPage()\n{\n\tvar path = window.location.pathname;\n\tvar page = path.substring(path.lastIndexOf('/') + 1);\n\treturn page;\n}", "title": "" }, { "docid": "c941c0d8f0d2d0db669b3ed710050ce2", "score": "0.572059", "text": "onNavTo(pageNum){\n this.pageNum = pageNum;\n this.getPage();\n }", "title": "" }, { "docid": "11c73f015b57c84069ddfa084cf6ab8c", "score": "0.5713149", "text": "function getCurrentWindowName() {\r\n\tvar multiple_page = getCookie(\"xpoe.preference.multiple_page\");\r\n\tif(multiple_page==\"YES\") { \r\n return window.name;\r\n }\r\n return \"\";\r\n}", "title": "" }, { "docid": "a1790d580f12f3be555ed8b091640f2c", "score": "0.57091486", "text": "function GetCurrentPage() {\r\n\t\tfor each(var page in PAGES) {\r\n\t\t\tif($(page[\"path\"]).filter(\":visible\").length) {\r\n\t\t\t\treturn page;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "836499d891a5186adaa756114a45c436", "score": "0.5679927", "text": "function getCurrentSection() {\n var currentSection = window.location.pathname.split('/').pop(); // returns the the current path\n switch (currentSection) {\n case '':\n return 'home';\n case 'pricing':\n return 'pricing';\n case 'features':\n return 'features';\n case 'templates':\n return 'templates';\n case 'contact':\n return 'contact';\n case 'sign-up':\n return 'sign-up';\n case 'team':\n return 'team';\n case '404':\n return '404';\n }\n }", "title": "" }, { "docid": "b10722334e7ef75c9e0124f4e0108310", "score": "0.56543165", "text": "isActivePage(page){\n return (this.props.page == page)? \"active\" : \"\";\n }", "title": "" }, { "docid": "db5d5d9c0c7331af41cff27851e1df99", "score": "0.56512606", "text": "function navigation(page, e) {\n // Shows the description of the selected comic\n if (page === 'description') buildDescription(e)\n // Load the comic\n else buildComic(e)\n}", "title": "" }, { "docid": "5f7030a9eb692fa2867bd100af113d57", "score": "0.5644705", "text": "generatePageNavTitleHtml() {\n const { pageNavTitle } = this.frontMatter;\n return pageNavTitle\n ? `<a class=\"navbar-brand ${PAGE_NAV_TITLE_CLASS}\" href=\"#\">${pageNavTitle.toString()}</a>`\n : '';\n }", "title": "" }, { "docid": "96be70c946ec57fb449d4235d4b80ca4", "score": "0.56439006", "text": "function getPageName(url) {\n var index = url.lastIndexOf(\"/\") + 1;\n var filenameWithExtension = url.substr(index);\n var filename = filenameWithExtension.split(\".\")[0]; // <-- added this line\n return filename; // <-- added this line\n}", "title": "" }, { "docid": "4269c61d1ee84d04b4e8f5f4a91b42ce", "score": "0.56304646", "text": "function whatPage()\r\n{\r\n\tvar locationString = window.location.toString();\r\n\tvar startPoint = 0;\r\n\t// if there is a www\r\n\tif(locationString.indexOf(\"www\") != -1)\r\n\t{\r\n\t\tstartPoint = 39;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tstartPoint = 35;\r\n\t}\t\r\n\t\r\n\tvar stopPoint = locationString.length-1;\r\n\t\r\n\tvar pageNum = locationString.substring(startPoint,stopPoint);\r\n\t\r\n\t// if we get back \"/\" then we are on the first page (ie http://icanhascheezburger.com/)\r\n\tif(pageNum != \"/\")\r\n\t{\r\n\t\treturn pageNum;\r\n\t}\r\n\telse \r\n\t{\r\n\t\treturn 1;\r\n\t}\r\n}", "title": "" }, { "docid": "36c6edb12325459a9dbf6c576aa8a987", "score": "0.562735", "text": "function lsd_navClickHandling(name) {\n\t// Update existing hash\n\tlocation.hash = \"#\"+lsd_alphaNumericOnly(name);\n\t\n\t// Scroll to relevent segment\n\tlsd_scrollToContentName(name);\n}", "title": "" }, { "docid": "9f23a25aea35b75e8ef701495f47efe5", "score": "0.5620346", "text": "async grabTitle() {\n return this.page.title();\n }", "title": "" }, { "docid": "29d31c349dcd13226fbad56c64f89fa2", "score": "0.56200725", "text": "function GetSelection()\n{\n var UrlVar = getUrlVars();\n var Page = UrlVar[0][0];\n if (UrlVar[0][1] != undefined && (Page==\"2R\"|| Page==\"2U\" ))\n {\n Page = Page + getAllUrlParams(window.location.hash).page;\n }\n if (Page == \"3I\") {\n Page = Page + getAllUrlParams(window.location.hash).gt;\n }\n $('#nav ul li').removeClass(\"active\");\n $.each(AppCommon.PortalMenus, function (key, obj) {\n if ($.inArray(Page, obj) !== -1)\n $(GetMenuId(key)).addClass(\"active\");\n\n });\n\n\n}", "title": "" }, { "docid": "0d9957c19f46d1a6f7ea0132ac79361c", "score": "0.56079453", "text": "function onPopAndStart() {\n\tvar loc = location.href;\n\tpageName = loc.substring(loc.lastIndexOf(\"/\")+1);\n\t//If no string found\n\tif (pageName.length === 0) {\n\t\t//show home-div\n\t\tpageName = \"home\";\n\t}\n\t//show right section\n\tdisplaySection(pageName);\n}", "title": "" }, { "docid": "50f169c80d6e1ebc4bda0e19a8c2a993", "score": "0.5596652", "text": "activatePage(pageName){return this.injectLocation({pathSegments:[pageName]})}", "title": "" }, { "docid": "4bb31c1df3925516d5fdb74f960b8d5d", "score": "0.5565066", "text": "getMenuItem(page, children){\n\n let title = pages[page].title || page;\n return(\n <li>\n <a className={classNames({active : getPageRoot(this.state.active) === page})} href={\"#\"+page}>{title}{children}</a>\n </li>\n );\n }", "title": "" }, { "docid": "a2b3309b5d63ade80092d7b6502f1a57", "score": "0.5556177", "text": "function getHTMLname(){\n let path = window.location.pathname;\n let page = path.split(\"/\").pop();\n page = page.replace(\".html\", \"\");\n return page;\n}", "title": "" }, { "docid": "bd2ff59f6115a37f6b3f03147674cca5", "score": "0.5554037", "text": "function getCurrentPage() {\n return $(\"#book\").turn(\"page\");\n }", "title": "" }, { "docid": "56af058e4dac753bd03ded918b2fb1de", "score": "0.55365443", "text": "function getCurrentRouteName(navigationState) {\n if (!navigationState) {\n return null;\n }\n const route = navigationState.routes[navigationState.index];\n // dive into nested navigators\n if (route.routes) {\n return getCurrentRouteName(route);\n }\n return route.routeName;\n}", "title": "" }, { "docid": "84f52904687d6afcbe92218e1c2f3714", "score": "0.5535367", "text": "function getActiveRouteName(navigationState) {\n if (!navigationState) {\n return null;\n }\n const route = navigationState.routes[navigationState.index];\n // dive into nested navigators\n if (route.routes) {\n return getActiveRouteName(route);\n }\n return route.routeName;\n }", "title": "" }, { "docid": "4693c6f0718425f08311e91b2e193da2", "score": "0.5519813", "text": "function navFrom(){\r\n try{\r\n let blogNum = parseInt(location.hash.substring(1));\r\n logs[blogNum].click();\r\n }\r\n catch(e){\r\n console.log(\"Error: unobtainable selection index OR no selection\");\r\n }\r\n}", "title": "" }, { "docid": "c2f542f81865870c7be87345b7e2cc10", "score": "0.5514596", "text": "hazNav(x) {\n this.page = x;\n }", "title": "" }, { "docid": "01864c05058435e45584961792cd8bb0", "score": "0.55112666", "text": "function getBreedNames(currentUrl) {\n let currentUrlSplit = currentUrl.split(\"-\");\n //console.log(currentUrlSplit);\n // if it's a sub-breed\n if (currentUrlSplit.length > 1) {\n currentPage = currentUrlSplit[0];\n currentSubBreedPage = currentUrlSplit[1];\n breedPage = true;\n\n } else { // if it's a breed\n currentPage = currentUrlSplit[0];\n }\n}", "title": "" }, { "docid": "548837d2af9ba675aad7dd1bc17c6ea5", "score": "0.5496009", "text": "function getCurentFileName(){\n var pagePathName= window.location.pathname;\n\treturn pagePathName.substring(pagePathName.lastIndexOf(\"/\") + 1);\n}", "title": "" }, { "docid": "cae0fa8fdc913d833a998d11b699ecb7", "score": "0.5493227", "text": "function setCurrentPage(namePage){\n\tswitch (namePage){\n\t\tcase \"firstPage\":\n\t\t\tcurrentPage = 1;\n\t\t\tbreak;\n\t\tcase \"flickrForm\":\n\t\t\tcurrentPage = 2;\n\t\t\tbreak;\n\t\tcase \"flickrGallery\":\n\t\t\tcurrentPage = 3;\n\t\t\tbreak;\n\t\tcase \"photoViewer\":\n\t\t\tcurrentPage = 4;\n\t\t\tbreak;\n\t\tcase \"europeMap\":\n\t\t\tcurrentPage = 5;\n\t\t\tbreak;\n\t\tcase \"countryGallery\":\n\t\t\tcurrentPage = 6;\n\t\t\tbreak;\n\t\tcase \"fullscreen\":\n\t\t\tcurrentPage = 7;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"Error goPage\"+namePage);\n\t\tbreak;\n\t}\n\tuserPath.push(currentPage);\n}", "title": "" }, { "docid": "eae8da06e60517b7d6431e0385c70b6a", "score": "0.5491029", "text": "function get_paging_text( )\n{\n if( NUMBER_OF_PAGES === 1 ) {\n return \"Seite 1\";\n } else {\n return \"Seite \" + CURRENT_PAGE + \" von \" + NUMBER_OF_PAGES;\n }\n}", "title": "" }, { "docid": "16ebffac46e0a1dea9b16324f1b75fb3", "score": "0.5483608", "text": "function pageMatch( name )\n{\n\tvar url = location.href;\n\n\tvar fname = strip_qstring(baseName(url));\n\treturn fname == name;\n\t\n}", "title": "" }, { "docid": "5d7f6e07c63b06cd094a0e8e3939aea4", "score": "0.54774237", "text": "function pn(x)\t{ // AUTO PREV-NEXT\r\n\tvar pages = new Array('index2','why','gisha','byage','hadracha','siyur0','musa','tanks','zikaron','meizag','taruhot','nofim','xtras','ech','contact','undefined');\r\n\tvar a=location.href.split(\".netlify.com/\"); a=a[1].split(\".htm\"); var pgnm=a[0]; // get current page name\r\n\tif (pgnm==\"\") pgnm=\"index2\";\r\n\tfor(l=0;l<pages.length;l++) {\t\t// loop through \"pages\" array for current page name\r\n\t\tif (pages[l] == pgnm) {var prev=pages[l-1]+\".htm\"; var next=pages[l+1]+\".htm\"}\r\n\t}\r\n\tif(x==\"p\") location.href=prev; else location.href=next;\t\t//redirect\r\n\t} // END AUTO PREV-NEXT", "title": "" }, { "docid": "5c05a6130c53758f7dc4a4cba4d34383", "score": "0.5476092", "text": "function getActiveRouteName(navigationState) {\n if (!navigationState) {\n return null;\n }\n const route = navigationState.routes[navigationState.index];\n // dive into nested navigators\n if (route.routes) {\n return getActiveRouteName(route);\n }\n return route.routeName;\n}", "title": "" }, { "docid": "5c05a6130c53758f7dc4a4cba4d34383", "score": "0.5476092", "text": "function getActiveRouteName(navigationState) {\n if (!navigationState) {\n return null;\n }\n const route = navigationState.routes[navigationState.index];\n // dive into nested navigators\n if (route.routes) {\n return getActiveRouteName(route);\n }\n return route.routeName;\n}", "title": "" }, { "docid": "f7f190aea5f2bb888471721c97da4f05", "score": "0.54728734", "text": "function navigationSelected() {\n var navHome = $('.js-nav-home');\n var navFeatures = $('.js-nav-features');\n var navHiw = $('.js-nav-hiw');\n var navPlans = $('.js-nav-plans');\n var navSelected;\n\n switch(currentPage) {\n case 'home':\n navSelected = navHome;\n break;\n case 'features':\n navSelected = navFeatures;\n break;\n case 'hiw':\n navSelected = navHiw;\n break;\n case 'pricing':\n navSelected = navPlans;\n break;\n default:\n navSelected = null;\n }\n if (navSelected!= null) {\n if (currentPage === 'home') {\n navSelected.addClass('header-logo--selected');\n } else {\n navSelected.addClass('header-navigation__item--selected');\n }\n }\n}", "title": "" }, { "docid": "7bb1d6cc879a2f30f7f5d5a714238a9a", "score": "0.54696196", "text": "function getSceneSiteName($selector) {\n return $selector.text().trim();\n}", "title": "" }, { "docid": "f203832f24e9b6864d4fc8f6534785d7", "score": "0.5448576", "text": "function Utils_GetPagePath() {\n\treturn $(location).attr('pathname');\n}", "title": "" }, { "docid": "f2c6c4e3c309a807887c74cb75cb3727", "score": "0.5447257", "text": "getPageNames() {\n return Object.keys(this.pages)\n }", "title": "" }, { "docid": "bf864e8557016b23342324eace5780ac", "score": "0.5440391", "text": "function setMenuPressed(page) {\n switch (page) {\n case \"index.html\":\n $(\"#p-1\").addClass(\"active\");\n break;\n case \"page-2.html\":\n $(\"#p-2\").addClass(\"active\");\n break;\n case \"page-3.html\":\n $(\"#p-3\").addClass(\"active\");\n break;\n }\n}", "title": "" }, { "docid": "a4c5fcf0404d4ecdd1a4dc31d1c75005", "score": "0.5418532", "text": "function definePage() {\n var fullURL = window.location.href;\n var splitURL = fullURL.split(\"\");\n \n var holder = [];\n\n for(i=27; i < splitURL.length; i++) {\n holder.push(splitURL[i]);\n }\n \n var concatURL = holder.join(\"\");\n \n return concatURL;\n }", "title": "" }, { "docid": "2a09cf973f6481590293ad202eb6b2d6", "score": "0.54176867", "text": "function onPageClicked () {\r\n\tlet $pageNumber = $(this)\r\n\tlet nextPage = parseInt($pageNumber.text())\r\n\t\r\n\tsearchSentenceOnPage(nextPage, function (result) {\r\n\t\tglobalVarPage = nextPage\r\n\t\t\r\n\t\t// change active page\r\n\t\t$('.active').removeClass('active')\r\n\t\t$pageNumber.closest('li').addClass('active')\r\n\t})\r\n}", "title": "" }, { "docid": "163c7c33eecae5315e5d25656d148b57", "score": "0.5411567", "text": "function getThisPage() {\n var result = '';\n var url = window.location.pathname;\n if (url.indexOf('.html', url.length - '.html'.length) !== -1) {\n result = url.split('/').pop();\n }\n\n return result;\n}", "title": "" }, { "docid": "71678c714b7ad7b1b42e7a35bbf026cb", "score": "0.5405117", "text": "function getPageLocation()\n{\n\tvar path = window.location.pathname;\n\treturn path;\n}", "title": "" }, { "docid": "97df6b9b346e093dc90ff706e03db29f", "score": "0.5400372", "text": "function getCurrentRouteName(navigationState: NavigationState): ?string {\n if (!navigationState) {\n return null\n }\n const route = navigationState.routes[navigationState.index]\n // dive into nested navigators\n if (route.routes) {\n return getCurrentRouteName(route)\n }\n return route.routeName\n}", "title": "" }, { "docid": "a42bb8a41fa7f70bdfb05ff690087e86", "score": "0.53925824", "text": "function activeNav() {\n let value = $('[data-page]').attr('data-page');\n let target = $('[data-nav=' + value + ']');\n target.addClass('active');\n }", "title": "" }, { "docid": "573a783dfa6ddc0ada598035900072e4", "score": "0.5391541", "text": "getActivePage() {\n let activePage = <LandingPage />\n switch (this.state.activePage) {\n case \"home\":\n activePage = <LandingPage />;\n break;\n case \"indian\":\n activePage = <Indian />; \n break;\n case \"italian\":\n activePage = <ConstructionPage />;\n break;\n case \"thai\":\n activePage = <ConstructionPage />;\n break;\n default:\n break;\n }\n return activePage;\n }", "title": "" }, { "docid": "0a0d03db7678fec52caf64f9f68efc4d", "score": "0.53889745", "text": "function getCurrentPage() {\n\n\t// remove trailing slash\n\tvar result = window.location.pathname.replace(/\\/$/, '');\n\n\treturn result;\n}", "title": "" }, { "docid": "81038851db7039b927771e978ef0a58d", "score": "0.5382284", "text": "function getDefaultPageID() { \n\tvar pageName = window.location.pathname; \n\n\t// eliminates everything after \"?\" (for Opera browswers)\n\tvar tempIndex1 = pageName.indexOf(\"?\");\n\tif (tempIndex1 != -1) {\n\t\tpageName = pageName.substr(0, tempIndex1);\n\t}\n\t// eliminates everything after \"#\" (for Opera browswers)\n\tvar tempIndex2 = pageName.indexOf(\"#\");\n\tif (tempIndex2 != -1) {\n\t\tpageName = pageName.substr(0, tempIndex2);\n\t}\n\t// eliminates everything after \";\"\n\tvar tempIndex3 = pageName.indexOf(\";\");\n\tif (tempIndex3 != -1) {\n\t\tpageName = pageName.substr(0, tempIndex3);\n\t}\n\n\tvar slashPos = pageName.lastIndexOf(\"/\");\n\tif (slashPos == pageName.length - 1) {\n\t\tpageName = pageName + \"default.asp\"; /****************** SET TO DEFAULT DOC NAME */\n\t}\n\n\twhile (pageName.indexOf(\"/\") == 0) {\n\t\tpageName = pageName.substr(1,pageName.length);\n\t}\n\n\treturn(pageName); \n}", "title": "" }, { "docid": "30b9b1b7df4220f12bb47be16bdd4b6f", "score": "0.53774", "text": "function getUrl(){\n\t\treturn document.navigation.href;\t\t\t\t\t\t\t\t\t//RETURNING CURRENT TAB URL\n\t}", "title": "" }, { "docid": "247b43c22f47df9f236f98bdc2fd3fe2", "score": "0.5361657", "text": "function highlight () {\n // Find the main tag. The id is of the form \"content-foo\" and\n // \"foo\" indicates what navbar item to highlight.\n let collection = document.getElementsByTagName(\"main\");\n let id = collection[0].id;\n let matches = id.match(/content-(.*)/);\n let name = matches[1];\n \n if (name) {\n // Find the entry in the ordered list of the navbar and add a\n // class to the item to let CSS highlight it appropriately.\n let item = document.getElementById(\"nav-\" + name);\n item.classList.add(\"nav-highlight\");\n }\n}", "title": "" }, { "docid": "2e59e3b5e77672b6c6fad4644ff3a22e", "score": "0.5359694", "text": "function getLink(name, href, currentPage) {\n if (currentPage != href) {\n return '<li><a href=\"' + href + '\">' + name + '</a></li>';\n }\n else {\n return '<li class=\"here\">' + name + '</li>';\n }\n}", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "d1292ca3b39eefa1f4f3c01c1ee919cc", "score": "0.5344785", "text": "getCurrentNavigation() {\n return this.currentNavigation;\n }", "title": "" }, { "docid": "763a7134e28326c2f21d67ee1b5b3ea0", "score": "0.53401965", "text": "function changePage(event) {\n if (event.target.tagName === \"A\") {\n const links = ul.querySelectorAll(\"li a\");\n for (let i = 0; i < links.length; i++) {\n links[i].className = \"\";\n }\n event.target.className = \"active\";\n showPage(studentList, event.target.textContent);\n }\n }", "title": "" }, { "docid": "e3d37fcc4a7d391152b49ba6bf7d56c3", "score": "0.53309447", "text": "function nav(name) {\n _.el.find('.' + name).click(function() {\n var me = $(this);\n me.hasClass('dot') ? _.stop().to(me.index()) : me.hasClass('prev') ? _.prev() : _.next();\n });\n }", "title": "" }, { "docid": "4666613a2060ed4e59a271ca86f5966f", "score": "0.5328839", "text": "function activeNav() {\n for (var i = 0; i < 5; i++) {\n if (currentIndex == i) {\n $(\"#page\" + (currentIndex + 1)).addClass(\"active orange\");\n };\n };\n }", "title": "" }, { "docid": "2240a54088361dd53b9fcef2b116797e", "score": "0.53213924", "text": "function personalise_page_tagName (profile)\n{\n\n\tpersonalise_page_attribute(profile['@tagName'], \"tagName\");\n\n\t\n}", "title": "" }, { "docid": "734e256bc48a63370e86aabdf2f452bb", "score": "0.5319718", "text": "function cmGetDefaultPageID() { \r\n\tvar pageName = window.location.pathname; \r\n\r\n\t// eliminates everything after \"?\" (for Opera browswers)\r\n\tvar tempIndex1 = pageName.indexOf(\"?\");\r\n\tif (tempIndex1 != -1) {\r\n\t\tpageName = pageName.substr(0, tempIndex1);\r\n\t}\r\n\t// eliminates everything after \"#\" (for Opera browswers)\r\n\tvar tempIndex2 = pageName.indexOf(\"#\");\r\n\tif (tempIndex2 != -1) {\r\n\t\tpageName = pageName.substr(0, tempIndex2);\r\n\t}\r\n\t// eliminates everything after \";\"\r\n\tvar tempIndex3 = pageName.indexOf(\";\");\r\n\tif (tempIndex3 != -1) {\r\n\t\tpageName = pageName.substr(0, tempIndex3);\r\n\t}\r\n\r\n\tvar slashPos = pageName.lastIndexOf(\"/\");\r\n\tif (slashPos == pageName.length - 1) {\r\n\t\tpageName = pageName + \"default.asp\"; /****************** SET TO DEFAULT DOC NAME */\r\n\t}\r\n\r\n\twhile (pageName.indexOf(\"/\") == 0) {\r\n\t\tpageName = pageName.substr(1,pageName.length);\r\n\t}\r\n\r\n\treturn(pageName); \r\n}", "title": "" }, { "docid": "2b12e91af1973be31207b0a11f50de07", "score": "0.5314554", "text": "function getRouteName(state) {\n if (!state.navigation) return null;\n\n const { currentNavigatorUID, navigators } = state.navigation;\n if (!currentNavigatorUID) return null;\n\n const { index, routes } = navigators[currentNavigatorUID];\n return `[${currentNavigatorUID}] ${routes[index].routeName || routes[index].key}`;\n}", "title": "" }, { "docid": "5cfff1a7e75abd46995375bc6aac6e2c", "score": "0.53137976", "text": "function switchPage() {\n let l;\n if (location.hash) {\n l = location.hash;\n } else if (!location.hash) {\n l = '#home';\n }\n $('.page').hide();\n $(l).show();\n console.log(l)\n menuItemActive(l);\n}", "title": "" }, { "docid": "3651debadced45399377b9c41605f017", "score": "0.53131366", "text": "get heading () { return $('h1.page-title > span.base') }", "title": "" }, { "docid": "fdf74efbec4f029d50ca6f62da9453f3", "score": "0.5299887", "text": "function mobileNavigateToTab (pageName) {\n\tcloseMobileNav();\n\tcurrentPage.elem.style.display = \"none\";\n\tcurrentPage.mobileNavElem.classList.remove(\"mobile-nav-selected\");\n\tcurrentPage.mobileNavElem.style.color = \"#fff\";\n\n\t/* importing themeChange object\n\t * from themeChange.js\n\t * to get the current theme color\n\t */\n\tlet theme = require(\"./themeChange\");\n\n\tcurrentPage = pages[pageName];\n\tcurrentPage.elem.style.display = \"block\";\n\tcurrentPage.mobileNavElem.classList.add(\"mobile-nav-selected\");\n\tcurrentPage.mobileNavElem.style.color = `${theme.changes[0].colors[theme.currentThemeCounter]}`;\n\n\t// change opacity of glitch image\n\tif (pageName===\"home\")\n\t\tdocument.getElementById(\"image-container\").style.opacity = 1;\n\telse\n\t\tdocument.getElementById(\"image-container\").style.opacity = 0.4;\n}", "title": "" }, { "docid": "75bbed663ca937924d79808fa5dd7889", "score": "0.5291716", "text": "function getProjectUrlTitle(){\r\n return get_resource_name().split(\"/\")[6];\r\n}", "title": "" }, { "docid": "aa409e7bbd8a3581092108ec11e1495d", "score": "0.5283102", "text": "function ParsePageTag() {\n\tvar url = window.location.href;\n\n\tvar split = url.indexOf( '?' );\n\tif( split != -1 ) {\n\t\turl = url.substring( 0, split );\n\t}\n\t\n\tsplit = url.lastIndexOf( '/' );\n\tif( split != -1 ) {\n\t\treturn url.substring( split+1 );\n\t} else {\n\t\treturn \"\";\n\t}\n}", "title": "" }, { "docid": "6ce74d09177059062dbb7a99208b3e3e", "score": "0.5283063", "text": "function getActiveRouteName(navigationState) {\n if (!navigationState) {\n return null;\n }\n const route = navigationState.routes[navigationState.index];\n\n if (route.routes) {\n return getActiveRouteName(route);\n }\n return route.routeName;\n}", "title": "" }, { "docid": "5c4ef8e5737cdc40b195ffed8a0e6672", "score": "0.52798593", "text": "function getHeaderTitle(route) {\n const routeName = route.state\n ? route.state.routes[route.state.index].name\n : route.params?.screen || 'Home'\n\n switch (routeName) {\n case 'Notifications':\n return 'Notifications'\n case 'FindPeople':\n return 'Search'\n case 'Connections':\n return 'Connections'\n case 'ActiveChats':\n return 'ActiveChats'\n case 'Requests':\n return 'Requests'\n }\n}", "title": "" }, { "docid": "23c3f8fe762aa5641f44f7163e016a25", "score": "0.5277034", "text": "function urlpagepart(page) {\n\tif(typeof(page)=='undefined' || page < 1) page = 1;\n\treturn 'p=' + page;\n}", "title": "" }, { "docid": "1e7148d935e1d2e8da3f28e3824624dd", "score": "0.5277029", "text": "function setPageTitle() {\n // Set window and section scroll positions and other variables\n var scrollPos = scrollY || pageYOffset,\n windowHeight = $(window).height(),\n navHeight = $('#nav').height(),\n buffer = navHeight + 100,\n landingPos = $('#landing').position().top - buffer,\n aboutPos = $('#about').position().top - buffer,\n contactPos = $('#contact').position().top - buffer,\n isTitleChanged = false;\n\n if (pageTitle !== 'landing' && (scrollPos > landingPos && scrollPos < aboutPos)) {\n pageTitle = 'landing';\n isTitleChanged = true;\n } else if (pageTitle !== 'about' && (scrollPos > aboutPos && scrollPos < contactPos)) {\n pageTitle = 'about';\n isTitleChanged = true;\n } else if (pageTitle !== 'contact' && (scrollPos > contactPos)) {\n pageTitle = 'contact';\n isTitleChanged = true;\n }\n\n if (isTitleChanged) changePageTitle();\n }", "title": "" }, { "docid": "2bd0f244dd8cdf5cf412ee73540975dc", "score": "0.5268595", "text": "static highlightCurrentPage(currentPage) {\n const pageNumbers = document.querySelectorAll('.page');\n const currentPageNumber = document.querySelector(`.page--${currentPage}`);\n pageNumbers.forEach(p => p.classList.remove('active'));\n currentPageNumber.classList.add('active');\n }", "title": "" }, { "docid": "7f5aaa0c662cd7a2f2dfd8dc9020f0da", "score": "0.52651733", "text": "function findURLForLandingPages(curr) {\n var url = window.location.href;\n var setOfLandingPages = new Array();\n setOfLandingPages[0] = \"frenchmuseum\";\n setOfLandingPages[1] = \"springtrends\";\n setOfLandingPages[2] = \"giftguide\";\n setOfLandingPages[3] = \"springcatalog\";\n setOfLandingPages[4] = \"lifeinmotion\";\n setOfLandingPages[5] = \"museumglass\";\n setOfLandingPages[6] = \"shopbystyle\";\n setOfLandingPages[7] = \"holidaycatalog2010\";\n setOfLandingPages[8] = \"holidaycat2010\";\n setOfLandingPages[9] = \"KaboodliciousHome\";\n setOfLandingPages[10] = \"mastercard2\";\n setOfLandingPages[11] = \"harpers\";\n setOfLandingPages[12] = \"hearst\";\n setOfLandingPages[13] = \"giftsfordad\";\n \n\n \n var isLanding;\n var pageName;\n var index = url.indexOf(\"/landing/\");\n var index1 = url.indexOf(\"/business/\");\n if (index != -1 && index1 == -1) {\n var wt_cg = document.createElement(\"meta\");\n //window.getSelection ? wt_cg.name = 'WT.cg_n' : wt_cg.Name = 'WT.cg_n';\n wt_cg.name = 'WT.cg_n';\n wt_cg.content = \"Landing Page\";\n document.getElementsByTagName(\"head\")[0].appendChild(wt_cg);\n var wt_curr = document.createElement(\"meta\");\n //window.getSelection ? wt_curr.name = 'WT.z_cur' : wt_curr.Name = 'WT.z_cur';\n wt_curr.name = 'WT.z_cur';\n wt_curr.content = curr;\n document.getElementsByTagName(\"head\")[0].appendChild(wt_curr);\n }\n else {\n for (var i = 0, len = setOfLandingPages.length; value = setOfLandingPages[i], i < len; i++) {\n isLanding = url.search(value);\n if (isLanding != -1) {\n var wt_cg = document.createElement(\"meta\");\n //window.getSelection ? wt_cg.name = 'WT.cg_n' : wt_cg.Name = 'WT.cg_n';\n wt_cg.name = 'WT.cg_n';\n wt_cg.content = \"Landing Page\";\n document.getElementsByTagName(\"head\")[0].appendChild(wt_cg);\n var wt_curr = document.createElement(\"meta\");\n //window.getSelection ? wt_curr.name = 'WT.z_cur' : wt_curr.Name = 'WT.z_cur';\n wt_curr.name = 'WT.z_cur';\n wt_curr.content = curr;\n document.getElementsByTagName(\"head\")[0].appendChild(wt_curr);\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "480a4a57b635df305b3b21a22d9ebbe1", "score": "0.5263012", "text": "function isNav () {\n\tpg = document.title;\n\t\n\tif (pg == 'Home' || pg == 'Resume' || pg == 'Favorite Sites' || pg == 'My Life' || pg == 'Friends') {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" } ]
669eedf57bc4f822e340f7ade669dd52
Determines if the given control supports multiple input schemas.
[ { "docid": "91a8e840bdda04ffa1e51f8d64d257f1", "score": "0.7069172", "text": "_isMultiSchemaControl(control) {\n\t\tif (control.role === ParamRole.COLUMN && control.valueDef.propType === Type.STRUCTURE) {\n\t\t\treturn true;\n\t\t}\n\t\tif (PropertyUtils.toType(control.subControls) === \"array\") {\n\t\t\tfor (const keyName in control.subControls) {\n\t\t\t\tif (has(control.subControls, keyName)) {\n\t\t\t\t\tconst subControl = control.subControls[keyName];\n\t\t\t\t\tif (subControl.role === ParamRole.COLUMN && subControl.valueDef.propType === Type.STRUCTURE) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" } ]
[ { "docid": "d48bbf733df71a7f096c4e8d3eec5041", "score": "0.7815121", "text": "_canHaveMultipleSchemas() {\n\t\tfor (const keyName in this.controls) {\n\t\t\tif (has(this.controls, keyName)) {\n\t\t\t\tconst control = this.controls[keyName];\n\t\t\t\tif (this._isMultiSchemaControl(control)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "0cf3aea062a385d9576d7f6678407b9f", "score": "0.60147697", "text": "function matchingSchemas(schemas, tagName) {\n if (schemas !== null) {\n for (let i = 0; i < schemas.length; i++) {\n const schema = schemas[i];\n if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "0318e70130352a9e1c9fcddf3b5969e5", "score": "0.5132059", "text": "isValid() {\n return [\"number\", \"shape\", \"color\", \"pattern\"].every(\n (attr) => this._isValidAttr(attr)\n );\n }", "title": "" }, { "docid": "f5ad0548dc1c1f8b2c61def80a75a375", "score": "0.5108804", "text": "function TUnion(schema) {\r\n if (!(IsObject(schema) && schema[Types.Kind] === 'Union' && IsArray(schema.anyOf) && IsOptionalString(schema.$id))) {\r\n return false;\r\n }\r\n for (const inner of schema.anyOf) {\r\n if (!TSchema(inner))\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "43c82b911446e1fc08ac54cc79c22769", "score": "0.5038926", "text": "function hasEachInputAValue(){\n return haveTextInputsAvalue() && isOptionSelected() && isCheckboxChecked();\n }", "title": "" }, { "docid": "f54a6c4c7ffa2611f8b21edc8bda9fc1", "score": "0.50291383", "text": "isSchemaSupported(schema) {\n switch (schema) {\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA224:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA256:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA384:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA512:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA3_224:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA3_256:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA3_384:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithSHA3_512:\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].ECDSAwithRIPEMD160:\n return this.algorithm === _KeyType__WEBPACK_IMPORTED_MODULE_6__[\"KeyType\"].ECDSA;\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].EDDSAwithSHA512:\n return this.algorithm === _KeyType__WEBPACK_IMPORTED_MODULE_6__[\"KeyType\"].EDDSA;\n case _SignatureScheme__WEBPACK_IMPORTED_MODULE_7__[\"SignatureScheme\"].SM2withSM3:\n return this.algorithm === _KeyType__WEBPACK_IMPORTED_MODULE_6__[\"KeyType\"].SM2;\n default:\n throw new Error('Unsupported signature schema.');\n }\n }", "title": "" }, { "docid": "f5d1cf1860d9110c7739a46fb3a70e22", "score": "0.50058943", "text": "function isMixedControls(controlData, pasteArea) {\r\r\n\tvar flag = false, $pasteArea = $(pasteArea);\r\r\n\tif($pasteArea.children(\".element\").length > 0) {\r\r\n\t\tif(controlData.controltype == \"radio\" && $pasteArea.find(\".radio\").length == 0) { flag = true; }\r\r\n\t\telse if(controlData.controltype == \"checkbox\" && $pasteArea.find(\".checkbox\").length == 0) { flag = true; }\r\r\n\t\telse if((controlData.controltype == \"textarea\" || controlData.controltype == \"droparea\") && ($pasteArea.find(\".textarea\").length == 0 && $pasteArea.find(\".droparea\").length == 0)) { flag = true; }\r\r\n\t}\r\r\n\treturn flag;\r\r\n}", "title": "" }, { "docid": "e399c78f5d1f63e6f1bc16f68bb9f045", "score": "0.49807417", "text": "function isOneOf() {\n var toCheck = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return values.includes(toCheck);\n}", "title": "" }, { "docid": "18ff8b83a51addabb6c5ff5d3e9ceb6d", "score": "0.49497738", "text": "function getIsMultiPicklist() {\n\t\t\tif (angular.isDefined(vm.FieldType)) {\n\t\t\t\treturn vm.FieldType.toLowerCase() == 'multipicklist';\n\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "72931bd04838b031fdc4efa098e4bd91", "score": "0.49300992", "text": "hasValidInput(){\n var input = this._getInput();\n return input && ( input.isOfType(Image2D.TYPE()) || input.isOfType(Image3D.TYPE()) );\n }", "title": "" }, { "docid": "bcaee88c054cfd959b78d7419c085269", "score": "0.48600665", "text": "function verifyInputs() {\n for (const [inputName, input] of Object.entries(inputs)) {\n if (!optionalInputNames.has(inputName) && !input.value) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "30c735a004e1a4cb1830cd7983c83293", "score": "0.4846394", "text": "function validateFilesInputs() {\n\tlet fileInputNode = document.getElementById('file-input-field'); //File DOM node\n\tlet cameraInputNode = document.getElementById('camera-input-field'); //Camera DOM node\n\tlet lightInputNode = document.getElementById('light-input-field'); //Illumination DOM node\n\tlet numObjectFiles = fileInputNode.files.length; //Number of selected objects files\n\tlet numCameraFiles = cameraInputNode.files.length; //Number of selected camera files\n\tlet numLightFiles = lightInputNode.files.length // Number of selected light files\n\treturn ( (numCameraFiles == 1) && (numObjectFiles > 0) && (numLightFiles > 0) );\n}", "title": "" }, { "docid": "53aa2a28fd4e270c938d234712ebe787", "score": "0.4775727", "text": "function validateControl(objControl, caption) { \n\t\n\talert(objControl.type);\n\tvar isValid = true;\n\n\tswitch (objControl.type) {\n\t\tcase 'text', 'textarea':\t// Textbox; Textarea\n\t\t\tif (objControl.value == '') {\n\t\t\t\talert(\"Please specify \" + trim(caption));\n\t\t\t\tisValid = false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'select-one':\t\t\t// Dropdown\n\t\t\tif (objControl.value == '') {\n\t\t\t\talert(\"Please select \" + trim(caption));\n\t\t\t\tisValid = false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"select-multiple\":\t\t// Listbox\n\t\t\tif (objControl.value == '') {\n\t\t\t\talert(\"Please select atleast one \" + trim(caption));\n\t\t\t\tisValid = false;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tobjControl.focus();\n\treturn isValid;\n}", "title": "" }, { "docid": "78109956ad26120fbcc03fd357e45f70", "score": "0.47594795", "text": "function validateSchemaArrayType(obj) {\n\t\t var schema = obj[KEYWORD_SCHEMA]\n\t\t , schemaType\n\t\t , schemaJsType;\n\n\t\t\t// Validate that the schema is not null.\n\t\t if (schema === null) {\n\t\t throw \"The '\" +\n\t\t \t\tKEYWORD_SCHEMA +\n\t\t \t\t\"' field's value cannot be null: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t // Validate that the schema exists and that it is an object, either \n\t\t // a JSON object or a JSON array.\n\t\t schemaType = typeof schema;\n\t\t if (schemaType === \"undefined\") {\n\t\t throw \"The '\" +\n\t\t \t\tKEYWORD_SCHEMA +\n\t\t \t\t\"' field is missing: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t schemaJsType = Object.prototype.toString.call(schema);\n\t\t // If it is an array, this is a definition for a data point whose\n\t\t // value will be a constant length array, and each index in that\n\t\t // array must have a defined type. But, the types may vary from\n\t\t // index to index.\n\t\t if (schemaJsType === JS_TYPE_ARRAY) {\n\t\t validateSchemaConstLengthArray(schema);\n\t\t }\n\t\t // If it is an object, this is a definition for a data point whose \n\t\t // value will be a variable length array, but each index's type\n\t\t // must be the same.\n\t\t else if(schemaJsType === JS_TYPE_OBJECT) {\n\t\t validateSchemaConstTypeArray(schema);\n\t\t }\n\t\t // Otherwise, it is invalid.\n\t\t else {\n\t\t \tthrow \"The '\" +\n\t\t \t\t\tKEYWORD_SCHEMA +\n\t\t \t\t\t\"' field's type must be either an array or an object: \" + \n \t\t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t}", "title": "" }, { "docid": "1ae2518598c76de14f3d82929d9d7946", "score": "0.47506455", "text": "multipleOf(jsonSchema) {\n if (!jsonSchema.isEmpty(jsonSchema.multipleOf)) {\n this.jsonSchemaPojo.multipleOf = jsonSchema.multipleOf;\n }\n }", "title": "" }, { "docid": "d1be6260585f97c09805c2710528315e", "score": "0.4735052", "text": "function checkProp(value,schema,path,i){var l;path+=path?typeof i=='number'?'['+i+']':typeof i=='undefined'?'':'.'+i:i;function addError(message){errors.push({property:path,message:message});}if((typeof schema!='object'||schema instanceof Array)&&(path||typeof schema!='function')&&!(schema&&getType(schema))){if(typeof schema=='function'){if(!(value instanceof schema)){addError(\"is not an instance of the class/constructor \"+schema.name);}}else if(schema){addError(\"Invalid schema/property definition \"+schema);}return null;}if(_changing&&schema.readonly){addError(\"is a readonly field, it can not be changed\");}if(schema['extends']){// if it extends another schema, it must pass that schema as well\ncheckProp(value,schema['extends'],path,i);}// validate a value against a type definition\nfunction checkType(type,value){if(type){if(typeof type=='string'&&type!='any'&&(type=='null'?value!==null:typeof value!=type)&&!(value instanceof Array&&type=='array')&&!(value instanceof Date&&type=='date')&&!(type=='integer'&&value%1===0)){return[{property:path,message:typeof value+\" value found, but a \"+type+\" is required\"}];}if(type instanceof Array){var unionErrors=[];for(var j=0;j<type.length;j++){// a union type\nif(!(unionErrors=checkType(type[j],value)).length){break;}}if(unionErrors.length){return unionErrors;}}else if(typeof type=='object'){var priorErrors=errors;errors=[];checkProp(value,type,path);var theseErrors=errors;errors=priorErrors;return theseErrors;}}return[];}if(value===undefined){if(schema.required){addError(\"is missing and it is required\");}}else{errors=errors.concat(checkType(getType(schema),value));if(schema.disallow&&!checkType(schema.disallow,value).length){addError(\" disallowed value was matched\");}if(value!==null){if(value instanceof Array){if(schema.items){var itemsIsArray=schema.items instanceof Array;var propDef=schema.items;for(i=0,l=value.length;i<l;i+=1){if(itemsIsArray)propDef=schema.items[i];if(options.coerce)value[i]=options.coerce(value[i],propDef);errors.concat(checkProp(value[i],propDef,path,i));}}if(schema.minItems&&value.length<schema.minItems){addError(\"There must be a minimum of \"+schema.minItems+\" in the array\");}if(schema.maxItems&&value.length>schema.maxItems){addError(\"There must be a maximum of \"+schema.maxItems+\" in the array\");}}else if(schema.properties||schema.additionalProperties){errors.concat(checkObj(value,schema.properties,path,schema.additionalProperties));}if(schema.pattern&&typeof value=='string'&&!value.match(schema.pattern)){addError(\"does not match the regex pattern \"+schema.pattern);}if(schema.maxLength&&typeof value=='string'&&value.length>schema.maxLength){addError(\"may only be \"+schema.maxLength+\" characters long\");}if(schema.minLength&&typeof value=='string'&&value.length<schema.minLength){addError(\"must be at least \"+schema.minLength+\" characters long\");}if(typeof schema.minimum!==undefined&&typeof value==typeof schema.minimum&&schema.minimum>value){addError(\"must have a minimum value of \"+schema.minimum);}if(typeof schema.maximum!==undefined&&typeof value==typeof schema.maximum&&schema.maximum<value){addError(\"must have a maximum value of \"+schema.maximum);}if(schema['enum']){var enumer=schema['enum'];l=enumer.length;var found;for(var j=0;j<l;j++){if(enumer[j]===value){found=1;break;}}if(!found){addError(\"does not have a value in the enumeration \"+enumer.join(\", \"));}}if(typeof schema.maxDecimal=='number'&&value.toString().match(new RegExp(\"\\\\.[0-9]{\"+(schema.maxDecimal+1)+\",}\"))){addError(\"may only have \"+schema.maxDecimal+\" digits of decimal places\");}}}return null;}// validate an object against a schema", "title": "" }, { "docid": "11f0f1d031b9272ad01967c0e7dea579", "score": "0.47329625", "text": "function validate(value, schemas) {\n return !schemas.every(schema => validateValueForSchema(value, schema));\n}", "title": "" }, { "docid": "628a5c6ac07f008565cb0c5bb7f825d6", "score": "0.47174972", "text": "function isSubControlStructureObjectType(control) {\n\tif (control) {\n\t\tif (control.structureType && control.structureType === \"object\") {\n\t\t\treturn true;\n\t\t} else if (control.subControls) {\n\t\t\tfor (const subControl of control.subControls) {\n\t\t\t\tif (subControl.structureType && subControl.structureType === \"object\") {\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (subControl.subControls) {\n\t\t\t\t\tconst objectType = isSubControlStructureObjectType(subControl);\n\t\t\t\t\tif (objectType) { // continue if false\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "a6dfbd51aee2a29bae6cd94b0af0ea3f", "score": "0.470929", "text": "function validateORMFrameworks(input, errors) {\n // check to make sure there are valid orm framework choices\n if (input.toolingConfigurations.orm &&\n (!choices.ormChoices.includes(input.toolingConfigurations.orm))) {\n errors.push(`Invalid orm choice. Valid choices are ${choices.ormChoices}`);\n }\n}", "title": "" }, { "docid": "e83336245fef1a6d86408b4dfa5a92ad", "score": "0.47082657", "text": "function isArray (value) {\n if(value && typeof value === 'object' && value.constructor === Array){\n return true;\n }\n schemaTypeValidationError.message = `${value} is not of type Array`\n throw schemaTypeValidationError\n return\n \n}", "title": "" }, { "docid": "a86bc1fb4d30fe2b5a3a4aa281290b87", "score": "0.46797562", "text": "function checkResult(schema) {\n var winschema = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]];\n for(var i = 0; i < 4; i++){\n for(var j = 0; j < 4; j++){\n if(schema[i][j] != winschema[i][j]){\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "9ee94ae1ec887a7dfb82508460d63e56", "score": "0.4667172", "text": "hasValidInput(){\n var that = this;\n var inputCategories = Object.keys( this._inputValidator );\n var valid = true;\n \n if(inputCategories.length == 0){\n valid = false;\n console.warn(\"No input validator was added. Filter cannot run. Use addInputValidator(...) to specify input types.\");\n }\n\n inputCategories.forEach( function(key){\n var inputOfCategory = that._getInput( key );\n \n if(inputOfCategory){\n if(\"isOfType\" in inputOfCategory){\n valid = valid && inputOfCategory.isOfType( that._inputValidator[ key ] );\n }else{\n try{\n valid = valid && (inputOfCategory instanceof that._inputValidator[ key ] );\n }catch(e){\n valid = false;\n }\n }\n \n }\n // input simply not existing!\n else{\n valid = false;\n }\n \n });\n\n if(!valid){\n console.warn(\"The input is not valid.\");\n }\n\n return valid;\n }", "title": "" }, { "docid": "1ec0f1286bcb6d696f60de3c2df00adb", "score": "0.46569407", "text": "function workOperationAmTypesOK() {\n var isAmWorkOperationType = operationList[0].WorkOperationType.AM;\n\n var allSame = operationList.every(function (op) {\n return isAmWorkOperationType === op.WorkOperationType.AM;\n });\n\n if (!allSame) {\n error = u4dmSvc.globalization.translate('sit.u4dm.error.start-op.multiple-operation-types');\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "5b65441b4b7704b6393a75196eddfeac", "score": "0.4656702", "text": "function isValid (value){\n return supportedTypes.includes(value)\n}", "title": "" }, { "docid": "dad5277b88bf30e785c158a4a9613c91", "score": "0.46345344", "text": "function isRecord() {\n return [\n checkSchema({\n id : { isUUID : true },\n fruit : { isString : true },\n colour : { isString : true },\n weight : { isInt : true },\n value: { isInt : true }\n }), checkValidation()\n ];\n}", "title": "" }, { "docid": "f7a47cd43deebd704709e624efd1c562", "score": "0.46198702", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[/* isAbstractType */ \"C\"])(typeA)) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[/* isAbstractType */ \"C\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[/* isAbstractType */ \"C\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "0966f7af6cbbe97cfbe5b0c530d9109a", "score": "0.46192676", "text": "function validateSchemaExtender(original, extender) {\n var type = original[KEYWORD_TYPE];\n \n if (type === TYPE_BOOLEAN) {\n validateSchemaExtenderBoolean(original, extender);\n }\n else if (type === TYPE_NUMBER) {\n validateSchemaExtenderNumber(original, extender);\n }\n else if (type === TYPE_STRING) {\n validateSchemaExtenderString(original, extender);\n }\n else if (type === TYPE_OBJECT) {\n validateSchemaExtenderObject(original, extender);\n }\n else if (type === TYPE_ARRAY) {\n validateSchemaExtenderArray(original, extender);\n }\n \n validateSchemaOptionsExtender(original, extender);\n }", "title": "" }, { "docid": "d36770b96dd8b3b4fc730384f868d4fd", "score": "0.45938966", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "d6c42d2aacdf172376ed8c6e7f4b7f73", "score": "0.45906875", "text": "function isArray(input) {\n\t return Object.prototype.toString.call(input) === '[object Array]';\n\t }", "title": "" }, { "docid": "dcb374ee0f2e15c273b7f4f416e5be2c", "score": "0.45799702", "text": "function validateSchemaConstTypeArray(obj) {\n\t\t validateSchemaType(obj);\n\t\t}", "title": "" }, { "docid": "42008adef816f246d51c7fe6b05eaeea", "score": "0.45766765", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "f18d8125fecbba830a74bc7a889cceda", "score": "0.4576114", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "title": "" }, { "docid": "105edb40c1754363d6952092ab428c4a", "score": "0.4570086", "text": "function isMultiselect($el) {\n\t\tvar elSize;\n\n\t\tif ($el[0].multiple) {\n\t\t\treturn true;\n\t\t}\n\n\t\telSize = attrOrProp($el, \"size\");\n\n\t\tif (!elSize || elSize <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "7ef15e4bcb190f8f8807b81d6bc075b7", "score": "0.45634678", "text": "function isMultisigInput (script, allowIncomplete) {\n if (script.chunks.length < 2) return false\n if (script.chunks[0] !== ops.OP_0) return false\n\n if (allowIncomplete) {\n return script.chunks.slice(1).every(function (chunk) {\n return chunk === ops.OP_0 || isCanonicalSignature(chunk)\n })\n }\n\n return script.chunks.slice(1).every(isCanonicalSignature)\n}", "title": "" }, { "docid": "96852fc86c947913b70464c9535020ad", "score": "0.45633718", "text": "function checkSelectPropTypes(props) {\n checkControlledValueProps('select', props);\n for(var i = 0; i < valuePropNames.length; i++){\n var propName = valuePropNames[i];\n if (props[propName] == null) continue;\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) error(\"The `%s` prop supplied to <select> must be an array if `multiple` is true.%s\", propName, getDeclarationErrorAddendum());\n else if (!props.multiple && isArray) error(\"The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s\", propName, getDeclarationErrorAddendum());\n }\n }", "title": "" }, { "docid": "3b9949fc86e4b1b029ddfedfcc7db0fa", "score": "0.45539656", "text": "function is_multiselect(element)\n {\n return (element.is('select') && typeof element.attr('multiple') !== 'undefined' && element.attr('multiple') !== false);\n }", "title": "" }, { "docid": "cd4363c973fc27ca5419c53a0ab2af71", "score": "0.45498705", "text": "function validateSchemaExtenderArray(original, extender) {\n // Ensure that the extending schema is \n if (extender[KEYWORD_TYPE] !== TYPE_ARRAY) {\n throw \"The original schema defined an array, but the \" +\n \"extending schema does not: \" +\n extender;\n }\n \n // Get the different types for an array.\n var originalConstType = original[KEYWORD_CONST_TYPE];\n var originalConstLength = original[KEYWORD_CONST_LENGTH];\n \n // If it is a constant-type array, ensure that the extender is also\n // defining a constant-type array.\n if (typeof originalConstType !== \"undefined\") {\n // Get the type of array for the extender schema.\n var extenderConstType = extender[KEYWORD_CONST_TYPE];\n \n // Ensure that the extender schema is a constant-type as well.\n if (typeof extenderConstType === \"undefined\") {\n throw \"The original schema defined a constant-type \" +\n \"array, but the extending schema did not: \" +\n JSON.stringify(extender);\n }\n \n // Validate the sub-schemas.\n validateSchemaExtender(originalConstType, extenderConstType);\n }\n // Otherwise, it must be a constant-length array, so ensure that\n // the extender is also defining a constant-lenght array.\n else {\n // Get the type of array for the extender schema.\n var extenderConstLength = extender[KEYWORD_CONST_LENGTH];\n\n // Ensure that the extender schema is a constant-length as well.\n if (typeof extenderConstLength === \"undefined\") {\n throw \"The original schema defined a constant-type \" +\n \"array, but the extending schema did not: \" +\n JSON.stringify(extender);\n }\n\n // Ensure that the two schemas are the same length. \n if (originalConstLength.length !== extenderConstLength.length) {\n throw \"The original schema and the extending schema \" +\n \"are different lengths: \" +\n JSON.stringify(extender);\n }\n \n // Ensure each index defines the same schema.\n for (var i = 0; i < originalConstLength.length; i++) {\n validateSchemaExtender(\n originalConstLength[i],\n extenderConstLength[i]);\n }\n }\n }", "title": "" }, { "docid": "4effc8e9f3a4c583958c05c01664d27c", "score": "0.45496753", "text": "function EditableRecordsetMenu_canApplyServerBehavior(sbObj)\r\n{\r\n // NOTE: do not use this.listControl in this function,\r\n // because initializeUI() has not yet been run\r\n \r\n var retVal = true;\r\n \r\n var control = dwscripts.findDOMObject(this.paramName);\r\n \r\n if (control && !control.editable)\r\n { \r\n var nameValueArray = this.findAllRecordsetNames();\r\n\r\n var rsNames = nameValueArray[0];\r\n\r\n if (!sbObj && rsNames.length == 0) //if there are no Recordsets\r\n {\r\n alert(dwscripts.sprintf(MM.MSG_NoRecordsets, dwscripts.getRecordsetDisplayName()));\r\n\r\n retVal = false; //return false to indicate an error\r\n }\r\n }\r\n \r\n return retVal;\r\n}", "title": "" }, { "docid": "74f12cc30c357fc37ca6f49ad891d272", "score": "0.45484355", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__type_definition__[\"n\" /* isAbstractType */])(typeA)) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__type_definition__[\"n\" /* isAbstractType */])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__type_definition__[\"n\" /* isAbstractType */])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "31d49ebc662e56d72ad2cef3b438507c", "score": "0.45362145", "text": "function checkRequestFormat(requests) {\n for (var i = 0; i < requests.length; i++) {\n if (!requests[i].organization_id\n || requests[i].organization_id.constructor != String\n || requests[i].organization_id.length != 1) { // ONLY one element allowed\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "51d029462183258601b3952cbefd3584", "score": "0.4531843", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeA)) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "51d029462183258601b3952cbefd3584", "score": "0.4531843", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeA)) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "bfe5aa2fa917f509251943205fc14fbc", "score": "0.4529253", "text": "function isArray(input) {\n return Object.prototype.toString.call(input) === \"[object Array]\";\n}", "title": "" }, { "docid": "823c00f35ea79a25e5e453582b1993d6", "score": "0.4529226", "text": "function validateSchema(callback) {\n let config = {...dbConfig};\n config.database = 'information_schema';\n let connection = mysql.createConnection(config);\n connection.query(`SELECT table_name FROM tables WHERE table_schema = '${dbConfig.database}'`, (err, results) => {\n connection.end();\n if (err)\n callback(err, false);\n else {\n const currentTables = JSON.parse(JSON.stringify(results)).map(t => t.TABLE_NAME);\n const valid = tables.every(table => currentTables.includes(table));\n callback(err, valid);\n }\n });\n}", "title": "" }, { "docid": "5faeb4f0343f7917a63e71bdb0317d31", "score": "0.45290482", "text": "function isValidMultipleChoice(question, errorStream) {\n if (!question) {\n errorStream.push({ data: { question }, error: 'Question is not defined' });\n return false;\n }\n\n if (!question.title) {\n errorStream.push({ data: { question }, error: 'Question has no title' });\n return false;\n }\n\n if (!question.possibleResponses || !(question.possibleResponses instanceof Array)) {\n errorStream.push({ data: { question }, error: 'Question possibleResponses are undefined' });\n return false;\n }\n\n if (question.possibleResponses.length === 0) {\n errorStream.push({ data: { question }, error: 'A multiple choice question should have at least 1 response' });\n return false;\n }\n\n const { possibleResponses } = question;\n\n\n return possibleResponses.every((response) => {\n if (response.responseType !== QuestionTypes.MUTLIPLE_CHOICE) {\n errorStream.push({ data: { question }, error: 'Response has invalid type' });\n return false;\n }\n\n if (!response.value || !response.label) {\n errorStream.push({ data: { question }, error: 'Response has no value and/or label' });\n return false;\n }\n\n return true;\n });\n}", "title": "" }, { "docid": "37c3a101e14c103e199bf1fe3c33c103", "score": "0.45256132", "text": "validateInputs(){\n return true;\n }", "title": "" }, { "docid": "25c9e3fc5173c198adaae6b5a7b475e4", "score": "0.45255664", "text": "function isMultiselect($el) {\n var elSize;\n\n if ($el[0].multiple) {\n return true;\n }\n\n elSize = attrOrProp($el, \"size\");\n\n if (!elSize || elSize <= 1) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "d2639491c568d66f342f4530bf5a02b1", "score": "0.4524193", "text": "validateStructure () {\n return this.workbook.SheetNames.includes('Team Schedule') &&\n this.workbook.SheetNames.includes('Roster') &&\n this.workbook.SheetNames.includes('Services');\n }", "title": "" }, { "docid": "13476ea8ce5da3ef3a010c725c9af8f7", "score": "0.45234564", "text": "function isMultisigInput (script, allowIncomplete) {\n var chunks = decompile(script)\n if (chunks.length < 2) return false\n if (chunks[0] !== OPS.OP_0) return false\n\n if (allowIncomplete) {\n return chunks.slice(1).every(function (chunk) {\n return chunk === OPS.OP_0 || isCanonicalSignature(chunk)\n })\n }\n\n return chunks.slice(1).every(isCanonicalSignature)\n}", "title": "" }, { "docid": "13476ea8ce5da3ef3a010c725c9af8f7", "score": "0.45234564", "text": "function isMultisigInput (script, allowIncomplete) {\n var chunks = decompile(script)\n if (chunks.length < 2) return false\n if (chunks[0] !== OPS.OP_0) return false\n\n if (allowIncomplete) {\n return chunks.slice(1).every(function (chunk) {\n return chunk === OPS.OP_0 || isCanonicalSignature(chunk)\n })\n }\n\n return chunks.slice(1).every(isCanonicalSignature)\n}", "title": "" }, { "docid": "13476ea8ce5da3ef3a010c725c9af8f7", "score": "0.45234564", "text": "function isMultisigInput (script, allowIncomplete) {\n var chunks = decompile(script)\n if (chunks.length < 2) return false\n if (chunks[0] !== OPS.OP_0) return false\n\n if (allowIncomplete) {\n return chunks.slice(1).every(function (chunk) {\n return chunk === OPS.OP_0 || isCanonicalSignature(chunk)\n })\n }\n\n return chunks.slice(1).every(isCanonicalSignature)\n}", "title": "" }, { "docid": "182730d44091743b8eadb5fb1e217ffb", "score": "0.45171118", "text": "function isNativeMultiSelect(el) {\n return isNativeSelect(el) && el.multiple;\n}", "title": "" }, { "docid": "975e30103af946ef196c310bd171007a", "score": "0.4515815", "text": "function isMultisigInput(script, allowIncomplete) {\n if (script.chunks.length < 2) return false;\n if (script.chunks[0] !== ops.OP_0) return false;\n\n if (allowIncomplete) {\n return script.chunks.slice(1).every(function (chunk) {\n return chunk === ops.OP_0 || isCanonicalSignature(chunk);\n });\n }\n\n return script.chunks.slice(1).every(isCanonicalSignature);\n }", "title": "" }, { "docid": "6d0b92b7ebffd3a0485136fcdb3a9a6d", "score": "0.45111367", "text": "function checkSchemaFlag() {\n return 0;\n}", "title": "" }, { "docid": "125ca915c6061949646300a81fba3799", "score": "0.450645", "text": "function validateInputs(inputType, inputs) {\n switch (inputType) {\n case 'BMP':\n return validateBMPInputs(inputs);\n break;\n case 'Complexity':\n return designComplexity.validateInputs(inputs);\n break;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "bc6b18f438e5dda42da3b62da3a39459", "score": "0.4496834", "text": "function isMultisigInput(script, allowIncomplete) {\n var chunks = decompile(script);\n if (chunks.length < 2) return false;\n if (chunks[0] !== OPS.OP_0) return false;\n\n if (allowIncomplete) {\n return chunks.slice(1).every(function (chunk) {\n return chunk === OPS.OP_0 || isCanonicalSignature(chunk);\n });\n }\n\n return chunks.slice(1).every(isCanonicalSignature);\n }", "title": "" }, { "docid": "3a1d36b5e58a7eccebd34e3ac90a72e5", "score": "0.4496274", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeA)) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" } ]
393c4d437f78b3f71610cdd159d22382
Returns tag badge background and border colors based on hashed tag name.
[ { "docid": "4350fbacf0a2ae793e7ebe56bcbe3b82", "score": "0.6658197", "text": "function getTagColorsFromName(name) {\n if (name === void 0) { name = ''; }\n var hash = djb2(name.toLowerCase());\n var index = Math.abs(hash % TAG_COLORS.length);\n return getTagColor(index);\n}", "title": "" } ]
[ { "docid": "571be6eba433202c62e1977d1f5ae966", "score": "0.59595644", "text": "function colorTags () {\r\n\t\t$(\"span.tag\").each(function(){\r\n\t\t\tif(!this.style.color) {\r\n\t\t\t\tvar tag = calculatedTags[this.innerHTML];\r\n\t\t\t\tif(tag == undefined)\r\n\t\t\t\t{//calculate if undefined\r\n\t\t\t\t\tvar bgColor = stringToColor(this.innerHTML);\r\n\t\t\t\t\tvar snippedColor = cutHex(bgColor);\r\n\t\t\t\t\tvar isLight = colourIsLight(hexToR(snippedColor),hexToG(snippedColor),hexToB(snippedColor));\r\n\t\t\t\t\ttag = new Tag(\r\n\t\t\t\t\t\tthis.innerHTML,\r\n\t\t\t\t\t\tbgColor,\r\n\t\t\t\t\t\tisLight\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\tcalculatedTags[this.innerHTML] = tag;\r\n\t\t\t\t}//else use the \"cache\"\r\n\t\t\t\tthis.style.color = tag.bgIsLight?\"#000\":\"#FFF\";//set the color of the text\r\n\t\t\t\tthis.style.backgroundColor = tag.bgColor;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "65861bf89e8c39941c07f43be0478d8c", "score": "0.59563327", "text": "function assignColor(previewTag, tagName) {\r\n chrome.storage.sync.get(\"tags\", function(memoryObject) {\r\n for (let tag of memoryObject.tags) {\r\n if (tagName === tag.tagName) {\r\n previewTag.style.backgroundColor = tag.tagColor;\r\n return;\r\n }\r\n }\r\n })\r\n}", "title": "" }, { "docid": "82090883eac85a41a15024b4c6db88fe", "score": "0.58404994", "text": "get backgroundColor() {\n return brushToString(this.i.bv);\n }", "title": "" }, { "docid": "61bde7e3dbc503b53562188db01c9d36", "score": "0.58370876", "text": "get backgroundColor() {\n return brushToString(this.i.nk);\n }", "title": "" }, { "docid": "4e8d8d2901bc24beefaef698e6eb456d", "score": "0.5818123", "text": "get boxTypeBackgroundColor() {\n return brushToString(this.i.o7);\n }", "title": "" }, { "docid": "175e92f927c039c795d80500cc8bc798", "score": "0.5684469", "text": "getbackgroundColor(metricName) {\n if(this.props.metricForGraph == metricName) {\n return selectedColor;\n } else {\n return nonSelectedColor;\n }\n }", "title": "" }, { "docid": "1f5ad3571909ac7771d8ee19b12da390", "score": "0.55791193", "text": "get actualBackgroundColor() {\n return brushToString(this.i.m7);\n }", "title": "" }, { "docid": "87a98cb378b10e89eb6b1ab04ba8e299", "score": "0.55481404", "text": "get itemBackgroundColor() {\n return brushToString(this.i.hn);\n }", "title": "" }, { "docid": "9213927c48a9bcf5c85f68314afe0638", "score": "0.54947907", "text": "get iconBackgroundColor() {\n return brushToString(this.i.s9);\n }", "title": "" }, { "docid": "ecc7c882a632c0add26d13bead86bee9", "score": "0.54903084", "text": "get outlinedBackgroundColor() {\n return brushToString(this.i.tk);\n }", "title": "" }, { "docid": "40886df2da7e5ab6b75d1260337e0f08", "score": "0.54805005", "text": "get backgroundColor() {\n return brushToString(this.i.oy);\n }", "title": "" }, { "docid": "bc1d7b5e3982bf7d0cab3f30aea4b1d4", "score": "0.54696316", "text": "function getUsernameColor (username) {\n // Compute hash code\n\n return \"red\";\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "6823369149c4b4de4a170821a2db605f", "score": "0.5453884", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < global.fullname.length; i++) {\n hash = global.fullname.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "3deaf27d783f00037ffe8afc114d872b", "score": "0.54395884", "text": "get lyBadgeBg() {\n return this._lyBadgeBg;\n }", "title": "" }, { "docid": "41288ab9d67478977bd385b402af2e44", "score": "0.54330593", "text": "function getStyle(sig){\n // use color brewer to assign color values\n if (sig <= 250) {\n return '#f1d9fa';\n }\n else if (sig <= 500) {\n return '#d68ef0';\n }\n else if (sig <= 750){\n return '#ba43e6';\n }\n else if (sig <= 1000){\n return '#8f19bc';\n }\n else {\n return '#560f71';\n };\n}", "title": "" }, { "docid": "94d50faff3b490ac14a24f658ebb6dff", "score": "0.5429822", "text": "get checkedBackgroundColor() {\n return brushToString(this.i.da);\n }", "title": "" }, { "docid": "5682718b5f931f71370b393b990a2db5", "score": "0.54155076", "text": "get bg() {\n return this._lyBadgeBg;\n }", "title": "" }, { "docid": "426131b8d992fdf087bfb0b8a6db26ad", "score": "0.5396154", "text": "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "07786df27920336aba0d91fec7721b23", "score": "0.53862506", "text": "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 6) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n}", "title": "" }, { "docid": "2779d50e96be1de670507fb2c32c5d68", "score": "0.5385786", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "836d6226c7a74072698beb96b84fa439", "score": "0.53842384", "text": "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "836d6226c7a74072698beb96b84fa439", "score": "0.53842384", "text": "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "836d6226c7a74072698beb96b84fa439", "score": "0.53842384", "text": "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "6eccb8ad28358cb4a9dd4106bb4c12e9", "score": "0.5384012", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "6eccb8ad28358cb4a9dd4106bb4c12e9", "score": "0.5384012", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "6eccb8ad28358cb4a9dd4106bb4c12e9", "score": "0.5384012", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "6eccb8ad28358cb4a9dd4106bb4c12e9", "score": "0.5384012", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "163826b9ac26ed00256b7b49729d565b", "score": "0.53839284", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "5df5cce1169e3f1e9c29545bb0734484", "score": "0.5382296", "text": "get highlightTextColor() {\n return brushToString(this.i.c9);\n }", "title": "" }, { "docid": "ab0a33faf0b95d1999e6046156b1612f", "score": "0.5375609", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "a9422acb8505b8a3d24a23f4d1d0cece", "score": "0.5364352", "text": "function getUsernameColor (username) {\n\t // Compute hash code\n\t var hash = 7;\n\t for (var i = 0; i < username.length; i++) {\n\t hash = username.charCodeAt(i) + (hash << 5) - hash;\n\t }\n\t // Calculate color\n\t var index = Math.abs(hash % COLORS.length);\n\t return COLORS[index];\n \t}", "title": "" }, { "docid": "9351b10d2f1d55fb61f3b2f95e1011dd", "score": "0.53594995", "text": "static rgbForeground(r, g, b) {\n\t\tvar count = r + g + b\n\t\tvar brightness = this.rgbBrightness(r, g, b)\n\t\tif (brightness > 140 || count > 450)\n\t\t\treturn [0, 0, 0]\n\t\t\t//return '#000000'\n\t\telse\n\t\t\treturn [255, 255, 255]\n\t\t\t//return '#FFFFFF'\n\t}", "title": "" }, { "docid": "04ef80e51c4cb25c9f6f118146dfda1b", "score": "0.53547275", "text": "get raisedBackgroundColor() {\n return brushToString(this.i.tv);\n }", "title": "" }, { "docid": "1055edab161e75ba9fd3610eaa70f9e7", "score": "0.5353149", "text": "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash);\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n}", "title": "" }, { "docid": "5bb0c5371e663c86086648ad16dad29d", "score": "0.5351741", "text": "get outlinedSelectedItemBackgroundColor() {\n return brushToString(this.i.h3);\n }", "title": "" }, { "docid": "721c19dca941f5f8fd62e21611581e37", "score": "0.53498363", "text": "getBadgeClasses() {\n let classes = \"m-2 badge-\";\n classes += this.state.counter === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "e0d7b0cdf621a2dd7939dea848aefedb", "score": "0.53495556", "text": "get actualBackgroundColor() {\n return brushToString(this.i.or);\n }", "title": "" }, { "docid": "7b89f96e9265f22e53e3a09c62ad1a52", "score": "0.5316202", "text": "get uncheckedBackgroundColor() {\n return brushToString(this.i.dt);\n }", "title": "" }, { "docid": "5fc62359c540bda3d4706ece16269e3e", "score": "0.53114766", "text": "get actualUncheckedBackgroundColor() {\n return brushToString(this.i.c8);\n }", "title": "" }, { "docid": "0df2659d818f16106514c6304dd1e7d8", "score": "0.5304388", "text": "get itemTextColor() {\n return brushToString(this.i.hu);\n }", "title": "" }, { "docid": "c7b411dc34a8be5b67499cba3a68f5d0", "score": "0.5300586", "text": "get iconFocusBackgroundColor() {\n return brushToString(this.i.te);\n }", "title": "" }, { "docid": "eaec683463af161fe472544cc42d2785", "score": "0.5294692", "text": "get borderTypeBackgroundColor() {\n return brushToString(this.i.o0);\n }", "title": "" }, { "docid": "8923df5527ac6f3e16d89fe1c2c70816", "score": "0.5290799", "text": "get actualHighlightTextColor() {\n return brushToString(this.i.ct);\n }", "title": "" }, { "docid": "6dc2555e6b9f626b2d3877e0e00e8a35", "score": "0.5285785", "text": "function bgcolor() {\n let hash = gravatarUrl.split(\"/\");\n hash = hash[hash.length - 1];\n if (hash.length >= 6) {\n // make the color string with a slight transparency\n return `#${hash.slice(0, 6)}aa`;\n }\n return \"#aaaaaaaa\";\n }", "title": "" }, { "docid": "688c74ad57d86750fdb91dec9d2e0f08", "score": "0.5284083", "text": "getBackgroundColor(hueOffset=0){\n let theme = this.getTheme();\n return theme.getBackgroundColor(false,this.getLayer(),this.getTopLayer(),hueOffset);\n }", "title": "" }, { "docid": "706558a40c0a39d9fb27f096041aa361", "score": "0.5282704", "text": "get actualCheckedBackgroundColor() {\n return brushToString(this.i.c5);\n }", "title": "" }, { "docid": "7dae3080f47dcdc4685a65b95a28aa19", "score": "0.5280082", "text": "get iconTextColor() {\n return brushToString(this.i.tj);\n }", "title": "" }, { "docid": "c41e97803ac3550f872470cab9f572ee", "score": "0.52787745", "text": "getRgb() {\r\n\r\n }", "title": "" }, { "docid": "c609a9f6dc875a0ba17de95012ca4d91", "score": "0.52661633", "text": "function getBubbleColor(bubble) {\n\n return bubble.frame;\n\n}", "title": "" }, { "docid": "c01aca634c1d82904d16754b989b43b2", "score": "0.52633893", "text": "get flatItemBackgroundColor() {\n return brushToString(this.i.hb);\n }", "title": "" }, { "docid": "979e6566188e96bff7837302126816f2", "score": "0.5253327", "text": "function highlightToBgColor(highlight){\n const mapping = {\n 'none':'',\n 'correct':'green',\n 'wrong':'red'\n };\n return mapping[highlight];\n }", "title": "" }, { "docid": "2b1f796be7522ba689c954396d425592", "score": "0.52492094", "text": "jobColor(displayName) {\n return 'red';\n }", "title": "" }, { "docid": "8cb470fb206e2ba5902f7b6100a0aad2", "score": "0.52485174", "text": "get focusBackgroundColor() {\n return brushToString(this.i.s5);\n }", "title": "" }, { "docid": "16956b6c1c8de58b19cb24c396392c8a", "score": "0.5243368", "text": "get actualTextColor() {\n return brushToString(this.i.bs);\n }", "title": "" }, { "docid": "fc996020bcfc5e3745dce9b395ef24d6", "score": "0.5243224", "text": "getBarColor(name) {\n return this.state[name];\n }", "title": "" }, { "docid": "bf8b3ed29de8723d84b01df41da9bb99", "score": "0.52377385", "text": "get raisedTextColor() {\n return brushToString(this.i.t5);\n }", "title": "" }, { "docid": "62290cbc5e406e5c42a32ee4af880ec9", "score": "0.5235811", "text": "function updateTagColors(event, currentColor) {\r\n if (!event.target.classList.contains(\"disabled-button\")) {\r\n let newColor = document.querySelector(\".selected-new-color\").style.backgroundColor;\r\n for (let sideBarTag of document.querySelectorAll(\".tag\")) {\r\n if (sideBarTag.childNodes[0].childNodes[0].style.backgroundColor === currentColor) {\r\n sideBarTag.childNodes[0].childNodes[0].style.backgroundColor = newColor;\r\n break;\r\n }\r\n }\r\n for (let previewEntry of document.querySelectorAll(\".preview-entry\")) {\r\n for (let previewTag of previewEntry.childNodes[2].childNodes) {\r\n if (previewTag.style.backgroundColor === currentColor) {\r\n previewTag.style.backgroundColor = newColor;\r\n break;\r\n } \r\n }\r\n }\r\n for (let formEntryTag of document.querySelectorAll(\".note-tag\")) {\r\n if (formEntryTag.style.backgroundColor === currentColor) {\r\n formEntryTag.style.backgroundColor = newColor;\r\n break;\r\n }\r\n }\r\n chrome.storage.sync.get(\"tags\", function(memoryObject) {\r\n for (let tag of memoryObject.tags) {\r\n if (tag.tagColor === currentColor) {\r\n tag.tagColor = newColor;\r\n break;\r\n }\r\n }\r\n chrome.storage.sync.set({\"tags\": memoryObject.tags});\r\n document.querySelector(\".affirmative-button\").classList.add(\"ok-to-close\");\r\n removePopUp(event);\r\n })\r\n }\r\n}", "title": "" }, { "docid": "de5c673574ab0c21ddf0c61ca440ce04", "score": "0.5225211", "text": "get focusTextColor() {\n return brushToString(this.i.s6);\n }", "title": "" }, { "docid": "b5fdf228a31b35b90ea49ff2f10681d2", "score": "0.52184016", "text": "get actualItemBackgroundColor() {\n return brushToString(this.i.ez);\n }", "title": "" }, { "docid": "62bed225e6fb20aeda79cc8c9f7dea28", "score": "0.52102774", "text": "get actualTextColor() {\n return brushToString(this.i.ni);\n }", "title": "" }, { "docid": "83bcc27af4cc9de57864c931ee77f64c", "score": "0.5203983", "text": "function generateColors() {\r\n let circles = document.querySelectorAll(\".generated-color\");\r\n chrome.storage.sync.get(\"tags\", function(memoryObject) {\r\n let color = \"\"\r\n let newColors = [];\r\n let tagColors = [\"rgb(164, 150, 243)\", \"rgb(125, 105, 238)\"]; // The two purple theme colors\r\n for (let tag of memoryObject.tags) {\r\n tagColors.push(tag.tagColor);\r\n }\r\n for (let x = 0; x < 10; x++) {\r\n do {\r\n color = `rgb(${Math.floor(Math.random() * 251)}, ${Math.floor(Math.random() * 251)}, ${Math.floor(Math.random() * 251)})`;\r\n } while (newColors.includes(color) || tagColors.includes(color));\r\n newColors.push(color);\r\n circles[x].style.backgroundColor = color;\r\n } \r\n })\r\n}", "title": "" }, { "docid": "27ceb88011ad74d020c0b6ca6c02cf10", "score": "0.52016747", "text": "get hoverBackgroundColor() {\n return brushToString(this.i.s7);\n }", "title": "" }, { "docid": "f85ad4a56aa65490874ef6c6ac944c2d", "score": "0.5201604", "text": "get outlinedSelectedItemHoverBackgroundColor() {\n return brushToString(this.i.h4);\n }", "title": "" }, { "docid": "a2083ebb6894466c7498681af8ec9eac", "score": "0.52001464", "text": "getBadgesClasses() {\n const { counter } = this.props;\n let classes = \"badge m-2 badge-\";\n classes += counter.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "b6e66ac89dc2c03add96a29730f002a1", "score": "0.5198569", "text": "function getUsernameColor(username) {\n //compute hash color value\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n //calculate a new color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "199e053639ec3b8d89841924e0ef8ed9", "score": "0.5179294", "text": "get hoverBackgroundColor() {\n return brushToString(this.i.bz);\n }", "title": "" }, { "docid": "86393a9a8362438f3017a05c69348ad9", "score": "0.5173975", "text": "function tagHighlighter(tags, options) {\n let map = Object.create(null);\n for (let style of tags) {\n if (!Array.isArray(style.tag))\n map[style.tag.id] = style.class;\n else\n for (let tag of style.tag)\n map[tag.id] = style.class;\n }\n let { scope, all = null } = options || {};\n return {\n style: (tags) => {\n let cls = all;\n for (let tag of tags) {\n for (let sub of tag.set) {\n let tagClass = map[sub.id];\n if (tagClass) {\n cls = cls ? cls + \" \" + tagClass : tagClass;\n break;\n }\n }\n }\n return cls;\n },\n scope\n };\n }", "title": "" }, { "docid": "4838c3e18f880073ee429b82b7c9f879", "score": "0.51705784", "text": "get rippleColor() {\n return brushToString(this.i.t6);\n }", "title": "" }, { "docid": "b39cfddc2742377b792bae67874f84fa", "score": "0.5168942", "text": "get outlinedItemBackgroundColor() {\n return brushToString(this.i.hv);\n }", "title": "" }, { "docid": "d8f9a27138008f22cf681a085d005176", "score": "0.51631534", "text": "toggleTagHighlight(name) {\n document.getElementById('filter_' + name).children[0].style.background = this.context.getTagStatus(name) === true ? '#d1d1d1' : '#e4e4e4';\n }", "title": "" }, { "docid": "322b349c60735d383ca587a7078e54dd", "score": "0.5161868", "text": "get iconHoverBackgroundColor() {\n return brushToString(this.i.tg);\n }", "title": "" }, { "docid": "cc531d34cca7d8d3f3816a93ab7b4ca6", "score": "0.51578695", "text": "get searchTypeBackgroundColor() {\n return brushToString(this.i.s0);\n }", "title": "" }, { "docid": "4aabbde6a20aaf5ac88b0a1bb466c15b", "score": "0.5157697", "text": "function getcolor(vote) {\n if (vote >= 8) {\n return \"green\"\n }\n else if (vote >= 5) {\n return \"orange\"\n }\n else {\n return \"red\"\n }\n}", "title": "" }, { "docid": "92474c57e7215298870d7e78f86ba85e", "score": "0.5145035", "text": "function generateBadge(attribute,description,color)\n{\n return `https://img.shields.io/badge/${attribute}-${description}-${color}`\n}", "title": "" }, { "docid": "1f2e9ddcaffa0cc63660dd9ed12f2555", "score": "0.5135005", "text": "getBadgeClasses() {\r\n let classes = \"badge m-2 \"\r\n classes += (this.props.counter.value === 0)? \"badge-warning\": \"badge-primary\" \r\n return classes; \r\n }", "title": "" }, { "docid": "48ec5182cfd34c345869bbda90318b6c", "score": "0.51303625", "text": "get raisedFocusBackgroundColor() {\n return brushToString(this.i.t0);\n }", "title": "" }, { "docid": "14d788c68563cdd77b6d2ee7b037df02", "score": "0.51267695", "text": "function getUserColor(username){\n var hash = 392873767; \n for(var i = 0; i < username.length; i++) { \n hash ^= ((hash << 5) + username.charCodeAt(i) + (hash >> 2)); \n } \n return PANEL_COLORS[Math.abs(hash % 7)];\n }", "title": "" }, { "docid": "2a5eb3effd07a63dc19f22cca034ad09", "score": "0.5125057", "text": "function grab_color(square_class) {\n\n\t\t// split the classess by the nbsp delimiter\n\t\tvar class_array = square_class.split(\" \");\n\n\t\t// set the duck's color to last term in class, which is the background color.\n\t\tvar duck_color = \"\";\n\n\t\tfor (i in class_array) {\n\n\t\t\tduck_color = class_array[i];\n\n\t\t}\n\n\t\treturn duck_color;\n\n}", "title": "" }, { "docid": "080537981d5612ca3273557327c87e63", "score": "0.5124449", "text": "get raisedHoverBackgroundColor() {\n return brushToString(this.i.t2);\n }", "title": "" }, { "docid": "4e82d55b5f3763b08b0052a1025d4676", "score": "0.51202714", "text": "get textColor() {\n return brushToString(this.i.b2);\n }", "title": "" }, { "docid": "5f484a7792d35d85b6fb7dc3c73b2fbc", "score": "0.51173234", "text": "function getFillColor(primitive) {\n\treturn map(primitive, function(primitive) {\n\t\treturn graph.getCellStyle(primitive).fillColor;\n\t});\n\n}", "title": "" }, { "docid": "5c8f42a253c8fd45971f36ef9b11893f", "score": "0.5106774", "text": "get fabBackgroundColor() {\n return brushToString(this.i.sj);\n }", "title": "" }, { "docid": "362d5b6017038972533c7286cf52574e", "score": "0.5104905", "text": "get flatSelectedItemBackgroundColor() {\n return brushToString(this.i.hj);\n }", "title": "" }, { "docid": "3bb0b9d8a0e87b300baec74a35986a5e", "score": "0.5104209", "text": "getBackgroundRGB() {\n\t if (this.backgroundRed !== undefined && this.backgroundGreen !== undefined && this.backgroundBlue !== undefined) {\n\t return 'rgb(' + this.backgroundRed + ',' + this.backgroundGreen + ',' + this.backgroundBlue + ')';\n\t }\n\t else {\n\t return \"\";\n\t }\n\t }", "title": "" }, { "docid": "4d813d156330876b083458cd84d8b948", "score": "0.51001644", "text": "get itemDisabledBackgroundColor() {\n return brushToString(this.i.hp);\n }", "title": "" }, { "docid": "e9a5018b0bc8d4b1ce14d5ee9b8bdf11", "score": "0.5099419", "text": "function determineColor(name) {\n for (i = 0; i < btypes.length; i++) {\n if (btypes[i] == name) {\n return colors[i];\n }\n }\n }", "title": "" }, { "docid": "6cd7352df49afad49a01c11c23ff92fd", "score": "0.50965166", "text": "get textColor() {\n return brushToString(this.i.a5);\n }", "title": "" }, { "docid": "b2409074f1d36c26397917a33cab3dda", "score": "0.509279", "text": "get actualHoverBackgroundColor() {\n return brushToString(this.i.ne);\n }", "title": "" }, { "docid": "86879de11a31460639b9bc40181ba577", "score": "0.50892526", "text": "get flatBackgroundColor() {\n return brushToString(this.i.su);\n }", "title": "" }, { "docid": "446059fa16704f416b7183d2b4b17004", "score": "0.5084931", "text": "get actualDisabledBackgroundColor() {\n return brushToString(this.i.m9);\n }", "title": "" }, { "docid": "4e67ff3b0d03bb7c42d7606ea1015a1e", "score": "0.507925", "text": "get disabledBackgroundColor() {\n return brushToString(this.i.sg);\n }", "title": "" }, { "docid": "44e2275bc41970e3dd7e760a7044286d", "score": "0.50712126", "text": "get actualSelectedItemBackgroundColor() {\n return brushToString(this.i.e7);\n }", "title": "" }, { "docid": "a6fe3c356bbf30cf3ee0fb7d488b5bcd", "score": "0.50686246", "text": "getBackgroundHex() {\n\t if (this.backgroundRed !== undefined && this.backgroundGreen !== undefined && this.backgroundBlue !== undefined) {\n\t return \"#\" + this.backgroundRed.toString(16) + this.backgroundGreen.toString(16) + this.backgroundBlue.toString(16);\n\t }\n\t else {\n\t return \"\";\n\t }\n\t }", "title": "" }, { "docid": "9318eeae3e3b2dc4af709979ff3c51fe", "score": "0.50669485", "text": "get iconDisabledBackgroundColor() {\n return brushToString(this.i.tb);\n }", "title": "" }, { "docid": "f5fa1a0d315d550ed8a932a792165cc5", "score": "0.5066025", "text": "get outlinedItemTextColor() {\n return brushToString(this.i.h2);\n }", "title": "" }, { "docid": "83f08dff3326d9783ce5abf6e501857b", "score": "0.5059681", "text": "get iconFocusTextColor() {\n return brushToString(this.i.tf);\n }", "title": "" }, { "docid": "0da4b564c2692b01cfbd5c1282ff12ee", "score": "0.5059486", "text": "get actualFocusBackgroundColor() {\n return brushToString(this.i.nc);\n }", "title": "" }, { "docid": "9aa3ebcde4329ecceb1e81bc8f0cbf4a", "score": "0.5057817", "text": "getUsernameColor(username) {\n const COLORS = [\n '#e21400', '#ffe400', '#ff8f00',\n '#58dc00', '#dd9cff', '#4ae8c4',\n '#3b88eb', '#f47777', '#EEACB7',\n '#D3FF3E', '#99CC33', '#999933',\n '#996633', '#B8D5B8', '#7FFF38',\n '#FADBBC', '#FAE2B7', '#EBE8AF',\n ];\n // Compute hash code\n let hash = 7;\n for (let i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n let index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "title": "" }, { "docid": "7a1d78f84365b0503cd4dfdd7e88b892", "score": "0.5042996", "text": "get selectedItemBackgroundColor() {\n return brushToString(this.i.h7);\n }", "title": "" }, { "docid": "bdea763b666b1b80c7a545aad29e0dd5", "score": "0.5042264", "text": "get textColor() {\n return brushToString(this.i.b3);\n }", "title": "" } ]
489d89a6c4f44b33b0754afd36469795
If not MSIE, return false. If it is, return the version number.
[ { "docid": "5276db758dc527f0e6a2bb33cfbb14fd", "score": "0.582109", "text": "function isMsie() {\n\t\treturn navigator.cpuClass && !navigator.product;\n\t}", "title": "" } ]
[ { "docid": "d78c1e9c6706bd76ad5cf79b94165bcb", "score": "0.74178404", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)), 10);\n }\n\n var trident = ua.indexOf(\"Trident/\");\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf(\"rv:\");\n return parseInt(ua.substring(rv + 3, ua.indexOf(\".\", rv)), 10);\n }\n\n var edge = ua.indexOf(\"Edge/\");\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf(\".\", edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "8e3bffa637476a62dd0b4c316e7fa8c6", "score": "0.7413158", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "5e9f821e5c9ba6119dfe7268dae033a6", "score": "0.735952", "text": "function detectIE() {\n var ua = navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {// IE 11 => return version number\n var rv = ua.lastIndexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {// Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }// other browser\n return false;\n}", "title": "" }, { "docid": "f0d630a91bb34e2c1591e287be00d142", "score": "0.7354011", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "131f6abe94feec97e3932f60e229240d", "score": "0.735102", "text": "function detectIE() {\n\tvar ua = window.navigator.userAgent;\n\n\tvar msie = ua.indexOf('MSIE ');\n\tif (msie > 0) {\n\t\t// IE 10 or older => return version number\n\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t}\n\n\tvar trident = ua.indexOf('Trident/');\n\tif (trident > 0) {\n\t\t// IE 11 => return version number\n\t\tvar rv = ua.indexOf('rv:');\n\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t}\n\n\tvar edge = ua.indexOf('Edge/');\n\tif (edge > 0) {\n\t\t// Edge (IE 12+) => return version number\n\t\treturn parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t}\n\n\t// other browser\n\treturn false;\n}", "title": "" }, { "docid": "cb5f22df99d874768b30cb1f8cd655fc", "score": "0.7350652", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n var trident = ua.indexOf('Trident/');\n\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n if (trident > 0) {\n // IE 11 (or newer) => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "f4d453dd7920e6eb38978f8972f99c59", "score": "0.73359513", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "852cd4ce331ab96c047de0a58927cd6a", "score": "0.7313907", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "050583908abd1dcabf97a4b07272a929", "score": "0.7298696", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "a11fa6a08713c73b7279d03bcb48a8b4", "score": "0.72969645", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "289719534e731d9132a466eff81e9e37", "score": "0.72901803", "text": "function detectIE() {\n\tvar ua = window.navigator.userAgent;\n\tvar msie = ua.indexOf('MSIE ');\n\tif (msie > 0) {\n\t\t// IE 10 or older => return version number\n\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t}\n\tvar trident = ua.indexOf('Trident/');\n\tif (trident > 0) {\n\t\t// IE 11 => return version number\n\t\tvar rv = ua.indexOf('rv:');\n\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t}\n\t// other browser\n\treturn false;\n}", "title": "" }, { "docid": "6401bf0b60b3d3c1cba2067ed94f2678", "score": "0.7285079", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n // other browser\n return false;\n}", "title": "" }, { "docid": "f80cf1cc2b37aa990027346b6c08ef85", "score": "0.7283538", "text": "detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "2c0338a7bc4f864b8e1a4d5b73d44a52", "score": "0.7271889", "text": "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n var edge = ua.indexOf('Edge/');\r\n if (edge > 0) {\r\n // Edge (IE 12+) => return version number\r\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n }\r\n\r\n // other browser\r\n return false;\r\n}", "title": "" }, { "docid": "e8943e1f958f1e366c5e0e09dd744aff", "score": "0.7262552", "text": "function detectIE() {\n\tvar ua = window.navigator.userAgent;\n\n\tvar msie = ua.indexOf('MSIE ');\n\tif (msie > 0) {\n \t// IE 10 or older => return version number\n \treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t}\n\n\tvar trident = ua.indexOf('Trident/');\n\tif (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t}\n\n\tvar edge = ua.indexOf('Edge/');\n\tif (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t}\n\n\t// other browser\n\treturn false;\n}", "title": "" }, { "docid": "6b90d0f9248203fab5a87d4d633c1786", "score": "0.7252989", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "2bf55754d809eb568b6c81727adc1e53", "score": "0.724124", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "de4a1811cfa7ed4a3d374b3784080476", "score": "0.72096246", "text": "function msieversion() {\n var ua = window.navigator.userAgent\n var msie = ua.indexOf(\"MSIE \")\n if (msie > 0) // is Microsoft Internet Explorer; return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)))\n else\n return 0 // is other browser\n}", "title": "" }, { "docid": "382cbdd3ec825510dbfe9cb21dd1f464", "score": "0.71809834", "text": "function msieversion()\r\n{\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf ( \"MSIE \" );\r\n\r\n if ( msie > 0 ) // is Microsoft Internet Explorer; return version number\r\n {\r\n return parseInt ( ua.substring ( msie+5, ua.indexOf ( \".\", msie ) ) );\r\n }\r\n else\r\n {\r\n return 0; // is other browser\r\n }\r\n}", "title": "" }, { "docid": "35065b50a6ee26fcc148ef3dcfeb5eb5", "score": "0.71773934", "text": "function msieversion ()\n{\n\tvar ua = window.navigator.userAgent;\n\tvar msie = ua.indexOf (\"MSIE \");\n\n\tif ( msie > 0 ) // If Internet Explorer, return version number\n\t\treturn parseInt (ua.substring (msie+5, ua.indexOf (\".\", msie )));\n\telse // If another browser, return 0\n\t\treturn 0;\n}", "title": "" }, { "docid": "807d1cd03587e55c43c162e4df38b7bb", "score": "0.717585", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n\t\n}", "title": "" }, { "docid": "658fa650333c659af3b458b0489eb473", "score": "0.7129939", "text": "function getIeVersion(){\n var retVal = -1,\n ua, re\n if(navigator.appName === 'Microsoft Internet Explorer'){\n ua = navigator.userAgent\n re = new RegExp('MSIE ([0-9]{1,})')\n if(re.exec(ua) !== null){\n retVal = parseInt(RegExp.$1)\n }\n }\n return retVal\n }", "title": "" }, { "docid": "518bde75be6bf333d749798b937006b5", "score": "0.7010612", "text": "function getIeVersion() {\n var rv = -1,\n ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[0-9]{0,})\");\n if (navigator.appName === 'Microsoft Internet Explorer') {\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n return rv;\n }", "title": "" }, { "docid": "6f9605fffdcee73b21c2eb38c45b6677", "score": "0.7003012", "text": "function version_ie() {\r\n\tif (navigator.appVersion.indexOf('MSIE 6') > 0)\r\n\t\treturn 6;\r\n\telse if (navigator.appVersion.indexOf('MSIE 7') > 0)\r\n\t\treturn 7;\r\n\telse if (navigator.appVersion.indexOf('MSIE 8') > 0)\r\n\t\treturn 8;\r\n\telse\r\n\t\treturn 0;\r\n}", "title": "" }, { "docid": "524e56eba0d2949e8c7d717bb5d7f7d5", "score": "0.69106644", "text": "function _isIE() {\n\n\t\tvar myNav = navigator.userAgent.toLowerCase();\n\t\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\n\t}", "title": "" }, { "docid": "3f98dc5a4f5750265b79e3fd7bbd75df", "score": "0.69020885", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "3f98dc5a4f5750265b79e3fd7bbd75df", "score": "0.69020885", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "632e423f8fa1de14b061f18a2df7dd7f", "score": "0.6862974", "text": "function getIEVer() {\n\tvar rv = -1; // Return value assumes failure.\n\tif (navigator.appName == 'Microsoft Internet Explorer') {\n\t\tvar ua = navigator.userAgent;\n\t\tvar re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t\tif (re.exec(ua) !== null) {\n\t\t\trv = parseFloat(RegExp.$1);\n\t\t}\n\t}\n\treturn rv;\n}", "title": "" }, { "docid": "e0b011b79aa50c8bada7ae54c228f98a", "score": "0.678727", "text": "function isInternetExplorer() {\n\tvar ua = window.navigator.userAgent;\n\t\n\tvar msie = ua.indexOf('MSIE ');\n\tif(msie >= 0) {\n\t\t// IE 10 or older => return version number\n\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t}\n\t\n\tvar trident = ua.indexOf('Trident/');\n\tif(trident >= 0) {\n\t\t// IE 11 => return version number\n\t\tvar rv = ua.indexOf('rv');\n\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t}\n\t\n\tvar edge = ua.indexOf('Edge/');\n\tif(edge => 0) {\n\t\t// IE 12 => return version number\n\t\treturn parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t}\n\t\n\t// other browser\n\treturn false;\n}", "title": "" }, { "docid": "941296e607c37c72167d93f87ca70940", "score": "0.67699337", "text": "function GetIEVersion() {\n var sAgent = window.navigator.userAgent;\n var Idx = sAgent.indexOf(\"MSIE\");\n\n // If IE, return version number.\n if (Idx > 0) \n return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(\".\", Idx)));\n\n // If IE 11 then look for Updated user agent string.\n else if (!!navigator.userAgent.match(/Trident\\/7\\./)) \n return 11;\n\n else\n return 0; //It is not IE\n}", "title": "" }, { "docid": "941296e607c37c72167d93f87ca70940", "score": "0.67699337", "text": "function GetIEVersion() {\n var sAgent = window.navigator.userAgent;\n var Idx = sAgent.indexOf(\"MSIE\");\n\n // If IE, return version number.\n if (Idx > 0) \n return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(\".\", Idx)));\n\n // If IE 11 then look for Updated user agent string.\n else if (!!navigator.userAgent.match(/Trident\\/7\\./)) \n return 11;\n\n else\n return 0; //It is not IE\n}", "title": "" }, { "docid": "2056b2282d2fb6dba1b47e0c27ca8b83", "score": "0.66715187", "text": "function checkOSVersion() {\n\tvar b = false;\n\n\tvar m = /Windows NT (\\d+\\.\\d+)/.exec(navigator.oscpu);\n\tif ( m ) {\n\t\tvar ver = m[1];\n\t\tif ( ver >= \"6.0\" ) return true;\t\t// 6.0+: Vista, Win7 or later, no problem\n\t\tif ( ver < \"5.1\" ) return false;\t\t// 5.1: XP, can not work if is earlier than that\n\n\t\t// 5.1: XP, should be SP2+\n\t\t// 5.2: Windows Server 2003, should be SP1+\n\t\tvar regRoot = 3;\t// HKEY_LOCAL_MACHINE\n\t\tvar regPath = \"SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\";\n\t\tvar regName = \"CSDVersion\";\n\t\tvar servicePackStr = gIeTab.getRegistryEntry(regRoot, regPath, regName);\n\t\tif ( servicePackStr && servicePackStr.length > 3 ) {\n\t\t\tvar i = 1;\n\t\t\twhile ( ((servicePackStr[i] < '0') || (servicePackStr[i] > '9')) && ( i < servicePackStr.length ) ) {\n\t\t\t\ti++;\n\t\t\t}\n \tvar ServicePackLevel = parseInt(servicePackStr[i]);\n \tswitch (ver) {\n \t\tcase \"5.1\":\n \t\t\tb = ServicePackLevel >= \"2\";\n \t\t\tbreak;\n \t\tcase \"5.2\":\n \t\t\tb = ServicePackLevel >= \"1\";\n \t\t\tbreak;\n \t\tdefault:\n \t\t\tb = ServicePackLevel >= \"2\";\t\t// Should not come here, but as the last resort, set a default condition\n \t\t\tbreak;\n \t}\n }\n\t}\n\n\treturn b;\n}", "title": "" }, { "docid": "43e9b29c9ac43c0337e64df04ec3a29e", "score": "0.6667056", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n // If Internet Explorer, return version number\n var version = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n var ieClass = \"ie-\" + version;\n $(\"body\").addClass(\"ie-browser \" + ieClass);\n }\n\n return false;\n}", "title": "" }, { "docid": "4f6d82c2697431bedf93daa7ba9490a8", "score": "0.6657372", "text": "function detectIE()\n // Returns the version of Internet Explorer or a -1\n // (indicating the use of another browser).\n {\n var rv = false;\n var path = ( document.location.href );\n if (navigator.appName == 'Microsoft Internet Explorer' && path.indexOf(\"http\") == 0 )\n {\n rv = true;\n }\n return rv;\n }", "title": "" }, { "docid": "3daf9d6ce4e0bc9cb422501ace985494", "score": "0.6633032", "text": "function isIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "132a12972c3aff15ea924c9316e510d7", "score": "0.6590526", "text": "function isInternetExplorerBefore(version) {\n var iematch = /MSIE ([0-9]+)/g.exec(window.navigator.userAgent);\n\n return iematch ? +iematch[1] < version : false;\n}", "title": "" }, { "docid": "6c4138de0a000710149d2948bfb73ec1", "score": "0.65804905", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "6c4138de0a000710149d2948bfb73ec1", "score": "0.65804905", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "9d665fbce22435bec6b21ac2dae58d44", "score": "0.6578273", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "9d665fbce22435bec6b21ac2dae58d44", "score": "0.6578273", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "8164091b83ea73259e4d1521a510fd81", "score": "0.6534111", "text": "function isIE() {\n\n return is(\"MSIE\");\n }", "title": "" }, { "docid": "34bc8297fd078fe6c7a5d24eef0541b1", "score": "0.65045685", "text": "function isOldIE()\r\n{\r\n var ver = navigator.appVersion;\r\n\tvar p = ver.indexOf(\"MSIE 5\");\r\n\treturn (p >= 0 && ver.substr(p + 5, 3) <= \"5.0\") // IE <= 5.0\r\n}", "title": "" }, { "docid": "1190c3c91b2b35b94e89127b91cf6cc2", "score": "0.6503063", "text": "function ie_10_or_older() {\n // check if IE10 or older\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n // return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n return true;\n }\n // other browser\n return false;\n }", "title": "" }, { "docid": "67618eccfb3a47342ef7eb67232bb60d", "score": "0.6492875", "text": "function isIE () {\n\t\tvar myNav = navigator.userAgent.toLowerCase();\n\t\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\t}", "title": "" }, { "docid": "0acd12b09acfe7b4ec22214465a2c86b", "score": "0.6454521", "text": "function getInternetExplorerVersion() {\n let rv = -1;\n let re = null;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n re = new RegExp('MSIE ([0-9]{1,}[.0-9]{0,})');\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n } else if (navigator.appName === 'Netscape') {\n re = new RegExp('Trident/.*rv:([0-9]{1,}[.0-9]{0,})');\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n return rv;\n}", "title": "" }, { "docid": "e077a974b9c328108f5fab25a0b8f890", "score": "0.6448242", "text": "function _isIE()\r\n{\r\n\tvar result = false;\r\n\t\r\n\tif (navigator.appName.toLowerCase().indexOf(\"microsoft\") != -1)\r\n\t{\r\n\t\tresult = true;\r\n\t}\r\n\t\r\n\treturn result;\r\n}", "title": "" }, { "docid": "1161b589cd26e22d05acbb0be0b40ef8", "score": "0.64239776", "text": "function isIE () {\r\n var myNav = navigator.userAgent.toLowerCase();\r\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\r\n}", "title": "" }, { "docid": "f079553f8ccc20799071759800b79709", "score": "0.63991815", "text": "function getInternetExplorerVersion(){\n\t\tvar rv = -1; // Return value assumes failure.\n\t\tif (navigator.appName == 'Microsoft Internet Explorer') {\n\t\t\tvar ua = navigator.userAgent;\n\t\t\tvar re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t\t\tif (re.exec(ua) != null)\n\t\t\t\trv = parseFloat( RegExp.$1 );\n\t\t}\n\t\treturn rv;\n\t}", "title": "" }, { "docid": "29bc8733d68b5d62a7941965f09b2fe3", "score": "0.6390095", "text": "function checkIE() {\r\n var ms_ie = false;\r\n var ua = window.navigator.userAgent;\r\n var old_ie = ua.indexOf('MSIE ');\r\n var new_ie = ua.indexOf('Trident/');\r\n if ((old_ie > -1) || (new_ie > -1)) {\r\n ms_ie = true;\r\n }\r\n return ms_ie;\r\n }", "title": "" }, { "docid": "0e131a3da3aa906373f4d3508e9943c7", "score": "0.6381879", "text": "function getInternetExplorerVersion() {\r\n var rv = -1; // Return value assumes failure.\r\n if (navigator.appName == 'Microsoft Internet Explorer') {\r\n var ua = navigator.userAgent;\r\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\r\n if (re.exec(ua) != null)\r\n rv = parseFloat(RegExp.$1);\r\n }\r\n return rv;\r\n}", "title": "" }, { "docid": "390da56f82ac088e73f4ece50c8af6dc", "score": "0.6362113", "text": "function getInternetExplorerVersion() {\n\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n\n}", "title": "" }, { "docid": "6bd2730c091c19704c615f1610c311bf", "score": "0.636197", "text": "function getInternetExplorerVersion() {\n var rv = -1; // Return value assumes failure.\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n }", "title": "" }, { "docid": "2d4c57e5a65790a2b5bbfb2897aafe2b", "score": "0.63557464", "text": "function detectIE() {\nvar ua = window.navigator.userAgent;\n\n// Test values; Uncomment to check result …\n//\n// IE 10\n// ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n// IE 11\n// ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n// Edge 12 (Spartan)\n// ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n// Edge 13\n// ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n//\nvar msie = ua.indexOf('MSIE ');\nif (msie > 0) {\n// IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n}\n\nvar trident = ua.indexOf('Trident/');\nif (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n}\n\nvar edge = ua.indexOf('Edge/');\nif (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n}\n // other browser\n return false;\n}", "title": "" }, { "docid": "531b1e513eb09226accfe66eddb67eec", "score": "0.63486767", "text": "function isIE(version) {\n return getInternetExplorerVersion() === version;\n}", "title": "" }, { "docid": "d4ae1984a82951fb50f0877f042157c7", "score": "0.6346906", "text": "function getInternetExplorerVersion(){\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer'){\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat( RegExp.$1 );\n }\n else if (navigator.appName == 'Netscape'){\n var ua = navigator.userAgent;\n var re = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat( RegExp.$1 );\n }\n return rv;\n }", "title": "" }, { "docid": "65bc7e15b43776deec664fd63143cc2f", "score": "0.6343082", "text": "function getInternetExplorerVersion()\n // Returns the version of Internet Explorer or a -1\n // (indicating the use of another browser).\n {\n var rv = -1; // Return value assumes failure.\n if (navigator.appName == 'Microsoft Internet Explorer')\n {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat( RegExp.$1 );\n }\n return rv;\n }", "title": "" }, { "docid": "5611ef8e2b53c699ec253ec8a9a9093b", "score": "0.6338587", "text": "function getInternetExplorerVersion(){\n\t\tvar rv = -1;\n\t\tif (navigator.appName == 'Microsoft Internet Explorer'){\n\t\t\tvar ua = navigator.userAgent;\n\t\t\tvar re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t\t\tif (re.exec(ua) != null)\n\t\t\trv = parseFloat( RegExp.$1 );\n\t\t}\n\t\telse if (navigator.appName == 'Netscape'){\n\t\t\tvar ua = navigator.userAgent;\n\t\t\tvar re = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\");\n\t\t\tif (re.exec(ua) != null)\n\t\t\trv = parseFloat( RegExp.$1 );\n\t\t}\n\t\treturn rv;\n\t}", "title": "" }, { "docid": "c22746a6c6958c709a24306023cd89a7", "score": "0.63349724", "text": "function getInternetExplorerVersion()\n {\n var rv = -1; // Return value assumes failure.\n if (navigator.appName == 'Microsoft Internet Explorer')\n {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n {\n rv = parseFloat( RegExp.$1 );\n }\n }\n return rv;\n }", "title": "" }, { "docid": "561231965b50bc3c82e7f75bd2d411dd", "score": "0.6324107", "text": "function usingIE() {\n /** //came from http://stackoverflow.com/questions/19999388/jquery-check-if-user-is-using-ie\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)){\n //alert(parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)))); //gets ie version number\n out = true;\n }else{\n out = false;\n }\n return out; */\n //single line version, original came from internet, too lazy to dissect it - it works\n return (window.navigator.userAgent.indexOf(\"MSIE \") > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./));\n}", "title": "" }, { "docid": "f1d042b0553d7c232d68b9dc331edba6", "score": "0.63189965", "text": "function getInternetExplorerVersion()\r\n\t{\r\n\t var rv = -1;\r\n\t if (navigator.appName == 'Microsoft Internet Explorer')\r\n\t {\r\n\t var ua = navigator.userAgent;\r\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\r\n\t if (re.exec(ua) != null)\r\n\t rv = parseFloat( RegExp.$1 );\r\n\t }\r\n\t else if (navigator.appName == 'Netscape')\r\n\t {\r\n\t var ua = navigator.userAgent;\r\n\t var re = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\");\r\n\t if (re.exec(ua) != null)\r\n\t rv = parseFloat( RegExp.$1 );\r\n\t }\r\n\t return rv;\r\n\t}", "title": "" }, { "docid": "f0db4c4cea870c9ff3cd1d94dff16422", "score": "0.6311432", "text": "function isBrowserMsie() {\n return navigator.userAgent.match(/MSIE ([0-9]+)\\./);\n}", "title": "" }, { "docid": "8ed5ae672fc2f5b2b3011c6dd3c15da2", "score": "0.6296313", "text": "function getInternetExplorerVersion()\n{\n var rv = -1; /* assume not IE. */\n if (navigator.appName == 'Microsoft Internet Explorer')\n {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat( RegExp.$1 );\n }\n return rv;\n}", "title": "" }, { "docid": "8de5b8ac99d749637ddd8a2c2c6929cd", "score": "0.62919074", "text": "function IsIE() {\r\n var BrowserName = navigator.appName\r\n var BrowserVersion = parseInt(navigator.appVersion);\r\n\r\n if (BrowserName == \"Microsoft Internet Explorer\")\r\n return true;\r\n else\r\n return false;\r\n}", "title": "" }, { "docid": "000926c2d32f9a7c025447e0990b9777", "score": "0.6287287", "text": "function getInternetExplorerVersion()\n\t\t// Returns the version of Windows Internet Explorer or a -1\n\t\t// (indicating the use of another browser).\n\t\t{\n\t\t var rv = -1; // Return value assumes failure.\n\t\t if (navigator.appName == 'Microsoft Internet Explorer')\n\t\t {\n\t\t var ua = navigator.userAgent;\n\t\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t\t if (re.exec(ua) != null)\n\t\t rv = parseFloat( RegExp.$1 );\n\t\t }\n\n\t\t var isAtLeastIE11 = !!(navigator.userAgent.match(/Trident/) && !navigator.userAgent.match(/MSIE/));\n\t\t if(isAtLeastIE11){\n\t\t \t\trv = 11; //if it is IE 11 \n\t\t }\n\n\t\t return rv;\n\t\t}", "title": "" }, { "docid": "92de7b905c2dbf4ad5d2ed184b8125ce", "score": "0.6283724", "text": "function checkBrowserVersion() {\n var temp,\n info;\n\n info = uaLowerCase.match(/(opera|chrome|safari|firefox|msie)\\/?\\s*(\\.?\\d+(\\.\\d+)*)/i);\n if (info && (temp = ua.match(/version\\/([\\.\\d]+)/i)) !== null) {\n info[2] = temp[1];\n }\n\n privateBrowserVersion = info ? info[2] : navigator.appVersion;\n }", "title": "" }, { "docid": "6e0e1ae0dd7764d373c57b8253da1e0a", "score": "0.6279436", "text": "function getInternetExplorerVersion(){\n\tvar rv = -1;\n\tif (navigator.appName == 'Microsoft Internet Explorer'){\n\t\tvar ua = navigator.userAgent;\n\t\tvar re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t\tif (re.exec(ua) != null)\n\t\trv = parseFloat( RegExp.$1 );\n\t}\n\telse if (navigator.appName == 'Netscape'){\n\t\tvar ua = navigator.userAgent;\n\t\tvar re = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\");\n\t\tif (re.exec(ua) != null)\n\t\trv = parseFloat( RegExp.$1 );\n\t}\n\treturn rv;\n}", "title": "" }, { "docid": "8b505f3a273ad2c3ca9383320c97e6b1", "score": "0.627515", "text": "function getInternetExplorerVersion(){\n var rv = -1; // Return value assumes failure.\n if (navigator.appName == 'Microsoft Internet Explorer')\n {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat( RegExp.$1 );\n }\n return rv;\n}", "title": "" }, { "docid": "1525a325f898ebb0ea503efbdc8de013", "score": "0.62695044", "text": "function isCorrectVersion() {\r\n if (parseInt(version, 10) >= 9) {\r\n return true;\r\n }\r\n else {\r\n alert('This script requires Adobe Photoshop CS2 or higher.', 'Wrong Version', false);\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "3d39151a4fbfcb928b1995bc8edd1f0c", "score": "0.62685156", "text": "function checkVersion ()\n{\n return true;\n\n /***************************\n var ver = new String(InstallTrigger.getVersion(\"jslib\"));\n\n // strip off build info \n ver = ver.substring(0, ver.lastIndexOf(\".\"));\n\n return (G_VER >= ver);\n ***************************/\n}", "title": "" }, { "docid": "6bfc9394f74cacd9b1b228a5e7fb0ef9", "score": "0.615504", "text": "function isCorrectVersion() {\n\tif (parseInt(version, 10) >= 9) {\n\t\treturn true;\n\t}\n\telse {\n\t\talert('This script requires Adobe Photoshop CS2 or higher.', 'Wrong Version', false);\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "0627792b79142846a513d47c5184391c", "score": "0.61486894", "text": "function getIsIE() { return ((navigator.appName == 'Microsoft Internet Explorer') || ((navigator.appName == 'Netscape') && (new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\").exec(navigator.userAgent) != null))); }", "title": "" }, { "docid": "f7605ecfce931499e87d20dfdbb8da4a", "score": "0.61323553", "text": "function isIE() {\n return navigator.appName.match(/Internet Explorer/);\n}", "title": "" }, { "docid": "c915a480c258695ceb8022caeca959d7", "score": "0.61267257", "text": "function ieCheck(){\n\tif((window.navigator.userAgent).indexOf(\"MSIE \") > 0){\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "53324c330e88f4bb0f80e278967aadf2", "score": "0.6088393", "text": "function isIE() {\n\treturn navigator.userAgent.indexOf('MSIE') !=-1;\n}", "title": "" }, { "docid": "7b608f4e1f3ebf0b77d4c4b387508074", "score": "0.606783", "text": "function aaScreenIE() {\r\n if (navigator.appName == 'Microsoft Internet Explorer') {\r\n msie=navigator.appVersion.split(\"MSIE\")\r\n version=parseFloat(msie[1]);\r\n if (version >= 6) return false;\r\n } else {\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "caffc9f971637e2ecf5fe1a9f37602cf", "score": "0.60591644", "text": "function isIE() {\n\treturn (navigator.userAgent.indexOf(\"MSIE\") >= 0);\n}", "title": "" }, { "docid": "aa32dc996056048766daf5a0b2a2713c", "score": "0.60471284", "text": "function isCorrectVersion() {\r\n\tif (parseInt(version, 10) >= 10) {\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\talert('This script requires Adobe Photoshop CS3 or higher.', 'Wrong version', false);\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "beca30245cab5e7c1a83f33c8de775ff", "score": "0.6025441", "text": "function isIE() { return cu.browser.isIE(); }", "title": "" }, { "docid": "e100f2a80782c3f660d6f574f465b153", "score": "0.6025386", "text": "function isIE( version, comparison ){\n var $div = $('<div style=\"display:none;\"/>').appendTo($('body'));\n $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n var ieTest = $div.find('a').length;\n $div.remove();\n return ieTest;\n}", "title": "" }, { "docid": "0fa07bbc5074995273d17c0efe3bebfb", "score": "0.5999619", "text": "function detectIE()\n{\n var rv = false;\n var path = ( document.location.href );\n if (navigator.appName == 'Microsoft Internet Explorer' && path.indexOf(\"http\") == 0 )\n {\n rv = true;\n }\n return rv;\n}", "title": "" }, { "docid": "1b32b82262e8bec8b453be387a62e7c2", "score": "0.5974835", "text": "function detectIE() {\n let ua = window.navigator.userAgent;\n return (ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1);\n}", "title": "" }, { "docid": "d6906437e96d839baf7e028f52520cf7", "score": "0.59473884", "text": "function IE6browserCheck() {\t\n\t\t//return ((navigator.appName == 'Microsoft Internet Explorer' && Math.floor(Number(/MSIE ([^;]*);/.exec(navigator.appVersion)[1])) == 6));\n\t\t//Same issue is happning in IE 7 so just checking the browser type for IE\n\t\treturn (navigator.appName == 'Microsoft Internet Explorer');\n\t}", "title": "" }, { "docid": "2dc3c388ea93b4d120b1521b341e2754", "score": "0.5905471", "text": "function isInternetExplorer() {\n var rv = -1; // Return value assumes failure.\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv >= 8;\n }", "title": "" }, { "docid": "b85193009204e4fcccc9729970d38ab2", "score": "0.5897279", "text": "function isObsolete() {\n\treturn ((BrowserDetect.browser == 'Explorer') && (BrowserDetect.version <= 8));\n}", "title": "" }, { "docid": "c1e2404abf27ec0cbffca8583b27436e", "score": "0.58844584", "text": "function M_isIE() {\n return (navigator.userAgent.toLowerCase().indexOf(\"msie\") != -1) &&\n !window.opera;\n}", "title": "" }, { "docid": "552229ff7e19e103de284db9b622eef7", "score": "0.58706796", "text": "function isIE() {\r\n\tvar ua = window.navigator.userAgent.toUpperCase();\r\n\treturn (ua.indexOf(\"MSIE\") > 0);\r\n}", "title": "" }, { "docid": "6de908b4e347d453e95a5fbc40a5d831", "score": "0.58697104", "text": "function isLowerThanOrEqualWindows8_1() {\n if (process.platform != 'win32') {\n return false;\n }\n var osVersion = require('../../common/osVersion');\n return (osVersion.major <= 6 && osVersion.minor <= 3);\n}", "title": "" }, { "docid": "a30345b9a44c4bf555b911a30182ad5f", "score": "0.584125", "text": "function isIE(version, comparison) {\n var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n $div.html('<!--[if ' + (comparison || '') + ' IE ' + (version || '') + ']><a>&nbsp;</a><![endif]-->');\n var ieTest = $div.find('a').length;\n $div.remove();\n return ieTest;\n }", "title": "" }, { "docid": "a30345b9a44c4bf555b911a30182ad5f", "score": "0.584125", "text": "function isIE(version, comparison) {\n var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n $div.html('<!--[if ' + (comparison || '') + ' IE ' + (version || '') + ']><a>&nbsp;</a><![endif]-->');\n var ieTest = $div.find('a').length;\n $div.remove();\n return ieTest;\n }", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.5829123", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "dff8cb4dab9e31679d8d147896ff943c", "score": "0.5827123", "text": "function get_firefox_major_version()\n{\n if (navigator.userAgent.indexOf(\"Windows NT\") == -1)\n return -1;\n\n var ua = navigator.userAgent;\n var browser = ua.substring(0, ua.lastIndexOf(\"/\"));\n browser = browser.substring(browser.lastIndexOf(\" \") + 1);\n if (browser != \"Firefox\")\n return -1;\n \n var version = ua.substring(ua.lastIndexOf(\"/\") + 1);\n version = parseInt(version.substring(0, version.lastIndexOf(\".\")));\n return version;\n}", "title": "" }, { "docid": "6c48822f1bd83b7fc08126331d049263", "score": "0.5822352", "text": "function checkFinGetVersion(callback) {\r\n executeAsyncJavascript(\r\n \"var callback = arguments[arguments.length - 1];\" +\r\n \"if (fin && fin.desktop && fin.desktop.System && fin.desktop.System.getVersion) { callback(true); } else { callback(false); }\",\r\n function(err, result) {\r\n if (err) {\r\n callback(false);\r\n } else {\r\n callback(result.value);\r\n }\r\n }\r\n );\r\n }", "title": "" }, { "docid": "d500439efc19a263cf39f1f19a0bac98", "score": "0.580806", "text": "function useFallback() {\n\t\tvar rv = -1;\n\t\tvar ua = navigator.userAgent;\n\t\tvar re = new RegExp( \"MSIE ([0-9]{1,}[\\.0-9]{0,})\" );\n\n\t\tif (re.exec(ua) != null)\n\t\trv = parseFloat( RegExp.$1 );\n\n\t\tif ( rv > 0 && rv < 10 )\n\t\t return true;\n\t\telse\n\t\t return false;\n\t\t}", "title": "" }, { "docid": "d500439efc19a263cf39f1f19a0bac98", "score": "0.580806", "text": "function useFallback() {\n\t\tvar rv = -1;\n\t\tvar ua = navigator.userAgent;\n\t\tvar re = new RegExp( \"MSIE ([0-9]{1,}[\\.0-9]{0,})\" );\n\n\t\tif (re.exec(ua) != null)\n\t\trv = parseFloat( RegExp.$1 );\n\n\t\tif ( rv > 0 && rv < 10 )\n\t\t return true;\n\t\telse\n\t\t return false;\n\t\t}", "title": "" }, { "docid": "12233c87be23f10f3c3ee910698e1d22", "score": "0.57983553", "text": "function isIE() { // Private method\n return isIE5() || isIE6();\n}", "title": "" }, { "docid": "3df588bbe41ee007b930a7a32500bc57", "score": "0.5795884", "text": "function Xe(t) {\n return t.isFoundDocument() ? t.version : st.min();\n}", "title": "" }, { "docid": "77c8bf7d3e948eb88dee13f730b7ed2d", "score": "0.5793866", "text": "function inIE() {\n let userAgent = navigator.userAgent;\n return userAgent.includes(\"MSIE\") || userAgent.includes(\"Trident\");\n }", "title": "" }, { "docid": "4cff13e0388e5d1043eac0a88b752aaa", "score": "0.5789536", "text": "function isIE() {\n\treturn navigator.appName==\"Microsoft Internet Explorer\";\n}", "title": "" }, { "docid": "2bc440fd8a61a8b439191995fcbcd394", "score": "0.5777179", "text": "function classForMacAndIE() {\n \n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n\n if (msie > 0) {\n $('body').addClass('only-ie');\n\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\n }\n\n var trident = ua.indexOf('Trident/');\n\n if (trident > 0) {\n $('body').addClass('only-ie');\n\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n\n if (edge > 0) {\n\n $('body').addClass('only-ie');\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\n }\n\n\n if (navigator.userAgent.indexOf('Mac') > 0) {\n $('body').addClass('only-mac');\n }\n\n // other browser\n return false;\n\n}", "title": "" } ]
f335e40588ad3b37820a7209f6e7b3c3
_addBlock(block) adds a block to the chain The method will return a Promise that resolves with the block added or rejected if an error happens during execution. Check for the height to assign the 'previousBlockHash', assign the 'timestamp' and the correct 'height'. Finally, create the 'block hash' and push the block into the chain array. Update 'this.height' Note: the symbol '_' in the method name indicates in the javascript convention for a private method.
[ { "docid": "edfb12f6a84045073f44d4e38c30c337", "score": "0.8701526", "text": "_addBlock(block) {\n\t\tlet self = this;\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tlet height = self.chain.length;\n\t\t\tblock.previousBlockHash = self.chain[height - 1]\n\t\t\t\t? self.chain[height - 1].hash\n\t\t\t\t: null;\n\t\t\tblock.height = height;\n\t\t\t// SHA256 requires a string of data\n\t\t\tblock.time = new Date().getTime().toString().slice(0, -3);\n\t\t\tblock.hash = await SHA256(JSON.stringify(block)).toString();\n\t\t\tconst blockValid =\n\t\t\t\tblock.hash &&\n\t\t\t\tblock.hash.length === 64 &&\n\t\t\t\tblock.height === self.chain.length &&\n\t\t\t\tblock.time;\n\t\t\tblockValid\n\t\t\t\t? resolve(block)\n\t\t\t\t: reject(new Error('Cannot add an invalid block.'));\n\t\t})\n\t\t\t.catch((error) => console.log('ERROR: ', error))\n\t\t\t.then((block) => {\n\t\t\t\t// add block to chain\n\t\t\t\tthis.chain.push(block);\n\t\t\t\tthis.height = this.chain.length - 1;\n\t\t\t\t// validate chain\n\t\t\t\treturn new Promise(async (resolve, reject) => {\n\t\t\t\t\t(await this.validateChain())\n\t\t\t\t\t\t? resolve(block)\n\t\t\t\t\t\t: reject(new Error('Blockchain validation failed'));\n\t\t\t\t});\n\t\t\t});\n\t}", "title": "" } ]
[ { "docid": "51d267ea884bad22ccafd375fa153386", "score": "0.8693979", "text": "_addBlock(block) {\n let self = this;\n return new Promise(async (resolve, reject) => {\n let chainHeight = await self.getChainHeight();\n if (chainHeight > -1) {\n const prevBlock = await self.getBlockByHeight(self.height);\n block.previousBlockHash = prevBlock.hash;\n }\n block.timeStamp = new Date().getTime().toString().slice(0, -3);\n const newHeight = self.height +1;\n block.height = newHeight;\n block.hash = SHA256(JSON.stringify(block)).toString();\n let isValid = await self.validateChain();\n if(isValid) {\n self.chain.push(block);\n self.height++;\n }\n resolve(block);\n \n }).catch(\"Something went wrong\");\n }", "title": "" }, { "docid": "2fb7417e9abc10a9640ea7413d074e74", "score": "0.81227285", "text": "addBlock(newBlock){\n newBlock.previousHash = this.lastBlock().hash;\n newBlock.hash = newBlock.calculateHash();\n this.chain.push(newBlock);\n }", "title": "" }, { "docid": "6089cc5379f4c77493e49ef1cf130325", "score": "0.8087171", "text": "addBlock(block){\r\n block.prevHash = this.lastBlock().hash;\r\n block.mineBlock(this.dif);\r\n this.chain.push(block);\r\n }", "title": "" }, { "docid": "f109ac239506da470daa078003815f4d", "score": "0.79593927", "text": "addBlock (newBlock) {\n\t\t// Set the hash of the latest block\n\t\t// to be this new block's previous hash\n\t\tnewBlock.previousHash = this.getLatestBlock().hash\n\t\tnewBlock.mineBlock(this.difficulty)\n\t\tthis.chain.push(newBlock)\n\t}", "title": "" }, { "docid": "74d4f95f53c9716d4a0668487971c7e8", "score": "0.7947348", "text": "async _addBlock(block) {\n // Make sure chain is valid before adding any new blocks.\n const validationErrors = await this.validateChain();\n if (validationErrors.length > 0) {\n throw new Error('Can not add blocks to an invalid chain.');\n }\n\n // Increase chain height.\n this.height += 1;\n\n // Set block height.\n block.height = this.height;\n\n // Set block time.\n block.time = new Date().getTime().toString().slice(0, -3);\n\n // Set `previousBlockHash` if block is not the genesis block.\n if (this.height > 0) {\n block.previousBlockHash = this.chain[this.height - 1].hash;\n }\n\n // Create and set `hash` for block after setting `previousBlockHash` and other properties.\n block.hash = SHA256(JSON.stringify(block)).toString();\n\n // Add the block to the chain.\n this.chain.push(block);\n }", "title": "" }, { "docid": "fa90780da14b927ff4a43e779a624950", "score": "0.79155904", "text": "addBlock(newBlock){\n \n // Height do bloco a partir da chain em memória\n newBlock.height = this.chain[this.chain.length - 1].height + 1;\n \n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n \n // Hash do bloco anterior\n if(newBlock.height>0){\n \n // Vai ter que mudar para nenhum valor de hash anterior, ou seja, a partir de 0 \n newBlock.previousBlockHash = this.chain[this.chain.length-1].hash;\n }\n \n // Hash do bloco com SHA256 usando newBlock e convertendo para uma string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n \n // Adicionando objeto de bloco à cadeia\n db.addDataToLevelDB(JSON.stringify(newBlock).toString());\n \n // Adicionar bloco à cadeia na memória\n \tthis.chain.push(newBlock);\n }", "title": "" }, { "docid": "aec54fa67b8d6dc9ddcd5bf39b446f6b", "score": "0.78802854", "text": "addBlock (block) {\n checkBlock(this.lastBlock(), block, this.difficulty, this.getUnspent())\n this.chain.push(block) // Push block to the chain\n this.cleanMempool(block.transactions) // Clean mempool\n debug(`Added block ${block.index} to the chain`)\n return block\n }", "title": "" }, { "docid": "ee5966e95ea20ad5c529de8433501ba5", "score": "0.78718823", "text": "addBlock(newBlock){\n\t\tnewBlock.previousHash = this.getLatestBlock().hash;\n\t\tnewBlock.hash = newBlock.calculateHash();\n\t\tthis.chain.push(newBlock);\n\t}", "title": "" }, { "docid": "c1655d027c2ae60b71cc9bc17531b9f8", "score": "0.77886593", "text": "addBlock(newBlock){\n\t\t//first: set the previousHash value of the new block to the hash of the last block in the chain\n\t\tnewBlock.previousHash = this.getLatestBlock().hash;\n\t\t//calling the mineBlock function, passing a difficulty value/time limit, to mine the block before pushing it onto the chain\n\t\tnewBlock.mineBlock(this.difficulty);\n\t\t//add this new block to the chain\n\t\tthis.chain.push(newBlock);\n\t}", "title": "" }, { "docid": "a4d6bedd773204c5636684f2ef354080", "score": "0.77423245", "text": "addBlock(newBlock) {\n newBlock.previousHash = this.getLatestBlock().hash;\n newBlock.mineBlock(this.difficulty);\n this.chain.push(newBlock);\n }", "title": "" }, { "docid": "a4d6bedd773204c5636684f2ef354080", "score": "0.77423245", "text": "addBlock(newBlock) {\n newBlock.previousHash = this.getLatestBlock().hash;\n newBlock.mineBlock(this.difficulty);\n this.chain.push(newBlock);\n }", "title": "" }, { "docid": "bf8fc613e41265807b673adae3768302", "score": "0.77202535", "text": "addBlock(newBlock) {\n\t\tnewBlock.previousHash = this.lastBlock.hash;\n\t\tnewBlock.hash = newBlock.createHash();\n\t\tthis.chain.push(newBlock);\n\t\treturn newBlock.hash;\n\t}", "title": "" }, { "docid": "0a9253daa72dfaab3451d8877c2ff65d", "score": "0.7709017", "text": "addBlock(block) {\n this.chain.push(block)\n // reset pending Transactions\n this.pendingTransactions = []\n }", "title": "" }, { "docid": "f0db9018909e00ed7f8b9925c7bb1a50", "score": "0.76135254", "text": "addBlock(newBlock) {\n return new Promise((res, rej) => {\n let self = this;\n this.getBlockHeight().then((height) => {\n // Block height\n newBlock.height = (height);\n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n // Block hash with SHA256 using newBlock and convert to string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n if (newBlock.height > 0) {\n self.getBlock(height - 1).then((response) => {\n newBlock.previousBlockHash = JSON.parse(response).hash;\n // Store new block in database\n levelDB.addLevelDBData(height, newBlock);\n res(JSON.stringify(newBlock));\n console.log(\"Block \" + newBlock.height + \" has been added to the blockchain.\");\n });\n } else {\n // Block hash with SHA256 using newBlock and convert to string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Store new block in database\n //levelDB.addLevelDBData(newBlock.height, JSON.stringify(newBlock).toString());\n levelDB.addLevelDBData(height, newBlock);\n res(JSON.stringify(newBlock));\n }\n })\n });\n }", "title": "" }, { "docid": "8df0894bb71955a9b808628ff01ada23", "score": "0.7582112", "text": "addBlock(data){\n // grabs the last block in the chain to get the last hash\n const block = Block.mineBlock(this.chain[this.chain.length-1], data);\n this.chain.push(block); // push/add it to the chain\n\n return block;\n \n\n }", "title": "" }, { "docid": "d1a610d8dbd6a2bc12d6f9409e504ff2", "score": "0.7534051", "text": "prepareAndPushBlock(newBlock) {\n let that = this;\n // Block height\n newBlock.height = that.chainLength;\n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Adding block object to chain\n addLevelDBData(newBlock.height, JSON.stringify(newBlock)).then(() => {\n console.log('Added block #' + newBlock.height);\n // Increment chainLength after insertion is confirmed\n that.chainLength += 1;\n }).catch(err => {\n console.log('Failed to add block', err);\n });\n }", "title": "" }, { "docid": "ee88213262af09ffc8ff8978ed612c45", "score": "0.74473923", "text": "addBlock(newBlock){\n getBlockHeightFromLevelDB(function(height) {\n // Block height\n newBlock.height = (height + 1);\n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n // previous block hash\n if(height>=0){\n getDataFromLevelDB(height, function(data) {\n newBlock.previousBlockHash = JSON.parse(data).hash;\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Store newBlock in LevelDB\n addDataToLevelDB(newBlock.height, JSON.stringify(newBlock).toString());\n });\n } else {\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Store newBlock in LevelDB\n addDataToLevelDB(newBlock.height, JSON.stringify(newBlock).toString());\n }\n });\n }", "title": "" }, { "docid": "da3fccda08ab56c914ca700d42c4a25f", "score": "0.7435811", "text": "addBlock(data) {\n const lastBlock = this.chain[this.chain.length-1];\n const block = Block.mineBlock(lastBlock, data)\n this.chain.push(block);\n return block;\n }", "title": "" }, { "docid": "72ab2235eb05ba8dc140f09b72ec8bfc", "score": "0.7404664", "text": "addBlock(data){\n let index = this.chain.length;\n let prevHash = this.chain.length !== 0 ? this.chain[this.chain.length - 1].hash : 0;\n let block = new Block(index, data, prevHash);\n \n this.chain.push(block);\n }", "title": "" }, { "docid": "50534258619454d62587a2b5af41a028", "score": "0.740275", "text": "addBlock(newBlock){\n\n // before adding a block to the blockchain, it needs to set the previousHash to the last block on the chain\n newBlock.previousHash = this.getLatestBlock().hash;\n \n // now that we've changed the the block, we need to update its hash\n // the block is 'mined' and the hash is created which starts with the number of zeros defined by the difficulty property\n newBlock.mineBlock(this.difficulty)\n \n // now we can push this block onto the chain\n this.chain.push(newBlock);\n }", "title": "" }, { "docid": "817be98baa531ac062f62d8f6ec04a0c", "score": "0.72577", "text": "function addBlock(data) {\n if(!data) throw new Error(\"Can't create a block without data!\");\n let newBlock = new Block();\n return chaindb.getBlockHeight()\n .then(blockHeight => {\n if(data === 'genesis') {\n newBlock.body = \"First block in the chain - Genesis block\";\n return;\n } else {\n newBlock.body = data;\n newBlock.height = blockHeight + 1;\n return chaindb.getBlockFromDB(blockHeight);\n }\n }).then((block) => {\n if(data !== 'genesis') newBlock.previousBlockHash = block.hash;\n\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n\n let key = newBlock.height;\n let value = JSON.stringify(newBlock);\n\n return chaindb.addBlockToDB(key, value);\n }).then( () => {\n let block = JSON.stringify(newBlock);\n console.log(\"New Block added to Chain.\");\n return block;\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "2e956431b0f3b57c009c79a5e8f8a20a", "score": "0.7111405", "text": "addBlock({data}){\n // console.log(`data is ${data}`);\n const lastBlock = this.chain[this.chain.length-1];\n const newBlock = Block.mineBlock({lastBlock, data});\n this.chain.push(newBlock);\n // console.log(this.chain.length);\n }", "title": "" }, { "docid": "68782a161d80ec64e74ffb72d335307b", "score": "0.70789963", "text": "async function addBlock(newBlock){\n\n newBlock.height=await getBlockHeight(); //setting new block height\n if(newBlock.height == 0)\n { newBlock.previousBlockHash=0;//setting previousblockhash for genesis block\n\t\t\tnewBlock.body=\"Genesis block in the Block chain\";\n console.log(\"Block chain need genesis Block ...!!!! \", newBlock.height);}\n if(newBlock.height > 0)\n {\n let obj=await getBlock(newBlock.height-1);//setting previousblockhash from old block\n newBlock.previousBlockHash=obj.hash;//setting previousblockhash for the block\n }\n console.log(\"newBlock.previousBlockHash: \",newBlock.previousBlockHash);\n\t\t\tnewBlock.time = new Date().getTime().toString().slice(0,-3);//setting datetime for the block\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();//setting Hash for the block\n\t\t\t//Add block to Level DB\n\t\t\taddDataToLevelDB(newBlock.height, JSON.stringify(newBlock)).then((result) => {\n if(!result) {console.log(\"Error Adding data\");\n }else {\n return result;\n console.log(\"RESULT \",result);}\n }).catch((err) => { console.log(err); });\n\n}", "title": "" }, { "docid": "d937f25fc5a6185da46971cc28b62d15", "score": "0.7068573", "text": "async addGenesisBlock(newBlock) {\n try {\n let height = parseInt(await this.getBlockHeight(), 10);\n\n\n\n //console.log(alldata.length);\n if (height === -1) {\n console.log(\"add first\");\n // Block height \n newBlock.height = 0;\n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n // previous block hash\n newBlock.previousBlockHash = \"\";\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Adding block object to chain\n let putblock = await this.putBlock(0, JSON.stringify(newBlock));\n return putblock;\n\n }\n }\n catch (err) {\n console.log(err.message);\n return err.message; }\n // waits to get all values array\n\n }", "title": "" }, { "docid": "2ee4c7178f05e5f3fbb6bccc56353653", "score": "0.69981134", "text": "addBlock(newBlock) {\n let self = this;\n console.log('***** blockchain.addBlock(block): ', newBlock);\n // Add your code here\n // fetch previous block to get hash\n\n return new Promise(function(resolve, reject) {\n // Add your code here, remember in Promises you need to resolve() or reject()\n // console.log('***** blockchain.addBlock(block) calling self.getBlockHeight ***** ');\n self.getBlockHeight().then((blockHeight) => {\n //console.log('blockchain.addBlock(block) self.getBlockHeight blockHeight: ', blockHeight);\n\n // get the block by blockHeight in order to set previousBlockHash\n self.getBlock(blockHeight).then((returnedBlock) => {\n // console.log(\"blockchain.addBlock(block) result from self.getBlock returnedBlock: \", returnedBlock);\n if (returnedBlock === undefined){\n console.log(\"!!!!! ERROR blockchain.addBlock(block) result from self.getBlock(\" + blockHeight + \") is UNDEFINED\");\n reject(\"!!!!! ERROR blockchain.addBlock(block) result from self.getBlock(\" + blockHeight + \") is UNDEFINED\");\n }\n\n // console.log(\"blockchain.addBlock(block) setting values in newBlock\");\n let height = (blockHeight + 1);\n //console.log(\"blockchain.addBlock(block) newBlock height: \", height);\n newBlock.setHeight(height);\n newBlock.setTimestamp(utils.getDateAsUTCString());\n newBlock.setPreviousBlockHash(returnedBlock.hash);\n newBlock.setHash(utils.generateHashFor(newBlock));\n\n // db.addBlock returns a Promise\n //console.log(\"blockchain.addBlock(block) calling self.bd.addBlock(newBlock): \", newBlock);\n self.bd.addBlock(newBlock).then( (result) => {\n //console.log(\"blockchain.addBlock(block) self.bd.addBlock result: \", result);\n resolve(result);\n }).catch((err) => {\n console.log(\"blockchain.addBlock(block) self.bd.addBlock error: \", err);\n reject(err);\n });\n }).catch((err) => {\n console.log(err);\n reject(err);\n });\n }).catch((err) => {\n console.log(err);\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "e6fd4ef102352444d1b5ba9c057230c2", "score": "0.6941768", "text": "function addBlockToDB(height, block) {\n return new Promise( (resolve, reject) => {\n db.put(height, block)\n .then( block => resolve(block))\n .catch( err => reject(new Error(`Block ${height} submission failed `, err)));\n });\n}", "title": "" }, { "docid": "22017f4caa5cbaddd61700fb0d7cfab1", "score": "0.6914564", "text": "addBlock(block) {\n this.blocks.push(block)\n // setHead()\n }", "title": "" }, { "docid": "db957008465bd290cf5c1dcaf58a50ac", "score": "0.6882235", "text": "_modifyBlock(height, block) {\n\t\tlet self = this;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tself.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n\t\t\t\tresolve(blockModified);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.log(err);\n\t\t\t\treject(err)\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "afca10a3b4620da8f43b3b0efced839e", "score": "0.6777598", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "afca10a3b4620da8f43b3b0efced839e", "score": "0.6777598", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "11bcf13c1864122515c22d0323f30e73", "score": "0.6724992", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "11bcf13c1864122515c22d0323f30e73", "score": "0.6724992", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "2f93c0b6c74171c90a54fab6318a027a", "score": "0.6723522", "text": "addBlock(name, profilePic)\n \t{\n\t\tconst block = Block.mineBlock(this.chain[this.chain.length-1], name, profilePic);\n \tthis.chain.push(block);\n\n \treturn block;\n \t}", "title": "" }, { "docid": "a188e0ed51757f458fd0a1b1d2bc7b9c", "score": "0.67145777", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n })\n }).catch((err) => { console.log(err); reject(err) });\n }", "title": "" }, { "docid": "83d0b492c3ee3c887e1e68f641b455e7", "score": "0.6701325", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n /*\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n */\n // 17 May 2019 modified to remove JSON.stringify because that is done in LevelSandbox\n self.bd.addLevelDBData(height, block).then((blockModified) => {\n //console.log(\"_modifyBlock blockModified: \", blockModified);\n resolve(blockModified);\n }).catch((err) => {\n console.log(err);\n reject(err)\n });\n });\n }", "title": "" }, { "docid": "952958625f6177cff7c52171f1d68643", "score": "0.6689698", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "b13304560e383189f6e9c9bbaea50110", "score": "0.6673738", "text": "createBlock(data, previousBlock) {\n let block = {\n previousBlock,\n data,\n challenge: '000',\n createDatetime: Date.now()\n };\n\n const blockDataString = block.previousBlock + JSON.stringify(block.data) + block.challenge + block.createDatetime;\n\n return this.mineBlock(blockDataString, block.challenge)\n .then(minedHash => {\n block.hash = minedHash.hash;\n block.proofOfWork = minedHash.nonce;\n this.chain.push(block)\n });\n }", "title": "" }, { "docid": "5e1827ce1da512b673968eecd546dd0e", "score": "0.66724575", "text": "addBlock(block, miningRewardAddress) {\n // Pass the verify function the blockchain\n if (block.verify(this.getHeadHash())) {\n // Valid block, add it\n console.log('Successfully added a block!');\n this.blockchain.push(block);\n this.checkMiningReward();\n }\n }", "title": "" }, { "docid": "216e29e02bb48f065f740e340aba8347", "score": "0.6659885", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd\n .addLevelDBData(height, JSON.stringify(block).toString())\n .then(blockModified => {\n resolve(blockModified);\n })\n .catch(err => {\n console.log(err);\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "95abb527c13d14a0caf859228fb256ee", "score": "0.6647259", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block)).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => {\n console.log(err);\n reject(err)\n });\n });\n }", "title": "" }, { "docid": "5b2a57f4710d2cdbbc8aa897b11d253e", "score": "0.6544288", "text": "maybeAddGenesisBlock(blockHeight) {\n if( blockHeight == 0) {\n console.log(\"Adding genesis block\");\n let genesisBlock = new Block(\"First block in the chain - Genesis block\");\n genesisBlock.height = 0;\n genesisBlock.timestamp = new Date().getTime().toString().slice(0,-3);\n genesisBlock.previousBlockHash = '';\n genesisBlock.hash = SHA256(JSON.stringify(genesisBlock)).toString();\n var promise = this.storeBlockInDb(JSON.stringify(genesisBlock).toString()).then((result) => {\n return Promise.resolve(blockHeight + 1);\n });\n\n return promise;\n } else {\n return Promise.resolve(blockHeight + 1);\n } \n }", "title": "" }, { "docid": "099f1d6a6843ff04c2ccc54c9a01ce3f", "score": "0.6529218", "text": "push(block) {\n // const prev is assigned to the previous block\n const prev = (this.blocks[this.blocks.length - 1]) || (null);\n // this.state is assigned to blockchain.verifyBlock and updated\n this.state = Blockchain.verifyBlock(prev, this.state, block);\n // block is eventually pushed into the blockchain blocks array\n this.blocks.push(block);\n }", "title": "" }, { "docid": "084639108fc40c564159d41af5082199", "score": "0.64963675", "text": "_modifyBlock(height, block) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "title": "" }, { "docid": "13d3799cb0a5de7a170525faa7e29562", "score": "0.6454948", "text": "newBlock (proof, previousHash) { //takes the POW, and last hash\n \n //immutable block object\n const block = {\n index: this.chain.length + 1, //new obj increment\n time_Stamp: new Date(), //get now time for date\n transactions: this.currTransactions, //set the blocks transaction\n proof: proof, //\n previous_Hash: previousHash\n }\n this.currTransactions = []; //no transaction change\n this.chain.push(block); //push onto array chain stack\n return block;\n }", "title": "" }, { "docid": "d5668da376f48cb2479e25ed8ab71d0b", "score": "0.6451033", "text": "async _modifyBlock(height, block) {\n let blockModified = await this.bd.addLevelDBData(height, JSON.stringify(block).toString());\n\n return blockModified;\n }", "title": "" }, { "docid": "81e58ebb57955af9c2ccecfe4582c4b4", "score": "0.6437916", "text": "function addBlock() {\n\t\n\tif (blocks > 0) {\n\t\tprev = $(\"#block\"+blocks+\"hash\").val();\n\t}\n\tblocks += 1;\n\tvar block = blocks;\n\t$(\"#block-row\").append($(\"<div class='col-xs-6'></div>\").load(\"/block.html\", function(){\n\t\tsetAttributes(block);\n\t\tupdateHash(block);\n\t}));\n}", "title": "" }, { "docid": "642cb029dc4a43a3f4b6d08812aadc26", "score": "0.6388362", "text": "addBlock(blockType) {\n this.props.addSectionBlock(\n this.props.section,\n buildBlock(\n this.props.sectionDefinition,\n blockType || this.props.sectionDefinition.blocks[0].type,\n findBlockNextIndex(this.props.sectionContent.blocks)\n )\n )\n }", "title": "" }, { "docid": "a2048a14959e9e3c1038aea1345faf02", "score": "0.63582724", "text": "minePendingVotes(){\n let block = new Block(Date.now(), this.pendingVotes, this.getLatestBlock().hash);\n block.mineBlock(this.difficulty);\n hashResult += 'Block successfully mined!'+ '\\n';\n // console.log('Block successfully mined!');\n this.chain.push(block);\n\n }", "title": "" }, { "docid": "2c316d9e784b2200e9d1589e93763296", "score": "0.63520783", "text": "minependingTransaction(miningRewardAddress)\n{\nlet block=new Block(Date.now(),this.pendingTransaction);\nblock.mineBlock(this.difficulty);\n\nconsole.log(\"Block mined Successful\");\nthis.chain.push(block);\nthis.pendingTransaction=[new Transaction(null,miningRewardAddress,this.miningReward)];\n}", "title": "" }, { "docid": "3832abdb8a036a139aca7cfa9fbe0792", "score": "0.6330937", "text": "async appendBlock(block, batchOps) {\n if (typeof block.hash !== 'string') {\n throw new Error('Invalid block hash.');\n }\n\n let ops = [\n { type: 'put', key: genKey(`block_${block.hash}`), value: JSON.stringify(block) },\n { type: 'put', key: genKey('head_block'), value: block.hash }\n ];\n if (block.litemsgs) {\n for (let litemsg of block.litemsgs) {\n ops.push({ type: 'put', key: genKey(`litemsg_${litemsg.hash}`), value: block.hash });\n }\n }\n if (batchOps) {\n ops = [...ops, ...batchOps];\n }\n\n return this.db.batch(ops);\n }", "title": "" }, { "docid": "cb9d7cd8b945c2760a12758da08458e6", "score": "0.6293656", "text": "validateBlock(height) {\n // Add your code here\n //console.log('***** blockchain.validateBlock(height) ***** ');\n let self = this;\n return new Promise(function(resolve, reject) {\n // Add your code here, remember in Promises you need to resolve() or reject()\n //first get block\n self.getBlock(height).then((returnedBlock) => {\n if (returnedBlock === undefined){\n console.log(\"!!!!! ERROR blockchain.addBlock(block) result from self.getBlock(\" + blockHeight + \") is UNDEFINED\");\n reject(\"!!!!! ERROR blockchain.addBlock(block) result from self.getBlock(\" + blockHeight + \") is UNDEFINED\");\n }\n\n if (self.checkForValidBlockHash(returnedBlock)) {\n resolve(true);\n } else {\n reject('!!!!! Blockchain.validateBlock Block ' + height + ' is not a valid block!');\n }\n }).catch((err) => {\n console.log(\"blockchain.getBlock(height) Failed to retrieve block by height: \", height);\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "2d36fadbbd5295078ab487bf8c334ad7", "score": "0.6260511", "text": "function addBlockToDatabase(block){\n databaseRef.push(block);\n}", "title": "" }, { "docid": "49f1e092bf8998f28097644f945401f2", "score": "0.6202367", "text": "AdBlock(data){\n let blockNumber = this.Blocks.length + 1;\n let prevHash = \"0000000000000000000000000000000000000000000000000000000000000000\";\n if (blockNumber !== 1){\n prevHash = this.Blocks[this.Blocks.length - 1].Hash;\n }\n\n let newBlock = new Block(blockNumber, data, 0, prevHash);\n newBlock.Mine();\n this.Blocks.push(newBlock)\n }", "title": "" }, { "docid": "63ba330493fa50c7ffb2428d7f634df4", "score": "0.6180473", "text": "function processBlock(blockHeight) {\n return new Promise(async (resolve, reject) => {\n try {\n await ActionController.processActionsFromBlockHeight(blockHeight);\n const processedBlock = new Block({ blockHeight });\n await processedBlock.save();\n resolve();\n } catch(e) {\n logger.log('error', e);\n reject(e);\n }\n });\n}", "title": "" }, { "docid": "c33e28cf0b3c19368b95c0f52dd43bba", "score": "0.6168282", "text": "function addBlock(block){\n allBlocks.unshift(block);\n}", "title": "" }, { "docid": "bac3c39b04c0207df677075c0b900ddb", "score": "0.614587", "text": "changeBlockData(height, newData) {\n return new Promise((resolve, reject) => {\n level.getLevelDBData(height).then(function(result){\n // compare block chain hash to the object\n let dirtyBlock = JSON.parse(result);\n dirtyBlock.data = newData;\n level.addLevelDBData(height, JSON.stringify(dirtyBlock).toString()).then(resolve, reject);\n }, reject);\n });\n }", "title": "" }, { "docid": "07f7892eefe0499d6049d1d9fb7e7412", "score": "0.61324507", "text": "function appendBlock(parentColumn, baseBlock, columnNumber, blockHeight) {\n var blockDiv = document.createElement('div');\n blockDiv.style.border = DEFAULT_BLOCK_BORDER;\n blockDiv.className = 'block';\n var colorIndex = Math.floor(Math.random() * 5);\n var color = COLORS[colorIndex];\n blockDiv.innerText = LETTERS[colorIndex];\n blockDiv.className += ' ' + color;\n if (isMobile) {\n blockDiv.className += ' mobileBlockSizes';\n } else {\n blockDiv.className += ' desktopBlockSizes';\n }\n blockDiv.style.left = columnNumber * BLOCK_SIZE_IN_PIXELS;\n blockDiv.style.top = blockHeight * BLOCK_SIZE_IN_PIXELS;\n sameboard.appendChild(blockDiv);\n\n var newBlock = Object.create(Block);\n if (baseBlock) {\n newBlock.blockHeight = baseBlock.blockHeight + 1;\n newBlock.prevBlock = baseBlock;\n baseBlock.nextBlock = newBlock;\n }\n newBlock.column = parentColumn;\n newBlock.color = colorIndex;\n newBlock.blockDiv = blockDiv;\n blockDiv.block = newBlock;\n return newBlock;\n}", "title": "" }, { "docid": "2a438f860ad4845ad3dbb29da4374292", "score": "0.6123103", "text": "generateGenesisBlock() {\n let self = this;\n let self2 = this.bd;\n let block\n\n return new Promise((resolve, reject) => {\n\n block = new Block(\"First block in the chain - Genesis block\")\n block.time = new Date().getTime().toString().slice(0, -3)\n block.hash = SHA256(JSON.stringify(block)).toString();\n block.height = 0\n self2.addDataToLevelDB(JSON.stringify(block)).then((result) => {\n //console.log(JSON.parse(result))\n resolve(result)\n })\n }).catch((err) => { console.log(err); reject(err) });\n }", "title": "" }, { "docid": "ce71fb57b92898975da17fc243713ed7", "score": "0.6114212", "text": "static mineBlock({lastBlock , data}){\n\n const lastHash = lastBlock.hash;\n let timestamp , hash;\n let { difficulty } = lastBlock;\n let nonce = 0;\n\n do {\n nonce++;\n timestamp = Date.now(); // every time the chain rties to find the hash the time changes , hence the timestamp needs to change as well\n difficulty = Block.adjustDifficulty({ originalBlock: lastBlock, timestamp }); // The difficulty will be based of the timestamp from the last guess of block\n hash = cryptoHash(timestamp, lastHash, data, nonce, difficulty);\n } while (hexToBinary(hash).substring(0, difficulty) !== '0'.repeat(difficulty)) // The hex to binary function comes from the hex-to-binary library that turns hex to binary \n // - > this is better because it allows for a more adjustable difficulty setting\n\n\n return new this({ //returns the newly created block\n timestamp, \n lastHash,\n data ,\n difficulty,\n nonce,\n hash\n });\n }", "title": "" }, { "docid": "1c24539625c6486419b77d5d117e0d8b", "score": "0.60978353", "text": "createBlock(proof, previousHash) {\n let block = {\n index: this.chain.length+1,\n 'timestamp': Date.now(),\n 'proof':proof,\n 'previousHash':previousHash,\n 'transcations':this.transcations\n }\n this.transcations = {};\n this.chain.push(block);\n return block;\n }", "title": "" }, { "docid": "9123c5a9ee607c6ba8e9ec8fd4927833", "score": "0.6086004", "text": "function addBlock(name, x, y, height, width){\n var block = Block(numBlocks);\n block.x = x;\n block.y = y;\n block.name = name;\n block.height = height;\n block.width = width;\n BLOCK_LIST[numBlocks] = block;\n numBlocks = numBlocks + 1;\n}//adds a block to BLOCK LIST", "title": "" }, { "docid": "d527cd255d05e60bfef460fe8cc72736", "score": "0.6052924", "text": "function addBlock(payload) {\n\t return {\n\t type: _constantsResumeConstants.ADD_BLOCK,\n\t payload: payload\n\t };\n\t}", "title": "" }, { "docid": "15d136061eebeeaaafd9bc3d66504d8c", "score": "0.6008388", "text": "async _initializeChain() {\n if (this.height === -1) {\n let block = new BlockClass.Block({ data: 'Genesis Block' });\n await this._addBlock(block);\n }\n }", "title": "" }, { "docid": "262739fb9af6c8f2542087acf85ca6ba", "score": "0.6003834", "text": "function addBlock()\n\t{\n\t\tvar $this = $(this),\n\t\t\tcontainer = $this.closest('[class*='+prefixeBlock+']');\n\t\t\n\t\tcurEdit = container;\n\t\t\n\t\tonAddStart($this);\n\t\t\n\t\tif(container.is('[class*='+prefixeBlock+']'))\n\t\t{\n\t\t\tvar html = container.extractNameBlockInClass(),\n\t\t\t\tnewBlock = block[html] != undefined\n\t\t\t\t\t\t\t&& block[html].html != undefined ? block[html].html(container) : '';\n\t\t\t\n\t\t\tnewBlock = $(newBlock);\n\t\t\tvar newBlockB = onAdd(newBlock,html,$this);\n\t\t\tnewBlock = newBlockB ? newBlockB : newBlock;\n\t\t\t\n\t\t\tif(newBlock) container.append(newBlock);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar html = 'default',\n\t\t\t\tnewBlock = block[html] != undefined\n\t\t\t\t\t\t\t&& block[html].html != undefined ? block[html].html($(workspace)) : '';\n\t\t\t\n\t\t\tnewBlock = $(newBlock);\n\t\t\tvar newBlockB = onAdd(newBlock,html,$this);\n\t\t\tnewBlock = newBlockB ? newBlockB : newBlock;\n\t\t\t\n\t\t\tif(newBlock) $(workspace).append(newBlock);\n\t\t}\n\t\t\n\t\tnewBlock.addAction(html,container);\n\t\t\n\t\tvar newBlockC = onAddEnd(newBlock,html,$this);\n\t\tnewBlock = newBlockC ? newBlockC : newBlock;\n\t\t\n\t\tcurEdit = newBlock;\n\t}", "title": "" }, { "docid": "fa006e1884a5d94f1f2368ea6c26791b", "score": "0.5936926", "text": "addBlock( amount, byPlayer ){\n\t\t\n\t\tlet pre = this.getBlock();\n\t\t\n\t\tamount = parseInt(amount);\n\t\tif( isNaN(amount) )\n\t\t\tthrow 'Invalid value passed to block: '+amt;\n\n\t\t// Damage\n\t\tif( amount < 0 ){\n\n\t\t\tlet n = this.block+amount;\n\t\t\tif( n < 0 ){\t// We went below 0, and have to remove from incoming block too\n\t\t\t\tthis.block = 0;\n\t\t\t\tthis.iBlock = Math.max(0, this.iBlock+n);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.block = n;\n\n\t\t}\n\t\t// ADD\n\t\telse{\n\n\t\t\tif( game.isTurnPlayer(this) )\n\t\t\t\tthis.block += amount;\n\t\t\telse\n\t\t\t\tthis.iBlock += amount;\n\n\t\t}\n\n\t\tlet added = this.getBlock()-pre;\n\n\t\tconst evt = new GameEvent({\n\t\t\tsender : byPlayer,\n\t\t\ttarget : this,\n\t\t\tcustom : {\n\t\t\t\tamount : Math.abs(added)\n\t\t\t}\n\t\t});\n\t\tevt.type = added > 0 ? GameEvent.Types.blockAdded : GameEvent.Types.blockSubtracted;\n\t\tevt.raise();\n\n\t\tif( added < 0 && !this.block )\n\t\t\tnew GameEvent({\n\t\t\t\ttype : GameEvent.Types.blockBroken,\n\t\t\t\tsender : byPlayer,\n\t\t\t\ttarget : this,\n\t\t\t}).raise();\n\n\t\t\n\t\treturn added;\n\n\t}", "title": "" }, { "docid": "57ec544f78ac6b7d7efdee7580d54835", "score": "0.59303004", "text": "validateBlock(height) {\n const self = this;\n // console.log(`validating block: ${height}`);\n return new Promise(function(resolve, reject) {\n self\n .getBlock(height)\n .then(block => {\n if (block) {\n // hash is added to block after, so must be removed to compute same hash\n const blockWithoutHash = { ...block, hash: \"\" };\n const blockHash = SHA256(\n JSON.stringify(blockWithoutHash)\n ).toString();\n const validBlockHash = block.hash;\n if (validBlockHash === blockHash) {\n // console.log(`block ${height} is valid`);\n resolve(true);\n } else {\n // console.log(`block ${height} is invalid`);\n resolve(false);\n }\n } else {\n reject(\"Block does not exist!\");\n }\n })\n .catch(err => {\n console.log(err);\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "b6daa4d574ccb167bf6556f100b84e67", "score": "0.5926163", "text": "minePendingTransactions(miningRewardAddress) {\n\n // Rewarding the miner for his hardwork\n const rewardTx = new Transaction(null, miningRewardAddress, this.miningReward);\n this.pendingTransactions.push(rewardTx);\n\n // Creating a new Block by calculating previous Hash and other parameters\n let pH = this.getLatestBlock().hash;\n let block = new Block(Date.now(), this.pendingTransactions, pH);\n block.mineBlock(this.difficulty);\n\n // Pushing it into chain array (main Block-Chain)\n console.log('Block Mined Successfully');\n this.chain.push(block);\n this.pendingTransactions = [];\n }", "title": "" }, { "docid": "30df8fc11522e3b5c124f58ec6a55a09", "score": "0.59099454", "text": "validateBlock(height) {\n // Add your code here\n let self = this;\n return new Promise((resolve, reject) => {\n this.getBlock(height).then((blockData) => {\n let block = JSON.parse(blockData);\n // get block hash\n let blockHash = block.hash;\n // remove block hash to test block integrity\n if (block.hash) {\n block.hash = '';\n }\n // generate block hash\n let validBlockHash = SHA256(JSON.stringify(block)).toString();\n if (validBlockHash === blockHash) {\n resolve(true);\n } else {\n // Reject the promise if a block is invalid or hash does not match. Reject the whole chain.\n reject(true);\n }\n });\n });\n }", "title": "" }, { "docid": "89d39f7ed926e092475c272745772e66", "score": "0.589172", "text": "function Blockchain()\n{\n // Arbitary params\n const nonce = 100, previousBlockHash = '0', hash = '0'; \n // All blocks that are mined are stored in the array as a chain\n this.chain = [];\n // Hold all of the new and pending transactions that are created before placed into a block\n this.pendingTransactions = [];\n\n /** \n * Create new block\n * @param {int} nonce - Block created legitimately via Proof of Work\n * @param {string} previousBlockHash - Data for the new block hashed\n * @param {string} hash - Data from the previous block hashed\n */\n\n Blockchain.prototype.createNewBlock = (nonce, previousBlockHash, hash) =>\n {\n const newBlock = {\n index: this.chain.length + 1, // Block number\n timestamp: Date.now(), // Block created date\n transactions: this.pendingTransactions, // All new or pending transactions inside block\n nonce: nonce,\n hash: hash,\n previousBlockHash: previousBlockHash \n }\n // Clear out transactions for next block\n this.pendingTransactions = [];\n // Append new block to blockchain\n this.chain.push(newBlock);\n // Return new block\n return newBlock;\n }\n\n // Create genesis block\n this.createNewBlock(nonce, previousBlockHash, hash);\n\n // Return the last block number\n Blockchain.prototype.getLastBlock = () => \n {\n return this.chain[this.chain.length - 1];\n }\n\n /** \n * Create new transaction\n * @param {int} amount - take the amount of the transaction\n * @param {string} sender - senders address\n * @param {string} recipient - recipients address\n */\n\n Blockchain.prototype.createNewTransaction = (amount, sender, recipient) => \n {\n const newTransaction = {\n amount: amount, \n sender: sender,\n recipient: recipient\n };\n // Append new transaction to blockchain\n this.pendingTransactions.push(newTransaction);\n // Return the number of the block the transaction is added to\n return this.getLastBlock()['index'] + 1;\n }\n\n /**\n * Return hashed data\n * @param {string} previousBlockHash -\n * @param {string} currentBlockHash -\n * @param {int} nonce - \n */\n\n Blockchain.prototype.hashBlock = (previousBlockHash, currentBlockHash, nonce) =>\n {\n // Change all pieces of data into a single piece of data\n const dataAsString = previousBlockHash + nonce.toString() + JSON.stringify(currentBlockHash);\n // Create hash\n const hash = sha256(dataAsString);\n // Return hash\n return hash;\n }\n\n /**\n * Define Proof of Work\n * @param {string} previousBlockHash - \n * @param {string} currentBlockHash - \n */\n\n Blockchain.prototype.proofOfWork = (previousBlockHash, currentBlockHash) =>\n {\n // Define a nonce and quad value\n let nonce = 0, quadValue = '0000';\n // Hash all the data initially\n let hash = this.hashBlock(previousBlockHash, currentBlockHash, nonce);\n // Iterate over the hashBlock method until suitable hash appears\n while(hash.substring(0, 4) !== quadValue) {\n nonce++; // Different value of nonce\n hash = this.hashBlock(previousBlockHash, currentBlockHash, nonce); \n };\n\n // Return nonce value that returned valid hash\n return nonce;\n }\n}", "title": "" }, { "docid": "7896ad50e3c8b139977aceef5414f7e0", "score": "0.58787507", "text": "generateGenesisBlock(){\n // Add your code here\n let self = this;\n this.getBlockHeight().then((height) => {\n if(0 > height){\n self.addBlock(new Block.Block(\"First block in the chain - Genesis block\")).then(function(data){\n console.log(\"Genesis block added to the chain\");\n });\n }\n }).catch((err) => {return err;});\n \n }", "title": "" }, { "docid": "5692d2c7620aad793cf7c491e6713e23", "score": "0.5874139", "text": "minePendingTransactions(miningRewardAddress) {\r\n let block = new Block(Date.now(), this.pendingTransactions);\r\n block.mineBlock(this.difficulty);\r\n\r\n console.log(\"Block mined Succesfully\");\r\n this.chain.push(block);\r\n\r\n this.pendingTransactions = [\r\n new Transaction(null, miningRewardAddress, this.miningReward)\r\n ];\r\n }", "title": "" }, { "docid": "86efe4d5cdaf6ebb3a2251521a7eb803", "score": "0.58536756", "text": "generateGenesisBlock(){\n this.bd.getBlockHeight().then((blockHeight) => {\n\n if(blockHeight === -1){\n this.addBlock(new Block.Block(\"First block in the chain - Genesis block\")).then(() => {\n // console.log(\"Genesis block created successfully\");\n });\n } \n \n });\n }", "title": "" }, { "docid": "7f1e1051ca2ab94b808244f71187c320", "score": "0.58405477", "text": "storeBlockInDb(newBlock) {\n return levelSandbox.addDataToLevelDB(newBlock);\n }", "title": "" }, { "docid": "db8c3774a1e565150e51dcb7aeb1c90b", "score": "0.5837288", "text": "generateGenesisBlock(){\n // Add your code here\n //console.log('***** generateGenesisBlock *****');\n let self = this;\n //console.log('***** generateGenesisBlock calling self.getBlockHeight *****');\n self.getBlockHeight().then( (result) => {\n //console.log('***** generateGenesisBlock logging result from self.getBlockHeight: ', result);\n if (result === 0) {\n //console.log('***** generateGenesisBlock creating new block');\n // height = 0, timestamp = '', data = [], previousBlockHash = '', hash = ''\n let b = new Block.Block('This is the Genesis Block');\n b.setHeight(0);\n b.setTimestamp(utils.getDateAsUTCString());\n b.setPreviousBlockHash(0);\n b.setHash(utils.generateHashFor(b));\n //console.log('***** generateGenesisBlock calling self.bd.addBlock ');\n self.bd.addBlock(b).then( (result) => {\n console.log(\"generateGenesisBlock fulfilled: \", result);\n }).catch((err) => {\n console.log(\"generateGenesisBlock rejected self.bd.addBlock error: \", err);\n });\n } else {\n console.log('***** generateGenesisBlock NO GENESIS BLOCK CREATED - BLOCKS EXIST');\n }\n }).catch((err) => {\n console.log(\"generateGenesisBlock generateGenesisBlock error: \", err);\n });\n }", "title": "" }, { "docid": "f9cce9bba6756589a5fa6273dd7b589c", "score": "0.5811755", "text": "changeChainData(height, newData) {\n return new Promise((resolve, reject) => {\n level.getLevelDBData(height).then(function(result){\n // compare block chain hash to the object\n let dirtyChain = JSON.parse(result);\n dirtyChain.data = newData;\n dirtyChain.hash = \"\";\n dirtyChain.hash = SHA256(JSON.stringify(dirtyChain)).toString();\n level.addLevelDBData(height, JSON.stringify(dirtyChain).toString()).then(resolve, reject);\n }, reject);\n });\n }", "title": "" }, { "docid": "aec2cf42a0df198ebd77fb44c55e982f", "score": "0.5762648", "text": "createBlock() {\n // TBD\n }", "title": "" }, { "docid": "fa07df1a9ce152e131396c9e2820183d", "score": "0.5760692", "text": "mineBlock() {\n let i = 0;\n let trueCount = 0;\n while (i<this.transactions.length) {\n const verTrans = this._verifyTransaction(this.transactions[i]);\n if(verTrans.length > 0) {\n console.error(\"Transaction \" + trueCount + \": \" + verTrans);\n // removes transaction if there is an error\n this.transactions.splice(i, 1);\n } else i++;\n trueCount++;\n }\n if(this.transactions.length === 0) {\n console.error(\"Cannot mine empty block.\");\n return;\n }\n let previousHash = this.ledger.getLastBlock().hash;\n let blockNum = this.ledger.getLastBlock().data.blockNumber+1;\n let myBlockData = new BlockData(blockNum, previousHash, this.transactions, 0, 0);\n let hash = st.findNonce(myBlockData, this.config.LEAD);\n let block =\n {\n data: myBlockData,\n hash: hash\n };\n this._addBlock(block);\n this.transactions = [];\n }", "title": "" }, { "docid": "fc8219f361957700d01e9375420d6f03", "score": "0.57219064", "text": "generateGenesisBlock(){\n // Add your code here\n try {\n this.getBlockHeight().then((height) => {\n if(height === -1) {\n this.addBlock(new Block.block('Fist block in the chain - Genesis Block')).then((result) => {\n console.log('Genesis block ' + result);\n });\n }\n })\n } catch(err) {\n console.log(err);\n } \n }", "title": "" }, { "docid": "ddc1afc6249e3d0aaa5417eaadc40389", "score": "0.56976813", "text": "generateGenesisBlock() {\n const self = this;\n self\n .getBlockHeight()\n .then(height => {\n // console.log(`in genisis block checking height: ${height}`);\n if (height === 0) {\n // only create genisis block if there are no other blocks\n const genisisBlock = new Block.Block(\n \"First block in the chain - Genesis block\"\n );\n // console.log(`in (height === 0) going to add block: ${height} and block data:`);\n // console.log(genisisBlock);\n self.addBlock(genisisBlock);\n }\n })\n .catch(err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "155764d2f8ef0d679c79a2b8233a74c0", "score": "0.56905746", "text": "mine() {\n const validTransactions = this.transactionPool.validTransactions();\n // Include a reward for the miner\n validTransactions.push(Transaction.rewardTransaction(this.wallet, \n Wallet.blockchainWallet()));\n // Create a block consisting of the valid transactions\n const block = this.blockchain.addBlock(validTransactions);\n // Synchronize the chains in the P2P server\n this.p2pServer.syncChains();\n // Clear the transaction pool\n this.transactionPool.clear();\n // Broadcast to every miner to clear their transaction pools\n this.p2pServer.broadcastClearTransactions();\n\n return block;\n }", "title": "" }, { "docid": "9ba079a3106993e2b49c979b92ed81b9", "score": "0.56761634", "text": "function BlockChain(){\n\tthis.chain = [];\n\tthis.pendingTransactions = [];\n\t\n\t// creating genesis Block\n\tthis.createNewBlock(100,'0','0');\n}", "title": "" }, { "docid": "8140b18be2c6a40734657e06d100af90", "score": "0.5675989", "text": "validateChain() {\n // Add your code here\n let self = this;\n //console.log('***** BlockChain.validateChain *****');\n\n // The Map object holds key-value pairs and remembers the original insertion order of the keys.\n\n return new Promise(function(resolve, reject) {\n let errorLog = [];\n self.getBlockHeight().then( (blockHeight) => {\n if (blockHeight === 0){\n //only one block in chain, so only validate the single block; do not check previous hash\n self.validateBlock(0).then( (result) => {\n resolve(errorLog);\n }).catch( (err) => {\n console.log(\"blockchain.validateChain height=0; failed to validate block err: \", err);\n errorLog.push(err);\n reject(err);\n });\n } else {\n\n self.bd.getAllBlocks().then((chainMap) => {\n if (chainMap.size === 0) {\n let msg = \"blockchain.validateChain retrieve all blocks returned an empty map!\";\n //console.log(msg);\n errorLog.push(msg);\n reject(errorLog);\n }else {\n let keys = Array.from(chainMap.keys());\n keys.sort(utils.sortNumericalArrayItemsAscending);\n // 11 blocks in array; blockHeight is 10;\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let currentBlock = chainMap.get(key);\n let isValidBlock = self.checkForValidBlockHash(currentBlock);\n if (isValidBlock) {\n // compare currentBlockHash with nextBlock's previousBlockHash\n // make sure this is not the end of the chain\n if (key !== blockHeight) {\n let nextKey = (key + 1);\n let nextBlock = chainMap.get(nextKey);\n if (currentBlock.hash === nextBlock.previousBlockHash) {\n resolve(errorLog);\n } else {\n let msg = 'Block ' + key + ' failed currentBlock.hash === nextBlock.previousBlockHash';\n //console.log(msg, currentBlock.hash, nextBlock.previousBlockHash);\n reject(errorLog);\n }\n } else {\n resolve(true);\n }\n } else {\n let msg = 'Block ' + key + ' failed validateBlock';\n //console.log(msg);\n errorLog.push(msg);\n reject(errorLog);\n }\n }\n }\n }).catch((err) => {\n console.log(\"blockchain.validateChain error: \", err);\n reject(err);\n });\n }\n }).catch( (err) => {\n console.log(\"blockchain.validateChain Failed to retrieve blockHeight \", err);\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "ed3997eaf27bb5f867eed748ffc9afc0", "score": "0.56398046", "text": "async mineBlock( block, difficulty, start, end, height, showLogsOnlyOnce){\n\n if(showLogsOnlyOnce) {\n console.log(\"\");\n console.log(\" ----------- mineBlock-------------\", height, \" \", difficulty.toString(\"hex\"));\n }\n\n try{\n\n //calculating the hashes per second\n\n\n let answer;\n\n try {\n answer = await this.mine(block, difficulty, start, end, height);\n } catch (exception){\n console.error(\"Couldn't mine block \" + block.height, exception);\n answer = {\n result: false,\n };\n }\n\n if (answer && answer.result && this.blockchain.blocks.length === block.height ){\n\n console.warn( \"----------------------------------------------------------------------------\");\n console.warn( \"WebDollar Block was mined \", block.height ,\" nonce (\", answer.nonce+\")\", \"timestamp\", block.timeStamp, answer.hash.toString(\"hex\"), \" reward\", (block.reward / WebDollarCoins.WEBD), \"WEBD\", block.data.minerAddress.toString(\"hex\"));\n console.warn( \"difficulty prev: \", block.difficultyTargetPrev.toString(\"hex\") );\n console.warn( \"----------------------------------------------------------------------------\");\n\n this.blockchain.mining.timeMinedBlock = new Date().getTime();\n\n //check if I mined all the last K blocks\n let i = this.blockchain.blocks.length-1;\n let count = 0;\n\n while ( !consts.DEBUG && i >= 0 && (await this.blockchain.getBlock(i)) .data.minerAddress.equals( this.unencodedMinerAddress )){\n\n count ++;\n i--;\n\n if (count >= consts.MINING_POOL.MINING.MAXIMUM_BLOCKS_TO_MINE_BEFORE_ERROR){\n StatusEvents.emit(\"blockchain/logs\", {message: \"You mined way too many blocks\"});\n break;\n }\n\n }\n\n let revertActions = new RevertActions(this.blockchain);\n\n try {\n\n if (await this.blockchain.semaphoreProcessing.processSempahoreCallback( () => {\n\n //returning false, because a new fork was changed in the mean while\n if (this.blockchain.blocks.length !== block.height)\n return false;\n\n block.hash = answer.hash;\n block.nonce = answer.nonce;\n\n //calculate blockHashChain\n block.hashChain = block.calculateChainHash();\n\n return this.blockchain.includeBlockchainBlock( block, false, \"all\", true, revertActions, false );\n\n }) === false) throw {message: \"Mining2 returned false\"};\n\n revertActions.push( {name: \"block-added\", height: block.height } );\n\n NodeBlockchainPropagation.propagateLastBlockFast( block );\n\n //confirming transactions\n await block.data.transactions.confirmTransactions();\n\n StatusEvents.emit(\"blockchain/new-blocks\", { });\n\n console.warn( \"----------------------------------------------------------------------------\");\n console.warn( \"Block mined successfully\");\n console.warn( \"----------------------------------------------------------------------------\");\n\n } catch (exception){\n console.error(\"Mining processBlocksSempahoreCallback raised an error \",block.height, exception);\n await revertActions.revertOperations();\n }\n\n } else\n if (!(answer && answer.result))\n console.error( \"block \", block.height ,\" was not mined...\");\n\n if (this.reset) { // it was reset\n this.reset = false;\n this._hashesPerSecond = 0;\n }\n\n } catch (Exception){\n\n console.error( \"Error mining block \", Exception, (block !== null ? block.toJSON() : '') );\n\n throw Exception;\n }\n\n }", "title": "" }, { "docid": "27e6b2c96ff4e15a4714e023563e5ce1", "score": "0.56163144", "text": "mine() {\n const validTransactions = this.txPool.getValidTxs();\n validTransactions.push(\n // include reward for mine\n Transaction.rewardTransaction(this.wallet, Wallet.blockchainWallet())\n );\n const minedBlock = this.blockchain.addBlock(validTransactions);\n // sync the chains via p2pServer\n this.p2pServer.broadcastUpdatedChain();\n this.txPool.clear();\n // broadcast to other miners to clear their txPool as well\n this.p2pServer.broadcastClearTransaction();\n\n return minedBlock;\n }", "title": "" }, { "docid": "692bc1ffac574949ef63b060b58f0ffb", "score": "0.5615922", "text": "static mineBlock({ lastBlock, data }) {\n const lastHash = lastBlock.hash;\n let hash, timestamp;\n // grab last block difficulty\n let { difficulty } = lastBlock;\n // make nonce a variable that can change. nonce should be able to adjust in mining algorithm\n let nonce = 0;\n\n // introduce a pattern to create a new hash until one is find with the right amount of leading 0s. DO WHILE LOOP increments the non-value until the difficulty criteria is met\n do {\n // whilst below isn't true keep >\n // adjusting the nonce\n nonce++;\n // setting the timestamp to current\n timestamp = Date.now();\n // adjust difficulty by calling the below function. do this on every loop to find the valid hash\n difficulty = Block.adjustDifficulty({ \n originalBlock: lastBlock, \n timestamp\n })\n // setting the hash based on the data and the above\n hash = cryptoHash(timestamp, lastHash, data, nonce, difficulty);\n // note add hexto binary to see the binary form\n\n } while (hexToBinary(hash).substring(0, difficulty) !== '0'.repeat(difficulty));\n \n return new this({\n timestamp,\n lastHash,\n data,\n difficulty,\n nonce,\n hash,\n });\n }", "title": "" }, { "docid": "f8d5c6dd56c17cf7ef9fbdc102772f70", "score": "0.56094337", "text": "function transferBlock(height1, height2) {\n bc.chain[height1] = bc.chain[height2];\n}", "title": "" }, { "docid": "7dbaba1007e49996952c19b240ff9801", "score": "0.56077784", "text": "getBlock(height) {\n // Add your code here\n //console.log('***** blockchain.getBlock(height) ***** ');\n let self = this;\n return new Promise(function(resolve, reject) {\n // Add your code here, remember in Promises you need to resolve() or reject()\n //levelSandbox.getBlock returns a Promise\n // console.log('***** blockchain.getBlock(height) calling self.bd.getBlock(height) ***** ');\n self.bd.getBlock(height).then( (result) => {\n // console.log('blockchain.getBlock(height) self.bd.getBlock(height) success: ', result);\n resolve(result);\n }).catch((err) => {\n console.log('blockchain.getBlock(height) Failed to retrieve block by height: ', height);\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "0a1e32054d01dacf4ff36ab3aa6b9103", "score": "0.5594177", "text": "async populateBlockchain(blockchain) {\n this.height = blockchain.length;\n this.chain = blockchain;\n\n // creates genesis block if blockchain length is 0\n if(!blockchain.length){\n this.createGenesis();\n }\n }", "title": "" }, { "docid": "2ad752d9c30c553cff5da8e3d91394b3", "score": "0.5590473", "text": "receiveBlock(block) {\n let errors = this.verify(block);\n if(errors.length === 0) {\n this.ledger.addBlock(block);\n // quick fix, eventually transactions will have to be validated and cleaned out every time a new block is added\n this.transactions = [];\n }\n else {\n console.log(\"From node \" + this.id + \":\");\n for (let error of errors)\n console.warn(error);\n console.log(\"Block: \", block);\n console.log(\"Transactions: \", JSON.stringify(block.data.transactions, null, ' '))\n }\n }", "title": "" }, { "docid": "8dc28598760930a6197e5dee6f00e52d", "score": "0.55802274", "text": "validateBlock(height) {\n let self = this;\n\n return new Promise(function(resolve) {\n // get block object\n self.getBlock(height)\n .then((result) => {\n // get block hash\n let blockHash = result.hash;\n\n // remove block hash to test block integrity\n result.hash = '';\n\n // generate block hash\n let validBlockHash = SHA256(JSON.stringify(result)).toString();\n\n // Compare\n resolve(blockHash === validBlockHash);\n });\n });\n }", "title": "" }, { "docid": "4be858ea84f3230f0dea3641e6d868a2", "score": "0.5579162", "text": "validateChain(){\n return new Promise(resolve => {\n \n // Obter a height da chain\n db.getBlocksCount().then((result) => {\n if(!result) {\n console.log('Error with getting chain height within validateChain');\n }else {\n var CorrectCounter = 0;\n \n // Loop através de cada bloco do bloco um usado para comparar o hash anterior\n for (var a = 0; a < result + 1; a++){\n \n // Obter valor de blocos usado para comparar\n              // OBSERVAÇÃO: Objetos de bloco são retornados como sequências de caracteres\n db.getLevelDBData(a-1).then((hash) => {\n if (!hash){\n console.log('Error With getting block within validateChain')\n }else{\n \n // Transforme a string de volta no objeto de bloco\n var obj = JSON.parse(hash);\n \n // Mantém o hash de bloco para comparar\n var blockhash = obj.hash;\n \n // Remover hash do objeto de bloco\n obj.hash = \"\";\n \n // Bloco hash com SHA256 para comparar com o hash no bloco\n var validBlockHash = SHA256(JSON.stringify(obj)).toString();\n \n // Colocar de volta o hash do objeto que foi removido\n obj.hash = blockhash;\n \n // O bloco da gênese não tem um hash anterior, o bloco é comparado apenas ao hash feito ao bloco\n if (obj.height == 0){\n \n // Comparando o hash que acabamos de criar (validBlockHash) com o hash no bloco\n if (obj.hash === validBlockHash){\n console.log(\"genesis Block Valid\")\n }else{\n console.log(\"genesis block invalid\")\n \n // Se a gênese é inválida, resolvemos a Promise com string e height do bloco\n var StringEnder = \"Chain invalid, please check block \"+obj.height;\n resolve(StringEnder);\n }\n }else{\n \n // Se não for bloco de gênese, pegue o bloco anterior subtraindo um da height\n db.getLevelDBData(obj.height - 1).then((priorHash) => {\n if (!priorHash){\n console.log(\"Error getting next Block\")\n }else{\n \n // Tornar o bloco anterior em um objeto\n var Newobj = JSON.parse(priorHash);\n \n // Vailação completa do bloco\n if (Newobj.hash === obj.previousBlockHash && validBlockHash === obj.hash){\n \n // Chegar ao fim da cadeia e resolver a promise com uma string válida\n if (result - 2 == CorrectCounter){\n resolve(\"CHAIN VALID\")\n }\n \n // Contador para a posição da chain\n CorrectCounter += 1;\n \n // Se o bloco ou bloco anterior for inválido, resolva a promise com uma string com blocos inválidos\n }else{\n console.log(\"Check prior hash match with blocks:\",obj.height, \"&\",obj.height -1 )\n var prior = obj.height - 1\n var StringEnder = \"CHAIN invalid, please check blocks \"+obj.height+\" and \"+prior;\n resolve(StringEnder);\n }\n }\n });\n }\n }\n }).catch((err) => { console.log(err);});\n }\n }\n \n }).catch((err) => { console.log(err); });\n \n })\n }", "title": "" }, { "docid": "8de5b031c4502837fc02abb21862cbe4", "score": "0.55787945", "text": "function init() {\n return chaindb.getBlockHeight()\n .then(blockHeight => {\n if(blockHeight === undefined) {\n console.log('New Blockchain created.');\n return addBlock(\"genesis\");\n } else {\n let length = parseInt(blockHeight) + 1;\n console.log(`Blockchain already exist with ${length} block(s).`);\n }\n console.log(\"Blockchain initialized.\");\n return 'Success';\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "e95dd05b5891477de7c968fb2fc49b57", "score": "0.55339944", "text": "static mineBlock(lastBlock, data) {\r\n\r\n let hash, timestamp;\r\n const lastHash = lastBlock.hash;\r\n let { difficulty } = lastBlock;\r\n let nonce = 0;\r\n\r\n do{\r\n nonce++;\r\n timestamp = Date.now();\r\n difficulty = Block.adjustDifficulty(lastBlock, timestamp);\r\n hash = Block.hash(timestamp, lastHash, data, nonce, difficulty);\r\n } while (hash.substring(0, difficulty) !== '0'.repeat(difficulty));\r\n \r\n return new this(timestamp, lastHash, hash, data, nonce, difficulty);\r\n }", "title": "" }, { "docid": "3dc08c1b974775ee236c7497f95ed867", "score": "0.5529182", "text": "function pushBlock() {\n stack.push({});\n }", "title": "" }, { "docid": "cb58f5d187e5af7e104fe476911d76a0", "score": "0.5524913", "text": "generateGenesisBlock(){\n let self = this;\n\n return new Promise(function(resolve, reject) {\n self.addBlock(new Block.Block('First block in the chain - Genesis block'))\n .then((result) => resolve(result))\n .catch((err) => reject(err))\n });\n }", "title": "" }, { "docid": "561c19313755eb9593c4b8020084d4cf", "score": "0.55010325", "text": "mine() {\n const validTransactions = this.transactionPool.validTransactions();\n // include a reward for the miner\n validTransactions.push(\n Transaction.rewardTransaction(this.wallet, Wallet.blockchainWallet())\n );\n // create a block consisting of the valid transactions\n const block = this.blockchain.addBlock(validTransactions);\n // synchronize chains in the peer to peer server\n this.p2pServer.syncChains();\n // clear transaction pool local to miner\n this.transactionPool.clear();\n // broadcast to every miner to clear their\n this.p2pServer.broadcastClearTransactions();\n // transaction pools so its not posted twice\n\n return block;\n }", "title": "" }, { "docid": "b213bf7733300cbc2c43df8af2600b5a", "score": "0.5491585", "text": "getBlockByHeight(height) {\n let self = this;\n return new Promise((resolve, reject) => {\n let block = self.chain.filter(p => p.height === height)[0];\n if(block){\n resolve(block);\n }\n }).catch(\"Something went wrong\");\n }", "title": "" }, { "docid": "5389c28d75e301b82bbf91c96439b663", "score": "0.54811037", "text": "generateGenesisBlock() {\n // Add your code here\n this.getBlockHeight().then((blockHeight) => {\n if (blockHeight === 0) {\n this.addBlock(new Block.Block(\"First block in the chain - Genesis block\"));\n }\n });\n }", "title": "" }, { "docid": "eebef4e3ed2a9a20fe0166eed2809233", "score": "0.54700834", "text": "generateGenesisBlock() {\n // Add your code here\n this.getBlockHeight().then((height) => {\n if (height == 0) {\n let genesisBlock = new Block.Block(\"Genesis Block\");\n\n genesisBlock.height = 0;\n genesisBlock.time = new Date().getTime().toString().slice(0, -3);\n genesisBlock.hash = SHA256(JSON.stringify(genesisBlock)).toString();\n\n this.bd.addLevelDBData(genesisBlock.height, JSON.stringify(genesisBlock).toString());\n }\n });\n }", "title": "" }, { "docid": "f57c8aa2b14500a906e50f7cbd51d17f", "score": "0.54691255", "text": "add (headers) {\n // ensure 'headers' is an array\n if (!Array.isArray(headers)) {\n throw Error('Argument must be an array of block headers')\n }\n\n // make sure first header isn't higher than our tip + 1\n if (headers[0].height > this.height() + 1) {\n throw Error('Start of headers is ahead of chain tip')\n }\n\n // make sure last header is higher than current tip\n if (headers[headers.length - 1].height <= this.height()) {\n throw Error('New tip is not higher than current tip')\n }\n\n // make sure we aren't reorging longer than max reorg depth\n // (otherwise longest chain isn't necessarily most-work chain)\n if (headers[0].height < this.height() - maxReorgDepth) {\n throw Error(`Reorg deeper than ${maxReorgDepth} blocks`)\n }\n\n // get list of blocks which will be reorged (usually none)\n let index = headers[0].height - this.store[0].height\n let toRemove = this.store.slice(index)\n\n // make sure we this isn't a fake reorg (including headers which are already in the chain)\n if (toRemove.length > 0 && getHash(headers[0]).equals(getHash(toRemove[0]))) {\n throw Error('Headers overlap with current chain')\n }\n\n // make sure headers are connected to each other and our chain,\n // and have valid PoW, timestamps, etc.\n this.verifyHeaders(headers)\n\n // remove any blocks which got reorged away\n this.store.splice(this.store.length - toRemove.length, toRemove.length)\n if (this.indexed) {\n for (let i = 0; i < toRemove.length; i++) {\n this.index.pop()\n }\n }\n\n // add the headers\n this.store.push(...headers)\n\n // index headers by hash\n if (this.indexed) {\n for (let header of headers) {\n let hexHash = getHash(header).toString('hex')\n this.index.push(hexHash, header)\n if (this.index.length > maxReorgDepth) {\n this.index.shift()\n }\n }\n }\n\n // emit events\n if (toRemove.length > 0) {\n this.emit('reorg', {\n remove: toRemove.reverse(),\n add: headers\n })\n }\n this.emit('headers', headers)\n }", "title": "" } ]
7c2ed2324173707f93db52ef3a12784a
senInfo(zip1, city): Collects initial data on start / endpoints from Google API
[ { "docid": "cdf595da4c57e80ec63f314f6fff56db", "score": "0.6962838", "text": "function setInfo(zip1, city)\n {\n //var api = \"https://jsonp.afeld.me/?url=https%3A%2F%2Fwww.zipcodeapi.com%2Frest%2FLapKZOoH0rcwVyfgQqrp0qvSBrlBbueXFEHEt6mtxz0t8fJYFboGBTydlUPxp3u4%2Finfo.json%2F\"+zip1+\"%2Fdegrees\";\n var api = \"http://maps.googleapis.com/maps/api/geocode/json?address=\"+zip1+\"&sensor=true\";\n $.ajax({\n url: api\n })\n .done(function( data ) {\n city.name = data['results'][0]['address_components'][1]['long_name'];\n city.lat = parseFloat(data['results'][0]['geometry']['location']['lat']);\n city.lng = parseFloat(data['results'][0]['geometry']['location']['lng']);\n console.log(city.name);\n if(city == city2)\n {\n last = true;\n }\n if(last)\n {\n last = false;\n buildMidCities();\n for(var i = 0; i < cityArr.length; i++)\n {\n getWeather(cityArr[i]);\n }\n }\n });\n }", "title": "" } ]
[ { "docid": "40e1a701f96ac354255eab51e01c94c5", "score": "0.62005526", "text": "function proccessCityInfo(data) {\n\tinitData(data);\n}", "title": "" }, { "docid": "7579fe8cc704c071660dbc576cff928b", "score": "0.5921707", "text": "async function parseCityInfo() {\n const parseResult = await parseTsv(config.geonames.zipFile);\n parseResult.forEach(row => {\n const lat = row[9];\n const lon = row[10];\n\n // we need lat&lon in order to execute spatial searches\n if (lat == null || lon == null) {\n return;\n }\n\n const countryCode = row[0];\n let countryName;\n let continentName;\n if (countryCode) {\n const country = countries[countryCode];\n if (country) {\n countryName = country.name;\n continentName = country.continent;\n }\n }\n\n cities.push({\n coords: {\n lat: Number(lat),\n lon: Number(lon)\n },\n city: row[2],\n county: row[3],\n country: countryName,\n continent: continentName,\n });\n });\n}", "title": "" }, { "docid": "1fd267fcd97c7f815ea2464c2a13491d", "score": "0.591936", "text": "function getCityInfo() {\n var lat = currentCity.coord.lat;\n var lon = currentCity.coord.lon;\n fetch(\n \"https://api.openweathermap.org/data/2.5/onecall?lat=\" +\n lat +\n \"&lon=\" +\n lon +\n \"&appid=bdf9878507551e1cf1dad292997418ad\",\n {\n method: \"GET\",\n credentials: \"same-origin\",\n redirect: \"follow\",\n cache: \"no-store\",\n }\n )\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(\"city info\");\n currentCityInfo = data;\n console.log(data);\n setInfo();\n });\n}", "title": "" }, { "docid": "df3c3e253c7d883f99a8f7b28b0b860b", "score": "0.58605987", "text": "function populateCityInfoStart() {\n for (var i = 0; i < majorCitiesArray.length; i++) {\n $(`#city${i + 1}`).html(`\n <p>${majorCitiesArray[i]}</p>\n <p>Time:</p>`);\n }\n}", "title": "" }, { "docid": "e67eb6ce6f137e1797006ce2335c3754", "score": "0.5848708", "text": "function getInfo(city) {\n var city;\n // API URL for city\n var queryURL= \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&units=imperial\" + \"&appid=8391498daeaf403c89574dc9e5a777c7\";\n\n // API call\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n getMoreInfo(response);\n displayForecast(response); \n })\n }", "title": "" }, { "docid": "7f971725d5280e6de5610b1149f3f0fd", "score": "0.58329535", "text": "function getCityInfo() {\n var cityNumber = 0;\n majorCitiesArray.forEach(function(city, index) {\n var geoCodeAPIkey = \"700f8122007345be85cf878d02de94cd\";\n var geoCodequeryURL = `https://api.opencagedata.com/geocode/v1/json?q=${city}&key=${geoCodeAPIkey}`;\n setTimeout(function() {\n cityNumber++;\n $.ajax({\n url: geoCodequeryURL,\n method: \"GET\"\n }).then(function(response) {\n var cityInfoObject = {\n cityLat: response.results[0].geometry.lat,\n cityLng: response.results[0].geometry.lng\n };\n var timeZoneQueryURL = `https://api.timezonedb.com/v2.1/get-time-zone?key=${timeZoneAPIkey}&format=json&by=position&lat=${cityInfoObject.cityLat}&lng=${cityInfoObject.cityLng}`;\n $.ajax({\n url: timeZoneQueryURL,\n method: \"GET\"\n }).then(function timeSearch(timeResult) {\n var timeInfoFull = timeResult.formatted;\n var timeInfoArray = timeInfoFull.split(\" \");\n var timeArray = timeInfoArray[1].split(\":\");\n cityInfoObject.cityTime = `${timeArray[0]}:${timeArray[1]}`;\n });\n cityInfoArray.push(cityInfoObject);\n\n if (cityNumber === majorCitiesArray.length){\n populateCityInfo();\n }\n });\n }, 1000 * index);\n })\n}", "title": "" }, { "docid": "2756efd55cadbfc45b23ad6ce8332b69", "score": "0.5770694", "text": "function searchCity(cityName) {\n let endPoint = `/2.5/weather?q=${cityName}&appid=${apiKey}`;\n\n //fetch API info based on the builded URL\n fetch(baseURL + endPoint)\n //convert info into a JSON\n .then(function (res) {\n return res.json();\n })\n //display info \"JSONed\"\n .then(function (data) {\n console.log(data);\n let lati = data.coord.lat;\n let long = data.coord.lon;\n appendCityList(cityName);\n cityByLatLon(lati, long); //calling the second endpoint\n });\n}", "title": "" }, { "docid": "bd006845ba78d9e5679fc836e1b69e8c", "score": "0.5749555", "text": "function zipCaller(zip) {\n var zipQueryUrl\n = \"https://us-zipcode.api.smartystreets.com/lookup?auth-id=\" + smartyStreetsID +\n \"&auth-token=\" + smartyStreetsToken + \"&zipcode=\" + zip;\n $.ajax({\n url: zipQueryUrl,\n method: \"GET\",\n success: function (response) {\n backTracker(response[0].zipcodes[0].county_fips);\n }\n })\n }", "title": "" }, { "docid": "137de0b3f45e66a94af5f5c7d47c39cb", "score": "0.57359535", "text": "function getCity(lat, lng) {\r\n //url = \"https://maps-api-ssl.google.com/maps/api/geocode/json?latlng=\"+lat+\",\"+lng+\"&sensor=true\";\r\n url = \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\"+lat+\",\"+lng+\"&sensor=true\";\r\n\r\n $.ajax(url).done(function(data) {\r\n for (var i = 0; i < data.results.length; i++) {\r\n for (var j = 0; j < data.results[i].address_components.length; j++) {\r\n\tfor (var k = 0; k < data.results[i].address_components[j].types.length; k++) {\r\n\t if (data.results[i].address_components[j].types[k] === 'locality') {\r\n\t var city_name = data.results[i].address_components[j].long_name;\r\n $('#home_site_name').val(city_name);\r\n\t console.log(' city name = ' + city_name);\r\n\t }\r\n\t}\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "9f4e58ed906ba7895fe32dc7b53204f1", "score": "0.57136357", "text": "function getCityName(){\n\t//check to see if app has been opened and city stored/changed\n\tif (typeof localStorage.zip == 'undefined') {\n\t\tvar zip = 83440;\n\t} else {\n\t\tvar zip = localStorage.zip;\n\t}\n\n\tvar myCity = new XMLHttpRequest();\n\tmyCity.onreadystatechange = function() {\n\t\tif(myCity.readyState == 4 && myCity.status==200) {\n\t\t\tvar response2 = myCity.responseText;\n\t\t\tvar answer2 = JSON.parse(response2);\n\t\t\tvar cityNameDefault = answer2.places[0]['place name'];\n\t\t\tvar state = answer2.places[0]['state abbreviation'];\n\t\t\tconsole.log(cityNameDefault, state);\n\t\t\tlocalStorage.zip = zip;\n\t\t\tlocalStorage.city = cityNameDefault;\n\t\t\tlocalStorage.state = state;\n\t\t\tgetCity(cityNameDefault);\n\t\t};\n };\n myCity.open(\"GET\", \"http://api.zippopotam.us/us/\"+zip, true);\n myCity.send();\n}", "title": "" }, { "docid": "af6d75ae35d6fd812ece887b12f30567", "score": "0.56836843", "text": "function init() { impServer(); getCurrentCityId(); impView();}", "title": "" }, { "docid": "b4cd9cb95657621a9e673c09e0954257", "score": "0.5676566", "text": "function getCityState () {\n\t var request = new XMLHttpRequest();\n\t var url = \"http://api.zippopotam.us/us/\"+document.getElementById('address_1_zip').value;\n\n\t request.open(\"GET\", url, true);\n\t request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n\t request.onreadystatechange = function() {\n\t if(request.readyState === 4) {\n\t \tif (this.status >= 200 && this.status < 400) { // lookup & input city/state by zip\n\t\t var locationInfo = JSON.parse(request.responseText).places[0];\n\t\t document.getElementById('address_1_state').value = locationInfo['state abbreviation'];\n\t\t document.getElementById('address_1_city').value = locationInfo['place name'];\n\t \t} else { // show city/state inputs on failed lookup\n\t \t\taddClass(document.getElementById('location'), 'show');\n\t \t};\n\t };\n\t };\n\t request.send();\n\t}", "title": "" }, { "docid": "12e34baa5f976c88b986c2216ba3f933", "score": "0.5664131", "text": "init(data){\n console.log(JSON.stringify(data,null,2));\n city = data.city;\n }", "title": "" }, { "docid": "b4eada9a08ab48197dab1f7f3c775c2a", "score": "0.5636841", "text": "function getAddressInfoByZip(zip) {\r\n if (zip.length >= 5 && typeof google != 'undefined') {\r\n var addr = {};\r\n \r\n\t\t \r\n\t\t \r\n\t\t jQuery.ajax({\r\n type: 'POST',\r\n url: paintcare.ajax_url,\r\n data: {\r\n action: 'pc_get_cache_geocode',\r\n pc_address: zip\r\n },\r\n success: function(response) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar obj = jQuery.parseJSON(response);\r\n\t\t \t\tif(obj.geocode !=\"\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\t pc_process_geocode_results(obj.geocode,addr);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.log(1);\r\n\t\t\t\t \r\n\t\t\t\t\t\t\t\t\tvar geocoder = new google.maps.Geocoder();\r\n\t\t\t\t\t\t\t\t\tgeocoder.geocode({\r\n\t\t\t\t\t\t\t\t\t\t'address': zip\r\n\t\t\t\t\t\t\t\t\t}, function(results, status) {\r\n\t\t\t\t\t\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tpc_save_geocode(results,zip);\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tmapFadeOut();\r\n\t\t\t\t\t\t\t\t\t\t\tif (results.length >= 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t pc_process_geocode_results(results,addr);\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\tresponse({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuccess: false\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tresponse({\r\n\t\t\t\t\t\t\t\t\t\t\t\tsuccess: false\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t });\r\n\t\t\t\r\n } else {\r\n response({\r\n success: false\r\n });\r\n }\r\n }", "title": "" }, { "docid": "1938dba91f5b5ff5263c27a8b9516574", "score": "0.5607135", "text": "function cityState() {\n const url = `https://api.opencagedata.com/geocode/v1/json?q=`;\n let place = $(\"#icon_prefix\").val();\n let cageKey = \"71d042c6415048dfa43baaaa58e46e6d\";\n let queryString = `${place}&key=${cageKey}`;\n queryURL = (url + queryString);\n\n // empty results div\n $(\".results-container\").empty();\n\n // call cagedata API\n $.ajax({\n url: queryURL,\n method: 'GET',\n }).then(function (response) {\n\n if (test) console.log(\" in cagedata response\");\n if (test) console.log(\" cagedata response\", response);\n\n let lat = response.results[0].geometry.lat;\n let lon = response.results[0].geometry.lng;\n\n let location = {\n latitude: lat,\n longitude: lon,\n success: true\n }\n\n getTrails(location);\n })\n}", "title": "" }, { "docid": "f8f26799e58e3aabe6dcc030fb433042", "score": "0.5598536", "text": "function weatherRunner(zip) {\n // we only get 250/month for free, so use sparingly when testing!!!\n // zipCaller(zip); // avoiding zipCaller for now to not max out API calls!!\n backTracker(\"42101\");\n }", "title": "" }, { "docid": "e986c43a351a886d7f7097edbca00243", "score": "0.5591803", "text": "function getWeather(city)\n {\n var lat = city.lat.toFixed(3);\n var lng = city.lng.toFixed(3);\n var api = 'http://api.openweathermap.org/data/2.5/weather?lat='+lat+'&lon='+lng+'&appid=2de143494c0b295cca9337e1e96b00e0';\n\n $.ajax({\n url: api\n })\n .done(function( data ) {\n\n city.temp = ((data['main']['temp'] - 273.15)* 1.8000 + 32.00).toFixed(1);\n city.pressure = data['main']['pressure'];\n city.humidity = data['main']['humidity'];\n city.weatherDes = data['weather'][0]['description'];\n city.weatherIco = data['weather'][0]['icon'];\n if(city.name == '' || city.name === undefined)\n {\n city.name = data['name'];\n }\n if(city == city2)\n {\n last = true;\n }\n if(last === true)\n {\n buildCities();\n buildAverage();\n startCity.innerText = \"Start: \" + city1.name;\n endCity.innerText = \"End: \" +city2.name;\n initMap();\n mapPane.style.display = 'block';\n }\n });\n }", "title": "" }, { "docid": "1c34909879daa9340fde329fcb2dd9d7", "score": "0.55871", "text": "function getForecast(zipcode) {\n\n console.log(WEATHER_API_URL + '?q=' + zipcode + '&satellites&raw');\n try {\n request.get(WEATHER_API_URL + '?q=' + zipcode + '&satellites&raw',\n function(error, response, body) {\n\n if (!error && response.statusCode == 200) {\n console.log(body);\n } else {\n printError({ message : error });\n }\n }\n );\n\n } catch (e) {\n printError({ message : \"Cannot get the request.\"});\n\n }\n\n}", "title": "" }, { "docid": "3607e5369d8a0d6d6251312f2efa689c", "score": "0.558639", "text": "function InitInfo() {\n var url = commonServices.getUrl(\"UnionService.ashx\", \"GetOpenSuggestDetail\");\n var paras = {\n suggID: suggID\n };\n commonServices.submit(paras, url).then(function (resp) {\n if (resp) {\n if (resp.success) {\n $scope.item = resp.obj;\n }\n }\n });\n }", "title": "" }, { "docid": "df2bdd1f9bf65f71bd4ba48ce4a3e20f", "score": "0.5582616", "text": "function geocodeStart(city) {\n cityName = city;\n var geocodeUrl = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + cityName.replace(\" \", \"+\") + \"&key=\" + googleApiKey;\n $.ajax({\n url: geocodeUrl,\n dataType: 'json',\n success: function (data) {\n coordinates[0] = (data.results[0].geometry.location.lat);\n coordinates[1] = (data.results[0].geometry.location.lng);\n startListsAndTransition(); //Once completed, Start list compilation\n }\n });\n}", "title": "" }, { "docid": "988f1e72942072d093abf416b0c7f92f", "score": "0.5562323", "text": "function changePostal(apiUrl, apiKey, searchParam) {\n fetch(\n `https://app.zipcodebase.com/api/v1/search?apikey=625df870-6187-11eb-a3e5-53ae15918210&codes=${searchParam.value}`\n )\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n console.log(data);\n const cityFromPostal = data.results[searchParam.value][0].city;\n cityName.innerHTML = `<span class=\"cityOnly\">${cityFromPostal}</span>, ${today}`;\n fetch(apiUrl + cityFromPostal + apiKey)\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n console.log(data);\n temp.innerHTML = `${Math.round(data.main.temp)} °C`;\n humidity.innerHTML = `${Math.round(data.main.humidity)} %`;\n pressure.innerHTML = `${Math.round(data.main.pressure)} hPa`;\n const coordLon = data.coord.lon;\n const coordLat = data.coord.lat;\n // console.log(coordLon + \" ///\" + coordLat);\n fetch(\n `https://api.openweathermap.org/data/2.5/air_pollution?lat=${coordLat}&lon=${coordLon}&appid=f2799a9007994daa45c68492bae50498`\n )\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n console.log(data);\n smog.innerHTML = `${Math.round(\n data.list[0].components.pm2_5\n )} µg/m³`;\n });\n });\n });\n}", "title": "" }, { "docid": "702f45b51cb9ebac31c8aac671c3b6ca", "score": "0.55598253", "text": "function x() {\n fromCity = response.results[0].address_components[0].long_name;\n console.log('FromCity ' + fromCity);\n\n // testing the conditions in the API response, because depending on countries, the country information maybe placed in different orders\n if (response.results[0].address_components[3]) {\n if (response.results[0].address_components[3].long_name) {\n fromCountry = response.results[0].address_components[3].long_name;\n console.log('fromCountry ' + fromCountry);\n } else if (response.results[0].address_components[2]) {\n if (response.results[0].address_components[2].long_name) {\n fromCountry = response.results[0].address_components[2].long_name;\n console.log('fromCountry ' + fromCountry);\n } else if (response.results[0].address_components[1]) {\n fromCountry = response.results[0].address_components[1].long_name;\n console.log('toCountry ' + toCountry);\n }\n }\n\n } else if (response.results[0].address_components[2]) {\n if (response.results[0].address_components[2].long_name) {\n fromCountry = response.results[0].address_components[2].long_name;\n console.log('fromCountry ' + fromCountry);\n } else if (response.results[0].address_components[1]) {\n fromCountry = response.results[0].address_components[1].long_name;\n console.log('toCountry ' + toCountry);\n }\n } else if (response.results[0].address_components[1]) {\n fromCountry = response.results[0].address_components[1].long_name;\n console.log('toCountry ' + toCountry);\n }\n }", "title": "" }, { "docid": "62364425d7c8e52a02670f290be5558f", "score": "0.55358195", "text": "getStations() {\n\t\tajaxGet(`https://api.jcdecaux.com/vls/v1/stations?contract=${this.city}&apiKey=${this.key}`, (response) => {\n\t\t\tlet stations = JSON.parse(response);\n\t\t\tstations.forEach((station) => {\n\t\t\t\tthis.setMarker(station);\n\t\t\t});\n\t\t\tthis.mymap.addLayer(this.markersCluster);\n\t\t});\n\t}", "title": "" }, { "docid": "35a976898237cb9e512f3b33a9dc9330", "score": "0.55245924", "text": "function getLatLong(zip){\n fetch (\"https://maps.googleapis.com/maps/api/geocode/json?address=\"+zip+\"&key=AIzaSyAqHEFAOikP1X73U_trS-aQvjiqcXKWSHs\")\n .then(response=>response.json())\n .then(responseJson=>getResults(responseJson))\n}", "title": "" }, { "docid": "9c3babce24db28a4224c5cea1a55105e", "score": "0.5509932", "text": "async function getDestinfo(cityName){\n\tconst geonamesKey = process.env.GEONAMES_KEY;\n\n\tlet url = `http://api.geonames.org/searchJSON?q=${cityName}&maxRows=1&username=${geonamesKey}`;\n\tlet response = await fetch(url);\n\tlet data = await response.json();\n\t//handle 404 & 500 response\n\tif(!response.ok){\n\t\tthrow new Error('Something went wrong');\n\t};\n\n\t//if to handle no match found for the city entry\n\tif(data.totalResultsCount === 0){\n\t\tthrow new Error('City not found');\n\t} else {\n\t\treturn [data.geonames[0].lat , data.geonames[0].lng, data.geonames[0].toponymName, data.geonames[0].countryName];\n\t};\n}", "title": "" }, { "docid": "77096576750dda90ba1f66a77ae2ab62", "score": "0.55026615", "text": "function initDoc() {\n retrievePreviouslySearchedList();\n inputCity = retrieveLastCitySearched();\n if (inputCity != null) {\n retrieveWeather(false);\n }\n }", "title": "" }, { "docid": "78098b20c0f60099ce4c6dba3ad41113", "score": "0.54971457", "text": "function countryapicall(x) {\n\n var ajaxurl = query.country.url + x.toLowerCase();\n\n\n $.ajax({\n url: ajaxurl,\n method: \"GET\"\n }) .then (function (result){\n\n var data = result\n\n console.log(\"country\", data)\n\n //function to show data in html\n htmlpushercountryinfo(data)\n\n //pass city name for weather api\n weatherapicall(data[0].capital)\n\n })\n\n}", "title": "" }, { "docid": "94ba4eceb36ff0421961c7cb93b88209", "score": "0.5476745", "text": "function getLocationInfo() {\n let miles = getRadiusInput();\n let city = getCity();\n let cat = getCatigory();\n $(\".search-location\").html(`<h3>${cat} trails found within <span class=\"location-name\">${miles} miles of ${city}</span></h3>`);\n callGeoCode(city, miles);\n}", "title": "" }, { "docid": "7febf54b279be0de6fbee8c3514ffaf0", "score": "0.54722524", "text": "function iceCreamSuggest()\n{\n var localURL = \"http://ip-api.com/json/\";\n $.ajax({\n url: localURL,\n method: \"GET\"\n }).then(function(response)\n {\n callMap(\"ice cream\", response.city);\n })\n}", "title": "" }, { "docid": "1d76dc1f0c8e91651b62111b69141d45", "score": "0.54673445", "text": "async getCity() {\n const response = await fetch(`https://dataservice.accuweather.com/locations/v1/cities/search?apikey=${this.apiKey}&q=${this.city}`);\n\n const responseData = await response.json();\n const full = responseData[0];\n const id = responseData[0].Key;\n const city = responseData[0].EnglishName;\n const country = responseData[0].Country.EnglishName;\n const code = responseData[0].Country.ID;\n\n return {\n full,\n id, \n city, \n country,\n code\n }\n }", "title": "" }, { "docid": "1a7b3eea5a384faa8fa9cf9ea77a2fb9", "score": "0.54641545", "text": "function computeCity(lati, long){\n fetch(`https://api.opencagedata.com/geocode/v1/json?q=${lati}+${long}&key=7d0266b0bdde4185b5fb4a9bbf45de2a`)\n .then(res => res.json())\n .then((location) => {\n getWeatherDetails(location.results[0].components.state_district)\n })\n .catch(() => {\n alert('Error reported from server, maybe try later?')\n })\n}", "title": "" }, { "docid": "18c9a660456bdf7b7a4a74d79a84e35a", "score": "0.5461078", "text": "function retreiveWeather(city) {\n\n //places city and API key into API address\n var currentURL = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apikey}`;\n\n //runs a fetch request to get initial data\n fetch(currentURL)\n .then((data) => data.json())\n .then(function (weather) {\n\n //if the city cannot be found, use alert to get user to re enter city\n if (weather.cod === \"404\") {\n alert(\"City not found\");\n };\n\n //pull latitude and longitude from data for more accurate information\n var lat = weather.coord.lat;\n var lon = weather.coord.lon;\n\n //using the coordinates into One Call API \n var onecallURL = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&units=imperial&appid=${apikey}`;\n\n //runs a fetch request to get the One Call API Data\n fetch(onecallURL)\n .then((data) => data.json())\n .then(function (oneCallData) {\n console.log(oneCallData)\n\n //compile One Call API Data into single variable for the current conditions\n var report = oneCallData.current\n\n //turn on DIV that will display current information\n $(reportEl).show();\n\n //Clears any old data in the city name line\n cityEl.innerHTML = \" \";\n //Adds the city we searched for to the city name line\n cityEl.append(city);\n //Adds today's date to the date line\n dayEl.textContent = today;\n\n //variable takes the temperature from the report with syntax wanted on the page \n var temperature = `Temperature: ${report.temp} °F`;\n\n tempEl.textContent = temperature;\n\n //variable takes the humidity from the report with syntax wanted on the page\n var humidity = `Humidity: ${report.humidity} %`;\n //write the information to the page\n humidityEl.textContent = humidity;\n\n //variable takes the wind speed from the report with syntax wanted on the page \n var wind = `Wind Speed: ${report.wind_speed} MPH`;\n //write the information to the page\n windEl.textContent = wind;\n\n //variable takes the UV Index from the report \n var uvindex = `${report.uvi}`;\n //write the information to the page\n uvEl.textContent = uvindex;\n\n //uses a logic function to check the UVI index score to the chart to determine it's strength\n if (report.uvi <= 2) {\n uvEl.classList.add('low');\n } else if (report.uvi > 2 && report.uvi < 6) {\n uvEl.addClass(\"mid\")\n } else if (report.uvi > 5 && report.uvi < 8) {\n uvEl.addClass(\"high\")\n } else if (report.uvi > 7 && report.uvi < 11) {\n uvEl.addClass(\"vhigh\")\n } else {\n uvEl.addClass(\"extreme\")\n };\n\n //pulls data from One Call API report for the daily predictions\n var forcastData = oneCallData.daily;\n //removes the one at the beginning of the array, as it will be equal to our current information \n forcastData.shift();\n //removes the last 2 from the array to have 5 items left\n forcastData.pop();\n forcastData.pop();\n\n console.log(forcastData);\n console.log(forcastData[0].clouds);\n // //convert the UNIX timestamp into MM/DD/YYYY\n // var forcastDt = forcastData[].dt\n // console.log(forcastDt);\n\n // create the 5 forcast cards from each item in the forcastData array\n\n for (let i = 0; i < forcastData.length; i++) {\n var forcastCard = $(`\n <div class=\"card\">\n <h1>Date<h1>\n <p>Temp: ${forcastData[i].temp.max}°F </p>\n <p>Humidity: ${forcastData[i].humidity}%</p>\n </div >\n `)\n\n forcastEl.append(forcastCard);\n }\n\n })\n })\n}", "title": "" }, { "docid": "3dca662bf624c1ef4da67da1bc78b0f5", "score": "0.54474366", "text": "async function initMap(){\n\tvar options = {\n\t\tzoom: 8,\n\t\tcenter: await getUserCityCoord()\n\t}\n\tvar map = new google.maps.Map(document.getElementById('map'), options);\n\tlet coordsList = [];\n\tlet cityNames = await getCityName()\n\t\t\n\t// iterate all cities, and get coords by city name\n\tfor (var city of cityNames){\n\t\tawait fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&units=imperial&appid=${weatherAPI}`)\n\n\t\t.then(response => response.json())\n\t\t.then(data => {\n\t\t\tcoordsList.push({lat: data.coord.lat, lng: data.coord.lon})\n\t\t})\n\t}\n\t\n\t// invoke addMarker()\n\taddMarker(coordsList)\n\t\n\t// itereate coords and add markers based on specific coord\n\tfunction addMarker(coords){\n\t\tfor (let i = 0; i < coords.length; i++){\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: coords[i],\n\t\t\t\tmap: map,\n\t\t\t //icon: \"https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png\"\n\t\t\t})\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a8699797d32ef3ad2c319dbda9a1340d", "score": "0.54338056", "text": "async function get_ipma_data(city){\n\n //Get city ids\n var city_ids = new Map()\n const districts = await axios.get('http://api.ipma.pt/open-data/distrits-islands.json')\n districts.data.data.forEach(e => {\n city_ids.set(e.idAreaAviso, e.globalIdLocal)\n })\n\n //Get city data\n var tmp = {}\n var globalIdLocal = city_ids.get(city_codes[city])\n var city_info = await axios.get('http://api.ipma.pt/open-data/forecast/meteorology/cities/daily/' + globalIdLocal + '.json')\n tmp['Temperature'] = ((parseFloat(city_info.data.data[0].tMin) + parseFloat(city_info.data.data[0].tMax))/2).toFixed(2)\n tmp['PrecipProbability'] = parseFloat(city_info.data.data[0].precipitaProb)\n location = {'lat': parseFloat(city_info.data.data[0].latitude),\n 'long': parseFloat(city_info.data.data[0].longitude)}\n\n return [tmp,location]\n}", "title": "" }, { "docid": "65f866108fbae2f2ccf94a9ce8616694", "score": "0.543356", "text": "function detailedInfo(final,callback){\n\t//Initiating a counter.\n var count = 0;\n\tfor (i=0;i<final.length;i++){\n ++count; \n\t\tvar placeId = final[i].place_id;\n\t\t//Google API address.\n\t\tvar durl = \"https://maps.googleapis.com/maps/api/place/details/json?placeid=\" + placeId + \"&key=\" + mykey;\n function back (durl,i){\n\t\thttps.get(durl,function(response) {\n\t\t\tvar body =\"\";\n\t\t\tresponse.on('data', function(chunk) {\n\t\t\t\tbody += chunk;\n\t\t\t})\n\t\t\tresponse.on('end', function () {\n\t\t\t\tplaces = JSON.parse(body);\n\t\t\t\tvar results = places.result;\n\t\t\t\tfinal[i].address = results.formatted_address;\n\t\t\t\tfinal[i].numbers = results.formatted_phone_number;\n\t\t\t\tfinal[i].website = results.website;\n\t\t\t\tfinal[i].url = results.url;\n\t\t\t\tfinal[i].photos = results.photos;\n --count;\n if (count === 0){\n callback(null,final);\n };\t\n\t\t\t})\n\t\t})}\n back(durl,i);\n\t} \n}", "title": "" }, { "docid": "751e5a54f9f1fdb31a8c27c71a0195f4", "score": "0.5431296", "text": "async function getSeekerData(city){\n\n try {\n const res2 = await fetch('/api/v1/seeker'+'?city='+city)\n window.sdata = await res2.json();\n if (res2.status === 200) {\n console.log(\"Got Map data\"+sdata)\n $('#Searchtype').show();\n // Create markers.\n var count = 0;\n window.refdata = new Array(sdata.length);\n $('#loader').hide();\n console.log(sdata)\n return sdata;\n }\n if (res2.status === 403) {\n $('#loader').hide();\n showError('No Help Seekers registered in this District yet, be the first one to do it.');\n return;\n\n }\n if (res2.status === 400) {\n $('#loader').hide();\n showError('Database Error');\n return;\n }\n if (res2.status === 500) {\n $('#loader').hide();\n showError('Server Error!');\n return;\n }\n } catch (err) {\n $('#loader').hide();\n showError(err);\n return;\n }\n\n}", "title": "" }, { "docid": "99a27c4b4bdc1e29549cfbb0943a34a0", "score": "0.5429162", "text": "function main(){\n preferredRace(race)\n zipCodes.forEach(zip =>{\n getLatLong() \n })\n}", "title": "" }, { "docid": "7706ad1da36a92e26e41769a76653b10", "score": "0.5422452", "text": "function fillInfo(data) {\r\n let loc = data['location'];\r\n ipAddress.textContent = `${data['ip']}`;\r\n ipLocation.textContent = `${loc['region']}, ${loc['country']} ${loc['postalCode'] !== '' ? loc['postalCode']: ''}`;\r\n ipTimezone.textContent = `UTC ${loc['timezone']}`;\r\n isp.textContent = `${data['isp']}`;\r\n}", "title": "" }, { "docid": "5fc16597093d73511f91fec8031e1ce5", "score": "0.5420135", "text": "function displayLocationInfo(city){\n\tel(\"popupTitle\").innerHTML =city.properties.NAME;\n\n\tvar annotations = el(\"annotation-container\");\n\tannotations.innerHTML = null; // clear previous annotations\n\n\t//remove and add new annotation input\n\tvar annotationInputCont = el(\"annotation-input-container\");\n\tannotationInputCont.innerHTML = null;\n\tif (currentUser !== null){\n\t\tmakeAnnotationInput(annotationInputCont);\n\t}\n\n\tgetAnnotationFromLocalServer(city);\n}", "title": "" }, { "docid": "06a332eae5c7d2731c3d610e77b00182", "score": "0.5420007", "text": "function getGeoNames({ city, countryCode, travelDate, countdown }) {\n projectData = {};\n const baseUrlAPI = 'http://api.geonames.org/searchJSON?';\n const cityName = encodeURIComponent(city);\n const maxRows = 10;\n const username = process.env.USERNAME;\n const completeUrlAPI = `${baseUrlAPI}q=${cityName}&country=${countryCode}&maxRows=${maxRows}&username=${username}`;\n // Call generic function to get data from Geonames API\n return (\n makeRequest(completeUrlAPI)\n // Parse data from GeoNames API. Object descontruction is used here to access geonames property\n .then(({ geonames, totalResultsCount }) => {\n if (totalResultsCount === 0) {\n throw new Error('City not found.');\n }\n\n const [{ lat, lng, name, adminName1, countryName }] = geonames; // Array and object descontruction\n\n // Save received data in server endpoint\n projectData = {\n latitude: lat,\n longitude: lng,\n city: name,\n state: adminName1,\n country: countryName,\n travelDate,\n countdown,\n };\n })\n );\n}", "title": "" }, { "docid": "c0baf4ced76ce51a2315d8a76c98ec1c", "score": "0.54176605", "text": "function getStationLocations(callback) {\n ajaxGet('https://api.jcdecaux.com/vls/v1/stations?contract=Lyon&apiKey=' + APIKey, function (response) {\n mapObj.array = JSON.parse(response);\n callback();\n });\n\n}", "title": "" }, { "docid": "9374d23679f6920a9ebd979324e46193", "score": "0.54157996", "text": "function getWeatherDetails(city) {\n fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&apikey=946c870db6ca82b017d54a8aa62c349a`)\n .then(weatherObj => weatherObj.json())\n .then((weatherData) => {\n printData(weatherData.name, weatherData.main.temp, weatherData.main.feels_like, weatherData.weather[0].main, weatherData.main.humidity, weatherData.main.temp_min, weatherData.main.temp_max, weatherData.sys.sunrise, weatherData.sys.sunset)\n })\n .catch((err) => {\n alert('Server error:', err)\n })\n}", "title": "" }, { "docid": "523909ad8a2d68b5644ef5f4617758ed", "score": "0.5410907", "text": "function getInatData() {\n let taxonName = LOCAL_JSON.plants[USER_INFO.choice].scientificName;\n let lat = USER_INFO.geo.lat;\n let lng = USER_INFO.geo.lng;\n const query = {\n taxon_name: taxonName,\n lat: lat,\n lng: lng,\n radius: \"100\",\n mappable: true,\n geo: true,\n };\n $.getJSON(iNAT_SEARCH_URL, query, setMarkers);\n}", "title": "" }, { "docid": "e5f6efa52a5730361854608327c3f16f", "score": "0.54104125", "text": "function getData(lat, lon) {\n let today = new Date();\n let date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();\n \n\t\tlet url = \"https://api.sunrise-sunset.org/json?lat=\"+lat+\"&lng=\"+lon+\n\t\t\"&date=\"+date+\"&formatted=0\";\n\n fetch(url)\n .then(checkStatus)\n .then(function(responseText) {\n let json = JSON.parse(responseText);\n let sunset = json[\"results\"][\"sunset\"];\n let sunsetDate = new Date(sunset);\n populateInfo(sunsetDate);\n });\n }", "title": "" }, { "docid": "a26b0b05bb134ab6fd6d9f4cb3c1a096", "score": "0.5409978", "text": "function get_city_data(str) \n\t{\n\t\t//GENERATE REQUEST\n\t\tconsole.log('search: ' + str);\n\t\tvar substring_match = document.getElementById('substring_match_checkbox').checked;\n\t\tvar request = \"http://127.0.0.1:5000/\" + ((substring_match)? (\"cities?like=\"+str) : (\"cities/\"+str));\n\t\tconsole.log(request);\n\t\t\n\t\t//SEND REQUEST\n\t\t$.getJSON(request, function(data)\n\t\t{\n\t\t\t//TEMP VARS\n\t\t\tvar city = \"\";\n\t\t\tvar state = \"\";\n\t\t\tvar country = \"\";\n\t\t\tvar alt_names = \"\";\n\t\t\tvar lat = \"\";\n\t\t\tvar lon = \"\";\n\t\t\tvar target = \"\";\n\t\t\tvar content = \"\";\n\t\t\tvar result = \"\";\n\t\t\tcity_location = [];\n\t\t\t\n\t\t\t//RETRIEVE DATA FOR EACH CITY AND GENERATE RESULTS\n\t\t\tfor(var i=0; i<data[\"cities\"].length && i<25; i++)\n\t\t\t{\n\t\t\t\t//GET CITY DATA\n\t\t\t\tcity = data[\"cities\"][i].city;\n\t\t\t\tstate = data[\"cities\"][i].state;\n\t\t\t\tcountry = data[\"cities\"][i].country;\n\t\t\t\tlat = data[\"cities\"][i].latitude;\n\t\t\t\tlon = data[\"cities\"][i].longitude;\n\t\t\t\talt_names = data[\"cities\"][i][\"alternate_names\"];\n\t\t\t\tcity_location.push([lat,lon]);\n\t\t\t\t\n\t\t\t\t//CHECK IF THERE IS MORE THAN 1 ALT NAME AND GENERATE A COLLAPSIBLE LIST TO DISPLAY THEM\n\t\t\t\tif(alt_names.length>1)\n\t\t\t\t{\n\t\t\t\t\tcontent = \"\";\n\t\t\t\t\tfor(var j=0; j<alt_names.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent += alt_names[j]+\"<br>\";\n\t\t\t\t\t}\n\t\t\t\t\ttarget = \"altn\"+i;\n\t\t\t\t\talt_names = \"<button class=\\\"btn btn-primary btn-outline-dark btn-sm\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#\"+target+\"\\\" aria-expanded=\\\"false\\\" aria-controls=\\\"\"+target+\"\\\">\";\n\t\t\t\t\talt_names += \"List</button><div class=\\\"collapse\\\" id=\\\"\"+target+\"\\\"><div class=\\\"card card-body\\\">\"+content+\"</div></div>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//GENERATE RESULT CONTENT\n\t\t\t\tcontent = \"<b>City:</b>\"+city+\"<br>\";\n\t\t\t\tcontent += \"<b>State:</b>\"+state+\"<br>\";\n\t\t\t\tcontent += \"<b>Country:</b>\"+country+\"<br>\";\n\t\t\t\tcontent += \"<b>Alternative Names:</b>\"+alt_names+\"<br>\";\n\t\t\t\tcontent += \"<b>Latitude:</b>\"+lat+\"<br>\";\n\t\t\t\tcontent += \"<b>Longitude:</b>\"+lon+\"<br>\";\n\t\t\t\t\n\t\t\t\t//GENERATE RESULT\n\t\t\t\ttarget = \"city\"+i;\n\t\t\t\tresult += \"<button class=\\\"btn btn-primary btn-block btn-outline-info mapview\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#\"+target+\"\\\" aria-expanded=\\\"false\\\" aria-controls=\\\"\";\n\t\t\t\tresult += target+\"\\\" id=\\\"\"+i+\"\\\">\"+city+\"</button><div class=\\\"collapse\\\" id=\\\"\"+target+\"\\\"><div class=\\\"card card-body\\\">\"+content+\"</div></div>\";\n\t\t\t}\n\t\t\t\n\t\t\t//UPDATE HTML TO DISPLAY RESULTS\n\t\t\tdocument.getElementById('results').innerHTML = result;\n\t\t});\n\t}", "title": "" }, { "docid": "d1bac26043acecc86078a218957de1d0", "score": "0.5407872", "text": "async function newsSearch(city_name) {\n let url = `https://api.openweathermap.org/data/2.5/weather?q=${city_name}&appid=${apiKey}&units=metric`;\n const resp = await fetch(url);\n const info = await resp.json();\n return info;\n }", "title": "" }, { "docid": "04fbfcc5aa6186582498512b87051a20", "score": "0.5394876", "text": "apiCall() {\n\t\tlet pageUrl = this.state.url\n\t\tlet city = pageUrl.split(\"city=\")\n\t\tcity = city[1].substring(0, city[1].length)\n\n\t\tvar url = WEATHERAPI + city + WEATHERAPIKEY;\n\n\t\tfetch(url)\n\t\t.then(response =>\n\t\t{\n\t\t\tif ( response.status >= 200 && response.status <299) {\n\t\t\t\treturn response.json();\n\t\t\t} else {\n\t\t\t\tthrow Error(response.statusText);\n\t\t\t}\n\n\t\t}).then(data => {\n\t\t\tthis.determineIndex(data, city)\n\t\t}).catch((error) => {\n\t\t\tconsole.log(error);\n\t\t});\n\n\t}", "title": "" }, { "docid": "071d57043895225a9b5a63c2f65aa28d", "score": "0.5392287", "text": "getPopulation(location='us', year='2015') {\n console.log(`Census:getPopulation():location=${location}, year=${year}`);\n\n // get population data service config\n const popService = this.services.get('population');\n //console.log('Census.getPopulation(): service config:\\n', JSON.stringify(popService));\n\n // get valid region info\n let region = this.locationService.getRegion(location);\n if ( region === null) {\n // defualt to USA\n region = new Region('1', 'USA');\n }\n\n // create for and in query params\n let forQueryParam = region.code;\n let inQueryParam = '';\n if (region.type === 'county' || region.type === 'place') {\n // qualify county query with state code param\n let state = this.locationService.getRegion(region.state.toLowerCase());\n inQueryParam = `&in=state:${state.code}`;\n if (region.type === 'county') {\n // strip out county state code for census county ds query\n forQueryParam = String(region.code).substring(2);\n }\n }\n console.log(`Census:getPopulation():query: for=${region.type}:${forQueryParam}${inQueryParam}`);\n\n // get region pop data\n return fetch(`${popService.host}/${year}/${popService.url}` +\n `?get=${popService.get}&for=${region.type}:${forQueryParam}${inQueryParam}` +\n `&key=${this.config.CENSUS_DATA_API_KEY}`, {\n method: 'GET',\n headers: {'Content-Type': 'application/json'},\n })\n .then(response => response.json())\n .then(jsonResponse => {\n console.log(`Census.getPopulation(): response:${JSON.stringify(jsonResponse)}`);\n // extract population data\n const popData = jsonResponse[1]; // skip header data row\n return { \n population: popData[0],\n density: popData[1],\n location: region.toString()};\n });\n }", "title": "" }, { "docid": "050b541a85109560e36b49d2f2658dd2", "score": "0.5384786", "text": "function initMap(parameters) {\n $.ajax({\n url: \"https://hotline.whalemuseum.org/api.json?\" + parameters + \"&limit=1000\",\n method: \"GET\",\n }).then(function(response) {\n totalWhales = response;\n \n }).then(function() {\n initialMap = new google.maps.Map(document.getElementById('map'), {\n zoom: 6,\n center: new google.maps.LatLng(48.5159,-123.1524),\n mapTypeId: 'terrain'\n });\n for (var i = 0; i < totalWhales.length; i++) {\n var speciesType = totalWhales[i].species;\n infoBox = \"<img class=pictureSize src='\" + imgURL[speciesType] + \"'><br>\";\n infoBox += \"Species: \" + totalWhales[i].species + \"<br>\";\n infoBox += \"Quantity: \" + totalWhales[i].quantity + \"<br>\";\n infoBox += \"Location: \" + totalWhales[i].location + \"<br>\";\n infoBox += \"Sigthed at: \" + totalWhales[i].sighted_at;\n coords[0] = totalWhales[i].latitude;\n coords[1] = totalWhales[i].longitude;\n var latLng = new google.maps.LatLng(coords[0],coords[1]);\n var marker = new google.maps.Marker({position: latLng, map: initialMap});\n attachInfo(marker, infoBox);\n }\n });\n }", "title": "" }, { "docid": "af0e3945c96f982ee588bad7b0c76518", "score": "0.53830755", "text": "function getCity(coords) {\n const request = new XMLHttpRequest();\n const method = \"GET\";\n const url =\n \"https://us1.locationiq.com/v1/reverse.php?key=23934d134759e2&lat=\" +\n coords.latitude +\n \"&lon=\" +\n coords.longitude +\n \"&format=json&zoom=10&normalizecity=1\";\n const async = true;\n\n request.open(method, url, async);\n request.onreadystatechange = () => {\n if (request.readyState === 4 && request.status === 200) {\n const data = JSON.parse(request.responseText);\n setCity(data.address.county);\n }\n };\n request.send();\n }", "title": "" }, { "docid": "8067974ed7f27d2e2f7ddfa365238653", "score": "0.53813654", "text": "async function fetchCity(city) {\n\n const res = await fetch(`https://geocode.xyz/${city}?json=1`);\n const data = await res.json();\n console.log(`Place Name: ${city} Longiture: ${data.longt} Latitude: ${data.latt}`);\n\n}", "title": "" }, { "docid": "a4512150f1a0b70841604c991f1e784f", "score": "0.53805804", "text": "function initMap(city) {\n geolocateURL = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + city + \"&key=AIzaSyBepTaWB2S-ZswMELWF7HxBIvUDpXCAG9o\"\n\n // AJAX call for geolocate\n $.ajax({\n url: geolocateURL,\n method: \"GET\",\n error: function (xhr, status, error) {\n var errorMessage = xhr.status + ': ' + xhr.statusText\n alert('Error - ' + errorMessage);\n },\n success: function (response) {\n //setting the variables for longitude and latitude to plug in to line 25 to center:\n var latOne = parseFloat(response.results[0].geometry.location.lat)\n var lonOne = parseFloat(response.results[0].geometry.location.lng)\n\n // changes map center to searched city, runs functions for restaurants and hotels:\n map.setCenter({ lat: latOne, lng: lonOne })\n addRestaurants(latOne, lonOne);\n addHotels(latOne, lonOne);\n }\n });\n}", "title": "" }, { "docid": "461aa2a8f3a5f3a1c299a7c2998ea4bc", "score": "0.5377482", "text": "function getOneCall(){\n let data = JSON.parse(localStorage.getItem(`${underscorify(city)}`));\n fetch(oneCallURL+`lat=${data.coord.lat}&lon=${data.coord.lon}&units=imperial&appid=${APIKey}`)\n .then(response => response.json())\n .then(data => {\n UV.text(`${data.current.uvi}`);\n uviColor(data);\n fiveDay(data);\n })}", "title": "" }, { "docid": "5bd6cbd2e465cbec05d638d2bcb9e55e", "score": "0.53645086", "text": "function getWeatherByCity(cityToSearch) {\n // let city = \"seattle\" //test line\n //first call is to grab lat&lon\n let cityQueryURL = `https://api.openweathermap.org/data/2.5/weather?q=${cityToSearch}&appid=${API_KEY}`\n\n //API\n $.ajax({\n url: cityQueryURL,\n method: \"GET\"\n }).then(function(cityLatLonRes) {\n //log the response\n console.log(cityLatLonRes);\n //set lat/lon for detailed api call\n let lat = cityLatLonRes.coord.lat;\n let lon = cityLatLonRes.coord.lon;\n //second call is to get all weather data needed for application\n let weatherQueryURL = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude=minutely,hourly&appid=${API_KEY}`\n $.ajax({\n url: weatherQueryURL,\n method: \"GET\"\n }).then(function(weatherRes) {\n //log response\n console.log(weatherRes);\n //this is where i will fill vars from response\n let ccTemp = kelvTF(weatherRes.current.temp);\n let ccHumid = (weatherRes.current.humidity) + \"%\";\n let ccWindSpeed = weatherRes.current.wind_speed;\n let ccUVIndex = weatherRes.current.uvi;\n\n console.log(`Temp: ${ccTemp}, Humidity: ${ccHumid}, Wind Speed: ${ccWindSpeed}, UV Index: ${ccUVIndex}`);\n \n $(\"#ccHeader\").text(cityToSearch);\n $(\"#ccTemp\").text(`Temp: ${ccTemp}`);\n $(\"#ccHumid\").text(`Humidity: ${ccHumid}`);\n $(\"#ccWindSpeed\").text(`Wind Speed: ${ccWindSpeed} MPH`);\n $(\"#ccUVIndex\").text(`UV Index: ${ccUVIndex}`);\n\n //UV Index Color function\n //colors and ranges from https://www.epa.gov/sunsafety/uv-index-scale-0\n function uvColor() {\n if (ccUVIndex >= 11) {\n $(\"#ccUVIndex\").css({\"backgroundColor\": \"hsl(303, 100%, 18%)\", \"color\":\"white\"});\n } else if (ccUVIndex < 11 && ccUVIndex > 7) {\n $(\"#ccUVIndex\").css({\"backgroundColor\": \"darkred\", \"color\":\"white\"});\n } else if (ccUVIndex < 8 && ccUVIndex >= 6) {\n $(\"#ccUVIndex\").css({\"backgroundColor\": \"darkorange\"});\n } else if (ccUVIndex < 6 && ccUVIndex >= 3) {\n $(\"#ccUVIndex\").css({\"backgroundColor\": \"yellow\"});\n } else\n $(\"#ccUVIndex\").css({\"backgroundColor\": \"green\", \"color\":\"white\"});\n }\n uvColor();\n\n //5day loop start\n let fiveDayForcast = weatherRes.daily;\n\n for(let i = 1; i <= 5; i++) {\n $(`#day${i}date`).text(moment().add(i, \"days\").format(\"MM/DD/YY\"));\n $(`#day${i}icon`).attr(\"src\", `https://openweathermap.org/img/w/${fiveDayForcast[i].weather[0].icon}.png`);\n $(`#day${i}temp`).text(kelvTF(fiveDayForcast[i].temp.day));\n $(`#day${i}humid`).text(`Humidity: ${fiveDayForcast[i].humidity}%`);\n }\n\n }).catch((error) => console.log(\"Second API call error: \", error))\n \n }).catch((error) => console.log(\"First API call error: \", error))\n}", "title": "" }, { "docid": "956bdd42e3a349c5ac152b0d1ccc6450", "score": "0.53581876", "text": "function getData_City(coordinates){\n // console.log(coordinates[0]);\n // console.log(coordinates[1]);\n var apiUrl = 'https://developers.zomato.com/api/v2.1/cities?lat=' +coordinates[0] +'&lon=' +coordinates[1];\n // make a request to the url\n\n fetch(apiUrl, {method: \"GET\", \n headers: {\n \"user-key\": zomato_api_key\n }})\n .then(function(response){\n //console.log(response);\n return response.json();\n })\n .then(function(data){\n //console.log(data.location_suggestions[0].name);\n cityName = data.location_suggestions[0].name;\n cityNameEl.setAttribute(\"placeholder\", cityName);\n cityId = data.location_suggestions[0].id;\n });\n }", "title": "" }, { "docid": "bf2302cd038311bc92f87efa6ef80684", "score": "0.53549975", "text": "function getLocationInfo() {\n\n // we define the local variables\n var country;\n var city;\n\n // JSONP ipinfo request\n $.get(\"https://ipinfo.io\", function(response) {\n\n // asigns the info to variables\n country = response.country;\n city = response.city;\n position = response.loc;\n\n // set the info in the html\n $(\"#location\").html(country + ', ' + city);\n getCurrentWeather();\n\n }, \"jsonp\");\n\n }", "title": "" }, { "docid": "76a1ba6acf97c75c6ab4f5d208df58f0", "score": "0.5348247", "text": "function initStatusMap() {\n /**********LOADING ALL STATIONS *********/\n $.getJSON(apiAddress) //Request list of all station\n .done(function(data) {\n stations = [];\n $.each(data, function (i, item) {\n stations.push([item.address, item.lat, item.lng, 1, item.optimal_criterion, 'pick_and_drop', item.available_bikes, item.available_bike_stands, item.bike_stands]); //Extract meaningful information\n });\n setMarkers(stations);//Draw Stations on map\n });\n}", "title": "" }, { "docid": "208a772bb4e7668a0aea783310781486", "score": "0.53401804", "text": "function getWeather(city, state, lat, long, county) {\n\n\n fetch(`https://api.meteostat.net/v2/stations/nearby?lat=${lat}&lon=${long}`, {\n headers: {\n \"X-Api-Key\": \"Ctr6uwisQ6EUppc1JyoKg9iw2F7mDtgu\"\n }\n })\n .then(result => result.json())\n .then(function(json) {\n if (json.data == null) {\n //not good\n } else {\n length = json.data.length;\n var i;\n var minDistance = 100;\n var stationID = null;\n var maxDailyData = 0;\n var dailyData = null;\n for(i = 0; i <length; i++) { \n if (!foundValidStation) {\n if (json.data[i].distance <= minDistance) {\n if (json.data[i].active == true) {\n fetch(\"https://api.meteostat.net/v2/stations/meta?id=\" + json.data[i].id, {\n headers: {\n \"X-Api-Key\": \"Ctr6uwisQ6EUppc1JyoKg9iw2F7mDtgu\"\n }\n })\n .then(result => result.json())\n .then(function(json) {\n \n start = json.data.inventory.daily.start;\n end = json.data.inventory.daily.end;\n if (start != null && end != null) {\n var startInt = parseInt(start.substring(0,4));\n var endInt = parseInt(end.substring(0,4));\n dailyData = (endInt - startInt);\n stationID = json.data.id;\n getStationClimate(stationID, dailyData);\n i = length++;\n } else {\n dailyData = null;\n }\n })\n .catch(error => console.log('error', error));\n }\n\n } \n }\n\n }\n }\n })\n .catch(error => console.log('error', error));\n //didnt find one with daily data\n}", "title": "" }, { "docid": "6e5472e1800d35ab4ebc5e056af918f1", "score": "0.53398055", "text": "function searchCityByLonLat(longitude, latitude, city){\n\n //Determine the api url by feeding in the longitude and latitude\n var apiUrl = \"https://api.openweathermap.org/data/2.5/onecall?lat=\"+ latitude +\"&lon=\"+ longitude +\"&units=metric&appid=c17008019bfc88b06737b4ffe4cba08b\";\n\n fetch(apiUrl).then(function(response){\n if(response.ok){\n response.json().then(function(data){\n //Display one call weather data based on the logitude and latitude\n displayWeather(data, city);\n });\n }\n else{\n alert(\"Error: \" + response.statusText);\n }\n }).catch(function(error){\n alert(\"Error: Cannot connect to the server\");\n });\n\n}", "title": "" }, { "docid": "5ea556ff93f12f2fc44c4316faab2199", "score": "0.533356", "text": "function getUpdatedStations() {\n\n\n var zipCodes = [ 60007, 60018, 60068, 60106, 60131,\n 60176, 60601, 60602, 60603, 60604,\n 60605, 60606, 60607, 60608, 60609,\n 60610, 60611, 60612, 60613, 60614,\n 60615, 60616, 60617, 60618, 60619,\n 60620, 60621, 60622, 60623, 60624,\n 60625, 60626, 60628, 60629, 60630,\n 60631, 60632, 60633, 60634, 60636,\n 60637, 60638, 60639, 60640, 60641,\n 60642, 60643, 60644, 60645, 60646,\n 60647, 60649, 60651, 60652, 60653,\n 60654, 60655, 60656, 60657, 60659,\n 60660, 60661, 60706, 60707, 60714,\n 60804, 60827 ];\n\n var request = new XMLHttpRequest();\n var data = []; // holds all parsed data obtained from request\n var filteredData = []; // holds data without repeated stations\n\n var basicData = []; // 4 fields: datasetID = 4, latitude, longitude, stationID\n var intervalDate = []; // 3 fields: stationID, mindate, maxdate\n var response;\n\n /*\n Make AJAX requests for each zipCode available in Chicago. Each iteration\n requests for available wheater stations per location (zipCode).\n */\n\n// THIS CODE WAS COMMENT DUE TO HIGH EXHAUSTIVE AND LONG REQUEST MADE TO NOAA CDO SERVER\n// THE RESULTS OF THIS REQUESTS ARE PROVIDE AT THE END OF THIS FILE, WHERE ALSO IS\n// EXPLAINED THE TREATMENT OF DATA...\n// SEE WHERE IS FROM DATA, UNCOMENT THE CODE...\n/*\n for(var i = 0; i < zipCodes.length; ++i) {\n request.open(\"GET\", \"https://www.ncdc.noaa.gov/cdo-web/api/v2/stations?locationid=ZIP:\" + zipCodes[i], false);\n request.setRequestHeader(\"token\", \"yPamBBFyXheSqvqPtnIXIdrHeumciHmr\");\n request.send();\n response = JSON.parse(request.responseText);\n // Only first station for each zip code is pushed\n console.log(response.results);\n for(var j = 0; j < response.results.length; ++j)\n {\n var segment = response.results[j].maxdate.split(\"-\");\n // only add recent data\n if(segment[0] == \"2017\")\n data.push(response.results[j]);\n }\n console.log(i);\n }\n\n console.log(\">> only recent data ----------------------------------------------------------------\");\n console.log(data);\n\n // There are stations that are repeated. This program bring out duplicates.\n filteredData.push(data[0]);\n for(var i = 1; i < data.length; ++i) {\n var passedAll = false;\n var breaked = false;\n for(var j = 0; j < filteredData.length; ++j) {\n if(j == filteredData.length-1)\n passedAll = true;\n if(data[i].id == filteredData[j].id) {\n breaked = true;\n break;\n }\n }\n if(passedAll && !breaked) {\n filteredData.push(data[i]);\n basicData.push([4, data[i].latitude, data[i].longitude, data[i].id]);\n intervalDate.push([data[i].id, data[i].mindate, data[i].maxdate]);\n }\n\n }\n console.log(\">> Filtered data (no duplicates)----------------------------------------------------\");\n console.log(filteredData);\n\n console.log(\">> Basic data ----------------------------------------------------------------------\");\n for(var i = 0; i < basicData.length; ++i) {\n console.log(basicData[i]);\n }\n\n console.log(\">> Interval data -------------------------------------------------------------------\");\n for(var i = 0; i < intervalDate.length; i++) {\n console.log(intervalDate[i]);\n }\n */\n return [\n [ 4, 41.9953, -88.0527, \"GHCND:US1ILCK0075\" ],\n [ 4, 41.995, -87.9336, \"GHCND:USW00094846\" ],\n [ 4, 42.0044, -87.846, \"GHCND:US1ILCK0180\" ],\n [ 4, 42.0168, -87.8557, \"GHCND:US1ILCK0192\" ],\n [ 4, 41.886, -87.621, \"GHCND:US1ILCK0036\" ],\n [ 4, 41.8558, -87.6094, \"GHCND:USC00111550\" ],\n [ 4, 41.9481, -87.6588, \"GHCND:US1ILCK0179\" ],\n [ 4, 41.9266, -87.6562, \"GHCND:US1ILCK0032\" ],\n [ 4, 41.8008, -87.5903, \"GHCND:US1ILCK0014\" ],\n [ 4, 41.9642, -87.6974, \"GHCND:US1ILCK0168\" ],\n [ 4, 42.0043, -87.6697, \"GHCND:US1ILCK0232\" ],\n [ 4, 41.6598, -87.5529, \"GHCND:US1ILCK0082\" ],\n [ 4, 41.7372, -87.7775, \"GHCND:USC00111577\" ],\n [ 4, 41.78611, -87.75222, \"GHCND:USW00014819\" ],\n [ 4, 42.0019, -87.6985, \"GHCND:US1ILCK0094\" ],\n [ 4, 41.9957, -87.6918, \"GHCND:US1ILCK0214\" ],\n [ 4, 41.9177, -87.8037, \"GHCND:US1ILCK0243\" ]\n // [ 4, 41.8231, -87.7666, \"GHCND:US1ILCK0100\" ] // Data available until february\n ];\n}", "title": "" }, { "docid": "fa3e6aad0bac4bfe6447c1c2597e5618", "score": "0.5327585", "text": "function getData() {\t\t\n\t\t$.getJSON('https://data.seattle.gov/resource/65fc-btcc.json') \n\t\t\t.then(createMarkers)\n\t\t\t.then(fitMapBounds)\n\t\t\t.then(updateTotals);\n\t}", "title": "" }, { "docid": "69b7bbc9247180cdd74b71c475cb609b", "score": "0.53241915", "text": "_getWeatherInfo(city){\n const weatherFetchURL = `https://api.openweathermap.org/data/2.5/onecall?lat=${this.#userLocationCoords[0]}&lon=${this.#userLocationCoords[1]}&exclude=hourly,minutely&appid=${weatherKeyAPI}&units=metric`\n fetch(weatherFetchURL)\n .then(response => response.json())\n .then(data => {\n const formatedWeather= this._formatWeather(data);\n this.renderWeatherHtml(formatedWeather,this.currentDate,this.#userLocation)\n // document.querySelector(\".weather__container\").classList.remove(\".display__none\")\n })\n .catch(err => console.error(err))\n }", "title": "" }, { "docid": "bf15f2526ee9dfa00b540c5ae57b3670", "score": "0.5321509", "text": "function getWeather(city) {\n var currentWeatherUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${api_key}`;\n //send fetch request to get latitude and longitude\n fetch(currentWeatherUrl)\n .then((data) => data.json())\n .then(function (weather) {\n console.log(weather);\n if (weather.cod === \"404\") {\n alert(\"City not found\");\n return;\n }\n currentCity.innerHTML = \"\" + weather.name;\n \n var lat = weather.coord.lat;\n var lon = weather.coord.lon;\n \n //api call for the latitude and longitude\n var onecallURL = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=${api_key}`;\n fetch(onecallURL)\n .then((data) => data.json())\n .then(function (onecallData) {\n console.log(onecallData);\n buildDashboard(onecallData);\n });\n });\n }", "title": "" }, { "docid": "653dd62ebd6284fbfbc5d836fe9eba12", "score": "0.53200996", "text": "function getAPNSCo(muni, returnedList) {\n try {\n consoLog(returnedList);\n\tvar features = returnedList['candidates']['0']['attributes'];\n consoLog(features);\n p_address = features['House'] + \" \" + features['PreDir'] + \" \" + features['StreetName'] + \" \" + features['SufType'];\n\tdocument.getElementById(\"add_place\").innerHTML=p_address;\n var urlz = \"https://gis.co.santa-cruz.ca.us/sccgis/rest/services/OpenData_Build_Single/MapServer/145/query?where=SITEADD%20LIKE%20UPPER%28%20%27\" + encodeURI(p_address) + \"%27%29&outFields=APNNODASH,SQUAREFT,SITEADD,SITEADD2,ZONING,NAME&outSR=4326&f=json\" ;\n\tsendfunc(muni, urlz, getAPN[muni].zoneFunc);\n }\n catch(err) {\n\t alert(\"Cannot find this address, check the street and area\");\n }\n}", "title": "" }, { "docid": "a2a869e7c7f8815eb64ea0d40d4b022d", "score": "0.5316448", "text": "function request(cityName) {\n var currentDay = moment().format(\"MM/DD/YYYY\");\n // console.log(currentDay);\n $(\".main_date\").text(cityName + \" \"+currentDay);\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&appid=bcd175ceb7463d439ff2fd3b39ac3761&units=imperial\"\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response){\n // console.log(response);\n $(\".data1\").text(\"Temperature: \" + response.main.temp + \"°F\");\n $(\".data2\").text(\"Humidity: \" + response.main.humidity + \"%\");\n $(\".data3\").text(\"Wind Speed: \" + response.wind.speed + \"mph\");\n var iconMain = response.weather[0].icon;\n $(\"#icon_main\").attr(\"src\",\"http://openweathermap.org/img/w/\" + iconMain + \".png\")\n var latitude = response.coord.lat;\n // console.log(latitude);\n var longitude = response.coord.lon;\n // console.log(longitude)\n secondRequest(latitude,longitude);\n thirdRequest(cityName);\n });\n\n }", "title": "" }, { "docid": "500b6a98afa157aaaf6ae31f884e3bdd", "score": "0.5312413", "text": "function extractNeededData(data) {\n // declare empty array\n const venuesForMap = [];\n // Loop through json response\n data.forEach(venue => {\n // Push the name, ID, and latlng into an array to use for the map\n venuesForMap.push({\n name: venue.name,\n id: venue.id,\n latlng: \n [\n venue.location.lat,\n venue.location.lng\n ]\n });\n });\n // Create the map with the data gathered. Function located in main.js\n createMap(venuesForMap);\n}", "title": "" }, { "docid": "cfdb1021b54d28f9df9ec631534a9677", "score": "0.5305925", "text": "async function inputInit() {\n const startUrl = \"http://api.openweathermap.org/geo/1.0/direct?q=\"\n const endUrl = \"&limit=5&appid=\"\n // city name entered by user\n let cityInput = document.querySelector(\"#city-input\");\n let myCity = cityInput.value\n // retrieving apiKey from server\n let apiKey = await getApiKey();\n // create url and initiate get http request\n let myUrl = startUrl+myCity+endUrl+apiKey\n const result = await getIt(myUrl);\n return result;\n}", "title": "" }, { "docid": "6c009c193add38cc8d6f5aac0f7ab624", "score": "0.53030777", "text": "function loadCity(query, abbr) {\r\n\tvar address = \"http://api.apixu.com/v1/current.json?key=d66034f087494afda10215001162111&q=\" + query;\r\n\tvar request = getRequestObject();\r\n\trequest.onreadystatechange = function() { \r\n\t\thelperLC(query, abbr, request);\r\n\t}\r\n\trequest.open(\"GET\", address, true);\r\n\trequest.send(null);\r\n}", "title": "" }, { "docid": "ed2089046f90a4494f492550b7a8e6b0", "score": "0.529629", "text": "function get_all_siteinfo() \n{\n RMPApplication.debug(\"begin get_all_siteinfo\");\n c_debug(debug.site, \"=> get_all_siteinfo\");\n // TO DO: tenter de faire un appel API pour récupérer toutes les informations\n // des locations concernées par le filtre de recherche\n // PUIS pour chaque entrée de var_order_list, associer les informations de SITE\n\n curr_indice = 0;\n var v_ol_len = var_order_list.length;\n c_debug(debug.site, \"=> get_all_siteinfo: v_ol_l = \", v_ol_len);\n if (var_order_list.length == undefined) { // only one search's result\n var buf = var_order_list.location.split('-');\n var loc_code = $.trim(buf[buf.length - 1]);\n var input = {};\n input.location_code = loc_code;\n input.indice = \"0\";\n c_debug(debug.site, \"=> get_all_siteinfo: loc_code = \", loc_code);\n //call api to location collection\n id_get_filtered_locations_api.trigger(input, {}, get_all_siteinfo_ok, get_all_siteinfo_ko);\n } else {\n for (var i=0; i<var_order_list.length; i++) {\n var buf = var_order_list[i].location.split('-');\n var loc_code = $.trim(buf[buf.length - 1]);\n \n // test par exemple sur le 3ème enregistrement\n /*if (i == 3) {\n c_debug(debug.site, \"=> get_all_siteinfo: \\n +var_order_list[i].location = \", var_order_list[i].location, \"\\n +loc_code = \", loc_code);\n }*/\n\n var input = {};\n input.location_code = loc_code;\n input.indice = i;\n c_debug(debug.site, \"=> get_all_siteinfo: loc_code = \", loc_code);\n //call api to location collection\n id_get_filtered_locations_api.trigger(input, {}, get_all_siteinfo_ok, get_all_siteinfo_ko);\n }\n }\n RMPApplication.debug(\"end get_all_siteinfo\");\n}", "title": "" }, { "docid": "74a23e3aabb786fbe0d8153744012600", "score": "0.52955776", "text": "function success(position) {\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n //console.log(lat);\n \n $.ajax({ url: \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\" + lat + \",\" + lon + \"&key=AIzaSyDB_0HCG9l1LKKjHU_6OEKtFE0Cohl1UJU\" ,\n dataType: 'json',\n success: function(results){\n \n //city\n var city = results.results[\"0\"].address_components[3].long_name;\n //state\n var state = results.results[\"0\"].address_components[5].short_name;\n document.getElementsByClassName(\"location\")[0].innerHTML = city+ \", \" + state;\n },\n error: function(){\n console.log('not working :(');\n }\n });\n \n //Retrieves weather data\n $.ajax({ url: \"https://api.forecast.io/forecast/c199afcc2ac8c994a18563502f3e65bc/\" + lat + \",\" + lon,\n dataType: 'jsonp',\n success: function(results){\n //console.log(results);\n \n var temp = results.currently.temperature;\n //Convert to Celcus equation\n var num = (temp - 32) * 5 / 9;\n var cel = Math.round(num * 100) / 100;\n //Temprature\n document.getElementsByClassName(\"temp\")[0].innerHTML = temp + \"° F\";\n document.getElementsByClassName(\"temp2\")[0].innerHTML = cel + \"° C\";\n\n\n\n //Short Summary\n document.getElementsByClassName(\"summary\")[0].innerHTML = results.currently.summary;\n \n //Long Summary\n document.getElementsByClassName(\"summary-long\")[0].innerHTML = results.daily.summary;\n\n //animated icon\n var skycons = new Skycons({\"color\": \"white\"});//color of icon\n skycons.set(\"icon1\", results.currently.icon);//applies correct icon to page\n skycons.play();//start icon animation\n },\n error: function(){\n //console.log('Not Working');\n alert('Weather data not available.');\n }\n\n }); \n \n}", "title": "" }, { "docid": "86755d351c4e70fca86456b3430e590d", "score": "0.5293315", "text": "function currentCity(){\n $.getJSON(\"https://ipinfo.io?token=7132bb4f140dca\", callback);\n \n function callback(data) {\n lat = data.loc.split(',')[0];\n lon = data.loc.split(',')[1];\n \n OWM_URL = \"https://api.openweathermap.org/data/2.5/weather?lat=\"+lat+\"&lon=\"+lon+\"&lang=\"+lang+\"&units=metric&appid=\" + OWM_API_KEY;\n updateWeather(OWM_URL);\n \n }\n }", "title": "" }, { "docid": "6099d10277f729d0b48a83ab4b35d6f4", "score": "0.5290967", "text": "function showAddress(address) {\n\tif (address.length != 5) {\n\t\talert(\"The input zip code is not valid! Please check and input again.\");\n\t\treturn;\n\t}\n\twindow.pagedData = [];\n\twindow.curPage = 0;\n\tvar waterquery = \"\";\n\tvar facilityquery = \"\";\n\tif (geocoder) {\n\t\tgeocoder.getLatLng(address, function(point) {\n\t\t\tif (!point) {\n\t\t\t\talert(address + \" not found\");\n\t\t\t} else {\n\t\t\t\tmap.setCenter(point, 10);\n\t\t\t}\n\t\t});\n\n\t\t$(\"#spinner\").css(\"display\", \"block\");\n\t\t$\n\t\t\t\t.ajax({\n\t\t\t\t\ttype : \"GET\",\n\t\t\t\t\turl : thiszipagent, // SPARQL service URI\n\t\t\t\t\tdata : \"code=\" + address, // query parameter\n\t\t\t\t\tdataType : \"json\",\n\t\t\t\t\tsuccess : function(data) {\n\t\t\t\t\t\tstate = data.result.stateAbbr;\n\t\t\t\t\t\tshowReportSite(state);\n\t\t\t\t\t\tthisStateCode = data.result.stateCode;\t\t\t\t\t\t\n\t\t\t\t\t\tif (thisStateCode == undefined)\n\t\t\t\t\t\t\tthisStateCode = stateAbbr2Code[state];\n\t\t\t\t\t\tstateCode = thisStateCode.split(\":\")[1];\n\t\t\t\t\t\tcountyCode = data.result.countyCode;\n\t\t\t\t\t\tcountyCode = countyCode.replace(\"US:\", \"\");// strip the\n\t\t\t\t\t\t// \"US:\"\n\t\t\t\t\t\tcountyFips = countyCode.replace(\":\", \"\");// strip the\n\t\t\t\t\t\t// \":\"\n\t\t\t\t\t\t// alert(countyFips);\n\t\t\t\t\t\tcountyCode = countyCode.split(\":\")[1];\n\t\t\t\t\t\tcountyCode = countyCode.replace(/^0+/, \"\");\n\t\t\t\t\t\tlat = data.result.lat;\n\t\t\t\t\t\tlng = data.result.lng;\n\n\t\t\t\t\t\tvar contaminants = $(\"#characteristicName\").val();\n\t\t\t\t\t\tvar effects = $(\"#health\").val();\n\t\t\t\t\t\tvar time = $(\"#time\").val();\n\t\t\t\t\t\tvar sources = JSON.stringify($.map(\n\t\t\t\t\t\t\t\t$('[name=\"source\"]:checked'), function(x) {\n\t\t\t\t\t\t\t\t\treturn x.value;\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\tvar regulation = $('[name=\"regulation\"]:checked').val();\n\t\t\t\t\t\tindustry = $(\"#industry_selection_canvas\").val();\n\t\t\t\t\t\t// alert(industry);\n\t\t\t\t\t\tgetLimitData(sources, regulation, contaminants, effects, time, industry);\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tvar bounds = map.getBounds();\n\t\t\t\t\t\tvar southWest = bounds.getSouthWest();\n\t\t\t\t\t\tvar northEast = bounds.getNorthEast();\n\t\t\t\t\t\tvar lngLow = southWest.lng();\n\t\t\t\t\t\tvar lngHigh = northEast.lng();\n\t\t\t\t\t\tvar latLow = southWest.lat();\n\t\t\t\t\t\tvar latHigh = northEast.lat();\n\t\t\t\t\t\tgetAllData(sources, regulation, contaminants, effects,\n\t\t\t\t\t\t\t\ttime, industry, lngLow, lngHigh, latLow,\n\t\t\t\t\t\t\t\tlatHigh);*/\n\t\t\t\t\t},\n\t\t\t\t\terror : function(data) {\n\t\t\t\t\t\twindow\n\t\t\t\t\t\t\t\t.alert(\"Unable to determine enough information about your location.\");\n\t\t\t\t\t\t$(\"#spinner\").css(\"display\", \"none\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t}\n}", "title": "" }, { "docid": "e7272461a9ad5213c94b05def8521c21", "score": "0.52733606", "text": "function apiTwo(coordinates) {\n console.log(coordinates);\n var cityTitle = document.querySelector('#city-title');\n var cityDate = moment().format(\"M/D/YYYY\");\n cityTitle.textContent = coordinates.name + \" (\" + cityDate + \")\";\n\n var lati = coordinates.coord.lat\n var longi = coordinates.coord.lon\n \n var oneCallApi = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lati + \"&lon=\" + longi + \"&units=imperial&appid=\" + APIKey;\n\n fetch(oneCallApi)\n .then(function (response) {\n if(!response.ok) {\n throw response.json();\n }\n return response.json();\n })\n .then(function (data) {\n printResults(data);\n })\n .catch(function (error) {\n console.error(error);\n })\n }", "title": "" }, { "docid": "445be95a2bf383df5dc3af1be2dbaa17", "score": "0.5264494", "text": "function getWeatherInfo() {\n var queryURL =\n \"https://api.openweathermap.org/data/2.5/onecall?lat=\" +\n latitude +\n \"&lon=\" +\n longitude +\n \"&exclude={part}&appid=\" +\n apiKey;\n $.ajax({\n url: queryURL,\n method: \"GET\",\n })\n .then(function (response) {\n console.log(response);\n renderFullPage(response);\n });\n }", "title": "" }, { "docid": "cc49cba63b25cee78b48ec80329999f6", "score": "0.5262888", "text": "function getLatLngByZipcode() {\n $.ajax({\n method: \"GET\", \n url: \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + zipCode + \"&key=AIzaSyCHUllvvIE1AweiwvXJOCvxq5DmtUhv1Cw\",\n \n }).then(response =>{\n console.log(response); \n latitude = response.results[0].geometry.location.lat; \n longitude = response.results[0].geometry.location.lng; \n console.log(latitude, longitude); \n getRestaurants(latitude, longitude); \n })\n \n}", "title": "" }, { "docid": "23e4f3fb48ccf60c4ba822eb2f3aef1d", "score": "0.52540165", "text": "function initIndexedData() {\n // Retrieve schematics data\n $.when(\n $.ajax({\n url: 'api/schematics',\n type: 'GET'\n })\n ).done(\n function (data) {\n // display options of schematicfiles to add to geo-point\n _.each(data.objects, function (schematic) {\n addSchematicSelection(schematic);\n schematics.push(schematic);\n });\n });\n\n // Retrieve geopoints from api and display on map\n $.when(\n $.ajax({\n url: 'api/datapoints',\n type: 'GET'\n })\n ).done(\n function (data) {\n points = data.objects;\n\n // Add indexed mapCircles to map\n _.map(points, drawCircle);\n updatePointCountDisplay(points.length);\n });\n}", "title": "" }, { "docid": "bdfcf4dba48071e900f3b978460a7ecb", "score": "0.5250896", "text": "function getCoordinates(city) {\n var apiUrl = \"https://api.openweathermap.org/geo/1.0/direct?q=\" + city + \"&limit=1\" + \"&appid=\" + appid;\n\n fetch(apiUrl).then(function (response) {\n if (response.ok) {\n response.json().then(function (data) {\n // Get lat and lon properties from response\n var lat = data[0].lat.toString();\n var lon = data[0].lon.toString();\n renderWeather(lat, lon, data[0].name);\n });\n } else {\n alert('Error: ' + response.statusText);\n }\n });\n}", "title": "" }, { "docid": "dccc2b175573aa40b778c1d5eb7f3df4", "score": "0.52391034", "text": "async function getGeoDetails(ingredients, number, cuisine) {\n console.log(1)\n console.log('-------first URL')\n console.log(foodUrl + ApiKey + '&query=' + ingredients + '&maxCarbs=' + number + '&cuisine=' + cuisine)\n const response = await fetch(foodUrl + ApiKey + '&query=' + ingredients + '&maxCarbs=' + number + '&cuisine=' + cuisine);\n try {\n return await response.json();\n } catch (e) {\n console.log('(1)There was an error :', e);\n }\n}", "title": "" }, { "docid": "f625197130b81a4b2b5b6d31eeed1638", "score": "0.52337253", "text": "async function getGeonames (inp) {\n try {\n let urlStart = \"http://api.geonames.org/postalCodeSearchJSON?\";\n let placename = inp.replace(/[,]/g, '');\n // getting the API key from server\n let apiKey = await getKeys(\"/apiKey\", \"geonames\");\n let compiledUrl = `${urlStart}placename=${placename}&maxRows=10&username=${apiKey}`\n let myData = await getData(compiledUrl)\n // API returns an object, of which we want to access the array of data\n // under \"postcodes\" obj attribute\n let myDataArr = myData.postalCodes\n return myDataArr;\n } catch(err) {\n console.log(err)\n }\n}", "title": "" }, { "docid": "60ccb4573fe8a9a91fc3e1d99ce7bc6a", "score": "0.5232098", "text": "function getLatLon() {\n var cityName = $destination.val()\n fetch('https://api.openweathermap.org/data/2.5/weather?q=' + cityName + '&appid=e7f511b5d71366565851371d14913d91') \n .then(function(response) {\n if (response.ok) {\n response.json() \n .then(function(data) {\n var lat = data.coord.lat\n var lon = data.coord.lon\n fetch(\"https://travel-places.p.rapidapi.com/\", {\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"x-rapidapi-host\": \"travel-places.p.rapidapi.com\", \n \"x-rapidapi-key\": \"ed72924349mshae50afa305e405fp1e199fjsn0f69786a98fb\" \n },\n \"body\": JSON.stringify({\n \"query\": \"{ getPlaces(categories:[\\\"MAJOR\\\"],lat:\" + lat + \",lng:\" + lon + \",maxDistMeters:50000) { name,lat,lng,abstract,distance,categories } }\"\n })\n })\n .then(function(response) {\n if (response.ok) {\n response.json()\n .then(function(data) {\n for(i = 0; i < 5; i++) {\n var activityName = $('.activityName' + i)\n var activityType = $('.activityType' + i)\n activityName.text(data.data.getPlaces[i].name)\n activityType.text(data.data.getPlaces[i].categories[0])\n\n }\n })\n } else {\n flightDisplay.attr('class', 'hidden')\n $errorPage.attr('class', 'errorPage')\n $('#errorCode').text(response.status)\n }\n })\n })\n } else {\n flightDisplay.attr('class', 'hidden')\n $errorPage.attr('class', 'errorPage')\n $('#errorCode').text(response.status)\n }\n })\n }", "title": "" }, { "docid": "fce2d71712478fb2e4c4b1281818f5a2", "score": "0.52272654", "text": "function getWoeid(i, cityOrZip, numAllowedFails) \n {\n cityList[i].name = 'Loading...';\n cityList[i].woeid = ''; \n cityList[i].image = IconHandler.returnImage(3200);\n cityList[i].temp = '';\n cityList[i].humidity = '';\n cityList[i].vis = '';\n cityList[i].windSpeed = ''; \n\n\tvar url = \"http://where.yahooapis.com/v1/places.q('\"+cityOrZip+\"')?format=json&appid=[S.acCMXV34GqNtuNg3WK590qQsnmF2LBDx2inBUwRZTU3dlVYrlyBN6hBJaDi4itcg--]\"\n\t \n\tvar Request = require(\"sdk/request\").Request;\n\tif(numAllowedFails > 0) \n\t{\n\t Request(\n\t {\n\t\t url: url,\n\t\t onComplete: function (response) \n\t\t {\n\t\t if(response.status === 200) \n\t\t { \n\t\t let txt = response.text.replace(/<[^>]+>\\s*$/,\"\");\n\t\t let json = JSON.parse(txt);\n\t\t \n\t\t if(json.places.total > 0) \n\t\t {\n\t\t cityList[i].name = json.places.place[0].woeid;\n\t\t cityList[i].woeid = json.places.place[0].woeid;\n\t\t getForecast(i);\n\t\t }\n\t\t else \n\t\t {\n\t\t cityList[i].name = \"Invalid Input\";\n\t\t }\n\t\t }\n\t\t if(response.status === 0) {\n\t\t getWoeid(i, cityOrZip, numAllowedFails-1)\n\t\t }\n\t\t\n\t\t if(document)\n\t\t { \n\t\t outputCityElements(); \n\t\t }\n\t\t } \n }).get();\n }\n }", "title": "" }, { "docid": "52bbb5f58e0cbb7fb37d03495b7be519", "score": "0.5226645", "text": "function getCityCoordinates(weather, city) {\n latitude = weather.coord.lat;\n longitude = weather.coord.lon;\n cityAndDateEl.textContent = weather.name + \" \";\n saveCityName = weather.name;\n}", "title": "" }, { "docid": "9a07c905d2146c0a8890f160c41acc0c", "score": "0.5225664", "text": "function getData(){\r\n console.log(\"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\");\r\n for (var city in citymap) {\r\n console.log(\"getting top track for the country \"+citymap[city].Country+\" corresponding to the metro \"+ city);\r\n \r\n getTopTracks(citymap[city].Country, city);\r\n }\r\n console.log(\"HELLO ALLTOPTRACKS.length=\" +ALLTOPTRACKS.length);\r\n}", "title": "" }, { "docid": "6ae925ef63298b5349b53408d135e8e3", "score": "0.5224511", "text": "function getWeather(cityName) {\n let queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&appid=\" + APIKey;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response){\n // Uses the Date constructor to return the date timestamp * 1000 ms\n const currentDate = new Date(response.dt*1000);\n const day = currentDate.getDate();\n // Returns the month of the year in numerical value of 0-11, so add 1\n const month = currentDate.getMonth() + 1;\n const year = currentDate.getFullYear();\n nameEl.innerHTML = response.name + \" (\" + month + \"/\" + day + \"/\" + year + \") \";\n // Calls the weather icon object\n let weatherPic = response.weather[0].icon;\n currentPicEl.setAttribute(\"src\",\"https://openweathermap.org/img/wn/\" + weatherPic + \"@2x.png\");\n currentPicEl.setAttribute(\"alt\",response.weather[0].description);\n // Calls the temp, humidity, and wind speed objects\n currentTempEl.innerHTML = \"Temperature: \" + k2f(response.main.temp) + \" &#176F\";\n currentHumidityEl.innerHTML = \"Humidity: \" + response.main.humidity + \"%\";\n currentWindEl.innerHTML = \"Wind Speed: \" + response.wind.speed + \" MPH\";\n \n // Getting longitude and latitude for the one-call-api\n let lat = response.coord.lat;\n let lon = response.coord.lon;\n let UVQueryURL = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&appid=\" + APIKey + \"&cnt=1\";\n $.ajax({\n url: UVQueryURL,\n method: \"GET\"\n }).then(function(response){\n console.log(response)\n console.log(response.daily[0].uvi)\n // Creating a span to contain the uv index\n let UVIndex = document.createElement(\"span\");\n // Most acccurate uv index is currently available from the daily object\n UVIndex.innerHTML = response.daily[0].uvi;\n // Used UV Index table to determine favorable, moderate, or severe conditions\n // https://en.wikipedia.org/wiki/Ultraviolet_index\n if (UVIndex.innerHTML > 6) {\n UVIndex.setAttribute(\"class\",\"badge badge-danger\");\n } else if (UVIndex.innerHTML > 3) {\n UVIndex.setAttribute(\"class\",\"badge badge-warning\");\n } else {\n UVIndex.setAttribute(\"class\",\"badge badge-success\");\n }\n currentUVEl.innerHTML = \"UV Index: \";\n currentUVEl.append(UVIndex);\n });\n\n // 5-Day forecast call\n let cityID = response.id;\n let forecastQueryURL = \"https://api.openweathermap.org/data/2.5/forecast?id=\" + cityID + \"&appid=\" + APIKey;\n $.ajax({\n url: forecastQueryURL,\n method: \"GET\"\n }).then(function(response){\n console.log(response);\n // Grab all elements with forecast class\n const forecastEls = document.querySelectorAll(\".forecast\");\n for (i = 0; i < forecastEls.length; i++) {\n forecastEls[i].innerHTML = \"\";\n // Index created to pull from the response.list and set the date time stamp and other attributes appropriately\n const forecastIndex = i*8 + 4;\n const forecastDate = new Date(response.list[forecastIndex].dt * 1000);\n const forecastDay = forecastDate.getDate();\n const forecastMonth = forecastDate.getMonth() + 1;\n const forecastYear = forecastDate.getFullYear();\n const forecastDateEl = document.createElement(\"p\");\n forecastDateEl.setAttribute(\"class\",\"mt-3 mb-0 forecast-date\");\n forecastDateEl.innerHTML = forecastMonth + \"/\" + forecastDay + \"/\" + forecastYear;\n forecastEls[i].append(forecastDateEl);\n const forecastWeatherEl = document.createElement(\"img\");\n forecastWeatherEl.setAttribute(\"src\",\"https://openweathermap.org/img/wn/\" + response.list[forecastIndex].weather[0].icon + \"@2x.png\");\n forecastWeatherEl.setAttribute(\"alt\",response.list[forecastIndex].weather[0].description);\n forecastEls[i].append(forecastWeatherEl);\n const forecastTempEl = document.createElement(\"p\");\n forecastTempEl.innerHTML = \"Temp: \" + k2f(response.list[forecastIndex].main.temp) + \" &#176F\";\n forecastEls[i].append(forecastTempEl);\n const forecastHumidityEl = document.createElement(\"p\");\n forecastHumidityEl.innerHTML = \"Humidity: \" + response.list[forecastIndex].main.humidity + \"%\";\n forecastEls[i].append(forecastHumidityEl);\n }\n })\n });\n }", "title": "" }, { "docid": "cac42008a617c7da48f63804a114349a", "score": "0.5217649", "text": "function fetchPopularData(cities) {\r\n cities.forEach((city) => {\r\n fetch(\r\n `${weatherAPI.baseURL}?lat=${city.lat}&lon=${city.lon}&units=metric&appid=${weatherAPI.key}`\r\n )\r\n .then((currentCity) => {\r\n return currentCity.json();\r\n })\r\n .then(displayPopularData);\r\n });\r\n}", "title": "" }, { "docid": "c1e4d5f22abefe312921498456eb346c", "score": "0.52174085", "text": "function init() {\n\tinit_map();\n\tzoomMap = map.getZoom();\n\trequestTimeUrl = \"http://\"+ myip + \":\" + myport + \"/timedata/timeseriesfires_portugal\";\n\tgetTimeSeriesJSON(requestTimeUrl);\n}", "title": "" }, { "docid": "78b5dbee97da551a12920084a68ea975", "score": "0.52157104", "text": "function queryGeocode() {\n // 'state' can be either acronym or full name.\n geocodeURL = 'https://maps.googleapis.com/maps/api/geocode/json?components=administrative_area:' + state + '|locality:' + cityName + '&key=AIzaSyB3Cm2EiWanz2vvfkcmsSjabHVnJmqgL4s';\n\n $.ajax({\n url: geocodeURL,\n crossDomain: true,\n success: function (geoData) {\n \n if (geoData.status != 'OK') {\n console.log('Unknown ERROR! ');\n showSignin();\n } else {\n lat = geoData.results[0].geometry.location.lat;\n lon = geoData.results[0].geometry.location.lng;\n\n console.log(geoData);\n console.log('Latitude obtained: ' + lat);\n console.log('Longitude obtained: ' + lon);\n console.log('');\n\n console.log('Calling weather API now...')\n callOpenWeatherAPI();\n\n console.log('Calling trail API now...')\n queryTrail();\n }\n },\n error: function(error) {\n console.log('ERROR! ' + error);\n }\n\n })\n .catch(function(error) {\n console.log(error);\n }) // End of AJAX call to Google Maps API.\n }", "title": "" }, { "docid": "eba3402f5358f7089a87cebbf1502f51", "score": "0.52150655", "text": "function getCityName(data) {\n\n var cityObject = JSON.parse(data);\n\n var city = cityObject.results[0].address_components[3].long_name;\n\n\n }", "title": "" }, { "docid": "b76945a8ca8a6c6afeeda2b67d2cc030", "score": "0.52140164", "text": "function getCityName(latitude, longitude, city_id) {\n const openCageAPIKey = \"4641706a1dfd40e5b62f9de9fdbfaf11\";\n const openCageAPIURL = `https://api.opencagedata.com/geocode/v1/json?q=${latitude}+${longitude}&key=${openCageAPIKey}`;\n\n fetch(openCageAPIURL)\n .then(response => {\n return response.json();\n })\n .then(request => {\n let city_object = request.results[0].components;\n\n // Ignores any missing components in the name (i.e. Singapore doesn't have a region code)\n let name_array = [];\n if (typeof(city_object.city) != \"undefined\") {\n name_array.push(city_object.city);\n }\n if (typeof(city_object.state) != \"undefined\") {\n name_array.push(city_object.state);\n }\n if (typeof(city_object[\"ISO_3166-1_alpha-2\"]) != \"undefined\") {\n name_array.push(city_object[\"ISO_3166-1_alpha-2\"]);\n }\n\n document.querySelector(\"#name\").textContent = `${name_array.join(\", \")} (${today.toLocaleDateString(\"en-US\", date_options)})`;\n addToStorage(`${name_array.join(\", \")}`, city_id);\n })\n}", "title": "" }, { "docid": "6d7588a2e6a292ab86df8e1130106db4", "score": "0.5213107", "text": "function weatherapicall(city){\n\n\n var queryWeatherURL = query.weather.url + city + query.weather.apiKey;\n \n $.ajax({\n url: queryWeatherURL,\n method: \"GET\"\n }).done(function(response) {\n console.log(response);\n\n htmlpusherweather(response)\n });\n }", "title": "" }, { "docid": "40598854ad0cd951b31f0a0dd860dfdf", "score": "0.5212771", "text": "function displayCities () {\n let cities = instructorData.additionalData.moreDetails.citiesLivedIn;\n for(let i=0; i<cities.length; i++) {\n console.log(cities[i]);\n }\n}", "title": "" }, { "docid": "79dc0f1e6631dff06989e4196626f96d", "score": "0.52120554", "text": "function getWeather(cityName) {\n let queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&appid=\" + apiKey;\n fetch(queryURL)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n var currentDate = new Date(data.dt * 1000);\n var day = currentDate.getDate();\n var month = currentDate.getMonth() + 1;\n var year = currentDate.getFullYear();\n nameElement.innerHTML = data.name + \"(\" + month + \"/\" + day + \"/\" + year + \")\";\n let weatherPic = data.weather[0].icon;\n currentPic.setAttribute(\"src\", \"https://openweathermap.org/img/wn/\" + weatherPic + \"@2x.png\");\n currentPic.setAttribute(\"alt\", data.weather[0].description);\n currentTemp.innerHTML = \"Tempurature: \" + tempFix(data.main.temp) + \" &#176F\";\n currentHumidity.innerHTML = \"Humidity:\" + data.main.humidity + \"%\";\n currentWind.innerHTML = \"Wind Speed:\" + data.wind.speed + \"mph\";\n // grabbing the lattitude and longitude from first api call to be used in second call to obtain UV index\n let lat = data.coord.lat;\n let lon = data.coord.lon;\n // makes the required call and inserts data into empty spots on current city box, also un-hides badge icon used to show current UV index\n let uvQueryUrl = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&appid=\" + apiKey + \"&cnt=1\";\n fetch(uvQueryUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data)\n let uvIndex = document.getElementById(\"uv-index-badge\")\n uvIndex.classList.remove(\"hidden\");\n uvIndex.innerHTML = data.current.uvi;\n currentUV.innerHTML = (\"UV Index: \")\n });\n\n // calls a third api to get data required for 5 day forecast\n let cityID = data.name;\n let forecastQueryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + cityID + \"&appid=\" + apiKey;\n fetch(forecastQueryURL)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data)\n // grabs all my empty forecast blocks and appends data needed\n var forecastBlocks = document.querySelectorAll(\".forecast\");\n for (let i = 0; i < forecastBlocks.length; i++) {\n forecastBlocks[i].innerHTML = \"\";\n var forecastIndex = i * 8 + 4;\n var forecastDate = new Date(data.list[forecastIndex].dt * 1000);\n var forecastDay = forecastDate.getDate();\n var forecastMonth = forecastDate.getMonth() + 1;\n var forecastYear = forecastDate.getFullYear();\n var forecastDateElement = document.createElement(\"p\");\n forecastDateElement.setAttribute(\"class\", \"mt-3 mb-0 forecast-date\");\n forecastDateElement.innerHTML = forecastMonth + \"/\" + forecastDay + \"/\" + forecastYear;\n forecastBlocks[i].append(forecastDateElement);\n var forecastWeatherElement = document.createElement(\"img\");\n forecastWeatherElement.setAttribute(\"src\", \"https://openweathermap.org/img/wn/\" + data.list[forecastIndex].weather[0].icon + \"@2x.png\");\n forecastWeatherElement.setAttribute(\"alt\", data.list[forecastIndex].weather[0].description);\n forecastBlocks[i].append(forecastWeatherElement);\n var forecastTempElement = document.createElement(\"p\");\n forecastTempElement.innerHTML = \"Temp: \" + tempFix(data.list[forecastIndex].main.temp) + \" &#176F\";\n forecastBlocks[i].append(forecastTempElement);\n var forecastHumidityElement = document.createElement(\"p\");\n forecastHumidityElement.innerHTML = \"Humidity: \" + data.list[forecastIndex].main.humidity + \"%\";\n forecastBlocks[i].append(forecastHumidityElement);\n var forecastWindElement = document.createElement(\"p\");\n forecastWindElement.innerHTML = \"Wind Speed: \" + data.list[forecastIndex].wind.speed + \"mph\";\n forecastBlocks[i].append(forecastWindElement);\n }\n })\n });\n}", "title": "" }, { "docid": "4dce7f022077eb19e1ab2da93fc1b2ae", "score": "0.5208549", "text": "async function fetchData() {\n const endpoint = await returnURL();\n const {name, subregion, population} = endpoint.data[0];\n const result = name + \" is situated in \" + subregion + \". It has a population of \" + population.toLocaleString() + \" people.\"\n return result;\n }", "title": "" }, { "docid": "aecb6b6a5c01fc2813ee27d5d35e3166", "score": "0.52080655", "text": "function getSourceStationInfo(){\r\n\r\n //if maps arent initialized, start maps, and select source station as the center\r\n if(!mapsInit){\r\n mapsInit = true;\r\n initMap(getLocation(data.sourceStation));\r\n\r\n }\r\n else{\r\n //otherwise set the center of the map to the source station\r\n moveMap(getLocation(data.sourceStation));\r\n }\r\n //get detailed info about the station from the barts api through our server\r\n serverJSONRequest('/station?station='+data.sourceStation,'GET',function(res){\r\n\r\n $(\"#sourceStationHeader\").html(res.name);\r\n $(\"#sourceStation-city\").html(res.city);\r\n if(res.north_routes.route){\r\n $(\"#sourceStation-NB\").html(parseRouteArray(res.north_routes.route));\r\n $(\"#sourceStation-NBP\").html(parsePlatformArray(res.north_platforms.platform));\r\n $(\"#sourceStation-NB-container\").show();\r\n $(\"#sourceStation-NBP-container\").show();\r\n }\r\n else{\r\n $(\"#sourceStation-NB-container\").hide();\r\n $(\"#sourceStation-NBP-container\").hide();\r\n }\r\n if(res.south_routes.route){\r\n $(\"#sourceStation-SB\").html(parseRouteArray(res.south_routes.route));\r\n $(\"#sourceStation-SBP\").html(parsePlatformArray(res.south_platforms.platform));\r\n $(\"#sourceStation-SB-container\").show();\r\n $(\"#sourceStation-SBP-container\").show();\r\n }\r\n else{\r\n $(\"#sourceStation-SB-container\").hide();\r\n $(\"#sourceStation-SBP-container\").hide();\r\n }\r\n\r\n\r\n $(\"#sourceStationInfo\").show();\r\n })\r\n}", "title": "" }, { "docid": "1bfa9bab6059253bdffd818bc4c88065", "score": "0.5206745", "text": "function gasStationFinder(lon, lat, city_input) {\n // inserting lat and lon taken from the restaurant API into the gas prices API since it doesnt accept city names\n var queryURL = \"http://api.mygasfeed.com/stations/radius/\" + lat + \"/\" + lon + \"/7/reg/Price/bpxxw96ps2.json\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n gasStationResponse(response, city_input);\n })\n}", "title": "" }, { "docid": "b44044458ee4f223ab92296626de34db", "score": "0.5206493", "text": "searchDiveSpots(zip) {\n this.setState({\n zipCode: zip,\n });\n axios.get(\"https://maps.googleapis.com/maps/api/geocode/json?address=\" + zip + \"&key=\" + googleAPIKey.googleAPIKey)\n .then((response) => {\n this.setState({\n latitude: response.data.results[0].geometry.location.lat,\n longitude: response.data.results[0].geometry.location.lng\n })\n axios.get('https://cors-anywhere.herokuapp.com/http://api.divesites.com/?mode=sites&lat=' + this.state.latitude + '&lng=' + this.state.longitude + '&dist=21.72')\n .then((res) => {\n this.setState({\n diveSpots: res.data.sites,\n })\n })\n })\n this.setState({\n showSearchResults: true,\n })\n }", "title": "" }, { "docid": "f48006aaf92b1f3e326886e4eb2d6b7a", "score": "0.51977265", "text": "async function cityInit () {\n const result = await inputInit();\n try {\n if (result.length > 1) {\n // make container visible in window\n cityContainer.style.display = \"block\";\n let firstResult = result[0];\n // some cities, such as in the US, include a state property e.g. London, KY, US\n if (firstResult.state !== undefined) {\n let output = `${firstResult.name}, ${firstResult.state}, ${firstResult.country}`\n return outputFunction(output);\n } else {\n let output = `${firstResult.name}, ${firstResult.country}`\n return outputFunction(output);\n }\n } else if (result.length == 0) {\n // error, input not recognized\n alert(\"please enter a valid city, e.g. \\\"London\\\", or \\\"London, GB\\\"\")\n } else {\n // if only one city returned by get request\n let chosenCityIndex = 0;\n return returnedCity(result,chosenCityIndex);\n }\n } catch(err) {\n console.log(err.message)\n }\n }", "title": "" }, { "docid": "6d285c7d489cf0a6616aa2d36c3fe601", "score": "0.5192973", "text": "_getCurrentCity([lat,long]){\n fetch(`https://us1.locationiq.com/v1/reverse.php?key=${reverseGeocodeAPI}&lat=${lat}&lon=${long}=&format=json&accept-language=\"en\"`)\n .then(response=>response.json())\n .then(data => {\n if(data.address.city.toLowerCase().includes(\"sector\")){\n this.#userLocation = \"Bucharest\";\n }else{\n this.#userLocation=data.address.city\n }\n this._getWeatherInfo(this.#userLocationCoords)\n })\n .catch(error => console.error(\"Could not get current city using geocode API\"))\n }", "title": "" }, { "docid": "6996e943817cdbe3b563c2ca42fbc66b", "score": "0.518858", "text": "function getWeatherInfo (query, state) {\n if (state == '' || state == 'none') {\n var apiUrl = 'https://api.openweathermap.org/data/2.5/weather?units=imperial&q=' + query + '&appid=' + APIkey;\n var stateName = ''; \n } else {\n var apiUrl = 'https://api.openweathermap.org/data/2.5/weather?units=imperial&q=' + query + ',' + state + ',us&appid=' + APIkey;\n var stateName = ', ' + state;\n }\n\n fetch(apiUrl).then(function(response){\n if (response.ok) {\n response.json().then(function(data){\n // this conditional uses a counter so that the automatic query that\n // happens when the page loads/refreshes does net get checked -- the \n // 'cityList' that checkCityID() uses is very large and sometimes doesn't\n // load in time for to bed used for the init() query, resulting in an error\n if (counter > 0){\n if (checkCityID(data.id, state)) {\n oneCallPass(data.coord.lat, data.coord.lon, data.name, stateName);\n } else {\n alert(query + stateName +' does not exist. Please try another state or leave state blank.')\n } \n } else {\n oneCallPass(data.coord.lat, data.coord.lon, data.name, stateName);\n }\n });\n } else {\n // there might be a better way to handle potential errors, but this works for now\n alert('ERROR: Page not found. Check the spelling of your query and try again.');\n console.error(response.status);\n }\n });\n}", "title": "" }, { "docid": "582f51c2d3819f93ba935f122bd8b93c", "score": "0.5186392", "text": "function searchCityByName(cityName){\n\n //Determine the api url by feeding in the city name\n var apiUrl = \"https://api.openweathermap.org/data/2.5/weather?q=\"+ cityName +\"&units=metric&appid=c17008019bfc88b06737b4ffe4cba08b\";\n\n //Fetch the data from OpenWeater\n fetch(apiUrl).then(function(response){\n if(response.ok){\n response.json().then(function(data){\n //Take the coordinates from the search and query one call weather API\n searchCityByLonLat(data.coord.lon, data.coord.lat, data.name);\n });\n }\n else{\n alert(\"Error: \" + response.statusText);\n }\n }).catch(function(error){\n alert(\"Error: Cannot connect to the server\");\n });\n}", "title": "" } ]
8e51e3fdfe6b0afcd2db715d2ef6df8e
NEW//////// draw() Shows an into screen, then starts game While the game is active, checks input updates positions of prey and player, checks health (dying), checks eating (overlaps), checks hits (overlaps) displays the agents. When the game is over, shows the game over screen.
[ { "docid": "d90c42a6d9c6d0ba070abba40ef2fc4b", "score": "0.0", "text": "function draw() {\n //Changing backround if the player is round, blue backround if else\n if (playerRoundness == playerRadius){\n background(r,g,b);\n if(r == 255 && g < 255 && b == 0){\n g+=5;\n }else if (r <= 255 && r > 0 && g == 255 && b == 0){\n r-=5;\n }else if (r == 0 && g == 255 && b >= 0 && b < 255){\n b+=5;\n }else if (r == 0 && g <= 255 && g > 0 && b == 255){\n g-=5;\n }else if (r < 255 && g == 0 && b == 255){\n r+=5;\n }else if (r == 255 && g == 0 && b <=255 && b >0){\n b-=5;\n }\n }else{\n background(100,100,200);\n }\n\n //An intro sequence displaying some text\n if (introTimer < 270){\n fill(43, 43, 114);\n textFont(myFont);\n textSize(30);\n textAlign(CENTER,CENTER);\n var title = \"I DON'T WANNA BE A SQUARE\";\n text(title,width/2,height/2);\n if(introTimer >130){\n var title = \"I WANNA BE A CIRCLE\";\n text(title,width/2,height*2/3);\n }\n introTimer++;\n }\n else if (!gameOver) {\n handleInput();\n\n movePlayer();\n movePrey();\n //Move enemies if there are some\n if (enemyArray.length >0){\n for (i = 0; i <enemyArray.length; i++){\n enemyArray[i].moveEnemy();\n }\n }\n\n updateHealth();\n checkEating();\n //Check if player was hit by each enemy\n if (enemyArray.length >0){\n for (i = 0; i <enemyArray.length; i++){\n enemyArray[i].checkHit();\n }\n }\n\n drawPrey();\n drawPlayer();\n //Draw each enemy if there are some\n if (enemyArray.length >0){\n for (i = 0; i <enemyArray.length; i++){\n enemyArray[i].drawEnemy();\n }\n }\n\n drawHealthBar();\n\n }\n else {\n showGameOver();\n }\n}", "title": "" } ]
[ { "docid": "57179e1e01e7a677a258021f78229600", "score": "0.7506854", "text": "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // draw the p5.clickables, in front of the mazes but behind the sprites \n clickablesManager.draw();\n\n // No avatar for Splash screen or Instructions screen\n if( adventureManager.getStateName() !== \"Splash\" && \n adventureManager.getStateName() !== \"Instructions\" &&\n adventureManager.getStateName() !== \"Village\" &&\n adventureManager.getStateName() !== \"Bakery2\" &&\n adventureManager.getStateName() !== \"Forest1\" ) {\n \n } \n}", "title": "" }, { "docid": "4412dea23fcaeeff26e13077e2744bc5", "score": "0.74077684", "text": "function draw() {\n background(bgImage);\n\n if (!gameOver) {\n handleInput();\n\n movePlayer();\n movePrey();\n\n updateHealth();\n checkEating();\n checkContactPlayerObstacle();\n checkContactProjectileObstacle();\n\n drawPrey();\n drawPlayer();\n drawProjectile();\n drawInfoText();\n }\n else {\n showGameOver();\n }\n}", "title": "" }, { "docid": "2fe47b0735b3729fd7ce07f60ba68869", "score": "0.73789173", "text": "function draw() {\n background('#79cdff');\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // draw the p5.clickables, in front of the mazes but behind the sprites \n clickablesManager.draw();\n\n // No avatar for following Screens, \n if (adventureManager.getStateName() !== \"Splash\" &&\n adventureManager.getStateName() !== \"Instructions\" &&\n adventureManager.getStateName() !== \"ExitPlane\" &&\n adventureManager.getStateName() !== \"UglyIsland\" &&\n adventureManager.getStateName() !== \"About\") {\n // responds to keydowns\n moveSprite();\n // this is a function of p5.js, not of this sketch\n drawSprite(playerSprite);\n }\n}", "title": "" }, { "docid": "8f5120e40cfcc697e3db334ca85e3b78", "score": "0.7368567", "text": "function draw() {\n sceneManager.switchScene(player1, player2);\n //implememt punishment/rewards for following/leading\n player1.updateTotal(player2);\n player2.updateTotal(player1);\n\n // update location of player1 and player2\n player1.update();\n player2.update();\n\n playerCollision();\n\n // Finally actually drawing!\n sceneManager.drawScene(player1, player2, foods);\n}", "title": "" }, { "docid": "8d588441d1d0da86623202740c8e43c8", "score": "0.7349727", "text": "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // draw the p5.clickables, in front of the mazes but behind the sprites \n clickablesManager.draw();\n\n // No avatar for Splash screen or Instructions screen\n if( adventureManager.getStateName() !== \"Start\" && \n adventureManager.getStateName() !== \"Instruction\" &&\n adventureManager.getStateName() !== \"Intro\" &&\n adventureManager.getStateName() !== \"Trans1\" &&\n adventureManager.getStateName() !== \"Trans1cont\" &&\n adventureManager.getStateName() !== \"Trans2\" &&\n adventureManager.getStateName() !== \"Trans3\" &&\n adventureManager.getStateName() !== \"ZoomBreak\" &&\n adventureManager.getStateName() !== \"ZoomBreak2\" &&\n adventureManager.getStateName() !== \"ZoomBreak3\" &&\n adventureManager.getStateName() !== \"ZoomBreak4\" &&\n adventureManager.getStateName() !== \"Trans4\" &&\n adventureManager.getStateName() !== \"Trans5\" &&\n adventureManager.getStateName() !== \"Trans6\" &&\n adventureManager.getStateName() !== \"ZoomEulogy\" &&\n adventureManager.getStateName() !== \"ZoomEulogy2\" &&\n adventureManager.getStateName() !== \"End\" &&\n adventureManager.getStateName() !== \"End2\") {\n \n // responds to keydowns\n moveSprite();\n\n // this is a function of p5.js, not of this sketch\n drawSprite(playerSprite);\n } \n}", "title": "" }, { "docid": "f500dcde3c9ee536d287b0d6bd0d4478", "score": "0.7235549", "text": "function draw() {\n background(0);\n\n\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 if (agents[0].collide(agents[i])) {\n agents[0].eat(agents[i]);\n }\n }\n}", "title": "" }, { "docid": "2dda994afae27823ea4c542cd4145437", "score": "0.721788", "text": "function draw() {\n background(backgroundimage);\n if (title){\n setTimeout(startGame,3000);\n titlescreen();\n }\n else if (!gameOver) {\n handleInput();\n ui()\n moveghost();\n movebones();\n updateHealth();\n checkEating();\n drawbones();\n drawghost();\n }\n else {\n showGameOver();\n\n}\n}", "title": "" }, { "docid": "058a133ea4b5062577f749d654beea05", "score": "0.71762186", "text": "function draw() {\n drawGUI();\n\n // If the player clicked the target\n if (gameOver) {\n displayWinText();\n displayCircleAroundTarget();\n displayVictoryAnimation();\n rewardPlayer(); // break point rewards\n }\n // A mirror outcome... if the player clicked too many times and lost\n if (lostGame) {\n displayLoserText();\n displayCircleAroundTarget();\n displayLoserAnimation();\n resetVelocity();\n }\n}", "title": "" }, { "docid": "96e08a86a58304ffb80a8be7899e1ba2", "score": "0.71190715", "text": "function draw(){\n if (gameState == 0){\n startScreen();\n } else if (gameState == 1){\n update();\n } else if (gameState == 2){\n gameOver();\n }\n}", "title": "" }, { "docid": "d8a19a5bfeff0056e6ce8de3d4e37f37", "score": "0.7102067", "text": "function draw() {\n clear();\n image(video, 0, 0, width, height);\n calculate();\n\n rect(conditionNoseX, conditionNoseY, 20, 20);\n rect(conditionLHandX, conditionLHandY, 20, 20);\n rect(conditionRHandX, conditionRHandY, 20, 20);\n\n //NOTE TO SELF: background(0) seems to stopped working. Fix this ASAP for testing!\n background(0);\n\n //code below triggers the functionality if users are nearby enough, so users from faraway cannot influence the mirror.\n if (distanceEyes > 50 && distanceEyes < 150){\n drawGrid();\n nodRec();\n gestureAnime();\n scenario();\n screen = 1;\n if (!played){\n hiAnimation.play();\n played = true;\n }\n }else{\n played = false;\n }\n //console log commented for eventual use\n if (gesture != null){\n console.log(gesture);\n }\n}", "title": "" }, { "docid": "d7f0849e5aa274653133ccfbb382940d", "score": "0.7076051", "text": "function draw() {\n if (isGameStarted())\n {\n // Handle game logic.\n handleGameLogic();\n\n // Display feedbacks, messages, score and progress.\n // Draw instuctions\n drawGame();\n }\n else\n drawHome();\n} // End of draw()", "title": "" }, { "docid": "8c2abd9344acd29e8da696db0481cd3c", "score": "0.70615816", "text": "function draw() {\n\n if (playing === false) {\n // Added function for title screen\n\n // titleScreen();\n }\n\n // If the game is being played,\n // then the preys and predators will be active\n else {\n // added 80s image collage image\n background(backgroundImage, 0, 0); // done by me on photoshop\n timeCount();\n // Handle input for the tiger\n google.handleInput();\n // fire.handleInput();\n // safari.handleInput();\n // Move all the \"browsers\"\n google.move();\n explorer.move();\n explorer1.move();\n explorer2.move();\n explorer3.move();\n explorer4.move();\n explorer5.move();\n explorer6.move();\n explorer7.move();\n explorer8.move();\n //fire.move();\n // safari.move();\n\n // Handle the predators eating any of the prey\n google.handleEating(explorer);\n google.handleEating(explorer1);\n google.handleEating(explorer2);\n google.handleEating(explorer3);\n google.handleEating(explorer4);\n google.handleEating(explorer5);\n google.handleEating(explorer6);\n google.handleEating(explorer7);\n google.handleEating(explorer8);\n\n\n\n // fire.handleEating(explorer);\n // fire.handleEating(explorer1);\n // fire.handleEating(explorer2);\n // fire.handleEating(explorer3);\n // fire.handleEating(explorer4);\n //fire.handleEating(explorer5);\n // fire.handleEating(explorer6);\n //fire.handleEating(explorer7);\n // fire.handleEating(explorer8);\n\n\n //safari.handleEating(explorer);\n //safari.handleEating(explorer1);\n //safari.handleEating(explorer2);\n // safari.handleEating(explorer3);\n // safari.handleEating(explorer4);\n // safari.handleEating(explorer5);\n // safari.handleEating(explorer6);\n // safari.handleEating(explorer7);\n // safari.handleEating(explorer8);\n\n\n // Display all the \"browswers\"\n google.display();\n explorer.display();\n explorer1.display();\n explorer2.display();\n explorer3.display();\n explorer4.display();\n explorer5.display();\n explorer6.display();\n explorer7.display();\n explorer8.display();\n // fire.display();\n // safari.display();\n\n\n\n\n\n\n gameOverScreen();\n //remove buttons when playing\n button.remove();\n button1.remove();\n\n\n push();\n for (let i = 0; i < decoyFire.length; i++) {\n // ... and update and display it\n\n decoyFire[i].display();\n google.handleEating(decoyFire[i]);\n // fire.handleEating(decoyFire[i]);\n // safari.handleEating(decoyFire[i]);\n pop();\n\n }\n\n }\n}", "title": "" }, { "docid": "2b8562d0528b475a17d26a040274ea0b", "score": "0.7057519", "text": "function draw() {\n displayBackground();\n\n youtubeIntro.display(); // Intro\n\n // Living room + close up\n livingRoom.display();\n livingRoom.switchScene();\n livingRoom.moveAcidTab();\n livingRoom.startTrip();\n livingRoom.changeFurniture();\n livingRoom.simulateCameraTilt();\n\n // Zipper scene\n zipper.zipperTeeth();\n zipper.displayZip();\n zipper.openZip();\n\n // Flower Scene\n flowerScene.setupPetals()\n flowerScene.displayFlower()\n flowerScene.checkDistanceFromPetal()\n flowerScene.changeCursor()\n flowerScene.descendingPetals()\n flowerScene.flowerState()\n flowerScene.sceneDecoration()\n flowerScene.switchScene()\n\n // Matrix scene\n matrix.setup()\n matrix.displayBuildings()\n matrix.movingWords()\n matrix.switchScene()\n\n // Juggling scene\n juggle.setupBalls()\n juggle.displayBrain()\n juggle.displayPaddle()\n juggle.responsibilites()\n juggle.displayIcons()\n juggle.displayHammer()\n\n // Starfield scene\n starfield.setup()\n starfield.displayStarfield()\n starfield.switchScene()\n\n // Falling scene\n falling.moveMan()\n falling.displayMan()\n falling.changingColor()\n falling.displayMovingRing()\n falling.background1()\n falling.displayOpenedMind()\n falling.checkDistanceFromRing()\n falling.displayCompletionBar()\n falling.seaState()\n falling.sensoryOverloadSetup()\n falling.sensoryOverload()\n\n starfield.showManAndCredits()\n\n // console.log(`x${mouseX}`); //25 913\n // console.log(`y${mouseY}`); //78 574\n // console.log(`Scene is ${scene}`); //25 913\n}", "title": "" }, { "docid": "c3a20e899930c75cd096328cd34b63bc", "score": "0.703326", "text": "function draw() {\n background(255);\n ai1.playNext(ai1.isLooping);\n ai1.show();\n board.show();\n\n\n //Endgame\n if (!board.isActive && !gameOver) {\n if(board.won) {\n gameOver = true;\n print(\"WIN!\" + \n \"\\n - Squares mined: \" + board.accesses +\n \"\\n - Correct bombs found: \" + board.correctBombLocations + \"/\" + board.numBombs);\n } else {\n gameOver = true;\n print(\"GAME OVER!\" + \n \"\\n - Squares mined: \" + board.accesses +\n \"\\n - Correct bombs found: \" + board.correctBombLocations + \"/\" + board.numBombs);\n }\n }\n}", "title": "" }, { "docid": "2f2b833735a3627732593beff6b4e747", "score": "0.699368", "text": "function draw() {\n if (gameState == INTRO) intro();\n else if (gameState == RUN_GAME) runGame();\n else if (gameState == GAME_OVER) gameOver();\n}", "title": "" }, { "docid": "fad20f74c3a0e459aa44006857234b89", "score": "0.696496", "text": "function draw() {\n background(200);\n currentScene.draw();\n\n // player.handleInput();\n // // Move all the player\n // player.move();\n // //handling if the key is found\n // key.handleFound(player);\n\n//eventually create a Screen class so that portal and wall arrays belong there\n// e.g. currentScreen = screen1;\n// for(i=0; ...)\n// currentScreen.portalArray[i].handleExit(player);\n// currentScreen.key.handleFound(player);\n// ...\n// }\n\n//the walls\n//handling the solid characteristics of a wall object\n//in relationship to the characters\n// for (let i = 0; i < portalArray.length; i++) {\n// portalArray[i].handleExit(player);\n// portalArray[i].display();\n// }\n//\n// for (let i = 0; i < wallArray.length; i++) {\n// wallArray[i].handleSolid(player);\n// wallArray[i].display();\n// }\n\n key.display();\n\n player.display();\n//can you create a for loop to check\n for (let i = 0; i < portalArray.length; i++) {\n\n if (portalArray[i].state === \"portalState1\") {\n //Shows the game over screen and resets all values to starting values\n displayPortal(i);\n player.reset();\n key.isFound = false;\n }\n }\n}", "title": "" }, { "docid": "05028371d244c09431cc6b45d49f7a5a", "score": "0.69568473", "text": "function draw() {\n delta = deltaTime;\n background(0);\n\n if(alive) {\n canvasTranslation();\n bubble.show();\n }\n else { spectatorMode(); }\n\n applySettings();\n\n foodDraw();\n drawBoundaries();\n}", "title": "" }, { "docid": "d4971add54c1d9527c1f431989804134", "score": "0.69522077", "text": "function draw() {\n // Setup background\n image(background, width / 2, height / 2)\n handleInput();\n if (gameState === \"INTRO\") {\n // Set up the font\n textSize(38);\n textAlign(CENTER, CENTER);\n strokeWeight(3);\n stroke(0);\n fill(200,70,30);\n // Introduce the game\n text('Capture the fleeting rebels!\\n\\nClick the mouse to start', width / 2, height / 2)\n\n } else if (gameState === \"GAME\") {\n\n\n movePlayer();\n movePrey();\n\n checkEating();\n updateHealth();\n\n\n drawPrey();\n drawPlayer();\n } else if (gameState === \"GAMEOVER\") {\n showGameOver();\n setupPrey();\n setupPlayer();\n }\n}", "title": "" }, { "docid": "8a131156888e15374887801f191f8da5", "score": "0.69410706", "text": "function draw() {\n let menu = document.getElementById('menu');\n //Show menu when menuFlag is true\n if(menuFlag === true){\n paint_background();\n menu.style = 'display:block;';\n }else{\n //Update matter engine\n Matter.Engine.update(engine);\n menu.style = 'display:none;'; // Hide menu \n paint_background();\n paint_assets();\n updateScore(); // Update score each refresh cycle\n fuzzBallStopped(); // Check if the fuzzBall has come to a halt\n collision(); // Detect collision\n drawLine(); // Draw a line to aim at the crates\n checkCrates(); // Check if all crates have been destroyed - Win condition\n }\n}", "title": "" }, { "docid": "b5affc4cd62200762c76ef61cf9b2bd1", "score": "0.69307315", "text": "function Draw()\n {\n //clear game board before drawing again\n ctx.clearRect(0, 0, w, h);\n\n //draw player\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(playerX,playerY,20,20);\n\n //draw pointer/gun\n ctx.fillStyle = \"#FF0000\";\n ctx.fillRect(pointerX,pointerY,10,10);\n\n //draw bullets\n for(var i=0;i<bullets.length;i++)\n {\n //if bullet direction is null, dont draw it\n if(bullets[i].direction != \"null\")\n {\n ctx.fillStyle = \"#0000FF\";\n ctx.fillRect(bullets[i].x,bullets[i].y,10,10);\n }\n }\n\n //draw enemies\n for(var i=0;i<bullets.length;i++)\n {\n //if enemy alive is false, dont draw it\n if(enemies[i].alive == true)\n {\n ctx.fillStyle = \"#00FF00\";\n ctx.fillRect(enemies[i].x,enemies[i].y,20,20);\n }\n }\n }", "title": "" }, { "docid": "84c228224e821b8ca06896be005ff549", "score": "0.6927497", "text": "function draw() {\n // run background & check level status\n levelScroll();\n // add character\n character.show();\n character.move();\n // fill array with some randomly generated enemies\n enemyCreator();\n // then send our array of badguys\n for (let i of enemies) {\n // random millisecond value between 2 & 3k\n let rando = Math.floor(Math.random() * (3250 - 2250 + 1) + 2250);\n setTimeout(i.show(), i.move(), rando);\n // if you get hit, lose life. if out of lives, kill loop & playAgain()\n if (character.hits(i)) {\n lives--;\n livesCounter();\n // impact with enemy\n const punch = new Audio('./game/sounds/Sharp-Punch.mp3');\n punch.play();\n i.hide();\n if (lives === 0) {\n noLoop();\n clearInterval(runScore);\n beat.pause();\n const dead = new Audio('./game/sounds/gameover.wav');\n dead.play();\n playAgain();\n }\n }\n }\n}", "title": "" }, { "docid": "802eb7d8398f531e28097e3fc64a058b", "score": "0.6926465", "text": "function draw() {\n // Set the background to be a very poor photoshop-made drawing of the white house\n tint(255, 255);\n image(imgBackground, width / 2, height / 2, 500, 500);\n\n if (!gameOver) {\n handleInput();\n\n movePlayer();\n movePrey();\n moveEnemy();\n\n updateHealth();\n checkEating();\n\n drawPrey();\n drawEnemy();\n drawPlayer();\n\n checkStreak();\n } else {\n showGameOver();\n }\n}", "title": "" }, { "docid": "7acf9631da94834f555cedc7dd201ad2", "score": "0.6923815", "text": "function draw() {\n\tif (screenNumber == 1) {\n\t\tshouldEmitAllowGameStart = allowGameStart !== AudioController.gameStartSoundFinished // should only emit if value is different\n\t\tallowGameStart = AudioController.gameStartSoundFinished\n\t\tif (allowGameStart && shouldEmitAllowGameStart) {\n\t\t\tsocket.emit('allow-game-start')\n\t\t\tshouldEmitAllowGameStart = false // set to false because already emited\n\n\t\t\tif (DEBUG_MODE) {\n\t\t\t\tstartDebugMode()\n\t\t\t}\n\t\t}\n\t}\n\t//clear before redrawing (important to reset transform before drawing)\n\tctx.setTransform(1, 0, 0, 1, 0, 0);\n\tclearCanvas()\n\n\t//draw each block\n\tblocks.forEach(row => {\n\t\trow.forEach(block => {\n\t\t\tif (block) block.draw(ctx);\n\t\t})\n\t});\n\n\tif (!gameOver) {\n\t\t//draw each pacman\n\t\tpacmans.forEach(function (pacman) {\n\t\t\tconst pacmanId = pacman.id\n\n\t\t\tcheckPlayerScreen(pacmanId)\n\t\t\tif (allowGameStart) pacman.updatePosition(players[pacmanId].direction, screenNumber, nScreens, players[pacmanId])\n\t\t\telse pacman.updateFixedPosition(screenNumber, nScreens, players[pacmanId])\n\t\t\tconst pacmanPos = pacman.getRowCol()\n\n\t\t\t// Check collision with default ghosts\n\t\t\tfor (const ghost of defaultGhosts) {\n\t\t\t\tconst ghostPos = ghost.getRowCol()\n\n\t\t\t\t// only collide if position is same and player has moved\n\t\t\t\tif (ghostPos.row == pacmanPos.row && ghostPos.col == pacmanPos.col && ENABLE_GHOST_COLLISION && players[pacmanId].hasMoved) {\n\t\t\t\t\tif (!pacman.isPoweredUp) {\n\t\t\t\t\t\tplayers[pacmanId].direction = DIRECTIONS.STOP\n\t\t\t\t\t\tplayers[pacmanId].screen = players[pacmanId].startScreen\n\t\t\t\t\t\tplayers[pacmanId].currentMap = players[pacmanId].startScreen == 1 ? 'master' : 'slave'\n\t\t\t\t\t\tplayers[pacmanId].x = players[pacmanId].startX\n\t\t\t\t\t\tplayers[pacmanId].y = players[pacmanId].startY\n\t\t\t\t\t\tplayers[pacmanId].lives--\n\t\t\t\t\t\tpacman.x = players[pacmanId].startX\n\t\t\t\t\t\tpacman.y = players[pacmanId].startY\n\t\t\t\t\t\tpacman.shouldUpdate = true\n\t\t\t\t\t\tplayers[pacmanId].hasMoved = false\n\t\t\t\t\t\tsocket.emit('pacman-death', players[pacmanId])\n\t\t\t\t\t\tsocket.emit('play-audio', 'death')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tghost.reset()\n\t\t\t\t\t\tplayers[pacmanId].score += GHOSTEAT_SCORE_VALUE\n\t\t\t\t\t\tsocket.emit('update-players-info', players[pacmanId])\n\t\t\t\t\t\tsocket.emit('play-audio', 'eatGhost')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check collision with player ghosts\n\t\t\tfor (const ghost of ghosts) {\n\t\t\t\tconst ghostId = ghost.id\n\t\t\t\tconst ghostPos = ghost.getRowCol()\n\n\t\t\t\t// only collide if position is same and player has moved\n\t\t\t\tif (ghostPos.row == pacmanPos.row && ghostPos.col == pacmanPos.col && ENABLE_GHOST_COLLISION && players[pacmanId].hasMoved && screenNumber == 1) {\n\t\t\t\t\tif (!pacman.isPoweredUp) {\n\t\t\t\t\t\t// add score for ghost\n\t\t\t\t\t\tplayers[ghostId].score += PACMANEAT_SCORE_VALUE\n\t\t\t\t\t\tsocket.emit('update-players-info', players[ghostId])\n\n\t\t\t\t\t\tplayers[pacmanId].direction = DIRECTIONS.STOP\n\t\t\t\t\t\tplayers[pacmanId].screen = players[pacmanId].startScreen\n\t\t\t\t\t\tplayers[pacmanId].currentMap = players[pacmanId].startScreen == 1 ? 'master' : 'slave'\n\t\t\t\t\t\tplayers[pacmanId].x = players[pacmanId].startX\n\t\t\t\t\t\tplayers[pacmanId].y = players[pacmanId].startY\n\t\t\t\t\t\tpacman.x = players[pacmanId].startX\n\t\t\t\t\t\tpacman.y = players[pacmanId].startY\n\t\t\t\t\t\tplayers[pacmanId].lives--\n\t\t\t\t\t\tpacman.shouldUpdate = true\n\t\t\t\t\t\tplayers[pacmanId].hasMoved = false\n\t\t\t\t\t\tsocket.emit('pacman-death', players[pacmanId])\n\t\t\t\t\t\tsocket.emit('play-audio', 'death')\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//add score to pacman\n\t\t\t\t\t\tplayers[pacmanId].score += GHOSTEAT_SCORE_VALUE\n\t\t\t\t\t\tsocket.emit('update-players-info', players[pacmanId])\n\n\t\t\t\t\t\t// remove score from ghost\n\t\t\t\t\t\tplayers[ghostId].score -= GHOST_DEATH_SCORE_LOSS\n\t\t\t\t\t\tif (players[ghostId].score < 0) players[ghostId].score = 0\n\t\t\t\t\t\tsocket.emit('update-players-info', players[ghostId])\n\n\t\t\t\t\t\t//reset ghost\n\t\t\t\t\t\tplayers[ghostId].direction = DIRECTIONS.STOP\n\t\t\t\t\t\tplayers[ghostId].screen = players[ghostId].startScreen\n\t\t\t\t\t\tplayers[ghostId].x = players[ghostId].startX\n\t\t\t\t\t\tplayers[ghostId].y = players[ghostId].startY\n\t\t\t\t\t\tghost.x = players[ghostId].startX\n\t\t\t\t\t\tghost.y = players[ghostId].startY\n\t\t\t\t\t\tplayers[ghostId].hasMoved = false\n\t\t\t\t\t\tsocket.emit('ghost-death', players[ghostId])\n\n\t\t\t\t\t\t//play sound\n\t\t\t\t\t\tsocket.emit('play-audio', 'eatGhost')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// food/powerpill eating logic\n\t\t\tif (players[pacmanId].currentMap == \"master\" && screenNumber == 1) {\n\t\t\t\tif (currentMap[pacmanPos.row][pacmanPos.col] == ENTITIES.FOOD && !blocks[pacmanPos.row][pacmanPos.col]?.wasEaten) {\n\t\t\t\t\tplayers[pacmanId].score += FOOD_SCORE_VALUE\n\t\t\t\t\tblocks[pacmanPos.row][pacmanPos.col].wasEaten = true; // set food to eaten\n\t\t\t\t\tavailableFoods--\n\t\t\t\t\tif (availableFoods == 0) {\n\t\t\t\t\t\tsocket.emit('set-foods-eaten', screenNumber)\n\t\t\t\t\t}\n\t\t\t\t\tsocket.emit('play-audio', 'munch')\n\t\t\t\t\tsocket.emit('update-players-info', players[pacmanId])\n\t\t\t\t} else if (currentMap[pacmanPos.row][pacmanPos.col] == ENTITIES.POWERPILL && !blocks[pacmanPos.row][pacmanPos.col]?.wasEaten) {\n\t\t\t\t\tplayers[pacmanId].score += POWERPILL_SCORE_VALUE\n\t\t\t\t\tplayers[pacmanId].isPoweredUp = true\n\t\t\t\t\tblocks[pacmanPos.row][pacmanPos.col].wasEaten = true; // set pill to eaten\n\t\t\t\t\tavailableFoods--\n\t\t\t\t\tif (availableFoods == 0) {\n\t\t\t\t\t\tsocket.emit('set-foods-eaten', screenNumber)\n\t\t\t\t\t}\n\t\t\t\t\tsocket.emit('play-audio', 'munch')\n\t\t\t\t\tsocket.emit('update-players-info', players[pacmanId])\n\t\t\t\t\tsocket.emit('set-powerup', { duration: POWERPILL_DURATION, value: true, playerId: pacmanId })\n\t\t\t\t}\n\t\t\t} else if (players[pacmanId].currentMap == \"slave\" && screenNumber !== 1 && players[pacmanId].screen == screenNumber) {\n\t\t\t\tconst playerPos = players[pacmanId].pos\n\t\t\t\t//relative col calculation\n\t\t\t\tlet isRightScreen = players[pacmanId].screen <= (Math.ceil(nScreens / 2));\n\t\t\t\tlet offsetIndex = isRightScreen ? players[pacmanId].screen - 1 : ((nScreens + 1) - players[pacmanId].screen) * -1;\n\t\t\t\tlet realtiveCol = playerPos.col - (offsetIndex * GRID_WIDTH)\n\n\t\t\t\tif (currentMap[playerPos.row][realtiveCol] == ENTITIES.FOOD && !blocks[playerPos.row][realtiveCol]?.wasEaten) {\n\t\t\t\t\tplayers[pacmanId].score += FOOD_SCORE_VALUE\n\t\t\t\t\tblocks[playerPos.row][realtiveCol].wasEaten = true; // set food to eaten\n\t\t\t\t\tavailableFoods--\n\t\t\t\t\tif (availableFoods == 0) {\n\t\t\t\t\t\tsocket.emit('set-foods-eaten', screenNumber)\n\t\t\t\t\t}\n\t\t\t\t\tsocket.emit('play-audio', 'munch')\n\t\t\t\t\tsocket.emit('update-players-info', players[pacmanId])\n\t\t\t\t} else if (currentMap[playerPos.row][realtiveCol] == ENTITIES.POWERPILL && !blocks[playerPos.row][realtiveCol]?.wasEaten) {\n\t\t\t\t\tplayers[pacmanId].score += POWERPILL_SCORE_VALUE\n\t\t\t\t\tplayers[pacmanId].isPoweredUp = true\n\t\t\t\t\tblocks[playerPos.row][realtiveCol].wasEaten = true; // set pill to eaten\n\t\t\t\t\tavailableFoods--\n\t\t\t\t\tif (availableFoods == 0) {\n\t\t\t\t\t\tsocket.emit('set-foods-eaten', screenNumber)\n\t\t\t\t\t}\n\t\t\t\t\tsocket.emit('play-audio', 'munch')\n\t\t\t\t\tsocket.emit('update-players-info', players[pacmanId])\n\t\t\t\t\tsocket.emit('set-powerup', { duration: POWERPILL_DURATION, value: true, playerId: pacmanId })\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// emit player position to all screens\n\t\t\tif (screenNumber == 1 && pacman.shouldUpdate) {\n\t\t\t\tplayers[pacmanId].x = pacman.x\n\t\t\t\tplayers[pacmanId].y = pacman.y\n\t\t\t\tplayers[pacmanId].pos = pacman.getRowCol()\n\t\t\t\tsocket.emit('update-players-info', players[pacmanId])\n\t\t\t\tpacman.shouldUpdate = false\n\t\t\t}\n\t\t\tpacman.draw(ctx);\n\t\t});\n\n\t\t//draw player ghosts\n\t\tghosts.forEach(function (ghost) {\n\t\t\tconst ghostId = ghost.id\n\n\t\t\tcheckPlayerScreen(ghostId)\n\t\t\tif (allowGameStart) ghost.updatePosition(players[ghostId].direction, screenNumber, nScreens, players[ghostId])\n\t\t\telse ghost.updateFixedPosition(screenNumber, nScreens, players[ghostId])\n\n\t\t\t// emit player position to all screens\n\t\t\tif (screenNumber == 1 && ghost.shouldUpdate) {\n\t\t\t\tplayers[ghostId].x = ghost.x\n\t\t\t\tplayers[ghostId].y = ghost.y\n\t\t\t\tplayers[ghostId].pos = ghost.getRowCol()\n\t\t\t\tsocket.emit('update-players-info', players[ghostId])\n\t\t\t\tghost.shouldUpdate = false\n\t\t\t}\n\t\t\tghost.draw(ctx)\n\t\t})\n\n\t\t//draw default ghosts\n\t\tdefaultGhosts.forEach(function (ghost) {\n\t\t\tconst keys = Object.keys(players)\n\t\t\t// mirror first players movemnt\n\t\t\tif (allowGameStart && keys.length) ghost.updateAiPosition(players[keys[0]].direction, currentMap)\n\t\t\tghost.draw(ctx)\n\t\t})\n\t}\n\n\tif (SHOW_STATUS) stats.update();\n\n\tif (!DEBUG_MODE || !allowGameStart) {\n\t\trequestAnimationFrame(draw)\n\t}\n}", "title": "" }, { "docid": "5ccfbc07f92ae7ee3a56a0fc69375db6", "score": "0.692331", "text": "function draw() {\n\n if (state === \"Menu\") {\n //the menu image only for the menu\n image(menuImg, 0, 0, width, height);\n }\n if (state === \"Narrative\") {\n image(narrativeImg, 0, 0, width, height);\n }\n if (state === \"Forest\") {\n image(forestImg, 0, 0, sceneWidth, sceneHeight);\n //the camera follwing the player in p5.Play\n if (player.x > camXMin && player.x < camXMax) {\n camera.position.x = player.x;\n }\n if (player.y > camYMin && player.y < camYMax) {\n camera.position.y = player.y;\n }\n\n //the dungeon entry\n dungeonEntry.handleExit(player);\n\n //handling if the key is found\n dungeonKey.handleFound(player);\n\n // Handle input for the orc\n player.handleInput();\n\n // Move the player\n player.move();\n\n //checking the projectiles\n checkProjectiles();\n\n //the necromancers\n for (let i = 0; i < necroArray.length; i++) {\n necroArray[i].shoot();\n necroArray[i].display();\n }\n //the trees as walls\n //handling the solid characteristics of a wall object\n //in relationship to the characters\n for (let i = 0; i < objectsArray.length; i++) {\n objectsArray[i].handleSolid(player);\n objectsArray[i].display();\n }\n\n //drawSprites(forestImg);\n\n dungeonEntry.display();\n dungeonKey.display();\n player.display();\n player.healthBar();\n player.magicBar();\n\n }\n if (state === \"Dungeon\") {\n //putting the dungeon backgound under everything on the canvas\n image(backgroundImg, 0, 0, width, height);\n // Handle input for the orc\n player.handleInput();\n\n // Move all the player\n player.move();\n\n //handles if the player drinks the potion\n potion.handleFound(player);\n potion2.handleFound(player);\n\n //handling if the key is found\n key.handleFound(player);\n\n //handling the exit of the player\n door.handleExit(player);\n\n // Display all the objects\n potion.display();\n potion2.display();\n door.display();\n key.display();\n //checking the projectiles and part of their collisions\n checkProjectiles();\n\n //the walls\n //handling the solid characteristics of a wall object\n //in relationship to the characters\n for (let i = 0; i < wallArray.length; i++) {\n wallArray[i].handleSolid(player);\n for (let j = 0; j < orcArray.length; j++) {\n wallArray[i].handleSolid(orcArray[j]);\n }\n wallArray[i].display();\n }\n //the orcs\n // Handle the orc eating any of the Player and moves and displays\n for (let i = 0; i < orcArray.length; i++) {\n orcArray[i].move();\n orcArray[i].handleEating(player);\n orcArray[i].display();\n }\n player.display();\n player.healthBar();\n player.magicBar();\n } else if (state === \"GameOver\") {\n //Shows the game over screen and resets all values to starting values\n image(overImg, 0, 0, width, height);\n player.reset();\n key.isFound = false;\n\n }\n}", "title": "" }, { "docid": "1f54204a5044688f5eb1c51cabaab0c9", "score": "0.6920792", "text": "function draw() {\n\n if (alive === true) {\n // Refresh the black background\n background(0);\n\n // Update the player\n updatePlayer();\n\n // Draw the player\n displayPlayer();\n\n // Draw the food\n displayFood();\n\n // Check eating\n checkEating();\n}\nelse if (alive === false){\n push();\n fill(255);\n text(\"GAME OVER\", 250, 250)\n pop(); \n}\n}", "title": "" }, { "docid": "a4ac95937c8a4f73fd676fa4447e9d8d", "score": "0.69170046", "text": "function draw() {\n background(0);\n\n// Intro\nif (state === `intro`){\n textIntro();\n}\n//\n\n// Level\nelse if (state === `level`){\n\n // Mic Input Lifts Creatures\n let level = mic.getLevel();\n let liftAmount = map(level, 0, 1, - 1, -15);\n\n // Winged Creatures\n for(let i = 0; i < creatures.length; i ++){\n let creature = creatures[i];\n if (creature.active){\n creature.move();\n creature.lift(liftAmount);\n creature.constraining();\n creature.gravity(gravityForce);\n creature.display();\n creature.checkImpact();\n }\n }\n\n orangeLine();\n\n delimitingWalls(); // white\n\n // Flickering White and Black Buttons\n crypticButtons();\n\n // Display Tips Table - User can open/close table containing cues, if necessary\n tips();\n\n // Check which Keys User is typing\n checkInputProgress();\n\n // Check if any of the Creatures fall below Orange Line\n checkFail();\n\n }\n//\n\n// Pass - User fails to guess the word in time\nelse if (state === `pass`){\n textPass();\n}\n//\n\n// Success - User guesses Word and Achives Item\nelse if (state === `success`){\n textSuccess();\n}\n//\n\n}", "title": "" }, { "docid": "08f194db0a856e43833e3995f0675327", "score": "0.6904797", "text": "function Update()\n {\n EnemySpawner();\n UpdatePlayerPos();\n CheckOutOfBounds();\n CheckCollision();\n Draw();\n }", "title": "" }, { "docid": "ab66be173934268b8e4a1f11d4ff7994", "score": "0.6892912", "text": "function drawScreen() {\r\n drawBackground();\r\n drawScores();\r\n drawCenterLine();\r\n drawBall();\r\n drawPaddles();\r\n if ((players === 0) && (gameStatus === 'menu')) {\r\n drawMainScreen();\r\n }\r\n }", "title": "" }, { "docid": "8d1e00fdb62aacf287712a78bdba4b2c", "score": "0.6891487", "text": "draw() {\n\n // Draw em all.\n allSprites.draw();\n this.displayScore();\n\n // Collision detection\n this.PlayerBullets.collide(this.Enemies, this.enemyHit.bind(this));\n this.Enemies.collide(this.Player, this.playerHit.bind(this));\n this.EnemyBullets.collide(this.Player, this.playerHit.bind(this));\n\n // Enemies should be generated at an 80 frame interval to avoid overlapping\n if (this.FrameCount > 80) {\n this.generateEnemies();\n this.FrameCount = 0;\n }\n\n // Shooter enemies cant independantly decide when to shoot, so it must be iterrated in the draw function.\n for (let enemy of this.Enemies) {\n if (enemy.type == \"shooterEnemy\" && random(200) <= 1) this.EnemyBullets.add(this.enemyBullet(enemy.position));\n\n // also fast enemies need to know who to displace\n if (enemy.type == \"fastEnemy\") enemy.displace(this.Enemies);\n }\n\n // This is used to prevent loose frame calls after state change\n if (this.FrameCount > 5) {\n\n if (this.Btn_backToMenu == undefined) {\n this.Btn_backToMenu = createButton(\"Back to menu\");\n this.Btn_backToMenu.position(this.CanvasX / 1.5, 30);\n this.Btn_backToMenu.mousePressed(this.backToMenu.bind(this));\n }\n\n // Music is played here to avoid issue of music continually playing when the game state is not active.\n if (this.Sound_Music.isPlaying() == false) this.Sound_Music.play();\n }\n\n this.FrameCount++;\n }", "title": "" }, { "docid": "ed356936fdb9c01ed1ab0383d56defd1", "score": "0.68464607", "text": "draw(){\n\t\tvar context = this.canvas.getContext('2d');\n\t\tcontext.setTransform(1,0,0,1,0,0); // remove all scaling\n\t\tcontext.clearRect(0, 0, this.width, this.height); // erase everything in the window\n\n\t\t// // display health in the upper left corner\n\t\t// context.font = \"22px Verdana\";\n\t\t// if (this.player.health > 0){\n\t\t// \tcontext.fillStyle ='rgba(0,0,255,1)';\n\t\t// } else{\n\t\t// \tcontext.fillStyle ='rgba(255,0,0,1)';\n\t\t// }\n\t\t// context.fillText(\"Health: \" + Math.max(0, this.player.health), 0, 20);\n\n\t\t// // display bullets in the upper left corner\n\t\t// if (this.player.bullets > 0){\n\t\t// \tcontext.fillStyle ='rgba(0,0,255,1)';\n\t\t// } else{\n\t\t// \tcontext.fillStyle ='rgba(255,0,0,1)';\n\t\t// }\n\t\t// context.fillText(\"Bullets: \" + Math.max(this.player.bullets, 0), 0, 40);\n\n\t\t// // display score and enemies number in the upper left corner\n\t\t// context.fillStyle ='rgba(0,0,255,1)';\n\t\t// context.fillText(\"Enemies: \" + this.enemies_number, 0, 60);\n\t\t// context.fillText(\"Score: \" + this.score, 0, 80);\n\t\t// context.fillText(\"Goal: \" + this.target, 0, 100);\n\n\t\t// // display how long until the next enemy will be created\n\t\t// context.fillText(\"New Enemy Coming In: \" + this.enemy_refresh_rate_left / 10 + \"s/\" + this.enemy_refresh_rate / 10 + \"s\", 320, 20);\n\n\t\t// // display the game result if game has ended\n\t\t// if (false){\n\t\t// \tcontext.font = \"128px Courier New oblique bolder\";\n\t\t// \tif (this.won){\n\t\t// \t\tcontext.fillStyle ='rgba(78, 161, 11,1)';\n\t\t// \t\tcontext.fillText(\"You Won!!!\", 0, 320);\n\t\t// \t} else{\n\t\t// \t\tcontext.fillStyle ='rgba(255,0,0,1)';\n\t\t// \t\tcontext.fillText(\"You Lost!!!\", 0, 320);\n\t\t// \t}\n\t\t// \tcontext.font = \"22px Verdana\";\n\t\t// \tcontext.fillText(\"move the mouse, click the mouse or press any key to continue\", 0, 440);\n\t\t// }\n\n\t\t// draw crosshair\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(this.mouseX-16, this.mouseY);\n\t\tcontext.lineTo(this.mouseX+16, this.mouseY);\n\t\tcontext.stroke();\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(this.mouseX, this.mouseY - 16);\n\t\tcontext.lineTo(this.mouseX, this.mouseY + 16);\n\t\tcontext.stroke();\n\n\t\tvar this_player_x = this.width / 2;\n\t\tvar this_player_y = this.height / 2;\n\n\t\tif (this.square_id in this.squares){\n\t\t\tthis_player_x = this.squares[this.square_id].x;\n\t\t\tthis_player_y = this.squares[this.square_id].y;\n\t\t}\n\n\t\t// make the world move\n\t\tcontext.translate(-this_player_x + this.canvas.width / 2, -this_player_y + this.canvas.height / 2);\n\n\t\t// draw all the squares of the game (play, enemy, bullet, box, ...)\n\t\tfor(let playerid in this.squares){\n\t\t\tthis.drawSquare(context, this.squares[playerid]);\n\t\t}\n\n\t\t// draw the border\n\t\tcontext.strokeStyle = \"blue\";\n\t\tcontext.beginPath();\n\t\tcontext.rect(0, 0, this.width,this.height);\n\t\tcontext.stroke();\n\t}", "title": "" }, { "docid": "cf47b6217845bbf0cf83b34dcf0567fd", "score": "0.6832554", "text": "function render()\n{\n switch (gs.state)\n {\n case 0: // Title\n // Clear the screen\n gs.ctx.clearRect(0, 0, gs.canvas.width, gs.canvas.height);\n gs.offctx.clearRect(0, 0, gs.canvas.width, gs.canvas.height);\n\n gs.hudctx.save();\n gs.hudctx.clearRect(0, 0, gs.canvas.width, gs.canvas.height);\n shadowwrite(gs.hudctx, 200, 20, \"Coding Go f\", 20, \"rgba(255,255,255,0.9)\");\n shadowwrite(gs.hudctx, 400, 200, \"Broken Links\", 10, \"rgba(255,255,0,0.9)\");\n shadowwrite(gs.hudctx, 250, 650, \"Press Space/Enter/Mouse to play\", 6, \"rgba(255,255,0,\"+(((gs.lasttime%1200))/1200).toFixed(2)+\")\");\n\n gs.hudctx.fillStyle=\"rgb(255,255,255)\";\n gs.hudctx.strokeStyle=\"rgb(255,255,255)\";\n gs.hudctx.lineCap=\"square\";\n gs.hudctx.lineWidth=15;\n\n var holex=960;\n var holey=155;\n\n gs.hudctx.beginPath();\n gs.hudctx.moveTo(holex, holey);\n gs.hudctx.lineTo(holex, holey-110);\n gs.hudctx.stroke();\n\n gs.hudctx.fillStyle=\"rgb(255,0,0)\";\n gs.hudctx.strokeStyle=\"rgb(255,0,0)\";\n gs.hudctx.beginPath();\n gs.hudctx.moveTo(holex+7, holey-90);\n gs.hudctx.lineTo(holex+24, holey-97.5);\n gs.hudctx.lineTo(holex+7, holey-105);\n gs.hudctx.closePath();\n gs.hudctx.fill();\n gs.hudctx.stroke();\n gs.hudctx.restore();\n break;\n\n case 1: // In game\n case 2: // Completed\n // Clear the screen\n gs.ctx.clearRect(0, 0, gs.canvas.width, gs.canvas.height);\n\n // Draw the ball shadow\n gs.ctx.save();\n gs.ctx.fillStyle=\"rgba(0,0,0,0.2)\";\n gs.ctx.strokeStyle=\"rgba(0,0,0,0.2)\";\n gs.ctx.beginPath();\n gs.ctx.arc(Math.floor(gs.ballabove.x)+10+((1-(gs.ballside.y/ymax))*20), Math.floor(gs.ballabove.y)+10+((1-(gs.ballside.y/ymax))*20), 10, 0, 2*Math.PI);\n gs.ctx.fill();\n gs.ctx.restore();\n\n // Draw the ball\n gs.ctx.beginPath();\n gs.ctx.arc(Math.floor(gs.ballabove.x), Math.floor(gs.ballabove.y), 10+((1-(gs.ballside.y/ymax))*20), 0, 2*Math.PI);\n gs.ctx.fill();\n\n gs.hudctx.clearRect(0, 0, gs.hudcanvas.width, gs.hudcanvas.height);\n\n if (gs.showscoreboard)\n {\n scoreboard();\n }\n else\n {\n shadowwrite(gs.hudctx, 520, 10, \"Hole \"+gs.hole, 10, \"rgba(255,255,0,0.9)\");\n\n if (!ballmoving())\n showheading();\n\n if (gs.swingstage>0)\n swingmeter();\n\n windmeter();\n\n showinfobox();\n }\n break;\n\n default:\n gs.state=0;\n break;\n }\n\n}", "title": "" }, { "docid": "9c5e1e23a29fdbb544ea0a679ad0f559", "score": "0.6825417", "text": "function paint()\n\t{\n\t\tif(screen == 1){\n\t\tctx.fillStyle = 'white';\n\t\tctx.fillRect(0,0,w,h);\n\t\t\n\t\tctx.fillStyle='black';\n\t\tctx.fillText(\"SPACE INVADERS\", w/2 - 80, 100)\n\n\t\tctx.fillRect(startx, starty, startw, starth);\n\t\tctx.fillStyle='white'\n\t\tctx.fillRect(w/2 - 85, 254, 139, 67);\n\t\tctx.fillStyle='black'\n\t\tctx.font='12pt arial';\n\t\tctx.fillText(\"PRESS TO PLAY\", w/2 - 80, 290, 139, 67)\n\t\tctx.fillText(\"Every Enemy is worth 100 points\", 150, 430);\n\t\tctx.fillText(\"Move using the arrow keys, and press SPACE to fire\", 150, 450);\n\n\t\t\n\n}\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(screen == 2){\n\t\tctx.fillStyle = 'black';\n\t\tctx.fillRect(0,0, w, h);\t\n\t\t\n\t\tctx.font='12pt arial';\n\t\tctx.fillStyle='white';\n\t\tctx.fillText(\"Score: \"+ score, 400, 20);\n\t\tctx.fillText(getRandomInt() , 50, 50);\n\t\tctx.fillText(Enemyy.length -1, 50, 100);\n\n\n//the actual line to draw the aliens\n\t\t\tfor(var i = 0; i < Enemyx.length; i++){\n\t\t\t\tctx.drawImage(Alien1, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t\tctx.drawImage(Alien1, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t\tctx.drawImage(Alien2, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t\tctx.drawImage(Alien3, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t}\n\t\t\n\n\t\n\tLaser();\n\tStage();\n\n\n\n\n//the aliens move slowly if you remove the for loop\t\n\tfor (var i = 0; i < 10; i ++){\n\n\t\t/*ctx.drawImage(Alien3, Enemyx[0] + 40 *i, Enemyy[0] , 30, 30);\n\t\n\t\tctx.drawImage(Alien2, Enemyx[0] + 40 *i, Enemyy[1] , 30, 30);\n\t\t\n\t\tctx.drawImage(Alien1,Enemyx[0] + 40 *i, Enemyy[2] , 30, 30);\n\t\t\n\t\tctx.drawImage(Alien1,Enemyx[0] + 40 *i, Enemyy[3] , 30, 30);\n\t\t\n\t\t\n\t\t//First row of aliens\n\t\tctx.drawImage(Alien3, Enemyx[0], Enemyy[0], 50, 50);\n\t\tctx.drawImage(Alien3, Enemyx[1], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[2], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[3], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[4], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[5], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[6], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[7], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[8], Enemyy[0], 30, 30);\n\t\tctx.drawImage(Alien3, Enemyx[9], Enemyy[0], 30, 30);\n\t\t\n\t\t//Second row of aliens\n\t\tctx.drawImage(Alien2, Enemyx[1], Enemyy[1], 30, 30);\n\t\t\n\t\t//Second bottom row of aliens\n\t\tctx.drawImage(Alien1, Enemyx[1], Enemyy[2], 30, 30);\n\t\t\n\t\t//Bottom row of aliens\n\t\tctx.drawImage(Alien1, Enemyx[1], Enemyy[3], 30, 30);\n\t\t\n\t\t*/\n\t\t\n\t\t\n\n\n\n\t//calling the functions to work in the paint\n\t//cant use the laser here because then it produces a giant line of lasers. maybe a power up\n\t\tPathing();\n\t\tHit();\n\t\t\n\t\t\n\n\t\t\n\n\t\t\n\t\t\n/*\n\t\n*/\n\t}\n\t\tctx.fillStyle = 'green';\n\t\tctx.fillRect(playerx, 460, 75, 20);\n\t\tctx.fillRect(playerx + 32.5, 442, 10, 50);\n\t\t\n\t}\n\t\t\n\n\t\t//a more fast paced high pressure minigame\n\t\t/*if(shoot == true){\nscreen = 4;\n}\n\tif(screen == 4){\n\tctx.fillStyle='red';\n\tctx.fillRect(0,0,w,h);\n\n\t\n\tfor(var i = 0; i < Enemyx.length; i++){\n\t\t\t\tctx.drawImage(Alien1, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t\tctx.drawImage(Alien1, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t\tctx.drawImage(Alien2, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t\tctx.drawImage(Alien3, Enemyx[i] , Enemyy[i], 30, 30);\n\t\t\t}\n\t\n\tPathing();\nHit();\nMinigame();\nLaser();\n\n\t\tctx.fillStyle = 'green';\n\t\tctx.fillRect(playerx, 460, 75, 20);\n\t\tctx.fillRect(playerx + 32.5, 442, 10, 50);\n\n}\t*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tspeeds += 5;\n\t\t\n\t}", "title": "" }, { "docid": "981838de74f0377d639c7a8d1cfb1adc", "score": "0.68236005", "text": "function draw() {\n background(backgroundFill,0,0);\n drawBackground(); // **new**\n\n if (!gameOver) {\n handleInput();\n\n movePlayer();\n movePrey();\n\n updateHealth();\n checkEating();\n\n drawPrey();\n drawPlayer();\n drawMedicineText(); // **new**\n }\n else {\n showGameOver();\n }\n}", "title": "" }, { "docid": "33b3e7aabf30c54d11f54cec1e5765be", "score": "0.6812232", "text": "function draw() {\n\n // Clear the background to black\n background(bgimg);\n // Handle input for the tiger\n tiger.handleInput();\n\n // Controls for Cat aka player TWOOOO\n cat.handleInput();\n // Move all the \"animals\"\n tiger.move();\n cat.move();\n antelope.move();\n zebra.move();\n bee.move();\n\n // Handle the tiger eating any of the prey\n tiger.handleEating(antelope);\n tiger.handleEating(zebra);\n tiger.handleEating(bee);\n\n //handle the cat eating any of the prey\n cat.handleEating(antelope);\n cat.handleEating(zebra);\n cat.handleEating(bee);\n\n // Display all the \"animals\"\n tiger.display();\n cat.display();\n antelope.display();\n zebra.display();\n bee.display();\n\n //instructions for how to win\n fill(0);\n textSize(20);\n text(\"Team up, catch and devourer up to 5 prey to win!\", windowWidth/2-200, windowHeight/2-200);\n\n //score tracker for if either predator eats 5 prey\n if (eaten >= 5) {\n background(200,200,140);\n fill(255);\n textSize(20);\n text(\"You have eaten them all!\", windowWidth/2, windowHeight/2);\n\n }\n}", "title": "" }, { "docid": "6feaca4d51ede50c523d94fcaa91d623", "score": "0.6802832", "text": "function draw () {\n\t// body...\n\tif (game.gamestate == \"logo\") {\n\t\tbackground(30);\n\n\t\tgame._logos.update();\n\t\tgame._logos.draw();\n\n\t}else if (game.gamestate == \"startmenu\") {\n\t\tbackground(50);\n\n\t\t// display text\n\t\tpush();\n\t\tnoStroke();\n\t\tfill(100);\n\t\ttextAlign(CENTER);\n\t\ttextFont(\"Georgia\");\n\t\ttextSize(80);\n\t\ttext(\"Blocks!\", width/2, height/4);\n\t\ttextSize(40);\n\t\ttext('Click to start', width/2, height/2);\n\t\ttextSize(12);\n\t\ttext(VERSION, width*0.9, height*0.95);\n\t\tpop();\n\t}else if (game.gamestate == \"pregame\"){\n\t\tbackground(30);\n\t\tif (player.gender == 'male') {\n\t\t\tplayer.color_b = 40;\n\t\t\tplayer.color_s = 60;\n\t\t}else {\n\t\t\tplayer.color_b = 80;\n\t\t\tplayer.color_s = 70;\n\t\t}\n\t\t// display text\n\t\tpush();\n\t\tnoStroke();\n\t\tfill(100);\n\t\ttextAlign(CENTER);\n\t\ttextFont(\"Georgia\");\n\t\ttextSize(40);\n\t\ttext(\"Create you!\", width/2, height*0.2);\n\t\ttextSize(25);\n\t\tfill(200);\n\t\ttext(player.gender, width*0.75, height*0.35);\n\t\ttext(player.color_h, width*0.75, height*0.50);\n\t\tcolorMode(HSB, 360, 100, 100);\n\t\trectMode(CENTER);\n\t\tfill(player.color_h, player.color_s, player.color_b);\n\t\trect(width/2, height/2, 100, 200);\n\t\tcolorMode(RGB, 255);\n\t\tpop();\n\n\t\twindows.update();\n\t\twindows.draw();\n\n\t\t\n\t}else if (game.gamestate == \"game\"){\n\t\t// background(90);\n\t\tdraw_q = [];\n\n\t\t// update\n\t\tgame.update();\n\t\tplayer.update();\n\t\twindows.update();\n\t\tcamera.update(player);\n\n\t\t// blit all entities\n\t\tfor (var i = entities.length - 1; i >= 0; i--) {\n\t\t\tvar e = entities[i];\n\t\t\tif(collideRectCircle(camera.x-width/2,camera.y-height/2,width,height,e.x,e.y,300)){\n\t\t\t\te.update();\n\t\t\t\tblit(e,e.y);\n\t\t\t}else if (player.party_members.indexOf(e) != -1) e.update();\n\t\t}\n\t\tblit(player,player.y);\n\n\t\t// draw\n\t\tterrain.draw();//draws background\n\t\tpush();\n\t\ttranslate(width/2-camera.x, height/2-camera.y);\n\t\tdraw_blitz();\n\t\tpop();\n\t\tterrain.fog.draw(player, camera);\n\t\twindows.draw();\n\t\t\n\t\tif(terrain._debug)terrain.draw_debug();\n\t\tif(player._debug)player.draw_debug();\n\t\tif(game.debug_mode)game.draw_debug();\n\t}\n}", "title": "" }, { "docid": "c46a0812493e83ad8c586d352c9d250b", "score": "0.6800906", "text": "function draw() {\n // Updates game logic and statistics\n initialPageLoading();\n updateGameState();\n backgroundParallax();\n checkConcurrentSheeps();\n displayDodges();\n displayLives();\n displaySaved();\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n resetVelocity();\n handleInputs();\n\n // Moves the lastly spawned sheep\n sheepVX = sheepSpeed;\n testSheep1.translateSheep(sheepX += 10 * sheepVX);\n testSheep1.displaySheep(sheepAvatar, sheepX, sheepSize, sheepSize);\n testSheep1.displayRandomName(sheepX, sheepY);\n testSheep1.displayHistory();\n\n // Updates the player's status\n checkSheepCollision();\n checkIfAvatarLeftScreen();\n checkDodged();\n\n // Moves the avatar according to its calculated velocity\n MoveAvatar();\n displayShamefulText();\n //image(shepherdAvatar, mouseX += badShepherdVX, mouseY += badShepherdVY, badShepherdSize, badShepherdSize);\n}", "title": "" }, { "docid": "3398f68988e8e8289d8935e6bed689ed", "score": "0.6796612", "text": "function draw(){\n\n\t//checks if the game is runing, and if so draws the player and the ball\n\tif(lose != true){\n\t\tbackground(205, 120, 180);\n\t\tif( (mouseY > userSize) || (mouseY< windowHeight-userSize) ){ \n\t\t\trect(5, mouseY, 1, userSize);\n\t\t}else if((mouseY > userSize)){\n\t\t\trect(5, (userSize), 1, userSize);\n\t\t}else if ((mouseY < windowHeight-userSize)) {\n\t\t\trect(5, (windowHeight-userSize), 1, userSize);\n\t\t}else{\n\t\t\tprint(Error)\n\t\t}\n\t\tenemyX += direction;\n\t\tenemyY += angle;\n\t\timage(enemyPic, enemyX, enemyY, enemySize, enemySize)\n\t\trect(windowWidth-5, enemyY, 2, userSize);\n\t}else{\n\t\timage(game_over, (windowWidth/2), (windowHeight/2), windowWidth, windowHeight);\n\t}\n\n\t//checks if the ball is still in bounds and if it needs to bounce\n\tif( (enemyX <= enemySize/2) && ( (enemyY >= mouseY-userSize) && (enemyY <= mouseY+userSize) ) ){ //checks if it hits user (if it does not use (ellipseY <= 50) then it alwas runs)\n\t\tdirection = 10;\n\t}else if(enemyX > windowWidth-enemySize){ //check if it hits other wall\n\t\tdirection = -10;\n\t}else if( (enemyY > windowHeight-enemySize)||(enemyY < 0+enemySize) ){ //check if it hits the top or botom\n\t\tangle *= -1;\n\t}else if( (enemyX < 0) || (enemyY < 0) ){ //checks if user missed\n\t\tprint(\"YOU LOSE\");\n\t\tlose = true\n\t}\n}", "title": "" }, { "docid": "236dd32f15b8d7100a237015685db7b9", "score": "0.6794704", "text": "function draw() {\n // Update\n world.update();\n player.update();\n for (let i = enemies.length - 1; i >= 0; i--) {\n enemies[i].update();\n if (enemies[i].destroyed) {\n score += 30;\n enemies.splice(i, 1);\n } else if (enemies[i].x < - 40) {\n enemies.splice(i, 1);\n } else if (enemies[i].crashed) {\n GAMEOVER = true;\n }\n }\n for (let i = meteors.length - 1; i >= 0; i--) {\n meteors[i].update();\n if (meteors[i].x < 0 - meteors[i].size) {\n meteors.push(new Meteor(width + random(180, 350), random(height / 4, 3 * height / 4), random(60, 160), world));\n meteors.splice(i, 1);\n }\n }\n // spawn a new enemy every 40 frames\n enemySpawnCD--;\n if (enemySpawnCD <= 0) {\n enemySpawnCD = 50;\n enemies.push(new Enemy(width - 30, random(height / 4, 3 * height / 4), world));\n }\n\n // gain score over time\n timeScore++;\n if (timeScore % 60)\n score++;\n\n // Render\n world.render();\n player.render();\n for (let i = meteors.length - 1; i >= 0; i--) {\n meteors[i].render();\n }\n for (let i = 0; i < enemies.length; i++) {\n enemies[i].render();\n }\n\n fill(255);\n textAlign(LEFT);\n textSize(40);\n strokeWeight(2);\n text(\"Score: \" + score, 30, height - 40);\n\n if (GAMEOVER) {\n gameOver();\n noLoop();\n }\n}", "title": "" }, { "docid": "fd623bfb4b518de5dd50f55e1fadbfe3", "score": "0.67921203", "text": "function draw() {\n\n\n if (state === `beginning`) {\n intro();\n\n } else if (state === `simulation`) {\n simulation();\n } else if (state === `selflove`) {\n selflove();\n sadness();\n }\n\n}", "title": "" }, { "docid": "ee2365966f0c51fb7a47e9ebf871c18c", "score": "0.6787752", "text": "function draw() {\n background(94, 50, 186);\n\n if (state === `simulation`) {\n simulation();\n } else if (state === `win`) {\n youWon();\n } else if (state === `lost`) {\n youLost();\n }\n}", "title": "" }, { "docid": "71717a0b5221c02df516a192040a94d2", "score": "0.6781892", "text": "function draw() {\n // console.log(\"Drawing...\");\n ctx.clearRect(0,0, canvas.width, canvas.height);\n keyPadControls();\n progressBar(screenCount);\n lamp.draw();\n fox.draw();\n\n\n //Starting screen\n if (screenCount === 0) {\n var openingBox = new DialogueBox(400,50,800,100);\n if (screenCount === 0 && fox.x<1600 && fox.x>700) {\n openingBox.display('Where are you off to at this time of night?',400,65);\n } else if (screenCount === 0 && fox.x<700 && fox.x>100) {\n openingBox.display(\"Good evening, Fox... It's getting late.\",400,65);\n }\n }\n if (screenCount === 1) {\n owlFlying.draw(owlFlyingImage);\n owlFlying.x += owlFlying.vx;\n owlFlying.y += owlFlying.vy;\n };\n\n if (screenCount === 1) {\n var oneBox = new DialogueBox(400,50,800,100);\n if (screenCount === 1 && fox.x<1600 && fox.x>700) {\n oneBox.display(\"But then... this isn't really a regular night, is it?\" ,400,65);\n } else if (screenCount === 1 && fox.x<700 && fox.x>100) {\n oneBox.display(\"This isn't even your regular neighbourhood.\",400,65);\n }\n }\n\n if (screenCount === 2) {\n mouse.draw(mouseImage);\n collisionCheck(mouse, 220, 170);\n if ((hasCollided === true) && (screenCount === 2)) {\n mouseChat();\n shouldDraw = false;\n }\n };\n\n if (screenCount === 3) {\n var thirdBox = new DialogueBox(400,50,800,100);\n if (fox.x<600 && fox.x>100) {\n thirdBox.display(\"Now, what could that be up ahead?\",400,65);\n };\n trash.draw(trashImage);\n fixedObstacleShift(trash);\n staticCollision(trash,230,170);\n if ((hasCollided === true) && (screenCount === 3)) {\n trashChat();\n shouldDraw = false;\n }\n };\n\n if (screenCount === 4) {\n owlFlying.draw(owlFlyingImage);\n owlFlying.x += owlFlying.vx;\n owlFlying.y += owlFlying.vy;\n var fourBox = new DialogueBox(400,50,800,100);\n if (screenCount === 4 && fox.x<1400 && fox.x>700) {\n fourBox.display(\"It's looking awfully lonely out here.\",400,65);\n } else if (screenCount === 4 && fox.x<550 && fox.x>100) {\n fourBox.display(\"By the way, where are all your friends tonight, Fox?\",400,65);\n };\n };\n\n if (screenCount === 5) {\n puddle.draw(puddleImage);\n fixedObstacleShift(puddle);\n staticCollision(puddle,220, 170);\n if ((hasCollided === true) && (screenCount === 5)) {\n puddleChat();\n shouldDraw = false;\n }\n };\n\n if (screenCount === 6) {\n owl.draw(owlImage);\n fixedObstacleShift(owl);\n staticCollision(owl, 220, 170);\n if ((hasCollided === true) && (screenCount === 6)) {\n owlChat();\n shouldDraw = false;\n }\n };\n\n if (screenCount === 7) {\n dog.draw(dogImage);\n collisionCheck(dog, 220, 170);\n if ((hasCollided === true) && (screenCount === 7)) {\n dogChat();\n shouldDraw = false;\n }\n };\n \n if (screenCount === 8) {\n cat.draw(catImage);\n var eightBox = new DialogueBox(400,50,800,100);\n if (fox.x<600 && fox.x>100) {\n eightBox.display(\"Finally, a familiar face...I think. Look familiar to you?\",400,65);\n };\n staticCollision(cat, 350, 170);\n if ((hasCollided === true) && (screenCount === 8)) {\n catChat();\n shouldDraw = false;\n }\n };\n\n if (screenCount === 9) {\n var nineBox = new DialogueBox(400,50,800,100);\n if (screenCount === 9 && fox.x<1600 && fox.x>700) {\n nineBox.display(\"This is starting to smell like home, isn't it?\",400,65);\n } else if (screenCount === 9 && fox.x<700 && fox.x>100) {\n nineBox.display(\"Hmm... maybe we're on the right track after all.\",400,65);\n }\n }\n \n if (screenCount === 10) {\n if (fox.x >= 500){\n fox.vx = 0;\n if (playerScore > 0) {\n winAlertDisplay('You made it! Well done, you.', 500, 150);\n winAlertDisplay('Your score is ' + playerScore, 500, 200);\n house.draw(houseImage);\n food.draw(foodImage);\n fireworksp.draw(fireworkspImage);\n fireworks.draw(fireworksImage);\n } else if (playerScore <= 0) {\n var loseBox = new DialogueBox(350,200,900,100);\n loseBox.display(\"Sorry, you won't find it tonight. Score: \" + playerScore, 500, 50);\n }\n }\n }\n\n\n if(shouldDraw) { window.requestAnimationFrame(draw); }\n} // end of draw loop", "title": "" }, { "docid": "c2096af8960f810e4a4924cf9375656e", "score": "0.67693293", "text": "function draw() {\n background(backgroundColor);\n image(road, 0,0,width, height-35)\n goalHeight = 50;\n // Code for gold goal line\n fill(60, 80, 80);\n rect(0, 0, width, goalHeight);\n\n // Code to display Frog\n fill(120, 80, 80);\n ellipse(frogX, frogY, frogDiameter);\n \n\n // if (!gameIsOver) {\n moveCars();\n drawCars();\n checkCollisions();\n checkWin();\n displayScores();\n // }\n if(isGlide == true && !gameIsOver){\n modeGlide();\n }\n if (gameIsOver) {\n speed = 0;\n }\n if(round(isPowerUp,0) != 7){\n isPowerUp = random(500);\n }\n if(round(isPowerUp,0) == 7){\n \n powerUp();\n \n }\n\n \n if(timeDown){\n timer;\n }\n \n // drawSprites();\n}", "title": "" }, { "docid": "eae85b31960fb4436c3819634d45fae1", "score": "0.67661923", "text": "function draw() {\n background(84, 125, 209);\n\n //Game States\n if (state === `title`) {\n titlescreen();\n } else if (state === 'gameplay') {\n gameplay();\n\n } else if (state === `gameclear`) {\n gameclear();\n } else if (state === `gameover`) {\n gameover();\n\n }\n}", "title": "" }, { "docid": "ca8e78974fc23e8e0a7747192d9c2313", "score": "0.67581356", "text": "function render() \r\n{\r\n //text to render\r\n\tvar txtGameName = \"SPACE INVADERS\";\r\n\tvar txtScore = \"SCORE: \"+score;\r\n var txtHiScore = \"HI-SCORE: \"+hiscore;\r\n var txtGameOver = \"GAME OVER\";\r\n var txtGameOver2 = \"CLICK TO PLAY AGAIN\";\r\n\tvar txtFirstPlay = \"CLICK TO PLAY\";\r\n\tvar txtnewLevel = \"LEVEL \"+level;\r\n\tvar txtPaused = \"PAUSED\";\r\n\tvar txtShips = \"SHIPS: \"+ships;\r\n\tvar txtInstruction = \"HIT SPACE TO SHOOT\";\r\n\t\r\n\t//so game resizes (somewhat) smoothly on window resize\r\n\t//resize();\r\n\t\r\n\t//draw images\r\n if (bgReady) \r\n\t{\r\n ctx.drawImage(bgImage, 0, 0);\r\n }\r\n\tif (shipReady && boomReady) \r\n\t{\r\n\t\tif(shipHitTimer)\r\n\t\t{\r\n\t\t\tctx.drawImage(boomImage, ship.x, ship.y);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tctx.drawImage(shipImage, ship.x, ship.y);\r\n\t\t}\r\n }\r\n\t\r\n\tif (brickReady) \r\n\t{\r\n\t\tfor(var i = 0; i < walls.length; i++)\r\n\t\t{\r\n\t\t\tfor(var j = 0; j < walls[i].bricks.length; j++)\r\n\t\t\t{\r\n\t\t\t\tctx.drawImage(brickImage, walls[i].bricks[j].x, walls[i].bricks[j].y);\r\n\t\t\t}\r\n\t\t}\r\n }\r\n\r\n\tif (alienReady && alien2Ready) \r\n\t{\r\n\t\tfor(var i = 0; i < aliensHigh; i++)\r\n {\r\n\t\t\tfor(var j = 0; j < aliensWide; j++)\r\n\t\t\t{\r\n\t\t\t\tif(!firstPlay && aliens[i][j])\r\n\t\t\t\t{\r\n\t\t\t\t\tif(aliens[i][j].x % 15 === 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tframeFlag = !frameFlag;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(frameFlag)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tctx.drawImage(alienImage, aliens[i][j].x, aliens[i][j].y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tctx.drawImage(alien2Image, aliens[i][j].x, aliens[i][j].y);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n\t\r\n }\r\n\t\r\n\tif (bulletReady && bullet2Ready)\r\n\t{\r\n\t\tif(bullet)\r\n\t\t{\r\n\t\t\tctx.drawImage(bullet2Image, bullet.x, bullet.y);\r\n\t\t}\r\n\t\tfor(var i = 0; i < lasers.length; i++)\r\n\t\t{\r\n\t\t\tctx.drawImage(bulletImage, lasers[i].x, lasers[i].y);\r\n\t\t}\r\n\t}\r\n\t\r\n //set font\r\n ctx.fillStyle = \"#FFF\";\r\n ctx.font = \"20px Share Tech Mono\";\r\n ctx.textAlign = \"left\";\r\n ctx.textBaseline = \"top\";\r\n\r\n //show score\r\n ctx.fillText(txtScore, 8, HEIGHT-32);\r\n\t\r\n\t//show hiscore\r\n ctx.fillText(txtHiScore, (WIDTH/2)-(ctx.measureText(txtHiScore).width/2), HEIGHT-32);\r\n\t\r\n\t//show ships\r\n\tctx.fillText(txtShips, WIDTH-(ctx.measureText(txtShips).width) - 8, HEIGHT-32);\r\n\t\r\n\t//show gameover message\r\n if(gameOver)\r\n {\r\n\t\tctx.fillText(txtGameOver,WIDTH/2-(ctx.measureText(txtGameOver).width/2),(HEIGHT/2)-32);\r\n\t\tctx.fillText(txtGameOver2,WIDTH/2-(ctx.measureText(txtGameOver2).width/2),(HEIGHT/2));\r\n }\r\n\t\r\n\t//show new level message\r\n if(newLevel)\r\n {\r\n\t\tctx.fillText(txtnewLevel,WIDTH/2-(ctx.measureText(txtnewLevel).width/2),(HEIGHT/2)-32);\r\n }\r\n\t\r\n\t//show first play message\r\n\tif(firstPlay)\r\n {\r\n\t\tctx.font = \"40px Share Tech Mono\";\r\n\t\tctx.fillText(txtGameName,WIDTH/2-(ctx.measureText(txtGameName).width/2),(HEIGHT/4));\r\n\t\tctx.font = \"20px Share Tech Mono\";\r\n\t\tctx.fillText(txtFirstPlay,WIDTH/2-(ctx.measureText(txtFirstPlay).width/2),(HEIGHT/2)-32);\r\n\t\tctx.fillText(txtInstruction,WIDTH/2-(ctx.measureText(txtInstruction).width/2),(HEIGHT/2));\r\n }\r\n\t\r\n\t//show pause message\r\n\tif(pause)\r\n {\r\n\t\tctx.fillText(txtPaused,WIDTH/2-(ctx.measureText(txtPaused).width/2),(HEIGHT/2)-32);\r\n }\r\n}", "title": "" }, { "docid": "873ec69e792c62f6acdc76c4af01361e", "score": "0.67500937", "text": "function draw() {\n clear();\n if (gameover != true){\n drawPacman();\n drawCircle();\n drawGhost();\n // tells our sprite to bounce off the walls and go in the opposite direction\n if (x + mx > WIDTH - r || x + mx < 0 + r){\n mx = -mx\n } else if (y + my > WIDTH - r || y + my < 0 + r) {\n my = -my\n }\n // moves our sprite\n x += mx; //means the same as x = x + mx\n y += my;\n\n followPacman();\n // check for a collision\n collisionCheck();\n collisionHandle();\n }\n if (gameover == true){\n ctx.font = \"40px Impact\";\n ctx.fillText(\"GAME OVER\",200,300)\n }\n}", "title": "" }, { "docid": "f3057c2405256776471514853586daa1", "score": "0.6737417", "text": "function draw() {\n //Kalder \"WaitForBothPlayers\" som tjekker hvornår den enden skal starte eller genstarte spillet.\n WaitForBothPlayers();\n\n if (IsGameRunning) {\n //Alle funktionerne som skal gøre mens spillet er i gang, som vil sige når \"IsGameRunning\" er sand.\n SyncDamage();\n SyncScore();\n SyncAppelsiner(null, false);\n SyncTurban();\n\n if (LocalPlayer[\"missed\"] > 0) {\n //Alle funktionerne som skal køre mens den lokale spiller stadig er i live.\n display();\n\n if (LocalPlayer[\"teamNumber\"] == 2) {\n //Alle funktionerne der skal køre hvis den lokale spiller er på hold 2.\n //Opdatere turbanens position og sender den nye position til den anden spiller.\n turban.move();\n const TurbanMSG = {\n x: turban.x,\n y: turban.y\n }\n socket.sendMessage(TurbanMSG);\n\n } else if (LocalPlayer[\"teamNumber\"] == 1) {\n //Alle funktionerne der skal køre hvis den lokale spiller er på hold 1.\n //Kalder funktionen \"SyncTurban\" for at opdatere turbanens nye position.\n SyncTurban();\n }\n } else {\n //Hvis den lokale spiller ikke længere er i live skal den vise game over skærmen.\n DeathScreen();\n }\n } else {\n //Hvis spillet ikke er i gang skal den vise vente skærmen.\n WaitingScreen();\n }\n}", "title": "" }, { "docid": "89e6629340e44b8ba8857f79c6825ade", "score": "0.6719621", "text": "function draw() {\n //===========TITLE SCREENS====================//\n // Check if game over is triggered, if not the game plays\n // also checks which title to display depending on the title's properties.\n if (leftPaddle.gameOver() || rightPaddle.gameOver()) {\n background(255);\n title.display();\n // if title.start is true during a game over, reset the paddles position\n // and score making it not gameOver anymore + change title screens.\n if (title.start === true) {\n title.end = false;\n leftPaddle.reset();\n rightPaddle.reset();\n aliens.reset();\n }\n } else {\n // if it's not a game over and title.start is true display start screen.\n // BackgroundArt selects a new random star background else time to play.\n if (title.start === true) {\n image(titleBackG,0,0);\n title.display();\n starBackg.selection();\n soundTrack.currentTime = 0;\n } else {\n //=========GAME START======================//\n soundTrack.play();\n starBackg.display();\n //=========LEFT PADDLE=====================//\n leftPaddle.handleInput();\n leftShot.handleInput(leftPaddle);\n leftPaddle.update();\n leftShot.update(leftPaddle);\n if (leftShot.isOffScreen()) {\n leftShot.reset(leftPaddle);\n }\n leftShot.handleCollision(rightPaddle);\n leftScore.update(leftPaddle);\n leftShot.display();\n leftPaddle.display();\n leftPaddle.hitCheck();\n //=========RIGHT PADDLE===================//\n rightPaddle.handleInput();\n rightShot.handleInput(rightPaddle);\n rightPaddle.update();\n rightShot.update(rightPaddle);\n if (rightShot.isOffScreen()) {\n rightShot.reset(rightPaddle);\n }\n rightShot.handleCollision(leftPaddle);\n rightScore.update(rightPaddle);\n rightShot.display();\n rightPaddle.display();\n rightPaddle.hitCheck();\n //========ALIENS========================//\n leftShot.handleDestroy();\n rightShot.handleDestroy();\n //=====ASK FOR HELP TO IMPROVE?===========//\n aliens.hunt();\n aliens.stun();\n //=========BALL========================//\n ball.update();\n if (ball.isOffScreen()) {\n ball.reset();\n }\n ball.handleCollision(leftPaddle);\n ball.handleCollision(rightPaddle);\n ball.handleCapture();\n ball.display();\n //========BAD BALL======================//\n for (var i = 0; i < aliens.score; i++) {\n //BadBall(x, y, vx, vy, size, speed)\n badBall.push(new BadBall(1 + i, 0, 5, 50, 30, 10));\n badBall[i].display();\n badBall[i].update();\n badBall[i].handleCollision(leftPaddle);\n badBall[i].handleCollision(rightPaddle);\n }\n aliens.display();\n }\n }\n}", "title": "" }, { "docid": "8656a6bb32e350dd6f1ba0635ff5e096", "score": "0.67189294", "text": "function draw() {\n if (start) {\n\n // This keeps the view centered around the tester.\n // These need to stay split statements if want to add zoom later.\n translate(width / 2 -tester.pos.x, height / 2 -tester.pos.y);\n\n // show() needs to come before updates due to translation.\n // when drawing canvas, tester --> people --> dashboard (background --> foreground)\n bg.show();\n box.show();\n\n postToMain();\n populationMembers.forEach((person)=>{\n person.show();\n });\n \n tester.show();\n \n powerups.show();\n dash.show();\n minimap.show();\n\n //Checks if the user wants to zoom in or out using minus and plus buttons\n keyPressed();\n\n if (new Date() > alerter.showMessage()){\n alerter.reset();\n }\n }\n}", "title": "" }, { "docid": "97e1f85f299c676880884824cb34767f", "score": "0.6718638", "text": "function draw() {\n noStroke();\n background(0,80);\n // States behavior\n switch (state) {\n case `mainMenu`:\n mainMenu();\n break;\n case `instruction`:\n instruction();\n break;\n case `gameplay`:\n gameplay();\n break;\n case `telescopeV`:\n telescopeV();\n break;\n }\n // Displaying typewriter\n typewriter.display();\n if(maxWarningTxt) {\n displayText(`12 wishes is more than enough...!`, 36, width / 2, height / 2);\n console.log(\"THIS WORKS! NO MORE STARS!\");\n }\n}", "title": "" }, { "docid": "68ee3fd7bccbd109ade1e95129863caa", "score": "0.6718168", "text": "function game() {\n background(\"white\");\n hero.applyForce(gravity);\n translate(-hero.pos.x + 100, 0);\n // if (mouseIsPressed) {\n // hero.applyForce(force);\n // }\n hero.update();\n hero.show();\n hero.edges();\n\n for (let i = 0; i < enemys.length; i++) {\n enemys[i].show();\n enemys[i].update();\n hero.hit(enemys[i]);\n }\n }", "title": "" }, { "docid": "6d63fc60913816b4568c7780e8b69588", "score": "0.67175627", "text": "function drawEasy() {\n //Shows the score\n fill(255);\n textSize(25);\n text( \"Score:\", 50, 75);\n text( score, 100, 75);\n\n hit1 = collideRectCircle( carx, cary, size/2.25 , size/1.25, deathx1, deathy1, size/2, size/2);\n hit2 = collideRectCircle( carx, cary, size/2.25 , size/1.25, deathx2, deathy2, size/2, size/2);\n hit3 = collideLineCircle( 0, height + size/2, width, height + size/2, deathx1, deathy1, size/2, size/2);\n hit4 = collideLineCircle( 0, height + size, width, height + size, deathx1, deathy1, size/2, size/2);\n\n //The obstacles locations are chosen between 50, 150, or 250\n let location1 = [\"50\",\"150\",\"250\"];\n let r1 = random(location1);\n let location2 = [\"50\",\"150\",\"250\"];\n let r2 = random(location2);\n\n //Obstacle #1\n fill(255,0,0);\n ellipse( deathx1, deathy1, size/2, size/2);\n\n //Obstacle #2\n fill(255,0,0);\n ellipse( deathx2, deathy2, size/2, size/2);\n\n //Speed of the obstacles\n deathy1 = deathy1 + fallSpeed1;\n deathy2 = deathy2 + fallSpeed1;\n\n //If car hits obstacle #1\n if (hit1 === true) {\n level = 200;\n easyLose = true;\n }//End if\n\n //If car hits obstacle #2\n if (hit2 === true) {\n level = 200;\n easyLose = true;\n }//End if\n\n //If obstacles reach the bottom of the screen\n if (hit3 === true) {\n //The obstacles change or keep their locations\n deathx1 = r1;\n deathx2 = r2;\n }//End if\n\n //If obstacle reach the bottom of the screen\n if (hit4 === true){\n //The obstalces return to the top of the canvas\n deathy2 = 0;\n deathy1 = 0;\n\n //Score increases\n score = score + 1;\n\n //Speed of the obstacles increase\n fallSpeed1 = fallSpeed1 + .5;\n }//End if\n\n\n}//End function drawEasy", "title": "" }, { "docid": "c2bef6b9c92635df2202d34c03ba65ed", "score": "0.6692182", "text": "function draw() {\r\n //title screen\r\n if (gameStatus == \"start\") {\r\n rectfill(canvas, 0, 0, SCREEN_W, SCREEN_H, colorBlack)\r\n textout(canvas, font, \"a game by Mattia Fortunati\", 10, SCREEN_H - 10, 12, colorWhite);\r\n textout_right(canvas, font, \"js13kGames competition 2015\", SCREEN_W - 10, SCREEN_H - 10, 12, colorWhite);\r\n textout_centre(canvas, font, \"R\", SCREEN_W / 2 - 50, SCREEN_H / 2 - 130, 72, makecol(255, 0, 0));\r\n textout_centre(canvas, font, \"G\", SCREEN_W / 2, SCREEN_H / 2 - 130, 72, makecol(0, 255, 0));\r\n textout_centre(canvas, font, \"B\", SCREEN_W / 2 + 50, SCREEN_H / 2 - 130, 72, colorBlue);\r\n textout_centre(canvas, font, \"Reverse Ground Battle\", SCREEN_W / 2, SCREEN_H / 2 - 70, 24, colorWhite);\r\n if (ISMOBILE) {\r\n textout_centre(canvas, font, \"TILT the DEVICE to MOVE\", SCREEN_W / 2, SCREEN_H / 2 - 30, 15, colorWhite);\r\n textout_centre(canvas, font, \"TAP to REVERSE GROUND COLOR\", SCREEN_W / 2, SCREEN_H / 2 - 10, 15, colorWhite);\r\n textout_centre(canvas, font, \"TAP to START\", SCREEN_W / 2, SCREEN_H / 2 + 160, 18, colorWhite);\r\n } else {\r\n textout_centre(canvas, font, \"Use ARROW KEYS to MOVE\", SCREEN_W / 2, SCREEN_H / 2 - 30, 15, colorWhite);\r\n textout_centre(canvas, font, \"SPACEBAR to REVERSE GROUND COLOR\", SCREEN_W / 2, SCREEN_H / 2 - 10, 15, colorWhite);\r\n textout_centre(canvas, font, \"press M to mute/unmute sounds\", SCREEN_W / 2, SCREEN_H / 2 + 10, 15, colorWhite);\r\n textout_centre(canvas, font, \"Press SPACEBAR to START\", SCREEN_W / 2, SCREEN_H / 2 + 160, 18, colorWhite);\r\n }\r\n textout_centre(canvas, font, \"Have Fun!\", SCREEN_W / 2, SCREEN_H / 2 + 30, 15, colorWhite);\r\n rect(canvas, 0 + 100, +30, SCREEN_W - 200, SCREEN_H - 70, colorWhite)\r\n }\r\n //game over screen\r\n else if (gameStatus == \"end\") {\r\n rectfill(canvas, 0, 0, SCREEN_W, SCREEN_H, colorBlack)\r\n textout_centre(canvas, font, \"GAME OVER\", SCREEN_W / 2, SCREEN_H / 2 - 140, 48, colorWhite);\r\n textout_centre(canvas, font, \"SCORE:\", SCREEN_W / 2, SCREEN_H / 2 - 90, 36, colorWhite);\r\n textout_centre(canvas, font, score, SCREEN_W / 2, SCREEN_H / 2 - 40, 36, colorWhite);\r\n textout_centre(canvas, font, \"TIPS:\", SCREEN_W / 2, SCREEN_H / 2 + 20, 15, colorWhite);\r\n textout_centre(canvas, font, \"Don't die next time\", SCREEN_W / 2, SCREEN_H / 2 + 40, 15, colorWhite);\r\n textout_centre(canvas, font, \"Destroy more enemy ships instead\", SCREEN_W / 2, SCREEN_H / 2 + 60, 15, colorWhite);\r\n textout_centre(canvas, font, \"N00b\", SCREEN_W / 2, SCREEN_H / 2 + 80, 15, colorWhite);\r\n if (ISMOBILE) {\r\n textout_centre(canvas, font, \"TAP to TRY AGAIN\", SCREEN_W / 2, SCREEN_H / 2 + 160, 18, colorWhite);\r\n } else {\r\n textout_centre(canvas, font, \"Press SPACEBAR to TRY AGAIN\", SCREEN_W / 2, SCREEN_H / 2 + 160, 18, colorWhite);\r\n }\r\n textout_centre(canvas, font, \"if you DARE ...\", SCREEN_W / 2, SCREEN_H / 2 + 180, 12, colorWhite);\r\n rect(canvas, 0 + 100, +30, SCREEN_W - 200, SCREEN_H - 70, colorWhite)\r\n } else if (gameStatus == \"loading\") {\r\n rectfill(canvas, 0, 0, SCREEN_W, SCREEN_H, colorBlack)\r\n textout_centre(canvas, font, \"Loading \" + Math.floor(100 * audioLoaded / audioToLoad) + \"%\", SCREEN_W / 2, SCREEN_H / 2, 36, colorWhite);\r\n rect(canvas, 0 + 100, +30, SCREEN_W - 200, SCREEN_H - 70, colorWhite)\r\n }\r\n //game screen\r\n else if (gameStatus == \"game\") {\r\n //background\r\n rectfill(canvas, 0, 0, SCREEN_W, SCREEN_H, makecol(color1, color2, 0))\r\n //moving ground rect\r\n groundRect.drawItself()\r\n //draw each particle in particlesArray\r\n for (var i = 0; i < particlesArray.length; i++) {\r\n try {\r\n particlesArray[i].drawitself();\r\n } catch (e) {}\r\n }\r\n //draw each shot in shotsArray\r\n for (var i = 0; i < shotsArray.length; i++) {\r\n try {\r\n shotsArray[i].drawitself();\r\n } catch (e) {}\r\n }\r\n //draw each enemy in enemiesArray\r\n for (var i = 0; i < enemiesArray.length; i++) {\r\n try {\r\n enemiesArray[i].drawitself();\r\n } catch (e) {}\r\n }\r\n //draw player\r\n polygonfill(canvas, 5, [char.x + 0, char.y - 15, char.x + 10, char.y + 0, char.x + 5, char.y + 5, char.x - 5, char.y + 5, char.x - 10, char.y + 0], colorBlue)\r\n circlefill(canvas, char.x - 4, char.y + 5, 2, colorBlue);\r\n circlefill(canvas, char.x + 4, char.y + 5, 2, colorBlue);\r\n //score text\r\n textout_centre(canvas, font, \"SCORE: \" + score, SCREEN_W / 2, 20, 18, colorBlue);\r\n }\r\n\r\n}", "title": "" }, { "docid": "e9cf397dcc553ea9e9d49cac4160cf6f", "score": "0.6691884", "text": "function drawStuff()\r\n\t{\r\n\t\tdrawGrid();\r\n\t\tdrawPlayer();\r\n\t\t\r\n\t\tctx.fillStyle = \"blue\";\r\n\t\tctx.font = \"30px Helvetica\";\r\n\t\tif(doorHit)\r\n\t\t{\r\n\t\t\tctx.fillText(\"You excaped!\", 50, 40);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "5846648fcd61b7d84795fa1a778272fb", "score": "0.66821676", "text": "function draw() {\n // Start screen\n if (startScreen) {\n background(startBackground);\n gameStructure.startScreenDisplay();\n }\n // Game first step\n else if (firstStep) {\n background(0);\n // Resets paddle position and define play area\n if (mouseY > (height / 2 + 200) && mouseY < (height)) {\n paddle.x = mouseX;\n paddle.y = mouseY;\n }\n\n // Display targets\n displayTargets();\n // Displays play area\n gameStructure.playArea();\n\n // Handles ball input\n ball.handleInput(firstStep);\n // Check if ball is jumping\n ball.handleJumping(paddle);\n // Updates ball position based on paddle position\n ball.updatePosition(paddle.x + 50);\n\n // Checks if ball collided with a target\n // If so hide the target and changes its id number so that it won't be counted again.\n for (let i = 0; i < targets.length; i++) {\n targets[i].goalAchieved(ball);\n }\n\n // Displays Ball and paddle\n paddle.display();\n ball.display();\n\n // If ball goes off the bottom of screen or all targets disappeared, game is over.\n if (ball.y > height) {\n firstFailure = false;\n stepIsOver = true;\n firstStep = false;\n }\n }\n // Transition screen\n else if (stepIsOver) {\n background(255);\n if (firstWin) {\n gameStructure.TransitionScreenDisplay(\"Good job buddy!\", firstWin);\n } else if (!firstFailure) {\n gameStructure.TransitionScreenDisplay(\"Oops you've got too ambitous!\", firstFailure);\n } else if (secondWin) {\n gameStructure.TransitionScreenDisplay(\"Good job buddy, Ready for next step!\", secondWin);\n } else if (!secondFailure) {\n gameStructure.TransitionScreenDisplay(\"Oops, did you misuse your will!\", secondFailure);\n }\n }\n // Game second step\n else if (secondStep) {\n background(0);\n\n // Resets paddle position\n paddle.x = mouseX;\n paddle.y = mouseY;\n\n // Update barriers position. Make them loop\n for (let i = 0; i < barriers.length; i++) {\n barriers[i].display();\n barriers[i].updatePosition();\n }\n // Check if ball collided barriers.\n // If so, decrease his health by 20%\n for (let i = 0; i < barriers.length; i++) {\n barriers[i].ballBarrierCollision(ball);\n }\n\n // Draw second step targets\n // Update target x postion if it went off screen\n // Check if ball collided with second step target. If so add to player score\n for (let i = 0; i < secondStepTarget.length; i++) {\n // Check the target point is counted only once\n if (secondStepTarget[i].id === 1) {\n secondStepTarget[i].display();\n }\n secondStepTarget[i].updatePosition();\n ball.targetCollision(secondStepTarget[i]);\n }\n\n // Handles ball input\n ball.handleInput(!firstStep);\n // Check if ball is jumping\n ball.handleJumping(paddle);\n // Updates ball position based on paddle position\n ball.updatePosition(paddle.x + 50);\n // Display percent of health + Display player score\n ball.displayHealth();\n ball.displayScore();\n // Updates target health. reduces health based on a random speed.\n // I keep this code cause I might use it again\n // for (let i = 0; i < targets.length; i++) {\n // targets[i].updateHealth();\n // }\n\n // Displays Ball and paddle\n paddle.display();\n ball.display();\n\n // If the player score reached to 100, second step ends +\n // show transition screen to go to next step\n if (ball.score > 10) {\n stepIsOver = true;\n secondWin = true;\n secondStep = false;\n }\n // If ball goes off the bottom of screen or player lost his whole life, game is over.\n else if (ball.y > height || ball.opacity <= 0) {\n stepIsOver = true;\n secondFailure = false;\n secondStep = false;\n }\n }\n // Game third step\n else if (thirdStep) {\n background(0);\n\n // Resets paddle position\n paddle.x = mouseX;\n paddle.y = mouseY;\n\n // Update barriers position. Display barriers and Make them loop\n // Update targets position. Display targets and Make them loop\n for (let i = 0; i < barriers.length; i++) {\n secondBarriers[i].display();\n secondBarriers[i].updatePosition();\n thirdStepTarget[i].display();\n thirdStepTarget[i].updatePosition();\n }\n // Check if ball collided barriers.\n // If so, decrease his health by 20%\n for (let i = 0; i < barriers.length; i++) {\n secondBarriers[i].ballBarrierCollision(ball);\n }\n\n // Display percent of health + Display player score\n ball.displayHealth();\n ball.displayScore();\n // Handles ball input\n ball.handleInput(thirdStep);\n // Check if ball is jumping\n ball.handleJumping(paddle);\n // Updates ball position based on paddle position\n ball.updatePosition(paddle.x + 50);\n\n // Displays Ball and paddle\n paddle.display();\n ball.display();\n\n if (ball.y > height) {\n gameOver = true;\n }\n }\n // Game over screen\n else if (gameOver) {\n background(0);\n gameStructure.gameOverDisplay();\n }\n}", "title": "" }, { "docid": "1ddca5725b5d8c1c4e1603794da0c525", "score": "0.6653358", "text": "function draw(){\n\tbackground(0);\n\n\tcamera_control();\n\n\tgridx = (cx-cx%50)+25;\n\tgridy = (cy-cy%50)+25;\n\n\tif(ongoing)\n\t\twave_loop();\n\n\ttower_loop();\n\tbullet_loop();\n\tenemy_loop();\n\n\tif(camera_mode == \"build\" || camera_mode == \"spec\"){\n\t\tdraw_cursor();\n\t\tdraw_ground();\n\t\tdraw_path();\n\t\tdraw_enemies();\n\t\tdraw_towers();\n\t\tdraw_bullets();\n\t}\n\n\tif(life <= 0){\n\t\tcamera_mode = \"loss\";\n\t\tcamera();\n\t\tfill(255);\n\t\ttextSize(width/8);\n\t\ttextAlign(CENTER, CENTER);\n\t\ttext(\"game over\", 0, 0);\n\t}\n\tif(wave == waves.length){\n\t\tcamera_mode = \"win\";\n\t\tcamera();\n\t\tfill(255);\n\t\ttextSize(width/8);\n\t\ttextAlign(CENTER, CENTER);\n\t\ttext(\"you win!\", 0, 0);\n\t}\n}", "title": "" }, { "docid": "0d6ec5f69d0aebf041e0eac9a1c7a46b", "score": "0.6652812", "text": "function drawGame () {\n push();\n\n //refresh screen\n clear();\n\n //if player is actively playing\n if (socket.id in playingData) {\n \n //get player object\n let player = playingData[socket.id];\n\n //calculate screen offset based on player position\n calcOffset(player);\n\n //draw grid background\n drawGrid();\n\n //draw game area borders\n drawBorders();\n\n //draw dead players\n drawDead();\n\n //draw client player if dead\n if (player.health <= 0) {\n drawPlayer(player);\n }\n\n //draw pickups\n drawPickups();\n\n //draw shots\n drawShots();\n\n //draw enemies\n drawEnemies();\n\n //draw zones\n drawZones();\n\n //draw living players\n drawLiving();\n\n // then draw client player on top if living\n if (player.health > 0) {\n drawPlayer(player);\n drawHealthbar(player);\n deathStart = 0;\n }\n\n //draw UI\n\n //draw minimap\n drawMinimap(player);\n\n //draw info about the current Room\n drawRoomInfo(gameSettings.playerTypes[player.type].colors.dark);\n\n //draw names of players\n drawPlayerInfo();\n\n //draw fps counter\n drawFPS(gameSettings.playerTypes[player.type].colors.dark);\n\n //draw Death screen if player is dead\n drawDeathMsg(player);\n\n // draw crosshair\n drawCrosshair(gameSettings.playerTypes[player.type].colors.dark);\n\n }\n\n //draw game if player not in game\n else {\n\n //calculate screen offset based on center of screen\n calcOffset({\n x: gameSettings.width/2,\n y: gameSettings.height/2\n });\n\n //draw grid background\n drawGrid();\n\n //draw game area borders\n drawBorders();\n\n //draw dead players\n drawDead();\n\n //draw pickups\n drawPickups();\n\n //draw shots\n drawShots();\n\n //draw enemies\n drawEnemies();\n\n //draw zones\n drawZones();\n\n //draw living players\n drawLiving();\n\n //draw UI\n\n //draw minimap\n drawMinimap();\n\n //draw info about the current Room\n drawRoomInfo(gameSettings.colors.darkgrey);\n\n //draw names of players\n drawPlayerInfo();\n\n //draw fps counter\n drawFPS(gameSettings.colors.darkgrey);\n\n // draw crosshair\n drawCrosshair(gameSettings.colors.darkgrey);\n }\n\n pop();\n}", "title": "" }, { "docid": "a89b6dddef115a7e175c683ec59b5c79", "score": "0.66522086", "text": "function draw(){\n\tclearStage();\n\tpaddle.update();\n\tupdateBricks();\n\tball.update();\n\tcheckGameState();\n}", "title": "" }, { "docid": "dd335c2a03fc1020144eefbc6f147127", "score": "0.66520023", "text": "function draw() {\n background(bg);\n\n // Update game status\n updatePause();\n updateStatus();\n\n // Update spawn and wave cooldown\n if (!paused) {\n if (scd > 0) scd--;\n if (wcd > 0 && toWait) wcd--;\n }\n\n // Draw basic tiles\n for (var x = 0; x < cols; x++) {\n for (var y = 0; y < rows; y++) {\n var t = tiles[display[x][y]];\n if (typeof t === 'function') {\n t(x, y, displayDir[x][y]);\n } else {\n stroke(border, borderAlpha);\n t ? fill(t) : noFill();\n rect(x * ts, y * ts, ts, ts);\n }\n }\n }\n\n // Draw spawnpoints\n for (var i = 0; i < spawnpoints.length; i++) {\n stroke(255);\n fill(0, 230, 64);\n var s = spawnpoints[i];\n rect(s.x * ts, s.y * ts, ts, ts);\n }\n\n // Draw exit\n stroke(255);\n fill(207, 0, 15);\n rect(exit.x * ts, exit.y * ts, ts, ts);\n\n // Draw temporary spawnpoints\n for (var i = 0; i < tempSpawns.length; i++) {\n stroke(255);\n fill(155, 32, 141);\n var s = tempSpawns[i][0];\n rect(s.x * ts, s.y * ts, ts, ts);\n }\n\n // Spawn enemies\n if (canSpawn() && !paused) {\n // Spawn same enemy for each spawnpoint\n var name = newEnemies.shift();\n for (var i = 0; i < spawnpoints.length; i++) {\n var s = spawnpoints[i];\n var c = center(s.x, s.y);\n enemies.push(createEnemy(c.x, c.y, enemy[name]));\n }\n\n // Temporary spawnpoints\n for (var i = 0; i < tempSpawns.length; i++) {\n var s = tempSpawns[i];\n if (s[1] === 0) continue;\n s[1]--;\n var c = center(s[0].x, s[0].y);\n enemies.push(createEnemy(c.x, c.y, enemy[name]));\n }\n\n // Reset cooldown\n toCooldown = true;\n }\n\n // Update and draw enemies\n for (let i = enemies.length - 1; i >= 0; i--) {\n let e = enemies[i];\n\n // Update direction and position\n if (!paused) {\n e.steer();\n e.update();\n e.onTick();\n }\n\n // Kill if outside map\n if (outsideMap(e)) e.kill();\n\n // If at exit tile, kill and reduce player health\n if (atTileCenter(e.pos.x, e.pos.y, exit.x, exit.y)) e.onExit();\n\n // Draw\n e.draw();\n\n if (e.isDead()) enemies.splice(i, 1);\n }\n\n // Draw health bars\n if (healthBar) {\n for (var i = 0; i < enemies.length; i++) {\n enemies[i].drawHealth();\n }\n }\n\n // Update and draw towers\n for (let i = towers.length - 1; i >= 0; i--) {\n let t = towers[i];\n\n // Target enemies and update cooldowns\n if (!paused) {\n t.target(enemies);\n t.update();\n }\n\n // Kill if outside map\n if (outsideMap(t)) t.kill();\n\n // Draw\n t.draw();\n\n if (t.isDead()) towers.splice(i, 1);\n }\n\n // Update and draw particle systems\n for (let i = systems.length - 1; i >= 0; i--) {\n let ps = systems[i];\n ps.run();\n if (ps.isDead()) systems.splice(i, 1);\n }\n\n // Update and draw projectiles\n for (let i = projectiles.length - 1; i >= 0; i--) {\n let p = projectiles[i];\n\n if (!paused) {\n p.steer();\n p.update();\n }\n\n // Attack target\n if (p.reachedTarget()) p.explode()\n\n // Kill if outside map\n if (outsideMap(p)) p.kill();\n\n p.draw();\n\n if (p.isDead()) projectiles.splice(i, 1);\n }\n\n // Draw range of tower being placed\n if (doRange()) {\n var p = gridPos(mouseX, mouseY);\n var c = center(p.x, p.y);\n var t = createTower(0, 0, tower[towerType]);\n showRange(t, c.x, c.y);\n\n // Draw a red X if tower cannot be placed\n if (!canPlace(p.x, p.y)) {\n push();\n translate(c.x, c.y);\n rotate(PI / 4);\n\n // Draw a red X\n noStroke();\n fill(207, 0, 15);\n var edge = 0.1 * ts;\n var len = 0.9 * ts / 2;\n rect(-edge, len, edge * 2, -len * 2);\n rotate(PI / 2);\n rect(-edge, len, edge * 2, -len * 2);\n\n pop();\n }\n }\n\n // Update FPS meter\n if (showFPS) calcFPS();\n\n // Show if god mode active\n if (godMode) {\n // Draw black rect under text\n noStroke();\n fill(0);\n rect(0, 0, 102, 22);\n\n fill(255);\n text('God Mode Active', 5, 15);\n }\n\n // Show if towers are disabled\n if (stopFiring) {\n // Draw black rect under text\n noStroke();\n fill(0);\n rect(width - 60, 0, 60, 22);\n \n fill(255);\n text('Firing off', width - 55, 15);\n }\n\n removeTempSpawns();\n\n projectiles = projectiles.concat(newProjectiles);\n towers = towers.concat(newTowers);\n newProjectiles = [];\n newTowers = [];\n\n // If player is dead, reset game\n if (health <= 0) resetGame();\n\n // Start next wave\n if (toWait && wcd === 0 || skipToNext && newEnemies.length === 0) {\n toWait = false;\n wcd = 0;\n nextWave();\n }\n\n // Wait for next wave\n if (noMoreEnemies() && !toWait) {\n wcd = waveCool;\n toWait = true;\n }\n\n // Reset spawn cooldown\n if (toCooldown) {\n scd = spawnCool;\n toCooldown = false;\n }\n\n // Recalculate pathfinding\n if (toPathfind) {\n recalculate();\n toPathfind = false;\n }\n}", "title": "" }, { "docid": "84da088c71f823e54f6521d7e16782b3", "score": "0.6630691", "text": "function draw() {\n // begin by CLEARING the ENTIRE PAGE\n // eliminates ARTIFACTING\n ctx.clearRect(0, 0, field.width, field.height);\n\n // draw ALIENS\n aliens.forEach((alienBoy, index) => {\n // drawImage (IMAGE, X-Pos, Y-Pos, WIDTH, HEIGHT)\n ctx.drawImage(alienBoy.image, alienBoy.x, alienBoy.y, alienBoy.width, alienBoy.height);\n });\n\n // move GUN after MOUSE\n dx = mousePos - player.x;\n player.x += (dx / 3);\n // draw GUN\n ctx.drawImage(gun, player.x, player.y, player.width, player.height);\n\n\n if (showReticle) {\n ctx.drawImage(hitMark, retX, retY, 52, 52)\n }\n\n // draw SCORE if the game is OCCURING\n if (gameplay) {\n \n }\n \n // load START of GAME\n switch (gameState) {\n case 1:\n // draw the LOGO in the CENTER\n ctx.drawImage(logoIMG, 160, 120, 500, 500);\n break;\n case 2:\n ctx.font = \"200px Share Tech Mono\";\n ctx.fillStyle = \"black\";\n ctx.fillText(\"3\", 350, 410);\n break;\n case 3:\n ctx.font = \"200px Share Tech Mono\";\n ctx.fillStyle = \"black\";\n ctx.fillText(\"2\", 350, 410);\n break;\n case 4:\n ctx.font = \"200px Share Tech Mono\";\n ctx.fillStyle = \"black\";\n ctx.fillText(\"1\", 350, 410);\n break;\n case 5:\n ctx.font = \"200px Share Tech Mono\";\n ctx.fillStyle = \"black\";\n ctx.fillText(\"GO!\", 270, 410);\n break;\n case 6:\n // begin COUNTDOWN\n gameplay = true;\n break;\n }\n\n if (gameplay) {\n //draw COUNTDOWN\n ctx.font = \"50px Share Tech Mono\";\n ctx.fillStyle = \"red\";\n ctx.fillText(`TIME: ${countdown}`, 500, 120);\n // draw SCORE\n ctx.font = \"50px Share Tech Mono\";\n ctx.fillStyle = \"red\";\n ctx.fillText(`SCORE: ${score}`,80, 120);\n // draw ASCENsion\n if (ascension > 0) {\n ctx.font = \"50px Share Tech Mono\";\n ctx.fillStyle = \"red\";\n ctx.fillText(`ASCENSION: ${ascension}`,250, 180);\n }\n }\n\n // ENDGAME\n\n if (endScreen) {\n // show SCORE\n ctx.font = \"50px Share Tech Mono\";\n ctx.fillStyle = \"red\";\n ctx.fillText(`YOU SCORED: ${score}`, 200, 400);\n // ask to TRY AGAIN\n ctx.font = \"30px Share Tech Mono\";\n ctx.fillStyle = \"black\";\n ctx.fillText(`LEVEL UP! ITS GETTING HARDER...`, 150, 470);\n }\n\n if (pushStart == false) {\n // intro to game\n ctx.font = \"60px Share Tech Mono\";\n ctx.fillStyle = \"red\";\n ctx.fillText(`KILL BUGS`, 245, 300);\n // shoot to start\n ctx.font = \"50px Share Tech Mono\";\n ctx.fillStyle = \"black\";\n ctx.fillText(`SHOOT (CLICK) TO BEGIN`, 100, 370);\n }\n\n // LOOP the ANIMATION SEQUENCE\n window.requestAnimationFrame(draw);\n}", "title": "" }, { "docid": "1857269cedb9bf1c1e40b6a281893db7", "score": "0.663027", "text": "function draw() {\n noStroke();\n rect(0, 0, bredde, hoyde);\n background(\"orange\");\n\n tegnBall();\n tegnPlayerOne();\n tegnPlayerTwo();\n hitOne();\n hitTwo();\n scoreBoard();\n}", "title": "" }, { "docid": "6596aa132b7be6b47733067176e429e4", "score": "0.6619005", "text": "draw() {\n ctx.clearRect(0,0,500,500);\n\t\tthis.particleManager.draw();\n\t\tthis.obstacleManager.draw();\n\t\t/* Question 6\n\t\tthis.c = new Vector();\n\t\tthis.c.setRandInt(new Vector(100,100),new Vector(250,250));\n\t\tctx.fillStyle = '#000000';\n\t\tctx.fillRect(this.c.x,this.c.y,100,100);\n\t\t*/\n }", "title": "" }, { "docid": "4dd8d79b83d309287cd19c01dd1e420d", "score": "0.66176224", "text": "function draw(){\n background(255, 255, 255);\n if(gameState === 0){\n titleScreen();\n }else if(gameState === 1){\n startGame();\n } else if(gameState === 2){\n playGame();\n } else if(gameState === 3){\n sickoGame();\n } else if(gameState === 4){\n endGame();\n }\n\n}", "title": "" }, { "docid": "8e78623a28069c22b05df217444cc4d6", "score": "0.66067463", "text": "function draw() {\n if (state === `start`){\n start();\n }\n else if (state === `simulation`){ //state: simulation (where the playing going on)\n simulation();\n }\n else if (state === `goodEnd`){//goodEnd when the userobject get big enough\n goodEnd();\n }\n else if (state === `badEnd`){//badEnd when userobject is eaten by bigger fish\n badEnd();\n }\n\n\n}", "title": "" }, { "docid": "934134f75a7e0cfdc61d501563e362f9", "score": "0.66053325", "text": "function draw() {\n turn = 1;\n win = 0;\n moves = 0;\n result = 0;\n\n //redefines variables so that game may be replayed after game is reset by player\n\n grid = [\n [0, 0, 0],\n [0, 0, 0],\n [0, 0, 0],\n ];\n\n //sets grid sections to zero so player input is enabled\n\n rect(0, 0, gridSize, gridSize);\n line(gridSize / 3, 0, gridSize / 3, gridSize);\n line((2 * gridSize) / 3, 0, (2 * gridSize) / 3, gridSize);\n line(0, gridSize / 3, gridSize, gridSize / 3);\n line(0, (2 * gridSize) / 3, gridSize, (2 * gridSize) / 3);\n\n //creates the grid that seperates the sections that players will interact with.\n}", "title": "" }, { "docid": "b2ac38a48a880b9ba6af8f2421b874dd", "score": "0.66039395", "text": "function draw() {\n background(0);\n\n switch (state) {\n case \"loading\":\n loading();\n break;\n case \"menu\":\n menu();\n break;\n case \"instructions\":\n instructions();\n break;\n case \"spellslist\":\n spellslist();\n break;\n case \"intro\":\n intro();\n break;\n case \"introEnd\":\n introEnd();\n break;\n case \"stage1\":\n stage1();\n break;\n case \"VNameEnding\":\n VNameEnding();\n break;\n case \"stage1End\":\n stage1End();\n break;\n case \"stage2\":\n stage2();\n break;\n case \"stage2End\":\n stage2End();\n break;\n case \"stage3\":\n stage3();\n break;\n case \"dementorEnding\":\n dementorEnding();\n break;\n case \"stage3End\":\n stage3End();\n break;\n case \"stage4\":\n stage4();\n break;\n case \"loseEnding\":\n loseEnding();\n break;\n case \"winEnding\":\n winEnding();\n break;\n }\n}", "title": "" }, { "docid": "6fe17a803d99f161fc379e32a7579522", "score": "0.6594046", "text": "function draw() {\n // Clear the background to black\n image(backgroundJungle, 0, 0);\n gameOver();\n\n //Display the amount of preys eaten by the tiger\n textFont(\"Impact\");\n textAlign(LEFT, TOP);\n textSize(20);\n fill(255);\n text(\"Prey eaten by Tiger: \" + tiger.preyEaten, 0, 0);\n\n //Display the amount of preys eaten by the lion\n textFont(\"Impact\");\n textAlign(RIGHT, TOP);\n textSize(20);\n fill(255);\n text(\"Prey eaten by Lion: \" + lion.preyEaten, 575, 0);\n\n //Display the amount of preys eaten by the wasp\n textFont(\"Impact\");\n textAlign(RIGHT, TOP);\n textSize(20);\n fill(255);\n text(\"Prey eaten by Wolf: \" + wolf.preyEaten, 950, 0);\n\n // Handle input for the tiger\n tiger.handleInput();\n lion.handleInput();\n wolf.handleInput();\n\n // Move all the \"animals\"\n tiger.move();\n antelope.move();\n zebra.move();\n hare.move();\n lion.move();\n wolf.move();\n\n // Verifying if the predators are dead\n tiger.checkState();\n lion.checkState();\n wolf.checkState();\n\n // Handle the tiger eating any of the prey\n tiger.handleEating(antelope);\n tiger.handleEating(zebra);\n tiger.handleEating(hare);\n lion.handleEating(antelope);\n lion.handleEating(zebra);\n lion.handleEating(hare);\n wolf.handleEating(antelope);\n wolf.handleEating(zebra);\n wolf.handleEating(hare);\n\n // Display all the \"animals\"\n tiger.display();\n antelope.display();\n zebra.display();\n hare.display();\n lion.display();\n wolf.display();\n}", "title": "" }, { "docid": "27e236a4aafa61ac8857065d793fd2c7", "score": "0.6581253", "text": "function draw() {\n // Clear the background to black\n background(0);\n\n // Handle input for the tiger\n tiger.handleInput();\n\n //Handle input for the lion\n jaguar.handleInput();\n\n // Move all the \"animals\"\n tiger.move();\n jaguar.move();\n antelope.move();\n zebra.move();\n bee.move();\n\n // Handle the tiger eating any of the preys\n tiger.handleEating(antelope);\n tiger.handleEating(zebra);\n tiger.handleEating(bee);\n\n //Handle the lion eating any of the preys\n jaguar.handleEating(antelope);\n jaguar.handleEating(zebra);\n jaguar.handleEating(bee);\n\n\n // Display all the \"animals!\"\n tiger.display();\n jaguar.display();\n antelope.display();\n zebra.display();\n bee.display();\n\n //display the number of prey the predators ate\n displayScore();\n\n}", "title": "" }, { "docid": "d9924bb927a8db7b46fb1fd72b840c26", "score": "0.6577866", "text": "function draw(){\n background(20, 20, 20);\n\n titleScreen();\n if(gameState === 1){\n startGame();\n runPaddle();\n runBalls();\n } else if(gameState === 2){\n playGame();\n runPaddle();\n runBalls();\n } else if(gameState === 3){\n sickoGame();\n runPaddle();\n runBalls();\n } else if(gameState === 4){\n endGame();\n }\n }", "title": "" }, { "docid": "9ad8870c4358152f5fdcf0e24582aa6b", "score": "0.6576909", "text": "function draw() {\n //instructions button\n fill(255);\n text(\"How to Play\", width / 2, height / 2 + 350);\n if (mouseIsPressed) {\n gameMode = \"instructions menu\";\n }\n if (state === \"start\") {\n startScreen();\n } \n else if (state === \"play\") {\n clear();\n \n displayBackground();\n \n // // Uncomment next 2 lines to show character and ground hitbox.\n // rect(spriteX, spriteY, height/hitGround, height/hitGround);\n // line(0 - 10, height * 0.63, width + 10, height * 0.63);\n \n // Draws and moves sprite.\n displaySprite();\n handleMovement();\n applyGravity();\n // nextScreen();\n }\n else if (state === \"dead\") {\n deathScreen();\n \n }\n}", "title": "" }, { "docid": "1bb882aa662ba61d18bc9d0cf7e2702e", "score": "0.6576379", "text": "function draw() {\r\n background(55);\r\n // if the snake is dead, stop updating the snake's position and display death message.\r\n if (snake.isDead) {\r\n console.log(\"You are dead, not a big surprise.\");\r\n textSize(36);\r\n text(\"Game Over\", width/2, height/2);\r\n textSize(18);\r\n text(\"Press ENTER to restart.\", width/2, height/2+2*grid);\r\n }\r\n // if the snake is not dead, update the snake's position\r\n else {\r\n snake.update();\r\n // display snake and food objects\r\n snake.display();\r\n food.display();\r\n }\r\n \r\n // if the snake's position overlaps with the food's, eat it.\r\n if (snake.x === food.x && snake.y === food.y) {\r\n food.update();\r\n snake.eat();\r\n }\r\n // always check if the snake dies or not.\r\n snake.death();\r\n\r\n // keep track of the score.\r\n fill(\"yellow\");\r\n textSize(24);\r\n text(`Score: ${snake.level}`, width-4*grid, height-grid);\r\n}", "title": "" }, { "docid": "42025b3e8f3463b97346ba03eea6bf0e", "score": "0.6574716", "text": "function draw() {\n background(\"#a8c089\");\n\n ////// NEW //////////\n // the switch statement checks the state of the game\n // and displays the proper screen\n switch (state) {\n case \"TITLE\":\n displayTitle();\n break;\n\n case \"GAME 1\":\n displayGame1();\n break;\n\n case \"GAME 2\":\n displayGame2();\n break;\n\n case \"CHARACTER SELECT\":\n displayCharacterSelect();\n break;\n\n case \"GAME LOST\":\n displayGameLost();\n break;\n\n case \"GAME WON\":\n displayGameWon();\n break;\n }\n}", "title": "" }, { "docid": "a8f63e13acb964a4449fcc00e8b7f243", "score": "0.65709585", "text": "function draw() {\n if (currentState.changingRoomOpened === true) //Process only if changing room has been set to true in the current scene player is in\n {\n currentChangingRoom.update(); //run the current changing room update() method every frame\n }\n currentState.update(); //run the current state update() method every frame\n}", "title": "" }, { "docid": "fe3f58b41410e58c5f958fb35c7dde6f", "score": "0.65610284", "text": "draw()\n\t{\n\t\t// draw player sprite on canvas\n\t\tthis.image.rotate(this.x, this.y, this.angle);\n\t\t\n\t\t// Draw health bar\n\t\tif (this.hitByLaser == true)\n\t\t{\n\t\t\tthis.drawHealthBar();\n\t\t}\n\t\t\n\t\t// draw rect\n\t\tthis.rect.draw();\n\t\t\n\t\t// update enemy \n\t\tthis.update();\n\t}", "title": "" }, { "docid": "bd519bbdbdd70383932b4583d12eb86a", "score": "0.6559222", "text": "function draw() {\n atrium();\n ground();\n columns();\n door();\n windows();\n updateRainDrops();\n}", "title": "" }, { "docid": "24a6a7d674c684915af762b0d59864d7", "score": "0.6556953", "text": "drawGame()\n\t{\n\t\t// clear screen\n\t\tContext.context.setTransform(1,0,0,1,0,0);//reset the transform matrix as it is cumulative\n\t\tself.clearScreen(\"#0f0000\");\n\n\t\t// Clamp the camera position to the world bounds while centering the camera around the player \n\t\tself.camX = self.clamp(-self.player.x + Context.canvas.width/2, 0, 5000 - Context.canvas.width);\n\t\tself.camY = self.clamp(-self.player.y + Context.canvas.height/2, 0, 5000 - Context.canvas.height);\n\t\t// Move canvas\n\t\tContext.context.translate(self.camX, self.camY); \n\t\t\n\t\t// draw background\n\t\tself.drawStar();\n\t\t\n\t\t// draw meteors\n\t\tself.drawMeteors();\n\t\t\n\t\t// draw lasers\n\t\tself.player.drawLaser();\n\t\t\n\t\t// draw enemies\n\t\tself.drawEnemies();\n\t\t\n\t\t// draw player\n\t\tself.player.draw(self.camX, self.camY);\n\t\t\n\t\t// draw upgrade debugger\n\t\tself.handleUpgrades();\n\t\t\n\t\t//draw main collision rect\n\t\t//self.drawMainRect();\n\n\t}", "title": "" }, { "docid": "8be24ff237325c20c737d06fd16c104c", "score": "0.6554099", "text": "function draw() {\n background(120);\n\n //Calling tates\n if (state ===`title`) {\n title();\n }\n if (state ===`simulation`) {\n simulation();\n }\n if (state ===`win`) {\n win();\n }\n if (state ===`lose`) {\n lose();\n }\n\n // // Loop through all the cherries and displays them.\n // for (let i = 0; i < object.cherries.length; i++) {\n // let cherry = object.cherries[i];\n // //Check if the cherry is captured\n // if (cherry.captured === false) {\n // cherry.display();\n //\n // // If ant captures cherry , a new cherry appears.\n // if (cherry.checkCapture(ant)) {\n // let x = random(0, width);\n // let y = random(0, height);\n // let cherry = new Cherry(x,y);\n // object.cherries.push(cherry);\n // score ++;\n // }\n // }\n // }\n}", "title": "" }, { "docid": "be6fa7985acafe33f71417076f539fc8", "score": "0.6546103", "text": "function draw() {\n\tdrawBackground();\n\tdrawPawns();\n}", "title": "" }, { "docid": "155923edaf2792a71243880260c64a44", "score": "0.65456146", "text": "function render() {\n screen.clear(); // clear the game canvas\n // draw all aliens\n for (var i = 0, len = aliens.length; i < len; i++) {\n var a = aliens[i];\n screen.drawSprite(a.sprite[spFrame], a.x, a.y);\n }\n // save contetx and draw bullet then restore\n screen.ctx.save();\n for (var i = 0, len = bullets.length; i < len; i++) {\n if(bullets[i].direction == 'up'){\n screen.drawSprite(bulSprite, bullets[i].x, bullets[i].y);\n }\n else{\n screen.drawSprite(bulDownSprite, bullets[i].x, bullets[i].y);\n }\n }\n screen.ctx.restore();\n\t\t//drawnPlayerScore\n screen.ctx.save();\n //score after death to be equal to display score at end\n if (player.lifes <= 0.1) {\n screen.drawScore(scoreAfterDeath, screen.width - 100, screen.height - 50);\n } else {\n screen.drawScore(player.score, screen.width - 100, screen.height - 50);\n }\n screen.ctx.restore();\n\t\t\n\t\t//drawnPlayerLifes\n\t\tscreen.ctx.save();\n screen.drawLifes(player.lifes.toFixed(0), screen.width-150, screen.height-50);\n screen.ctx.restore();\n\n // draw the player sprite\n screen.drawSprite(player.sprite, player.x, player.y);\n\n //drawing explosions\n screen.ctx.save();\n for (var i = 0; i <collisions .length; i++) {\n for (var j = 0; j < expSprite.length; j++) {\n screen.ctx.save();\n screen.drawSprite(expSprite[j], collisions[i].x, collisions[i].y);\n screen.ctx.restore();\n }\n }\n\n\t\tfor (var i = 0; i <collisionsBul.length; i++) {\n for (var j = 0; j < expSpriteBul.length; j++) {\n screen.ctx.save();\n screen.drawSprite(expSpriteBul[j], collisionsBul[i].x, collisionsBul[i].y);\n screen.ctx.restore();\n }\n }\n\n //drawing explosions on interaction with the canvas\n screen.ctx.save();\n for (var i = 0; i < canvasCollisionArray.length; i++) {\n if(canvasCollisionArray[i].direction == 'up'){\n screen.drawSprite(canvasUpSprite, canvasCollisionArray[i].x, canvasCollisionArray[i].y+5);\n }\n }\n screen.ctx.restore();\n collisions = [];\n\t\tcollisionsBul = [];\n canvasCollisionArray = [];\n }", "title": "" }, { "docid": "896a9a60b9ec02dace63d13478fc3f6a", "score": "0.65367824", "text": "function drawGuards() {\n var walls = data[gameArea.level].walls; \n \n // activate stun after level 3\n\tif (gameArea.level > 3) {\n var closestGuard = findClosest();\n }\n\n for (var i = 0; i < gameArea.guards.length; i++) {\n gameArea.guards[i].show(gameArea.ctx, walls, i === closestGuard && gameArea.cooldowns[1] <= 0);\n gameArea.guards[i].move();\n\n\n if (gameArea.guards[i].caught(new THREE.Vector2(lazuli.x, lazuli.y), walls)) {\n \tgameArea.deaths.push(new THREE.Vector2(lazuli.x, lazuli.y));\n lazuli = new component(data[gameArea.level].start[0]);\n }\n }\n}", "title": "" }, { "docid": "c4b2b15e68a46cfc6e56d35916aa74ed", "score": "0.6534017", "text": "function draw() {\n // Clear the background\n background(backgroundImg);\n\n // clear game if game is over\n if (creeper.isDead() === true && zombie.isDead() === true && skeleton.isDead() === true){\n image(backgroundImg, 0, 0, windowWidth, windowHeight);\n push();\n textSize(64);\n fill(255);\n text(\"GAME OVER\", width/2, height/2);\n pop();\n console.log(\"gameover\");\n return;\n }\n else {\n\n // Handle input for the tiger\n creeper.directionKeycode1();\n creeper.handleInput();\n zombie.directionKeycode2();\n zombie.handleInput();\n skeleton.directionKeycode3();\n skeleton.handleInput();\n\n // Move all the \"animals\"\n creeper.move();\n zombie.move();\n skeleton.move();\n sheep.move();\n cow.move();\n pig.move();\n\n // Handle the tiger eating any of the prey\n creeper.handleEating(sheep);\n creeper.handleEating(cow);\n creeper.handleEating(pig);\n\n zombie.handleEating(sheep);\n zombie.handleEating(cow);\n zombie.handleEating(pig);\n\n skeleton.handleEating(sheep);\n skeleton.handleEating(cow);\n skeleton.handleEating(pig);\n\n // Display all the \"animals\"\n creeper.displayCreeper();\n zombie.displayZombie();\n skeleton.displaySkeleton();\n sheep.displaySheep();\n cow.displayCow();\n pig.displayPig();\n\n // End the game when predator dies\n creeper.isDead();\n zombie.isDead();\n skeleton.isDead();\n }\n}", "title": "" }, { "docid": "1f418f5d5960cbf1b489a1229fed3521", "score": "0.65339106", "text": "draw() {\n if (!this.getSprite().getVisible()) {\n this.setAlive(false);\n }\n\n if (this.getLife() && this.getElapsed() > this.getLife()) {\n this.setAlive(false);\n }\n\n this.getSprite().draw();\n }", "title": "" }, { "docid": "83175502123605924138253207129bc0", "score": "0.6530048", "text": "function draw(){\n\tboard.clearRect(0, 0, 512, 512);\n\tfood.draw();\n\tsnake.draw();\n}", "title": "" }, { "docid": "8fb5ce33d7f3f93417f2ff0994b57b83", "score": "0.65257", "text": "draw(player1, player2, foods) {\n this.numTicks++;\n // this.basicSceneDraw(player1, player2, foods);\n background(30);\n fill(10, 255, 50);\n textSize(standardTextSize);\n textAlign(CENTER, TOP);\n text(\"Welcome\", windowWidth / 2, windowHeight / 2);\n }", "title": "" }, { "docid": "8591ea8c7ede4a665afb39b0ae5cc55a", "score": "0.65237004", "text": "function draw() {\n // Background is set to black and changes later in the city scene based\n // on the activity on the \"a\" and \"d\" keys. noStroke() is called in order to\n // make the scene look nicer (especically the clouds).\n backgroundSetup();\n noStroke();\n\n // When the project is ran, the start screen is activated.\n if (screenState === 1) {\n displayStartScreen();\n }\n\n // When the proceed button is pressed, the instructions image is loaded. The\n // cursor is also hidden so it doesn't take away from the scene aesthetics.\n else if (screenState === 2) {\n noCursor();\n instructionsPage();\n }\n\n // When the p (play) button is pressed as prompted, the entire scene is now drawn.\n // The cursor is hidden for the same reason as above.\n else if (screenState === 3) {\n noCursor();\n landscapePortion();\n cityPortion();\n drawCar();\n moveScene();\n changeScenario();\n }\n}", "title": "" }, { "docid": "1c70b63db6a80d16aca5ba1b2005eac9", "score": "0.6520818", "text": "function draw() {\n // Display the grass\n background(garden.grassColor.r, garden.grassColor.g, garden.grassColor.b);\n\n if (state === `title`) {\n title();\n } else if (state === `simulation`) {\n simulation();\n } else if (state === `eaten`) {\n gameOver();\n } else if (state === `survived`) {\n win();\n }\n}", "title": "" }, { "docid": "69ade3489eca41ec1d6f853c0d8361a3", "score": "0.6518012", "text": "function paint()\n\t{\n\t\t\n\t\tctx.fillStyle = 'white';\n\t\tctx.fillRect(0,0, w, h);\t\n\t\n\t\n\tif(screen == 0){\n\t\n\t\tstartButton.draw();\t\t//calls the game start\n\t\toptionButton.draw();\t\t//calls the options menu\n\t\tTitle.picture();\t\t//calls the title text\t\t\n\t\t\t\n\t}\t\t\n\t\t\n\telse if (screen == 1){\n\t\n\t\tpokemonButton.draw();\n\t\tpokedexButton.draw();\n\t\t\n\t}\n\t\n\telse if (screen == 2){\n\t\n\t\t\n\t\n\t}\n\t\t\n\t}////////////////////////////////////////////////////////////////////////////////END PAINT/ GAME ENGINE", "title": "" }, { "docid": "e92af25003e31140c43beff2adce2f72", "score": "0.6516167", "text": "function drawGame() {\n //draw things that don't move or move through player input\n drawBackground();\n drawShelters();\n drawPlayer();\n\n //move scripted objects\n moveBullets();\n moveAndDrawEnemies();\n moveAndDrawRedShip();\n\n //see if any aliens shoot and move their lasers\n for (var i = 0; i < aliens.length; i++) {\n for (var j = 0; j < aliens[i].length; j++) {\n var randomNum = Math.random();\n if (randomNum > .98) enemyShoot();\n }\n }\n moveLasers();\n\n //check all collisions\n checkEnemyCollisions();\n checkShelterCollisions();\n checkPlayerCollisions();\n checkRedShipCollisions();\n}", "title": "" }, { "docid": "93d9da23484c69168b652515b34b8007", "score": "0.6514585", "text": "function draw() {\n // A pink background\n background(255,220,220);\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n avatarVX = 0;\n avatarVY = 0;\n\n // Check which keys are down and set the avatar's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n avatarVX = -avatarSpeed;\n }\n else if (keyIsDown(RIGHT_ARROW)) {\n avatarVX = avatarSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n avatarVY = -avatarSpeed;\n }\n else if (keyIsDown(DOWN_ARROW)) {\n avatarVY = avatarSpeed;\n }\n\n\n if (gameOver === false){\n // Move the avatar according to its calculated velocity\n avatarX = avatarX + avatarVX;\n avatarY = avatarY + avatarVY;\n\n // The enemy always moves at enemySpeed\n enemyVX = enemySpeed;\n // Update the enemy's position based on its velocity\n enemyX = enemyX + enemyVX;\n\n // The player is black\n fill(0);\n // Draw the player as a circle\n ellipse(avatarX,avatarY,avatarSize,avatarSize);\n // The enemy is red\n fill(255,0,0);\n // Draw the enemy as a circle\n ellipse(enemyX,enemyY,enemySize,enemySize);\n\n // Check if the enemy and avatar overlap - if they do the player loses\n // We do this by checking if the distance between the centre of the enemy\n // and the centre of the avatar is less that their combined radii\n if (dist(enemyX,enemyY,avatarX,avatarY) < enemySize/2 + avatarSize/2) {\n death();\n }\n\n // Check if the avatar has gone off the screen (cheating!)\n if (avatarX < 0 || avatarX > width || avatarY < 0 || avatarY > height) {\n death();\n }\n // If player is on their last life, turn lives text colour red.\n if (lives === 0){\n livesCol = 255;\n }\n else{\n livesCol = 0;\n }\n\n // Check if the enemy has moved all the way across the screen\n if (enemyX > width) {\n // This means the player dodged so update its dodge statistic\n dodges = dodges + 1;\n //increase emeny's size by 5;\n enemySize += 10;\n // Reset the enemy's position to the left at a random height\n enemyX = 0;\n enemyY = random(0,height);\n\n avatarY = random(0, height);\n }\n //If the enemy's size is too big to be fair, reset it to the original,\n //but increase it's speed\n if (enemySize === 200){\n enemySpeed = enemySpeed + 1;\n enemySize = 50;\n }\n }\n // if player is out of lives, change gameOver conditional to true\n if (lives < 0){\n gameOver = true;\n }\n\n\n //Display number of dodges and number of lives remaining\n textFont('Courier')\n textSize(32);\n textAlign(LEFT);\n fill(0);\n text(\"Score = \" + dodges, 10, 40);\n fill(livesCol,0,0);\n text(\"Lives = \" + lives, 10, 80);\n newHighscore = dodges;\n console.log(highscore);\n\n if (gameOver === true){\n //check to see if the old highscore is lower than the new\n if (newHighscore > highscore){\n highscore = newHighscore;\n }\n\n background(0);\n textFont('Courier')\n textSize(32);\n textAlign(CENTER);\n fill(255,0,0);\n text(\"GAME OVER\", width/2, height/2);\n text(\"HIGHSCORE: \" + highscore, width/2, height/2-60);\n rectMode(CENTER);\n rect(width/2,height/2+60, width, 50);\n fill(textFill);\n text(\"Click To Play Again\", width/2, height/2+70);\n if (dist(mouseY,mouseY,height/2+60,height/2+60)<50){\n textFill = 255;\n if(mouseIsPressed){\n lives = 3;\n enemySize = 50;\n gameOver = false;\n dodges = 0;\n enemyX = 0;\n enemySpeed = 10;\n }\n }\n else{\n textFill = 0;\n enemyX = 0;\n }\n }\n}", "title": "" }, { "docid": "92d76eb4e7ab9de297617891d7bad6a5", "score": "0.6511846", "text": "function draw(time) {\n\n\n setUpScreen(time);\n\n checkCollision();\n\n drawGate(gate1.x, gate1.y, gate1.type);\n drawGate(gate2.x, gate2.y, gate2.type);\n drawGate(gate3.x, gate3.y, gate3.type);\n\n drawBall();\n ctx.fillStyle = \"#FF0000\";\n ctx.fillText(player.value, ball.x - 4, ball.y + 2);\n\n\n gate1.y = gate1.y + gate1.rate;\n gate2.y = gate2.y + gate2.rate;\n gate3.y = gate3.y + gate3.rate;\n\n tempAPI.update(player.lives);\n\n var speed = {rate1: gate1.rate, rate2:gate2.rate, rate3: gate3.rate};\n speedVis.update(speed);\n\n if (rightPressed && ball.x + ball.radius < canvas.width) {\n ball.x += 4;\n }\n if (leftPressed && ball.x - ball.radius > 0) {\n ball.x -= 4;\n }\n\n canvas.onclick = changePlayerValue;\n\n\n if (player.lives == 0) {\n ctx.textAlign=\"center\";\n ctx.fillText(\"GAME OVER\", (canvas.width/2), canvas.height/2);\n ctx.fillText(\"You've scored \"+player.score+\" points\", (canvas.width/2),(canvas.height/2)+25);\n loadEndMenu();\n pause();\n ctx.textAlign=\"start\"\n }\n\n\n\n\n if (!paused){\n requestAnimationFrame(draw);\n }\n\n}", "title": "" }, { "docid": "2296f52a47ea1e643269f1168393d52f", "score": "0.65028113", "text": "function start() {\n // Create the states\n titleState = new TitleState();\n instructionsState = new InstructionsState();\n gameState = new GameState();\n gameOverState = new GameOverState();\n minigameState = new MinigameState();\n\n // set the current state to title\n whichScreen = titleState;\n\n // create the player and enemy objects\n player = {\n name: \"Player\",\n health: 200,\n maxHealth: 200,\n incoming: 0,\n stun: false,\n x: width/2,\n y: height/2,\n size: width/20+height/20,\n speed: 10,\n vx: 0,\n vy: 0\n }\n enemy = {\n name: \"Enemy\",\n health: 500,\n maxHealth: 500,\n incoming: 0,\n stun: false\n }\n\n // Create the player's deck of abilities (20)\n for (var i = 0; i < 8; i++) {\n let fireSpear = new Ability(\"Fire Spear\", \"Deal damage\", player, enemy, \"damage\", \"number\", 10, playerMinigame, color(255,0,0), 80);\n abilitiesPlayerDeck.push(fireSpear);\n }\n for (var i = 0; i < 3; i++) {\n let cleanse = new Ability(\"Cleanse\", \"Heal self\", player, player, \"heal\", \"number\", 8, playerMinigame, color(0,255,255), 80);\n abilitiesPlayerDeck.push(cleanse);\n }\n for (var i = 0; i < 3; i++) {\n let paralyse = new Ability(\"Paralyse\", \"Stun\", player, enemy, \"stun\", \"status\", 10, playerMinigame, color(255,255,0), 80);\n abilitiesPlayerDeck.push(paralyse);\n }\n for (var i = 0; i < 3; i++) {\n let shield = new Ability(\"Shield\", \"Protect self\", player, player, \"% incoming\", \"number\", -5, playerMinigame, color(0,255,0), 80);\n abilitiesPlayerDeck.push(shield);\n }\n for (var i = 0; i < 3; i++) {\n let curse = new Ability(\"Curse\", \"Weaken enemy\", player, enemy, \"% incoming\", \"number\", 5, playerMinigame, color(255,0,255), 80);\n abilitiesPlayerDeck.push(curse);\n }\n // Shuffle the player's deck\n abilitiesPlayerDeck = shuffle(abilitiesPlayerDeck);\n // The player draws the 5 card starting hand\n for (var i = 0; i < 5; i++) {\n abilitiesHave.push(abilitiesPlayerDeck[0]);\n abilitiesPlayerDeck.splice(0, 1);\n }\n console.log(abilitiesHave);\n // create the list of enemy abilities\n let newEnemyAbility = new Ability(\"Neutron Beam\", \"weaken player by 10% per hit\", enemy, player, \"% incoming\", \"number\", 10, enemyNeutronBeamMinigame, color(random(0, 255), random(0, 255), random(0, 255)), 500);\n enemyAbilitiesHave.push(newEnemyAbility);\n newEnemyAbility = new Ability(\"BulletStorm\", \"deal damage\", enemy, player, \"damage\", \"number\", 10, enemyBulletStormMinigame, color(0), 80);\n enemyAbilitiesHave.push(newEnemyAbility);\n newEnemyAbility = new Ability(\"Static Bolt\", \"stun player if touch 3 times\", enemy, player, \"stun\", \"status\", 3, enemyStaticBoltMinigame, color(255, 255, 0), 350);\n enemyAbilitiesHave.push(newEnemyAbility);\n}", "title": "" }, { "docid": "890ad9818479e23970b204cc837297f4", "score": "0.64999706", "text": "function gameOn() {\n snakeExt();\n checkEnd();\n levelUp();\n clearCanvas();\n drawCanvas();\n}", "title": "" }, { "docid": "c27dbb3bf67f0273efdbec5c73e07b2a", "score": "0.6498805", "text": "function draw() {\n // A pink background\n background(playerTheme,backgroundTheme,enemyTheme);\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n avatarVX = 0;\n avatarVY = 0;\n // fetch random number for random rgb\n rR = random(0,255);\n rG = random(0,255);\n rB = random(0,255);\n // Check which keys are down and set the avatar's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n avatarVX = -avatarSpeed;\n }\n else if (keyIsDown(RIGHT_ARROW)) {\n avatarVX = avatarSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n avatarVY = -avatarSpeed;\n }\n else if (keyIsDown(DOWN_ARROW)) {\n avatarVY = avatarSpeed;\n }\n\n // Move the avatar according to its calculated velocity\n avatarX = avatarX + avatarVX;\n avatarY = avatarY + avatarVY;\n\n // The enemy always moves at enemySpeed (which increases)\n enemyVX = enemySpeed;\n // Update the enemy's position based on its velocity\n enemyX = enemyX + enemyVX;\n\n // Check if the enemy and avatar overlap - if they do the player loses\n // We do this by checking if the distance between the centre of the enemy\n // and the centre of the avatar is less that their combined radii\n if (dist(enemyX,enemyY,avatarX,avatarY) < enemySize/2 + avatarSize/2) {\n // Tell the player they lost\n console.log(\"YOU LOSE!\");\n // Reset the enemy's position\n enemyX = 0;\n enemyY = random(0,height);\n // Reset the enemy's size and speed\n enemySize = 50;\n enemySpeed = 5;\n // Reset the avatar's position\n avatarX = width/2;\n avatarY = height/2;\n // Reset the avatar's Size & speed\n avatarSize = 50;\n avatarSpeed = 10;\n // Reset the dodge counter\n dodges = 0;\n // Reset Score size\n fontSize = 15;\n // Reset SlowMo\n slowMo = false;\n }\n\n // Check if the avatar has gone off the screen (cheating!)\n if (avatarX < 0 || avatarX > width || avatarY < 0 || avatarY > height) {\n // If they went off the screen they lose in the same way as above.\n console.log(\"YOU LOSE!\");\n enemyX = 0;\n enemyY = random(0,height);\n enemySize = 50;\n enemySpeed = 5;\n avatarX = width/2;\n avatarY = height/2;\n avatarSize = 50;\n avatarSpeed = 10;\n dodges = 0;\n fontSize = 15;\n slowMo = false;\n }\n\n // Check if the enemy has moved all the way across the screen\n if (enemyX > width) {\n // This means the player dodged so update its dodge statistic\n dodges = dodges + 1;\n // Tell them how many dodges they have made\n console.log(dodges + \" DODGES!\");\n // increase the size of the score and constrain it to 25\n fontSize = constrain(fontSize + 0.5,15,25);\n // Reset the enemy's position to the left at a random height\n enemyX = 0;\n enemyY = random(0,height);\n // Increase the enemy's speed and size to make the game harder\n enemySpeed = enemySpeed + enemySpeedIncrease;\n enemySize = enemySize + enemySizeIncrease;\n // change size of avatar\n avatarSize = random(1,150);\n avatarSpeed = random(5,17);\n // change colors\n playerTheme = random(0,255);\n backgroundTheme = random(0,255);\n enemyTheme = random(0,255);\n }\n\n // slow motion power\n // every 5 dodges slow motion becomes available\n if (dodges == 5 || dodges == 10 || dodges == 15 || dodges == 20 || dodges == 25 || dodges == 30 || dodges == 35 || dodges == 40 || dodges == 50) {\n slowMo = true;\n }\n // if slow motion is available press the space key to slow enemies\n if ((slowMo == true) && keyIsDown(32)) {\n enemySpeed = (enemySpeed/2.5) + slowSpeed;\n slowMo = false;\n }\n // if slow motion is available show \"PRESS SPACE TO SLOW DOWN\"\n if (slowMo == true) {\n textSize(15);\n fill(rR,rG,rB);\n text(\"Press Space to Slow Down\",450,60);\n } else if (slowMo == false) {\n }\n // End game Screen\n if (dodges == 50){\n enemySpeed = 0;\n fill(rR,rG,rB);\n textSize(15);\n text(\"Wow would you look at that you won!\",250,250);\n }\n // Display the current number of successful in the console\n console.log(dodges);\n\n // The player is black\n fill(playerTheme);\n // Draw the player as a circle\n ellipse(avatarX,avatarY,avatarSize,avatarSize);\n\n // The enemy is red\n fill(enemyTheme,playerTheme,backgroundTheme);\n // Draw the enemy as a circle\n ellipse(enemyX,enemyY,enemySize,enemySize);\n\n // Decorative Circle at the top right\n fill(255);\n ellipse(500,10,100,100);\n // Text elements\n fill(0);\n textSize(15);\n textAlign(RIGHT);\n text(\"You've dodged:\",450,30);\n // Number of dodges\n textSize(fontSize);\n text(dodges,485,31);\n textFont(scoreFont);\n\n\n}", "title": "" }, { "docid": "bf5cedadf0ea65557f103688307a2e0b", "score": "0.6496859", "text": "function draw() {\n if (gameOver) {\n // Make the target image move around and bounce on the walls\n if (targetX+targetImage.width/2+targetVelocityX > width || targetX-targetImage.width/2+targetVelocityX < 0) {\n targetVelocityX = targetVelocityX*-1;\n }\n if (targetY+targetImage.height/2+targetVelocityY > height || targetY-targetImage.height/2+targetVelocityY < 0) {\n targetVelocityY = targetVelocityY*-1;\n }\n targetX+=targetVelocityX;\n targetY+=targetVelocityY;\n image(targetImage,targetX,targetY);\n // Draw a blinking circle around the sausage dog to show where it is\n // (even though they already know because they found it!)\n noFill();\n strokeWeight(5);\n stroke(random(255),random(255),random(255));\n ellipse(targetX,targetY,targetImage.width,targetImage.height);\n // Set text size for the victory message\n textSize(150);\n // White text\n fill(255);\n // Tell them they won!\n text(\"YOU WINNED!\",width/2,height/2);\n // Draw a next level button\n stroke(0);\n strokeWeight(1);\n fill(0, 255, 0);\n rect(width/2+width/20,height-height/4,width/5,height/5);\n textSize(30);\n fill(255);\n text(\"Next Level\",width/2+width/20+width/10,height-height/4+height/10)\n // Draw a reset game button\n fill(255, 0, 0);\n rect(width/2-width/5-width/20,height-height/4,width/5,height/5);\n fill(255);\n text(\"Reset Game\",width/2-width/5-width/20+width/10,height-height/4+height/10)\n playAgain = true;\n }\n}", "title": "" }, { "docid": "5918e71ca8a5395e7ed49feebc51cf63", "score": "0.64761156", "text": "function refreshGlobalDraw() {\n ctx.clearRect(0, 0, main.width, main.height);\n if (game == \"mainMenu\") {\n drawWords(\"b1ack0ut.\", 125, 400, 16, 0);\n oBoxes = [new OptionBox(\"new game\", 340, 550, 6)]\n }\n if (game == \"explore\" || game == \"fight\") {\n if (game == \"explore\") {\n //Draw Room Background\n oBoxes = [new OptionBox(\"move\", 40, 640, 5), new OptionBox(\"look\", 235, 640, 5), new OptionBox(\"items\", 610, 640, 5)]\n currentRoom.name == 'entrance' ? oBoxes.push(new OptionBox(\"exit\", 825, 640, 5)) : \"\"\n\n currentRoom.drawRoom()\n drawWords(\"score: \"+score,750,145,3,0)\n } else {\n oBoxes = [new OptionBox(\"attack\", 40, 640, 4), new OptionBox(\"action\", 235, 640, 4), new OptionBox(\"defend\", 580, 640, 4), new OptionBox(\"escape\", 795, 640, 4)];\n currentRoom.enemy.draw()\n }\n //Draws Lower boxes and player face\n ctx.strokeRect(25, 625, 950, 350);\n ctx.strokeRect(40, 705, 920, 255);\n ctx.fillStyle = \"black\";\n ctx.fillRect(420, 580, 119, 125);\n ctx.strokeRect(420, 580, 119, 125);\n\n //Draws hunger box\n ctx.strokeRect(25, 25, 307, 110);\n drawWords(\"hunger:\", 45, 45, 5, 0);\n ctx.strokeRect(49, 77, 258, 35);\n ctx.fillStyle = \"green\";\n ctx.fillRect(55, 83, 247 * (mainC.hunger > 0 ? mainC.hunger / 100: 0), 23);\n\n //Draws health box\n ctx.strokeRect(342, 25, 307, 110);\n drawWords(\"health:\", 362, 45, 5, 0);\n ctx.strokeRect(366, 77, 258, 35);\n ctx.fillRect(372, 83, 247 * (mainC.hp > 0 ? (mainC.hp / mainC.totalHp): 0 ), 23);\n\n //Draws Mood\n ctx.strokeRect(659, 25, 307, 110);\n drawWords(\"mood:\", 679, 45, 5, 0);\n state = \"\";\n if (mainC.sanity >= 80) {\n state = \"cool\"\n face_x = 0\n }\n if (mainC.sanity < 80 && mainC.sanity >= 50) {\n state = \"anxious\";\n color = {r: 255, g: 255, b: 0}\n face_x = 1\n }\n if (mainC.sanity < 50 && mainC.sanity >= 20) {\n state = \"paranoid\";\n color = {r: 255, g: 150, b: 0}\n face_x = 2\n }\n if (mainC.sanity < 20) {\n state = \"psychotic\";\n color = {r: 255, g: 0, b: 0}\n face_x = 3\n }\n spriteArray.mc.draw(426, 585, 5, {x: face_x, y: 0});\n drawWords(state, 685, 82, 5, 0);\n coloredMood = ctx.getImageData(685, 82, 265, 35);\n if (state != \"cool\") {\n d = coloredMood.data;\n for (i = 0; i < d.length; i += 4) {\n if (!(d[i] == 0 && d[i + 1] == 0 && d[i + 2] == 0)) {\n d[i] = color.r; // red\n d[i + 1] = color.g; // green\n d[i + 2] = color.b // blue\n }\n }\n }\n ctx.putImageData(coloredMood, 685, 82)\n }\n if (game == \"items\") {\n oBoxes = [new OptionBox(\"back\", 450, 900, 5)];\n ctx.strokeRect(25, 25, 950, 950);\n drawLine(500, 25, 500, 705);\n drawWords(\"items\", 200, 50, 5, 0);\n drawWords(\"status\", 675, 50, 5, 0);\n ctx.strokeRect(40, 705, 920, 255);\n drawWords(\"health: \" + mainC.hp + \"/\" + mainC.totalHp, 515, 150, 5, 0);\n drawWords(\"hunger: \" + mainC.hunger + \"/100\", 515, 200, 5, 0);\n\n itemSlots.forEach(function (it) {\n it.draw()\n });\n if (globalItemIndex != null && itemSlots[globalItemIndex].item != null) {\n item = itemSlots[globalItemIndex].item;\n drawWords(item.name, 325, 725, 5, 0);\n drawLine(325, 755, 325 + 29 * item.name.length - 2, 755);\n drawWords(item.desc, 60, 775, 5, 0)\n } else {\n ctx.clearRect(60, 725, 850, 150)\n }\n }\n if (game == \"gameover\") {\n drawWords(\"game over.\", 100, 400, 16, 0);\n drawWords(\"final score: \"+score,250,500,5,0)\n oBoxes = [new OptionBox(\"try again?\", 340, 555, 6)]\n cont = false\n }\n oBoxes.forEach(function (e) {\n e.drawOptionBox()\n });\n if (game != \"mainMenu\" && optionMenu != null) optionMenu.drawMenu();\n\n if (mapMenuActive) {\n ctx.fillStyle = \"black\";\n\n if(outside){\n ctx.fillRect(110, 150, 780, 650);\n ctx.strokeRect(110, 150, 780, 650);\n ctx.beginPath();\n ctx.lineWidth = 10\n ctx.arc(500,500,145,0,2*Math.PI);\n spr = new Sprite(155, 172, 34, 34).draw(398, 398, 6)\n dirOpt =[new OptionBox(\"north\", 415, 250, 5), new OptionBox(\"south\", 415, 710, 5)]\n console.log()\n if(currentRoom.moveOpts.east != null){\n dirOpt.push(new OptionBox(\"east\",690,475,5))\n }if(currentRoom.moveOpts.west != null){\n dirOpt.push(new OptionBox(\"west\",170,475,5))\n }\n ctx.stroke();\n ctx.lineWidth = 5\n dirOpt.forEach(function (e) {\n e.drawOptionBox()\n });\n }else {\n ctx.fillRect(200, 150, 600, 650);\n ctx.strokeRect(200, 150, 600, 650);\n for (i = 0; i < currentHouse.matrix.length; i++) {\n for (j = 0; j < currentHouse.matrix[i].length; j++) {\n ctx.strokeStyle = \"white\";\n ctx.fillStyle = \"white\";\n if (currentHouse.matrix[i][j] != \"closed\" && currentHouse.matrix[i][j] != null) {\n l = 95;\n w = 95;\n if (currentHouse.matrix[i][j] == \"open\"){\n ctx.strokeStyle = \"yellow\"\n }\n else if (currentHouse.matrix[i][j] == \"entrance\" || currentHouse.matrix[i][j].name == \"entrance\") {\n ctx.strokeStyle = \"green\"\n }\n currentRoom.name == \"entrance\" ? ctx.fillStyle = \"green\" : ctx.fillStyle = \"white\";\n if (currentRoom == currentHouse.matrix[i][j]) {\n ctx.fillRect(115 * i + 220, 115 * j + 220, w, l)\n } else {\n ctx.strokeRect(115 * i + 220, 115 * j + 220, w, l)\n }\n //console.log(\"checking adjacent room for space at: [\"+i+\",\"+j+\"]\")\n if (currentHouse.matrix[i][j] != currentRoom && adjacentRoom(i, j)) {\n //console.log(\"creating room option\")\n roomOpt.push({\n indI: i,\n indJ: j,\n x: 115 * i + 220,\n y: 115 * j + 220,\n w: w,\n h: l,\n in: function (x, y) {\n if (x >= this.x && x <= this.x + this.w && y >= this.y && y <= this.y + this.h) {\n return true\n }\n }\n })\n }\n }\n }\n }\n }\n drawWords(\"where?\",415,165,5,0)\n ctx.strokeStyle = 'green';\n }\n if(drawOpenChest != null || drawCatto){\n ctx.fillStyle = \"black\"\n ctx.fillRect(335,335,290,215)\n drawCatto ? new Sprite(106, 172, 49, 34).draw(350, 350, 5) : spriteArray.misc.draw(345, 350,5,{x:drawOpenChest,y:0})\n ctx.strokeRect(335,335,290,215)\n }\n if(anim != null) anim.play()\n}", "title": "" }, { "docid": "024f63dd9620e35b7f5a204648d41097", "score": "0.6474867", "text": "function draw() {\n\tbackground(10, 200, 10);\n\n\tif(statusMachine == 0){\n\t\tdrawHello();\n\t\tif (mouseIsPressed) {\n \t\tstroke(237, 34, 93);\n \t\tfill(237, 34, 93);\n \t\tellipse(mouseX, mouseY, 500, 500);\n \t\tstatusMachine++;\n \t\t}\n\n\t}\n\telse if(statusMachine == 1){\n\t\tdraw321();\n\t\tcounterTime = int((millis() - counterTimer_Start)/1000);\n\t\tif(counterTime > timerLeftMachineStatus){\n\t\t\tstatusMachine ++;\n\t\t\tcounterTimer_Start = millis();\n\t\t}\n\t}\n\telse if(statusMachine == 2){ \n\t\tdrawJoystick_XY();\n\t\t//drawJoystick_A();\n\t\t//drawJoystick_B();\n\t}\n\telse if(statusMachine == 3){\n\t\tdrawFinish();\n\t\tcounterTime = int((millis() - counterTimer_Start)/1000);\n\t\tif(counterTime > timerLeftMachineStatus){\n\n\t\t\tlocation.reload();\n\t\t\t//statusMachine = 0;\n\t\t\t//timerLeftMachineStatus = millis();\n\t\t\t//setup();\n\t\t}\n\t}\n\t\n\tdrawMouse();\n}", "title": "" }, { "docid": "2236df083d22c65a072dd58541857b27", "score": "0.64702314", "text": "function draw() {\r\n if (currentScene === 1) {\r\n drawTitleScreen();\r\n drawPlayButton();\r\n drawPractiseButton();\r\n drawRules();\r\n hint.draw();\r\n hint.update();\r\n batjeA.breedte = 20;\r\n batjeA.hoogte = 200 - 0.5*batjeA.size;\r\n batjeB.breedte = 380;\r\n batjeB.hoogte = 200 - 0.5*batjeB.size;\r\n goalSign();\r\n }\r\n if (currentScene === 2) { // zoals je kan zien wordt dit getekent bij scene 2\r\n drawPongTheGame();\r\n drawScoreBoard();\r\n drawBatjeA();\r\n drawBatjeB();\r\n batjesUpdate();\r\n goalSign();\r\n // print(PowerUpNr);\r\n // print(powerUp.X, powerUp.Y);\r\n }\r\n if (currentScene === 3) { // en onderstaande wordt getekent bij scene 3\r\n drawPractiseRoom();\r\n drawBackButton();\r\n drawScoreBoardPractise();\r\n drawBatjeB();\r\n batjesUpdate();\r\n }\r\n if (currentScene === 10) {\r\n drawTitleScreenExtreme();\r\n drawTitleAnimation();\r\n drawPlayExtremeButton();\r\n drawPractiseExtremeButton();\r\n drawRulesExtreme();\r\n PowerUpNr = 0; \r\n ball.kleur1 = 245;\r\n ball.kleur2 = 255;\r\n ball.kleur3 = 51;\r\n batjeA.breedte = 20;\r\n batjeA.hoogte = 200 - 0.5*batjeA.size;\r\n batjeB.breedte = 380;\r\n batjeB.hoogte = 200 - 0.5*batjeB.size;\r\n ball.Xpos = 200;\r\n ball.Ypos = 200;\r\n speeding = 1;\r\n }\r\n if (currentScene === 11){\r\n drawPongExtreme();\r\n drawBatjeAExtreme();\r\n drawBatjeBExtreme();\r\n drawScoreBoardExtreme();\r\n batjesUpdate();\r\n drawPowerUps();\r\n goalSign();\r\n }\r\n if(currentScene === 12){\r\n drawRulesScreenExtreme();\r\n drawBackButton();\r\n drawTitleAnimation();\r\n \r\n \r\n }\r\n if(surpriseBart === true){\r\n bSurprise();\r\n }\r\n}", "title": "" }, { "docid": "f9ed34a22503a6d08850fe3bb3e41c92", "score": "0.64697033", "text": "drawGameOver() {\n this.drawBkg();\n this.drawCharacter();\n this.displayFinalResult();\n }", "title": "" }, { "docid": "c05d97e5b49fc47861f41a0fde057df8", "score": "0.6459773", "text": "function Draw()\n {\n ctx.clearRect(0, 0, gameBoardCanvas.width, gameBoardCanvas.height);\n DrawSafePlatforms();\n DrawUnSafePlatforms();\n DrawCollisionObjects();\n DrawPlayer();\n if(player.Score < 20)\n DrawScore(player.badScoreColor);\n else if(player.Score <= 50)\n DrawScore(player.mediocreScoreColor);\n else if(player.Score >= 51)\n DrawScore(player.goodScoreColor);\n // DrawPositions();\n // DrawPositions2();\n }", "title": "" }, { "docid": "317c7b868c913c56c43e922edaa28da1", "score": "0.64567155", "text": "function draw() {\n \n // Clear canvas every frame so images can be redrawn\n background(0);\n \n if (systemState == \"play\") {\n // Runs kinematic system for game\n kinematicSystem();\n\n playerCameraSystem();\n\n if (keyIsPressed && (keyCode == 69 && !justPressed)) {\n justPressed = true;\n systemState = \"edit\";\n\n } else if (!keyIsPressed) {\n justPressed = false;\n\n }\n\n } else if (systemState == \"edit\") {\n // enables camera movement through camera dragging\n cameraMouseDrag();\n\n // draws grid on canvas\n drawGrid();\n\n if (keyIsPressed && (keyCode == 69 && !justPressed)) {\n justPressed = true;\n systemState = \"play\";\n\n } else if (!keyIsPressed) {\n justPressed = false;\n\n }\n }\n\n // Runs collision system for game\n collisionSystem();\n\n \n \n}", "title": "" }, { "docid": "64b1c212f79ead206db7e71040b7adad", "score": "0.6454981", "text": "function draw() {\n\tbackground(0);\n\tpopulation.run();\n\tlifeP.html(count);\n\tgenerationP.html(generation);\n\tcount++;\n\n\t//Create a new generation of rockets every 400 frames\n\tif(count == lifespan) {\n\t\tpopulation.evaluate();\n\t\tpopulation.selection();\n\t\tcount = 0;\n\t\tgeneration++;\n\t}\n\n\t//Create the obstacle\n\tfill(255);\n\tnoStroke();\n\trect(rx, ry, rw, rh);\n\n\t//Create the target\n\tellipse(target.x, target.y, 16, 16)\n}", "title": "" }, { "docid": "a84d0006091ee27d734a108e6e4bece1", "score": "0.64535373", "text": "function draw()\r\n{\r\n // clear\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n if(!next1){\r\n for(var i = 0; i < 6; i++){\r\n level1[i].draw();\r\n }\r\n for(i = 0; i<5; i++){\r\n book1[i].draw();\r\n }\r\n for(i = 0; i<5; i++){\r\n book2[i].draw();\r\n }\r\n if(checkCollisions(player, book2[2])){\r\n arrowShow = true;\r\n P6.innerHTML = \"Paper, 5(level 4)\";\r\n document.body.appendChild(P6);\r\n }\r\n if(arrowShow && arrowShow1){\r\n arrowShown = true;\r\n arrow.draw();\r\n window.setTimeout(function(){\r\n arrowShow = false;\r\n }, 2000);\r\n }\r\n } \r\n if(!next2){\r\n for(var i = 0; i < num1; i++){\r\n level2[i].draw();\r\n }\r\n for(var i = 0; i < 5; i++){\r\n bags[i].draw();\r\n }\r\n if(checkCollisions(player, wrench)){\r\n wrenchShow = true;\r\n P1.innerHTML = \"Wrench, 1\";\r\n noteChange = true;\r\n note.y = 455;\r\n document.body.appendChild(P1);\r\n //Inventory();\r\n }\r\n if(wrenchShow){\r\n wrench.x = 250;\r\n wrench.y = 200;\r\n wrench.width = 90;\r\n wrench.height = 120;\r\n wrenchShown = true;\r\n window.setTimeout(function(){\r\n wrench.x = 270;\r\n wrench.y = 520;\r\n wrench.width = 20;\r\n wrench.height = 30;\r\n wrenchShow = false;\r\n }, 2000);\r\n }\r\n if(checkCollisions(player, note) && noteChange){\r\n note.x = 60;\r\n note.y = 20;\r\n note.width = 200;\r\n note.height = 400;\r\n window.setTimeout(function(){\r\n note.x = 80;\r\n note.y = 455;\r\n note.width = 50;\r\n note.height = 40;\r\n }, 2000);\r\n }\r\n if(keys[\" \"]){\r\n switch(checkCollisions(bags[2], player)){\r\n case false:\r\n alert(\"There is nothing in this bag. Try another one!\");\r\n keys[\" \"] = false;\r\n break;\r\n case true:\r\n keys[\" \"] = false;\r\n P2.innerHTML = \"Apple, 3\";\r\n document.body.appendChild(P2);\r\n apple.x = 450;\r\n apple.y = 200;\r\n apple.width = 120;\r\n apple.height = 120;\r\n appleShown = true;\r\n window.setTimeout(function(){\r\n apple.x = 530;\r\n apple.y = 490;\r\n apple.width = 30;\r\n apple.height = 30;\r\n }, 2000);\r\n clickYN = true\r\n break;\r\n }\r\n } \r\n }\r\n function Clicked(){\r\n couch.draw();\r\n //couch.style.draggable = \"true\";\r\n document.addEventListener(\"click\", Clickey)\r\n click = true;\r\n }\r\n if(next3 == false){\r\n document.getElementById(\"gc\").style.filter = \"brightness(20%)\";\r\n couchI.src = \"couch2.png\";\r\n for(i = 0; i<2; i++){\r\n L3[i].draw();\r\n }\r\n if(FLShow == true){\r\n FL.draw();\r\n }\r\n if(yesL3 == true){\r\n for(i = 0; i<3; i++){\r\n L3S[i].draw();\r\n }\r\n }\r\n if(KShow == true){\r\n knife.draw();\r\n }\r\n Clicked();\r\n if(keys[\"1\"] && click == true){\r\n document.body.removeChild(P1);\r\n wrenchShow = true;\r\n wrench.x = board.x+20;\r\n wrench.y = board.y+20;\r\n wrench.width = 50;\r\n wrench.height = 40;\r\n window.setTimeout(function(){\r\n yesL3 = false;\r\n wrenchShow = false;\r\n FLShow = true;\r\n }, 1000);\r\n }\r\n if(checkCollisions(player, FL) && yesL3 == false){\r\n FLShow = false;\r\n FLShown = true;\r\n P3.innerHTML = \"Flashlight, 2\";\r\n document.body.appendChild(P3)\r\n window.setTimeout(function(){\r\n couch.x = 50;\r\n // window.setTimeout(function(){\r\n // document.getElementById(\"gc\").style.background = \"url('darkRoom.jpg')\";\r\n // document.getElementById(\"gc\").style.backgroundSize = \"cover\";\r\n // couchI.style.filter = \"brightness(20%)\";\r\n // }, 2000)\r\n }, 2000)\r\n }\r\n if(yesL3 == false && keys[\"2\"]){\r\n flashI.src = \"FL2.png\";\r\n FLShow = true;\r\n FL.x = player.x + 10;\r\n FL.y = player.y + 50;\r\n document.getElementById(\"gc\").style.filter = \"brightness(50%)\";\r\n if(checkCollisions(FL, couch)){\r\n couchI.src = \"couch.png\";\r\n }\r\n // if(checkCollisions(player, BO)){\r\n // BO.x = 200;\r\n // BO.y = 150;\r\n // BookOCI.src = \"bookOpen.png\";\r\n // }\r\n }\r\n if(checkCollisions(player, BO) && KShown == false){\r\n BO.x = 200;\r\n BO.y = 150;\r\n BO.width = 240;\r\n BO.height = 180; \r\n BookOCI.src = \"bookOpen.png\";\r\n KShow = true;\r\n if(checkCollisions(player, knife)){\r\n P4.innerHTML = \"knife, 3\";\r\n document.body.appendChild(P4);\r\n KShown = true;\r\n KShow = false;\r\n }\r\n window.setTimeout(function(){\r\n BO.x = 310;\r\n BO.y = 465;\r\n BO.width = 40;\r\n BO.height = 30; \r\n BookOCI.src = \"bookC.png\";\r\n KShow = false;\r\n }, 3000);\r\n }\r\n if(keys[\"3\"] && KAShown == false && FLShown == true){\r\n appleShow = true;\r\n KShow = true;\r\n apple.x = knife.x - 80;\r\n apple.y = knife.y;\r\n apple.width = 100;\r\n apple.height = 100;\r\n document.body.removeChild(P2);\r\n document.body.removeChild(P4);\r\n window.setTimeout(function(){\r\n KShow = false;\r\n appleShow = false;\r\n keyShow = true;\r\n KAShown = true;\r\n }, 2000)\r\n }\r\n if(appleShow == true){\r\n apple.draw();\r\n }\r\n if(keyShow == true){\r\n key.draw();\r\n }\r\n if(checkCollisions(player, key) && KAShown == true){\r\n P5.innerHTML = \"Key, 4\";\r\n document.body.appendChild(P5);\r\n keyShow = false;\r\n keyShown = true;\r\n // door3 = true;\r\n }\r\n }\r\n function OpenSafeCheck(){\r\n OpenSafe();\r\n }\r\n if(next4 == false){\r\n for(var i = 0; i<2; i++){\r\n level4[i].draw();\r\n }\r\n if(pageShow == true){\r\n code.draw(); \r\n }\r\n if(keys[\"2\"]){\r\n flashI.src = \"FL2.png\";\r\n FLShow = true;\r\n FL.x = player.x + 10;\r\n FL.y = player.y + 50;\r\n document.getElementById(\"gc\").style.filter = \"brightness(50%)\";\r\n }\r\n if(keys[\"5\"]){\r\n pageShow = true;\r\n window.setTimeout(function(){\r\n pageShow = false;\r\n }, 2000)\r\n }\r\n if(keys[\" \"]){\r\n if(clicked1 == false){\r\n OpenSafeCheck();\r\n }\r\n // answer1 = prompt(\"what is the code to open the safe?\");\r\n // if(answer1 == \"65792\"){\r\n // doorShow = true;\r\n // clicked1 = true;\r\n // }\r\n // else{\r\n // alert(\"That is not the answer\");\r\n // clicked1 = true;\r\n // document.setTimeout(function(){\r\n // clicked1 = false;\r\n // }, 2000)\r\n // }\r\n // }\r\n }\r\n if(doorShow == true){\r\n Door123.draw();\r\n }\r\n if(keys[\"4\"]){\r\n doorI.src = \"DoorO.png\";\r\n doorShow = true;\r\n document.body.removeChild(P5);\r\n }\r\n }\r\n\r\n player.draw(); \r\n}", "title": "" } ]
45e2c4c49433d7bc74078fd28cb0c4dd
Visit a parse tree produced by PlSqlParsermaximize_standby_db_clause.
[ { "docid": "0957f6d787b6c0c138b7a20ff17a03fb", "score": "0.7801488", "text": "visitMaximize_standby_db_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" } ]
[ { "docid": "54c100715f38eb18da9c3a1fb03678d1", "score": "0.6835056", "text": "visitActivate_standby_db_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e01b5ff723cd7798af8e9e1b81fb48ee", "score": "0.67495525", "text": "visitStandby_database_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "afc0b8116272760e4a8d020f3da5332a", "score": "0.6301495", "text": "visitStop_standby_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "84bc0890775a21c25942bfeedffd404a", "score": "0.6278363", "text": "visitStart_standby_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "7e87e5517bc597dcc6be38871c7fcf1b", "score": "0.53816587", "text": "visitManaged_standby_recovery(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "7b40af67b1c9cec426e47bafed2191fa", "score": "0.5354649", "text": "visitDatabase(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "5222e773ccd49283a9af394373dbe18f", "score": "0.52289754", "text": "visitConvert_database_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "df0e51306c12e3bc66055a8f40620a5d", "score": "0.5201945", "text": "visitQuery_block(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "84c54d779228705939bb46aaf42ad6bf", "score": "0.5175051", "text": "visitAlter_database(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "5ac08f167a5899ace1303b618c877733", "score": "0.50801456", "text": "visitFull_database_recovery(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "81716b3a6ccbc06ff45b663d9cb919b4", "score": "0.5056927", "text": "function parse_Statement(){\n\tdocument.getElementById(\"tree\").value += \"PARSER: parse_Statement()\" + '\\n';\n\n\tCSTREE.addNode('Statement', 'branch');\n\n\t\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\t\n\t\n\tif (tempDesc == ' print'){\n\t\tparse_PrintStatement();\n\t\n\n\t\t\t\t\n\t}\n\telse if(tempType == 'identifier'){\n\t\tparseCounter = parseCounter + 1;\n\t\t\n\t\tvar desc = tokenstreamCOPY[parseCounter][0];\n\t\t\n\t\tif (desc == ' ='){\n\t\t\t\n\t\tparseCounter = parseCounter - 1;\n\t\t\n\t\tparse_AssignmentStatement();\n\t\t}\n\t\n\t\t\n\t}\n\telse if (tempType == 'type'){\n\t\t\n\t\tparse_VarDecl();\n\n\t\t\n\t}\n\telse if (tempDesc == ' while'){\n\t\tparse_WhileStatement();\n\n\t\t\n\t}\n\telse if (tempDesc == ' if'){\n\t\tparse_IfStatement();\n\n\t\t\n\t}\n\telse if (tempDesc == '{'){\n\t\tparse_Block();\n\n\t\t\n\t}\n\tCSTREE.endChildren();\n\n\t\n\t\n}", "title": "" }, { "docid": "1da66500e1ba324ba30d944d614357a9", "score": "0.5003103", "text": "visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "306ef2eb86711fe6fab03dc71579bed6", "score": "0.49940744", "text": "visitSql_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "3760608b53c702af1dcb477220ab1239", "score": "0.49641013", "text": "visitHierarchical_query_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "8f38cb6ac7d47651c71a04c229261711", "score": "0.4950863", "text": "function SqlParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "fded8ae4f2459dc31247e288e32595d8", "score": "0.49255174", "text": "function parse_StatementList(){\n\t\n\n\t\n\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\n\tif (tempDesc == ' print' || tempType == 'identifier' || tempType == 'type' || tempDesc == ' while' || tempDesc == ' if' || tempDesc == '{' ){ //if next token is a statment\n\t\tdocument.getElementById(\"tree\").value += \"PARSER: parse_StatementList()\" + '\\n';\n\t\tCSTREE.addNode('StatementList', 'branch');\n\t\t\n\t\t\n\t\tparse_Statement(); \n\t\n\t\tparse_StatementList();\n\t\t\n\t\tCSTREE.endChildren();\n\t\n\t\t\n\t\t\n\t}\n\telse{\n\t\t\n\t\t\n\t\t//e production\n\t}\n\n\n\n\n\t\n\t\n}", "title": "" }, { "docid": "977b817dcdd0b92a6b25f4159cff87ea", "score": "0.48557565", "text": "function statementVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "3763abd13708dc362d6a2218a0b6f465", "score": "0.4840576", "text": "visitFlashback_query_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a9be2b314b469f0f7093d38f4aee7541", "score": "0.48110765", "text": "visitDatabase_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "826677e5c2fcd5e7f14475dfccb21f6c", "score": "0.48092732", "text": "visitSupplemental_plsql_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "95f8f0989ee338a4c938d72474465328", "score": "0.47919127", "text": "visitSupplemental_db_logging(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "9a7fdfe53ac951c6d90baf5c4a91cff6", "score": "0.4774403", "text": "visitStatement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "40f4a73eadc136d8131fbed88650b47b", "score": "0.47531664", "text": "function sql92Listener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "748cbab2f6cc6768fe3d95b04d52e8ba", "score": "0.47449955", "text": "visitPartial_database_recovery(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "9e191e13f439154cd6666fcb5e1f4135", "score": "0.46907058", "text": "function parse_Expr(){\n\tdocument.getElementById(\"tree\").value += \"PARSER: parse_Expr()\" + '\\n';\n\tCSTREE.addNode('Expr', 'branch');\n\n\t\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\t\n\tif(tempType == 'digit'){\n\t\tparse_IntExpr();\n\t\tCSTREE.endChildren();\n\t\t\n\t\t\n\t\n\t\t\n\t}\n\telse if (tempDesc == ' \"'){\n\t\tparse_StringExpr();\n\t\tCSTREE.endChildren();\n\t}\n\telse if (tempDesc == '(' || tempType == 'boolval'){\n\t\tparse_BooleanExpr();\n\t\tCSTREE.endChildren();\n\t\n\t\t\n\t}\n\telse if (tempType == 'identifier' ) {\n\t\tparse_ID();\n\t\tCSTREE.endChildren();\n\t\tCSTREE.endChildren();\n\t\t\n\t\n\t\t\n\t}\n\t\n\t\t\n\tCSTREE.endChildren();\t\n\t\n\t\n}", "title": "" }, { "docid": "87cdcd5a577ebb81ed9f1df4b539d592", "score": "0.4667263", "text": "visitSelect_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "df7de12b700fe1a91badfc42903d2b03", "score": "0.46578088", "text": "visitRecords_per_block_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "3a6bf14036acf323cba4dd37948971e5", "score": "0.46495485", "text": "visitUpgrade_table_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "41cdfd0c83bb1e2022013b94fd22539c", "score": "0.46462405", "text": "visitSql_statement_shortcut(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f63a930fabf3c875c3943424720a8db7", "score": "0.4620619", "text": "visitRecovery_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "478555388a4871d8f1a69408cc70da51", "score": "0.46169955", "text": "visitBuild_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1af09eb2e95d8273acb7923165031ea5", "score": "0.46155092", "text": "visitSql_script(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "6ea4e06e001fc5a17d1b3984d9a4d7e4", "score": "0.46095243", "text": "function makeStatement(d, b)\n{\n if (rnd(TOTALLY_RANDOM) == 2) return totallyRandom(d, b);\n\n if (rnd(2))\n return makeBuilderStatement(d, b);\n\n if (d < 6 && rnd(3) === 0)\n return makePrintStatement(d, b);\n\n if (d < rnd(8)) // frequently for small depth, infrequently for large depth\n return makeLittleStatement(d, b);\n\n d = rnd(d); // !\n\n return (Random.index(statementMakers))(d, b);\n}", "title": "" }, { "docid": "808a90d3379a88a6d049cbb9b084bbb5", "score": "0.46008053", "text": "visitOpen_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "6bf3db2479e11863be8cafc87bbba43b", "score": "0.456701", "text": "visitLob_retention_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "0a06933e9aef5d6c5210067216a39b9a", "score": "0.45560956", "text": "visitRaise_stmt(ctx) {\r\n console.log(\"visitRaise_stmt\");\r\n if (ctx.test() !== null) {\r\n return { type: \"RaiseStatement\", info: this.visit(ctx.test(0)) };\r\n }\r\n }", "title": "" }, { "docid": "b452949fb11e45bcec66acb0a915e0ec", "score": "0.4549326", "text": "visitFlashback_archive_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "be18578cd7207d388976d801d2c213cb", "score": "0.45446563", "text": "visitModify_lob_storage_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "323331989f5b33041d2c6b0e8117dfe8", "score": "0.45443612", "text": "visitRebuild_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c9393da84741294fe6b4317f513d53c8", "score": "0.45392802", "text": "visitFlashback_mode_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b781990ca77195890765526bb8a04ee6", "score": "0.45311496", "text": "visitWrite_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1ef6a1955e061d53ccf5315c69161663", "score": "0.4528649", "text": "visitExplain_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a2bd01ee64625771441968f04580220f", "score": "0.450873", "text": "function SqlParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "title": "" }, { "docid": "9c291acd16956fcffe2321f55b514ea1", "score": "0.4492977", "text": "visitDatabase_file_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "9c1add8859ddc2d6fa0af380c7452b83", "score": "0.4490381", "text": "visitSql_operation(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f1b05564a0c86c3f5c861f2514456ead", "score": "0.44855076", "text": "visitTablespace_state_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "7f58c9c50458852685baa41ad871cb32", "score": "0.44820058", "text": "visitExpr_stmt(ctx) {\r\n console.log(\"visitExpr_stmt\");\r\n if (ctx.augassign() !== null) {\r\n return {\r\n type: \"AugAssign\",\r\n left: this.visit(ctx.testlist_star_expr(0)),\r\n right: this.visit(ctx.getChild(2)),\r\n };\r\n } else {\r\n let length = ctx.getChildCount();\r\n let right = this.visit(ctx.getChild(length - 1));\r\n for (var i = length; i > 1; i = i - 2) {\r\n let temp_left = this.visit(ctx.getChild(i - 3));\r\n right = {\r\n type: \"Assignment\",\r\n left: temp_left,\r\n right: right,\r\n };\r\n }\r\n return right;\r\n }\r\n }", "title": "" }, { "docid": "51869a5385a9f52dc526614cd3ca9017", "score": "0.4458765", "text": "visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "92c949f733769f2272672f65bdc385b4", "score": "0.44386622", "text": "function processBottomEdge() {\n processEdge(\n [currentLevelMinIndex, currentLevelMaxIndex],\n c => {\n return c[0] <= currentLevelMaxIndex\n }, // highest value is always bottom right corner\n c => {\n c[0]++\n return c\n }\n ) // traverse towards right edge\n}", "title": "" }, { "docid": "32b7be375da2e6df30b4832c19188dca", "score": "0.44382665", "text": "visitStmt(ctx) {\r\n console.log(\"visitStmt\");\r\n if (ctx.simple_stmt() !== null) {\r\n return {\r\n type: \"SimpleStatement\",\r\n value: this.visit(ctx.simple_stmt()),\r\n };\r\n } else {\r\n return {\r\n type: \"CompoundStatement\",\r\n value: this.visit(ctx.compound_stmt()),\r\n };\r\n }\r\n }", "title": "" }, { "docid": "a94e239cc7192a57be4b7f8ad8ac8c47", "score": "0.44243667", "text": "visitLob_storage_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "ed6ac945588e02dc4ba3f255c086f08a", "score": "0.44233382", "text": "function parseTopLevel(node) {\n var first = true;\n if (!node.body) node.body = [];\n while (tokType !== _eof) {\n var stmt = parseStatement(true);\n node.body.push(stmt);\n if (first && isUseStrict(stmt)) setStrict(true);\n first = false;\n }\n\n lastStart = tokStart;\n lastEnd = tokEnd;\n lastEndLoc = tokEndLoc;\n return finishNode(node, \"Program\");\n }", "title": "" }, { "docid": "ed6ac945588e02dc4ba3f255c086f08a", "score": "0.44233382", "text": "function parseTopLevel(node) {\n var first = true;\n if (!node.body) node.body = [];\n while (tokType !== _eof) {\n var stmt = parseStatement(true);\n node.body.push(stmt);\n if (first && isUseStrict(stmt)) setStrict(true);\n first = false;\n }\n\n lastStart = tokStart;\n lastEnd = tokEnd;\n lastEndLoc = tokEndLoc;\n return finishNode(node, \"Program\");\n }", "title": "" }, { "docid": "88e9f65f0e22da0de97bde9f9f317a50", "score": "0.44232175", "text": "visitSelect_only_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "ea2e55749378018994ccb3f63f599522", "score": "0.44199803", "text": "visitPermanent_tablespace_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "649ef1dd269b34ab286833faf9587f4e", "score": "0.4412926", "text": "visitDml_table_expression_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f3a0b48c619c363e353cd3b675938a88", "score": "0.4386105", "text": "visitPartial_database_recovery_10g(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "3d6965cc6bc4b90c615d0cd9815e2309", "score": "0.43828237", "text": "visitForall_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a972daac9e21bb150f925c39b661baa0", "score": "0.43740013", "text": "visitUpdate_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e09d1188cdfe56fb1c1e597c8466fa59", "score": "0.436953", "text": "visitAlter_mapping_table_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "d0da900b4b395e42e1fc209d7c229b15", "score": "0.43650022", "text": "visitWindowing_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f7a0f2ad6c9be76007887da6cea19263", "score": "0.43540382", "text": "visitExtent_management_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "ee34d4ffb5b609aa466ea4c652d91661", "score": "0.43526217", "text": "function statementExpr(lastClause) {\n\t \n\t return function(ascent) {\n\t \n\t // kick off the evaluation by passing through to the last clause\n\t var exprMatch = lastClause(ascent);\n\t \n\t return exprMatch === true ? head(ascent) : exprMatch;\n\t };\n\t }", "title": "" }, { "docid": "b728b743dfc5d8cf9d1c0fdace4c0306", "score": "0.4349202", "text": "function collapsibleBlockTreeProcessor () {\n this.process((doc) => {\n for (const block of doc.findBy({ context: 'example' }, (candidate) => candidate.isOption('collapsible'))) {\n idAttr = block.getId() ? ` id=\"${block.getId()}\"` : ''\n classAttr = block.isRole() ? ` class=\"${block.getRole()}\"` : ''\n source_lines = []\n source_lines.push(`<details${idAttr}${classAttr}>`)\n if (block.hasTitle()) source_lines.push(`<summary class=\"title\">${block.getTitle()}</summary>`)\n source_lines.push('<div class=\"content\">')\n source_lines.push(block.getContent().split('\\n'))\n source_lines.push('</div>')\n source_lines.push('</details>')\n siblings = block.getParent().getBlocks()\n siblings[siblings.indexOf(block)] = this.createBlock(block.getParent(), 'pass', source_lines)\n }\n return doc\n })\n}", "title": "" }, { "docid": "dc79f40104ab2be2c7716d209fa3f93a", "score": "0.43482196", "text": "function selectStatement4( machine )\n {\n order = machine.popToken();\n machine.checkToken(\"by\");\n machine.checkToken(\"order\");\n where = machine.popToken();\n machine.checkToken(\"where\");\n tables = machine.popToken();\n machine.checkToken(\"from\");\n columns = machine.popToken();\n machine.checkToken(\"select\");\n machine.pushToken( new selectStatement( columns, tables, where.expression, order.expression ) );\n }", "title": "" }, { "docid": "99abe77c239230a4557183c39182860c", "score": "0.43469158", "text": "parseStatement(tt, parent) {\n switch (tt.nextToken()) {\n case Tokenizer.TT_NUMBER:\n tt.pushBack();\n this.parseRepetition(tt, parent);\n break;\n case Tokenizer.TT_KEYWORD:\n tt.pushBack();\n this.parseNonSuffixOrBacktrack(tt, parent);\n break;\n default:\n throw this.createException(tt, \"Statement: Keyword or Number expected.\");\n }\n\n // We parse suffix expressions here, that they have precedence over\n // other expressions.\n this.parseSuffixes(tt, parent);\n }", "title": "" }, { "docid": "c3c8a7328903f9720969146f2080e90e", "score": "0.43420786", "text": "visitSmall_stmt(ctx) {\r\n console.log(\"visitSmall_stmt\");\r\n if (ctx.expr_stmt() !== null) {\r\n return this.visit(ctx.expr_stmt());\r\n } else if (ctx.del_stmt() !== null) {\r\n return this.visit(ctx.del_stmt());\r\n } else if (ctx.pass_stmt() !== null) {\r\n return this.visit(ctx.pass_stmt());\r\n } else if (ctx.flow_stmt() !== null) {\r\n return this.visit(ctx.flow_stmt());\r\n } else if (ctx.import_stmt() !== null) {\r\n return this.visit(ctx.import_stmt());\r\n } else if (ctx.global_stmt() !== null) {\r\n return this.visit(ctx.global_stmt());\r\n } else if (ctx.nonlocal_stmt() !== null) {\r\n return this.visit(ctx.nonlocal_stmt());\r\n } else if (ctx.assert_stmt() !== null) {\r\n return this.visit(ctx.assert_stmt());\r\n }\r\n }", "title": "" }, { "docid": "2cc0bbfcca62b04a2430a00cbb2e0f86", "score": "0.43344858", "text": "function generateStatementList(node)\n\t{\n\t\tfor(var i = 0; i < node.children.length; i++)\n\t\t{\n\t\t\tgenerateStatement(node.children[i]);\n\t\t}\n\t}", "title": "" }, { "docid": "0eb2174cbaee8bce375c5344fa8bf3d7", "score": "0.4329517", "text": "visitMerge_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "bebe75f561c09c154740f011db7f106c", "score": "0.43154085", "text": "function Statement() {\n \t\t\tdebugMsg(\"ProgramParser : Statement\");\n \t\t\tvar ast;\n \t\t\tvar line=lexer.current.line;\n \t\t\t\n \t\t\tswitch (lexer.current.content) {\n \t\t\t\tcase \"if\"\t \t\t: ast=If(); \n\t \t\t\tbreak;\n \t\t\t\tcase \"do\"\t \t\t: ast=Do(); \n \t\t\t\tbreak;\n \t\t\t\tcase \"while\" \t\t: ast=While(); \t\t\n \t\t\t\tbreak;\n \t\t\t\tcase \"for\"\t\t\t: ast=For();\n \t\t\t\tbreak;\n \t\t\t\tcase \"switch\"\t\t: ast=Switch(); \t\n \t\t\t\tbreak;\n \t\t\t\tcase \"javascript\"\t: ast=JavaScript(); \n \t\t\t\tbreak;\n \t\t\t\tcase \"return\"\t\t: ast=Return(); \n \t\t\t\t\t\t\t\t\t\t check(\";\");\n \t\t\t\tbreak;\n \t\t\t\tdefault\t\t\t\t: ast=EPStatement(); \n \t\t\t\t\t check(\";\");\n \t\t\t}\n \t\t\tast.line=line;\n \t\t\tast.comment=lexer.getComment();\n \t\t\tlexer.clearComment(); \t\t\t\n \t\t\treturn ast;\t\n \t\t}", "title": "" }, { "docid": "2d521a5a4594c9ab133cd73f91655290", "score": "0.43132302", "text": "visitDb_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "3928b35615ee877c886ca8a7191482c5", "score": "0.43100178", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "b7f8445fba9259cdb02e5cf3ed66e8e6", "score": "0.43092927", "text": "function doSearch(databaseid, params, cb) {\n\tvar res;\n\tvar stope = {};\n\tvar fromdata;\n\tvar selectors = cloneDeep(this.selectors);\n\n\tfunction processSelector(selectors,sidx,value) {\n\n\t\tvar \n\t\t\tval,\t// temp values use many places\n\t\t\tnest, \t// temp value used many places\n\t\t\tr,\t\t// temp value used many places\n\t\t\tsel = selectors[sidx];\n\n\t\tvar SECURITY_BREAK = 100000;\n\n\t\tif(sel.selid) {\n\t\t\t// TODO Process Selector\n\t\t\tif(sel.selid === 'PATH') {\n\t\t\t\tvar queue = [{node:value,stack:[]}];\n\t\t\t\tvar visited = {};\n\t\t\t\t//var path = [];\n\t\t\t\tvar objects = alasql.databases[alasql.useid].objects;\n\t\t\t\twhile (queue.length > 0) {\n\t\t\t\t\tvar q = queue.shift()\n\t\t\t\t\tvar node = q.node;\n\t\t\t\t\tvar stack = q.stack;\n\t\t\t\t\tvar r = processSelector(sel.args,0,node);\n\t\t\t\t\tif(r.length > 0) {\n\t\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\t\treturn stack;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar rv = [];\n\t\t\t\t\t\t\tif(stack && stack.length > 0) {\n\t\t\t\t\t\t\t\tstack.forEach(function(stv){\n\t\t\t\t\t\t\t\t\trv = rv.concat(processSelector(selectors,sidx+1,stv));\n\t\t\t\t\t\t\t\t});\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn rv;\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(typeof visited[node.$id] !== 'undefined') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvisited[node.$id] = true;\n\t\t\t\t\t\t\tif(node.$out && node.$out.length > 0) {\n\t\t\t\t\t\t\t\tnode.$out.forEach(function(edgeid){\n\t\t\t\t\t\t\t\t\tvar edge = objects[edgeid];\n\t\t\t\t\t\t\t\t\tvar stack2 = stack.concat(edge);\n\t\t\t\t\t\t\t\t\tstack2.push(objects[edge.$out[0]]);\n\t\t\t\t\t\t\t\t\tqueue.push({node:objects[edge.$out[0]],\n\t\t\t\t\t\t\t\t\t\tstack:stack2});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Else return fail\n\t\t\t\treturn [];\n\t\t\t} if(sel.selid === 'NOT') {\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\n\n\t\t\t\tif(nest.length>0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'DISTINCT') {\n\t\t\t\tvar nest;\n\t\t\t\tif(typeof sel.args === 'undefined' || sel.args.length === 0) {\n\t\t\t\t\tnest = distinctArray(value);\n\t\t\t\t} else {\n\t\t\t\t\tnest = processSelector(sel.args,0,value);\n\t\t\t\t}\n\t\t\t\tif(nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tvar res = distinctArray(nest);\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,res);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'AND') {\n\t\t\t\tvar res = true;\n\t\t\t\tsel.args.forEach(function(se){\n\t\t\t\t\tres = res && (processSelector(se,0,value).length>0);\n\t\t\t\t});\n\t\t\t\tif(!res) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'OR') {\n\t\t\t\tvar res = false;\n\t\t\t\tsel.args.forEach(function(se){\n\t\t\t\t\tres = res || (processSelector(se,0,value).length>0);\n\t\t\t\t});\n\t\t\t\tif(!res) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'ALL') {\n\t\t\t\tvar nest = processSelector(sel.args[0],0,value);\n\t\t\t\tif(nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn nest;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,nest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'ANY') {\n\t\t\t\tvar nest = processSelector(sel.args[0],0,value);\n\n\t\t\t\tif(nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn [nest[0]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,[nest[0]]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'UNIONALL') {\n\t\t\t\tvar nest = [];\n\t\t\t\tsel.args.forEach(function(se){\n\t\t\t\t\tnest = nest.concat(processSelector(se,0,value));\n\t\t\t\t});\n\t\t\t\tif(nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn nest;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,nest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'UNION') {\n\t\t\t\tvar nest = [];\n\t\t\t\tsel.args.forEach(function(se){\n\t\t\t\t\tnest = nest.concat(processSelector(se,0,value));\n\t\t\t\t});\n\t\t\t\tvar nest = distinctArray(nest);\n\t\t\t\tif(nest.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn nest;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,nest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else \tif(sel.selid === 'IF') {\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\n\n\t\t\t\tif(nest.length===0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\treturn [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn processSelector(selectors,sidx+1,value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else \tif(sel.selid === 'REPEAT') {\n\n\t\t\t\tvar \n\t\t\t\t\tlvar, \n\t\t\t\t\tlmax,\n\t\t\t\t\tlmin = sel.args[0].value;\n\t\t\t\tif(!sel.args[1]) {\n\t\t\t\t\tlmax = lmin; // Add security break\n\t\t\t\t} else {\n\t\t\t\t\tlmax = sel.args[1].value;\n\t\t\t\t}\n\t\t\t\tif(sel.args[2]) {\n\t\t\t\t\tlvar = sel.args[2].variable;\n\t\t\t\t} \n\t\t\t\t//var lsel = sel.sels;\n\n\t\t\t\tvar retval = [];\n\n\t\t\t\tif (lmin === 0) {\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\tretval = [value];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(lvar){\n\t\t\t\t\t\t\talasql.vars[lvar] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,value));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\t// var nests = processSelector(sel.sels,0,value).slice();\n\t\t\t\tif(lmax > 0) {\n\t\t\t\t\tvar nests = [{value:value,lvl:1}];\n\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\twhile (nests.length > 0) {\n\n\t\t\t\t\t\tvar nest = nests[0];\n\n\t\t\t\t\t\tnests.shift();\n\t\t\t\t\t\tif(nest.lvl <= lmax) {\n\t\t\t\t\t\t\tif(lvar){\n\t\t\t\t\t\t\t\talasql.vars[lvar] = nest.lvl;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar nest1 = processSelector(sel.sels,0,nest.value);\n\n\t\t\t\t\t\t\tnest1.forEach(function(n){\n\t\t\t\t\t\t\t\tnests.push({value:n,lvl:nest.lvl+1});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif(nest.lvl >= lmin) {\n\t\t\t\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\t\t\t\tretval = retval.concat(nest1);\n\t\t\t\t\t\t\t\t\t//return nests;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnest1.forEach(function(n){\n\t\t\t\t\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Security brake\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif(i>SECURITY_BREAK) {\n\t\t\t\t\t\t\tthrow new Error('Security brake. Number of iterations = '+i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\treturn retval;\n\t\t\t} else if(sel.selid ==='OF') {\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [value];\n\t\t\t\t} else {\n\t\t\t\t\tvar r1 = [];\n\t\t\t\t\tObject.keys(value).forEach(function(keyv){\n\t\t\t\t\t\talasql.vars[sel.args[0].variable] = keyv;\n\t\t\t\t\t\tr1 = r1.concat(processSelector(selectors,sidx+1,value[keyv]));\n\t\t\t\t\t});\n\t\t\t\t\treturn r1;\n\t\t\t\t}\n\t\t\t} else \tif(sel.selid ==='TO') {\n\n\t\t\t\tvar oldv = alasql.vars[sel.args[0]];\n\t\t\t\tvar newv = [];\n\t\t\t\tif(oldv !== undefined) {\n\n\t\t\t\t\tnewv = oldv.slice(0);\n\n\t\t\t\t} else {\n\t\t\t\t\tnewv = [];\n\t\t\t\t}\n\t\t\t\tnewv.push(value);\n\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [value];\n\t\t\t\t} else {\n\t\t\t\t\talasql.vars[sel.args[0]] = newv;\n\t\t\t\t\tvar r1 = processSelector(selectors,sidx+1,value);\n\n\t\t\t\t\talasql.vars[sel.args[0]] = oldv;\n\t\t\t\t\treturn r1;\n\t\t\t\t}\n\n\t\t\t} else if(sel.selid === 'ARRAY') {\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length > 0) {\n\t\t\t\t\tval = nest;\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'SUM') {\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length > 0) {\n\t\t\t\t\tvar val = nest.reduce(function(sum, current) {\n\t \t\t\t\t\treturn sum + current;\n\t\t\t\t\t}, 0);\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'AVG') {\n\t\t\t\tnest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length > 0) {\n\t\t\t\t\tval = nest.reduce(function(sum, current) {\n\t \t\t\t\t\treturn sum + current;\n\t\t\t\t\t}, 0)/nest.length;\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'COUNT') {\n\t\t\t\tnest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length > 0) {\n\t\t\t\t\tval = nest.length;\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else \tif(sel.selid === 'FIRST') {\n\t\t\t\tnest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length > 0){\n\t\t\t\t\tval = nest[0];\n\t\t\t\t} else { \n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else \tif(sel.selid === 'LAST') {\n\t\t\t\tnest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length > 0) {\n\t\t\t\t\tval = nest[nest.length-1];\n\t\t\t\t} else {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'MIN') {\n\t\t\t\tnest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length === 0){\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tvar val = nest.reduce(function(min, current) {\n \t\t\t\t\treturn Math.min(min,current);\n\t\t\t\t}, Infinity);\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else \tif(sel.selid === 'MAX') {\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\n\t\t\t\tif(nest.length === 0){\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tvar val = nest.reduce(function(max, current) {\n \t\t\t\t\treturn Math.max(max,current);\n\t\t\t\t}, -Infinity);\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [val];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,val);\n\t\t\t\t}\n\t\t\t} else \tif(sel.selid === 'PLUS') {\n\t\t\t\tvar retval = [];\n\n\t\t\t\tvar nests = processSelector(sel.args,0,value).slice();\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\tretval = retval.concat(nests);\n\t\t\t\t} else {\n\t\t\t\t\tnests.forEach(function(n){\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tvar i = 0;\n\t\t\t\twhile (nests.length > 0) {\n\n\t\t\t\t\tvar nest = nests.shift();\n\n\t\t\t\t\tnest = processSelector(sel.args,0,nest);\n\n\t\t\t\t\tnests = nests.concat(nest);\n\n\t\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\t\tretval = retval.concat(nest);\n\t\t\t\t\t\t//return retval;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnest.forEach(function(n){\n\n\t\t\t\t\t\t\tvar rn = processSelector(selectors,sidx+1,n);\n\n\t\t\t\t\t\t\tretval = retval.concat(rn);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// Security brake\n\t\t\t\t\ti++;\n\t\t\t\t\tif(i>SECURITY_BREAK) {\n\t\t\t\t\t\tthrow new Error('Security brake. Number of iterations = '+i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn retval;\n\n\t\t\t} else \tif(sel.selid === 'STAR') {\n\t\t\t\tvar retval = [];\n\t\t\t\tretval = processSelector(selectors,sidx+1,value);\n\t\t\t\tvar nests = processSelector(sel.args,0,value).slice();\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\tretval = retval.concat(nests);\n\t\t\t\t\t//return nests;\n\t\t\t\t} else {\n\t\t\t\t\tnests.forEach(function(n){\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tvar i = 0;\n\t\t\t\twhile (nests.length > 0) {\n\t\t\t\t\tvar nest = nests[0];\n\t\t\t\t\tnests.shift();\n\n\t\t\t\t\tnest = processSelector(sel.args,0,nest);\n\n\t\t\t\t\tnests = nests.concat(nest);\n\n\t\t\t\t\tif(sidx+1+1 <= selectors.length) {\n\t\t\t\t\t\tnest.forEach(function(n){\n\t\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// Security brake\n\t\t\t\t\ti++;\n\t\t\t\t\tif(i>SECURITY_BREAK) {\n\t\t\t\t\t\tthrow new Error('Loop brake. Number of iterations = '+i);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn retval;\n\t\t\t} else \tif(sel.selid === 'QUESTION') {\n\t\t\t\tvar retval = [];\n\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,value))\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\n\t\t\t\tif(sidx+1+1 <= selectors.length) {\n\t\t\t\t\tnest.forEach(function(n){\n\t\t\t\t\t\tretval = retval.concat(processSelector(selectors,sidx+1,n));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn retval;\n\t\t\t} else if(sel.selid === 'WITH') {\n\t\t\t\tvar nest = processSelector(sel.args,0,value);\n\n\t\t\t\tif(nest.length===0) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else {\n\n\t\t\t\t\tvar r = {status:1,values:nest};\n\t\t\t\t}\n\t\t\t} else if(sel.selid === 'ROOT') {\n\t\t\t\tif(sidx+1+1 > selectors.length) {\n\t\t\t\t\treturn [value];\n\t\t\t\t} else {\n\t\t\t\t\treturn processSelector(selectors,sidx+1,fromdata);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error('Wrong selector '+sel.selid);\n\t\t\t}\n\n\t\t} else if(sel.srchid) {\n\t\t\tvar r = alasql.srch[sel.srchid.toUpperCase()](value,sel.args,stope,params);\n\n\t\t} else {\n\t\t\tthrow new Error('Selector not found');\n\t\t}\n\n\t\tif(typeof r === 'undefined') {\n\t\t\tr = {status: 1, values: [value]};\n\t\t}\n\n\t\tvar res = [];\n\t\tif(r.status === 1) {\n\n\t\t\tvar arr = r.values;\n\n\t\t\tif(sidx+1+1 > selectors.length) {\n\n\t\t\t\tres = arr;\t\t\t\t\t\n\n\t\t\t} else {\n\t\t\t\tfor(var i=0;i<r.values.length;i++) {\n\t\t\t\t\tres = res.concat(processSelector(selectors,sidx+1,arr[i]));\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}\n\n\tif(selectors !== undefined && selectors.length > 0) {\n\n\t\tif(selectors && selectors[0] && selectors[0].srchid === 'PROP' && selectors[0].args && selectors[0].args[0]) {\n\n\t\t\tif(selectors[0].args[0].toUpperCase() === 'XML') {\n\t\t\t\tstope.mode = 'XML';\n\t\t\t\tselectors.shift();\n\t\t\t} else if(selectors[0].args[0].toUpperCase() === 'HTML') {\n\t\t\t\tstope.mode = 'HTML';\n\t\t\t\tselectors.shift();\n\t\t\t} else if(selectors[0].args[0].toUpperCase() === 'JSON') {\n\t\t\t\tstope.mode = 'JSON';\n\t\t\t\tselectors.shift();\n\t\t\t}\n\t\t}\n\t\tif(selectors.length > 0 && selectors[0].srchid === 'VALUE') {\n\t\t\tstope.value = true;\n\t\t\tselectors.shift();\n\t\t}\n\t}\n\n\tif(this.from instanceof yy.Column) {\n\t\tvar dbid = this.from.databaseid || databaseid;\n\t\tfromdata = alasql.databases[dbid].tables[this.from.columnid].data;\n\t\t//selectors.unshift({srchid:'CHILD'});\n\t} else if(\n\t\t\t\tthis.from instanceof yy.FuncValue &&\t\t\t\t \n\t\t\t\talasql.from[this.from.funcid.toUpperCase()]\n\t\t\t) {\n\t\tvar args = this.from.args.map(function(arg){\n\t\tvar as = arg.toJS();\n\n\t\tvar fn = new Function('params,alasql','var y;return '+as).bind(this);\n\t\treturn fn(params,alasql);\n\t\t});\n\n\t\tfromdata = alasql.from[this.from.funcid.toUpperCase()].apply(this,args);\n\n\t} else if(typeof this.from === 'undefined') {\n\t\tfromdata = alasql.databases[databaseid].objects;\n\t} else {\n\t\tvar fromfn = new Function('params,alasql','var y;return '+this.from.toJS());\n\t\tfromdata = fromfn(params,alasql);\t\t\t\n\t\t// Check for Mogo Collections\n\t\tif(\n\t\t\ttypeof Mongo === 'object' && typeof Mongo.Collection !== 'object' && \n\t\t\tfromdata instanceof Mongo.Collection\n\t\t) {\n\t\t\tfromdata = fromdata.find().fetch();\n\t\t}\n\n\t}\n\n\t// If source data is array than first step is to run over array\n//\tvar selidx = 0;\n//\tvar selvalue = fromdata;\n\n\tif(selectors !== undefined && selectors.length > 0) {\n\t\t// Init variables for TO() selectors\n\n\t\tif(false) {\n\t\t\tselectors.forEach(function(selector){\n\t\t\t\tif(selector.srchid === 'TO') { //* @todo move to TO selector\n\t\t\t\t\talasql.vars[selector.args[0]] = [];\n\t\t\t\t\t// TODO - process nested selectors\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tres = processSelector(selectors,0,fromdata);\n\t} else {\n\t\tres = fromdata; \t\n\t}\n\n\tif(this.into) {\n\t\tvar a1,a2;\n\t\tif(typeof this.into.args[0] !== 'undefined') {\n\t\t\ta1 = \n\t\t\t\tnew Function('params,alasql','var y;return ' +\n\t\t\t\tthis.into.args[0].toJS())(params,alasql);\n\t\t}\n\t\tif(typeof this.into.args[1] !== 'undefined') {\n\t\t\ta2 = \n\t\t\t\tnew Function('params,alasql','var y;return ' +\n\t\t\t\tthis.into.args[1].toJS())(params,alasql);\n\t\t}\n\t\tres = alasql.into[this.into.funcid.toUpperCase()](a1,a2,res,[],cb);\n\t} else {\n\t\tif(stope.value && res.length > 0){\n\t\t\tres = res[0];\n\t\t}\n\t\tif (cb){\n\t\t\tres = cb(res);\n\t\t}\n\t}\n\treturn res;\n\n}", "title": "" }, { "docid": "71e8805a2bee3a3d671b2de776bcdaa3", "score": "0.43085676", "text": "function parseStatement(topLevel) {\n if (tokType === _slash || tokType === _assign && tokVal == \"/=\")\n readToken(true);\n\n var starttype = tokType, node = startNode();\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case _break: case _continue: return parseBreakContinueStatement(node, starttype.keyword);\n case _debugger: return parseDebuggerStatement(node);\n case _do: return parseDoStatement(node);\n case _for: return parseForStatement(node);\n case _function: return parseFunctionStatement(node);\n case _class: return parseClass(node, true);\n case _if: return parseIfStatement(node);\n case _return: return parseReturnStatement(node);\n case _switch: return parseSwitchStatement(node);\n case _throw: return parseThrowStatement(node);\n case _try: return parseTryStatement(node);\n case _var: case _let: case _const: return parseVarStatement(node, starttype.keyword);\n case _while: return parseWhileStatement(node);\n case _with: return parseWithStatement(node);\n case _braceL: return parseBlock(); // no point creating a function for this\n case _semi: return parseEmptyStatement(node);\n case _export:\n case _import:\n if (!topLevel && !options.allowImportExportEverywhere)\n raise(tokStart, \"'import' and 'export' may only appear at the top level\");\n return starttype === _import ? parseImport(node) : parseExport(node);\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n var maybeName = tokVal, expr = parseExpression();\n if (starttype === _name && expr.type === \"Identifier\" && eat(_colon))\n return parseLabeledStatement(node, maybeName, expr);\n else return parseExpressionStatement(node, expr);\n }\n }", "title": "" }, { "docid": "71e8805a2bee3a3d671b2de776bcdaa3", "score": "0.43085676", "text": "function parseStatement(topLevel) {\n if (tokType === _slash || tokType === _assign && tokVal == \"/=\")\n readToken(true);\n\n var starttype = tokType, node = startNode();\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case _break: case _continue: return parseBreakContinueStatement(node, starttype.keyword);\n case _debugger: return parseDebuggerStatement(node);\n case _do: return parseDoStatement(node);\n case _for: return parseForStatement(node);\n case _function: return parseFunctionStatement(node);\n case _class: return parseClass(node, true);\n case _if: return parseIfStatement(node);\n case _return: return parseReturnStatement(node);\n case _switch: return parseSwitchStatement(node);\n case _throw: return parseThrowStatement(node);\n case _try: return parseTryStatement(node);\n case _var: case _let: case _const: return parseVarStatement(node, starttype.keyword);\n case _while: return parseWhileStatement(node);\n case _with: return parseWithStatement(node);\n case _braceL: return parseBlock(); // no point creating a function for this\n case _semi: return parseEmptyStatement(node);\n case _export:\n case _import:\n if (!topLevel && !options.allowImportExportEverywhere)\n raise(tokStart, \"'import' and 'export' may only appear at the top level\");\n return starttype === _import ? parseImport(node) : parseExport(node);\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n var maybeName = tokVal, expr = parseExpression();\n if (starttype === _name && expr.type === \"Identifier\" && eat(_colon))\n return parseLabeledStatement(node, maybeName, expr);\n else return parseExpressionStatement(node, expr);\n }\n }", "title": "" }, { "docid": "be3ae840ee2255dbe9e5a66931d73dc8", "score": "0.43056273", "text": "visitSavepoint_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "a8dc3e7bd42bcd3a34f56ea426fb26e7", "score": "0.4298736", "text": "visitMapping_table_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c7eeddd32beafd3aa3f5bae15d413b03", "score": "0.42954808", "text": "visitLock_table_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "19fced0ad88536bf918c0ad53a93cc2a", "score": "0.4293005", "text": "visitTablespace_retention_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c7ace424cd2cb7bcba0cda32d636e4a9", "score": "0.4292023", "text": "visitClose_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "08c2831f9d8c3a2956cab2fba6d95be1", "score": "0.42870918", "text": "visitKeep_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "fc55235d55b6aea78f13d3a1abb352c7", "score": "0.42812735", "text": "function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n }", "title": "" }, { "docid": "7e39d5dc3cab3ada3a79e72da8344b17", "score": "0.4273019", "text": "visitCommit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1275f7ad16eb9a96d0991319427aa295", "score": "0.42725483", "text": "visitGlobal_stmt(ctx) {\r\n console.log(\"visitGlobal_stmt\");\r\n let globallist = [];\r\n for (var i = 0; i < ctx.NAME().length; i++) {\r\n globallist.push(this.visit(ctx.NAME(i)));\r\n }\r\n return { type: \"GlobalStatement\", globallist: globallist };\r\n }", "title": "" }, { "docid": "9f44ade0aac3ba6cf81c95ef1af293b8", "score": "0.4271397", "text": "visitStorage_table_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "76efcce8e074e5d2fb16e8a8fb56e906", "score": "0.42599106", "text": "visitTablespace_logging_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" } ]
606cab9e03b448bd4b1e40d6f4d1f9d1
Single player game function that controls running the game
[ { "docid": "7b3b7d2726cd4b6ae07192087cfb3641", "score": "0.0", "text": "function playGame(numPlayers, gameState){\n console.log('playing a game');\n if(numPlayers == 1){\n $('title').text('Single Player Game');\n }else{\n $('title').text('Two Player Game');\n }\n\n //variables used to control the sizing of the game display\n var sizeFactor = window.innerWidth / 1366,\n width = 1000 * sizeFactor,\n height = 600 * sizeFactor,\n imageSize = 64,\n playAreaOffset = $('#play_area').offset(),\n playAreaWidth = 1200, //1500\n playAreaHeight = 800; //960\n \n //variables used to control the fog that the player can see\n var fogSize = 400,\n fog = [];\n\n //variables used to store the positions of the walls\n var walls = [],\n verticalWalls = [],\n horizontalWalls = [];\n if(gameState.verticalWalls){\n verticalWalls = gameState.verticalWalls;\n }\n if(gameState.horizontalWalls){\n horizontalWalls = gameState.horizontalWalls;\n }\n\n //varibales used to store the enemy objects\n var enemies = [];\n\n //varibbles to store the bullet objects\n var bullets = [];\n\n //styling used to hide the background image from the title screen\n $('#play_area').css({\n 'backgroundImage': 'none',\n 'width': width,\n 'heigth': height\n //'cursor': 'url(../IMG/gunsight.png), crosshair'\n });\n\n //creates the stage to hold the how to play screen\n var stage = new Kinetic.Stage({container: 'play_area', width: 1000 * sizeFactor, height: 600 * sizeFactor});\n\n /*\n * creates the layers for the game\n */\n\n //foreground layer used to hold the player, bullets, and enemies\n var foreground = new Kinetic.Layer({x: 0, y: 0, width: playAreaWidth, height: playAreaHeight, clip: {x: 0, y: 0, width: width, height: height}});\n var bulletGroup = new Kinetic.Group({x: 0, y: 0, width: playAreaWidth, height: playAreaHeight});\n var enemyGroup = new Kinetic.Group({x: 0, y: 0, width: playAreaWidth, height: playAreaHeight});\n foreground.add(bulletGroup).add(enemyGroup);\n\n //background layer used to hold the walls and background tiling\n var background = new Kinetic.Layer({x: 0, y: 0, width: playAreaWidth, height: playAreaHeight, clip: {x: 0, y: 0, width: width, height: height}});\n\n //layer used to hold the fog\n var fogLayer = new Kinetic.Layer({x: 0, y: 0, width: playAreaWidth, height: playAreaHeight, clip: {x: 0, y: 0, width: width, height:height}, opacity: .9});\n\n /*\n * Self invoking anonymouse function used to populate the layers with the player, walls, and fog\n */\n (function(){\n //constructs the fog layer (composed of 8 different rectangles)\n fog[0] = new Kinetic.Rect({x: 0, y: 0, height: playAreaHeight, fill: '#62403A'});\n fog[1] = new Kinetic.Rect({y: 0, height: playAreaHeight, fill: '#62403A'});\n fog[2] = new Kinetic.Rect({y: 0, fill: '#62403A'});\n fog[3] = new Kinetic.Rect({fill: '#62403A'});\n fogLayer.add(fog[0]).add(fog[1]).add(fog[2]).add(fog[3]);\n if(numPlayers == 2){\n fog[4] = new Kinetic.Rect({fill: '#62403A'});\n fog[5] = new Kinetic.Rect({fill: '#62403A'});\n fog[6] = new Kinetic.Rect({fill: '#62403A'});\n fog[7] = new Kinetic.Rect({fill: '#62403A'});\n fog[8] = new Kinetic.Rect({fill: '#62403A'});\n fog[9] = new Kinetic.Rect({fill: '#62403A'});\n fog[10] = new Kinetic.Rect({fill: '#62403A'});\n fogLayer.add(fog[4]).add(fog[5]).add(fog[6]).add(fog[7]).add(fog[8]).add(fog[9]).add(fog[10]);\n }\n\n //adds the background color and border\n var backGroundFill = new Kinetic.Rect({x: 0, y: 0, width: playAreaWidth, height: playAreaHeight, fillPatternImage: backgroundPattern, fillPatternRepeat: 'repeat' });\n var backGroundBorder = new Kinetic.Rect({x: 0, y: 0, width: playAreaWidth, height: playAreaHeight, stroke: 'white', strokeWidth: 10});\n background.add(backGroundFill);\n background.add(backGroundBorder);\n\n //adds the horizontal walls to the background\n for(var i = 0; i < horizontalWalls.length; ++i){\n walls.push(new createWall(horizontalWalls[i][0] * 50, horizontalWalls[i][1] * 32, 'horizontal'));\n background.add(walls[walls.length - 1].obj);\n }\n\n //adds the vertical walls to the background\n for(var i = 0; i < verticalWalls.length; ++i){\n walls.push(new createWall(verticalWalls[i][0] * 50 + 12, verticalWalls[i][1] * 32, 'vertical'));\n background.add(walls[walls.length - 1].obj);\n }\n\n //creates the player and adds him to the foreground\n player = new createPlayer(gameState.player.x, gameState.player.y);\n foreground.add(player.obj);\n\n //creates the other player if it is a two player game\n if(numPlayers == 2){\n otherPlayer = new createPlayer(gameState.otherPlayer.x, gameState.otherPlayer.y);\n foreground.add(otherPlayer.obj);\n }\n\n //add the layers to the stage\n stage.add(background).add(foreground).add(fogLayer);\n redraw();\n })();\n \n //constructor functions to create a Player\n function createPlayer(x, y){\n this.obj = new Kinetic.Image({\n x: 500 * sizeFactor - imageSize / 2,\n y: 300 * sizeFactor - imageSize / 2,\n width: imageSize,\n height: imageSize,\n image: playerImg[0]\n });\n this.direction = 'up';\n };\n\n function createWall(x, y, type){\n if(type == 'vertical'){\n this.obj = new Kinetic.Image({x: x, y: y, width: 26, height: 64, image: wallVertical});\n }else if(type == 'horizontal'){\n this.obj = new Kinetic.Image({x: x, y: y, width: 50, height: 32, image: wallHorizontal});\n }\n this.type = 'wall';\n };\n\n //constructor function to create the bullets\n function createBullet(xpos, ypos){\n this.obj = new Kinetic.Circle({\n radius: 2,\n x: xpos,\n y: ypos,\n fill: '#7FFF00'\n });\n };\n\n //constructor function to create enemies\n function createEnemy(x, y, type, imgNum){\n switch(type){\n case 'gridBug':\n this.obj = new Kinetic.Image({\n x: x,\n y: y,\n width: imageSize,\n height: imageSize,\n image: gridBugImg[imgNum]\n });\n break;\n case 'roller':\n this.obj = new Kinetic.Image({\n x: x,\n y: y,\n width: imageSize,\n height: imageSize,\n image: rollerImg[imgNum]\n });\n break;\n case 'heavy':\n this.obj = new Kinetic.Image({\n x: x,\n y: y,\n width: imageSize,\n height: imageSize,\n image: image3\n });\n break;\n }\n }\n\n /*\n * Functions for objects in game\n */\n\n //increments the player's position based on the players current position, change of position, and timestep amount\n //also updates the position/clip of the foreground/background\n function updatePlayer(playerData, player){\n var xpos = playerData.x,\n originalX = width/2 - imageSize/2,\n clipX,\n posX;\n if(playAreaWidth <= width || xpos <= (originalX)){\n clipX = 0,\n posX = 0;\n }\n else if(xpos >= (playAreaWidth - originalX - imageSize)){\n clipX = playAreaWidth - width;\n posX = width - playAreaWidth;\n }\n else{\n clipX = xpos - originalX;\n posX = originalX - xpos;\n }\n player.obj.x(xpos);\n fogLayer.x(posX);\n fogLayer.clipX(clipX);\n foreground.x(posX);\n foreground.clipX(clipX);\n background.x(posX);\n background.clipX(clipX);\n var ypos = playerData.y,\n originalY = height/2 - imageSize/2,\n clipY,\n posY;\n if(playAreaHeight <= height || ypos <= (originalY)){\n clipY = 0,\n posY = 0;\n }\n else if(ypos >= (playAreaHeight - originalY - imageSize)){\n clipY = playAreaHeight - height;\n posY = height - playAreaHeight;\n }\n else{\n clipY = ypos - originalY;\n posY = originalY - ypos;\n }\n player.obj.y(ypos);\n fogLayer.y(posY);\n fogLayer.clipY(clipY);\n foreground.y(posY);\n foreground.clipY(clipY);\n background.y(posY);\n background.clipY(clipY);\n player.obj.image(playerImg[playerData.imgNum]);\n };\n\n //function used to update the appearance of the fog based on the player's position\n function updateFog(playerData, otherPlayerData){\n var halfFog = fogSize/2,\n halfWidth = width/2,\n halfHeight = height/2,\n left1,\n right1,\n top1,\n bottom1,\n left2,\n right2,\n top2,\n bottom2;\n if(!otherPlayerData){\n left1 = playerData.x + imageSize/2 - halfFog;\n right1 = playerData.x + imageSize/2 + halfFog;\n top1 = playerData.y + imageSize/2 - halfFog;\n bottom1 = playerData.y + imageSize/2 + halfFog;\n fog[0].width(left1);\n fog[1].x(right1).width(playAreaWidth - right1);\n fog[2].x(left1).height(top1).width(right1 - left1);\n fog[3].x(left1).y(bottom1).height(playAreaHeight - bottom1).width(right1 - left1);\n }else{\n var left1 = playerData.x+ imageSize/2 - halfFog,\n right1 = playerData.x+ imageSize/2 + halfFog,\n top1 = playerData.y + imageSize/2 - halfFog,\n bottom1 = playerData.y + imageSize/2 + halfFog,\n left2 = otherPlayerData.x + imageSize/2 - halfFog,\n right2 = otherPlayerData.x + imageSize/2 + halfFog,\n top2 = otherPlayerData.y + imageSize/2 - halfFog,\n bottom2 = otherPlayerData.y + imageSize/2 + halfFog,\n vertical = [],\n horizontal = [],\n verticalOverlap = false,\n horizontalOverlap = false;\n if(left1 < left2){\n horizontal[0] = left1;\n horizontal[3] = right2;\n if(right1 < left2){\n horizontal[1] = right1;\n horizontal[2] = left2;\n }else{\n horizontal[1] = left2;\n horizontal[2] = right1;\n horizontalOverlap = true;\n }\n }else{\n horizontal[0] = left2;\n horizontal[3] = right1;\n if(right2 < left1){\n horizontal[1] = right2;\n horizontal[2] = left1;\n }else{\n horizontal[1] = left1;\n horizontal[2] = right2;\n horizontalOverlap = true;\n }\n }\n if(top1 < top2){\n vertical[0] = top1;\n vertical[3] = bottom2;\n if(bottom1 < top2){\n vertical[1] = bottom1;\n vertical[2] = top2;\n }else{\n vertical[1] = top2;\n vertical[2] = bottom1;\n verticalOverlap = true;\n }\n }else{\n vertical[0] = top2;\n vertical[3] = bottom1;\n if(bottom2 < top1){\n vertical[1] = bottom2;\n vertical[2] = top1;\n }else{\n vertical[1] = top1;\n vertical[2] = bottom2;\n verticalOverlap = true;\n }\n }\n fog[0].width(horizontal[0]);\n fog[1].x(horizontal[3]).width(playAreaWidth - horizontal[3]);\n fog[2].x(horizontal[0]).height(vertical[0]).width(horizontal[3] - horizontal[0]);\n fog[3].x(horizontal[0]).y(vertical[3]).height(playAreaHeight - vertical[3]).width(horizontal[3] - horizontal[0])\n if(!verticalOverlap || !horizontalOverlap){\n fog[6].x(horizontal[1]).width(horizontal[2] - horizontal[1]).y(vertical[1]).height(vertical[2] - vertical[1]).show();\n }else{\n fog[6].hide();\n }\n if(!verticalOverlap){\n fog[5].x(horizontal[0]).width(horizontal[1] - horizontal[0]).y(vertical[1]).height(vertical[2] - vertical[1]).show();\n fog[7].x(horizontal[2]).width(horizontal[3] - horizontal[2]).y(vertical[1]).height(vertical[2] - vertical[1]).show();\n }else{\n fog[5].hide();\n fog[7].hide();\n }\n if(!horizontalOverlap){\n fog[4].x(horizontal[1]).width(horizontal[2] - horizontal[1]).y(vertical[0]).height(vertical[1] - vertical[0]).show();\n fog[8].x(horizontal[1]).width(horizontal[2] - horizontal[1]).y(vertical[2]).height(vertical[3] - vertical[2]).show();\n }else{\n fog[4].hide();\n fog[8].hide();\n }\n if(left1 < left2 && top1 < top2 || left2 < left1 && top2 < top1){\n fog[9].x(horizontal[0]).width(horizontal[1] - horizontal[0]).y(vertical[2]).height(vertical[3] - vertical[2]);\n fog[10].x(horizontal[2]).width(horizontal[3] - horizontal[2]).y(vertical[0]).height(vertical[1] - vertical[0]);\n }else{\n fog[9].x(horizontal[2]).width(horizontal[3] - horizontal[2]).y(vertical[2]).height(vertical[3] - vertical[2]);\n fog[10].x(horizontal[0]).width(horizontal[1] - horizontal[0]).y(vertical[0]).height(vertical[1] - vertical[0]);\n }\n }\n };\n\n /*\n * Event controllers for the game\n */\n \n //mouse down event is used to fire a bullet\n $('#play_area').on('mousedown', function(evt){\n var data = JSON.stringify({\n 'clientID': clientId,\n 'message': 'mousedown',\n 'x': evt.pageX - playAreaOffset.left + background.clipX(),\n 'y': evt.pageY - playAreaOffset.top + background.clipY()\n });\n ws.send(data);\n });\n\n //mouse up event is used to stop rapid fire\n $('#play_area').on('mouseup', function(){\n var data = JSON.stringify({\n 'clientID': clientId,\n 'message': 'mouseup'\n });\n ws.send(data);\n })\n\n //mouse move event is used to aim the gun (updates player model to show which direction the player is aiming)\n $('#play_area').on('mousemove', function(evt){\n var x = evt.pageX - playAreaOffset.left + background.clipX(),\n y = evt.pageY - playAreaOffset.top + background.clipY(),\n diffX = x - player.obj.x(),\n diffY = y - player.obj.y();\n\n var data = {\n 'clientID': clientId,\n 'message': 'mousemove',\n 'direction' : 'none'\n };\n\n if(Math.abs(diffX) > Math.abs(diffY)){\n if(diffX > 0){\n if(player.direction != 'east'){\n player.direction = 'east';\n data.direction = 'east';\n ws.send(JSON.stringify(data));\n }\n }else{\n if(player.direction != 'west'){\n player.direction = 'west';\n data.direction = 'west';\n ws.send(JSON.stringify(data));\n }\n }\n }else{\n if(diffY > 0){\n if(player.direction != 'south'){\n player.direction = 'south';\n data.direction = 'south';\n ws.send(JSON.stringify(data));\n }\n }else{\n if(player.direction != 'north'){\n player.direction = 'north';\n data.direction = 'north';\n ws.send(JSON.stringify(data));\n }\n }\n }\n })\n\n //keydown event is used to increment the player movement, toggle the weapons\n $(document).keydown( function(evt){\n var data = JSON.stringify({\n 'clientID': clientId,\n 'message': 'keydown',\n 'keycode': evt.keyCode\n });\n ws.send(data);\n });\n\n //keyup event is used to decrement the player movement\n //$(document).on('keyup', function(evt){\n $(document).keyup( function(evt){\n var data = JSON.stringify({\n 'clientID': clientId,\n 'message': 'keyup',\n 'keycode': evt.keyCode\n });\n ws.send(data);\n });\n\n /*\n * Functions used to increment the state of the game and redraw the display to show the new state\n */\n\n //redraw function that redraws the foreground to show the current positions\n function redraw(){\n background.batchDraw();\n foreground.batchDraw();\n fogLayer.batchDraw();\n }\n\n ws.onmessage = function(msg){\n var data = JSON.parse(msg.data);\n console.log(data);\n if(data.message == 'updateState'){\n var gameState = data.gameState,\n enemyData = gameState.enemyData,\n bulletData = gameState.bulletData,\n playerData = gameState.playerData,\n otherPlayerData;\n updatePlayer(playerData, player);\n if(numPlayers == 2){\n otherPlayerData = gameState.otherPlayerData;\n updatePlayer(otherPlayerData, otherPlayer);\n }\n updateFog(playerData, otherPlayerData);\n bulletGroup.destroyChildren();\n enemyGroup.destroyChildren();\n for(var i = 0; i < enemyData.length; ++i){\n var enemy = new createEnemy(enemyData[i].x, enemyData[i].y, enemyData[i].type, enemyData[i].imgNum);\n console.log(enemy);\n enemyGroup.add(enemy.obj);\n }\n for(var i = 0; i < bulletData.length; ++i){\n var bullet = new Kinetic.Circle({\n radius: 2,\n x: bulletData[i].x,\n y: bulletData[i].y,\n fill: '#7FFF00'\n });\n bulletGroup.add(bullet);\n }\n redraw();\n }\n };\n\n }", "title": "" } ]
[ { "docid": "772dcdbd90e7d0fc66c804a8caccad58", "score": "0.7537443", "text": "function playGame(){\n\n}", "title": "" }, { "docid": "285f70c44e865800ab1c1d4f262b1bb3", "score": "0.7460609", "text": "function gamePlay() {\n\n\n}", "title": "" }, { "docid": "637da298efeee96878be33886f566029", "score": "0.7453255", "text": "play(){\n\t\tthis.gameLoop();\n\t}", "title": "" }, { "docid": "3e6789e49559c70b3927fff1fe8b2a21", "score": "0.7407219", "text": "function start_game(){\n initialise();\n game_running = true;\n run_game();\n}", "title": "" }, { "docid": "7b176ab6664f67e4b136dd181b990464", "score": "0.7331584", "text": "function startGame() {\n\n\n}", "title": "" }, { "docid": "5ffc4649bc1f1ec0a9233c6144ff0755", "score": "0.73310083", "text": "function isGameRunning(){\n if (triviaIndex < 2){\n //gameRunning = true;\n reset();\n }\n else {\n //gameRunning = false;\n // gameOver();\n }\n}", "title": "" }, { "docid": "92f549642e870df1eb13ebaaac47d621", "score": "0.7328281", "text": "function startGame() {\n\n}", "title": "" }, { "docid": "c9fc76f136b39d26589b4cc74721eae1", "score": "0.7316772", "text": "function Game() {\n\t\tstartStage();\n\t}", "title": "" }, { "docid": "9477c769f3f1a676088cb01a0548d12a", "score": "0.7307464", "text": "function play() {\n\t\t//myGame.functionkey();\n\t\tmyGame.userChoice = this.id;\n\t\tmyGame.computerInput();\n\t\tmyGame.compare();\n\t\tmyGame.display();\n\t}", "title": "" }, { "docid": "83f91e135ccb72dc5d94a94d2209ded2", "score": "0.7255866", "text": "function startGame(){\n entireGameboard.start();\n}", "title": "" }, { "docid": "764461684dbc9ec3932b3214570f82ff", "score": "0.7220211", "text": "function startGame()\n{\n}", "title": "" }, { "docid": "0aa88abc515884bb5e36393ee6443a7f", "score": "0.72116417", "text": "function game_play() {\n if(game_playing) {\n player_jump();\n } else if(game_startscreen) {\n game_start();\n } else if(!player_falling) {\n game_reset();\n }\n}", "title": "" }, { "docid": "d6a45bb7c67aa5eba4ca50918504526e", "score": "0.7179927", "text": "function playGame () {\n gameStart();\n playRound();\n startTime();\n changeColor();\n }", "title": "" }, { "docid": "9921bf506b3b63c70d27da8d4f923f6d", "score": "0.7175206", "text": "function startGame() {\r\n P1();\r\n}", "title": "" }, { "docid": "3efbee88f678289d9ddbd9ffe9f45c85", "score": "0.7148249", "text": "function control() {\n if (continueData.localScore.L == 0 && \n continueData.localScore.R == 0) {\n select();\n } else {\n continueGame();\n }\n }", "title": "" }, { "docid": "28562f8c33e5eb23723317ec641c6c27", "score": "0.7121796", "text": "function runGame() {\n toons = startingToons()\n preGame = restartGame()\n userToons()\n}", "title": "" }, { "docid": "590c2dd0424d7128afed49c52bddd317", "score": "0.71098405", "text": "function playGameSingle() {\n if (isGameOver) return;\n if (currentPlayer === \"user\") {\n turnDisplay.innerHTML = \"Your Go\";\n }\n if (currentPlayer === \"enemy\") {\n turnDisplay.innerHTML = \"Computers Go\";\n setTimeout(enemyGo, 1000);\n }\n}", "title": "" }, { "docid": "13726b2bae1df37e3c2eb1b772a9cf40", "score": "0.7108774", "text": "function startGame(){\r\n\tchangeVisibility(\"lightbox\");\r\n\tchangeVisibility(\"boundaryMessage\");\r\n\tgameStatus = true;\r\n} // startGame", "title": "" }, { "docid": "c986041edfb8cad89a2950bcc5e3426d", "score": "0.7101585", "text": "playerControl() {\n // Player movement\n // Check keys\n this.player.step(DT);\n\n if (this.keyboard.keyPressedOnce(\"Enter\")) {\n this.RELOAD = 1;\n }\n }", "title": "" }, { "docid": "228749ce3a9c99f867e17fe08bccb010", "score": "0.7079607", "text": "function player(){\n\t\t\n}", "title": "" }, { "docid": "e48198148f05462257437f6de0e8c3a2", "score": "0.70711005", "text": "function mainLoopFunction(){\r\n //When no game mode is selected\r\n if (gameMode === 0){\r\n clearCanvas();\r\n //Load the menu screen\r\n drawMenu();\r\n //Check if user has selected a game mode\r\n gameModeSelect();\r\n }else {\r\n //Launch pvp game if selected\r\n if (gameMode === 1){\r\n clearCanvas();\r\n pvpGame();\r\n //Launch player vs ai game if selected\r\n } else if (gameMode === 2){\r\n clearCanvas();\r\n pvaGame();\r\n }\r\n }\r\n //Fetch mouse location every time cursor moves\r\n document.onmousemove = function(e){\r\n mouseX = e.pageX;\r\n mouseY = e.pageY;\r\n };\r\n\t\t}", "title": "" }, { "docid": "6fbc35046530bfa5bf4d40d93fd77d0f", "score": "0.7063365", "text": "function playerGo() {\n playerTurn = true;\n}", "title": "" }, { "docid": "06450aa61bdbd8b588336fd6da82feef", "score": "0.7052423", "text": "function startGame() {\r\n\tdisableButton();\r\n\tConnectPlayer();\r\n\twaitingForPlayer = setInterval(function(){ myTimer() }, 500);\r\n}", "title": "" }, { "docid": "cf8a6e44b053edbcce02680105a68188", "score": "0.705137", "text": "startGame() {\n this.canRunGame = true;\n this._interval = setInterval(() => {\n this.swapTorch();\n }, 300);\n\n this._timeout = setTimeout(() => {\n this.disableGame();\n }, 30000);\n }", "title": "" }, { "docid": "8b7e99acc442eac860409b37dc4b0e65", "score": "0.7041186", "text": "function win_game() {\n\n}", "title": "" }, { "docid": "d1e7055919b148c728280a8a1579bd5e", "score": "0.7029073", "text": "function clickHandler()\n{\n playGame();\n}", "title": "" }, { "docid": "99db505bdde21d0070c39b0c524a7969", "score": "0.70259017", "text": "function playGameSingle() {\r\n if (isGameOver) return\r\n if (currentPlayer === 'user') {\r\n turnDisplay.innerHTML = 'Your Go'\r\n computerSquares.forEach(square => square.addEventListener('click', function(e) {\r\n shotFired = square.dataset.id\r\n revealSquare(square.classList)\r\n }))\r\n }\r\n if (currentPlayer === 'enemy') {\r\n turnDisplay.innerHTML = 'Computers Go!'\r\n setTimeout(enemyGo, 1000)\r\n }\r\n }", "title": "" }, { "docid": "da1a6089cb1070f9071f1538d5086137", "score": "0.70140594", "text": "function playSolution() {\n if (machineState) {\n var ping = pingButton(0);\n }\n setTimeout(function() {\n playerTurn = true;\n }, 2000 + count * 800);\n }", "title": "" }, { "docid": "b476cc9a174d4cd3c2262daac22e80c8", "score": "0.7007592", "text": "function playGame(){\n setUpCharacters();\n pickHero();\n \n }", "title": "" }, { "docid": "596d0921e94a24eb40aa711dd93b14a6", "score": "0.69904804", "text": "function gameHandler() {\n levelDisplay.innerHTML = \"Level : \" + lvlCount;\n if (sequenceCount === lvlCount) {\n clearInterval(lightInterval);\n aI = false;\n delayClickEnabled();\n }\n if(aI) {\n //timeout to put delay at the start of the ai turn instead of the player's turn\n setTimeout(runSequence, 750);\n } \n }", "title": "" }, { "docid": "5e1a53d031e7a874c56dbe1137508bce", "score": "0.69754344", "text": "function startGameExtra() {}", "title": "" }, { "docid": "815dfc22ea701898f42683bb5cdba7df", "score": "0.69743806", "text": "function startGame() {\n\t\t\tswitchPlayers();\n\t\t\tcontroller.game.helloOne = false;\n\t\t\tcontroller.game.helloTwo = false;\n\t\t\tcontroller.game.isDisabled = false;\n\n\t\t\tcontroller.game.$save();\n\t\t}", "title": "" }, { "docid": "2bfdc70e08845742b699ad7e26348b1e", "score": "0.6973822", "text": "_playerOneInitiate () {\n this._choosenPlayer = 'Mario'\n this._startGame()\n }", "title": "" }, { "docid": "31e99648e06682522888afe895d5fd25", "score": "0.6970894", "text": "function play() {\n gameService.start();\n gameService.endRound();\n gameService.newRound();\n}", "title": "" }, { "docid": "c602809b5b812587217262b2dd2db89d", "score": "0.6958698", "text": "function playerTurn() {\r\n $('#interactionPause').css('display', 'none');\r\n setInitialPlayerMenu();\r\n setPlayerTurnStats();\r\n\r\n}", "title": "" }, { "docid": "d5f37652c8d63647d8e70403b7cd893c", "score": "0.6951958", "text": "function startGame() {\n buttonSwap();\n updateCounter(counter);\n computerMove();\n }", "title": "" }, { "docid": "ca3737db1252a6644d25c48dc2997897", "score": "0.6951196", "text": "function startGame() {\r\n if (!isGameStarted) {\r\n isGameStarted = true;\r\n enablePlayerInputs(false);\r\n enableRestartButton(true);\r\n enableMatchesInputs(false);\r\n enablePlayAlone(false);\r\n }\r\n}", "title": "" }, { "docid": "d40a3530fbc94b12e39a0379e02fbc0f", "score": "0.6933623", "text": "function winGame() {\r\n \r\n}", "title": "" }, { "docid": "0be3bb814d9930f86660c06f6da97e72", "score": "0.69309694", "text": "step() {\n this.gamepad.refresh();\n\n if (this.player.status === 0) {\n // If player is alive\n this.mentalDanger = 0;\n this.pathfinding();\n this.playerControl();\n this.monstersControl();\n this.setLight(); //this.generate();\n\n this.spawnSubjects();\n this.manageAnimations();\n this.cooldowns();\n }\n\n if (this.keyboard.keyPressedOnce(\"Enter\")) {\n this.RELOAD = 1;\n } // If game is winned\n\n\n if (this.player.pos.y < MARGIN * 8 - 8) this.player.status = 3;\n }", "title": "" }, { "docid": "5b326c21d5587daf97e1cc6c30c05b30", "score": "0.6925772", "text": "function playMain() {\n\n}", "title": "" }, { "docid": "700ccff4041d8be774e88786567a97c1", "score": "0.69205624", "text": "function main() {\n if(!player.mobile){\n win.cancelAnimationFrame(raf);\n } else {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Draw a nice message that declares the player won and give the player\n * the option to play again.\n */\n if(player.won === true){\n drawWinningScreen();\n player.won = false;\n }\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n raf = win.requestAnimationFrame(main);\n }\n }", "title": "" }, { "docid": "9866d9dd1c0f88e8c2ad8f8cb7904637", "score": "0.68960875", "text": "function start() {\n toggleGameButtons();\n update();\n}", "title": "" }, { "docid": "91ccbdc26494516408301287eebe880d", "score": "0.68896973", "text": "function startGame() {\n\t\tvar game = border.getElementById(\"game-area\");\n\t\tchangeTime();\n\n\t}", "title": "" }, { "docid": "83d81c179cbb75c599523ba51a0af196", "score": "0.6886925", "text": "function tickGameButton()\n{\n if (!gameRunning)\n {\n tickGame();\n drawGame();\n }\n}", "title": "" }, { "docid": "812da1dbb779cf689db94be373bfe8ae", "score": "0.68777746", "text": "function onePlayerGame() {\n if(currentPlayer === playerOne) {\n if(gameIsRunning) {\n humanMove();\n setTimeout(() => {\n $QS(\".playertwo.name\").classList.remove(\"active-player\");\n $QS(\".playerone.name\").classList.add(\"active-player\");\n }, 500);\n }\n } else {\n if(gameIsRunning) {\n setTimeout(() => computerMove(), 500);\n $QS(\".playerone.name\").classList.remove(\"active-player\");\n $QS(\".playertwo.name\").classList.add(\"active-player\");\n }\n }\n }", "title": "" }, { "docid": "7a7dfda6d9ffce04595e9df230a7dfe9", "score": "0.6867523", "text": "function winGameHandler() {\r\n enterKeyEnabled = true;\r\n audioplayWin();\r\n audioTheme.pause();\r\n audioBongo.pause();\r\n showWinText(\"on\");\r\n turnOffEnemySound();\r\n showPlayButton(\"on\");\r\n}", "title": "" }, { "docid": "d66cc0f045e2ed7ca132202033a98079", "score": "0.68616927", "text": "startGame() {\n\t\tthis.enterState(this.startState);\n\t}", "title": "" }, { "docid": "3380c48f205fb25628ff42cdf0b13cd3", "score": "0.68559563", "text": "function gameLogic(){\n dotEaten();\n powerPelletEaten();\n}", "title": "" }, { "docid": "39f5f7aeec67da43330dbba0512b9ed2", "score": "0.68520075", "text": "function startGame()\n {\n game.start();\n hideMenu();\n } // startGame", "title": "" }, { "docid": "65b2c9b9735d1067d5ca2de61531822d", "score": "0.68413496", "text": "function playGameMulti() {\n setupButtons.style.display = 'none'\n if (gameStarted) turnDisplay.style.display = 'initial' // Turn display on\n if (isGameOver) return\n if (!isGameOver) {\n if (!ready) {\n socket.emit('player-ready')\n ready = true\n playerReady(playerNum)\n }\n\n if (gameStarted) {\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = 'Your Go'\n if (t == null) {\n deadline = new Date(Date.parse(new Date()) + 10 * 1000);\n initializeClock('clockdiv');\n } else {\n resetSeconds();\n }\n\n\n }\n if (currentPlayer === 'enemy') {\n turnDisplay.innerHTML = \"Enemy's Go\"\n if (t == null) {\n deadline = new Date(Date.parse(new Date()) + 10 * 1000);\n initializeClock('clockdiv');\n } else {\n resetSeconds();\n }\n\n }\n }\n\n }\n }", "title": "" }, { "docid": "9b109b00e4e2fabe186dccacceb40c72", "score": "0.6840016", "text": "function startGame() {\n gameArea.start();\n}", "title": "" }, { "docid": "9b109b00e4e2fabe186dccacceb40c72", "score": "0.6840016", "text": "function startGame() {\n gameArea.start();\n}", "title": "" }, { "docid": "4d2c4c47c26e2e6b31ed771a092b9ae1", "score": "0.68327147", "text": "_startGame(){\n this.game.dealInitial();\n }", "title": "" }, { "docid": "a40e2a08fbd1e9778a9cc9fb6ea0d2d1", "score": "0.6825079", "text": "function pauseButtonPressedGame(){\n}", "title": "" }, { "docid": "b7fb77ec95344752d484891806791a8c", "score": "0.68202215", "text": "function runGame(){\n\tconsole.log('runGame');\n}", "title": "" }, { "docid": "353a26fbcc4e774fb81f36647f1b772e", "score": "0.68113947", "text": "toggleGame() {\n if (\n this.state.cameraPermission == \"authorized\" ||\n this.state.cameraPermission == \"undetermined\"\n ) {\n if (!this.canRunGame) {\n this.startGame();\n } else {\n this.disableGame();\n }\n }\n }", "title": "" }, { "docid": "268b0ed5167c19b0371470eca9d13c01", "score": "0.68064153", "text": "function game () {\n run();\n moveQuestion();\n}", "title": "" }, { "docid": "37bc06bc5d17c80c7e91e7a11b8f4ef7", "score": "0.6794076", "text": "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n let anim = win.requestAnimationFrame(main);\n /*checks whether certain conditions are met.\n */\n pauseSc(anim);\n }", "title": "" }, { "docid": "8efd53923e8e35ad125fcc9cd664db81", "score": "0.6788319", "text": "function main(){\n console.log(\"main function activated\");\n if(gameOver==false){\n update();\n draw();\n //update frames\n } \n else{\n //call gameover function\n clearInterval(interval);\n console.log(\"gameOver function activated\");\n $(\".set\").attr(\"style\", \"display: none\");\n $(\".gameset\").attr(\"style\", \"display: none\");\n $(\"#scoreCount\").attr(\"style\", \"display: none\");\n $(\"#retry\").attr(\"style\", \"display: block\");\n setInterval(function(){countDown()}, 1000);\n }\n }", "title": "" }, { "docid": "ba2dd301eda99498db16b8cb4e3cca9f", "score": "0.6786738", "text": "_startGame () {\n\tthis.game.state.start('game');\n }", "title": "" }, { "docid": "a82c6020934abb528810cccf45113c51", "score": "0.67799485", "text": "function play() {\n\n //The play state is not needed in this example\n}", "title": "" }, { "docid": "40cc95067ce09ecd8420b932e44aaaeb", "score": "0.676885", "text": "function gameController() {\n lastTime = Date.now();\n switch (game.gameState) {\n case 0:\n ctx.clearRect(0,0,canvas.width,canvas.height);\n startScreen();\n break;\n case 1:\n ctx.clearRect(0,0,canvas.width,canvas.height);\n level1();\n break;\n case 2:\n ctx.clearRect(0,0,canvas.width,canvas.height);\n gameWin();\n }\n }", "title": "" }, { "docid": "3214f2a6c8b4d2c42886abdce31d5aa7", "score": "0.6766634", "text": "function startGame() {\n reset();\n $loButton.trigger('click');\n}", "title": "" }, { "docid": "08ca1fdfc0339a4a8d81b3c481859932", "score": "0.67661774", "text": "function main() {\n drawMenu();\n\n\n // while (GAME.active && GAME != null) {\n // GAME.updateGame(); //updates the game\n // GAME.wonFirst = true;\n // GAME.lostFirst = true;\n // GAME.over=false;\n // InitializeRoad();\n // InitializeBill();\n // InitializeBob();\n // InitializeBeans();\n // InitializeBabies();\n // GAME.runGame(); //renders the game\n // }\n //if no game is running\n //renders the menu screen\n}", "title": "" }, { "docid": "aa6f274ae0467768c01ec23e2eb01c85", "score": "0.67578804", "text": "function executeGame() {\n\n document.querySelector('#play').addEventListener(\"click\",function(){\n startGame();\n });\n\n}", "title": "" }, { "docid": "a95a07346e2f64a209333954c0f98c68", "score": "0.6756335", "text": "play()\r\n {\r\n form.hide(); // will hide form and its details \r\n player.getrank();\r\n textSize(30);\r\n text(\"Game Start\",120,100); // to print message in play stage \r\n // call player class get playerinfo () to get all players info\r\n Player.getPlayerInfo();\r\n if(allPlayers != undefined )\r\n {\r\n //to set background\r\n background(\"yellow\");\r\n // to apply track\r\n image(Trackimg,0,-displayHeight*4,displayWidth,displayHeight*5)\r\n var index=0; //cars index\r\n var x=170; // car x and y position\r\n var y;\r\n for(var i in allPlayers)\r\n { \r\n index=index+1;\r\n \r\n x=x+250;\r\n y=displayHeight-allPlayers[i].distance;\r\n cars[index-1].x=x;\r\n cars[index-1].y=y;\r\n\r\n if(index==player.index){\r\n cars[index-1].shapeColor=\"red\";\r\n camera.position.x=displayWidth/2;\r\n camera.position.y= cars[index-1].y\r\n }\r\n \r\n }\r\n \r\n\r\n }\r\n\r\n if(keyIsDown(UP_ARROW) && player.index !=null){\r\n player.distance +=50;\r\n player.update();\r\n }\r\n\r\n if(player.distance>4000){\r\n gameState=2;\r\n player.rank+=1\r\n Player.updaterank(player.rank);\r\n }\r\n drawSprites();\r\n }", "title": "" }, { "docid": "d60b850dad91b0531bb9e654183f18ed", "score": "0.6753267", "text": "function doGameTick() {\n\n}", "title": "" }, { "docid": "be46d8f41b9b0788117509cade71106d", "score": "0.6751063", "text": "function draw() {\n if (started === 1) {\n game();\n }\n}", "title": "" }, { "docid": "2e26d6ce2ed82f5008361660a902e164", "score": "0.6750067", "text": "startGame() {\n this.active = true;\n this.turn = this.players[0];\n this.currentChecker = new Checker(this.turn);\n }", "title": "" }, { "docid": "535c0d4828a293a0458911bd5c41e0f3", "score": "0.674766", "text": "function main(){\n\tscan();\n\tinitialize();\n\tsetInterval(game,16);\n}", "title": "" }, { "docid": "7cb98ef827a9bec328a43a2b5e441434", "score": "0.674196", "text": "function startGame(){\n $('button').show();\n $('[data-toggle=\"tooltip\"]').tooltip();\n $( \".startgame\" ).click(function(){\n if (playerA.playing===1){\n $('#player').text('Player A');\n }\n if (playerB.playing===1){\n $('#player').text('Player B');\n }\n\n resetvalue();\n setinitialshapes();\n playAudio();\n showgame();\n startInterval();\n $('.btn-danger').hide();\n $('.btn-info').hide();\n });\n playerA.playing=1;\n window.tetris = tetris;\n // bind keys\n bindKeys();\n // set up the initial shape\n hidegame();\n }", "title": "" }, { "docid": "9a0a94877c0c809710e1a15a812f28eb", "score": "0.67389", "text": "function playGame() {\n if (isGameOver) {\n return;\n }\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = \" Your turn \" + localStorage.getItem(\"username\");\n computerSquares.forEach(square => square.addEventListener('click', function (e) {\n revealSquare(square);\n }))\n }\n if (currentPlayer === 'computer') {\n turnDisplay.innerHTML = \"Computer's turn\";\n setTimeout(computerGo, 1000);\n }\n }", "title": "" }, { "docid": "db94e4534a847b0b4f30098b87c7040d", "score": "0.67341673", "text": "startGame() {\r\n this.resetGame();\r\n this.selectDifficulty(this.clickTile);\r\n this.display.resetGame(this.resetGame);\r\n }", "title": "" }, { "docid": "bfdb34c700c354397e82634fe6a49de2", "score": "0.67256504", "text": "function startPlay(level){\n\tgame_play_area();\n\tmy_game_core.start_start(level);\n}", "title": "" }, { "docid": "d26ee2ef6acc2e48d9bc3dc1daea7126", "score": "0.6721869", "text": "function runGame(){\n\n drawBackground();\n drawBall();\n checkBoundaries();\n \n}", "title": "" }, { "docid": "74e52c02f332eb0ddb0ab985326854ee", "score": "0.6720799", "text": "function setupGame() {\r\n\r\n}", "title": "" }, { "docid": "2297849d8095b7a6288d10bc552f92a7", "score": "0.6720233", "text": "function main() {\n\n /* Get time delta information which is required if the game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is)\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n if (!gameOver) {\n update(dt);\n render();\n }\n \n /* Set lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n console.log('main is running');\n /* Use browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "title": "" }, { "docid": "bf7215cc99db3f60c07bf39eec2576c7", "score": "0.67195827", "text": "function initPlayerDefault() {\n player1(); \n }", "title": "" }, { "docid": "f4cbf6aa38da27100e6579e715e08724", "score": "0.67187667", "text": "function controlGameState(e) {\n flap.pause();\n collision.pause();\n\n switch (state.current) {\n case state.getReady:\n swoosthing.play();\n state.current = state.game;\n break;\n case state.game:\n playAgain = false;\n flap.play();\n bird.flap();\n break;\n case state.over:\n // RESET BIRD \n bird.stopFlap();\n\n setTimeout(() => {\n playAgain = true;\n }, 500);\n\n if (playAgain == true) {\n state.current = state.getReady;\n\n // RESET VALUE\n let elem = canvas.getBoundingClientRect();\n let clientX = e.clientX - elem.left;\n let clientY = e.clientY - elem.top;\n if (clientX >= startBtn.left && clientX <= startBtn.left + startBtn.width && clientY >= startBtn.top && clientY <= startBtn.top + startBtn.height) {\n // RESET PIPES\n pipes.pipesReset();\n\n // RESET BIRD \n bird.birdReset();\n\n // SCORE RESET\n score.scoreReset();\n }\n }\n break;\n }\n}", "title": "" }, { "docid": "d76ac673ef4ea90ec2c8413406f99990", "score": "0.67152345", "text": "start () {\n this.gameLoop()\n }", "title": "" }, { "docid": "a6a13be25acfdacc85b9b2c4497a452a", "score": "0.671366", "text": "function startTheGame() {\n console.log(\"Game is starting\");\n}", "title": "" }, { "docid": "355c2f8d4559e5aebe78f0fdf1e794eb", "score": "0.67116237", "text": "function gameLogic(){\n\n //Switch for Current State\n switch(GameManager.currentState){\n\n //If Currently in Loading\n case GameManager.statesE.LOADING:\n\n //Draw Star Background\n Background.backgroundDraw();\n\n //Start LoadScreen Bar\n loadScreen.startBar(1 , () => {\n //Change State\n GameManager.currentState = GameManager.statesE.MAINMENU;\n //Reset Bar for later use\n loadScreen.resetBar();\n //Clear screen\n clear();\n startMainVideo();\n });\n break;\n\n //If Currently in Main Menu\n case GameManager.statesE.MAINMENU:\n \n //Draw Star Background\n Background.backgroundDraw();\n //Draw Main Menu\n mainmenu.drawMenu();\n imageMode(CENTER);\n image(uiSpaceFighterLogoIMG, width/2, height/4, 1000, 500);\n imageMode(CORNER)\n image(uiVideoBorderIMG, 10, 575, 580, 345);\n break;\n\n //If Currently in Playing\n case GameManager.statesE.PLAYING:\n\n Background.backgroundDraw();\n Controls.refresh();\n \n loadScreen.startBar(1, () => {\n console.log(\"DONE LOADING PLAYING\")\n if(GameManager.Difficulty.Mode == GameManager.DifficultModesE.ENDLESS){\n GameManager.Difficulty.neededKills = 999999999;\n }\n });\n\n if(loadScreen.COMPLETE){\n drawSprites();\n\n if(!GameManager.paused){\n\n //CLEANUP \n GameManager.cleanBulletGroups();\n GameManager.enemyShipsRefresh();\n \n //PLAYER ALIVE\n if(GameManager.player.ship.info.currentHealth > 0){\n\n //#region COLLISIONS\n\n //Reposition overlapped Sprites\n GameManager.Groups.enemySprites.collide(GameManager.Groups.enemySprites, (enemy) => {enemy.position.x += (random(-25, 25)); enemy.position.y += (random(-250, -150))});\n\n //BULLETS > ENEMIES\n GameManager.Groups.friendlybullets.collide(GameManager.Groups.enemySprites, (bullet,enemy) => {bullet.damage(bullet, enemy.self);});\n \n //ENEMIES > PLAYER\n GameManager.Groups.enemySprites.collide(GameManager.player.ship.sprite) ? GameManager.player.dealDamage(1) : 0;\n \n //PLAYER > BULLETS\n GameManager.player.ship.sprite.collide(GameManager.Groups.enemybullets, (player, bullet) => {\n bullet.damage(bullet, player.self);\n });\n //PLAYER > PICKUPS\n GameManager.player.ship.sprite.overlap(GameManager.Groups.pickups, (player, pickup) => pickup.self.effect(player, 100));\n //PLAYER > EVENTS\n GameManager.player.ship.sprite.overlap(GameManager.Groups.spaceEventsShop, () =>{\n GameManager.Groups.enemybullets.removeSprites();\n GameManager.Groups.friendlybullets.removeSprites();\n GameManager.currentPauseState = GameManager.pauseStatesE.SHOP;\n pauseGame(GameManager.currentPauseState);\n Shop.createShopPage()\n createSHOPMENU();\n console.log(\"IN SHOP\");\n })\n GameManager.Groups.enemySprites.overlap(GameManager.Groups.spaceEventsHazards, (enemy, nul) => {enemy.self.dealDamage(100)});\n GameManager.player.ship.sprite.overlap(GameManager.Groups.spaceEventsHazards) ? GameManager.player.dealDamage(1) : 0;\n\n //#endregion \n\n //SPAWN ENEMIES FROM SPAWNER\n GameManager.EnemyAndEventSpawner.refresh(GameManager.Difficulty.maxEnemies);\n\n //ALLOW PLAYER TO SHOOT\n GameManager.player.shoot(Controls.shoot1, Controls.shoot2);\n\n //DRAW PLAYER HEALTHBAR\n GameManager.player.healthbar();\n GameManager.player.shieldbar();\n //Recharge Player Shield //TODO ADD SHOP UPGRADE\n GameManager.player.shieldRecharge(.05);\n //REPOSITION SHIELD TO PLAYER\n GameManager.player.ship.sprite.shield.map(e => e.position = GameManager.player.ship.sprite.position);\n\n //ALLOW ENEMIES TO SHOOT\n GameManager.enemyShipsShootAll(GameManager.enemyShipsArray, GameManager.player.ship);\n\n \n //MOVE PLAYER BASED ON CONTROLS VECTOR\n GameManager.player.movePlayer(Controls.vector, 4 );\n \n //BOSS\n if(GameManager.bossSpawned){\n GameManager.boss.refresh();\n GameManager.boss.sprite.collide(GameManager.player.ship.sprite) ? GameManager.player.dealDamage(1) : 0;\n\n if(GameManager.boss.sprite.animation.getFrame() == 0 || GameManager.boss.sprite.animation.getFrame() == 10){\n GameManager.player.ship.sprite.collide(GameManager.Groups.bossAttacks, (player, attack) => {\n player.self.damage(attack);\n })\n GameManager.Groups.friendlybullets.collide(GameManager.boss.sprite, (bullet,boss) => {\n bullet.life = 1;\n boss.health -= bullet.damageAmount;\n });\n }\n }\n } \n\n } else{ \n\n //PAUSED\n Controls.zero();\n\n //LOCK PLAYER MOVEMENT\n GameManager.player.movePlayer(Controls.vector, 0 );\n\n\n //Switch for type of Pause\n switch(GameManager.currentPauseState){\n\n //In Game Pause\n case GameManager.pauseStatesE.PAUSE:\n pausemenu.drawMenu();\n break;\n\n //Shop Pause\n case GameManager.pauseStatesE.SHOP:\n\n \n imageMode(CENTER);\n //Shop Background\n image(shopPageIMG, width/2 - GameManager.settings.globalSettings.sidebarWidth/2, height/2);\n //Shop Items Group\n drawSprites(GameManager.Groups.ShopItems);\n //Shop Tooltip Background\n drawSprites(GameManager.Groups.hoverToolTip);\n //Draw Tooltip Text\n GameManager.Groups.hoverToolTip.forEach(e => e.self.drawInfo());\n //shopmenu.drawMenu();\n break;\n\n }\n \n } \n GameManager.player.currentLifes < 0 || GameManager.showGameOver ? drawGameOver() : 0;\n //DRAW SIDEBAR\n imageMode(CORNER);\n Sidebar.drawSideBar();\n } else {\n //Draw the loading Bar\n loadScreen.drawBar();\n }\n break;\n\n //If Currently in leaderboard Menu\n case GameManager.statesE.LEADERBOARD:\n //Draw Star Background\n Background.backgroundDraw();\n //createLEADERBOARD();\n\n //Draw Sprites in allSprites\n drawSprites();\n //Draw Leaderboard Text\n drawLEADERBOARDSCORES();\n\n break;\n \n //If Currently in Options\n case GameManager.statesE.OPTIONS:\n //Draw Star Background\n Background.backgroundDraw();\n\n //createLEADERBOARD();\n image(uiOptionsMenuIMG, width/2, height/2, 700, 900);\n fill(\"black\");\n textSize(64)\n textAlign(CENTER, TOP);\n\n text(\"MODE\",width/2, height/2 - 300);\n\n text(\"DIFFICULTY\",width/2, height/2 - 100);\n \n text(\"MUSIC\",width/2, height/2 + 100);\n\n text(\"HAZARDS\",width/2, height/2 + 250);\n\n //Draw Sprites in allSprites\n drawSprites();\n\n break;\n }\n}", "title": "" }, { "docid": "848744e6e171686d950bcac5c91835f1", "score": "0.67090964", "text": "function main() {\n\n // Get time delta information which is required for smooth animation\n\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call update/render functions, pass along the time delta to\n * update function since it may be used for smooth animation.\n */\n\n update(dt);\n render();\n\n /* Set lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n\n lastTime = now;\n\n // check whether or not to stop the game depending on game conditions created in game play\n\n loopFilter();\n\n function loopFilter () {\n\n // if game play doesn't require a stop in animation, use the browser's requestAnimationFrame function to call 'main' again as soon as the browser is able to draw another frame to continue the game loop\n\n if (!stopGame) {\n\n win.requestAnimationFrame(main);\n\n // stop game loop and call the 'you win' canvas prompt\n\n } else if (winGame) {\n\n youWin();\n\n // stop game loop and call the 'level passed' canvas prompt\n\n } else if (goUplevel) {\n\n passLevel();\n\n // stop game loop and call the 'paused' canvas prompt\n\n } else if (pause) {\n\n pauseGame();\n\n // stop game loop and call the opening canvas prompt\n\n } else if (beginGame) {\n\n gameBegin();\n\n // stop game loop and call the 'game over' canvas prompt\n\n } else {\n\n gameOver();\n\n }\n\n }\n\n // whenver the game loop stops, the background music is paused\n\n if (stopGame) {\n\n gameMusicSound.pause();\n\n }\n\n }", "title": "" }, { "docid": "c014bad26c77645aed24e77b43af667c", "score": "0.6697065", "text": "playGame(){\n this.addListeners();\n }", "title": "" }, { "docid": "03f805d230f09254570559a3072ec0ed", "score": "0.6693331", "text": "function startGame(){\n\t$(\"#userNameToShow\").html(loggedUser);\n\tinitParams();\n\t$(\"#scoreLabel\").html(\"0\");\n\tbackgroundSong.loop=true;\n\tbackgroundSong.play();\n\tgenerateBoard();\n\tinitPacmanPosition();\n\tinitCherry();\n\tinitGhostPositions();\n\tinitGhostsArr();\n\tsetGameIntervals();\n\tdrawLives();\n\tinitBonusPosition(\"medication\");\n\tinitGhostCorners();\n}", "title": "" }, { "docid": "1611f2fda5144048f11a525b13d3707b", "score": "0.66879016", "text": "function theGame(){\n background(0);\n display();\n displayCounter();\n state = 'theGame';\n}", "title": "" }, { "docid": "f02226335e7296e0f45753cfa69612d5", "score": "0.6683127", "text": "function startGame() {\n // Reset page state and make game 'active'\n clearBoard();\n gameActive = true;\n $('#fillMe').html('');\n // If the player chooses X, they will move AFTER the AI has moved first\n if (playerChar === 'X') {\n aiMove();\n }\n}", "title": "" }, { "docid": "a6ecc14c3eeac40546e5a21d6c0c836b", "score": "0.66812897", "text": "function GameControlReady() {\n gameReady = true;\n}", "title": "" }, { "docid": "d1dfb6644239b65957ef4af2d13b1459", "score": "0.66809225", "text": "function simonsTurn(){\n playSimonSeq();\n // enableButtons();\n}", "title": "" }, { "docid": "1e27d5c3e1559222715ddf9f3a4fbc83", "score": "0.6676768", "text": "function startGame() {\r\n renderBlanks()\r\n startTimer()\r\n \r\n // Prevents start button from being clicked when round is in progress\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "5ac4b7d655b6cbdf3526e9737b1bd279", "score": "0.6666778", "text": "function main() {\n /* Get the time delta information which is required if the game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call the update/render functions, pass along the time delta to\n * the update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Call the function which will check our newly-updated entities to see\n * if we should continue the game, or whether it should end as 'won' or\n * 'lost'\n */\n checkGameStatus();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n * We're saving the 'request id' value returned by requestAnimationFrame\n * function so that we will be able to stop the animation - stop the\n * game - if we need to. We initialized the requestId variable to 0 when\n * we declared it - this allows us to use 'undefined' for our test on\n * whether or not to continue the animation because we'll set the\n * requestId to 'undefined' in the 'stopGame' function when the\n * parameters for winning or losing the game are met, or if we determine\n * that the user has clicked the 'stop' or 'reset' button. So anything\n * other than 'undefined' means we should continue the game loop.\n */\n if (requestId !== undefined) {\n requestId = win.requestAnimationFrame(main);\n }\n }", "title": "" }, { "docid": "d90204dbcf3a15abc3e28d8323e82eed", "score": "0.66591537", "text": "function startGame() {\n var activePlayer = rollForTurn();\n setTimeout(function() {hideGameMsg();}, 4000);\n\n //assign state of control butto\n var btn = document.getElementById('btnStart');\n btnDisabled(btn); //disable start button since new game is active\n\n btn = document.getElementById('btnStop');\n stopEnabled(btn); //enable stop button for new game\n\n btn = document.getElementById('settingsBtn');\n btnDisabled(btn); //disable change of settings once game begins\n\n //assign active player to the console\n var showPlayer = document.getElementById('showPlayer');\n showPlayer.innerHTML = activePlayer;\n showPlayer.style.color = \"#5fdc37\";\n \n}", "title": "" }, { "docid": "5f50921596d99c54ea7953b63585bb04", "score": "0.6658391", "text": "newGame() {\n this.resetGame();\n this.chooseRandomPlayer();\n this.DOM.board.show();\n\n if(this.activePlayer.isComputer){\n this.computerMove();\n }\n }", "title": "" }, { "docid": "b2159a7bb67b5683370e1e7f294b130f", "score": "0.66545236", "text": "function runGame() {\n switch (gameRunner.state) {\n case GameState.LOADING:\n newGameState();\n break;\n case GameState.RUNNING:\n break;\n }\n}", "title": "" }, { "docid": "2bf91c6416af11855f993dd766017129", "score": "0.66488785", "text": "gameLoop(timestamp) {\n // Calcul des secondes passées depuis la dernière image\n let secondsPassed = (timestamp - this.oldTimestamp) / 1000;\n this.oldTimestamp = timestamp;\n \n if (this.keybordControls.isPressed('Pause') || this.keybordControls.isPressed('Escape') || this.keybordControls.isPressed('KeyP')) {\n this.pause(timestamp);\n }\n \n if(!this.pauseGame.value) {\n // Débloquage de succès\n if ( scripts.gameState === 'game' ) {\n if ( this.player.score > 100 && !scripts.displayCompetencies.exp ) {\n scripts.displayCompetencies.exp = true;\n document.getElementById('experiences').style.display = \"block\";\n setTimeout(() => {\n this.player.dialog(7);\n }, 100);\n } else if ( this.player.score > 200 && !scripts.displayCompetencies.formation ) {\n scripts.displayCompetencies.formation = true;\n document.getElementById('formations').style.display = \"block\";\n setTimeout(() => {\n this.player.dialog(7);\n }, 100);\n } else if ( this.player.score > 300 && !scripts.displayCompetencies.hobbies ) {\n scripts.displayCompetencies.hobbies = true;\n document.getElementById('hobbies').style.display = \"block\";\n setTimeout(() => {\n this.player.dialog(7);\n }, 100);\n } else if ( this.player.score > 400 && !scripts.displayCompetencies.contact ) {\n scripts.displayCompetencies.contact = true;\n document.getElementById('contact').style.display = \"block\";\n setTimeout(() => {\n events[6].toDisplay = true;\n this.player.dialog(8);\n }, 100);\n } else if ( this.player.score == 500 && events[6].executed && !this.endedGame ) {\n // Le joueur a fini le jeu\n this.endedGame = true;\n setTimeout(() => {\n this.player.dialog(11);\n }, 100);\n }\n }\n \n this.level.update(secondsPassed, this.player, this.keybordControls);\n this.player.update(secondsPassed, this.keybordControls);\n }\n \n this.level.draw();\n this.player.draw();\n\n window.requestAnimationFrame(timeStamp => {\n this.gameLoop(timeStamp);\n });\n }", "title": "" }, { "docid": "7d4779325a90d177745a6f8f22c8da8e", "score": "0.6648534", "text": "function onGameStarted() {\n return ControlPresets.FULL_GAME_CONTROL;\n}", "title": "" }, { "docid": "c9eab4a6fca7304aed5db9a925898731", "score": "0.66482776", "text": "startGame() {\n return this.resumeGame();\n }", "title": "" }, { "docid": "fe503773d7f85c32627e4827db9af723", "score": "0.6648092", "text": "function executeGame() {\n\n document.querySelector(\"#play\").addEventListener(\"click\", startGame)\n\n\n}", "title": "" }, { "docid": "bfe1bb3cddeb92cd0f77e27fbf746857", "score": "0.6647489", "text": "function runGame()\n {\n console.log(\"runGame()\");\n console.log(`Tracker: ${tracker}`);\n console.log(`Ticks: ${ticks}`);\n var humanTurn = $(this);\n if(gameStatus === 'ready')\n {\n turnHandler(humanTurn);\n }\n else if(gameStatus === 'ended')\n {\n $(\"#output\").text(\"Resetting Game...\");\n resetGame();\n }\n }", "title": "" }, { "docid": "e50923f948a1f4ea6d3ce8a2a239a749", "score": "0.6646828", "text": "start()\r\n{\r\n if(gameState === 0)\r\n{\r\nplayer=new Player();\r\nplayer.getCount();\r\nform=new Form();\r\nform.display();\r\n}\r\n}", "title": "" }, { "docid": "d7d156fd35c91d6cf02c93c85f773820", "score": "0.66407466", "text": "function winGame(){\n stopGame();\n alert(\"Great job. You won!\");\n}", "title": "" } ]
68a1daedf977cc0d7a886132971edf79
function to format date
[ { "docid": "25991f5ac68a42c1a712a9efc27b031a", "score": "0.0", "text": "function formatDOB(date){\n return `${date.split('-')[1]}/${date.split('-')[2][0]+date.split('-')[2][1]}/${date.split('-')[0]}`\n}", "title": "" } ]
[ { "docid": "8c834698947346468ac9465182b4f277", "score": "0.80229896", "text": "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "title": "" }, { "docid": "36335a69435d3343c9b226b5bb2b2010", "score": "0.78982013", "text": "function formatDate(date) {\n var day = date.getDate();\n var month = date.getMonth() + 1; //Months are zero based\n var year = date.getFullYear();\n var formattedDate = year + \"-\" + month + \"-\" + day;\n return formattedDate;\n }", "title": "" }, { "docid": "a55d0edfe18ea61815ac21e49d39c92e", "score": "0.7876802", "text": "function formatDate(date)\n{\n g_date=date.getDate();\n if(g_date <=9)\n {\n g_date=\"0\"+g_date;\n }\n g_month=date.getMonth();\n g_year=date.getFullYear();\n if (g_year < 2000) g_year += 1900;\n return todaysMonthName(date)+\" \"+g_date+\", \"+g_year;\n}", "title": "" }, { "docid": "4e832dfad146acec0dff98cda62c4ee1", "score": "0.7856424", "text": "function formattedDate(date) {\n\n // Récupération\n var month = String(date.getMonth() + 1);\n var day = String(date.getDate());\n var year = String(date.getFullYear());\n\n // Ajout du 0\n if (month.length < 2) \n month = '0' + month;\n\n // Ajout du 0\n if (day.length < 2) \n day = '0' + day;\n\n return day+'/'+month+'/'+year;\n }", "title": "" }, { "docid": "10b427fc7b4ad5a5753883df120c9b70", "score": "0.7775405", "text": "function formatDate(date) {\n \n var dd = date.getDate();\n if (dd < 10) {\n dd = '0' + dd;\n }\n \n var mm = date.getMonth() + 1;\n if (mm < 10) {\n mm = '0' + mm;\n }\n \n var yy = date.getFullYear();\n if (yy < 10) {\n yy = '0' + yy;\n }\n \n return mm + '/' + dd + '/' + yy;\n }", "title": "" }, { "docid": "a032ab131febf762e5e27e4dd33d0e9f", "score": "0.77482456", "text": "function formattedDate(date) {\r\n\t\t\t\t\tvar d = new Date(date),\r\n\t\t\t\t\t\tmonth = '' + (d.getMonth() + 1),\r\n\t\t\t\t\t\tday = '' + d.getDate(),\r\n\t\t\t\t\t\tyear = d.getFullYear();\r\n\r\n\t\t\t\t\tif (month.length < 2) month = '0' + month;\r\n\t\t\t\t\tif (day.length < 2) day = '0' + day;\r\n\t\t\t\t\treturn [year, month, day].join('-');\r\n\t\t\t\t}", "title": "" }, { "docid": "b04e78dc1b1916a9cff23a1dcb1bb01b", "score": "0.7740092", "text": "function formatDate(date) {\n var day = date.getDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n\n var month = date.getMonth() + 1;\n if (month < 10) {\n month = \"0\" + month;\n }\n\n var year = date.getFullYear();\n\n return day + \".\" + month + \".\" + year;\n}", "title": "" }, { "docid": "2b198c512c23f480148fdec79fb525a3", "score": "0.77229714", "text": "function formatDate(date) {\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear().toString().slice(-2);\n return day + month + year;\n}", "title": "" }, { "docid": "d3ad859e48950ba6ba286d174a62fa46", "score": "0.7717673", "text": "formatDate (date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "e2c3dabcd3c4e53e8eb377c2777c05f6", "score": "0.7711721", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "c601b274f8907157dbaea8c718488886", "score": "0.769446", "text": "function formatDate(date){\n var yyyy = date.getFullYear();\n var mm = date.getMonth() + 1;\n var dd = date.getDate();\n //console.log(\"This is dd\" + dd);\n if(dd<10){\n dd='0'+ dd;\n }\n if(mm<10){\n mm='0'+mm;\n } \n return ( mm + '/' + dd + '/' + yyyy);\n \n }", "title": "" }, { "docid": "6d7178b3506caf7cb4511c0118b3cdd7", "score": "0.76909953", "text": "function formatDate(date, format){\n if(!date){\n return '0000-00-00';\n }\n var dd = date.substring(0, 2);\n var mm = date.substring(3, 5);\n var yy = date.substring(6);\n if (format == 'dmy') {\n return dd + '-' + mm + '-' + yy;\n } else {\n return yy + '-' + mm + '-' + dd;\n }\n }", "title": "" }, { "docid": "b86f1aa91822834ecdc9448850991424", "score": "0.7690983", "text": "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "title": "" }, { "docid": "1d22b49d450c9a592f19f615b491d9d1", "score": "0.76804984", "text": "function formatDate(date) {\r\n\r\n let dd = date.getDate();\r\n if (dd < 10) dd = '0' + dd;\r\n\r\n let mm = date.getMonth() + 1;\r\n if (mm < 10) mm = '0' + mm;\r\n\r\n let yy = date.getFullYear() % 100;\r\n if (yy < 10) yy = '0' + yy;\r\n\r\n return dd + '.' + mm + '.' + yy;\r\n}", "title": "" }, { "docid": "bfde5ebf272f8316930c477796b54520", "score": "0.76715106", "text": "function dateFormatter(date){\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n return year + '-' + ('0' + month).slice(-2) + '-' + day; // the '0' and the slicing is for left padding\n}", "title": "" }, { "docid": "79cd01792bb5806c9bb3fa6c4e1b9ee5", "score": "0.7670629", "text": "function formatDate(date) {\n\t\t\t\treturn date.getDate() + \"-\" + (date.getMonth()+1) + \"-\" + date.getFullYear();\n\t\t\t}", "title": "" }, { "docid": "3f530becfb329c8ea3900be0eeacb668", "score": "0.76665986", "text": "function formatDate() {\n var d = new Date(),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n \n return [day, month, year].join('/');\n }", "title": "" }, { "docid": "66c1314ce50103f8cc53391321a8cc23", "score": "0.7664738", "text": "function formatDate(date) {\n var dd = date.getDate()\n if (dd < 10) dd = '0' + dd;\n var mm = date.getMonth() + 1\n if (mm < 10) mm = '0' + mm;\n var yy = date.getFullYear();\n if (yy < 10) yy = '0' + yy;\n return dd + '.' + mm + '.' + yy;\n}", "title": "" }, { "docid": "687d74552a1cc705ca3718a544937333", "score": "0.7658275", "text": "function formatDate(date) {\n if (date.length < 2) {\n return \"0\" + date;\n } else {\n return date;\n }\n}", "title": "" }, { "docid": "394273d61f44227789e59f106a0e16a6", "score": "0.7649787", "text": "function formatDate(date) {\n\tif (date == null) {\n\t\treturn null;\n\t}\n\tvar d = date.getDate();\n\tvar m = date.getMonth() + 1;\n\tvar y = date.getFullYear();\n\treturn '' + (d <= 9 ? '0' + d : d) + '-' + (m <= 9 ? '0' + m : m) + '-' + y;\n}", "title": "" }, { "docid": "cbc3cf5cb48f10c70d492814728d88c1", "score": "0.7646211", "text": "function formatDate(date){\n\tvar day = date.getDate();\n var monthIndex = date.getMonth();\n var year = date.getFullYear();\n\treturn months[monthIndex] + \" \" + day + \", \" + year;\n}", "title": "" }, { "docid": "3a30f318c640226a044fd73fad473ffa", "score": "0.76447165", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n month = '0' + month;\n }\n if (day.length < 2) {\n day = '0' + day;\n }\n\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "4baa5c9fa189fada4204daa39f279644", "score": "0.7638743", "text": "function formatDate(d) {\n return `${d.year}-${d.month}-${d.day}`\n }", "title": "" }, { "docid": "e778fd9a5b1e1e62fe2bdf400337f40d", "score": "0.763736", "text": "function formatDate(date) {\n const month = date.getMonth() + 1;\n const day = date.getDate();\n const year = date.getFullYear();\n \n return `${month}/${day}/${year}`;\n }", "title": "" }, { "docid": "a90dff2f7979078d8f9807f76d57dd8f", "score": "0.7631055", "text": "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "bc510902f64f9f82f27f5a892b982b9f", "score": "0.7624957", "text": "function formatDate(date) {\n let source = new Date(date);\n let day = source.getDate();\n let month = source.getMonth() + 1;\n let year = source.getFullYear();\n\n return `${day}/${month}/${year}`;\n }", "title": "" }, { "docid": "274e623a42ab9daaf0208154272ec97e", "score": "0.76243186", "text": "function formatDate(date){\n var dd = date.getDate(),\n mm = date.getMonth()+1, //January is 0!\n yyyy = date.getFullYear();\n\n if(dd<10) dd='0'+dd;\n if(mm<10) mm='0'+mm;\n\n return yyyy+'-'+mm+'-'+dd;\n}", "title": "" }, { "docid": "5fd2e791585a156fad0c81ad17f8b076", "score": "0.761591", "text": "function formatDate(date) {\n return format(new Date(date), 'yyyy-MM-dd')\n}", "title": "" }, { "docid": "8614e6851fbb88373269d674ded17987", "score": "0.7600514", "text": "function dateFormat(i){\n var date = data.list[i].dt_txt;\n var year = date.slice(0,4);\n var day = date.slice(5,7);\n var month = date.slice(8,10);\n\n var newDateFormat = day + \"/\" + month + \"/\" + year;\n console.log(newDateFormat);\n return newDateFormat;\n }", "title": "" }, { "docid": "ef9106ae703255a23f9f03fb6977052f", "score": "0.759434", "text": "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n }", "title": "" }, { "docid": "2141a6e0f85120f7ab3d5dd0084dcc22", "score": "0.7590029", "text": "function formatDate(val) {\n var d = new Date(val),\n day = d.getDate(),\n month = d.getMonth() + 1,\n year = d.getFullYear();\n\n if (day < 10) {\n day = \"0\" + day;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return month + \"/\" + day + \"/\" + year;\n}", "title": "" }, { "docid": "230b4bbdbbe2e446d2368ff81aeb4955", "score": "0.75792575", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "087217e9f59e73926e4111327407f3e0", "score": "0.75597423", "text": "function formatDate(date) {\n var d = new Date(date);\n d = d.toLocaleString();\n return d;\n }", "title": "" }, { "docid": "f650fde7df61ae8e0421cac775d39b4c", "score": "0.7555843", "text": "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n}", "title": "" }, { "docid": "2c523f1deb3d83ffaf005d3e318db5bf", "score": "0.75546664", "text": "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "title": "" }, { "docid": "46e008cbc24c703cf83b183c4ea617e9", "score": "0.75524753", "text": "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "title": "" }, { "docid": "46e008cbc24c703cf83b183c4ea617e9", "score": "0.75524753", "text": "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "title": "" }, { "docid": "96cd2a7221579b913df5d0a9c88a08da", "score": "0.75513893", "text": "function formatDate(date) {\n\t\tvar day = date.getDate();\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(day / 10) == 0) {\n\t\t\tday = \"0\" + day;\n\t\t}\n\t\t\n\t\tvar month = date.getMonth() + 1; // months start at 0\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(month / 10) == 0) {\n\t\t\tmonth = \"0\" + month;\n\t\t}\n\t\t\n\t\tvar year = date.getFullYear();\n\t\t\n\t\treturn day + \"/\" + month + \"/\" + year;\n\t}", "title": "" }, { "docid": "e5335341efa13cf6296b05686a50f5a1", "score": "0.75473064", "text": "function formatDate(date){\n var yr = date.getFullYear();\n var mnth = date.getMonth()+1;\n if(mnth < 10){\n mnth = `0${mnth}`;\n }\n var day = date.getDate()\n if(day < 10){\n day = `0${day}`;\n }\n return yr+\"-\"+mnth+\"-\"+day;\n}", "title": "" }, { "docid": "af6727136c431ef3ef37cade30bba3e3", "score": "0.7546642", "text": "function formatDate(date) {\r\n var d = date ? new Date(date) : new Date()\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n if (month.length < 2)\r\n month = '0' + month;\r\n if (day.length < 2)\r\n day = '0' + day;\r\n\r\n return `${day}${month}${year}`;\r\n}", "title": "" }, { "docid": "90eea3222c511b8ccef155bd550a01d3", "score": "0.754641", "text": "function formatDate(date) {\n return date.getFullYear() + '-' +\n (date.getMonth() < 9 ? '0' : '') + (date.getMonth()+1) + '-' +\n (date.getDate() < 10 ? '0' : '') + date.getDate();\n}", "title": "" }, { "docid": "d729bf77a7d7e72be822aa9d866a358b", "score": "0.75310117", "text": "formatTheDate(date, format) {\n const [ year, month, day ] = (date.toISOString()).substr(0, 10).split('-');\n return dateFns.format(new Date(\n year,\n (month - 1),\n day,\n ), format);\n }", "title": "" }, { "docid": "7ab6a58b6da21b18f1c0aa9b1216a940", "score": "0.752584", "text": "function formatDate(date) {\n\t\treturn (date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear() + ' - ' + formatTime([date.getHours(), date.getMinutes()]));\n\t}", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.7523719", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.7523719", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.7523719", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "0ca8f16b66cc80ef8487ccc578c6866c", "score": "0.7508412", "text": "function formatDate(date) {\n var day = date.getDate();\n var month = date.getMonth();\n var year = date.getFullYear();\n month++;\n if (month < 10)\n month = '0' + month;\n if (day < 10)\n day = '0' + day;\n return [year, month, day].join('-').toString();\n}", "title": "" }, { "docid": "8b23d3585ef5fc2592def305b998fe07", "score": "0.7505491", "text": "function formatDate(date) {\n\treturn new Date(date.split(' ').join('T'))\n}", "title": "" }, { "docid": "996603203d1ecc5774068d4dd4d13d86", "score": "0.75041264", "text": "formatDate(date) {\n return date.toISOString().replaceAll(\"-\", \"\").substring(0, 8);\n }", "title": "" }, { "docid": "cdb0a8fe4e33fa1d79785e53d99c2bff", "score": "0.7496785", "text": "function formatteddate(inputDate){\r\n var inDate = new Date(inputDate);\r\n var month = '' + (inDate.getMonth() + 1);\r\n var day = '' + inDate.getDate();\r\n var year = inDate.getFullYear();\r\n \t if (month.length < 2) month = '0' + month;\r\n \t if (day.length < 2) day = '0' + day;\r\n return [year, month, day].join('-');\r\n }", "title": "" }, { "docid": "21ea6bd79058e67e3c108b5c07fa386f", "score": "0.74914104", "text": "function formatDate(date) {\r\n var day = '',\r\n month = '',\r\n year = '',\r\n tmp = [],\r\n str = '';\r\n tmp = date.split('/');\r\n day = tmp[1];\r\n month = tmp[0];\r\n year = '20' + tmp[2];\r\n str = year + '-' + month + '-' + day;\r\n return str;\r\n}", "title": "" }, { "docid": "2bbb6e30febce0bd3d802a3d49058a47", "score": "0.74911475", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n \tmonth = '0' + month;\n }\n if (day.length < 2) {\n \tday = '0' + day;\n }\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "f96954d1d377de549daf3261fc1506a4", "score": "0.74872094", "text": "function formatDate(date) {\n return date.replace(/(^\\d{4})([\\-\\/])(\\d{2})\\2(\\d{2})$/, '$4.$3.$1')\n}", "title": "" }, { "docid": "0ce638920de6e9a6746b8f91650c9a7a", "score": "0.7481034", "text": "date_lisible_format(date){\n var day = date.substring(0, 2),\n month_number = date.substring(3, 5),\n year = date.substring(6, 10);\n\n const Date_Month_Key = new Map([[\"01\", \"Janvier\"], [\"02\", \"Fevrier\"], [\"03\", \"Mars\"], [\"04\", \"Avril\"], [\"05\", \"Mai\"], [\"06\", \"Juin\"], [\"07\", \"Juillet\"], [\"08\", \"Août\"], [\"09\", \"Septembre\"], [\"10\", \"Octobre\"], [\"11\", \"Novembre\"], [\"12\", \"Decembre\"]]); \n var month = Date_Month_Key.get(month_number);\n\n var date_format = day+\" \"+month+\" \"+year;\n\n return date_format;\n }", "title": "" }, { "docid": "f719c9ec12e15ff58eafb359abae77cc", "score": "0.7480171", "text": "function formatDate(date, format) {\n return format\n .replace(/yyyy/i, util_toString(date.getFullYear()))\n .replace(/MM/i, lpad(date.getMonth() + 1))\n .replace(/M/i, util_toString(date.getMonth()))\n .replace(/dd/i, lpad(date.getDate()))\n .replace(/d/i, util_toString(date.getDate()));\n}", "title": "" }, { "docid": "90b400dd30faf698e5d1514fbe56f5c5", "score": "0.74780744", "text": "function formatDate(date){\n\treturn [date.getFullYear(), \n\t\t\t(((date.getMonth()+1)<10)?\"0\":\"\") + (date.getMonth()+1),\n\t\t\t((date.getDate()<10)?\"0\":\"\") + date.getDate()\n\t\t ].join(\"-\");\n}", "title": "" }, { "docid": "69edaa90de66fb058e5090cbc345d5a7", "score": "0.7474837", "text": "function formatDate(date) {\n const d = new Date(date);\n return d.getFullYear() + \"-\" + twoDigits(d.getMonth() + 1) + \"-\" + twoDigits(d.getDate());\n}", "title": "" }, { "docid": "1f026bc60f179a71e40b7d1c501abc67", "score": "0.74689585", "text": "function formattedDate(d) {\n let month = String(d.getMonth() + 1);\n let day = String(d.getDate());\n const year = String(d.getFullYear());\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return `${year}-${month}-${day}`;\n }", "title": "" }, { "docid": "fcbcd6d26100fc17d03d06d50f961ecc", "score": "0.74653244", "text": "function formatDate(date) {\r\n return date.getFullYear().toString() + (date.getMonth() + 1).toString().padStart(2, '0') + date.getDate().toString() \r\n + date.getHours().toString().padStart(2, '0') + date.getMinutes().toString().padStart(2, '0');\r\n }", "title": "" }, { "docid": "642a81c8c21e3387be9a139f9145813e", "score": "0.74641526", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "3901e67c1e072a8a129c06cbd75398cf", "score": "0.7462693", "text": "function dateformat(date) {\n \n // Main array that will be used to sort out the date.\n let dateArray = date.split('-');\n // Sorts days\n let dayArray = dateArray[2].split('T');\n let day = dayArray[0];\n // Sets up month and year months\n let month = dateArray[1];\n let year = dateArray[0];\n // Using the global standard or writing DOB\n let formatedDOB = [day, month, year].join('-');\n // Retuns the data from the formatted DOB.\n return formatedDOB;\n }", "title": "" }, { "docid": "d387cd8b0284bc0d0e9763cc76e1f836", "score": "0.74622947", "text": "function formatDate(date) {\n result = \"\";\n if (date) {\n result += date.getDate() + \"/\"; // Day\n result += (date.getMonth() + 1) + \"/\";\n result += (date.getYear() + 1900);\n }\n return result;\n}", "title": "" }, { "docid": "94045d1d5964efd21fb7c65c5e449309", "score": "0.7456913", "text": "function formatDate(date){\n var date_array = date.split('-');\n return date_array[1] + '/' + date_array[2] + '/' + date_array[0]\n }", "title": "" }, { "docid": "fb7b59ffa05ee66b7f51edf5ef5d1ba8", "score": "0.7452084", "text": "function formatDate ( date ) {\n return date.getDate() + nth(date.getDate()) + \" \" +\n months[date.getMonth()] + \" \" +\n date.getFullYear();\n}", "title": "" }, { "docid": "455cd99abfe7dfcad04ff658ab88ce2f", "score": "0.74512845", "text": "function formatDate(date) {\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day = date.getDate();\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "59800b3c875543eb508e1113effd817a", "score": "0.74503464", "text": "getFormattedDate(date) {\n return dayjs(date).format(\"MMM MM, YYYY\");\n }", "title": "" }, { "docid": "9bca1c86ad35e37052ed87c339e2eea5", "score": "0.74431056", "text": "function formatDate(date) {\n\tvar datum = new Date(date);\n\tvar jahr = datum.getFullYear();\n\tvar month_number = datum.getMonth();\n\tvar monat = \"\";\n\tswitch(month_number) {\n\t\tcase 0:\n\t\t\tmonat = \"Januar\"; break;\n\t\tcase 1:\n\t\t\tmonat = \"Februar\"; break;\n\t\tcase 2:\n\t\t\tmonat = \"März\"; break;\n\t\tcase 3:\n\t\t\tmonat = \"April\"; break;\n\t\tcase 4:\n\t\t\tmonat = \"Mai\"; break;\n\t\tcase 5:\n\t\t\tmonat = \"Juni\"; break;\n\t\tcase 6:\n\t\t\tmonat = \"Juli\"; break;\n\t\tcase 7:\n\t\t\tmonat = \"August\"; break;\n\t\tcase 8:\n\t\t\tmonat = \"September\"; break;\n\t\tcase 9:\n\t\t\tmonat = \"Oktober\"; break;\n\t\tcase 10:\n\t\t\tmonat = \"November\"; break;\n\t\tcase 11:\n\t\t\tmonat = \"Dezember\"; break;\n\t}\n\tvar tag = datum.getDate();\n\tvar stunden = datum.getHours();\n\tvar min = datum.getMinutes();\n\t// bei den Minuten und Stunden fehlt wenn sie einstellig sind die erste 0\n\tif (stunden < 10) {\n\t\tif (min < 10) {\n\t\t\treturn tag+\". \"+monat+\" \"+jahr+\", 0\"+stunden+\":0\"+min;\n\t\t}\n\t\treturn tag+\". \"+monat+\" \"+jahr+\", 0\"+stunden+\":\"+min;\n\t} else if (min < 10) {\n\t\treturn tag+\". \"+monat+\" \"+jahr+\", \"+stunden+\":0\"+min;\n\t}\n\treturn tag+\". \"+monat+\" \"+jahr+\", \"+stunden+\":\"+min;\n}", "title": "" }, { "docid": "391c3c75d33f48597b5add50e7bb23b4", "score": "0.7430092", "text": "function FormatDate(DateToFormat) {\r\nvar year = \"\";\r\nvar month = \"\";\r\nvar day = \"\";\r\n\r\nyear = DateToFormat.getFullYear();\r\nmonth = DateToFormat.getMonth() + 1;\r\nmonth = \"0\" + month;\r\nif (month.length == 3) { \r\nmonth = month.substr(1,2);\r\n}\r\nday = \"0\" + DateToFormat.getDate();\r\nif (day.length == 3) {\r\nday = day.substr(1,2);\r\n}\r\n\r\nreturn year + \"-\" + month + \"-\" + day;\r\n}", "title": "" }, { "docid": "f75d142205a4d12bae592118e90cb8e5", "score": "0.74247307", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "70e9db249540a924d019ef3aada08c3d", "score": "0.7419113", "text": "function formatDate (date) {\n if (date) {\n const year = date.getFullYear()\n const month = date.getMonth() + 1\n const day = date.getDate()\n return year + '-' + month.toString().padStart(2, '0') + '-' + day.toString().padStart(2, '0')\n } else {\n return ''\n }\n}", "title": "" }, { "docid": "f1673c79506c980fe6a16c4108fb00a0", "score": "0.7405647", "text": "function _getFormattedDate(date) {\n var year = date.getFullYear();\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n return month + '/' + day + '/' + year;\n }", "title": "" }, { "docid": "29aea0dc73037038d259584a89cb51a0", "score": "0.7404992", "text": "function formatDate(){\n if (!Date.prototype.toISODate) {\n Date.prototype.toISODate = function() {\n return this.getFullYear() + '-' +\n ('0'+ (this.getMonth()+1)).slice(-2) + '-' +\n ('0'+ this.getDate()).slice(-2);\n }\n }\n }", "title": "" }, { "docid": "55cd728fdbbd1c01d0a5ef2837de8215", "score": "0.74045485", "text": "function GetFormatDate() {\n\tvar d = new Date();\n\tvar yyyy = d.getFullYear();\n\tvar mm = d.getMonth() < 9 ? \"0\" + (d.getMonth() + 1) : (d.getMonth() + 1); // getMonth() is zero-based\n\tvar dd = d.getDate() < 10 ? \"0\" + d.getDate() : d.getDate();\n\tvar hh = d.getHours() < 10 ? \"0\" + d.getHours() : d.getHours();\n\tvar min = d.getMinutes() < 10 ? \"0\" + d.getMinutes() : d.getMinutes();\n\tvar ss = d.getSeconds() < 10 ? \"0\" + d.getSeconds() : d.getSeconds();\n\treturn \"\".concat(yyyy).concat(\"-\").concat(mm).concat(\"-\").concat(dd).concat(\" \").concat(hh).concat(\":\").concat(min).concat(\":\").concat(ss);\n}", "title": "" }, { "docid": "e8e86fd220fa93d15a9b79b30d1b85ba", "score": "0.74019086", "text": "static formatDate (date, format) {\n let year = date.getFullYear(),\n month = Timer.zero(date.getMonth()+1),\n day = Timer.zero(date.getDate()),\n hours = Timer.zero(date.getHours()),\n minute = Timer.zero(date.getMinutes()),\n second = Timer.zero(date.getSeconds()),\n week = date.getDay();\n return format.replace(/yyyy/g, year)\n .replace(/MM/g, month)\n .replace(/dd/g, day)\n .replace(/hh/g, hours)\n .replace(/mm/g, minute)\n .replace(/ss/g, second)\n .replace(/ww/g, Timer.weekName(week));\n }", "title": "" }, { "docid": "13316e54a9cc92aec03dc965845f40bb", "score": "0.7399676", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "a9944ed75a526ae4829c256bc4714696", "score": "0.73936176", "text": "function formattedDate(d = new Date()) {\n return [d.getDate(), d.getMonth() + 1, d.getFullYear()]\n .map((n) => (n < 10 ? `0${n}` : `${n}`))\n .join(\"/\")\n .concat(` at ${getTime(d)}`);\n }", "title": "" }, { "docid": "0d2ca6f086e3720ddfb2a3653be636e8", "score": "0.7386569", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-');\n}", "title": "" }, { "docid": "b7c53f78bcf4805e5bad02f971422bcd", "score": "0.737719", "text": "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 }", "title": "" }, { "docid": "dcae15008ab8682752e54beef18ea70a", "score": "0.7371125", "text": "static formatDateDDMMYYYY(date) {\n if (Common.isNullOrUndifined(date)) return \"\";\n try {\n return moment(date).format(\"DD/MM/yyyy\");\n } catch (error) {\n console.log(\"formatDateDDMMYYYY\\n\" + error);\n }\n }", "title": "" }, { "docid": "5b8806f829153a530b807eef025f1d20", "score": "0.7366276", "text": "function formattedDate(d = new Date) {\n\treturn [d.getDate(), d.getMonth()+1, d.getFullYear()]\n\t\t.map(n => n < 10 ? `0${n}` : `${n}`).join('/');\n }", "title": "" }, { "docid": "c5feff956d317121856a429019d2e9bd", "score": "0.7365216", "text": "function format(d) {\n const month = d.getMonth() >= 9 ? d.getMonth() + 1 : `0${d.getMonth() + 1}`;\n const day = d.getDate() >= 10 ? d.getDate() : `0${d.getDate()}`;\n const year = d.getFullYear();\n return `${month}/${day}/${year}`;\n}", "title": "" }, { "docid": "cf5d1c409c6e476c43e5f2d0aacfc80e", "score": "0.7362865", "text": "function formatDate(d) {\n return (d.getMonth()+1) + '/' +\n d.getDate() + '/' +\n d.getFullYear();\n }", "title": "" }, { "docid": "61397acdfc4497cfdd5cb4200c733bf7", "score": "0.7358181", "text": "formatDate(value, format) {\n format = format || '';\n if (value) {\n return window.moment(value)\n .format(format);\n }\n return \"n/a\";\n }", "title": "" }, { "docid": "de95eaea46047d37b5a14b0d1eb982f4", "score": "0.73505056", "text": "function formatDate(date)\n{\n date = new Date(date * 1000);\n return '' + date.getFullYear() + '/' + lpad(date.getMonth(), 2, '0') + '/' + lpad(date.getDate(), 2, '0') + ' ' + lpad(date.getHours(), 2, '0') + ':' + lpad(date.getMinutes(), 2, '0');\n}", "title": "" }, { "docid": "55b643b07f3e3ab880ea491fb73b28c7", "score": "0.73460597", "text": "function pgFormatDate(date) {\n /* Via http://stackoverflow.com/questions/3605214/javascript-add-leading-zeroes-to-date */\n return String(date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()); \n}", "title": "" }, { "docid": "c6185cd0566b65dcc5ceb32f5d98f593", "score": "0.73447484", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear().toString().substring(2);\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [month, day, year].join('-');\n}", "title": "" }, { "docid": "4509f5718ac50df1b4f4dcbdcea761d3", "score": "0.7340298", "text": "function formatDate(date){\n\t\tvar formatted = {\n\t\t\tdate:date,\n\t\t\tyear:date.getFullYear().toString().slice(2),\n\t\t\tmonth:s.months[date.getMonth()],\n\t\t\tmonthAbv:s.monthsAbv[date.getMonth()],\n\t\t\tmonthNum:date.getMonth() + 1,\n\t\t\tday:date.getDate(),\n\t\t\tslashDate:undefined,\n\t\t\ttime:formatTime(date)\n\t\t}\n\t\tformatted.slashDate = formatted.monthNum + '/' + formatted.day + '/' + formatted.year;\n\t\treturn formatted;\n\t}", "title": "" }, { "docid": "36f5ecdc77f541279898733c4fe98207", "score": "0.7339219", "text": "function formatDate(date) {\n var newDate = new Date(date);\n var dd = newDate.getDate();\n var mm = newDate.getMonth() + 1; // January is 0!\n\n var yyyy = newDate.getFullYear();\n\n if (dd < 10) {\n dd = \"0\".concat(dd);\n }\n\n if (mm < 10) {\n mm = \"0\".concat(mm);\n }\n\n var formatedDate = \"\".concat(dd, \"/\").concat(mm, \"/\").concat(yyyy);\n return formatedDate;\n}", "title": "" }, { "docid": "9718e640d561d7be568065fdcc809808", "score": "0.73391324", "text": "function formatDate(date) {\n var year = date.substring(0, 2);\n var month = date.substring(3, 5);\n var day = date.substring(6, 8);\n\n var monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n var monthString = monthNames[parseInt(month)-1];\n var dayString = parseInt(day);\n var yearString = \"20\" + year;\n\n return monthString + \" \" + dayString + \", \" + yearString;\n}", "title": "" }, { "docid": "424defc37907af59433e79dd5e299ae9", "score": "0.73390865", "text": "function formatDate(date) { \n var dateString = date + \"\";\n return dateString.substring(2);\n}", "title": "" }, { "docid": "170d1f5c56e85aaed12c63fce9984736", "score": "0.7326655", "text": "returnDateFormat(date){\n var day = new Date(date);\n return day.toDateString();\n }", "title": "" }, { "docid": "cdcd5cb441b24bdb26b7d3926e5972ce", "score": "0.7322004", "text": "function formatDate(date) {\n\tlet d = new Date(date),\n\t\tmonth = \"\" + (d.getMonth() + 1),\n\t\tday = \"\" + d.getDate(),\n\t\tyear = d.getFullYear();\n\n\tif (month.length < 2) month = \"0\" + month;\n\tif (day.length < 2) day = \"0\" + day;\n\n\treturn [year, month, day].join(\"-\");\n}", "title": "" }, { "docid": "aa1c62afd15f06d76e390752a96c065b", "score": "0.73147064", "text": "function formatDate(input) {\n\tvar d = new Date(input);\n\tvar month = ('0' + (d.getMonth() + 1)).slice(-2);\n var date = ('0' + d.getDate()).slice(-2);\n return d.getFullYear() + \"-\" + month + \"-\" + date;\n}", "title": "" }, { "docid": "1066648dd7094f65e9e0fbf08d1ac428", "score": "0.7298835", "text": "function prettyFormatDate(date) {\n return Utilities.formatDate(new Date(date), \"GMT-7\", \"MM/dd/yy\").toString();\n}", "title": "" }, { "docid": "4fffcbee274e01e5e5096facbc8d54dd", "score": "0.72959936", "text": "static formatDate(date) {\n let formattedDate = '';\n\n formattedDate += date.getUTCFullYear();\n formattedDate += '-' + ('0' + (date.getUTCMonth() + 1)).substr(-2);\n formattedDate += '-' + ('0' + date.getUTCDate()).substr(-2);\n\n return formattedDate;\n }", "title": "" }, { "docid": "0e530642be499f99efb0753fee49254a", "score": "0.7291373", "text": "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "title": "" }, { "docid": "21ac747e293da202f77d346caffe8aa1", "score": "0.7288302", "text": "function formatted_date()\n{\n var result=\"\";\n var d = new Date();\n var month = (d.getMonth()+1);\n var day = d.getDate();\n if (d.getMonth()+1 < 10){\n \t\tvar month = '0' + (d.getMonth()+1);\n }\n if (d.getDate()+1 < 10){\n \t\tvar day = '0' + d.getDate();\n }\n result += d.getFullYear() +''+ month +''+ day;\n console.log(result);\n return result;\n}", "title": "" }, { "docid": "0207fb3abc512584ef3bff3e82310499", "score": "0.7285654", "text": "function setFormatoDate(data) {\n let dd = (\"0\" + (data.getDate())).slice(-2);\n let mm = (\"0\" + (data.getMonth() + 1)).slice(-2);\n let yyyy = data.getFullYear();\n return dd + '/' + mm + '/' + yyyy;\n}", "title": "" }, { "docid": "e5d0e27c7c97911acbc308ee222d7d8b", "score": "0.7282875", "text": "function getFormattedDate(date) {\n return $filter('date')(date, 'yyyy-MM-dd');\n }", "title": "" }, { "docid": "0960670fe601237e2bee2436978360d0", "score": "0.72822535", "text": "function formatDateString (date) {\n var month = (date.getMonth() + 1); \n var day = date.getDate();\n if (month < 10) month = '0' + month;\n if (day < 10) day = '0' + day;\n var dateString = date.getFullYear() + '-' + month + '-' + day;\n return dateString;\n }", "title": "" }, { "docid": "c2a0dbbdf045ca12d5a2a4cc98de11a9", "score": "0.7277209", "text": "function formatDate(date) {\n var formattedDate = date.substr(5, 2) + '/';\n formattedDate += date.substr(8, 2) + '/';\n formattedDate += date.substr(0, 4);\n return formattedDate;\n} //end formatDate", "title": "" } ]
702de60aa592cd1e38add08db3eb1560
Asks a series of questions to gather paramaters on what kind of characters should be included in the password. Loops until at least one set of characters is included. Returns a string that contains all the characters that will be used to generate a pasword.
[ { "docid": "dadc5b52a955c4ef7beed68bc57a9d7d", "score": "0.6876764", "text": "function charType() {\n var str = ''\n count = 0;\n\n while (loop=true){\n // checks if user wants to include lowercase and adds it to str if they do.\n var includeLower = confirm(\"Do you want to include lowercase characters?\")\n if(includeLower == true){\n str = str + 'abcdefghijklmnopqrstuvwxyz'\n count++\n }\n\n // checks if user wants to include uppercase and adds it to str if they do.\n var includeUpper = confirm(\"Do you want to include uppercase characters?\")\n if(includeUpper == true){\n str = str + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n count++\n }\n\n // checks if user wants to include numbers and adds it to str if they do.\n var includeNum = confirm(\"Do you want to include numeric characters?\")\n if(includeNum == true){\n str = str + '0123456789'\n count++\n }\n\n // checks if user wants to include special characters and adds it to str if they do.\n var includeSchar = confirm(\"Do you want to include special characters?\")\n if(includeSchar == true){\n str = str + ' !\"#$%&\\'()*+,-./:;<=>?@[\\]^_`{|}~'\n count++\n }\n\n // checks to make sure at least one set of characters is selected. If one or more has been selected, returns a string that contains the characters from which a password will be generated. Otherwise, it will ask the questions again.\n if (count > 0){\n loop = false;\n return str\n } else {\n alert(\"You must select at least one character set to include\")\n } \n }\n}", "title": "" } ]
[ { "docid": "d088364ba2622e8e0415f179a8232a3c", "score": "0.72033244", "text": "function generatePassword() {\n\n //Password criteria prompts\n\n //Prompt for desired length\n //Use do/while to repeat prompt if invalid desired length is entered\n do { \n var desiredLength = prompt(\"How many characters does your password need to be?\");\n \n //Validate that entry is between 8 & 128 characters\n if (parseInt(desiredLength) < 8 || parseInt(desiredLength) > 128) {\n alert (\"Password length must be between 8 and 128 characters. Please try again.\");\n }\n\n //Break out of the function early if user cancels prompt\n if (desiredLength === null) {\n return;\n }\n } while (parseInt(desiredLength) < 8 || parseInt(desiredLength) > 128);\n \n\n //Prompt for character types to include -- lowercase, uppercase, numeric, and/or special \n //Use do/while loop to repeat prompts if all are declined and user confirms they want to try again\n do {\n //Define empty array to hold selected charTypes\n var selectedChars = [];\n \n //Prompt for charTypes to include and append array with selected charTypes\n var includeLowercase = confirm (\"Do you want to include lowercase letters?\");\n if (includeLowercase === true) {\n selectedChars.push(\"lowercase\");\n }\n\n var includeUppercase = confirm (\"Do you want to include uppercase letters?\");\n if (includeUppercase === true) {\n selectedChars.push(\"uppercase\");\n }\n\n var includeNumbers = confirm (\"Do you want to include numbers?\");\n if (includeNumbers === true) {\n selectedChars.push(\"numbers\");\n }\n\n var includeSpecial = confirm (\"Do you want to include special characters?\");\n if (includeSpecial === true) {\n selectedChars.push(\"special\");\n }\n\n //If all charTypes are declined, alert that at least one must be selected\n if (includeLowercase === false && includeUppercase === false && includeNumbers === false && includeSpecial === false) {\n var tryAgain = confirm (\"At least one character type selection must be included. Do you want to try again?\");\n }\n\n //Break out of function early if user cancels confirm (doesn't want to try again)\n if (tryAgain === false) {\n return;\n }\n } while (includeLowercase === false && includeUppercase === false && includeNumbers === false && includeSpecial === false);\n \n\n //Define charTypes\n var lowercase = \"abcdefghijklmnopqrstuvwxyz\";\n var uppercase = lowercase.toUpperCase();\n var numbers = \"1234567890\";\n var special = \"!@$-\\%#(^&/*)<?_>|+~\";\n\n //Generate string of random characters from selected charTypes \n //Use do/while loop with conditions on each charType to get a random char from the corresponding string and append it to a var until that var's length == desired length\n \n //Function for randomizing which of the selected charTypes should be used for the next character in the password\n function getNextCharType() {\n let nextCharTypeIndex = Math.floor(Math.random() * selectedChars.length)\n return selectedChars[nextCharTypeIndex];\n }\n\n //Function for getting a random character from the charType definitions\n function getRandomChar(charType) {\n var randomCharIndex = Math.floor(Math.random() * charType.length); \n return charType.charAt(randomCharIndex);\n }\n \n //Define empty string variable to hold the string of characters as they're determined\n var randomPass = \"\";\n\n //Loop through each selected charType to get a character from that type until the desired length is satisfied\n do {\n //Determine next charType to pull from\n var nextCharType = getNextCharType();\n\n //Get next character by determining what the next randomized selected charType is and append character from that charType to the string\n if (nextCharType === \"lowercase\" && randomPass.length < parseInt(desiredLength)) {\n randomPass += getRandomChar(lowercase);\n }\n if (nextCharType === \"uppercase\" && randomPass.length < parseInt(desiredLength)) {\n randomPass += getRandomChar(uppercase);\n }\n if (nextCharType === \"numbers\" && randomPass.length < parseInt(desiredLength)) {\n randomPass += getRandomChar(numbers);\n }\n if (nextCharType === \"special\" && randomPass.length < parseInt(desiredLength)) {\n randomPass += getRandomChar(special);\n }\n\n //Version of character getter that ensures at least one character from each selectedType gets included \n //Use without nextCharType and getNextCharType\n // if (includeLowercase === true && randomPass.length < parseInt(desiredLength)) {\n // randomPass += getRandomChar(lowercase);\n // }\n // if (includeUppercase === true && randomPass.length < parseInt(desiredLength)) {\n // randomPass += getRandomChar(uppercase);\n // }\n // if (includeNumbers === true && randomPass.length < parseInt(desiredLength)) {\n // randomPass += getRandomChar(numbers);\n // }\n // if (includeSpecial === true && randomPass.length < parseInt(desiredLength)) {\n // randomPass += getRandomChar(special);\n // }\n }\n while (randomPass.length < parseInt(desiredLength)); \n\n //Return the string\n return randomPass;\n}", "title": "" }, { "docid": "094dcdae5abee5d52bc1183a09a0845f", "score": "0.71964324", "text": "function generateRandomPassword() {\n let randomSet = []; // Array for a bunch of random, possible characters, that will then go on to be randomly chosen from for the final password\n let ensureSet = []; // Array for ensuring that at least one of each selected char-set will be included in the final password\n let passwordString = []; // Array for the final, randomly generated password. \n\n // AND the variables for the contents of each possible character set. \n var upperRange = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var lowerRange = \"abcdefghijklmnopqrstuvwxyz\";\n var specialRange = \"!@#$%^&*()_+~`-=:;',.<>?/{}[]\";\n var numberRange = \"1234567890\";\n\n // doing truth checks to make sure the character sets are only included if the user selected them, then running the functions to include them if they pass.\n truthCheck(upperCase, upperRange);\n truthCheck(lowerCase, lowerRange);\n truthCheck(specialCase, specialRange);\n truthCheck(numbers, numberRange);\n\n // Truth-check function for the character selection.\n function truthCheck(x, y) {\n if (x) {\n randomSelector(y); // details below::\n charsetEnsure(y); // details below::\n };\n };\n // this is the function that provides a bunch of random characters to chose from, and sends them into the randomSet array, to later be chosen from randomly agin.\n // There are different methods that could be used in place of the for-loop, specifically the middle parameter. \n // I chose i < 100 so that it would really fill up the randomSet array with options to choose from, to ensure a thoroughly random password, \n // without running too many iterations and causing the function to run really slow. \n function randomSelector(x) {\n for (let i = 0; i < 100; i++) {\n xChar = x.charAt(Math.floor(Math.random() * x.length));\n randomSet.push(xChar);\n };\n };\n // This function is what ensures that if a char-set passes its truth check, at least one of that sets characters will show up in the generated password. \n function charsetEnsure(x) {\n xChar = x.charAt(Math.floor(Math.random() * x.length));\n ensureSet.push(xChar);\n };\n //then::\n //push the ensured chars to the passwordString, while joining them together so that they don't print with commas later.\n passwordString.push(ensureSet.join(''));\n\n // this loop picks random characters form the randomSet array that was filled earlier by the previous loop (randomSelector())\n // it uses (passwordLength - ensureSet.length) to ensure the generated password is the same length as specified by the user\n // (you must subtract ensureSet, because those characters will be added by force, and do not account for what the user specified the length to be)\n for (let i = 0; i < (passwordLength - ensureSet.length); i++) {\n var charPicked = randomSet[Math.floor(Math.random() * randomSet.length)];\n passwordString.push(charPicked);\n };\n\n // finally, log the result to the console, as well as return the result\n // so that the main function can access the randomly generated password. \n console.log(passwordString); //console check\n return passwordString.join('').toString();\n}", "title": "" }, { "docid": "e5ea0099a3b78bbceb8a63dd050c57a7", "score": "0.7193865", "text": "function generatePassword() {\n\n //When prompted for the length of the password \n\n do {\n var length = parseInt(prompt(\"How many characters would you like your password to contain?\"));\n\n // THEN the user will be able to choose a length of at least 8 characters and no more than 128 characters\n //Need to check the user input to make sure it is between 8 and 128\n //otherwise, user receives a prompt to enter correct input. \n if (length < 8 || length > 128 || isNaN(length)) {\n alert(\"Length must be between 8-128 characters\")\n }\n } while (length < 8 || length > 128 || isNaN(length))\n\n\n // when presented with a series of prompts for password criteria\n // user answer each prompt\n\n do {\n var gotLower = confirm(\"Click Ok to confirm including lowercase characters.\")\n var gotUpper = confirm(\"Click Ok to confirm including uppercase characters.\")\n var gotSpecial = confirm(\"Click Ok to confirm including special characters.\")\n var gotNumber = confirm(\"Click Ok to confirm including numeric characters.\")\n\n if (gotLower === false && gotUpper === false && gotSpecial === false && gotNumber === false) {\n alert(\"You must select at least one character type!\");\n }\n // THEN user input is validated as at least one character type should be selected\n // Else an error is prompted to atleast give us one characters to choose from\n } while (gotLower === false && gotUpper === false && gotSpecial === false && gotNumber === false)\n\n var actualPassword = []\n var randomPassword = \"\"\n\n if (gotLower) {\n actualPassword = actualPassword.concat(lowercase)\n randomPassword = randomPassword + lowercase[Math.floor(Math.random() * lowercase.length)];\n }\n if (gotUpper) {\n actualPassword = actualPassword.concat(uppercase)\n randomPassword = randomPassword + uppercase[Math.floor(Math.random() * uppercase.length)];\n }\n if (gotSpecial) {\n actualPassword = actualPassword.concat(specialChar)\n randomPassword = randomPassword + specialChar[Math.floor(Math.random() * specialChar.length)];\n }\n if (gotNumber) {\n actualPassword = actualPassword.concat(numeric)\n randomPassword = randomPassword + numeric[Math.floor(Math.random() * numeric.length)];\n }\n\n //form all charc shows chosen by the user , choose one randomly and add it to our password x number of times\n\n var currentlength = randomPassword.length;\n console.log(currentlength)\n\n for (var i = 0; i < length - (currentlength); i++) {\n randomPassword = randomPassword + actualPassword[Math.floor(Math.random() * actualPassword.length)];\n console.log(randomPassword)\n }\n // THEN a password is generated that matches the selected criteria\n return randomPassword;\n\n}", "title": "" }, { "docid": "3065acaad18a70526aebc5d1d41752ff", "score": "0.7172278", "text": "function generatePassword() {\n\n // ask for password length\n passLength = window.prompt(\"How many characters would you like your password to have? Please enter a number between 8 and 128\")\n \n // confirm valid password length\n while(passLength < 8 || passLength > 128) {\n passLength = window.prompt(\"Please enter a number between 8 and 128 for the number of characters in your password. Try again!\");\n }\n \n // ask for character types to include\n var confirmLower = window.confirm(\"Would you like lowercase letters in your password?\");\n var confirmUpper = window.confirm(\"Would you like uppercase letters in your password?\");\n var confirmSpecial = window.confirm(\"Would you like special characters in your password?\");\n var confirmNum = window.confirm(\"Would you like numbers in your password?\");\n\n // confirm at least one character type selected\n while(confirmLower === false && confirmUpper === false && confirmSpecial === false && confirmNum === false) {\n window.alert(\"Please select at least 1 character type!\");\n confirmLower = window.confirm(\"Would you like lowercase letters in your password?\");\n confirmUpper = window.confirm(\"Would you like uppercase letters in your password?\");\n confirmSpecial = window.confirm(\"Would you like special characters in your password?\");\n confirmNum = window.confirm(\"Would you like numbers in your password?\");\n }\n\n // put all desired character types into 1 array\n if (confirmLower) {\n chars = chars.concat(lower);\n }\n if (confirmUpper) {\n chars = chars.concat(upper);\n }\n if (confirmSpecial) {\n chars = chars.concat(special);\n }\n if (confirmNum) {\n chars = chars.concat(num);\n }\n\n // add characters to password until desired length reached\n while(buildPass.length < passLength) {\n buildPass = buildPass + chars[Math.floor(Math.random()*chars.length)];\n } \n \n // function to check for desired characters\n function containsChar(password, characters) {\n var contains = false;\n     for (var i = 0; i < password.length; i++) {\n        var character = password.charAt(i);\n        if (characters.includes(character)){\n          contains = true;\n break;\n        }\n     }\n return contains;\n   }\n\n // function to replace random char in string\n  function replace(string, index, replacement) {\n    return string.substr(0, index) + replacement + string.substr(index + replacement.length);\n  }\n\n // check & replace for lowercase letters\n if(confirmLower) {\n if(containsChar(buildPass,lower) === false) {\n buildPass = replace(buildPass, Math.floor(Math.random()*buildPass.length), lower[Math.floor(Math.random()*lower.length)]);\n }\n }\n\n // check & replace for uppercase letters\n if(confirmUpper) {\n if(containsChar(buildPass,upper) === false) {\n buildPass = replace(buildPass, Math.floor(Math.random()*buildPass.length), upper[Math.floor(Math.random()*upper.length)]);\n }\n }\n\n // check & replace for special characters\n if(confirmSpecial) {\n if(containsChar(buildPass,special) === false) {\n buildPass = replace(buildPass, Math.floor(Math.random()*buildPass.length), special[Math.floor(Math.random()*special.length)]);\n }\n }\n\n // check & replace for numeric characters\n if(confirmNum) {\n if(containsChar(buildPass,num) === false) {\n buildPass = replace(buildPass, Math.floor(Math.random()*buildPass.length), num[Math.floor(Math.random()*num.length)]);\n }\n }\n return buildPass;\n}", "title": "" }, { "docid": "720597567004629b6d01246cc7b0eae6", "score": "0.71667", "text": "function generatePassword(){\n var lengthAsk = window.prompt(\"Between 8-128 characters, how many characters should this password contain?\"); \n// while-everything is true besides whats in parathesis. || = \"or\"\n while (lengthAsk < 8 || lengthAsk> 128){ \nalert(\"Password must be between 8-128 characters\");\n// re enter correct character if character requirement not met.\nvar lengthAsk = window.prompt(\"Between 8-128 characters, how many characters should this password contain? \"); \n }\n // parameters of the password\n var includeSpecialChar = window.confirm(\"Do you want to include special characters in the password?\");\n var includeLowerCase = window.confirm(\"Do you want to include lower case characters in the password?\");\n var includeUpperCase = window.confirm(\"Do you want to include upper case characters in the password?\");\n var includeNumbers = window.confirm(\"Do you want to include numbers in the password?\");\n // If everything is false the while loop will run causing the confirms to re ask.\n while(includeSpecialChar===false\n &&includeLowerCase===false\n &&includeUpperCase===false\n &&includeNumbers===false){\n alert(\"Choose at least 1 parameter\");\n var includeSpecialChar = window.confirm(\"Do you want to include special characters in the password?\");\n var includeLowerCase = window.confirm(\"Do you want to include lower case characters in the password?\");\n var includeUpperCase = window.confirm(\"Do you want to include upper case characters in the password?\");\n var includeNumbers = window.confirm(\"Do you want to include numbers in the password?\");\n }\nvar passwordCombination =[]\nif(includeSpecialChar){\n passwordCombination = passwordCombination + specialChar\n}\nif(includeLowerCase){\n passwordCombination = passwordCombination + lowerCase\n}\nif(includeUpperCase){\n passwordCombination = passwordCombination + upperCase\n}\nif(includeNumbers){\n passwordCombination = passwordCombination + numberChar\n}\nconsole.log (passwordCombination);\nvar randPass = \"\";\nfor(i=0; i<lengthAsk; i++){\n randPass = randPass + passwordCombination[Math.floor(Math.random() * passwordCombination.length)];\n console.log(randPass);\n};\nreturn randPass;\n}", "title": "" }, { "docid": "19042faf5a93886dc470c1260c9d5bdc", "score": "0.71408427", "text": "function generatePassword() {\n var length = window.prompt(\"How many characters do you want your password to have?\");\n console.log(length);\n var questions = [\n {\n question: 'Would you like your password to use numbers?'\n },\n {\n question: 'Would you like your password to use lowercase letters?'\n },\n {\n question: 'Would you like your password to use uppercase letters?'\n },\n {\n question: 'Would you like your password to use special characters?'\n },\n ];\n if (length < 8 || length > 128 || isNaN(length)) {\n window.alert(\"Your password needs to have between 8 and 128 characters\");\n console.log(\"Please try again!\")\n } else {\n var numbers = confirm(questions[0].question);\n if (numbers === false) {\n console.log('No Numbers');\n } else {\n console.log('Numbers');\n }\n var lowercase = confirm(questions[1].question);\n if (lowercase === false) {\n console.log('No Lowercase');\n } else {\n console.log('Lowercase');\n }\n var uppercase = confirm(questions[2].question);\n if (uppercase === false) {\n console.log('No Uppercase');\n } else {\n console.log('Uppercase');\n }\n var special = confirm(questions[3].question);\n if (special === false) {\n console.log('No Special Characters');\n } else {\n console.log('Special Characters');\n }\n var characterSets = [\n {value: numbers, char: \"0123456789\"},\n {value: lowercase, char: \"abcdefghijklmnopqrstuvwxyz\"},\n {value: uppercase, char: \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"},\n {value: special, char: \"!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\"},\n ];\n if (numbers === false && lowercase === false && uppercase === false && special === false) {\n alert('You need to select at least one character type!');\n console.log(\"Please try again!\");\n } else {\n var charset = \"\";\n for (var i = 0; i < characterSets.length; i++) {\n if (characterSets[i].value === true) {\n charset += characterSets[i].char;\n }\n }\n var passGen = \"\";\n for (var i = 0, n = charset.length; i < length; ++i) {\n passGen += charset.charAt(Math.floor(Math.random() * n));\n } \n return passGen;\n } \n }\n}", "title": "" }, { "docid": "33d5a4d1e8281135c4f056ba5a69e818", "score": "0.71400374", "text": "function userPrompts() {\n possibleChars = [];\n password = \"\";\n alert(\n `The next few prompts will gather your requirements for your password.\nThe \"OK\" button will select yes and the \"Cancel\" button will select no.`\n );\n // this stores the users input for the length of the password they want\n passLength = +prompt(\n \"Please enter a length between 8 and 128 characters that you would like your password to be.\"\n );\n // this checks passLength value to see if it is between 8 and 128 and the function will be called again if it isnt\n if (passLength >= 8 && passLength <= 128) {\n // this checkes to see if they want uppercase in the password and returns a true or false value\n includeLower = confirm(\n `Would you like to include lowercase letters? \nClick \"OK\" for yes or \"Cancel\" for no`\n );\n // this checkes to see if they want uppercase in the password and returns a true or false value\n includeUpper = confirm(\n `Would you like to include uppercase letters? \nClick \"OK\" for yes or \"Cancel\" for no`\n );\n // this checkes to see if they want special characters in the password and returns a true or false value\n includeSpecial = confirm(\n `Would you like to include special characters? \nClick \"OK\" for yes or \"Cancel\" for no`\n );\n // this checkes to see if they want numeric characters in the password and returns a true or false value\n includeNumeric = confirm(\n `Would you like to include numbers? \nClick \"OK\" for yes or \"Cancel\" for no`\n );\n if (\n !includeLower &&\n !includeUpper &&\n !includeSpecial &&\n !includeNumeric\n ) {\n alert(\n \" Please select at least one character set. The generator will now start over.\"\n );\n userPrompts();\n }\n } else {\n // this will show if the user input a incorrect value\n alert(\n \" That was not a valid input! The generator will now start over.\"\n );\n // this restarts the function after an invalid input\n userPrompts();\n }\n // this adds the special characters to the array if the user selected the yes option\n if (includeSpecial) {\n passLength--;\n // this guarantees at least one special character will be in password if selected\n password += specialChar[Math.floor(Math.random() * specialChar.length)];\n possibleChars = possibleChars.concat(specialChar);\n }\n // this adds the lowercase characters to the array if the user selected the yes option\n if (includeLower) {\n passLength--;\n // this guarantees at least one lowercase will be in password if selected\n password +=\n alphabeticalLowerChar[\n Math.floor(Math.random() * alphabeticalLowerChar.length)\n ];\n possibleChars = possibleChars.concat(alphabeticalLowerChar);\n }\n // this adds the uppercasecharacters to the array if the user selected the yes option\n if (includeUpper) {\n passLength--;\n // this guarantees at least one uppercase will be in password if selected\n password +=\n alphabeticalUpperChar[\n Math.floor(Math.random() * alphabeticalUpperChar.length)\n ];\n possibleChars = possibleChars.concat(alphabeticalUpperChar);\n }\n // this adds the uppercasecharacters to the array if the user selected the yes option\n if (includeNumeric) {\n passLength--;\n // this guarantees at least one numeric will be in password if selected\n password += numeric[Math.floor(Math.random() * numeric.length)];\n possibleChars = possibleChars.concat(numeric);\n }\n // this calls the writePassword function to display to the password id box\n writePassword();\n}", "title": "" }, { "docid": "a7f63e612c8e08f71533c2354cd75934", "score": "0.71202505", "text": "function getCharacters() {\n for (let i = 0; i < (chars); i++) {\n var placeChar = \"\";\n if (uppercase == true) {\n placeChar = upperString.charAt(Math.floor(Math.random() * upperString.length));\n finalPassword.push(placeChar);\n }\n if (lowercase == true) {\n placeChar = lowerString.charAt(Math.floor(Math.random() * lowerString.length));\n finalPassword.push(placeChar);\n }\n if (numbers == true) {\n placeChar = numberString.charAt(Math.floor(Math.random() * numberString.length));\n finalPassword.push(placeChar);\n }\n if (specialChar == true) {\n placeChar = specialString.charAt(Math.floor(Math.random() * specialString.length));\n finalPassword.push(placeChar);\n }\n i++;\n } \n } //Make the password same length as user desired", "title": "" }, { "docid": "3ca9aaf8f5fb1f7aa509e28db66eafe5", "score": "0.7109609", "text": "function generatePassword() {\n\n//Declare one array for each type of character set\n\n//Array of numbers\nvar numArray = [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"];\n\n//Array of lower case letters\nvar lowCaseCharArray = [\"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\n//Array of uppercase letters\nvar upCaseCharArray = [\"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\n//Array of special characters, space, double quotation and backslash removed from OWASP list\nvar specCharArray = ['!','#','$','%','&',\"'\",'(',')','*','+',',','-','.','/',':',';','<','=','>','?','@','[',']','^','_','`','{','|','}','~'];\n\n//Prompts to inquire to user about four types of possible characters\n\n//Alert user to program options\nalert(\"You will be given the chance to select from four types of characters to include in your password. Lower and Upper case letters, Numbers and Symbols. You must select at least one character set.\");\n\n//First prompt lowercase letters\nvar lowCaseChoice = getUserChoice(\"lower case letters\");\n\n//use the check function to make sure the user has input Y or N\nlowCaseChoice = checkUserChoice(lowCaseChoice, \"lower case letters\")\n\n//Add lower case characters if selected\naddCharToArray(lowCaseChoice, lowCaseCharArray, \"lower case letters\");\n\n//Second prompt is for uppercase letters\nvar upCaseChoice = getUserChoice(\"upper case letters\");\n\n//use the check function to make sure the user has input Y or N\nupCaseChoice = checkUserChoice(upCaseChoice, \"upper case letters\")\n\n//add upper case letters to seclection array\naddCharToArray(upCaseChoice, upCaseCharArray, \"upper case letters\");\n \n//Third prompt is for numeric characters\nvar numCaseChoice = getUserChoice(\"numeric characters\");\n\n//use the check function to make sure the user has input Y or N\nnumCaseChoice = checkUserChoice(numCaseChoice, \"numeric characters\")\n\n//Numeric characters added to selection Array\naddCharToArray(numCaseChoice, numArray, \"numeric characters\");\n\n//Fourth prompt is for special characters\nvar specCharChoice = getUserChoice(\"special characters\");\n\n//use the check function to make sure the user has input Y or N\nspecCharChoice = checkUserChoice(specCharChoice, \"special characters\")\n\n//Special characters added to selection array\naddCharToArray(specCharChoice, specCharArray, \"special characters\");\n\n//If the user did not select any character sets the program will end and give an alert\nif (passCharSelectionArray.length <1) {\n alert(\"You did not select any character sets, no password generation possible. Start again and select at least one character set.\");\n return (\" \");\n}\n\n//Initialize password as a number lower than the required length to start the user input loop for length\nvar passwordLength = 0;\n//Ask for password length in a loop to check length and input type\nwhile (isNaN (passwordLength) || (passwordLength <8 || passwordLength > 128)) {\n passwordLength = prompt('Please select a password length between 8 and 128 characters: ');\n passwordLength = parseInt(passwordLength);\n }\n\n//Make a passwordArray by running a random selector over the password character selection array\n//in a loop of the password length\nvar passwordArray = [];\nvar i = 0;\nwhile (i<passwordLength) {\n var randomChar = passCharSelectionArray[Math.floor(Math.random()*passCharSelectionArray.length)];\n passwordArray.push(randomChar);\n i++;\n}\n\n//Then this password needs to get returned to the function call in the form of a \n//string. This requires a conversion from array to string\nvar passwordString = passwordArray.join(\"\");\n\n//return the password\nreturn passwordString;\n}", "title": "" }, { "docid": "b73dbeb6bb80e002dcaa86dbd17d8a5b", "score": "0.710034", "text": "function generatePassword() {\n\n // Create variables that will hold the arrays of the possible inputs for\n // the different values within the password\n var lowerAlphas = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',\n 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',\n 'w', 'x', 'y', 'z'];\n var upperAlphas = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',\n 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',\n 'W', 'X', 'Y', 'Z'];\n var specialChars = ['!', '\"', '#', '$', '%', '&', \"'\", '(', ')', '*', '+',\n ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@',\n '[', ']', '^', '_', '`', '{', '}', '|'];\n var allNumbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n // Create variables that will be used to hold the information from\n // the questions that will be asked\n var lowerQuestion = false;\n var upperQuestion = false;\n var numberQuestion = false;\n var specialQuestion = false;\n var passwordLength = 0;\n\n // Create variables that will be used to \"count\" within if else statements\n // to confirm that the certain necessary criteria will be met\n var lowerAlphasCounter = 0;\n var upperAlphasCounter = 0;\n var numbersCounter = 0;\n var specialCounter = 0;\n var k = 0;\n\n // Initialize asking the questions with prompts and confirms and store the answers in variables,\n // convert passwordLength to a number\n for (var i = 0; i < 1; i++) {\n lowerQuestion = confirm('Would you like lowercase letters? Okay for yes, cancel for no.');\n upperQuestion = confirm('Would you like uppercase letters? Okay for yes, cancel for no.');\n numberQuestion = confirm('Would you like numbers? Okay for yes, cancel for no.');\n specialQuestion = confirm('Would you like special characters? Okay for yes, cancel for no.');\n passwordLength = prompt('How long would you like your password? (8+ characters)');\n passwordLength = Number(passwordLength);\n\n // Test the validity of the answers (correct password length and at least one question must be true)\n if ((passwordLength < 8 || passwordLength > 128) && (lowerQuestion == false && upperQuestion == false && numberQuestion == false && specialQuestion == false)) {\n alert('Your password must be at least 8 to 128 characters AND you must select at least one password requirement.');\n lowerQuestion = false;\n upperQuestion = false;\n numberQuestion = false;\n specialQuestion = false;\n passwordLength = 0;\n writePassword();\n }\n\n // Test the validity of the answers (correct password length and at least one question must be true)\n if ((passwordLength < 8 || passwordLength > 128) && (lowerQuestion == true || upperQuestion == true || numberQuestion == true || specialQuestion == true)) {\n alert('You must enter a password length between 8 and 128!');\n lowerQuestion = false;\n upperQuestion = false;\n numberQuestion = false;\n specialQuestion = false;\n passwordLength = 0;\n generatePassword();\n }\n\n // Test the validity of the answers (correct password length and at least one question must be true)\n if ((passwordLength >= 8 && passwordLength <= 128) && (lowerQuestion == false && upperQuestion == false && numberQuestion == false && specialQuestion == false)) {\n alert('You must select at least one of the password requirements!');\n lowerQuestion = false;\n upperQuestion = false;\n numberQuestion = false;\n specialQuestion = false;\n passwordLength = 0;\n writePassword();\n }\n\n // Test to see if passwordLength is a number, this prevents people from entering words/special characters\n // into the passwordLength variable that would break the code\n if (isNaN(passwordLength)) {\n alert('Password length must be a number!')\n lowerQuestion = false;\n upperQuestion = false;\n numberQuestion = false;\n specialQuestion = false;\n passwordLength = 0;\n writePassword();\n }\n\n // Test to ensure that the user information entered is valid\n if ((passwordLength >= 8 && passwordLength <= 128) && (lowerQuestion == true || upperQuestion == true || numberQuestion == true || specialQuestion == true)) {\n \n // If all the entered parameters are viable start inputting information into a string that will hold the password\n // depending on which variables the user wanted\n if (lowerQuestion == true && upperQuestion == true && numberQuestion == true && specialQuestion == true) {\n\n // Create a loop that will run according to how long the user input for the password length is\n for (var j = 0; j < passwordLength; j++){\n\n // Create a variable that holds a random number that will be used to randomize which array containing\n // password information will be accessed to give either an uppercase letter, lowercase letter, number\n // or a special character\n var num = Math.floor(Math.random() * 4);\n if (num == 0) {\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n lowerAlphasCounter++;\n k++;\n }\n if (num == 1) {\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n upperAlphasCounter++\n k++;\n }\n if (num == 2) {\n var numberNum = 0;\n numberNum = Math.floor(Math.random() * 10);\n passwordComplete += allNumbers[numberNum];\n numbersCounter++;\n k++;\n }\n if (num == 3) {\n var specialNum = 0;\n specialNum = Math.floor(Math.random() * 30);\n passwordComplete += specialChars[specialNum];\n specialCounter++;\n k++;\n }\n\n // Through the above if statements you use a variable count to see if the program accesses the information within,\n // after it goes through the entire for loop, then it will check to make sure the different counters reached at least\n // 1, and if they didn't, it will reset all the variables and redo the for loop. This ensures that there is at least\n // one of each character in the password\n if ((k == passwordLength) && (lowerAlphasCounter < 1 || upperAlphasCounter < 1 || numbersCounter < 1 || specialCounter < 1)) {\n j = -1;\n k = 0;\n lowerAlphasCounter = 0;\n upperAlphasCounter = 0;\n numbersCounter = 0;\n specialCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == true && upperQuestion == true && numberQuestion == true && specialQuestion == false) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 3);\n if (num == 0) {\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n lowerAlphasCounter++;\n k++;\n }\n if (num == 1) {\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n upperAlphasCounter++\n k++;\n }\n if (num == 2) {\n var numberNum = 0;\n numberNum = Math.floor(Math.random() * 10);\n passwordComplete += allNumbers[numberNum];\n numbersCounter++;\n k++;\n }\n if ((k == passwordLength) && (lowerAlphasCounter < 1 || upperAlphasCounter < 1 || numbersCounter < 1 )) {\n j = -1;\n k = 0;\n lowerAlphasCounter = 0;\n upperAlphasCounter = 0;\n numbersCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == true && upperQuestion == true && numberQuestion == false && specialQuestion == false) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 2);\n if (num == 0) {\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n lowerAlphasCounter++;\n k++;\n }\n if (num == 1) {\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n upperAlphasCounter++\n k++;\n }\n if ((k == passwordLength) && (lowerAlphasCounter < 1 || upperAlphasCounter < 1)) {\n j = -1;\n k = 0;\n lowerAlphasCounter = 0;\n upperAlphasCounter = 0;\n numbersCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == true && upperQuestion == false && numberQuestion == true && specialQuestion == false) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 2);\n if (num == 0) {\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n lowerAlphasCounter++;\n k++;\n }\n if (num == 1) {\n var numberNum = 0;\n numberNum = Math.floor(Math.random() * 10);\n passwordComplete += allNumbers[numberNum];\n numbersCounter++;\n k++;\n }\n if ((k == passwordLength) && (lowerAlphasCounter < 1 || numbersCounter < 1)) {\n j = -1;\n k = 0;\n lowerAlphasCounter = 0;\n numbersCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == true && upperQuestion == false && numberQuestion == false && specialQuestion == false) {\n for (var j = 0; j < passwordLength; j++){\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n }\n }\n if (lowerQuestion == true && upperQuestion == true && numberQuestion == false && specialQuestion == true) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 3);\n if (num == 0) {\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n lowerAlphasCounter++;\n k++;\n }\n if (num == 1) {\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n upperAlphasCounter++\n k++;\n }\n if (num == 2) {\n var specialNum = 0;\n specialNum = Math.floor(Math.random() * 30);\n passwordComplete += specialChars[specialNum];\n specialCounter++;\n k++;\n }\n if ((k == passwordLength) && (lowerAlphasCounter < 1 || upperAlphasCounter < 1 || specialCounter < 1)) {\n j = -1;\n k = 0;\n lowerAlphasCounter = 0;\n upperAlphasCounter = 0;\n specialCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == true && upperQuestion == false && numberQuestion == false && specialQuestion == true) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 2);\n if (num == 0) {\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n lowerAlphasCounter++;\n k++;\n }\n if (num == 1) {\n var specialNum = 0;\n specialNum = Math.floor(Math.random() * 30);\n passwordComplete += specialChars[specialNum];\n specialCounter++;\n k++;\n }\n if ((k == passwordLength) && (lowerAlphasCounter < 1 || specialCounter < 1)) {\n j = -1;\n k = 0;\n lowerAlphasCounter = 0;\n specialCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == true && upperQuestion == false && numberQuestion == true && specialQuestion == true) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 3);\n if (num == 0) {\n var lowerNum = 0;\n lowerNum = Math.floor(Math.random() * 26);\n passwordComplete += lowerAlphas[lowerNum];\n lowerAlphasCounter++;\n k++;\n }\n if (num == 1) {\n var numberNum = 0;\n numberNum = Math.floor(Math.random() * 10);\n passwordComplete += allNumbers[numberNum];\n numbersCounter++;\n k++;\n }\n if (num == 2) {\n var specialNum = 0;\n specialNum = Math.floor(Math.random() * 30);\n passwordComplete += specialChars[specialNum];\n specialCounter++;\n k++;\n }\n if ((k == passwordLength) && (lowerAlphasCounter < 1 || numbersCounter < 1 || specialCounter < 1)) {\n j = -1;\n k = 0;\n lowerAlphasCounter = 0;\n numbersCounter = 0;\n specialCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == false && upperQuestion == true && numberQuestion == true && specialQuestion == true) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 3);\n if (num == 0) {\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n upperAlphasCounter++\n k++;\n }\n if (num == 1) {\n var numberNum = 0;\n numberNum = Math.floor(Math.random() * 10);\n passwordComplete += allNumbers[numberNum];\n numbersCounter++;\n k++;\n }\n if (num == 2) {\n var specialNum = 0;\n specialNum = Math.floor(Math.random() * 30);\n passwordComplete += specialChars[specialNum];\n specialCounter++;\n k++;\n }\n if ((k == passwordLength) && (upperAlphasCounter < 1 || numbersCounter < 1 || specialCounter < 1)) {\n j = -1;\n k = 0;\n upperAlphasCounter = 0;\n numbersCounter = 0;\n specialCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == false && upperQuestion == true && numberQuestion == false && specialQuestion == true) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 2);\n if (num == 0) {\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n upperAlphasCounter++\n k++;\n }\n if (num == 1) {\n var specialNum = 0;\n specialNum = Math.floor(Math.random() * 30);\n passwordComplete += specialChars[specialNum];\n specialCounter++;\n k++;\n }\n if ((k == passwordLength) && (upperAlphasCounter < 1 || specialCounter < 1)) {\n j = -1;\n k = 0;\n upperAlphasCounter = 0;\n specialCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == false && upperQuestion == true && numberQuestion == false && specialQuestion == false) {\n for (var j = 0; j < passwordLength; j++){\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n }\n }\n if (lowerQuestion == false && upperQuestion == true && numberQuestion == true && specialQuestion == false) {\n for (var j = 0; j < passwordLength; j++){\n var num = Math.floor(Math.random() * 2);\n if (num == 0) {\n var upperNum = 0;\n upperNum = Math.floor(Math.random() * 26);\n passwordComplete += upperAlphas[upperNum];\n upperAlphasCounter++\n k++;\n }\n if (num == 1) {\n var numberNum = 0;\n numberNum = Math.floor(Math.random() * 10);\n passwordComplete += allNumbers[numberNum];\n numbersCounter++;\n k++;\n }\n if ((k == passwordLength) && (upperAlphasCounter < 1 || numbersCounter < 1)) {\n j = -1;\n k = 0;\n upperAlphasCounter = 0;\n numbersCounter = 0;\n passwordComplete = \"\";\n }\n }\n }\n if (lowerQuestion == false && upperQuestion == false && numberQuestion == true && specialQuestion == false) {\n for (var j = 0; j < passwordLength; j++) {\n var numberNum = 0;\n numberNum = Math.floor(Math.random() * 10);\n passwordComplete += allNumbers[numberNum];\n }\n }\n if (lowerQuestion == false && upperQuestion == false && numberQuestion == false && specialQuestion == true) {\n for (var j = 0; j < passwordLength; j++) {\n var specialNum = 0;\n specialNum = Math.floor(Math.random() * 30);\n passwordComplete += specialChars[specialNum];\n }\n }\n }\n }\n\n // return the passwordComplete variable so it can be passed to the writePassword() function\n return passwordComplete;\n}", "title": "" }, { "docid": "093431e4c68566557c8b58a471f7d281", "score": "0.7090312", "text": "function generatePassword() {\n var workingPass = [];\n var possibleCharacters = [];\n\n var passLength = prompt(\"Enter a password length between 8 and 128\");\n if ((passLength > 128) || (passLength < 8)) {\n alert(\"Sorry, password length invalid. Please try again.\")\n return;\n }\n\n var upperCase = confirm(\"Allow uppercase characters?\");\n var lowerCase = confirm(\"Allow lowercase characters?\");\n var numbers = confirm(\"Allow numbers?\");\n var special = confirm(\"Allow special characters?\");\n\n // Then confirming which character types are desired for the password\n // Then making if statments to concat relevant list arrays into the working \"possibleCharacter\" array\n if (upperCase === true) {\n possibleCharacters = possibleCharacters.concat(listUpper);\n\n }\n if (lowerCase === true) {\n possibleCharacters = possibleCharacters.concat(listLower);\n \n }\n if (numbers === true) {\n possibleCharacters = possibleCharacters.concat(listNumbers);\n }\n if (special === true) {\n possibleCharacters = possibleCharacters.concat(listSpecial);\n \n }\n // Then running a for loop, setting i to zero and incrementing by 1 until i = passLength\n for (var i = 0; i < passLength; i++) {\n //once at each loop, randomly selecting a character from all of possibleCharacters and concatenating it to workingPass\n workingPass = workingPass.concat(possibleCharacters[Math.floor(Math.random() * possibleCharacters.length)]);\n\n }\n // finally joining the new randomly assembled string in workingPass \n return workingPass.join(\"\")\n\n\n}", "title": "" }, { "docid": "7fccdf73e6c55a44d0bcbea445d06684", "score": "0.7063027", "text": "function generatePassword() {\n var passwordLength = prompt(\"How many characters do you want your password to have?\");\n if (passwordLength <= 7 || passwordLength >= 129) {\n alert(\"Your password should have between 8-128 characters. Please try again.\");\n var passwordLength = prompt(\"How many characters do you want your password to have?\");\n } else {\n alert(\"Great! Just a few more questions before we generate your secure password.\");\n }\n\n// User selects which character type to include in their password\n\n var passwordLowerCase = confirm(\"Do you want to have lowercase letters in your password?\");\n if (passwordLowerCase === true) {\n alert(\"Yay, you have selected that you want lowercase letters.\");\n }\n var passwordUpperCase = confirm(\"Do you want to have uppercase letters in your password?\");\n if (passwordUpperCase === true) {\n alert(\"Yay, you have selected that you want uppercase letters.\");\n }\n var passwordNumber = confirm(\"Do you want to include numbers in your password?\");\n if (passwordNumber === true) {\n alert(\"Yay, you have selected that you want numbers.\")\n }\n var passwordChar = confirm(\"Do you want to include special characters in your password?\");\n if (passwordChar === true) {\n alert(\"Yay, you have selected that you want special characters.\") \n }\n else if (passwordLowerCase === false && passwordUpperCase === false && passwordNumber === false && passwordChar === false) {\n alert(\"You must choose at least one criteria.\");\n var passwordLowerCase = confirm(\"Do you want to have lowercase letters in your password?\");\n var passwordUpperCase = confirm(\"Do you want to have uppercase letters in your password?\");\n var passwordNumber = confirm(\"Do you want to include numbers in your password?\");\n var passwordChar = confirm(\"Do you want to include special characters in your password?\");\n } \n \n// Add parameters to an array\n\nvar generatePass = [];\nvar guaranteedChar = [];\n\nconsole.log(generatePass);\n\nif (passwordLowerCase === true) {\n guaranteedChar.push(\"a\");\n\n for(let i =0; i < letterLower.length; i++){\n generatePass.push(letterLower[i]);\n }\n passwordLength --\n}\n\nif (passwordUpperCase === true) {\n guaranteedChar.push(\"K\");\n \n for(let i =0; i < letterUpper.length; i++){\n generatePass.push(letterUpper[i]);\n }\n passwordLength --\n}\n\nif (passwordNumber === true) {\n guaranteedChar.push(\"4\"); \n\n for(let i =0; i < number.length; i++){\n generatePass.push(number[i]);\n }\n passwordLength --\n}\n\nif (passwordChar === true) {\n guaranteedChar.push(\"!\");\n \n for(let i =0; i < specialChar.length; i++){\n generatePass.push(specialChar[i]);\n }\n passwordLength --\n}\n\n// Compute random password \n var fPassword = [];\n\n for (let i = 0; i < passwordLength; i++) {\n fPassword.push(generatePass[(Math.floor(Math.random() * generatePass.length))]);\n }\n\nvar x = fPassword.concat(guaranteedChar);\n\n\nreturn x;\n\n}", "title": "" }, { "docid": "b715db376542bf15508f3019e7bac3e5", "score": "0.7061842", "text": "function generatePassword() {\n\n var length = prompt(\"How many characters would you like for your password to contain?\");\n\n // Verify password length\n while (length <= 8 || length >= 128) {\n alert(\"Password length must be between 8 and 128 characters\");\n var length = (prompt(\"How many characters would you like your password to contain?\"));\n }\n // Promt user for character types\n var confirmSpecial = confirm(\"Click OK to confirm including special characters.\");\n var confirmNumeric = confirm(\"Click OK to confirm including numeric characters.\");\n var confirmLower = confirm(\"Click OK to confirm including lowercase characters.\");\n var confirmUpper = confirm(\"Click OK to confirm including uppercase characters.\");\n\n// Setting character arrays using 'split'\nvar charSet = [];\nvar charSpecial = \"!@#$%^&*()_+~`|}{[];?><,./-='\";\nvar charSpecialArr = charSpecial.split(\"\");\n\nvar charNumeric = \"012345678910\";\nvar charNumericArr = charNumeric.split(\"\");\n\nvar charLower = \"abcdefghijklmnopqrstuvwxyz\";\nvar charLowerArr = charLower.split(\"\");\n\nvar charUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nvar charUpperArr = charUpper.split(\"\");\n\n // Add character types based on user choices\n if (confirmSpecial) {\n Array.prototype.push.apply(charSet, charSpecialArr);\n}\n\nif (confirmNumeric) {\n Array.prototype.push.apply(charSet, charNumericArr);\n}\n\nif (confirmLower) {\n Array.prototype.push.apply(charSet, charLowerArr);\n}\n\nif (confirmUpper) {\n Array.prototype.push.apply(charSet, charUpperArr);\n}\n\n// Concantenating all character sets for randomization\nvar allChar = charSet.concat(charSpecial, charNumeric, charLower, charUpper)\n\n// Determine random password with loop\nvar myPassword = \"\";\n\nfor (var i = 0; i < length; i++) {\n myPassword = myPassword + allChar[Math.floor(Math.random() * charSet.length)];\n}\n\nreturn myPassword;\n}", "title": "" }, { "docid": "85fc0cf7e26b598c55b5d0bb80f1452f", "score": "0.7054019", "text": "function generatePassword(){\n var options = getPasswordOptions();\n // Variable to store password as it's being concatenated\n var result = [];\n\n // Array to store types of characters to include in password\n var possibleCharacters = [];\n\n // Array to contain one of each type of chosen character to ensure each will be used\n var guaranteedCharacters = [];\n\n // Conditional statement that adds array of special characters into array of possible characters based on user input\n // Push new random special character to guaranteedCharacters\n if (options.hasSpecialCharacters) {\n possibleCharacters = possibleCharacters.concat(specialCharacters);\n guaranteedCharacters.push(getRandom(specialCharacters));\n }\n // Conditional statement that adds array of numeric characters into array of possible characters based on user input\n // Push new random special character to guaranteedCharacters\nif(options.hasNumbers) {\n possibleCharacters = possibleCharacters.concat(numbers);\n guaranteedCharacters.push(getRandom(numbers));\n}\n // Conditional statement that adds array of lowercase characters into array of possible characters based on user input\n // Push new random lower-cased character to guaranteedCharacters\nif(options.hasLowercaseCharacters) {\n possibleCharacters = possibleCharacters.concat(lowerCaseLetters);\n guaranteedCharacters.push(getRandom(lowerCaseLetters));\n}\n // Conditional statement that adds array of uppercase characters into array of possible characters based on user input\n // Push new random upper-cased character to guaranteedCharacters\nif(options.hasUppercaseLetters) {\n possibleCharacters = possibleCharacters.concat(upperCaseLetters);\n guaranteedCharacters.push(getRandom(upperCaseLetters));\n}\n // For loop to iterate over the password length from the options object, selecting random indices from the array of possible characters and concatenating those characters into the result variable\n var i;\n for (i = 0; i < possibleCharacters.length; i++) {\n text += possibleCharacters[i] + \"<br>\";\n } \n // Mix in at least one of each guaranteed character in the result\n \n // Transform the result into a string and return\n}", "title": "" }, { "docid": "4de00d9e3dc681d360506020ae8aa89c", "score": "0.7043973", "text": "function generatePassword() {\n var passLength = prompt (\"Please select password length between 8-128 characters?\");\n var lowerCase = confirm (\"Would you like to use lowercase letters?\");\n var upperCase = confirm (\"Would you like to use uppercase letters?\");\n var numeric = confirm (\"Would you like to use numbers?\");\n var specialChar = confirm (\"Would you like to use special characters?\");\n\n//Validating password criteria\n if (passLength <8 || passLength > 128) {\n alert (\"Please ensure number of characters is between 8 - 128 characters\"); \n }\n else if (lowerCase === false && upperCase === false && numeric === false && specialChar === false) {\n alert (\"Please select atleast one or more of the password criteria\");\n } else {\n \n var lowerCaseChar = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n var upperCaseChar = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"];\n var numbers = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n var specialChars = [\"!\", \"#\", \"$\", \"%\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \"-\", \".\", \"/\", \":\", \";\", \"<\", \"=\", \">\", \"?\", \"@\", \"[\", \"]\", \"^\", \"_\", \"{\", \"|\", \"}\", \"~\",];\n \n var possibleChars = [];\n var generatedPassword = \" \";\n\n if(lowerCase === true) {\n possibleChars = possibleChars.concat(lowerCaseChar);\n console.log()\n }\n if(upperCase === true) {\n possibleChars = possibleChars.concat(upperCaseChar);\n }\n if(numeric === true) {\n possibleChars = possibleChars.concat(numbers);\n }\n if(specialChar === true) {\n possibleChars = possibleChars.concat(specialChars);\n }\n//generate password matching the password length criteria\nfor(var i=0; i < passLength; i++) {\n var randomNumber = Math.floor(Math.random()*possibleChars.length);\n generatedPassword += possibleChars[randomNumber]; \n}\n return generatedPassword;\n\n}\n}", "title": "" }, { "docid": "d4cc7f37add37666d4f8552eb470b558", "score": "0.7033522", "text": "function generatePassword() {\n var passwordLength = (prompt(\"Choose a number of characters for your password.\"));\n \n //Setting up criteria\n while (passwordLength <= 7 || passwordLength >= 129 ) {\n alert(\"Password length must be between 8-128 characters. Please try again\");\n var passwordLength = (prompt(\"Choose a number of characters for your password. It must be at least 8 characters and no more than 128 characters.\"));\n } \n alert(`Your password will have ${passwordLength} characters`); \n {\n var confirmLowerCases = confirm(\"Do you want lowercases in your password?\");\n var confirmUpperCases = confirm(\"Do you want uppercases in your password?\");\n var confirmNumbers = confirm(\"Do you want numbers in your password?\");\n var confirmSpecialCharacters = confirm(\"Do you want special characters in your password?\");\n \n // Loop if answer is outside the parameters \n while(confirmUpperCases === false && confirmLowerCases === false && confirmSpecialCharacters === false && confirmNumbers === false) {\n alert(\"You must choose at least one parameter\");\n var confirmSpecialCharacters = confirm(\"Click OK to confirm if you would like to include special characters\");\n var confirmNumbers = confirm(\"Click OK to confirm if you would like to include numeric characters\"); \n var confirmLowerCases = confirm(\"Click OK to confirm if you would like to include lowercase characters\");\n var confirmUpperCases = confirm(\"Click OK to confirm if you would like to include uppercase characters\"); \n } \n\n }\n\n var passwordCharacters = []\n if (confirmSpecialCharacters) {\n passwordCharacters = passwordCharacters.concat(specialCharacters)\n }\n\n if (confirmNumbers) {\n passwordCharacters = passwordCharacters.concat(numbers)\n }\n \n if (confirmLowerCases) {\n passwordCharacters = passwordCharacters.concat(lowerCases)\n }\n\n if (confirmUpperCases) {\n passwordCharacters = passwordCharacters.concat(upperCases)\n }\n \n //empty string variable for the for loop \n var randomPasswordGenerated = \"\";\n\n // loop getting random characters\n for (var i = 0; i < passwordLength; i++) {\n randomPasswordGenerated = randomPasswordGenerated + passwordCharacters[Math.floor(Math.random() * passwordCharacters.length)];\n }\n return randomPasswordGenerated;\n}", "title": "" }, { "docid": "37a4367a09a60392f0a2fbf14cd73646", "score": "0.7028625", "text": "function generatePassword() {\n\n // Password Prompt\n // WHEN prompted for the length of the password\n // THEN I choose a length of at least 8 characters and no more than 128 characters\n // in this case, we should probably use a function to turn the length into a number\n var passwordLength = parseInt(prompt(\"How many characters will this password be?\"));\n\n // Password length will fail if greater than 128, less than 8 and is Not a number. Will loop until user gets it right. \n // we need a prompt here and ask for the length from the user\n // check IF the input number is < 8 and > 128 \n while( passwordLength > 128 \n || passwordLength < 8 \n || isNaN(passwordLength)){\n passwordLength = parseInt(prompt(\"Please choose a number greater than 8 and less than 128 for your password length.\"));\n }\n\n // Boolean to pass into for each desired character type. \n // WHEN prompted for character types to include in the password\n // THEN I choose lowercase, uppercase, numeric, and/or special characters\n // we need a confirm to ask the user if they want to use lowercase\n // we need a confirm to ask the user if they want to use uppercase\n // we need a confirm to ask the user if they want to use numeric\n // we need a confirm to ask the user if they want to use special characters\n var specialCharacters = confirm(\"Would you like to use Symbols?\");\n var numbers = confirm(\"How about numbers?\");\n var caseLower = confirm(\"Lower case letters?\");\n var caseUpper = confirm(\"Upper case letters?\");\n\n // While loop that works if all above variables are false, loops until user gets it right.\n // THEN my input should be validated and at least one character type should be selected\n // each prompt needs to be validated...\n while(!caseUpper && !caseLower && !numbers && !specialCharacters){\n alert(\"Password will not be strong enough, please select one parameter.\");\n var specialCharacters = confirm(\"Would you like to use Symbols?\");\n var numbers = confirm(\"How about numbers?\");\n var caseLower = confirm(\"Lower case letters?\");\n var caseUpper = confirm(\"Upper case letters?\");\n }\n // Variables with all characters possilbe to be selected\n // end of \"collected all the data here\" *************************\n // using the number from above and the 4 booleans\n var special = [\"!\",\"@\",\"#\",\"$\",\"%\",\"^\",\"&\",\"*\"];\n var nombre = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"];\n var lower = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n var upper = [\"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 // This is THE variable that facilitates the whole process.\n var useable = [];\n\n if (specialCharacters === true){\n useable = useable.concat(special);\n }\n if (numbers === true){\n useable = useable.concat(nombre);\n }\n if (caseLower === true){\n useable = useable.concat(lower);\n }\n if (caseUpper === true){\n useable = useable.concat(upper);\n } \n\n // WHEN all prompts are answered\n // THEN a password is generated that matches the selected criteria\n // all the information is gathered (all prompts are finished getting input)\n // all the HARD logic goes here ????????\n\n for (var i = 0; i < passwordLength; i++){\n var pwGenerator = useable[Math.floor(Math.random()*useable.length)]\n password = password + pwGenerator;\n console.log(password)\n }\n // return password\n // WHEN the password is generated\n // THEN the password is either displayed in an alert or written to the page\n // either do an alert with password... or just check to see if my variable has a password\nreturn(password)\n// *********************** end function logic **********************\n\n}", "title": "" }, { "docid": "0a54b8d1857cdbef8b31f04f64f67089", "score": "0.7026288", "text": "function generatePassword() {\n var pwCharSet = \"\";\n var newPW = \"\";\n //these if statements add the chosen character sets to a temporary character set that the new password will pull from\n\n //adds the lower case character set if chosen\n if (lowCase) {\n pwCharSet += lowCharSet;\n }\n //adds the upper case character set if chosen\n if (upCase) {\n pwCharSet += upCharSet;\n }\n //adds the number character set if chosen\n if (numeric) {\n pwCharSet += numbCharSet;\n }\n //adds the special character set if chosen\n if (specialChars) {\n pwCharSet += specCharSet; \n }\n\n //this loop constructs the password character by character\n for (var i = 0, n = pwCharSet.length; i < pwLength; ++i) {\n newPW += pwCharSet.charAt(Math.floor(Math.random() * n));\n }\n\n //each if first checks if it was included as a criterion, if it is, then it checks if the newly generated password contains at least 1 character from that character set\n\n //checks if there is at least 1 lower case character\n if (lowCase) {\n if (validateCriterion(lowCharSet, newPW) === false){\n newPW = generatePassword()\n }\n }\n //checks if there is at least 1 upper case character\n if (upCase) {\n if (validateCriterion(upCharSet, newPW) === false){\n newPW = generatePassword()\n }\n }\n //checks if there is at least 1 number\n if (numeric) {\n if (validateCriterion(numbCharSet, newPW) === false){\n newPW = generatePassword()\n }\n }\n //checks if there is at least 1 special character\n if (specialChars) {\n if (validateCriterion(specCharSet, newPW) === false){\n newPW = generatePassword()\n }\n }\n\n\n//if all the checks pass, then we can return the newly generated password\n return newPW;\n \n}", "title": "" }, { "docid": "7edc076459fb811b957f3369218fe92d", "score": "0.70082945", "text": "function generatePassword() {\n var length = getPasswordLength();\n var password = \"\";\n var numbers = prompt(\"Do you want numbers in your password?\")\n var numbers = numbers.toLowerCase()\n if(numbers === \"yes\") {\n characterPool.push.apply(characterPool, numbersList);\n numbers1 = Math.floor(Math.random() *numbersList.length);\n passwordTemp.push(numbersList[numbers1]);\n } else {\n numbers1 = Math.floor(Math.random() *doNotInclude.length);\n } \n \n \n \n \n var upperCase = window.prompt(\"Do you want uppercase letters in your password?\");\n var upperCase1 = upperCase.toLowerCase()\n if(upperCase1 === \"yes\") {\n characterPool.push.apply(characterPool, upperCase2);\n upperCase3 = Math.floor(Math.random() * upperCase2.length); \n passwordTemp.push(upperCase2[upperCase3]);\n } else {\n upperCase3 = Math.floor(Math.random() *doNotInclude.length);\n } \n \n var lowerCase = prompt(\"Do you want lower case letters in your password?\");\n var lowerCase1= lowerCase.toLowerCase();\n if(lowerCase1 === \"yes\") {\n characterPool.push.apply(characterPool, lowerCase2);\n lowerCase3 = Math.floor(Math.random() *lowerCase2.length);\n passwordTemp.push(lowerCase2[lowerCase3]);\n } else {\n lowerCase3 = Math.floor(Math.random() *doNotInclude.length);\n }\n \n var specialCharacters = prompt(\"Do you want special characters in your password?\");\n var specialCharacters1 = specialCharacters.toLowerCase();\n if(specialCharacters1 === \"yes\") {\n characterPool.push.apply(characterPool, specialChar);\n specialChar1 = Math.floor(Math.random() *specialChar.length);\n passwordTemp.push(specialChar[specialChar1])\n } else {\n specialChar1 = Math.floor(Math.random() *doNotInclude.length);\n }\n // This line makes sure the password includes the characters based on the asked questions. \n password = passwordTemp.join(\"\");\n \n // check that criteria is met\n if(numbers + upperCase1 + lowerCase1 + specialCharacters1 === \"nononono\") {\n alert(\"Need to include at least on number, upper case letter, lower case letter, or special character\");\n \n return generatePassword();\n } else {\n \n }\n \n // adds the required amount of characters based on the first question and randomizes it for a unique password. \n while (password.length < length){\n password += characterPool[Math.floor(Math.random() *characterPool.length)];\n \n }\n var passwordReshuffle = password.split('').sort(function(){return 0.5-Math.random()}).join('');\n\n // oushes password to password box on screen. \n var passwordText = document.querySelector(\"#password\");\n passwordText.value = passwordReshuffle;\n \n return passwordReshuffle;\n \n }", "title": "" }, { "docid": "36a1c28ed93b2c3b3e232240bc556095", "score": "0.69959867", "text": "function generatePassword(){\n\n let numberLength = 0;\n let upperCase = true;\n let lowerCase = true;\n let specialchar = true;\n let number = true;\n let alphaLower = [\"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 alphaUpper =[\"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 special = [\"!\",\"@\",\"#\",\"$\",\"%\",\"&\",\"?\"];\n let numero = [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"];\n let letterPull = [];\n let passWord = \"\";\n \n \n \n numberLength = prompt(\"How many characters do you want?\");\n numberLength=parseInt(numberLength);\n if (isNaN(numberLength) || (8>numberLength) || (numberLength>128)) {\n alert(\"Must be between a number of 8 and 128\");\n return;\n\n }\n\n else{\n alert(\"You selected \" + numberLength + \".\");\n }\n upperCase = confirm(\"Do you want Upper Case Letters? Yes or No\");\n if (upperCase === true){\n letterPull=letterPull.concat(alphaUpper)\n }\n \n lowerCase = confirm(\"Do you want Lower Case Letters\");\n if (lowerCase === true) {\n letterPull=letterPull.concat(alphaLower)\n }\n\n specialchar = confirm (\"Do you want Special Characters\");\n if(specialchar== true) {\n letterPull=letterPull.concat(special)\n }\n\n number = confirm (\"Do you Want Numbers?\");\n if(number == true) {\n letterPull=letterPull.concat(numero)\n }\n\n // generating random number, letter, and special characters with the for loop function\n for (let i = 0; i < numberLength; i++) {\n let charset = Math.floor(Math.random()*letterPull.length);\n\n charset = letterPull[charset];\n passWord = passWord.concat(charset);\n\n }\n return passWord;\n }", "title": "" }, { "docid": "007c308700bb8ffe30ecd4fb235208ea", "score": "0.69888175", "text": "function generatePassword() {\n\n //Get password criteria from user\n var pwdlen = prompt(\"Length (must be between 8 and 128 characters)\", 8);\n //console.log(pwdlen);\n //console.log(isNaN(pwdlen));\n //console.log('==============================111====');\n\n //if its not a number ask for number\n while (isNaN(pwdlen) || pwdlen < 8 || pwdlen > 128) {\n alert(\"Please enter a valid number!\");\n pwdlen = prompt(\"Length (must be between 8 and 128 characters)\", 8);\n //console.log(pwdlen);\n //console.log(isNaN(pwdlen));\n //console.log('============================222======');\n\n }\n\n var charcnt = 0;\n\n do {\n var wantSplchrs = confirm(\"Do you want to include special characters?\");\n console.log(\"splchrs \" + wantSplchrs);\n if (wantSplchrs) {\n charcnt++;\n console.log(charcnt);\n }\n var wantNumbers = confirm(\"Do you want to include numbers?\");\n console.log(\"Numbers \" + wantNumbers);\n if (wantNumbers) {\n charcnt++;\n console.log(charcnt);\n }\n\n var wantLowerchrs = confirm(\"Do you want to include Lower characters?\");\n console.log(\"lower \" + wantLowerchrs);\n if (wantLowerchrs) {\n charcnt++;\n console.log(charcnt);\n }\n\n var wantUpperchrs = confirm(\"Do you want to include Upper characters?\");\n console.log(\"upper \" + wantUpperchrs);\n\n if (wantUpperchrs) {\n charcnt++;\n console.log(charcnt);\n }\n\n } while (charcnt < 1);\n //Define Arrays to hold special chrs, number and alphabets\n var ArraySpecialChrs = ['\"', ' ', '!', '\"', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '^', '_', '`', '{', '|', '}', ';', '~'];\n console.log(ArraySpecialChrs);\n\n var ArrayNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n console.log(ArrayNumbers);\n\n var ArrayLowerChrs = ['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 console.log(ArrayLowerChrs);\n\n var ArrayUpperChrs = ['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 console.log(ArrayUpperChrs);\n\n //Define a Array to store the generated password\n var ArrayPwd = [''];\n console.log(ArrayPwd);\n\n //Check 1 of 15 possibility\n if (wantSplchrs === true && wantNumbers === false && wantLowerchrs === false && wantUpperchrs === false) {\n for (var i = 0; i < pwdlen; i++) {\n // console.log(\"just i is =======>\" + i);\n // console.log(ArraySpecialChrs[i]);\n\n // console.log(\"----------------\");\n\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n console.log(ArraySpecialChrs.length);\n console.log(\"What Array number are we picking: \" + randArrayNo);\n console.log(ArraySpecialChrs[randArrayNo]);\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n console.log(ArrayPwd);\n\n console.log(\"----------------\");\n\n }\n }\n\n\n //Check 2 of 15 possibility\n if (wantSplchrs === false && wantNumbers === true && wantLowerchrs === false && wantUpperchrs === false) {\n for (var i = 0; i < pwdlen; i++) {\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n\n }\n }\n\n\n //Check 3 of 15 possibility\n if (wantSplchrs === false && wantNumbers === false && wantLowerchrs === true && wantUpperchrs === false) {\n for (var i = 0; i < pwdlen; i++) {\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n\n }\n }\n\n\n //Check 4 of 15 possibility\n if (wantSplchrs === false && wantNumbers === false && wantLowerchrs === false && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n }\n\n //Check 5 of 15 possibility\n if (wantSplchrs === true && wantNumbers === true && wantLowerchrs === false && wantUpperchrs === false) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are two arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 2);\n console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n console.log(ArraySpecialChrs.length);\n console.log(\"What Array number are we picking: \" + randArrayNo);\n console.log(ArraySpecialChrs[randArrayNo]);\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n console.log(ArrayPwd);\n\n console.log(\"----------------\");\n } else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n console.log(ArrayNumbers.length);\n console.log(\"What Array number are we picking: \" + randArrayNo);\n console.log(ArrayNumbers[randArrayNo]);\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n console.log(ArrayPwd);\n\n console.log(\"----------------\");\n\n }\n\n }\n }\n\n //Check 6 of 15 possibility\n if (wantSplchrs === true && wantNumbers === false && wantLowerchrs === true && wantUpperchrs === false) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are two arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 2);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n\n } else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n }\n\n }\n }\n\n //Check 7 of 15 possibility\n if (wantSplchrs === true && wantNumbers === false && wantLowerchrs === false && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are two arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 2);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n\n } else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n\n }\n }\n\n //Check 8 of 15 possibility\n if (wantSplchrs === false && wantNumbers === true && wantLowerchrs === true && wantUpperchrs === false) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are two arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 2);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n\n }\n\n }\n }\n\n //Check 9 of 15 possibility\n if (wantSplchrs === false && wantNumbers === true && wantLowerchrs === false && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are two arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 2);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n\n }\n }\n\n //Check 10 of 15 possibility\n if (wantSplchrs === false && wantNumbers === false && wantLowerchrs === true && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are two arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 2);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n\n }\n }\n\n //Check 11 of 15 possibility\n if (wantSplchrs === true && wantNumbers === true && wantLowerchrs === true && wantUpperchrs === false) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are three arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 3);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n\n } else if (randArraypickerNo === 3) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n\n }\n\n }\n }\n\n //Check 12 of 15 possibility\n if (wantSplchrs === true && wantNumbers === true && wantLowerchrs === false && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are three arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 3);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n\n } else if (randArraypickerNo === 3) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n\n }\n }\n\n //Check 13 of 15 possibility\n if (wantSplchrs === true && wantNumbers === false && wantLowerchrs === true && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are three arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 3);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n\n } else if (randArraypickerNo === 3) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n\n }\n }\n\n //Check 14 of 15 possibility\n if (wantSplchrs === false && wantNumbers === true && wantLowerchrs === true && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are three arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 3);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n\n } else if (randArraypickerNo === 3) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n\n }\n }\n\n\n //Check 15 of 15 possibility\n if (wantSplchrs === true && wantNumbers === true && wantLowerchrs === true && wantUpperchrs === true) {\n for (var i = 0; i < pwdlen; i++) {\n\n // As there are three arrays, generate a random number to pick the array\n var randArraypickerNo = Math.ceil(Math.random() * 4);\n //console.log(randArraypickerNo);\n\n if (randArraypickerNo === 1) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArraySpecialChrs.length - 1));\n ArrayPwd[i] = ArraySpecialChrs[randArrayNo];\n }\n else if (randArraypickerNo === 2) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayNumbers.length - 1));\n ArrayPwd[i] = ArrayNumbers[randArrayNo];\n\n } else if (randArraypickerNo === 3) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayLowerChrs.length - 1));\n ArrayPwd[i] = ArrayLowerChrs[randArrayNo];\n\n } else if (randArraypickerNo === 4) {\n //Variable to get a random index\n var randArrayNo = Math.ceil(Math.random() * (ArrayUpperChrs.length - 1));\n ArrayPwd[i] = ArrayUpperChrs[randArrayNo];\n\n }\n\n }\n }\n\n\n //Concatinate the pwd and return\n Passwordfinal = \"\";\n for (var i = 0; i < ArrayPwd.length; i++) {\n Passwordfinal = Passwordfinal + ArrayPwd[i];\n\n }\n\n console.log(Passwordfinal);\n return Passwordfinal;\n\n}", "title": "" }, { "docid": "92426dfd5bcc6897cabbc13d57ad2fff", "score": "0.6985991", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n var i;\n\n let length = \"0\";\n let lengthInt = 0;\n \n function getLength() {\n length = prompt(\"What would you like your password to be? select any number between 8 and 128\");\n \n if (!(length)){\n return 0;\n }\n lengthInt = parseInt(length);\n if (isNaN(lengthInt)){\n getLength();\n }\n else if ((lengthInt < 8) || (lengthInt > 128)){\n getLength();\n }\n return lengthInt;\n }\n \n lengthInt = getLength();\n if (lengthInt === 0){\n return;\n }\n\n while (!(wantNum) && !(wantCap) && !(wantLow) && !(wantSpec)){\n alert(\"You will need to select at least one character type to include in your password.\")\n var checkNum = confirm(\"Would you like numbers in your password?\");\n var checkCap = confirm(\"Would you like capitalized letters in your password?\");\n var checkLow = confirm(\"Would you like lower cased letters in your password?\");\n var checkSpec = confirm(\"Would you like special characters in your password?\");\n\n\n function useUserPreferences(charNum, charCap, charLower, charSpec) {\n\n var userPass = \"\"\n var validChar = \"\"\n\n var charNum = '1234567890'\n var charCap = 'QWERTYUIOPASDFGHJKLZXCVBNM'\n var charLower = 'qwertyuiopasdfghjklzxcvbnm'\n var charSpec = '!@#$%^&*()_+{}{|:\"<>?},./;[]' \n \n for (i = 0; i < charNum.length, i++;) {\n newChar = validChar.charAt(Math.floor(Math.random()*validChar.length+1));\n userPass = charNum.useUserPreferences(newChar)\n }\n for (i = 0; i < charCap.length, i++;) {\n newChar = validChar.charAt(Math.floor(Math.random()*validChar.length+1));\n userPass = charCap.useUserPreferences(newChar)\n }\n for (i = 0; i < charLower.length, i++;) {\n newChar = validChar.charAt(Math.floor(Math.random()*validChar.length+1));\n userPass = charLow.useUserPreferences(newChar)\n }\n for (i = 0; i < charSpec.length, i++;) {\n newChar = validChar.charAt(Math.floor(Math.random()*validChar.length+1));\n userPass = charSpec.useUserPreferences(newChar)\n }\n }\n\n document.getElementById(\"display\").value = password\n\n}\n}", "title": "" }, { "docid": "453d89913799832b9c1cb9a2e45b133e", "score": "0.6983042", "text": "function writePassword() {\n //checklist \n var Plength = prompt(\"Length of password:\")\n var lowercase = confirm(\"At lease one lowercase\")\n var number = confirm(\"At lease one number\")\n var uppercase = confirm(\"At lease one uppercase\")\n var specialChar = confirm(\"At least one special character\")\n //\n\n myCriteria()\n function myCriteria(){\n//Narrow down to the set of characters to generate password from\n \n var lC = 'abcdefghijklmnopqrstuvwxyz'\n var num = '0123456789'\n var uC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n var sC = '!\"#$%&()*+,-./:;<=>?@[^_`]{|}~'\n var string = \"\"\n var checkCriteria = []\n console.log(Plength)\n if (lowercase == true) { \n console.log(\"lowercase\")\n var string = string.concat(lC)\n checkCriteria[checkCriteria.length]=lC\n\n }\n if (number == true) {\n console.log(\"number\")\n var string = string.concat(num)\n checkCriteria[checkCriteria.length]=num\n }\n if (uppercase == true) {\n console.log(\"uppercase\")\n var string = string.concat(uC)\n checkCriteria[checkCriteria.length]=uC\n }\n if (specialChar == true) {\n console.log(\"specialChar\")\n var string = string.concat(sC)\n checkCriteria[checkCriteria.length]=sC\n } \n \n console.log(\"We will select from these characters:\"+\" \"+string)\n //generate password\n var frame = [] \n while(frame.length<Plength){\n var xChar = string.charAt(Math.floor(Math.random() * string.length))\n frame.push(xChar) \n }\n\nvar passwordString = frame.join('')\n \npasswordText.value = passwordString;\n\nconsole.log(passwordString)\n }\n\n}", "title": "" }, { "docid": "7ee18a7beba627c662419f168fb5f124", "score": "0.698231", "text": "function generatePassword () { \n // First, determine the length variable - prompt input\n var length = prompt(\"Choose a password length between 8 & 128\"); \n while ((length < 8) || (length > 128)) {\n alert(\"Password must be between 8 and 128 characters!\");\n length = prompt(\"Choose a password length between 8 & 128\"); \n }\n \n // Second, determine remaining parameters for password criteria - confirmation window\n var userNumbers = confirm(\"Would you like to include numbers in you password?\");\n var userLowerCase = confirm(\"Would you like to include lower case letters in your password?\");\n var userUpperCase = confirm (\"Would you like to include upper case letters in your password?\");\n var userSpecial = confirm (\"Would you like to include special characters in your password?\");\n // Condition that requires at least one selection is made, if not loops confirmation questions. \n while (userNumbers, userLowerCase, userUpperCase, userSpecial === false) {\n alert(\"You must choose at least one!\");\n userNumbers = confirm(\"Would you like to include numbers in you password?\");\n userLowerCase = confirm(\"Would you like to include lower case letters in your password?\");\n userUpperCase = confirm (\"Would you like to include upper case letters in your password?\");\n userSpecial = confirm (\"Would you like to include special characters in your password?\");\n }\n\n // declare password varibale to hold char for user password\n var allCombos = [];\n var finalPassword = \"\";\n\n // case 1: numbers\n if (userNumbers) {\n for (var i of numbers)\n allCombos.push(i);\n }\n\n // case 2: lowerCase\n if (userLowerCase) {\n for (var i of lowerCase)\n allCombos.push(i);\n }\n\n // case 3: upperCase\n if (userUpperCase) {\n for (var i of upperCase)\n allCombos.push(i);\n }\n\n // case 4: special\n if (userSpecial) {\n for (var i of special)\n allCombos.push(i);\n }\n\n // log allCombos to console\n console.log(allCombos);\n\n // math to create the password\n for (var i = 0; i < length; i++) {\n finalPassword += allCombos[Math.floor(Math.random() * allCombos.length)];\n }\n \n // log final password to the console\n console.log(finalPassword);\n\n // print final password to console\n return finalPassword;\n }", "title": "" }, { "docid": "2d85495c37f8c8d6853aa0f5628f7df9", "score": "0.69745356", "text": "function generatePassword() {\n pwLength = window.prompt(\"Your password can have between 8 and 128 characters. Enter the number you would like.\");\n\n // prompt for invalid entry\n while (pwLength < 8 || pwLength > 128) {\n window.alert(\"That was not a valid entry, please try again.\");\n pwLength = window.prompt(\"Your password can have between 8 and 128 characters. Enter the number you would like.\");\n }\n\n // prompts for character types to use\n useLowCase = confirm(\"Do you want to use lower case letter?\");\n useUpCase = confirm(\"How about upper case letters?\");\n useNumbers = confirm(\"Should it include numbers?\");\n useSpecial = confirm (\"And how about special characters/punctuation?\")\n\n // if no character types are chosen\n while (useLowCase === false && useUpCase === false && useNumbers === false && useSpecial == false) {\n window.alert(\"Please choose at least one type of character to use.\");\n useLowCase = confirm(\"Do you want to use lower case letter?\");\n useUpCase = confirm(\"How about upper case letters?\");\n useNumbers = confirm(\"Should it include numbers?\");\n useSpecial = confirm (\"And how about special characters/punctuation?\")\n }\n\n\n ///// DETERMINE WHICH ARRAYS TO USE\n\n // if all 4 character types are chosen\n if (useLowCase && useUpCase && useNumbers && useSpecial) {\n endResultPw = lowCase.concat(upCase, numbers, special);\n\n // if 3 types are chosen\n } else if (useLowCase && useUpCase && useNumbers) {\n endResultPw = lowCase.concat(upCase, numbers); \n } else if (useLowCase && useUpCase && useSpecial) {\n endResultPw = lowCase.concact(upCase, special);\n } else if (useUpCase && useNumbers && useSpecial) {\n endResultPw = upCase.concat(numbers, special);\n } else if (useLowCase && useNumbers && useSpecial) {\n endResultPw = lowCase.concat(numbers, special);\n \n // if 2 types are chosen\n } else if (useLowCase && useUpCase) {\n endResultPw = lowCase.concat(upCase);\n } else if (useLowCase && useNumbers) {\n endResultPw = lowCase.concat(numbers);\n } else if (useLowCase && useSpecial) {\n endResultPw = lowCase.concat(special);\n } else if (useUpCase && useNumbers) {\n endResultPw = upCase.concat(numbers);\n } else if (useUpCase && useSpecial) {\n endResultPw = upCase.concat(special);\n } else if (useNumbers && useSpecial) {\n endResultPw = numbers.concat(special);\n\n // if 1 is chosen\n } else if (useLowCase) {\n endResultPw = lowCase;\n } else if (useUpCase) {\n endResultPw = upCase;\n } else if (useNumbers) {\n endResultPw = numbers;\n } else if (useSpecial) {\n endResultPw = special;\n }\n\n\n ///// RANDOM SELECTION OF PASSWORD CHARACTERS\n\n // display pw as a string\n let password = \"\";\n\n // generate pw by looping through selected arrays\n for (var i = 0; i < pwLength; i++) {\n password = password + endResultPw[Math.floor(Math.random() * endResultPw.length)];\n }\n return password;\n\n}", "title": "" }, { "docid": "74cef9320ff3410d44db7f13a535f740", "score": "0.6964184", "text": "function generatePassword() {\n //\n // DATA STRUCTURE\n //\n // 1. Varialable to store user input object by calling yourFuncForUserInput\n\n var userInput2 = yourFuncForUserInput();\n\n //\n // 2. An empty array for result to store password as it's being concatenated later\n\n var storePass = [];\n\n //\n // 3. Array to store all eligible/possible characters of different types based on by user input\n\n var allChar = [];\n\n //\n // 4. Array to contain one of each type of chosen character to ensure each will be used and guaranteed\n //\n\n var guaranteedCharacters = [];\n\n // MAIN LOGIC\n //\n // 1a. Conditional statement that adds array of special characters into array of possible characters based on user input\n // 1b. Push new random special character to guaranteedCharacters\n //\n\n if(userInput2.includes(\"confirmCharacter\") === true) {\n allChar = allChar.concat(specialCharacters);\n }\n else if (!userInput2.includes(\"confirmCharacter\")) {\n return;\n }\n\n // 2a. Conditional statement that adds array of numeric characters into array of possible characters based on user input\n // 2b. Push new random special character to guaranteedCharacters\n //\n\n if(userInput2.includes(\"confirmNumber\") === true) {\n allChar = allChar.concat(numericCharacters);\n }\n\n // 3a. Conditional statement that adds array of lowercase characters into array of possible characters based on user input\n // 3b. Push new random lower-cased character to guaranteedCharacters\n //\n\n if(userInput2.includes(\"confirmLowercase\") === true) {\n allChar = allChar.concat(lowerCasedCharacters);\n }\n\n // 4a. Conditional statement that adds array of uppercase characters into array of possible characters based on user input\n // 4b. Push new random upper-cased character to guaranteedCharacters\n //\n\n if(userInput2.includes(\"confirmUppercase\") === true) {\n allChar = allChar.concat(upperCasedCharacters);\n }\n\n // 5. For loop to iterate over the password length from the options object, selecting random indices from the array of possible characters and concatenating those characters into the result variable\n //\n\n for(var i = 0; i < confirmLength; i++) {\n guaranteedCharacters += yourFuncForRandomChar(allChar);\n }\n\n // 6. Mix in at least one of each guaranteed character in the result\n //\n // 7. Transform the result into a string and pass into writePassword and return it to the caller\n //\n\n var password = guaranteedCharacters;\n return password;\n\n}", "title": "" }, { "docid": "c45b607a89e7789a59cf396b164778e3", "score": "0.69635254", "text": "function generatePassword () {\n var randomPassword = \"\";\n var pwLengthEntry = setPasswordLength();\n var lowerCaseOption = checkLowercase();\n var upperCaseOption = checkUppercase();\n var numericOption = checkNumeric();\n var specialOption = checkSpecial();\n\n // if all of the confirms are false, presents the user with an error and breaks out of the function\n if (lowerCaseOption === false && upperCaseOption === false && numericOption === false && specialOption === false) {\n alert(\"Please select at least one character type.\");\n return\n }\n\n // defines a new variable to concatenate all relevant character sets\n var finalSetofOptions = \"\";\n\n if (lowerCaseOption) {\n finalSetofOptions = finalSetofOptions.concat(lowercaseCharacters);\n }\n\n if (upperCaseOption) {\n finalSetofOptions = finalSetofOptions.concat(uppercaseCharcters);\n }\n\n if (numericOption) {\n finalSetofOptions = finalSetofOptions.concat(numberCharacters);\n }\n\n if (specialOption) {\n finalSetofOptions = finalSetofOptions.concat(specialCharacters);\n }\n\n // iterates through the final password character set to select characters based on how many characters were defined by the pwLength prompt\n for (var i = 0; i < pwLengthEntry; i++) {\n randomPassword += finalSetofOptions.charAt(Math.floor(Math.random() * finalSetofOptions.length));\n }\n return randomPassword;\n\n}", "title": "" }, { "docid": "23a8fe27af7119e58d9bd32509538b16", "score": "0.6959369", "text": "function getFullPassword(length, userAskedForUppercaseLetters, userAskedForLowercaseLetters, userAskedForNumbers, userAskedForSymbols) {\n var password = '';\n i = length;\n while (i > 0) {\n if (userAskedForLowercaseLetters === true) {\n if (i !== 0) {\n password = password + getLower();\n i--;\n }\n }\n\n if (userAskedForUppercaseLetters === true) {\n if (i !== 0) {\n password = password + getUpper();\n i--;\n }\n }\n\n if (userAskedForNumbers === true) {\n if (i !== 0) {\n password = password + getNumber();\n i--;\n }\n }\n \n if(userAskedForSymbols === true) {\n if (i !== 0) {\n password = password + getSymbol();\n i--;\n }\n\n }\n } \n return password;\n}", "title": "" }, { "docid": "a0a8ba9d1d81d7b4cece7825db73ab14", "score": "0.69548196", "text": "function generatePassword() {\n let pWord = [];\n\n // Get user inputs.\n getPasswordLength();\n getUseLowers();\n getUseUppers();\n getUseNumbers();\n getUseSymbols();\n\n // Check if password length has been input, if not, then return nothing.\n if (passwordLength == null || passwordLength == NaN) {\n return;\n }\n // Error if user did not select any criteria. \n else if (!useLowers && !useUppers && !useNumbers && !useSymbols) {\n alert(\"Cannot create a password!\\nPlease select what characters you would like to use.\");\n\n // Use Lowercase, Uppercase, Numbers, and Symbols\n } else if (useLowers && useUppers && useNumbers && useSymbols) {\n passString = numbers.concat(lowerCase, upperCase, symbols);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Lowercase, Uppercase, Numbers, but not Symbols.\n } else if (useLowers && useUppers && useNumbers && !useSymbols) {\n passString = numbers.concat(lowerCase, upperCase);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Lowercase, Uppercase, Symbols, but not Numbers.\n } else if (useLowers && useUppers && !useNumbers && useSymbols) {\n passString = lowerCase.concat(upperCase, symbols);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Lowercase, Numbers, Symbols, but not Uppercase.\n } else if (useLowers && !useUppers && useNumbers && useSymbols) {\n passString = numbers.concat(lowerCase, symbols);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Uppercase, Numbers, Symbols, but not Lowercase.\n } else if (!useLowers && useUppers && useNumbers && useSymbols) {\n passString = numbers.concat(upperCase, symbols);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Lowercase only.\n } else if (useLowers && !useUppers && !useNumbers && !useSymbols) {\n passString = lowerCase;\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Uppercase only.\n } else if (!useLowers && useUppers && !useNumbers && !useSymbols) {\n passString = upperCase;\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Numbers only.\n } else if (!useLowers && !useUppers && useNumbers && !useSymbols) {\n passString = numbers;\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Symbols only.\n } else if (!useLowers && !useUppers && !useNumbers && useSymbols) {\n passString = symbols;\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Lowercase and Uppercase only. \n } else if (useLowers && useUppers && !useNumbers && !useSymbols) {\n passString = lowerCase.concat(upperCase);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Lowercase and Numbers only.\n } else if (useLowers && !useUppers && useNumbers && !useSymbols) {\n passString = lowerCase.concat(numbers);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Lowercase and Symbols only.\n } else if (useLowers && !useUppers && !useNumbers && useSymbols) {\n passString = lowerCase.concat(symbols);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Uppercase and Symbols only. \n } else if (!useLowers && useUppers && !useNumbers && useSymbols) {\n passString = upperCase.concat(symbols);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Uppercase and Numbers only.\n } else if (!useLowers && useUppers && useNumbers && !useSymbols) {\n passString = upperCase.concat(numbers);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n\n // Use Numbers and Symbols only.\n } else if (!useLowers && !useUppers && useNumbers && useSymbols) {\n passString = numbers.concat(symbols);\n for (let i = 0; i < passwordLength; i++) {\n let x = passString[Math.floor(Math.random() * passString.length)];\n pWord.push(x);\n }\n return pWord.join(\"\");\n }\n}", "title": "" }, { "docid": "54b43e10829dd95e507e06a777fabc5e", "score": "0.6941474", "text": "function generatePassword() {\n var length = askLength();\n var includeLower = confirm(\"Use lowercase?\");\n var includeUpper = confirm(\"Use uppercase?\");\n var includeNumbers = confirm(\"Use numbers?\");\n var includeSymbols = confirm(\"Use symbols?\");\n if (includeLower === false &&\n includeUpper === false &&\n includeNumbers === false &&\n includeSymbols === false) {\n alert(\"Please select OK for at least one type of character to include in your password.\")\n return generatePassword();\n }\n var pot = \"\";\n var finalPassword = \"\";\n \n if (includeLower) {\n pot = pot + lowerCase;\n }\n\n if (includeUpper) {\n pot = pot + upperCase;\n }\n\n if (includeNumbers) {\n pot = pot + numbers;\n }\n\n if (includeSymbols) {\n pot = pot + symbols;\n }\n \n console.log(`pot: ${pot}`);\n\n for (let i=0; i<length; i++) {\n var index = Math.floor(Math.random() * pot.length);\n finalPassword += pot[index];\n }\n \n console.log(finalPassword);\n\n return finalPassword;\n}", "title": "" }, { "docid": "2a1ef7b83677a8fb43e2d56bfdf73a14", "score": "0.6937487", "text": "function generatePassword() {\n var password = \"\";\n var length = promptLength();\n var charSet = createCharSet();\n\n //Handles if a user decides not to allow any characters at all; forces them to try again\n console.log(\"charSet = \" + charSet);\n while (charSet.length === 0) {\n window.alert(\"Cannot generate a password with no characters. Please select at least one character type from the following choices.\");\n charSet = createCharSet();\n console.log(\"charSet = \" + charSet)\n }\n\n //Generates the password from the charSet\n for (var i = 0; i < length; i++) {\n password += charSet.charAt(Math.floor(Math.random() * charSet.length));\n }\n\n return password;\n}", "title": "" }, { "docid": "76ae9f77ece41e52db09170766f35f12", "score": "0.6930362", "text": "function generatePassword(){\n var passLength = prompt( \"how many characters would you like to be in your password? ( choose from 8-128 characters)\" );\n passLength = parseInt(passLength);\n// loop the question if users don't input a number in the range or it's not a number.\n while(passLength<8 || passLength>128 || isNaN(passLength)){\n alert(\"Your password must be between 8-128 characters. Please try again\");\n passLength = prompt( \"how many characters would you like? ( choose from 8-128 characters)\" );\n }\n\n // ask user to confirm character type of password they would like to include \n \n var pickNum = confirm (\"Would you like numbers in your password?.\\n Cancel='No' || OK='Yes' \");\n \n var pickChar = confirm (\"Would you like special characters in your password? \\n Cancel='No' || OK='Yes' \");\n \n var pickLower = confirm (\"Would you like lowercase characters in your password? \\n Cancel='No' || OK='Yes' \");\n \n var pickUpper = confirm (\"Would you like uppercase characters in your password? \\n Cancel='No' || OK='Yes' \");\n\n//loop obove questions if users dont pick any character type of password\n \n while(pickNum ===false && pickChar ===false && pickLower ===false && pickUpper ===false){\n alert(\" You must choose at least 1 character type of password \");\n \n pickNum = confirm (\"Would you like numbers in your password? \\n Cancel='No' || OK='Yes' \");\n \n pickChar = confirm (\"Would you like special characters in your password? \\n Cancel='No' || OK='Yes' \");\n \n pickLower = confirm (\"Would you like lowercase characters in your password? \\n Cancel='No' || OK='Yes'\");\n \n pickUpper = confirm (\"Would you like uppercase characters in your password? \\n Cancel='No' || OK='Yes' \");\n }\n\n var yourPassword = [];\n\n //check options user picks & initialize the yourPassword array\n if (pickNum){\n yourPassword = yourPassword.concat(num);\n \n }\n \n if (pickChar){\n yourPassword = yourPassword.concat(specialChar);\n \n }\n\n if (pickLower){\n yourPassword = yourPassword.concat(lower);\n \n }\n\n if (pickUpper){\n yourPassword = yourPassword.concat(upper);\n \n }\n console.log(yourPassword);\n \n // create an emty string named yourNewPassword \n var yourNewPassword = \"\";\n // fill in the emty string by selecting random characters from array yourPassword\n for (var i = 0; i < passLength; i++) {\n yourNewPassword = yourNewPassword + yourPassword[Math.floor(Math.random() * yourPassword.length)];\n console.log(yourNewPassword);\n }\n //return value\n return yourNewPassword;\n \n }", "title": "" }, { "docid": "c60b4de62859c061420829b7a30c9eb5", "score": "0.6922094", "text": "function buildPassword(){\n let options = getPasswordOptions();\n //variable to store password as its being concatenated\n let result = [];\n\n //array to store types of characters to include\n let possibleCharacters = [];\n\n //array to contain one of each type of chosen character \n let guaranteedCharacters = [];\n\n //conditional statement tht adds array of special characters to possible characters and add 1 random\n //character to guaranteedCharacters.\n //Push new random special character to guaranteedCharacters\n if(options.specialChar) {\n possibleCharacters = possibleCharacters.concat(symbols);\n guaranteedCharacters.push(getRandom(symbols))\n }\n\n //conditional statement tht adds array of numeric characters to possible characters and add 1 random\n //character to guaranteedCharacters.\n //Push new random special character to guaranteedCharacters\n if(options.numericChar) {\n possibleCharacters = possibleCharacters.concat(numerals);\n guaranteedCharacters.push(getRandom(numerals))\n }\n\n //conditional statement tht adds array of lower case characters to possible characters and add 1 random\n //character to guaranteedCharacters.\n //Push new random special character to guaranteedCharacters\n if(options.lowerCaseChar) {\n possibleCharacters = possibleCharacters.concat(lowerAlpha);\n guaranteedCharacters.push(getRandom(lowerAlpha))\n }\n\n //conditional statement tht adds array of upper case characters to possible characters and add 1 random\n //character to guaranteedCharacters.\n //Push new random special character to guaranteedCharacters\n if(options.upperCaseChar) {\n possibleCharacters = possibleCharacters.concat(upperAlpha);\n guaranteedCharacters.push(getRandom(upperAlpha))\n }\n\n //Loop through possible characters and push to results array\n for(let i = 0; i < options.length; i++) {\n let possibleCharacter = getRandom(possibleCharacters);\n\n result.push(possibleCharacter);\n }\n\n //Mix at least one of the guaranteed character in the result\n for(let i = 0; i<guaranteedCharacters.length; i++) {\n result[i] = guaranteedCharacters[i];\n }\n\n //Create a string from result array to pass into writePassword\n return result.join('');\n}", "title": "" }, { "docid": "577501ce182aee0067705eb25bb8f705", "score": "0.69205445", "text": "function generatePassword() {\n var passwordLengthConf = prompt(\"Choose a password length: 8-128 characters.\");\n \n // Password length validation via user input\n if (passwordLengthConf < 8 || passwordLengthConf > 128) {\n alert(\"Please enter a number between 8-128.\");\n passwordLengthConf = 0;\n return generatePassword();\n };\n\n // Confirm statements used to aquire true or false based on user input\n var wantUppercase = confirm(\"Do you want uppercase letters?\");\n var wantLowercase = confirm(\"Do you want lowercase letters?\");\n var wantNumbers = confirm(\"Do you want numbers?\");\n var wantSpecialChar = confirm(\"Do you want special characters?\");\n\n // Console loggin the user input\n console.log(passwordLengthConf);\n console.log(wantLowercase);\n console.log(wantUppercase);\n console.log(wantNumbers);\n console.log(wantSpecialChar);\n\n // Variables that pull from the user input\n var includeuppercaseLetters=wantUppercase;\n var includelowercaseLetters=wantLowercase;\n var includenumberChar=wantNumbers;\n var includeSpecialChar=wantSpecialChar;\n var passwordLength=passwordLengthConf;\n\n var password=\"\";\n\n // First 4 characters determined below based on user input\n if(includeuppercaseLetters) {\n password+=generateRandomUppercaseLetter();\n }\n if(includelowercaseLetters) {\n password+=generateRandomLowercaseLetter();\n }\n if(includenumberChar) {\n password+=generateRandomNumberChar();\n }\n if(includeSpecialChar) {\n password+=generateRandomSpecialChar();\n }\n \n // For loop determining the length of the password\n for(var i = password.length; i < passwordLength; i++){\n var typeOfCharacterToGenerate=true\n\n // Possible parameters for filling up the remaining length of the password (using the array functions above)\n if(typeOfCharacterToGenerate===wantSpecialChar && typeOfCharacterToGenerate===wantNumbers && typeOfCharacterToGenerate===wantUppercase && typeOfCharacterToGenerate===wantLowercase){\n password+=generateRandomAll();\n }\n else if(typeOfCharacterToGenerate===wantSpecialChar && typeOfCharacterToGenerate===wantNumbers && typeOfCharacterToGenerate===wantUppercase){\n password+=generateRandomSpecialNumberUpper();\n }\n else if(typeOfCharacterToGenerate===wantSpecialChar && typeOfCharacterToGenerate===wantNumbers && typeOfCharacterToGenerate===wantLowercase){\n password+=generateRandomSpecialNumberLower();\n }\n else if(typeOfCharacterToGenerate===wantLowercase && typeOfCharacterToGenerate===wantUppercase && typeOfCharacterToGenerate===wantSpecialChar){\n password+=generateRandomUpperLowerSpecial();\n }\n else if(typeOfCharacterToGenerate===wantLowercase && typeOfCharacterToGenerate===wantUppercase && typeOfCharacterToGenerate===wantNumbers){\n password+=generateRandomUpperLowerNumber();\n }\n else if(typeOfCharacterToGenerate===wantLowercase && typeOfCharacterToGenerate===wantUppercase){\n password+=generateRandomUpperLower();\n }\n else if(typeOfCharacterToGenerate===wantSpecialChar && typeOfCharacterToGenerate===wantUppercase){\n password+=generateRandomSpecialCharAndUppercase();\n }\n else if(typeOfCharacterToGenerate===wantSpecialChar && typeOfCharacterToGenerate===wantLowercase){\n password+=generateRandomSpecialCharAndUppercase();\n }\n else if(typeOfCharacterToGenerate===wantSpecialChar && typeOfCharacterToGenerate===wantNumbers){\n password+=generateRandomSpecialCharAndUppercase();\n }\n else if(typeOfCharacterToGenerate===wantNumbers && typeOfCharacterToGenerate===wantUppercase){\n password+=generateRandomNumberUpper();\n }\n else if(typeOfCharacterToGenerate===wantNumbers && typeOfCharacterToGenerate===wantLowercase){\n password+=generateRandomNumberLower();\n }\n else if(typeOfCharacterToGenerate===wantUppercase){\n password+=generateRandomUppercaseLetter();\n }\n else if(typeOfCharacterToGenerate===wantLowercase){\n password+=generateRandomLowercaseLetter();\n }\n else if(typeOfCharacterToGenerate===wantNumbers){\n password+=generateRandomNumberChar();\n }\n else if(typeOfCharacterToGenerate===wantSpecialChar){\n password+=generateRandomSpecialChar();\n }\n }\n\n return password;\n\n}", "title": "" }, { "docid": "5ef568382efa29e15521be8ca589443f", "score": "0.6918319", "text": "function generatePassword() {\n var identifiedLength = (prompt(\"Hi User! How long do you want your password to be?\"));\n\n while(identifiedLength <= 7 || identifiedLength >= 129) {\n alert(\"Your password should be within 8-128 characters\");\n var identifiedLength = (prompt(\"Hi User! How long do you want your password to be?\"));\n }\n\n var identifiedNumber = confirm(\"Click if you want to have any numeric characters.\");\n var identifiedLowercase = confirm(\"Click if you want to have any lowercase characters.\");\n var identifiedUpperCase = confirm(\"Click if you want to have any uppercase characters.\");\n var identifiedSpecialCharacter = confirm(\"Click if you want any special characters.\");\n\n while(identifiedSpecialCharacter === false && identifiedUpperCase === false && identifiedNumber === false && identifiedLowercase === false) {\n alert(\"Hi User! You need to choose at least one option.\");\n var identifiedNumber = confirm(\"Click if you want to have any numeric characters.\");\n var identifiedLowercase = confirm(\"Click if you want to have any lowercase characters.\");\n var identifiedUpperCase = confirm(\"Click if you want to have any uppercase characters.\");\n var identifiedSpecialCharacter = confirm(\"Click if you want to have any special characters.\");\n }\n\n var passwordElement = []\n\n if (identifiedNumber) {\n passwordElement = passwordElement.concat(number)\n }\n\n if (identifiedLowercase) {\n passwordElement = passwordElement.concat(lowerCase)\n }\n\n if (identifiedUpperCase) {\n passwordElement = passwordElement.concat(upperCase)\n }\n\n if (identifiedSpecialCharacter) {\n passwordElement = passwordElement.concat(specialCharacter)\n }\n\n console.log(passwordElement);\n\n var anyNumber = \"\"\n\n for(var i = 0; i < identifiedLength; i++) {\n anyNumber = anyNumber + passwordElement[Math.floor(Math.random() * passwordElement.length)];\n console.log(anyNumber)\n }\n\n return anyNumber;\n}", "title": "" }, { "docid": "693fff02e13aacbaf82520eb2ecd55aa", "score": "0.690667", "text": "function generatePassword() {\n var userOptions = getUserOptions(); // create a variable and call our function so we can use our data from the previous function.\n var results = []; // create a var to store password\n var userPossibleChars = []; // array to store the types of characters to include in our password\n // var guarChar = []; // array to contain atleast one of each chosen type of characters to make sure atleast one of every char is being used (validation)\n\n // create conditional statements that add the array of characters into an array of possible characters based on our users input\n // need to push new random characters to the guaranteed characters (look up .concat())\n if (userOptions.isSpecial) {\n userPossibleChars = userPossibleChars.concat(specialChar); //take chars and concat\n console.log(\"specialChar added to userPossibleChars \" + userPossibleChars);\n\n // take chars and push(randomizationfunction(specialChars) (after we randomize)\n } else {\n console.log(\"No special characters required\");\n }\n\n // create conditional statements that add the array of characters into an array of possible characters based on our users input\n // need to push new random characters to the guaranteed characters (look up .concat())\n if (userOptions.isNum) {\n userPossibleChars = userPossibleChars.concat(numChar);\n console.log(\"numChar added to userPossibleChars \" + userPossibleChars);\n } else {\n console.log(\"No number characters required\");\n }\n\n // create conditional statements that add the array of characters into an array of possible characters based on our users input\n // need to push new random characters to the guaranteed characters (look up .concat())\n if (userOptions.isLower) {\n userPossibleChars = userPossibleChars.concat(lowerChar);\n console.log(\"lowerChar added to userPossibleChars \" + userPossibleChars);\n } else {\n console.log(\"No lowercase characters required\");\n }\n // create conditional statements that add the array of characters into an array of possible characters based on our users input\n // need to push new random characters to the guaranteed characters (look up .concat())\n if (userOptions.isUpper) {\n userPossibleChars = userPossibleChars.concat(upperChar);\n console.log(\"upperChar added to userPossibleChars \" + userPossibleChars);\n } else {\n console.log(\"No uppercase characters required\");\n }\n\n // create another for loop to guarantee atleast one character from each possible characters in the result\n if(userOptions.isSpecial){\n results.push(randomizer(specialChar));\n } else if(userOptions.isNum){\n results.push(randomizer(numChar));\n } else if(userOptions.isLower){\n results.push(randomizer(lowerChar));\n }else if(userOptions.isUpper){\n results.push(randomizer(upperChar));\n }\n\n if(results.length == userOptions.passLength){\n this.passwordValue = results.join('');\n } else{\n var iterateLength = (parseInt(userOptions.passLength) - results.length); \n // create a for loop to pluck out random options object and grabing random characters from the array of possible characters and concat them into the results variable\n for(var i = 0 ; i < iterateLength; i++){ \n results.push(randomizer(userPossibleChars));\n }\n\n if(results.length == userOptions.passLength){\n console.log(results.join(''));\n this.passwordValue = results.join('');\n } else{\n return 'You made a mistake!';\n }\n } \n\ndocument.getElementById(\"password\").value = this.passwordValue; \n}", "title": "" }, { "docid": "1ca65a13309709e441ae074c0a67ee94", "score": "0.6898879", "text": "function generatePassword () {\n\n // Prompt user's preference of character length\n selectCharLength = parseInt(prompt(\"How long would you like your password to be? Please select between 8 and 128.\"));\n\n // Validate user's input to be between 8 and 128 characters\n while (!selectCharLength || selectCharLength < 8 || selectCharLength > 128) {\n alert(\"You need to provide a valid answer, please try again!\");\n selectCharLength = parseInt(prompt(\"Please select between 8 and 128.\"));\n };\n\n // Prompt user's character preferences\n if (selectCharLength) {\n acceptUppercase = confirm(\"Should the password include Uppercase characters?\");\n acceptLowercase = confirm(\"Should the password include Lowercase characters?\");\n acceptNumbers = confirm(\"Should the password include Numbers?\");\n acceptSpecialChar = confirm(\"Should the password include Special characters?\");\n };\n // Validate user's selection to include at least one choice\n if (!acceptUppercase && !acceptLowercase && !acceptNumbers && !acceptSpecialChar) {\n selection = alert(\"You must choose at least one character type! Please try again.\");\n }\n // Get result from the selection\n else if (acceptUppercase && acceptLowercase && acceptNumbers && acceptSpecialChar) {\n selection = upperCase.concat(lowercase, specialCharacters, numbers);\n }\n else if (acceptUppercase && acceptLowercase && acceptNumbers) {\n selection = upperCase.concat(lowercase, numbers);\n }\n else if (acceptUppercase && acceptLowercase && specialCharacters) {\n selection = upperCase.concat(lowercase, specialCharacters);\n }\n else if (acceptUppercase && acceptNumbers && specialCharacters) {\n selection = upperCase.concat(numbers, specialCharacters);\n }\n else if (acceptLowercase && acceptNumbers && specialCharacters) {\n selection = lowercase.concat(numbers, specialCharacters);\n }\n else if (acceptUppercase && acceptLowercase) {\n selection = upperCase.concat(lowercase);\n }\n else if (acceptUppercase && specialCharacters) {\n selection = upperCase.concat(specialCharacters);\n }\n else if (acceptUppercase && acceptNumbers) {\n selection = upperCase.concat(numbers);\n }\n else if (acceptLowercase && acceptNumbers) {\n selection = lowercase.concat(numbers);\n }\n else if (acceptLowercase && specialCharacters) {\n selection = lowercase.concat(specialCharacters);\n }\n else if (acceptNumeric && specialCharacters) {\n selection = numbers.concat(specialCharacters);\n }\n else if (acceptUppercase) {\n selection = upperCase;\n }\n else if (acceptLowercase) {\n selection = lowercase;\n }\n else if (specialCharacters) {\n selection = specialCharacters;\n }\n else if (acceptNumbers) {\n selection = numbers;\n };\n\n // Pass through the selection result\n var combinePassword = []\n // Scramble user's selection(s) then convert to string\n for (let i = 0; i < selectCharLength; i++) {\n var charCode = selection[Math.floor(Math.random() * selection.length)]\n combinePassword.push(String.fromCharCode(charCode));\n }\n // Combine user selection(s) together\n return combinePassword.join('');\n}", "title": "" }, { "docid": "61378694c7a06c32d1afddd458bb2b58", "score": "0.6888627", "text": "function generatePassword() {\n var options = getPasswordOptions();\n// Variable to store password\n var result = [];\n \n// Array to store possible types of characters to include in password\n var possibleChar = [];\n \n// Array to contain one of each type of chosen character, forcing utilization of at least one of each chosen type\n var guaranteedChar = [];\n \n// Conditional statement that adds array of special characters and adds guaranteed character based on user input\n if (options.hasSpecialChar) {\n possibleChar = possibleChar.concat(specialChar);\n guaranteedChar.push(getRandom(specialChar));\n }\n \n// Conditional statement that adds array of numeric characters and adds guaranteed character based on user input\n if (options.hasNumeric) {\n possibleChar = possibleChar.concat(numeric);\n guaranteedChar.push(getRandom(numeric));\n }\n \n// Conditional statement that adds array of lowercase characters and adds guaranteed character based on user input\n if (options.hasLowerCase) {\n possibleChar = possibleChar.concat(lowerCase);\n guaranteedChar.push(getRandom(lowerCase));\n }\n \n// Conditional statement that adds array of uppercase characters and adds guaranteed character based on user input\n if (options.hasUpperCase) {\n possibleChar = possibleChar.concat(upperCase);\n guaranteedChar.push(getRandom(upperCase));\n }\n \n// For loop to iterate password length from the options object, selecting random characters from the array of possibilities and concatenating those into the result variable\n for (var i = 0; i < options.passLength; i++) {\n var possibleChar = getRandom(possibleChar);\n \n result.push(possibleChar);\n }\n \n// Mix in at least one of each guaranteed character in result\n for (var i = 0; i < guaranteedChar.passLength; i++) {\n result[i] = guaranteedChar[i];\n }\n \n// Transform the result into a string and display\n return result.join('');\n}", "title": "" }, { "docid": "405f2ad0dfa4ce09a5325011a3271c73", "score": "0.68826497", "text": "function generatePassword(){\n var password = \"\";\n\n var allUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var allLower = \"abcdefghijklmnopqrstuvwxyz\";\n var allNum = \"012345678901234567890123456789\"; //Increased frequency of numbers.\n var allSpec = \"!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\";\n var allCandidate = \"\";\n\n // Set candidate characters based off of criteria.\n if (useUpper) allCandidate += allUpper; \n if (useLower) allCandidate += allLower; \n if (useNum) allCandidate += allNum;\n if (useSpec) allCandidate += allSpec;\n\n console.log(\"allCandidate = \" + allCandidate);\n\n // Select random character from candidate's until passLength is met.\n for (var i = 0; i < passLength; i++)\n password += allCandidate.charAt(Math.floor(Math.random() * allCandidate.length));\n\n return password;\n}", "title": "" }, { "docid": "c80f054659bab1e7a2a838a1219e0392", "score": "0.68813694", "text": "function generatePassword() {\n\n //Bring in user's password length selection from verifyLength() function\n var pwdLength = verifyLength();\n \n //If statements to prompt user for password criteria\n var confirmLower = window.confirm(\"Would you like your password to contain lower case letters?\");\n if (confirmLower) {\n pwdCharacters += lowerCase\n console.log(\"User would like lower case letters. Current available characters are: \" + pwdCharacters);\n window.alert(\"👍🏼 Lower case letters will be added to your password recipe.\");\n } else {\n window.alert(\"Ok. Lower case letters will be omitted from your password recipe.\");\n }\n\n var confirmUpper = window.confirm(\"Would you like your password to contain upper case letters?\");\n if (confirmUpper) {\n pwdCharacters += upperCase\n console.log(\"User would like upper case letters. Current available characters are: \" + pwdCharacters);\n window.alert(\"👍🏼 Upper case letters will be added to your password recipe.\");\n } else {\n window.alert(\"Ok. Upper case letters will be omitted from your password recipe.\");\n }\n\n var confirmNumber = window.confirm(\"Would you like your password to contain numbers?\");\n if (confirmNumber) {\n pwdCharacters += numbers\n console.log(\"User would like numbers. Current available characters are: \" + pwdCharacters);\n window.alert(\"👍🏼 Numbers will be added to your password recipe.\");\n } else {\n window.alert(\"Ok. Numbers will be omitted from your password recipe.\");\n }\n\n var confirmSpChar = window.confirm(\"Would you like your password to contain special characters?\");\n if (confirmSpChar) {\n pwdCharacters += spCharacters\n console.log(\"User would like special characters. Current available characters are: \" + pwdCharacters);\n window.alert(\"👍🏼 Special characters will be added to your password recipe.\");\n } else {\n window.alert(\"Ok. Special characters will be omitted from your password recipe.\");\n }\n \n // If statement to ensure user accepts at least one criteria\n if (confirmLower === false && confirmUpper === false && confirmNumber === false && confirmSpChar === false) {\n window.alert(\"You must accept at least one of the available password criteria to generate a password.\");\n return generatePassword();\n }\n \n //For loop to iterate across pwdCharacters string and generate password of desired length\n var password = \"\";\n for (i=0; i < pwdLength; i++) {\n //for each iteration, generate a random number and multiply by # of \"available\" characters\n var randomChar = Math.floor(Math.random() * pwdCharacters.length);\n password += pwdCharacters.charAt(randomChar);\n console.log(\"In progress password is: \" + password);\n }\n console.log(\"Full randomly generated password is: \" + password);\n return password;\n \n}", "title": "" }, { "docid": "946dee78ad67a44ce76d0126658c2ff5", "score": "0.68726623", "text": "function generatePassword() {\n //Create arrays for each possible character type\n const upper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n const lower = \"abcdefghijklmnopqrstuvwxyz\";\n const numbers = \"0123456789\";\n const special = \"#$%;&'()*+,-./:;<=>?@[\\]^_`{|}~\";\n\n // var password = (' ');\n\n //Keep prompting user if length is not between 8 and 128\n do {\n var length = prompt(\"Enter length of password between 8 and 128\");\n } while ((length < 8) || (length > 128));\n\n //Keep prompting user if at least one character type is not chosen\n do {\n var cnfrmupper = confirm(\"Would you like upper case in password?\");\n var cnfrmlower = confirm(\"Would you like lower case in password?\");\n var cnfrmnumbers = confirm(\"Would you like numbers in password?\");\n var cnfrmspecial = confirm(\"Would you like special characters in password?\");\n var pwdChars = [];\n } while ((cnfrmupper === false) && (cnfrmlower === false) && (cnfrmlower === false) && (cnfrmspecial === false));\n\n //Append array given user choices from confirms above\n if(cnfrmupper) {\n pwdChars = [...pwdChars,...upper];\n };\n if(cnfrmlower) {\n pwdChars = [...pwdChars,...lower];\n };\n if(cnfrmnumbers) {\n pwdChars = [...pwdChars,...numbers];\n }; \n if(cnfrmspecial) {\n pwdChars = [...pwdChars,...special];\n };\n // console.log(pwdChars);\n \n //Build password given length chosen and random pick of character type array\n for (i = 0; i < (length-1); i++) {\t\t\n var randomNumber = Math.floor(Math.random() * (pwdChars.length-1));\n console.log(randomNumber);\n var randomPick = pwdChars[randomNumber];\n // console.log(randomPick);\n password = password + randomPick;\n // console.log(randomPick);\n }; \n }", "title": "" }, { "docid": "3e1285fb7f321277e6390def68779693", "score": "0.68676555", "text": "function generatePassword() {\n //.split makes each character a string and puts them into an array. An array is being built. The first index is [0]\n var upperCase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\n var lowerCase = \"abcdefghijklmnopqrstuvwxyz\".split(\"\");\n var specialChars = \"~!@#$%^&*()_+\".split(\"\");\n var numberVals = \"1234567890\".split(\"\");\n //bolean values to determine which chars will be utilized\n var useUpperCase;\n var useLowerCase;\n var useSpecialChars;\n var useNumberVals;\n // WHEN prompted for password criteria\n // THEN I select which criteria to include in the password\n\n // WHEN prompted for the length of the password\n // THEN I choose a length of at least 8 characters and no more than 128 characters\n\n var passwordLength = prompt(\n \"How many characters would you like to include for your password?\"\n ).trim();\n if (passwordLength > 7 && passwordLength < 129) {\n // WHEN prompted for character types to include in the password\n // THEN I choose lowercase, uppercase, numeric, and/or special characters\n useUpperCase = confirm(\"Would you like to include uppercase characters?\");\n useLowerCase = confirm(\"Would you like to include lowercase characters?\");\n useSpecialChars = confirm(\"Would you like to incldue special characters?\");\n useNumberVals = confirm(\"Would you like to include numeric characters?\");\n } else {\n alert(\n \"Invalid password length entered. Please enter a password between 8-128 characters\"\n );\n generatePassword();\n }\n if (useUpperCase || useLowerCase || useSpecialChars || useNumberVals) {\n alert(\"Preferences are now set. Your password will be generated now.\");\n } else {\n alert(\n \"Please select at least one character value to generate your password\"\n );\n generatePassword();\n }\n var charsToUse = [];\n for (let i = 0; i < passwordLength; i++) {\n if (useUpperCase) {\n charsToUse.push(upperCase[Math.floor(Math.random() * upperCase.length +1)]);\n }\n if (useLowerCase) {\n charsToUse.push(lowerCase[Math.floor(Math.random() * lowerCase.length +1)]);\n }\n if (useSpecialChars) {\n charsToUse.push(\n specialChars[Math.floor(Math.random() * specialChars.length +1)]\n );\n }\n if (useNumberVals) {\n charsToUse.push(\n numberVals[Math.floor(Math.random() * numberVals.length +1)]\n );\n }\n }\n console.log(charsToUse);\n // final password array\n \n var finalPassword = [];\n for (let i = 0; i < passwordLength; i++) {\n finalPassword.push(\n charsToUse[Math.floor(Math.random() * charsToUse.length)]\n );\n }\n return finalPassword.join(\"\");\n}", "title": "" }, { "docid": "37bf4025a99ee73c09c0c48eab65c165", "score": "0.68650496", "text": "function generatePassword() {\n let passwordLength = chooseLength();\n let useUpperCase = false;\n let useLowerCase = false;\n let useSpecialCharacters = false;\n let useNumbers = false;\n while (!useUpperCase && !useLowerCase && !useSpecialCharacters && !useNumbers) {\n window.alert(\"You must choose at least one of the following types of characters to use in your password.\");\n useUpperCase = upperCasePrompt();\n useLowerCase = lowerCasePrompt();\n useSpecialCharacters = specialCharactersPrompt();\n useNumbers = numbersPrompt();\n }\n\n // Making an array based on what the user picked\n let choices = [];\n if (useUpperCase) {\n choices = choices.concat(upperCaseLetters);\n }\n if (useLowerCase) {\n choices = choices.concat(lowerCaseLetters);\n }\n if (useSpecialCharacters) {\n choices = choices.concat(specialCharacters);\n }\n if (useNumbers) {\n choices = choices.concat(numberCharacters);\n }\n\n // Generate password of appropriate length using choices\n let password = \"\";\n for (let i = 0; i < passwordLength; i++) {\n let index = Math.floor(Math.random() * choices.length);\n let choice = choices[index];\n password += choice;\n }\n\n return password;\n}", "title": "" }, { "docid": "8be3378d28849d392a076f96f2a4d360", "score": "0.6863132", "text": "function generatePassword() {\n // Define length of the password as equal to the number entered by the user between 8 and 128 inclusive\n var length = prompt(\n \"How many characters would you like in your password? (8 - 128)\"\n );\n // Error message if user enters a number less than 8, more than 128, or not a number\n if (length < 8 || length > 128 || isNaN(length)) {\n alert(\"Please enter number between 8 and 128\");\n // Dialog box asking again\n var length = prompt(\n \"How many characters would you like in your password? (8 - 128)\"\n );\n // Dialog boxes asking what kinds of symbols to use\n var confirmUpper = confirm(\"Use uppercase?\");\n var confirmLower = confirm(\"Use lowercase?\");\n var confirmNumbers = confirm(\"Use numbers?\");\n var confirmSymbols = confirm(\"Use symbols?\");\n }\n // Confirm that user confirmed at least one option\n while (!confirmUpper && !confirmLower && !confirmNumbers && !confirmSymbols) {\n alert(\"Please select one or more character types.\");\n var confirmUpper = confirm(\"Use uppercase?\");\n var confirmLower = confirm(\"Use lowercase?\");\n var confirmNumbers = confirm(\"Use numbers?\");\n var confirmSymbols = confirm(\"Use symbols?\");\n }\n // Define all possible characters in password\n var passChar = [];\n var upper = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n ];\n var lower = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n ];\n var numbers = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"];\n var symbols = [\"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"-\", \"_\", \"?\"];\n\n // If statements to string symbols together (or \"concatenate\" them)\n\n if (confirmSymbols) {\n passChar = passChar.concat(upper);\n }\n if (confirmLower) {\n passChar = passChar.concat(lower);\n }\n if (confirmNumbers) {\n passChar = passChar.concat(numbers);\n }\n if (confirmSymbols) {\n passChar = passChar.concat(symbols);\n }\n\n // Define random password and make for loop to pull characters a number of times equal to the length\n\n var rPassword = \"\";\n for (var i = 0; i < length; i++) {\n rPassword =\n rPassword + passChar[Math.floor(Math.random() * passChar.length)];\n }\n return rPassword;\n}", "title": "" }, { "docid": "0197ffeac69670f614e20f89629a87a5", "score": "0.68582886", "text": "function generatePassword(pLength) {\n var password = ' '; //this variable expects some value to it\n var characters = ' '; //empty string, but as the user confirms the following vars then will generate a new string \n\n var pLength = prompt(\"How many characters would you like your password? 8 characters min - 128 characters max.\");\n\n \n if (pLength < 8 || pLength > 128) {\n prompt(\"Password must be 8 - 128 characters. Try Again.\"); //Ensures that user only uses the numbers requested\n\n };\n\n var isUpperCase = confirm(\"Do you want it to contain any upper case letters?\");\n \n //if user confirms uppercase letters, this will ensure that Upper case letters gets added into the characters string\n if(isUpperCase === true) {\n characters+= upperLetters;\n };\n\n var symbolEl = confirm(\"Would you like to include a symbol?\");\n\n //if user confirms symbols, this will ensure that symbols gets added into the characters string\n if(symbolEl === true) {\n characters+= symbol; \n };\n\n var numberEl = confirm(\"Would you like to include numbers?\");\n \n //if user confirms numbers, this will ensure that numbers gets added into the characters string\n if(numberEl === true) {\n characters+= number;\n };\n \n //if user confirms lower case letters, this will ensure that lower case letters gets added into the characters string\n var isLowerCase = confirm(\"Would you like to include lower case letters?\");\n\n if(isLowerCase === true) {\n characters+= lowerLetters;\n };\n\n if(symbolEl !==true && isUpperCase !== true && numberEl !== true && isLowerCase !==true) {\n confirm(\"You must choose at least one of the criteria's prompted in order to generate password. Please try again.\")\n };\n\n //for loop generates password with included add-ons to character string and limiting to the length requested\nfor(var i=0; i < pLength; i++){\n password += characters.charAt(Math.floor(Math.random() * characters.length));\n};\n\nreturn password;\n\n}", "title": "" }, { "docid": "88793d504ecd1a88d4a6bc624a05531a", "score": "0.6851903", "text": "function generatePassword(){\n var password = \"\";\n characterChoice = [];\n passwordLength = parseInt(window.prompt(\"How many characters? (8-128)\"));\n if(isNaN(passwordLength) || passwordLength < 8 || passwordLength > 128){\n window.alert(\"Must be a number between 8 and 128\");\n return false;\n }\n var includeUpper = window.confirm(\"Should it include uppercase letters?\");\n if(includeUpper){\n characterChoice = characterChoice.concat(upperLetters);\n }\n var includeLower = window.confirm(\"Should it include lowercase letters?\");\n if(includeLower){\n characterChoice = characterChoice.concat(lowerLetters);\n }\n var includeNumbers = window.confirm(\"Should it include numbers?\");\n if(includeNumbers){\n characterChoice = characterChoice.concat(numbers);\n }\n var includeSpecial = window.confirm(\"Should it include special characters?\");\n if(includeSpecial){\n characterChoice = characterChoice.concat(specialCharacters);\n }\n for(var i = 0; i < passwordLength.lenght; i++){\n var randomCharacter = Math.floor(Math.random() * passwordLength.length);\n password = characterChoice[randomCharacter];\n }\n return password;\n}", "title": "" }, { "docid": "c9e51a507f55a084d1616e6ba805fb47", "score": "0.68511426", "text": "function generatePassword(){\n var characters = \"\";\n var charCount;\n\n // Error handling when choosing number of characters\n do {\n charCount = prompt(\"How long do you want the password to be? MUST BE AT LEAST 8 CHARACTERS AND NO MORE THAN 128 CHARACTERS \");\n }\n while (charCount < 8 || charCount > 128 || isNaN(charCount));\n\n\n // Loops that add strings of letters, characters, and numbers to empty string 'characters'\n if (confirm(\"Do you want special characters? \")) {\n characters += \"!@#$%&?\";\n }\n\n if (confirm(\"Do you want capital letters? \")) {\n characters += \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n }\n\n if(confirm(\"Do you want lower case letters? \")) {\n characters += \"abcdefghijklmnopqrstuvwxyz\";\n }\n\n if (confirm(\"Do you want numbers? \")) {\n characters += \"1234567890\";\n }\n\n\n // Loop that adds random figures from updated characters list to a new list 'password'\n var password = \"\";\n\n for (var i = 0; i < charCount; i++) {\n var randNum = Math.floor(Math.random() * characters.length);\n password += characters.charAt(randNum);\n }\n return password;\n}", "title": "" }, { "docid": "4651b757d5a82cbd3af9b9c4c35d9731", "score": "0.68449086", "text": "function generatePassword() {\n //Takes user input to get character amount\n var charAmount = parseInt(prompt(\"Enter how many characters you want your password to contain (8-128 characters)\"));\n\n var passwordString = \"\";\n var possibleCharacters = \"\";\n var requiredCharacters = \"\";\n\n\n if (charAmount < 8 || charAmount > 128) {\n alert(\"Please choose a number between 8 and 128\")\n } else {\n //Determine if user wants to use lowercase letters\n var lowerConfirm = confirm(\"Do you want to include lowercase letters in your password?\");\n\n //Determine if user wants to use uppercase letters\n var upperConfirm = confirm(\"Do you want to inclue uppercase letters in your password?\");\n\n //Determine if user wants to use numbers\n var numberConfirm = confirm(\"Do you want to include numbers in your password?\");\n\n //Determine if user wants to use special characters\n var specialConfirm = confirm(\"Do you want to include special characters in your password?\");\n if (lowerConfirm || upperConfirm || numberConfirm || specialConfirm) {\n\n\n //Use user inputs to determine which character types are in password\n if (lowerConfirm) {\n possibleCharacters += lowercaseLetters;\n requiredCharacters += lowercaseLetters[Math.floor(Math.random() * lowercaseLetters.length)];\n }\n\n if (upperConfirm) {\n possibleCharacters += uppercaseLetters;\n requiredCharacters += uppercaseLetters[Math.floor(Math.random() * uppercaseLetters.length)];\n }\n\n if (numberConfirm) {\n possibleCharacters += numbers;\n requiredCharacters += numbers[Math.floor(Math.random() * numbers.length)];\n }\n\n if (specialConfirm) {\n possibleCharacters += specialCharacters;\n requiredCharacters += specialCharacters[Math.floor(Math.random() * specialCharacters.length)];\n }\n\n //Loop to grab random characters from chosen character types and will stop at chosen password lenth\n for (var i = 0; i < charAmount; i++) {\n var randomIndex = Math.floor(Math.random() * possibleCharacters.length);\n possibleCharacters[randomIndex];\n passwordString += possibleCharacters[randomIndex];\n }\n } else {\n alert(\"Please choose a valid option.\");\n return \"\";\n }\n }\n\n return passwordString.substr(requiredCharacters.length) + requiredCharacters;\n}", "title": "" }, { "docid": "bb2b91147e35b63c8353cae5ab8dc554", "score": "0.68322295", "text": "function generatePassword() {\n var confirmLength = (prompt(\"How many characters would you like your password to contain?\"));\n\n while(confirmLength < 8 || confirmLength > 50) {\n alert(\"Password must be between 8-50 characters. Please re-enter a password length.\");\n var conirmLength = (prompt(\"How many characters would you like your password to contain?\"));\n } \n\n// Ask user what character types they would like to have in their password\n\n var confirmSpecial = confirm(\"Click OK if you would like to include special characters\");\n var confirmNumeric = confirm(\"Click OK if you would like to include numeric characters\"); \n var confirmLower = confirm(\"Click OK if you would like to include lowercase characters\");\n var confirmUpper = confirm(\"Click OK if you would like to include uppercase characters\");\n\n while(confirmUpper === false && confirmLower === false && confirmSpecial\n === false && confirmNumeric === false) {\n alert(\"Error: You must choose at least one parameter\");\n var confirmSpecial = confirm(\"Click OK if you would like to include special characters\");\n var confirmNumeric = confirm(\"Click OK if you would like to include numeric characters\"); \n var confirmLower = confirm(\"Click OK if you would like to include lowercase characters\");\n var confirmUpper = confirm(\"Click OK if you would like to include uppercase characters\"); \n } \n\n// Assign actions to character type variables\n var passwordCharacters = []\n \n if (confirmSpecial) {\n passwordCharacters = passwordCharacters.concat(charSpecial)\n }\n\n if (confirmNumeric) {\n passwordCharacters = passwordCharacters.concat(charNumeric)\n }\n \n if (confirmLower) {\n passwordCharacters = passwordCharacters.concat(charLower)\n }\n\n if (confirmUpper) {\n passwordCharacters = passwordCharacters.concat(charUpper)\n }\n\n console.log(passwordCharacters)\n\n// Random selection of password characters\n\n var randomPassword = \"\"\n \n for (var i = 0; i < confirmLength; i++) {\n randomPassword = randomPassword + passwordCharacters[Math.floor(Math.random() * passwordCharacters.length)];\n console.log(randomPassword)\n }\n return randomPassword;\n}", "title": "" }, { "docid": "b60037141412a0b3ad95cf35d8ab1fda", "score": "0.6827136", "text": "function generatePassword(){\n var passwordLength = prompt(\"How many characters would you like your password to contain? (Choose a number between 8 and 128)\");\n \n if (isNaN(passwordLength)) {\n alert(\"Please input a number!\");\n return;\n }\n \n else {\n passwordLength = parseInt(passwordLength, 10);\n };\n \n // if an input other than a number between 8-128 is entered, alert user and ask prompt again\n while (passwordLength < 8 || passwordLength > 128) {\n alert(\"Please choose between 8-128 characters!\");\n passwordLength = prompt(\"How many characters would you like your password to contain? (Choose a number between 8 and 128)\");\n passwordLength = parseInt(passwordLength, 10);\n };\n\n // when the password length is chosen, then ask what kind of criteria is needed\n alert(\"You will be shown four criteria that may be applied to the password. Please select at least one.\");\n // ask if lowercase should be included\n var lowerCharInput = confirm(\"1. Would you like lowercase characters to be included?\");\n // ask if uppercase should be included\n var upperCharInput = confirm(\"2. Would you like uppercase characters to be included?\");\n // ask if numbers should be included\n var numberCharInput = confirm(\"3. Would you like number characters to be included?\");\n // ask if special characters should be included\n var specialCharInput = confirm(\"4. Would you like special characters to be included?\");\n\n //confirm that at least one of the criteria above is selected; if not, go through the prompts again\n while (lowerCharInput === false && upperCharInput === false && numberCharInput === false && specialCharInput === false) {\n alert(\"Please choose at least one criteria to be applied to the password.\")\n lowerCharInput = confirm(\"1. Would you like lowercase characters to be included?\");\n upperCharInput = confirm(\"2. Would you like uppercase characters to be included?\");\n numberCharInput = confirm(\"3. Would you like number characters to be included?\");\n specialCharInput = confirm(\"4. Would you like special characters to be included?\");\n };\n\n // once at least one criteria is selected, start to generate password\n // array that will hold the selected characters for generating the password\n var selectedPasswordChar = [];\n\n // pulls the selected criteria characters and adds them to the array\n if (lowerCharInput === true) {\n selectedPasswordChar.push(...allPasswordCharacters.lowerCharArray);\n };\n\n if (upperCharInput === true) {\n selectedPasswordChar.push(...allPasswordCharacters.upperCharArray);\n };\n\n if (numberCharInput === true) {\n selectedPasswordChar.push(...allPasswordCharacters.numberCharArray);\n };\n\n if (specialCharInput === true) {\n selectedPasswordChar.push(...allPasswordCharacters.specialCharArray);\n };\n\n // holds the generated password\n var passwordArray = [];\n\n // loops through the selected characters based on the length of the password selected\n for (var i = 0; i < passwordLength; i++) {\n\n // randomly select a number based on the length of the array\n var randomChar = Math.floor(Math.random() * selectedPasswordChar.length);\n\n // takes the randomly selected number, looks up that index in the characters that were selected, takes the item in that index and pushes it into the password variable\n passwordArray.push(selectedPasswordChar[randomChar][0]);\n };\n var finalPassword = passwordArray.join(\"\");\n \n // returns generated password into the write password function to display on page\n return(finalPassword);\n}", "title": "" }, { "docid": "5816bee88c760cf35d43bb105ff44cca", "score": "0.6810494", "text": "function generatePassword() {\n var password = \"\";\n var options = getPasswordOptions();\n console.log(options);\n// object for available characters to input into password\n var availableCharacterTypes = [\n specialCharacters,\n numericCharacters,\n lowerCaseCharacters,\n upperCaseCharacters\n ];\n // available character types & filling in open variable\n var availableCharacterTypes = [];\n if (specialCharacters) {\n for (var i = 0; i < specialCharacters.length; i++);\n { availableCharacterTypes += specialCharacters;\n }\n }\n if (options.upperCaseCharacters) {\n for (var i = 0; i < upperCaseCharacters.length; i++);\n { availableCharacterTypes += upperCaseCharacters;\n }\n }\n if (options.lowerCaseCharacters) {\n for (var i = 0; i < lowerCaseCharacters.length; i++);\n {\n availableCharacterTypes += lowerCaseCharacters;\n }\n }\n if (options.numericCharacters) {\n for (var i = 0; i < numericCharacters.length; i++);\n {\n availableCharacterTypes += numericCharacters;\n }\n }\n\n for (var i = 0; i <= options.length; i++) {\n password += getRandomElementfromArray(availableCharacterTypes);\n };\n return password;\n}", "title": "" }, { "docid": "5a5c1dac23d227cfaea47f7d4d37b34b", "score": "0.67932063", "text": "function getCharacters() {\n var characters = '';\n\n // get user choices\n var addLow = confirm(`Would you like to include lowercase letters?\n \n choose 'OK' for yes or 'Cancel' for no.`);\n var addUp = confirm(`Would you like to include uppercase letters?\n \n choose 'OK' for yes or 'Cancel' for no.`);\n var addNum = confirm(`Would you like to include numbers?\n \n choose 'OK' for yes or 'Cancel' for no.`);\n var addChar = confirm(`Would you like to include special characters?\n \n choose 'OK' for yes or 'Cancel' for no.`);\n\n // add characters based on user choices\n if (addLow === true){\n characters += lower;\n }\n if (addUp === true){\n characters += upper;\n }\n if (addNum === true){\n characters += numeric;\n }\n if (addChar === true){\n characters += special;\n }\n\n // check to make sure there is at least one type of character\n while (characters.length == 0) {\n alert(\"Please choose at least one type of character to generate your password.\");\n characters = getCharacters();\n }\n return characters;\n}", "title": "" }, { "docid": "b397365e41353beff2b4c7e1c3295a29", "score": "0.67929345", "text": "function generatePassword () {\n\n var passLength = characters.characterlength();\n\n if (!passLength){\n return\n }\n var passLowcase = characters.lowercase();\n var passUppercase = characters.uppercase();\n var passNumber = characters.numbers();\n var passSymbol = characters.symbols ();\n var pass = \"\";\n var it = \"\";\n \n for (var i = 0; i < passLength; i++) { \n if ( passLowcase == true && it != passLength ) {\n var lcase = getLower();\n pass += lcase;\n it++;\n }\n if ( passUppercase == true && it != passLength) {\n var Ucase = getUpper();\n pass += Ucase;\n it++;\n }\n if ( passNumber == true && it != passLength) {\n var Ncase = getNumber();\n pass += Ncase;\n it++;\n }\n if ( passSymbol == true && it != passLength) {\n var Scase = getSymbol();\n pass += Scase;\n it++;\n }\n}\nreturn pass\n}", "title": "" }, { "docid": "14e8094637777731660e6243613975ea", "score": "0.6792417", "text": "function generatePassword() {\n var passwordCharacters = \"\";\n var passwordLength = \"\";\n\n // set all criteria's to false until user says true\n var lowerCaseOption = false,\n upperCaseOption = false,\n numericOption = false,\n specialCharactersOption = false;\n\n // ask users the length of password\n passwordLength = prompt(\n \"Please enter the length of the password, must be between 8 and 128\"\n );\n\n // verify password length\n if (passwordLength >= 8 && passwordLength <= 128) {\n // prompt that asks user the way they would to have their passwords generated\n lowerCaseOption = confirm(\"Do you want lowercase letters?\");\n upperCaseOption = confirm(\"Do you want uppercase letters?\");\n numericOption = confirm(\"Do you want numbers?\");\n specialCharactersOption = confirm(\"Do you want special characters?\");\n\n // confirm at least one chacter type has been chosen\n if (\n lowerCaseOption ||\n upperCaseOption ||\n numericOption ||\n specialCharactersOption\n ) {\n return passwordCharacters = buildPassword(passwordLength, [lowerCaseOption, upperCaseOption, numericOption, specialCharactersOption]);\n\n } else {\n // if not, let user know to select one\n alert(\"You need to pick at least one character type.\");\n }\n } else {\n // let user know their selection is invalid\n alert(\"Invalid password length.\");\n }\n}", "title": "" }, { "docid": "4773e0a9ec2114b809b7abd17ed6e0b5", "score": "0.67908263", "text": "function generatePassword() {\n // request number of characters needed for the password. Only allow between 8 and 128 characters\n var numChar = parseInt(\n prompt(\n \"How many characters are in this password? Please select between 8 and 128.\"\n )\n );\n // verify a valid number was entered\n while (numChar < 8 || numChar > 128 || isNaN(numChar)) {\n console.log(\"Number of characters selected is: \" + numChar);\n if (isNaN(numChar)) {\n numChar = parseInt(\n prompt(\n \"A number was not entered. Please enter a number within 8 and 128 again\"\n )\n );\n } else if (numChar > 8 || numChar < 128) {\n numChar = parseInt(\n prompt(\n \"The number \" +\n numChar +\n \" is not within 8 and 128. Please enter again\"\n )\n );\n }\n }\n\n //confirm all values are false so if the user wants to generate a new password they need to confirm the characters used again\n for (h = 0; h < charactersAvailable.length; h++) {\n charactersAvailable[h].value = false;\n }\n\n //while every charactersAvailable value is false then loop\n while (charactersAvailable.every((element) => element.value === false)) {\n //request for each character type to be used\n for (i = 0; i < charactersAvailable.length; i++) {\n charactersAvailable[i].value = confirm(\n \"Do you want \" + charactersAvailable[i].ch + \" used?\"\n );\n console.log(charactersAvailable[i]);\n }\n // if user does not select any characters then start over at lowercase request\n if (charactersAvailable.every((element) => element.value === false)) {\n alert(\n \"You must select at least one character type to be in the password. Please try again.\"\n );\n }\n }\n\n generatePass = \"\";\n // rewrite characters available object to a characters used object\n for (j = 0; j < charactersAvailable.length; j++) {\n if (charactersAvailable[j].value === true) {\n charactersUsed.push(charactersAvailable[j]);\n }\n }\n console.log(charactersUsed);\n\n //generate password\n for (k = 0; k < numChar; k++) {\n //Randomly select character type\n var l = Math.floor(Math.random() * charactersUsed.length);\n console.log(\"l: \" + l + \", char type: \" + charactersUsed[l].ch);\n\n //Get the character from randomly generated ASCII\n var randChar = String.fromCharCode(\n Math.floor(\n Math.random() * (charactersUsed[l].max - charactersUsed[l].min + 1) +\n charactersUsed[l].min\n )\n );\n console.log(\"randChar: \" + randChar);\n //push character to the password\n generatePass = generatePass.concat(randChar);\n console.log(generatePass);\n }\n\n return generatePass;\n}", "title": "" }, { "docid": "ca62c31d65edc675d855eed36db1a084", "score": "0.6778324", "text": "function generatePassword() {\n user_chars = \"\";\n var password_char_ct = getPasswordCharCt(); \n\n if (password_char_ct != null)\n var password_char_types = getPasswordCharTypes();\n\n var password = \"\";\n for (var i=0; i<password_char_ct; i++)\n {\n //Generate password from the user choice of characters list\n\n password += user_chars.charAt(Math. floor(Math. random() * user_chars.length));\n }\n\n return password;\n}", "title": "" }, { "docid": "33556107d8ca84cc9e7f453446be8f15", "score": "0.67700326", "text": "function generatePassword(){\r\n var passwordRules = prompt(\"how many characters woulds you like in your password?\");\r\n\r\n //check for validation \r\n if(isNaN(passwordRules)){\r\n alert(\"please enter a number between 8-128 long\");\r\n return;\r\n } else if(passwordRules < 8 || passwordRules > 128){\r\n alert(\"please enter a number between 8-128\");\r\n return;\r\n } else{ \r\n var includeLowerCase = confirm(\"Would you like the password to contain lower case letters?\");\r\n var includeUpCase = confirm(\"Would you like the password to contain upper case letters?\");\r\n var includeNumeric = confirm(\"Would you like the password to contain numberic values?\");\r\n var includeSpecial = confirm(\"Would you like the password to contain special characters?\");\r\n }\r\n\r\n var lowerCaseLetters = \"a b c d e f g h i j k l m n o p q r s t u v w u x y z\";\r\n var lowerCaseLettersArrey = lowerCaseLetters.split(\" \");\r\n console.log(lowerCaseLettersArrey);\r\n var upperCased = lowerCaseLetters.toUpperCase();\r\n var upperCasedArray = upperCased.split(\" \");\r\n console.log(upperCasedArray);\r\n var numbers = \"1 2 3 4 5 6 7 8 9\";\r\n var numberArray = numbers.split(\" \");\r\n console.log(numberArray);\r\n var specialCharacters = \"! @ # $ % & * _ - + = ( ) ? / > . < , ' ; : ] { [ }\";\r\n var specialCharactersArray = specialCharacters.split(\" \");\r\n console.log(specialCharactersArray);\r\n\r\n\r\n var mainArray = [];\r\n\r\n if(includeLowerCase) mainArray = mainArray.concat(lowerCaseLettersArrey);\r\n\r\n if(includeUpCase) mainArray = mainArray.concat(upperCasedArray);\r\n console.log(\"the total data set in our array is \" + mainArray);\r\n //if user picks nothing \r\n if(!includeLowerCase && !includeUpCase){\r\n alert(\"please pick one character type\");\r\n return;\r\n }\r\n if(includeNumeric) mainArray = mainArray.concat(numberArray);\r\n\r\n if(includeSpecial) mainArray = mainArray.concat(specialCharactersArray);\r\n\r\n var password = [];\r\n\r\n for (var i = 0; i < passwordRules; i++) {\r\n var char = mainArray[Math.floor(Math.random() * mainArray.length)];\r\n \r\n password += char;\r\n \r\n }\r\n console.log(\"the generated password is \" + password);\r\n return password;\r\n}", "title": "" }, { "docid": "a5c1ccd32e49278ffa078c8f91bb212f", "score": "0.67699593", "text": "function generatePassword(){\n\n let passwordLength = prompt(\"Enter a password that is the length of at least 8 characters and no more than 128 characters!\");\n let passwordUpperCase = confirm(\" Do you want to use uppercase?\")\n let passwordLowerCase = confirm(\" Do you want to use lowercase?\")\n let passwordNumbers = confirm(\" Do you want to use numbers?\")\n let passwordSpecialCharacters = confirm(\" Do you want to use specail characters?\")\n\n console.log(passwordLength, passwordLowerCase, passwordNumbers, passwordSpecialCharacters, passwordUpperCase)\n \n//Arry for alphabet, numbers and characters\nlet upperCase=[\"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\"]; \nlet lowerCase =[\"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\"];\nlet numbers =[\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\nlet specialCharacters =[\"!\", \"0\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\",\"*\", \"(\", \")\", \"_\", \"+\", \"=\", \"?\", \"<\", \">\"];\n\nif (passwordLength === true) {\n passwordUpperCase = confirm(\" Do you want to use uppercase?\");\n console.log (passwordUpperCase);\n let passwordLowerCase = confirm(\" Do you want to use lowercase?\");\n console.log (passwordLowerCase)\n let passwordNumbers = confirm(\" Do you want to use numbers?\");\n console.log(passwordNumbers)\n let passwordSpecialCharacters = confirm(\" Do you want to use specail characters?\");\n console.log(passwordSpecialCharacters)\n\n}\n //loops\n for (let i = 0; i < generatePassword; i++) {\n password=password +value.allChars(math.floor()*math.floor(value.length-1));\n \n }\n // Password is currently blank! We need to make a better one\n\n let password = \"\";\n \n return password;\n}", "title": "" }, { "docid": "6099a6314b7107a08040f5be770b8096", "score": "0.6769029", "text": "function getPasswordParameters() {\n let\n passwordLength,\n includesCharacters = false;\n\n console.group(\"Collecting password parameters:\");\n\n passwordLength = promptPasswordLength(minLength, maxLength);\n \n for (let set of characterSets) {\n set.include = confirmIncludeCharacters(set)\n includesCharacters = includesCharacters || set.include;\n }\n\n console.groupEnd();\n\n return {\n length: passwordLength,\n hasCharacters: includesCharacters\n }\n}", "title": "" }, { "docid": "0aaceaf44c04b29f2e35bbf06c61d980", "score": "0.67661124", "text": "function generatePassword() {\n\n\n // initialize a variable that will be used to randomly extract symbols from.\n var symbols;\n // set variable for the number of characters\n var num = \"not a number\";\n //Initialize a variable to store password\n var pass = \"\";\n \n\n\n\n //Start a while loop until some parameters are chosen\n while(symbols == null) {\n\n //ask the user if they want to use lower case letters\n if (confirm(\"Would you like to include lower case letters?\")) {\n\n symbols += lower;\n \n }\n //ask the user if they want to use upper case letters\n if (confirm(\"Would you like to include upper case letters?\")) {\n\n symbols += upper;\n \n }\n //ask the user if they want to use numbers\n if (confirm(\"Would you like to include numbers?\")) {\n\n symbols += numbers;\n \n }\n //ask the user if they want to use special characters\n if (confirm(\"Would you like to include special characters?\")) {\n\n symbols += special;\n \n }\n // If necessary prompts the user to pick something and restarts.\nif (symbols == null) {\n alert(\"You must choose at least one type of characters!\")};\n\n }\n\n\n //ask the usere how many characters should the password be\n //If the input doesn't match parameters, the prmpt is repeated.\n while (isNaN(num) || num < 8 || num > 128) {\n\n num = prompt(\"How many characters long should your password be? \\nEnter a number between 8 and 128:\");\n\n }\n\n //start a loop as long as the characters needed\n\n for(var x = 0; x < num; x++) {\n //create a variable to store a random number between 0 and the length of the number of usable characters.\n var randomNumber = Math.floor(Math.random() * symbols.length);\n //Add the character at the index randomly generated\n pass += symbols[randomNumber];\n\n }\n\n return pass;\n\n}", "title": "" }, { "docid": "8818a1393006dd09780ed4209ce77845", "score": "0.67651826", "text": "function generatePassword() {\n //ask for customized requirment for character types and password length\n var capConf = confirm(\"Do you want upper case letters in your password?\");\n var lowConf = confirm(\"Do you want lower case letters in your password?\");\n var numconf = confirm(\"Do you want numbers in your password?\");\n var spcConf = confirm(\"Do you want special characters in your password?\");\n var passLength = prompt(\"Please enter a password length between 8 and 128\");\n\n //for every criteria chosen, add that criteria's possible character string into newArray and keep track of number of criteria picked\n if (capConf === true) {\n newArray.push(passStrCap);\n requirmentCount++;\n }\n if (lowConf === true) {\n newArray.push(passStrLow);\n requirmentCount++;\n }\n if (numconf === true) {\n newArray.push(passStrNum);\n requirmentCount++;\n }\n if (spcConf === true) {\n newArray.push(passStrSpc);\n requirmentCount++;\n }\n //alert user is length exceed limit\n if (passLength < 8 || passLength > 128) {\n return alert(\"Must pick a length between 8 and 128\");\n }\n //alert user if none of the critera is picked\n if (\n capConf === false &&\n lowConf === false &&\n numconf === false &&\n spcConf === false\n ) {\n alert(\"Must pick at least one type of character for password\");\n }\n\n //generate new random password with newArray created above\n //go through chosen criteria by type\n for (var j = 0; j < requirmentCount; j++) {\n //divide total password length by number of criteria chosen to make sure each type of characters are about the same amount (if divisible)\n //if not divisible, only generate number of character till the last divisible length\n for (var i = 0; i < Math.floor(passLength / requirmentCount); i++) {\n //for each criteria, randomly pick a character from possible string in newArray\n var newLet = Math.floor(Math.random() * newArray[j].length);\n //add to newPass\n newPass += newArray[j].charAt(newLet);\n }\n }\n //if password length is no divisible, add reminder number of character from possible string\n if (passLength % requirmentCount != 0) {\n //calculate reminder\n var reminderChar = passLength % requirmentCount;\n //add reminder number of character to password\n for (var q = 0; q < reminderChar; q++) {\n //pick from chosen categories randomly\n var newRandArray = Math.floor(Math.random() * newArray.length);\n var newRand = Math.floor(Math.random() * newArray[newRandArray].length);\n //add to new password\n newPass += newArray[newRandArray].charAt(newRand);\n }\n }\n //change string to array for shuffling\n var shuffling = newPass.split(\"\");\n //call shuffle function below to shuffle all elements in array shuffling\n finalStr = shuffle(shuffling);\n //output shuffled password string\n\n return finalStr;\n}", "title": "" }, { "docid": "828d32c7a679da7b7cbe975907dd02f1", "score": "0.676409", "text": "function generatePassword() {\r\n var finalPass = \"\";\r\n var charSet = \"\";\r\n \r\n passLength = parseInt(\r\n prompt(\r\n \"How many characters would you like in your password? Passwords must be at least 8 characters long, but not more than 128.\"\r\n )\r\n ); // Prompts user for the number of characters they want in their generated password, converting the number to an integer.\r\n\r\n \r\n if (passLength < 8 || passLength > 128 || isNaN(passLength)) {\r\n alert(\"Your answer must be provided as a number between 8 and 128.\");\r\n passLength = parseInt(\r\n prompt(\r\n \"How many characters would you like in your password? Passwords must be at least 8 characters long, but not more than 128.\"\r\n )\r\n ); //If the user's number does not meet the conditional requirements, an alert will pop up telling them so; the original prompt will show after the OK is clicked.\r\n }\r\n\r\n {\r\n \r\n //Boolean confirmations for required password conditions.\r\n confirmLower = confirm(\"Do you want to use lowercase letters in your password?\");\r\n confirmUpper = confirm(\"Do you want to use uppercase letters in your password?\");\r\n confirmNumbers = confirm(\"Do you want to use numbers in your password?\");\r\n confirmSpecial = confirm(\"Do you want to use special characters in your password?\");\r\n\r\n //If user confirm = true, add to charSet\r\n if (confirmLower === true) {\r\n charSet += lowerCase;\r\n }\r\n if (confirmUpper === true) {\r\n charSet += upperCase;\r\n }\r\n if (confirmNumbers === true) {\r\n charSet += numbers;\r\n }\r\n if (confirmSpecial === true) {\r\n charSet += special;\r\n }\r\n //If a user selects nothing\r\n if (\r\n confirmLower === false && confirmUpper === false && confirmNumbers === false && confirmSpecial === false\r\n ) {\r\n alert(\"Passwords must contain a combination of special characters, numerals, uppercase letters, and lower case letters. Please start over and select amongst these character types\");\r\n } else {\r\n \r\n //loops until the user's chosen password length is reached, then takes the characters the user chose and randomizes to the length of the character set.\r\n for (let i = 0; i < passLength; i++) {\r\n finalPass += charSet.charAt(Math.floor(Math.random() * charSet.length)); // Final password is generated.\r\n }\r\n \r\n }\r\n }\r\n\r\n return finalPass;\r\n}", "title": "" }, { "docid": "c1e4027d3b8c5861f1b982a22a911216", "score": "0.6761506", "text": "function generatePassword() {\n var passwordLength = prompt(\"Please enter the number of characters you want for you new password. It must be more than 8 but less than 128.\");\n\n // checks if requested lenth is 8-128, if not the user is prompted to re-enter their password length\n if (isNaN(passwordLength) || passwordLength < 8 || passwordLength > 128) passwordlength = Number(prompt(\"Length must be 8-128 characters. How many characters would you like your password to be?\"));\n\n var numbers = confirm(\"Do you want numbers in your password?\");\n\n var lowerCases = confirm(\"Do you want lowercases in your password?\");\n\n var upperCases = confirm(\"Do you want uppercases in your password?\");\n\n var special = confirm(\"Do you want special characters in your password?\");\n // sets the minimum count for the characters\n var minimumCount = 0;\n // string variable for the loop \n var randomPasswordGenerated = \"\";\n // minimums for characters in the password\n var minimumNumbers = \"\";\n\n var minimumLowerCases = \"\";\n\n var minimumUpperCases = \"\";\n\n var minimumSpecialCharacters = \"\";\n\n // functions that determine the character set for each type of element in the password\n var functionArray = {\n getNumbers: function() {\n return String.fromCharCode(Math.floor(Math.random() * 10 + 48));\n },\n\n getLowerCases: function() {\n return String.fromCharCode(Math.floor(Math.random() * 26 + 97));\n },\n\n getUpperCases: function() {\n return String.fromCharCode(Math.floor(Math.random() * 26 + 65));\n },\n\n getSpecialCharacters: function() {\n return specialCharacters[Math.floor(Math.random() * specialCharacters.length)]\n }\n\n};\n\n //these check if the user clicked ok for any of the prompts and uses the characters accordingly\n\n if (numbers === true) {\n minimumNumbers = functionArray.getNumbers();\n minimumCount++;\n\n }\n\n if (lowerCases === true) {\n minimumLowerCases = functionArray.getLowerCases();\n minimumCount++;\n\n }\n\n if (upperCases === true) {\n minimumUpperCases = functionArray.getUpperCases();\n minimumCount++;\n\n }\n\n if (special === true) {\n minimumSpecialCharacters = functionArray.getSpecialCharacters();\n minimumCount++;\n\n }\n\n // loop getting random characters\n for (let i = 0; i < (parseInt(passwordLength) - minimumCount); i++) {\n var randomNumberPicked = Math.floor(Math.random() * 4);\n\n randomPasswordGenerated += randomNumberPicked;\n\n }\n\n // to make sure characters are added to the password\n randomPasswordGenerated += minimumNumbers;\n randomPasswordGenerated += minimumLowerCases;\n randomPasswordGenerated += minimumUpperCases;\n randomPasswordGenerated += minimumSpecialCharacters;\n\n\n return randomPasswordGenerated;\n\n}", "title": "" }, { "docid": "042e677fe70769af095293790d918ff2", "score": "0.676141", "text": "function generatePassword() {\n var inputs = generateCriteria();\n\n // Variable to store password during concatenation\n var finalPassword = [];\n\n // Array to store potential character types to include in password\n var potentialCharTypes = [];\n\n // Array to store character types selected for inclusion in password\n var selectedCharTypes = [];\n\n // Conditional adding array of lowercase letters into array of potential character Types based on user input\n // then pushes\n if (inputs.storeLower) {\n potentialCharTypes = potentialCharTypes.concat(lowerArray);\n selectedCharTypes.push(getRandom(lowerArray));\n }\n\n // Conditional adding array of uppercase letters into array of potential character Types based on user input\n // then pushes\n if (inputs.storeUpper) {\n potentialCharTypes = potentialCharTypes.concat(upperArray);\n selectedCharTypes.push(getRandom(upperArray));\n }\n\n // Conditional adding array of special characters into array of potential character Types based on user input\n // then pushes\n if (inputs.storeSpecChars) {\n potentialCharTypes = potentialCharTypes.concat(specChars);\n selectedCharTypes.push(getRandom(specChars));\n }\n\n // Conditional adding array of numbers into array of potential character Types based on user input\n // then pushes\n if (inputs.storeNumbers) {\n potentialCharTypes = potentialCharTypes.concat(numbers);\n selectedCharTypes.push(getRandom(numbers));\n }\n\n // For loop to iterate over the password length from the userInput object, selecting random indices from the array of possible character types and concatenating those inputs into the finalPassword variable\n for (var i = 0; i < inputs.length; i++) {\n var potentialCharType = getRandom(potentialCharTypes);\n \n finalPassword.push(potentialCharType);\n }\n\n // Include at least one selected character type in the final password\n for (var i = 0; i < selectedCharTypes.length; i++) {\n\n finalPassword[i] = selectedCharTypes[i];\n }\n\n // Transform the finalPassword into a string and pass into writePassword\n return finalPassword.join('');\n}", "title": "" }, { "docid": "c0f4322323747f03c98374f10fffa3c4", "score": "0.6760976", "text": "function generatePassword() {\n //variable for the generated password\n var generatedPassword = \"\";\n\n //Strings of lowercase, uppercase, numeric, and special characters\n\n var upperCaseCharacters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var lowerCaseCharacters = \"abcdefghijklmnopqrstuvwxyz\";\n var numericCharacters = \"01234567890\";\n var specialCharacters = \"!@#$%^&*()\";\n\n //String of all eligible characters based upon user selected character types\n\n var requiredCharactersString = \"\";\n\n //Prompts the user to select a number between 8-128\n var passwordLength = prompt(\n \"How many characters would you like in your password? \\n(Please enter a number between 8-128)\"\n );\n\n //Prompts the user to enter a new value if length is not between 8-128\n while (passwordLength < 8 || passwordLength > 128) {\n passwordLength = prompt(\n \"The password must be between 8 and 128 characters. \\nPlease select a number between 8-128.\"\n );\n }\n\n //Asks the user to confirm if lowercase characters must be included\n var includeLowerCase = confirm(\n \"Do you want to include lowercase characters?\"\n );\n //Add string of lowercase characters to requiredCharactersString if prompt is true\n if (includeLowerCase) {\n requiredCharactersString = requiredCharactersString.concat(\n lowerCaseCharacters\n );\n }\n\n //Asks the user to confirm if uppercase characters must be included\n var includeUpperCase = confirm(\n \"Do you want to include uppercase characters?\"\n );\n //Add string of uppercase characters to requiredCharactersString if prompt is true\n if (includeUpperCase) {\n requiredCharactersString = requiredCharactersString.concat(\n upperCaseCharacters\n );\n }\n\n //Asks the user to confirm if numbers characters must be included\n var includeNumeric = confirm(\"Do you want to include numeric characters?\");\n //Add string of numeric characters to requiredCharactersString if prompt is true\n if (includeNumeric) {\n requiredCharactersString = requiredCharactersString.concat(\n numericCharacters\n );\n }\n\n //Asks the user to confirm if special characters must be included\n var includeSpecial = confirm(\"Do you want to include special characters?\");\n //Add string of special characters to requiredCharactersString if prompt is true\n if (includeSpecial) {\n requiredCharactersString = requiredCharactersString.concat(\n specialCharacters\n );\n }\n\n //Add a random character from the requiredCharactersString to generatedPassword for the remaining password length\n\n for (var i = 0; i < passwordLength; i++) {\n //random number for number of elements in requiredCharactersString\n var random = Math.floor(Math.random() * requiredCharactersString.length);\n\n generatedPassword = generatedPassword.concat(\n requiredCharactersString.charAt(random)\n );\n }\n\n return generatedPassword;\n}", "title": "" }, { "docid": "754008361741189a3d2848f809231b4d", "score": "0.6758268", "text": "function generatePassword(){//what user selected, length of what you want\n var compiledPassword = \"\";\n \n var lowerCharSet = \"abcdefghijklmnopqrstuvwxyz\";\n var upperCharSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var numberCharSet = \"0123456789\";\n var specialCharSet = \"@#$%^&*\";\n var finalPassword = \"\";\n if (lowerCase){\n compiledPassword+=lowerCharSet \n }\n \n if (upperCase){\n compiledPassword+=upperCharSet \n }\n \n if (numberCase){\n compiledPassword+=numberCharSet \n }\n \n if (specialCase){\n compiledPassword+=specialCharSet \n }\n for (var i=0; i<passLengthInteger; i++) { //if user has selected 10 character, for loops will run 10 times, we want random\n finalPassword+= compiledPassword.charAt(Math.floor(Math.random()*compiledPassword.length))\n }\n return finalPassword\n \n}", "title": "" }, { "docid": "e1629f10ca18892c50d968abf31916d4", "score": "0.6757685", "text": "function generatePassword() {\n var numbers = \"123456789\";\n var lowercase = \"abcdefghijklmnopqrstuvwxyz\";\n var uppercase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var special = \"!@#$%^&*()_+\";\n\n\n\n\n var userLenChars = 0\n while (userLenChars < 8 || userLenChars > 128) {\n userLenChars = prompt(\"How many password characters between 8 to 128 do you want?\");\n\n if (userLenChars === null || !userLenChars.length) return;\n\n // Problem A - User enters a non-number\n if (isNaN(userLenChars)) {\n alert(\"Please enter a valid number.\")\n userLenChars = 0\n continue;\n }\n\n userLenChars = parseInt(userLenChars)\n\n // Problem B - User enters a number not in the range\n\n // Check if the entered length is 8 <=\n if (userLenChars < 8 || userLenChars > 128) {\n alert(\"You must pick a number between 8 and 128!\");\n }\n\n }\n\n\n var pool = \"\"\n while (true) {\n pool = \"\"\n\n var userLowerChars = confirm(\"Would you like to include lowercase characters?\");\n var userUpperChars = confirm(\"Would you like to include uppercase characters?\");\n var userNumericChars = confirm(\"Would you like to include numeric characters?\");\n var userSpecialChars = confirm(\"Would you like to include special characters?\");\n\n if (userLowerChars) pool += lowercase\n if (userUpperChars) pool += uppercase\n if (userNumericChars) pool += numbers\n if (userSpecialChars) pool += special\n\n // Check if the pool contains any characters\n if (pool.length === 0) {\n alert(\"You must pick at least one option!\");\n continue\n }\n\n break;\n\n }\n\n var userPassword = \"\"\n // Generate password\n for (var i = 0; i < userLenChars; i++) {\n // Generate a random index\n var randomIndex = Math.floor(Math.random() * pool.length)\n\n var randomCharacter = pool[randomIndex]\n\n userPassword += randomCharacter\n }\n\n return userPassword\n\n}", "title": "" }, { "docid": "dae06b2faff66d349158cbf409c60eb0", "score": "0.67526865", "text": "function generatePassword() {\n\n var passwordLength = prompt('How many characters would you like your password to contain?');\n var charSet = '';\n var upperCase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var lowerCase = 'abcdefghijklmnopqrstuvwxyz';\n var numbers = '0123456789';\n var symbols = '!@#$%&*+\\/~';\n var password = '';\n\n if (passwordLength < 8) {\n alert(\"Password length must be greater than 8 characters.\")\n return generatePassword();\n } else if (passwordLength > 129) {\n alert(\"Password length must be less than 129 characters.\")\n return generatePassword();\n }\n\n\n if (passwordLength >= 8 && passwordLength <= 128) {\n var optionUpper = confirm(\"Click OK if you would like your password to include uppercase characters.\")\n var optionLower = confirm(\"Click OK if you would like your password to include lowercase characters.\")\n var optionNumber = confirm(\"Click OK if you would like your password to include numberic characters.\")\n var optionSpecial = confirm(\"Click OK if you would like your password to include special characters.\")\n\n if (optionUpper) {\n charSet += upperCase;\n }\n\n if (optionLower) {\n charSet += lowerCase;\n }\n\n if (optionNumber) {\n charSet += numbers;\n }\n\n if (optionSpecial) {\n charSet += symbols;\n }\n\n if (optionUpper === false && optionLower === false && optionNumber === false && optionSpecial === false) {\n alert(\"At least one character must be selected.\")\n generatePassword();\n }\n\n\n\n var charSetLength = charSet.length;\n for (var i = 0; i < passwordLength; i++) {\n password += charSet.charAt(Math.floor(Math.random() * charSetLength));\n\n }\n\n return password;\n\n\n }\n}", "title": "" }, { "docid": "d82d9ecff0bf58c3fbbfb99e29a012f0", "score": "0.6749893", "text": "function generatePassword(){\n var prompts = passwordPrompts();\n var possibleOptions = [];\n var confirmedOptions = [];\n var final = [];\n if(prompts.wantNumbers) {\n possibleOptions = possibleOptions.concat(numbers);\n //confirmedOptions.push(getRandomChar(numbers))\n }\n if(prompts.wantLower) {\n possibleOptions = possibleOptions.concat(lower);\n //confirmedOptions.push(getRandomChar(lower))\n }\n if(prompts.wantUpper) {\n possibleOptions = possibleOptions.concat(upper);\n //confirmedOptions.push(getRandomChar(upper))\n }\n if(prompts.wantChar) {\n possibleOptions = possibleOptions.concat(character);\n //confirmedOptions.push(getRandomChar(character))\n }\n\n // we need to iterate over the length of the password from the object \n for (i = 0; i < prompts.length; i++) {\n //console.log(getRandomChar[i]);\n \n final.push(getRandomChar(possibleOptions));\n}\n\n // we need to change the array to a string \n return final.join('')\n}", "title": "" }, { "docid": "07918edffb3183a4731afafe536532fd", "score": "0.6737225", "text": "function generatePasswordCharacters() {\n \n if (confirmUppercase === true) {\n passwordCharacters += uppercase;\n }\n\n if (confirmLowercase === true) {\n passwordCharacters += lowercase;\n }\n\n if (confirmNumbers === true) {\n passwordCharacters += numbers;\n }\n\n if (confirmSymbols === true) {\n passwordCharacters += symbols;\n }\n}", "title": "" }, { "docid": "399decd42f85fceaa34ea8d55888bc54", "score": "0.67354655", "text": "function generatePassword() {\n let characters = \"\";\n var passwordLength = prompt(\"How long would you like your password to be?(Must be longer than 8 Characters and Shorter than 128)\");\n \n \n if (passwordLength < 8 ) {\n alert(\"Password is too short\");\n return generatePassword();\n } \n\n if (passwordLength > 128 ) {\n alert(\"Password is too long\");\n return generatePassword();\n } \n else {\n\n var numbersConfirm = confirm(\"Do you want your password to include numbers?\");\n\n var lowerCasesConfirm = confirm(\"Do you want your password to include? lower case letters?\");\n\n var upperCasesConfirm = confirm(\"Do you want your password to include upper cases letters?\");\n\n var specialConfirm = confirm(\"Do you want your password to include special characters?\");\n }\n\n // Checks to make sure user selected ok for all and uses empty minimums from above\n\n if (numbersConfirm === true) {\n characters = characters + numbers;\n }\n\n if (lowerCasesConfirm === true) {\n characters = characters + lowerCase;\n }\n\n if (upperCasesConfirm === true) {\n characters = characters + upperCase;\n\n }\n\n if (specialConfirm === true) {\n characters = characters + special ;\n\n }\n\n if ( specialConfirm === false && numbersConfirm === false && lowerCasesConfirm === false && upperCasesConfirm == false) {\n alert (\"You must choose an option\");\n return generatePassword();\n }\n\n // empty string variable for the for loop below\n var password = \"\";\n\n // loop getting random characters\n for (let i = 0; i < passwordLength; i++) {\n var randomNumberPicked = Math.floor(Math.random() * characters.length);\n var randomCharacter = characters.charAt(randomNumberPicked)\n password = password + randomCharacter\n\n }\n\n return password;\n\n}", "title": "" }, { "docid": "5fcdab891019d24bf56d9d02830eb4db", "score": "0.6734745", "text": "function generatePassword() {\n\n confirm (\"Would you like to include UPPERCASE LETTERS?\")); if true {\n includedTypes.push(\"UpCase\");\n charPool.concat(charUCase);\n } \n\n while (includedTypes.length < 1) {\n \n if (confirm (\"Would you like to include LOWERCASE LETTERS?\")) {\n includedTypes.push(\"LowCase\");\n charPool.concat(charLCase); \n } \n \n if (confirm (\"Would you like to include NUMBERS?\")) {\n includedTypes.push(\"Numbers\");\n charPool.concat(charNumeric);\n } \n \n if (confirm (\"Would you like to include SPECIAL CHARACTERS?\")) {\n includedTypes.push(\"Special\");-+\n charPool.concat(charSpecial);\n }\n\n if (userChoiceNum <8 || >128)) alert (\"Oops! That's not a number between 8 and 128. Please choose again.\")\n }\n}", "title": "" }, { "docid": "380849aa765a15e6878fe0a149568dfd", "score": "0.67337126", "text": "function generatePassword() {\n //\n // DATA STRUCTURE\n //\n // 1. Varialable to store user input object by calling yourFuncForUserInput\n var userCharVal = yourFuncForUserInput();\n\n // 2. An empty array for result to store password as it's being concatenated later\n var finalPassword = [];\n\n // 3. Array to store all eligible/possible characters of different types based on by user input\n var possibleCharacters = [];\n\n // 4. Array to contain one of each type of chosen character to ensure each will be used and guaranteed\n var guaranteedCharacters = [];\n\n // 5. Random guaranteed character\n var randomGuaranteedChar;\n\n // MAIN LOGIC\n //\n // 1a. Conditional statement that adds array of special characters into array of possible characters based on user input\n if (userCharVal.specialChar){\n possibleCharacters.push(specialCharacters);\n\n // 1b. Push new random special character to guaranteedCharacters\n randomGuaranteedChar = yourFuncForRandomChar(possibleCharacters[possibleCharacters.length-1]);\n\n guaranteedCharacters.push(randomGuaranteedChar);\n }\n\n // 2a. Conditional statement that adds array of numeric characters into array of possible characters based on user input\n\n if (userCharVal.numChar){\n possibleCharacters.push(numericCharacters);\n\n // 2b. Push new random number to guaranteedCharacters\n randomGuaranteedChar = yourFuncForRandomChar(possibleCharacters[possibleCharacters.length-1]);\n\n guaranteedCharacters.push(randomGuaranteedChar);\n }\n\n // 3a. Conditional statement that adds array of lowercase characters into array of possible characters based on user input\n if (userCharVal.lowerChar){\n possibleCharacters.push(lowerCasedCharacters);\n\n // 3b. Push new random lower-cased character to guaranteedCharacters\n\n randomGuaranteedChar = yourFuncForRandomChar(possibleCharacters[possibleCharacters.length-1]);\n\n guaranteedCharacters.push(randomGuaranteedChar);\n }\n \n // 4a. Conditional statement that adds array of uppercase characters into array of possible characters based on user input\n\n if (userCharVal.upperChar){\n possibleCharacters.push(upperCasedCharacters);\n\n // 4b. Push new random upper-cased character to guaranteedCharacters\n\n randomGuaranteedChar = yourFuncForRandomChar(possibleCharacters[possibleCharacters.length-1]);\n\n guaranteedCharacters.push(randomGuaranteedChar);\n }\n\n // 5. For loop to iterate over the password length from the options object, selecting random indices from the array of possible characters and concatenating those characters into the result variable\n\n for (i = 0; i < ((userCharVal.password) - (possibleCharacters.length)); i++){\n\n //Send possibleCharacters array to yourFuncForRandomChar to select a random index within the possibleCharacters array and return the array that is in that index\n var randomArray = yourFuncForRandomChar(possibleCharacters);\n \n //Send random array chosen from possibleCharacters back to yourFuncForRandomChar to get back one value\n\n var randomIndexVal = yourFuncForRandomChar(randomArray);\n\n //Push that single value to the finalPassword array\n finalPassword.push(randomIndexVal);\n }\n\n // 6. Mix in at least one of each guaranteed character in the result\n finalPassword = finalPassword.concat(guaranteedCharacters);\n\n // 7. Transform the result into a string and pass into writePassword and return it to the caller\n return finalPassword.join('');\n}", "title": "" }, { "docid": "3d4393012855cfff281b9c17361376e2", "score": "0.67304343", "text": "function generatePass() {\n\n concatPass = [];\n\n if (lowerCaseChoice) {\n concatPass = lowerCase.concat(concatPass);\n }\n\n if (upperCaseChoice) {\n concatPass = upperCase.concat(concatPass);\n }\n\n if (numbersChoice) {\n concatPass = numbers.concat(concatPass);\n }\n\n if (specialCharChoice) {\n concatPass = specialChar.concat(concatPass);\n }\n\n var passwordLocal = \"\";\n\n for (var i = 0; i < passwordLength; i++) {\n var randomNumber = Math.floor(Math.random() * concatPass.length);\n passwordLocal = passwordLocal += concatPass[randomNumber];\n }\n\n password = passwordLocal;\n\n}", "title": "" }, { "docid": "4e6069f004a05d3b4cad0f1d26d3e64b", "score": "0.6729555", "text": "function generatePassword() {\n var userCriteria = inputOptions();\n\n var password = [];\n var chosenChar = [];\n var charsInc = []; \n\n//various character options for special characters, numbers, upper and lowercase\nif (userCriteria.confirmSpecialChar) {\n charsInc = charsInc.concat(specialChar);\n chosenChar.push(randomChar(specialChar));\n}\n\nif (userCriteria.confirmNumber) {\n charsInc = charsInc.concat(number);\n chosenChar.push(randomChar(number));\n}\n\nif (userCriteria.confirmUpperAlpha) {\n charsInc = charsInc.concat(upperAlpha);\n chosenChar.push(randomChar(upperAlpha));\n}\n\nif (userCriteria.confirmLowerAlpha) {\n charsInc = charsInc.concat(lowerAlpha);\n chosenChar.push(randomChar(lowerAlpha));\n}\n//Loop to check length\nfor(var i=0; i < userCriteria.confirmLength; i++) {\n var possibleChar = randomChar(charsInc);\n password.push(possibleChar);\n}\n//Loop to match the password with the length chosen\nfor(var i=0; i < chosenChar.length; i++) {\n password[i] = chosenChar[i];\n}\n// Include a return call and join characters into string \nreturn password.join(\" \");\n \n}", "title": "" }, { "docid": "4ca9fc16496b5bc0627eff906ff1a61c", "score": "0.6723281", "text": "function writePassword() {\n passLength();\n console.log(passwordLength);\n passCase();\n console.log(uppercaseCheck);\n passNum();\n console.log(numberCheck);\n passSpecChar();\n console.log(specCheck);\n\n //all possible slected criterion combinations\n \n var characters = lowercase;\n //var password = \"\";\n\n if (uppercaseCheck && numberCheck && specCheck) {\n characters += specialcase += numbercase += uppercase;\n\n } else if (numberCheck && specCheck) {\n characters += numbercase += uppercase;\n\n } else if (numberCheck && uppercaseCheck) {\n characters += numbercase += specialcase;\n\n } else if (uppercaseCheck && specCheck) {\n characters += specialcase += uppercase;\n\n } else if (uppercaseCheck) {\n characters += specialcase;\n\n } else if (numberCheck) {\n characters += numbercase;\n\n } else if (specCheck) {\n characters += specialcase;\n\n } else {\n characters === lowercase\n }\n\n //actual function loop with all specified password parameters \n for(var i = 0; i < passLength; i++) {\n password += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return password;\n }", "title": "" }, { "docid": "40690622fa3224b1fb44fe095dce8228", "score": "0.67185944", "text": "function generatePassword(){\n\n var pwdLength = prompt(\"How many characters would you like to have between 8 to 128?\");\n if(pwdLength < 8 || pwdLength > 128){\n alert(\"Try to pick length between 8 to 128!\"); \n }\n\n var upperCase = confirm(\"Include uppercase letter?\");\n var lowerCase = confirm(\"Include lowercase letter?\");\n var numberCase = confirm(\"Include number?\");\n var symbolCase = confirm(\"Include symbol?\");\n if(upperCase === true){\n allChar.push(upperC);\n }\n if(lowerCase === true){\n allChar.push(lowerC);\n }\n if(numberCase === true){\n allChar.push(number);\n }\n if(symbolCase === true){\n allChar.push(symbol);\n }\n // if(allChar.length < 1 || allChar == undefined){\n // alert(\"Pick at least one of the criteria\");\n // }\n // console.log(allChar); \n \n for (var i = 0; i < pwdLength; i++) {\n var randomArray = Math.floor(Math.random() * allChar.length);\n var result = Math.floor(Math.random() * allChar[randomArray].length);\n if( i === 0){\n password =+ allChar[randomArray][result];\n } \n else{\n password = password + allChar[randomArray][result];\n }\n \n }\n return password;\n}", "title": "" }, { "docid": "bab3730ac1fe7ed9bc419aa2c26083a0", "score": "0.6717057", "text": "function generatePassword() {\n passChars = parseInt(prompt(\"Your password can be between 8 and 128 character. How many would you like?\"));\n if ((passChars > 128) || (passChars < 8) || (!passChars)) {\n alert(\"Invalid entry. Your password must be between 8 and 128 characters\");\n passChars = parseInt(prompt(\"Your password can be between 8 and 128 character. How many would you like?\"));\n } else {\n specialCharConfirm = confirm(\"A strong password includes special charaters, i.e. ! @ #, would you like to include special characters?\");\n numbersConfirm = confirm(\"Would you like your password to contain numbers?\");\n alphabetUpperConfirm = confirm(\"Would you like your password to contain uppercase?\");\n alphabetLowerConfirm = confirm(\"Would you like your password to contain lowercase letters?\");\n }\n\n // alerts user that they must confirm at least one of the prompts of characters choices\n if (!specialCharConfirm && !numbersConfirm && !alphabetUpperConfirm && !alphabetLowerConfirm) {\n choices = alert(\"You must choose at least one character category!\");\n }\n\n // logic functions to complete user choices\n else if ((specialCharConfirm == true) && (numbersConfirm == true) && (alphabetUpperConfirm == true) && (alphabetLowerConfirm == true) ) {\n choices = alphabet.concat(numbers, specialChars, alphabetUpper);\n }\n else if ((specialCharConfirm == true) && (numbersConfirm == true) && (alphabetUpperConfirm == true)) {\n choices = specialChars.concat(numbers, alphabetUpperConfirm);\n }\n else if ((numbersConfirm == true) && (alphabetUpperConfirm == true) && (alphabetLowerConfirm == true)) {\n choices = numbers.concat(alphabetUpper, alphabet);\n }\n else if ((alphabetUpperConfirm == true) && (alphabetLowerConfirm == true) && (specialCharConfirm == true)) {\n choices = alphabetUpper.concat(alphabet, specialChars);\n }\n\n else if ((alphabetUpperConfirm == true) && (alphabetLowerConfirm == true)) {\n choices = alphabetUpper.concat(alphabet);\n }\n else if ((alphabetUpperConfirm == true) && (numbersConfirm == true)) {\n choices = alphabetUpper.concat(numbers);\n }\n else if ((alphabetUpperConfirm == true) && (specialCharConfirm == true)) {\n choices = alphabetUpper.concat(specialChars);\n }\n else if ((alphabetLowerConfirm == true) && (numbersConfirm == true)) {\n choices = alphabet.concat(numbers);\n }\n else if ((alphabetLowerConfirm == true) && (specialCharConfirm == true)) {\n choices = alphabet.concat(specialChars);\n }\n else if ((numbersConfirm == true) && (specialChars == true)) {\n choices = numbers.concat(specialChars);\n }\n \n else if (alphabetUpperConfirm == true) {\n choices = alphabetUpper;\n }\n else if (alphabetLowerConfirm == true) {\n choices = alphabet;\n }\n else if (numbersConfirm == true) {\n choices = numbers;\n }\n else if (specialCharConfirm == true) {\n choices = specialChars;\n };\n\n // Empty array generated for users new password\n passwordArr = [];\n\n for (i = 0; i < passChars; i++) {\n var userChoices = choices[Math.floor(Math.random() * choices.length)];\n passwordArr.push(userChoices);\n }\n\n var password = passwordArr.join(\"\");\n return password;\n}", "title": "" }, { "docid": "d740ec9aebf8090755a07997020d15a0", "score": "0.67159075", "text": "function generatePassword() {\n // turn input string into numbers\n var confirmLength = parseInt(prompt(\"How many characters would you like your password to contain?\"));\n // make sure passwrod is between 8 and 129 and is NOT a letter or symbol\n while(confirmLength <= 7 || confirmLength >= 129 || (isNaN(confirmLength))) {\n alert(\"Password length must be a number between 8-128 characters. Try again!\");\n var confirmLength = (prompt(\"How many characters would you like your password to contain?\"));\n } \n \n\n// Ask what type of characters they would like to use\n var choices=[]\n var confirmLowerCase = confirm(\"Would you like to use Lower Case letters?\");\n if (confirmLowerCase) {\n choices = choices.concat(lowerCase) // choices += lowerCase\n }\n var confirmUpperCase = confirm(\"Would you like to use Upper Case letters?\");\n if (confirmUpperCase) {\n choices = choices.concat(upperCase)\n }\n var confirmNumeric = confirm(\"Would you like to use Numbers?\");\n if (confirmNumeric) {\n choices = choices.concat(numeric)\n }\n var confirmSpecialCharacters = confirm(\"Would you like to use Special Characters?\");\n if (confirmSpecialCharacters) {\n choices = choices.concat(specialCharacters)\n }\n\n// make sure they use at least one of the requirements\n\n while(confirmLowerCase === false && confirmUpperCase === false && confirmNumeric === false && confirmSpecialCharacters === false) {\n alert (\"You must select at least one type of character\");\n var confirmLowerCase = confirm(\"Would you like to use Lower Case letters?\");\n if (confirmLowerCase) {\n choices = choices.concat(lowerCase)\n }\n var confirmUpperCase = confirm(\"Would you like to use Upper Case letters?\");\n if (confirmUpperCase) {\n choices = choices.concat(upperCase)\n }\n var confirmNumeric = confirm(\"Would you like to use Numbers?\");\n if (confirmNumeric) {\n choices = choices.concat(numeric)\n }\n var confirmSpecialCharacters = confirm(\"Would you like to use Special Characters?\");\n if (confirmSpecialCharacters) {\n choices = choices.concat(specialCharacters)\n }\n }\n\n \n // creat for loop to take in input and make password\n \n var createdPassword = []\n for (var i=0; i<confirmLength;i++) {\n var index = Math.floor(Math.random() * choices.length )\n\n createdPassword.push(choices[index])\n }\n \n// this took out too many commas\n return createdPassword.join(\"\")\n \n }", "title": "" }, { "docid": "c868d532e26c9e192c893a60f560e52e", "score": "0.671413", "text": "function writePassword() {\n var possibles = []\n var length = parseInt(prompt(\"How long does this password need to be?\"))\n\nif(length < 8 || length > 128 || isNaN(length)) {\n alert(\"no way, try again\")\n} else {\n var charactersTrue = confirm(\"Do you want characters?\");\n var capCharsTrue = confirm(\"Do you want capitals?\");\n var numsTrue = confirm(\"Do you want numbers?\");\n var sCharsTrue = confirm(\"Do you want special characters?\");\n\n if (charactersTrue) { possibles.push(characters) };\n if (capCharsTrue) { possibles.push(capChars) };\n if (numsTrue) { possibles.push(nums) };\n if (sCharsTrue) { possibles.push(sChars) };\n\n var password = \"\"\n while(password.length < length) {\n\n for (let i = 0; i < possibles.length; i++) {\n if (password.length < length){\n let rand = Math.floor(Math.random() * possibles[i].length)\n password += possibles[i][rand]\n }\n }\n }\n}\n// console.log(password, `pasword lenth: ${password.length}`)\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "f37c1607811beb7ec2bd8a817f03942a", "score": "0.6711158", "text": "function generatePassword() {\n var pwordQs = questions();\n var combosPossible = [];\n var passwordGenerated = \"\";\n//if functions for different possible selections.\n if (pwordQs.numbersPrompt) {\n for (var i of numbers)\n combosPossible.push(i);\n }\n if (pwordQs.lowerPrompt) {\n for (var i of lowerCase)\n combosPossible.push(i);\n }\n if (pwordQs.upperPrompt) {\n for (var i of upperCase)\n combosPossible.push(i);\n }\n if (pwordQs.specialPrompt) {\n for (var i of special)\n combosPossible.push(i);\n }\n\n console.log(combosPossible);\n//function that combines all selections and generates password for the user\n for (var i = 0; i < pwordQs.length; i++) {\n passwordGenerated += combosPossible[Math.floor(Math.random() * combosPossible.length)];\n \n }\n console.log(passwordGenerated);\n\n return passwordGenerated;\n}", "title": "" }, { "docid": "d143cacec4fcea8f7c34ea7d1ceb7e4b", "score": "0.6703367", "text": "function generatePassword() {\n var userOptions = getPasswordOptions()\n var possibleCharacters = []\n var confirmedCharacters = []\n var result = []\n\n if (userOptions.hasUpper) {\n possibleCharacters = possibleCharacters.concat(upperCase);\n confirmedCharacters.push(obtainRandom(upperCase))\n }\n\n if (userOptions.hasLower) {\n possibleCharacters = possibleCharacters.concat(lowerCase);\n confirmedCharacters.push(obtainRandom(lowerCase))\n }\n\n if (userOptions.hasNumber) {\n possibleCharacters = possibleCharacters.concat(numbers);\n confirmedCharacters.push(obtainRandom(numbers))\n }\n\n if (userOptions.hasSpecial) {\n possibleCharacters = possibleCharacters.concat(specialCharacters);\n confirmedCharacters.push(obtainRandom(specialCharacters))\n }\n\n\n // for loop to get random characters\n for (i = 0; i < userOptions.length; i++) {\n\n var possibleCharacters = obtainRandom(possibleCharacters)\n result.push(possibleCharacters)\n }\n for (i = 0; i < confirmedCharacters.length; i++) {\n result[i] = confirmedCharacters[i]\n }\n // returns the result\n return result.join(\"\");\n}", "title": "" }, { "docid": "a68b1fa585d7aa5b3d1acffec8aa3bb5", "score": "0.6692115", "text": "function generatePassword() {\n length = answer,\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\",\n retVal = \"\";\n for (i = 0, n = charset.length; i < length; ++i) {\n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n}", "title": "" }, { "docid": "bd28a70003c280202ec252b4504a7d14", "score": "0.669098", "text": "function generatePassword() {\n var userArr = [];\n var pwordLength = prompt(\"How many characters would you like to include? (min. 8 max. 128)\");\n pwordLength = parseInt(pwordLength);\n // User must enter 8 - 128 or message will diplay to try again\n if(pwordLength > 7 && pwordLength < 129) {\n var lowerCaseTrue = confirm(\"Would you like to include lower case characters?\");\n if(lowerCaseTrue === true) {\n userArr = userArr.concat(alphaLowerChars);\n };\n var upperCaseTrue = confirm(\"Would you like to include upper case characters?\");\n if(upperCaseTrue === true) {\n userArr = userArr.concat(alphaUpperChars);\n };\n var numTrue = confirm(\"Would you like to include numbers?\");\n if(numTrue === true) {\n userArr = userArr.concat(numChars);\n };\n var specCharTrue = confirm(\"Would you like to include special characters?\");\n if (specCharTrue === true) {\n userArr = userArr.concat(specChars);\n };\n var pword = \"\"; \n for(var i = pwordLength; i > 0; i--) {\n pword += userArr[Math.floor(Math.random() * userArr.length)];\n };\n return pword;\n \n } else {\n return \"Try Again! You must enter a number between 8 and 128.\"\n };\n}", "title": "" }, { "docid": "0d4aee068bd76e94de8e7b3013173074", "score": "0.66890895", "text": "function generatePassword(\n passwordLength, \n includeSpecial,\n includeLowercase,\n includeUppercase,\n includeNumber,\n ) {\n\n let characterOptions = [];\n\n let lowercase = [\"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 uppercase = [\"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 special = [\"!\", \"%\", \"&\", \",\", \"*\", \"+\", \"-\", \".\", \"/\", \"<\", \">\", \"?\",\"~\"];\n let number = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n\n if (includeSpecial) {\n characterOptions = characterOptions.concat(special)\n }\n\n if (includeUppercase) {\n characterOptions = characterOptions.concat(uppercase)\n }\n\n if (includeLowercase) {\n characterOptions = characterOptions.concat(lowercase)\n }\n\n if (includeNumber) {\n characterOptions = characterOptions.concat(number)\n }\n\n\n\n let res = \"\"\n\n console.log(characterOptions)\n\n for (i=0; i<passwordLength; i++) {\n let randomIndex = Math.floor(Math.random() * characterOptions.length)\n res += characterOptions[randomIndex]\n }\n return res\n }", "title": "" }, { "docid": "f25dca8be603d46c160f6cab3fbc47a2", "score": "0.668795", "text": "function generatePassword() {\n var confirmLength = (prompt(\"How manny characters would you like your password to be?\"));\n\n \n// Loop answer to fit criteria\n while(confirmLength <= 8 || confirmLength >= 128){\n alert(\"Password must be between 8-128 characters. Try Again\");\n var confirmLength = (prompt(\"How manny characters would you like your password to be?\"));\n }\n\n alert(`Your password will have ${confirmLength} characters`);\n\n //Confirm Password Parameters\n var confirmSpecialCharacter = confirm(\"Would you like to include special characters?\");\n var confirmNumericCharacter = confirm(\"Would you like to include numeric characters?\");\n var confirmUpperCase = confirm(\"Would you like to include uppercase characters?\");\n var confirmLowerCase = confirm(\"Would you like to include lowercase characters?\");\n\n\n// Loop answer to fit criteria\nwhile(confirmSpecialCharacter === false && confirmNumericCharacter === false && confirmUpperCase === false && confirmLowerCase === false){\n\n\n}\n\n\n//Assign action to the password parameters\nvar passwordCharacters = []\n\nif (confirmSpecialCharacter) {\n passwordCharacters = passwordCharacters.concat(specialChar)\n}\nif (confirmNumericCharacter) {\n passwordCharacters = passwordCharacters.concat(number)\n}\nif (confirmUpperCase) {\n passwordCharacters = passwordCharacters.concat(alphaUpper)\n}\nif (confirmLowerCase) {\n passwordCharacters = passwordCharacters.concat(alphaLower)\n}\n\nconsole.log(passwordCharacters)\n\n//Loop selecting random items from convined arrays\n\nvar randomPassword = \"\"\n\nfor (var i = 0; i < confirmLength; i++) {\n randomPassword = randomPassword + passwordCharacters[Math.floor(Math.random() * passwordCharacters.length)];\n console.log(randomPassword)\n }\n return randomPassword;\n}", "title": "" }, { "docid": "c05fa60007c0461956c839ab15f47199", "score": "0.66874725", "text": "function generatePassword() {\n var passwordText = \"\";\n\n var myLowerCase = confirm(\"Do you want to include lowercase?\");\n var myUppercase = confirm(\"Do you want to include Uppercase?\");\n var myNumeric = confirm(\"Do you want to include numbers?\");\n var mySpecial = confirm(\"Do you want to include special characters?\");\n\n //if all the inputs are false then alert \"select atlist one character\".\n\n if (\n myUppercase === false &&\n myLowerCase === false &&\n myNumeric === false &&\n mySpecial === false\n ) {\n alert(\"Pleas select atlist one character!\");\n }\n // if all the inputs are true store them in the reciverCharArray.\n if (myLowerCase === true) {\n receiverCharArray.push(lowerCase);\n }\n\n if (myUppercase === true) {\n receiverCharArray.push(upperCase);\n }\n\n if (myNumeric === true) {\n receiverCharArray.push(numeric);\n }\n\n if (mySpecial === true) {\n receiverCharArray.push(special);\n }\n //prompt for the length of the password\n var passwordLength = parseInt(\n prompt(\n \"How many characters do you want? It cannot be less than 8 or more than 128 characters.\"\n )\n );\n // if the lenth of password < 8 alert \"pleas select number that is >= 8 characters.\"\n if (passwordLength < 8) {\n alert(\"pleas select number that is greater or equal to 8 .\");\n passwordLength = parseInt(\n prompt(\n \"How many characters do you want? It cannot be less than 8 or more than 128 characters.\"\n )\n );\n }\n // if the length of the password is > 128 alert \" pleas select a number that is >= than 8 and <= 128\"\n if (passwordLength > 128) {\n alert(\"Pleas select a number the is greater then 8 or less than 128!\");\n passwordLength = parseInt(\n prompt(\n \"How many characters do you want? It cannot be less than 8 or more than 128 characters.\"\n )\n );\n return;\n }\n\n // creat a loop to generate the password randomly from the array.\n for (var i = 0; i < passwordLength; i++) {\n //generate rundom number\n\n var randomArrayNum = parseInt(\n Math.floor(Math.random() * receiverCharArray.length)\n );\n console.log(\"RandomArrayNum\", randomArrayNum);\n //generate random number for selected array\n console.log(receiverCharArray);\n var selectedAarry = receiverCharArray[randomArrayNum];\n console.log(\"SeletecdArray\", selectedAarry);\n //stores random number based on length of selected array\n\n var randomNum = Math.floor(Math.random() * selectedAarry.length);\n console.log(\"randonNum\", randomNum);\n\n var randmCharacter = selectedAarry[randomNum];\n console.log(\"RandomCHaracter\", randmCharacter);\n\n //combine the string and return passwordText\n\n passwordText += randmCharacter;\n\n console.log(\"==========\");\n }\n\n \n console.log(\"your password is\" + passwordText);\n //alert(\"your password is\" + passwordText);\n return passwordText;\n}", "title": "" }, { "docid": "e0bcd3d09e82943cbcd94bcb7c307cb3", "score": "0.6683151", "text": "function generatePassword() {\n var result = [];\n var possibleCharacters = [];\n var guaranteedCharacters = [];\n var options = criteriaNeeded();\n\n console.log(options)\n\n if (options.choiceUpperCase) {\n possibleCharacters = possibleCharacters.concat(upperCase)\n guaranteedCharacters.push(getRandom(upperCase))\n }\n\n if (options.choiceLowerCase) {\n possibleCharacters = possibleCharacters.concat(lowerCase)\n guaranteedCharacters.push(getRandom(lowerCase))\n }\n\n if (options.pwLength) {\n possibleCharacters = possibleCharacters.concat(numbers)\n guaranteedCharacters.push(getRandom(numbers))\n }\n\n if (options.choiceSpecial) {\n possibleCharacters = possibleCharacters.concat(special)\n guaranteedCharacters.push(getRandom(special))\n }\n\n for (var i = 0; i < options.pwLength; i++) { \n result.push(getRandom(possibleCharacters));\n //return arr[randIndex];\n }\n\n for (var i = 0; i < guaranteedCharacters.length; i++) {\n result[i] = guaranteedCharacters[i]\n }\n return result.join(\"\");\n}", "title": "" }, { "docid": "12d1f6a414e6512dbce4a2702b0013bb", "score": "0.66809934", "text": "function generatePassword() {\n let passLength = parseInt(prompt(\"How long would you like your password\"));\n if (passLength < 8 || passLength > 128) {\n alert(\"choose a length of at least 8 characters and no more than 128 characters\");\n return;\n }\n let lower = confirm(\"Would you like lowercase letters?\");\n let upper = confirm(\"Would you like uppercase letters?\");\n let specialchar = confirm(\"Would you like any special characters?\");\n let numbers = confirm(\"would you like numbers?\");\n\n if (lower === false && upper === false && specialchar === false && numbers === false) {\n alert(\"Please choose at least one character set\");\n return;\n }\n\n let passwordOptions = [];\n if (lower === true) {\n passwordOptions = passwordOptions.concat(lowerCase)\n }\n if (upper === true) {\n passwordOptions = passwordOptions.concat(upperCase)\n }\n if (specialchar === true) {\n passwordOptions = passwordOptions.concat(special)\n }\n if (numbers === true) {\n passwordOptions = passwordOptions.concat(num)\n }\n let pass = [];\n\n\n for (let i = 0; i < passLength; i++) {\n let result = passwordOptions[Math.floor(Math.random() * passwordOptions.length)];\n pass.push(result);\n }\n\n\n // Password is currently blank! We need to make a better one\n return pass.join(\"\");\n}", "title": "" }, { "docid": "4e85a827035643952291a73c08a65326", "score": "0.6680384", "text": "function generateCharacterArray() {\n console.log(\"Execute generateCharacterArray()\");\n pswdcharacterset = [\"\"]; // clears array in the event of multiple executions //\n\n // Asks users which character sets to include //\n ulc = confirm(\"Do you want to include lowercase characters in your password?\\nPress OK for yes and Cancel for No.\");\n if(ulc) {\n pswdcharacterset = lc.concat(pswdcharacterset);\n console.log(\"Include lowercase letters\");\n }\n \n uuc = confirm(\"Do you want to include uppercase characters in your password?\\nPress OK for yes and Cancel for No.\");\n if(uuc) {\n pswdcharacterset = uc.concat(pswdcharacterset);\n console.log(\"Include uppercase letters\");\n }\n\n unu = confirm(\"Do you want to include numbers in your password?\\nPress OK for yes and Cancel for No.\");\n if(unu) {\n pswdcharacterset = nu.concat(pswdcharacterset);\n console.log(\"Include numbers\");\n }\n\n usc = confirm(\"Do you want to include special characters in your password?\\nPress OK for yes and Cancel for No.\");\n if(usc) {\n pswdcharacterset = sc.concat(pswdcharacterset);\n console.log(\"Include special characters\");\n }\n\n // check to ensure at least one character set was chosen //\n if (!ulc && !uuc && !unu && !usc) {\n alert(\"You must choose at least one type of character to include. Please start again\");\n getPasswordLength();\n\n } else {\n generatePasswordArray();\n }\n\n} //end generateCharacterArray", "title": "" }, { "docid": "d42217afaa5c38b976365cfa9406b595", "score": "0.66779953", "text": "function generatePassword() {\n\n var confirmLength = window.prompt(\"How many characters would you like your password to contain? Please choose a number between 8 and 128.\");\n console.log(\"Your password length is \" + confirmLength);\n\n while(confirmLength <= 7 || confirmLength >= 129) {\n window.alert(\"UH OH! Your password length MUST be between 8-128 characters. Try again.\");\n var confirmLength = window.prompt(\"How many characters would you like your password to contain? Please choose a number between 8 and 128.\");\n }\n\n if(confirmLength >= 8 || confirmLength <=128) {\n window.alert(\"Your password will have \" + confirmLength + \" characters in total.\");\n console.log(\"Your password length is \" + confirmLength);\n }\n\n var confirmUpperCase = window.confirm(\"Would you like to include upper case letters in your password (ex. A,B,C...)? Click 'OK' to confirm.\");\n var confirmLowerCase = window.confirm(\"Would you like to include lower case letters in your password (ex. a,b,c...)? Click 'OK' to confirm.\");\n var confirmNumber = window.confirm(\"Would you like to add numbers in your password (ex. 1,2,3...? Click 'OK' to confirm.\");\n var confirmSpecial = window.confirm(\"Would you like to include special character's in your password (ex. !,@,#...)? Click 'OK' to confirm.\");\n\n if(confirmUpperCase === false && confirmLowerCase === false && confirmNumber === false & confirmSpecial === false) {\n window.alert(\"You MUST choose at least one of the 4 password criteria.\");\n var confirmUpperCase = window.confirm(\"Would you like to include upper case letters in your password (ex. A,B,C...)? Click 'OK' to confirm.\");\n var confirmLowerCase = window.confirm(\"Would you like to include lower case letters in your password (ex. a,b,c...)? Click 'OK' to confirm.\");\n var confirmNumber = window.confirm(\"Would you like to add numbers in your password (ex. 1,2,3...? Click 'OK' to confirm.\");\n var confirmSpecial = window.confirm(\"Would you like to include special character's in your password (ex. !,@,#...)? Click 'OK' to confirm.\");\n //how to loop lines 59-62 and clean up code???? also where to add console log for the above 4 lines??\n }\n\n\n // can use .concat to merge 2 or more arrays\n \n if (confirmUpperCase) {\n avalChars += upperCase;\n }\n\n if(confirmLowerCase) {\n avalChars += lowerCase;\n }\n\n if(confirmNumber) {\n avalChars += number;\n }\n\n if(confirmSpecial) {\n avalChars += special;\n }\n \n\n\n for (var i = 0; i < confirmLength; i++) {\n //randomly select chars from chars added to availchars. Loop thru selecting of chars until matches confirm.length\n password += avalChars[Math.floor(Math.random() * avalChars.length)];\n }\n \n \n return password;\n \n}", "title": "" }, { "docid": "e3ada441f60dfea7d779fd22efdadebc", "score": "0.66759557", "text": "function generatePassword() {\n var options = passwordValues();\n var result = [];\n \n var potentialChoices = [];\n \n var randomInput = [];\n \n // Add Vars to possible pswd options\n if (options.hasUppercase) {\n potentialChoices = potentialChoices.concat(upperCase);\n randomInput.push(getRandom(upperCase));\n }\n if (options.hasLowercase) {\n potentialChoices = potentialChoices.concat(lowerCase);\n randomInput.push(getRandom(lowerCase));\n }\n if (options.hasSymbols) {\n potentialChoices = potentialChoices.concat(symbols);\n randomInput.push(getRandom(symbols));\n }\n if (options.hasNumbers) {\n potentialChoices = potentialChoices.concat(numbers);\n randomInput.push(getRandom(numbers));\n }\n // iterate over loop for length and possible characters \n for (var i = 0; i < options.length; i++) {\n var possibleCharacter = getRandom(potentialChoices);\n \n result.push(possibleCharacter);\n }\n \n // Use one of each option chosen for the password\n for (var i = 0; i < randomInput.length; i++) {\n result[i] = randomInput[i];\n }\n \n // Pass result as string and write to writePassword\n return result.join('');\n }", "title": "" }, { "docid": "91230b31c3619af9d9372542fb1ac10a", "score": "0.66757417", "text": "function generatePassword (length, wordLower, wordUpper, wordNumber, wordSpecial){\n var values = []\n if (wordLower) values += \"abcdefghijklmnopqrstuvwxyz\";\n if (wordUpper) values += \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n if (wordNumber) values += \"0123456789\";\n if (wordSpecial) values += \"!@#$%^&*+=:,./'?`~\";\n\n var wordLength = prompt (\"Choose the length of password. From 8 to 50 characters\")\n if (wordLength > \"8\") {\n wordLength = true;\n console.log(wordLength);\n }else {\n \n }\n\n var wordLower = prompt (\"Do you want Lowercase letters in your password? yes or no\" )\n if (wordLower === \"yes\") {\n wordLower === true;\n console.log(wordLower);\n }else {\n wordLower === false;\n }\n\n var wordUpper = prompt (\"Do you want Uppercase letters in your password? yes or no\")\n if (wordUpper === \"yes\") {\n wordUpper === true;\n console.log(wordUpper);\n }else {\n wordUpper === false;\n }\n \n var wordNumber = prompt (\"Do you want numbers? yes or no\")\n if (wordNumber === \"yes\") {\n wordNumber === true;\n console.log(wordNumber);\n }else {\n wordNumber === false;\n }\n \n var wordSpecial = prompt (\"Do you want Special Characters? yes or no \")\n if (wordSpecial === \"yes\") {\n wordSpecial === true;\n console.log(wordSpecial);\n }else {\n wordSpecial === false;\n }\n \n \n var password = \"\";\n \n for(var i = 0; i <= wordLength; i++) { \n var newPass = [Math.floor(Math.random()* wordLength.length)];\n password = newPass + password;}\n \n \n return password;}", "title": "" }, { "docid": "c655495076963c997a5e77adc57631cf", "score": "0.66755843", "text": "function generatePassword() {\n\n charNum = window.prompt(\"How many characters would you like your password to be? (number between 8 and 128)\");\n // this conditional tells the user if there character number is acceptable or not for the application \n if (charNum < 8 || charNum > 128) {\n alert(\"too small or too big\")\n return; // the return terminates the function \n }\n\n //ensures clear array to begin\n characterChoices = [];\n // these prompts allow user select what specific password criteria they want\n upperConfirm = window.confirm(\"Would you like to include Uppercase Letters?\");\n\n lowerConfirm = window.confirm(\"Would you like to include Lowercase Letters?\");\n\n numConfirm = window.confirm(\"Would you like to include numbers?\");\n\n charConfirm = window.confirm(\"Would you like to include special characters?\");\n console.log(upperConfirm, lowerConfirm, numConfirm, charConfirm)\n\n // if they don't select any they will be alerted that they must choose at least one \n if (upperConfirm === false && lowerConfirm === false && numConfirm === false && charConfirm === false) {\n alert(\"MUST SELECT AT LEAST ONE!\")\n return;\n }\n\n // if the user chooses upper case character \n // it will randomly use the uppercase character array\n // making array available to generate password \n if (upperConfirm === true) {\n characterChoices.push(upperAlpha);\n }\n\n // if the user chooses lower case character \n // it will make the lower case array available \n // for random selections\n if (lowerConfirm === true) {\n characterChoices.push(lowerAlpha);\n }\n\n // if the user chooses number character \n // it will make the numbers array available \n // for random selections\n if (numConfirm === true) {\n characterChoices.push(numbers);\n }\n\n // if the user chooses special characters \n // it will make the special characters array available \n // for random selections\n if (charConfirm === true) {\n characterChoices.push(specChar);\n }\n\n // initilizing the password to be empty \n var password = \"\";\n\n // for loop to create random password of charNum\n for (let i = 0; i < charNum; i++) {\n // getting the index of one of the arrays that has characters that we want to use \n var num = Math.floor(Math.random() * characterChoices.length);\n // charArray is a reference to one the arrays defined above \n var charArray = characterChoices[num];\n // here we get the random index of the character in the charArray\n var randomcharacterposition = Math.floor(Math.random() * charArray.length);\n // now adding the random character to the end of the password\n password += charArray[randomcharacterposition];\n }\n // returning password to be displayed \n return password;\n}", "title": "" }, { "docid": "75f23d774d21ba14d9c2d38dd987b5ff", "score": "0.6673664", "text": "function generatePassword() {\n // get the criteria from the user\n getCriteria();\n\n //get at least on character of each type\n eachCharacter = getvalues(eachCharacter);\n\n //get all the characters needed for the password , all the characters are equal to lengthOfPassword from user\n while (allCharacters.length < lengthOfPassword) {\n allCharacters = getvalues(allCharacters);\n }\n\n // insert necessary characters into all the characters string at random\n for (var i = 0; i < eachCharacter.length; i++) {\n var val = Math.floor(Math.random() * allCharacters.length);\n\n allCharacters[val] = eachCharacter[i];\n }\n\n return allCharacters;\n}", "title": "" }, { "docid": "cef6ad658f4d5eb220e80c5f26311e3b", "score": "0.667232", "text": "function generatePassword() {\n // IPO - input processing output\n // prompt the user for the input\n // use confirm() and or prompt()\n // prompt() javascript -- w3\n // one after another\n\n var pLength = prompt(\"how long do you want the password to be? choose between 7-128\")\n\n var valid = false;\n // while I havenot confirmed validity do this\n while (!valid) {\n if (\n pLength < 7\n || pLength > 128\n || isNaN(parseInt(pLength))\n ) {\n pLength = prompt(\"invlid try again. choose between 7-128\")\n }\n else {\n valid = true; //sentry variable\n }\n }\n console.log(pLength);\n\n var specialCharacters = confirm(\"do you want special characters?\");\n\n var numericCharacters = confirm(\"do you want numeric characters?\");\n\n var lowercaseCharacters = confirm(\"do you want lowercase characters?\");\n\n var uppercaseCharacters = confirm(\"do you want uppercase characters\");\n\n\n // remember to assign to variables\n /*\n do you want spec chars\n var specChar = prompt()\n */\n // use those inputs to generate a password (string)\n // if spec chars is true (condition)\n // create a string with a special character\n\n\n// define emmpty strings will be used later if needed\n var symbols = \" \";\n var numbers = \" \";\n var lowercase = \" \";\n var uppercase = \" \";\n \n\n if (specialCharacters) {\n var symbols = '!\"#$%&\\'()*+,-./:;<=>?@^[\\\\]^_`{|}~';\n }\n\n if (numericCharacters) {\n var numbers = '0123456789';\n }\n\n if (lowercaseCharacters) {\n var lowercase = 'abcdefghijklmnopqrstuvwxyz';\n }\n\n if (uppercaseCharacters) {\n var uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n }\n\n var all = uppercase + lowercase + numbers + symbols;\n\n console.log(all);\n\n var password = '';\n for (var index = 0; index < pLength; index++) {\n var randomNumber = Math.floor(Math.random() * all.length);\n console.log(randomNumber);\n password += all.substring(randomNumber, randomNumber + 1);\n console.log(password);\n }\n\n copyBtn.classList.remove(\"hide\");\n return password;\n\n}", "title": "" }, { "docid": "6e06597c7df216618832d206ef642325", "score": "0.6671089", "text": "function generatePassword() {\n let passwordLength = prompt(\"How many characters are in your password? Enter a number between 8-128\");\n passwordLength = parseInt(passwordLength)\n if (passwordLength >= 8 && passwordLength <= 128) {\n const includeUpper = confirm(\"Should the password include uppcase letters?\");\n const includeLower = confirm(\"Should the password include Lowercase letters?\");\n const includeNumber = confirm(\"Should the password include numbers?\");\n const includeSymbols = confirm(\"Should the password include special characterss?\");\n if (includeUpper === true || includeLower === true || includeNumber === true || includeSymbols === true) {\n let temporaryPassword = \"\";\n for (var i = 1; i <= passwordLength; i++) {\n if (includeUpper) {\n temporaryPassword += getRandomUpper();\n }\n if (includeLower) {\n temporaryPassword += getRandomLower();\n }\n if (includeNumber) {\n temporaryPassword += getRandomNumber();\n }\n if (includeSymbols) {\n temporaryPassword += getRandomSymbol();\n }\n }\n return temporaryPassword.substr(0, passwordLength);\n } else {\n alert(\"Must include at least one requirment\")\n }\n } else {\n alert(\"Password length needs to be more than 8 and less than 128\");\n }\n}", "title": "" }, { "docid": "5fa11ab6e504468305c13a4606501937", "score": "0.66676235", "text": "function criteria () {\n\n //Prompt user is they want to include numbers in the password, default answer set to Y\n charNumber = prompt(\"Would you like to include NUMBERS in your new ultra-secure password? Type in Y or N\", \"Y\");\n //console.log(promptAnswer.includes(charNumber));\n while (!promptAnswer.includes(charNumber.toLowerCase())) {\n alert(\"Please type in a 'Y' or an 'N' to continue\");\n charNumber = prompt(\"Would you like to include NUMBERS in your new ultra-secure password? Type in Y or N\", \"Y\");\n //console.log(charNumber.toLowerCase());\n }\n\n //Prompt user if they want to include special characters in the password, default answer set to Y\n charSpecial = prompt(\"Would you like to include SPECIAL characters in your new ultra-secure password? Type in Y or N\", \"Y\");\n //console.log(promptAnswer.includes(charSpecial));\n while (!promptAnswer.includes(charSpecial.toLowerCase())) {\n alert(\"Please type in a 'Y' or an 'N' to continue\");\n charSpecial = prompt(\"Would you like to include SPECIAL characters in your new ultra-secure password? Type in Y or N\", \"Y\");\n //console.log(charSpecial.toLowerCase());\n }\n\n //Prompt user if the want to include capital letters in the password, default answer set to Y\n charCapital = prompt(\"Would you like to include CAPITAL letters in your new ultra-secure password? Type in Y or N\", \"Y\");\n //console.log(promptAnswer.includes(charCapital));\n while (!promptAnswer.includes(charCapital.toLowerCase())) {\n alert(\"Please type in a 'Y' or an 'N' to continue\");\n charCapital = prompt(\"Would you like to include CAPITAL letters in your new ultra-secure password? Type in Y or N\", \"Y\");\n //console.log(charCapital.toLowerCase());\n }\n\n //Prompt user for length of password, default answer set to 10\n var pwLength = prompt(\"Finally, how LONG would you like your password to be (How many characters)? Please type in a number greater than 7 and less than 129.\", \"10\");\n //console.log(pwLength);\n pwLengthPerm = parseInt(pwLength);\n //console.log(pwLengthPerm);\n while (pwLengthPerm < 8 || pwLengthPerm > 128) {\n alert(\"That number is invalid.\");\n pwLength = prompt(\"How LONG would you like your password to be (How many characters)? Please type in a number greater than 7 and less than 129.\", \"10\");\n //console.log(pwLength);\n\n //Permanent Conversion of Password Length to an integer\n pwLengthPerm = parseInt(pwLength);\n //console.log(pwLengthPerm);\n }\n}", "title": "" }, { "docid": "47c9a4843d0c87ad145156a914d85c10", "score": "0.66663605", "text": "function generatePassword() {\n\n // Prompt user for password length.\n var passwordLength = prompt(\"Please select a password length between 8 and 128 characters.\");\n\n // Variable declared to store password that's generated.\n var password = \"\";\n\n // While loop to make sure user selects correct password length.\n while(passwordLength < 8 || passwordLength > 128){\n alert(\"Invalid password length.\");\n passwordLength = prompt(\"Please select a password length between 8 and 128 characters.\");\n }\n\n // Confirm variables declared to store user selection on character types.\n var uppercaseConfirm = confirm(\"Would you like to include uppercase letters?\");\n var lowercaseConfirm = confirm(\"Would you like to include lowercase letters?\");\n var numbersConfirm = confirm(\"Would you like to include numbers?\");\n var symbolsConfirm = confirm(\"Would you like to include symbols?\");\n\n // While loop to make sure user selects at least one character type.\n while(!uppercaseConfirm && !lowercaseConfirm && !numbersConfirm && !symbolsConfirm){\n alert(\"Please select at least one character type.\");\n uppercaseConfirm = confirm(\"Would you like to include uppercase letters?\");\n lowercaseConfirm = confirm(\"Would you like to include lowercase letters?\");\n numbersConfirm = confirm(\"Would you like to include numbers?\");\n symbolsConfirm = confirm(\"Would you like to include symbols?\");\n }\n\n // If statement to generate random password when user selects all four character types.\n if(uppercaseConfirm && lowercaseConfirm && numbersConfirm && symbolsConfirm){\n var choices = alphabetUppercase + alphabetLowercase + numbers + symbols;\n // For loop to generate password with all four character types.\n for (var i = 0; i < passwordLength; i++) {\n password += choices[Math.floor(Math.random() * choices.length)];\n }\n\n return password; \n\n } \n \n // Else if statement to generate random password when user selects lowercase, numbers, and symbols.\n else if(lowercaseConfirm && numbersConfirm && symbolsConfirm){\n var choices = alphabetLowercase + numbers + symbols;\n // For loop to generate random password when user selects lowercase, numbers, and symbols.\n for (var i = 0; i < passwordLength; i++) {\n password += choices[Math.floor(Math.random() * choices.length)];\n }\n\n return password; \n\n } \n \n // Else if statement to generate random password when user selects numbers and symbols.\n else if(numbersConfirm && symbolsConfirm){\n var choices = numbers + symbols;\n // For loop to generate random password when user selects numbers and symbols.\n for (var i = 0; i < passwordLength; i++) {\n password += choices[Math.floor(Math.random() * (choices.length))];\n }\n\n return password; \n\n } \n \n // Else statement when user only selects symbols.\n else {\n\n // For loop to generate random password when user selects symbols.\n for (var i = 0; i < passwordLength; i++) {\n password += symbols[Math.floor(Math.random() * symbols.length)];\n }\n\n return password; \n\n } \n\n}", "title": "" }, { "docid": "579b26cd1c45bc12fb2f1860b090c0b0", "score": "0.66632974", "text": "function generatePassword() {\n\n // Arrays for different sets of characters\n\n var lowercaseChars = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n var uppercaseChars = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"];\n var numericChars = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"];\n var specialChars = [\"~\",\"!\",\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"(\",\")\",\"_\",\"-\",\"+\",\"=\",\"`\",\"<\",\",\",\">\",\".\",\"?\",\"/\",\"{\",\"}\",\"[\",\"]\",\"|\"];\n \n // Creates \"myPassword\" variable\n\n var myPassword = \"\"\n\n // Prompts user to choose length of password; re-prompts them if they choose too few or too many characters\n\n var pwLength = parseInt(prompt('How many chars?'));\n\n if (pwLength < 8 || pwLength > 128 || isNaN(pwLength)) {\n alert(\"Please choose a number between 8 and 128.\");\n pwLength = parseInt(prompt('How many chars?'));\n }\n\n // Prompts user to decide whether or not to include different character types\n\n var pwLowercase = confirm(\"Include lowercase characters?\");\n var pwUppercase = confirm(\"Include uppercase characters?\");\n var pwNumeric = confirm(\"Include numbers?\");\n var pwSpecial = confirm(\"Include special characters?\");\n var typeCount = 0\n\n // Makes user go back if they don't select any of the 4 character types\n\n if (pwLowercase === false && pwUppercase === false && pwNumeric === false && pwSpecial === false) {\n alert(\"Please choose at least character type.\");\n return generatePassword();\n }\n\n // Setting a variable for how many types of characters the user has selected to use in their password\n\n if (pwLowercase === true) {\n typeCount ++;\n }\n\n if (pwUppercase === true) {\n typeCount ++;\n }\n\n if (pwNumeric === true) {\n typeCount ++;\n }\n\n if (pwSpecial === true) {\n typeCount ++;\n }\n // For-loop to choose random characters of each type to add to the password\n \n if (pwLowercase === true) {\n var lowerCount = pwLength / typeCount;\n for (var i = 0; i < lowerCount; i++) {\n var randomIndex = Math.floor(Math.random() * lowercaseChars.length);\n var randomLowercase = lowercaseChars[randomIndex];\n myPassword = myPassword + randomLowercase;\n }\n }\n \n if (pwUppercase === true) {\n var UpperCount = pwLength / typeCount;\n for (var i = 0; i < UpperCount; i++) {\n var randomIndex = Math.floor(Math.random() * uppercaseChars.length);\n var randomUppercase = uppercaseChars[randomIndex];\n myPassword = myPassword + randomUppercase;\n }\n }\n \n if (pwNumeric === true) {\n var numericCount = pwLength / typeCount;\n for (var i = 0; i < numericCount; i++) {\n var randomIndex = Math.floor(Math.random() * numericChars.length);\n var randomNumeric = numericChars[randomIndex];\n myPassword = myPassword + randomNumeric;\n }\n }\n \n if (pwSpecial === true) {\n var specialCount = pwLength / typeCount;\n for (var i = 0; i < specialCount; i++) {\n var randomIndex = Math.floor(Math.random() * specialChars.length);\n var randomSpecial = specialChars[randomIndex];\n myPassword = myPassword + randomSpecial;\n }\n }\n \n// Defines \"shortenPassword\" function\n\n function shortenPassword() {\n originalPassword = myPassword;\n shortenedPassword = originalPassword.slice((myPassword.length - pwLength));\n }\n\n// Calls \"shortenPassword\" function & redfines \"myPassword\" variable if password is too long\n\n if (myPassword.length > pwLength) {\n shortenPassword();\n myPassword = shortenedPassword;\n }\n\n// Jumbles up the characters in the password\n\n var jumbledPassword = myPassword.split('').sort(function(){return 0.5-Math.random()}).join('');\n\n myPassword = jumbledPassword;\n\n// Returns value of \"myPassword\" so it can be fed into \"writePassword\" function\n\n return myPassword;\n\n}", "title": "" } ]
8a33623704adf73dccabfb0ea1b5ae6c
replace the username and password with right one to use properly
[ { "docid": "4747c6511228ececc034de347f174219", "score": "0.0", "text": "function objectIdWithTimestamp(timestamp) {\n // Convert string date to Date object (otherwise assume timestamp is a date)\n if (typeof(timestamp) == 'string') {\n timestamp = new Date(timestamp);\n }\n // Convert date object to hex seconds since Unix epoch\n var hexSeconds = Math.floor(timestamp/1000).toString(16);\n\n // Create an ObjectId with that hex timestamp\n var constructedObjectId = require('mongodb').ObjectId(hexSeconds + \"0000000000000000\");\n\n return constructedObjectId\n}", "title": "" } ]
[ { "docid": "8caad905935b18142710738f31e5b823", "score": "0.7172745", "text": "function correctCredentials(username, password){\n return username === \"admin\" && password === \"admin\";\n}", "title": "" }, { "docid": "f072a650e2def626d0a5be419a74932e", "score": "0.64473045", "text": "static async authenticate(username, password) { }", "title": "" }, { "docid": "90c07d3503b4a6ef652b3df83ffcbd6b", "score": "0.63576525", "text": "function checkPassword(user, password){\n\n}", "title": "" }, { "docid": "f7e1a964f18563034d57b83d3ba385c8", "score": "0.634351", "text": "function encode(password) { return \"!\" + password + \"!\"; }", "title": "" }, { "docid": "f7f4d2a4c21b7938f93e2ce762a297bd", "score": "0.6299843", "text": "loginWith(username, pass) {\n this.userFld.setValue(username);\n this.passFld.setValue(pass);\n }", "title": "" }, { "docid": "3dd21097563011626d63e0354a77630a", "score": "0.6238147", "text": "static async login({username, password}) {\n const res = await db.query(\n ` SELECT password, is_admin, username FROM users WHERE username = $1`\n , [username]);\n const user = res.rows[0];\n if(user) {\n if(await bcrypt.compare(password, user.password)) {\n return user;\n }\n }\n const invalidPass = new Error(\"Invalid Credentials\");\n invalidPass.status = 401;\n throw invalidPass;\n }", "title": "" }, { "docid": "92cf65aa523388448da7b5cd6b8fdb49", "score": "0.61467457", "text": "function login(name ,pw ,isValidUser){\n\tisValidUser(name,pw);\n}", "title": "" }, { "docid": "6b275a52ce7a6ce8d48b37bc018af281", "score": "0.612693", "text": "login(username = 'different_stv', password = 'passforqa'){\n // login(username = \"Slava+\"randomNumber()+\"gmail.com\", password = 'different_qa'){\n this.usernameTxt.setValue(username);\n this.PasswordTxt.setValue(password);\n this.LoginLnk.click();\n }", "title": "" }, { "docid": "d6dc256984f3ed45c6e9d1f6c381aa88", "score": "0.61226785", "text": "signin(/*username, password*/) {}", "title": "" }, { "docid": "e8864b38eb5a10e3a8d1d5cfb6ab6e64", "score": "0.6088601", "text": "setLogin(username, password) {\n log.debug(\"User login: \"+username)\n client = client.wrap(basicAuth, { username: username, password: password });\n }", "title": "" }, { "docid": "6ded55478cb6fdd873ff1ace1c318f92", "score": "0.6088234", "text": "function prepareUserCredentials() {\n\t\tif (userCredentials.username && userCredentials.password) {\n\t\t\t// We got username and password so try to sign on with them\n\t\t\tdoSignOn(userCredentials);\n\t\t} else {\n\t\t\tif (!userCredentials.username) {\n\t\t\t\t// Since we didn't find a username, clear anything we did find\n\t\t\t\tuserCredentials.password = undefined;\n\t\t\t\tuserCredentials.devicename = undefined;\n\t\t\t}\n\t\t\tcreateSignOnDialog();\n\t\t}\n\t}", "title": "" }, { "docid": "c74fb766a1285d8ed1b53aef5f0a67e7", "score": "0.60416174", "text": "async authUserPass() {\n const data = await this.consume();\n if (data[0] != 0x01) {\n this.logger.error('Unsupported auth version: %d', data[0]);\n this.socket.end();\n return true;\n }\n\n const ulen = data[1];\n const uname = data.toString('ascii', 2, 2+ulen);\n const plen = data[2+ulen];\n const passwd = data.toString('ascii', 2+ulen+1, 2+ulen+1+plen);\n\n this.logger.debug('uname: %s, passwd: %s', uname, passwd);\n\n if (this.userPassAuthFn(uname, passwd)) {\n this.socket.write(Buffer.from([0x01, 0x00]));\n } else {\n this.socket.end(Buffer.from([0x01, 0x01]));\n return true;\n }\n }", "title": "" }, { "docid": "6c31bdd04500aac9fcecff8b6d5a247d", "score": "0.60250795", "text": "function make_base_auth(user, password) {\n var tok = user + ':' + pass;\n var hash = $.base64.encode(tok);\n return \"Basic \" + hash;\n }", "title": "" }, { "docid": "60a5eb30dada4023925574ea02f69238", "score": "0.60203016", "text": "function authenticate(username, password) {\n return (username === 'john' && password === '123');\n}", "title": "" }, { "docid": "87eae09395c3508c66afe4f29ed691ab", "score": "0.6008736", "text": "function usernamePasswordUser(req,res){\n\n\n var username = req.query.username;\n var password = req.query.password;\n var cred = {username: username,\n password: password\n };\n var user = userModel.findUserByCredentials(cred);\n res.json(user);\n }", "title": "" }, { "docid": "ad0fe59f9a9188a2e67949ae48535822", "score": "0.5998657", "text": "function getAuth(username, password, callback) {\n\n var passwordHash = hash(password);\n\n conn.query(\n 'select * from users where user_name = ? and password_hash = ?', \n [username, passwordHash], \n callback\n );\n}", "title": "" }, { "docid": "6895a26fb3996e4230cc7e26574f1426", "score": "0.5995397", "text": "function make_base_auth(user, password) {\r\n var tok = user + ':' + password;\r\n var hash = Base64.encode(tok);\r\n return \"Basic \" + hash;\r\n}", "title": "" }, { "docid": "e42c6b2ea92998b6d5ea46dd00d00515", "score": "0.59803903", "text": "function validateUser(username,password) {\n if(username=='nacho' && password=='Nerd1979'){\n console.log(`Welcome ${username}, nice to see you again`);\n }else if(username=='pedro' && password=='Batman0217'){\n console.log(`Welcome ${username}, nice to see you again`);\n }else if(username=='marta' && password=='Mother2312'){\n console.log(`Welcome ${username}, nice to see you again`);\n }else{\n console.log('Please input valid credentials');\n }\n}", "title": "" }, { "docid": "7bfb2c60a5ca94f33a25fd689c40a692", "score": "0.597356", "text": "static async authenticate(data) {\n //check the user\n const result = await db.query(\n `SELECT username, \n password, \n first_name, \n last_name, \n email,\n phone,\n photo_url\n FROM users \n WHERE username = $1`,\n [data.username]\n );\n const user = result.rows[0];\n if (user) {\n // compare hashed password to a new hash from password\n const isValid = await bcrypt.compare(data.password, user.password);\n if (isValid) {\n return user;\n }\n }\n\n throw new APIError(401, 'Invalid PW');\n }", "title": "" }, { "docid": "3472b113652343b7bd9a0b41cd3ebffe", "score": "0.5951944", "text": "function credentialsFromUrl(parts) {\n var user = 'guest', passwd = 'guest';\n if (parts.username != '' || parts.password != '') {\n user = (parts.username) ? unescape(parts.username) : '';\n passwd = (parts.password) ? unescape(parts.password) : '';\n }\n return credentials.plain(user, passwd);\n}", "title": "" }, { "docid": "8bb204681d78664b7689c53e2213d9a0", "score": "0.59441113", "text": "handleChangeUserName() {\n var pwd = this.usernamePassword.value;\n var newUserName = this.username.value;\n this.props.handleChangeUserName(newUserName, pwd);\n }", "title": "" }, { "docid": "9a457d65298dda51ea1193fc46f2058b", "score": "0.59141", "text": "constructor(userName, passWord) {\n this.name = userName;\n this.pass = passWord\n }", "title": "" }, { "docid": "4e50fac556754fc57f08af3d7eb952ed", "score": "0.59000254", "text": "function userInfo(username, password) {\n if (username === 'elevenfifty' && password === 'Letmein1234!') {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "45acddf2dced5f4a4166c5f099a15455", "score": "0.5890294", "text": "function makeHttpAuth(password) {\n var str = program.user + ':' + program.realm + ':' + password\n var hash = crypto.createHash('MD5')\n hash.update(str)\n return program.user + ':' + program.realm + ':' + hash.digest('hex')\n}", "title": "" }, { "docid": "7db18a5509ad93470f6508cd37269b18", "score": "0.5873038", "text": "changeUser(username, newUsername, newPassword) {\n\t\tthrow new Error('Not implemented yet');\n\t\t// use changeUser\n\t}", "title": "" }, { "docid": "a681e064053a1e0f805ca6469a5097a9", "score": "0.5863336", "text": "function login(username, password) {\n // console.log('leaking secrets', username, password)\n store.action(actions.login)(username.toLowerCase(), password);\n}", "title": "" }, { "docid": "4a5dc4c484451bd17d56d727e32c5813", "score": "0.5844067", "text": "function replacer(key,value){\n if (key==\"password\") return undefined;\n \n else return value;\n}", "title": "" }, { "docid": "5cd95c1ff8680243fb79151cf32d00fe", "score": "0.58372974", "text": "function validate_user(username, password) {\n\n return true;\n}", "title": "" }, { "docid": "992c444b8424ab4aef10cecdd8e894ea", "score": "0.5834327", "text": "function auth (username, password) {\n // Allow specifying it as one argument (mostly for CLI inputability)\n if (password === undefined) {\n const i = username.indexOf(':');\n if (i > -1) {\n password = username.slice(i + 1);\n username = username.slice(0, i);\n } else {\n password = ''; // Enables the .auth(GITHUB_TOKEN) no-username shorthand\n }\n }\n return { username, password }\n}", "title": "" }, { "docid": "a5543e0a122f9c69bc655c38fbd9745c", "score": "0.58341855", "text": "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var user = users[name]; // lấy tên người dùng\n // query the db for the given username\n if (!user) return fn(new Error('cannot find user')); // nếu không có user thông báo lỗi\n // apply the same algorithm to the POSTed password, applying\n // the hash against the pass / salt, if there is a match we\n // found the user\n hash(pass, user.salt, function(err, hash){ // truyền vào các tham số và kiểm tra mã băm của pass có chùng với mã băm của user.hash đã khởi tạo ở bước trc không\n if (err) return fn(err);\n if (hash == user.hash) return fn(null, user);\n fn(new Error('invalid password'));\n });\n}", "title": "" }, { "docid": "1ad4271d02bf29194d2a0a7fdc95e65e", "score": "0.58217555", "text": "function resetExistingUserField() {\r\n self.existingUser.username('');\r\n self.existingUser.password('');\r\n }", "title": "" }, { "docid": "9851dd1b5d5d4e0f2880f3b562ce2d57", "score": "0.5816142", "text": "function basicAuth(user, password)\n{\n var tok=user+':'+password;\n var hash=btoa(tok);\n return 'Basic '+hash;\n}", "title": "" }, { "docid": "b5decbbb7f3bb5daabd00e03f6df3255", "score": "0.5796289", "text": "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n let user = users.find(u => u.name === name);\n // query the db for the given username\n if (!user) return fn(new Error('cannot find user'));\n // apply the same algorithm to the POSTed password, applying\n // the hash against the pass / salt, if there is a match we\n // found the user\n // secure({ password: pass, salt: key }, function (err, pass, salt, hash) {\n // if (err) return fn(err);\n // if (hash == hashKey) return fn(null, user);\n // fn(new Error('invalid password'));\n // });\n if(pass === user.password) return fn(null,user);\n fn(new Error('invalid password'));\n}", "title": "" }, { "docid": "79c4f76d6642c2217bd49dd199b64c69", "score": "0.57892716", "text": "function password(val){\n if(true){\n return ('Please enter a password containing at least 10 characters ')\n } else {\n return (`Login to access your account.`)\n }\n }", "title": "" }, { "docid": "1f169c7855b746fd468ee183a0c4bcb9", "score": "0.57843786", "text": "function mostrapassr() {\n\t\n\t var x = document.getElementById(\"pass1\");\n\t var x1 = document.getElementById(\"pass2\");\n\t \n\t if (x.type === \"password\") {\n\t x.type = \"text\";\n\t } else {\n\t x.type = \"password\";\n\t }\n\t if (x1.type === \"password\") {\n\t\t x1.type = \"text\";\n\t\t } else {\n\t\t x1.type = \"password\";\n\t\t }\n\t\n}", "title": "" }, { "docid": "a23e501815318f98a2187c92780b3400", "score": "0.57841307", "text": "function passwordChecker(username, password) {\n if (username === bankDataBase[0] && password === bankDataBase[1]) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "2ced0a716caf9742a5eba7d717e95592", "score": "0.57684594", "text": "function validFields(username,password){\n\t\treturn username != \"\" && password != \"\";\n\t}", "title": "" }, { "docid": "67a9a957edc1d0731271a2e4c3b7e499", "score": "0.5743036", "text": "set password(password){\n this._password = password;\n }", "title": "" }, { "docid": "c9497622824a19340e7c801daf628acb", "score": "0.57263494", "text": "function practiceLogin(username, password) {\n if (username === \"elevenfiftyuser\" && password === \"Letmein1234!\") {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "fa1aa573c294ceb89c5ba54f7c986731", "score": "0.572356", "text": "authenticate_user(user_name, pw) {\n\n let token = `Basic ${Buffer.from(`${user_name}:${pw}`).toString(\"base64\")}`;\n\n return this.find_user(user_name, pw, token).then((user) => {\n return this.authenticate_ldap(user.dn, pw);\n });\n }", "title": "" }, { "docid": "0cc7005be63f0a9777c175f087a783c4", "score": "0.571619", "text": "function passwordCallback(password) {\n\t\tuserCredentials.password = password;\n\t\tprepareUserCredentials();\n\t}", "title": "" }, { "docid": "f8c9859fa1d60cc0d3d74e0a09f4022f", "score": "0.5710633", "text": "function changeCredentials() {\n\t// don't be too confident : check if it's the good user\n\tvar _oldPass = window.prompt('Veuillez rentrer votre ancien mot de passe', '');\n\t\n\tif (_oldPass == null) {\n\t\treturn;\n\t}\n\t\n\tif (myKey.validatePassword(_oldPass) !== true) {\n\t\twindow.alert('Erreur : mot de passe invalide');\n\t\tlogout(); // out, bitch\n\t\treturn;\n\t}\n\t\n\tvar _user = window.prompt(\"Veuillez rentrer le nouveau nom d'utilisateur\", '');\n\t\n\tif (_user == null) {\n\t\treturn;\n\t}\n\t\n\tif (_user != '') {\n\t\t// now ask for new password\n\t\tvar _pass = window.prompt('Veuillez rentrer le nouveau mot de passe', '');\n\t\t\n\t\tif (_pass == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (_pass != '') {\n\t\t\t// confirm password\n\t\t\tvar _pass2 = window.prompt('Veuillez confirmer le nouveau mot de passe', '');\n\t\t\t\n\t\t\tif (_pass2 != _pass) {\n\t\t\t\terror(\"Les mots de passe ne correspondent pas\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// backup credentials in globals, for next function\n\t\t\tnewUser = _user;\n\t\t\tnewPass = doPbkdf2(_pass, myKey.salt);\n\t\t\tnewKey = hmac(newPass, myKey.token);\n\t\t\t\n\t\t\t// we have to re-encrypt everything (all content & all sections)\n\t\t\tvar _content = {};\n\t\t\tfor (var _section in myKey.data) {\n\t\t\t\t_content[_section] = {id: myKey.data[_section][\"id\"], title: myEncrypt(myKey.data[_section][\"title\"], newPass), content: myEncrypt(JSON.stringify(myKey.data[_section][\"content\"]), newPass)};\n\t\t\t}\n\t\t\t\n\t\t\t// send it back\n\t\t\t$.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: serverUrl+\"request/credentials_changed\",\n\t\t\t\tdata: {user: myKey.user, key: myKey.key, newUser: newUser, newKey: newKey, newContent: JSON.stringify(_content)},\n\t\t\t\tsuccess : changeCredentialsMemory,\n\t\t\t\terror: serverError\n\t\t\t});\t\n\t\t} else {\n\t\t\terror(\"Veuillez rentrer un mot de passe !\");\n\t\t}\n\t} else {\n\t\terror(\"Veuillez rentrer un nom d\\'utilisateur !\");\n\t}\t\n}", "title": "" }, { "docid": "09a5a98f2df7b280c15a0e9f3b8c9758", "score": "0.5706284", "text": "static authUser(username, password, result) {\n db.query(`SELECT * FROM users WHERE username = \"${username}\"`)\n .then((tuples) => {\n if (!tuples[0].length) {\n return result({message: 'Invalid email or password.'});\n }\n if (!(tuples[0][0].password == password)) {\n return result({message: 'Invalid email or password.'});\n }\n return result({message: \"Success\"});\n })\n .catch(function (error) {\n console.log(error);\n })\n }", "title": "" }, { "docid": "e370c5c7cf3ca11992059a2039bd6540", "score": "0.5702365", "text": "static get password() {\n return \"B-e-a8969\";\n }", "title": "" }, { "docid": "d536b5032a14048a6f4b9384f706b79f", "score": "0.5698089", "text": "function Credentials() {\n this.userName = \"\";\n this.passWord = \"\";\n}", "title": "" }, { "docid": "098c9c3feda7d673185b31fd9643fb84", "score": "0.5695647", "text": "set password(value) {\n this._parsedUrl.set('password', value);\n }", "title": "" }, { "docid": "20ae802d06fa726a7b5829cb926d0449", "score": "0.5689595", "text": "static emailPassword(email, password) {\n return new Credentials(\"local-userpass\", \"local-userpass\", {\n username: email,\n password,\n });\n }", "title": "" }, { "docid": "14c728a7e9d35d990ee3972bfe69c558", "score": "0.5685609", "text": "isCorrectPassword(passwd) {\n return this.password === encrypt(passwd);\n }", "title": "" }, { "docid": "0d67ad125c392f82c765ff7119f33af7", "score": "0.5685144", "text": "function handle_username()\n{\n entry = document.getElementById(\"username_entry\");\n document.body.style.cursor = \"initial\";\n lightdm.authenticate(entry.value);\n}", "title": "" }, { "docid": "ed8a4f66580927681b84a268a5c5c478", "score": "0.56792736", "text": "async convertToApppassword() {\n const data = await this._doApiCall(apiUrlGetApppassword);\n if (data && data.apppassword) {\n // Test if the apppassword really works with the given username\n const oldpassword = this.password;\n this.password = data.apppassword;\n const r = await this._doApiCall(apiUrlUserID);\n if (r._failed || r.status >= 900) {\n this.password = oldpassword;\n } else {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "b9426f46df7e66b9676238260d0759f1", "score": "0.56766886", "text": "function rewritePassword() {\n for (var i = 0; i < password.length; i++) {\n if (password.charAt(i) == \" \") {\n password_hidden += \" \";\n } else {\n password_hidden += \"-\";\n }\n }\n}", "title": "" }, { "docid": "7e1f0501e42005ff135cd31415e09b83", "score": "0.56674033", "text": "function authenticate(name, pass, fn) {\n\t if (!module.parent) console.log('authenticating %s:%s', name, pass);\n\n\t User.findOne({\n\t username: name\n\t },\n\n\t function (err, user) {\n\t if (user) {\n\t if (err) return fn(new Error('cannot find user'));\n\t hash(pass, user.salt, function (err, hash) {\n\t if (err) return fn(err);\n\t if (hash == user.hash) return fn(null, user);\n\t fn(new Error('invalid password'));\n\t });\n\t } else {\n\t return fn(new Error('cannot find user'));\n\t }\n\t });\n\n\t}", "title": "" }, { "docid": "8041270db3b8799561578eb5d5872b97", "score": "0.5665976", "text": "function checkPass() {\n loginService.checkPass( tc.user.username, function(response) {\n if ( response.update == true ) {\n tc.settings( response.update );\n }\n }, function( error ) {\n tc.toast( \"Could not check if password needs to be updated.\" );\n });\n }", "title": "" }, { "docid": "b61ed5d17985e8ad98202ea817283980", "score": "0.566573", "text": "mapPropsToValues({ username, password }) {\n return {\n username: username || '',\n password: password || ''\n };\n }", "title": "" }, { "docid": "c33d1bbe20a9a9e43ecd9ca87bcb53e4", "score": "0.56656516", "text": "function login(username, password) {\n if (username === \"trevor\" && password === \"chicken\") {\n return true;\n } else if (username === \"moath\" && password === \"bigchicken\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "cb073373a7d3e1a50cfa836eb80f50c4", "score": "0.56600475", "text": "function setPassword(userData) {\n\tvar salt = makeSalt();\n\tuserData['salt'] = salt;\n\t// userData['hashedPassword'] = encryptPassword(salt, userData.password);//TODO uncomment this and remove below line\n\tuserData['hashedPassword'] = userData.password;\n\tdelete userData['password'];\n\n}", "title": "" }, { "docid": "9a4214de7df899a3d9f83b0b49169fa9", "score": "0.5656192", "text": "function init() {\r\n var username = paramenters[\"username\"];\r\n var password = paramenters[\"password\"];\r\n getInputFields();\r\n writeToInputFields(username, password);\r\n }", "title": "" }, { "docid": "2580f3297ecf8cb8694cdb984eb9f539", "score": "0.5651448", "text": "function auth(username, password, res) {\n\n\tif (username == conf.username && bcrypt.compareSync(password, conf.password)) {\n\t\treturn true;\n\t} else {\n\t\tres.send(401);\n\t}\n}", "title": "" }, { "docid": "10fe4f927d638bd8ba6ae987c085d54f", "score": "0.5650667", "text": "authenticate(username, password, callback){\n if(username === this.ADMIN_NAME){\n return callback(password === this.ADMIN_PASSWORD);\n }\n this.db.getApiKeyDigest(username, digest => {\n callback(Auth.verifyEqual(password, digest));\n });\n }", "title": "" }, { "docid": "4ea4affc8c4a267b755a2e30b9cb9125", "score": "0.5646394", "text": "function createAndStoreNewUsernameAndPassword() { //use this function to create a new password. doesn't necessarily need to be in the code\n\n usernamev = document.getElementById(\"userCreate\").value;\n passwordv = document.getElementById(\"passwordCreate\").value\n\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"result\").innerHTML = this.responseText;\n }\n };\n xhttp.open(\"POST\", custURL + \"?Username=\" + usernamev \n + \"&Password=\" + passwordv\n , true);\n xhttp.send();\n}", "title": "" }, { "docid": "9a19f7333fedc87a126ddec49f3c78fc", "score": "0.5644485", "text": "static async authenticate(username, password) {\n const result = await db.query(\n `SELECT password\n FROM users\n WHERE username = $1`,\n [username]\n );\n const user = result.rows[0];\n\n if (user) {\n return (await bcrypt.compare(password, user.password) === true);\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "520e205a871a9a525477392b4a1aa732", "score": "0.5643362", "text": "function validUser(user, password) {\n\treturn user === 'viferga' && password === '123';\n}", "title": "" }, { "docid": "04d63fd3a2ed20320269f87488d48200", "score": "0.5642407", "text": "function autenticar(name, password, res){\n // usually this would be a database call:\n var user = users[_.findIndex(users, {name: name})];\n if( ! user ){\n return res.status(401).json({message:\"no such user found\"});\n }\n\n if(user.password === password) {\n \n // from now on we'll identify the user by the id and the id is the only personalized value that goes into our token\n var payload = {id: user.id};\n var token = getToken(payload);\n return res.json({message: \"ok\", token: token});\n } else {\n return res.status(401).json({message:\"Password incorrecta\"});\n }\n\n}", "title": "" }, { "docid": "9495615ce3f891b91794512e1c684319", "score": "0.5634226", "text": "function checkPassword(input) {}", "title": "" }, { "docid": "233cca93214b8ba321f709c1fd3b24e1", "score": "0.56284237", "text": "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var user = users[name];\n if (!user) return fn(new Error('cannot find user'));\n hash(pass, user.salt, function(err, hash){\n if (err) return fn(err);\n if (hash == user.hash) return fn(null, user);\n fn(new Error('invalid password'));\n })\n}", "title": "" }, { "docid": "0060162a15ff0b7b2e755ca875d8b3a8", "score": "0.5620707", "text": "function checkLogin(userName, password) {\n return ((userName == cred.user) && (password == cred.pass)) ? true : false\n}", "title": "" }, { "docid": "5a370857012a28538cc97d7a09e77feb", "score": "0.56172866", "text": "function passwordtest() {\n document.getElementById('username').value;\n const user = document.getElementById('username').value;\n document.getElementById('password').value;\n const pw = document.getElementById('password').value;\n if(pw != 12345678) {\n alert('Password Incorrect')\n }\n else {\n document.getElementById('change').innerHTML = \"Welcome \" + user + \"!\";\n }\n}", "title": "" }, { "docid": "25f5c21a0412efc3973d75a915a19cf9", "score": "0.56127405", "text": "get authPassword(){\n\t\tif (\"authorization\" in $req.headers \n\t\t\t&& $req.headers.authorization[0].listFirst(\" \") == \"Basic\"\n\t\t){\n\t\t\tvar decoder = Packages.org.apache.commons.codec.binary.Base64;\n\t\t\tvar token = $req.headers.authorization[0].listLast(\" \");\n\t\t\ttoken = String(new java.lang.String((decoder.decodeBase64(new java.lang.String(token).getBytes()))));\n\t\t\treturn token.listLast(\":\");\n\t\t} else {\n\t\t\treturn \"\";\t\n\t\t}\n\t}", "title": "" }, { "docid": "413321d7e89697c3f2d5ba9fc6f18d23", "score": "0.5612077", "text": "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var user = users[name];\n if (!user) return fn(new Error('cannot find user'));\n hash(pass, user.salt, function(err, hash){\n if (err) return fn(err);\n if (hash == user.hash) return fn(null, user);\n fn(new Error('invalid password'));\n });\n}", "title": "" }, { "docid": "f71a9696c2ea6f201f54851cfc100cef", "score": "0.56076723", "text": "getPassword() {\n return super.getAsNullableString(\"password\") || super.getAsNullableString(\"pass\");\n }", "title": "" }, { "docid": "d861ef8047a326c900b0adb4246e22cd", "score": "0.5600473", "text": "function authenticate(name, pass, fn) {\n\tvar sqlite3 = require('sqlite3').verbose();\n\tvar db = new sqlite3.Database('domodb');\n\n \tdb.serialize(function () {\n\t\tconsole.log(name);\n\t\tvar stmt = 'SELECT * FROM users WHERE username = \"' + name + '\"';\n db.get(stmt, function(err, row){\n\t\t\t//db.each('SELECT * FROM users WHERE username = \"' + name + '\"', function (err, row) {\n\t\t\tif(err) return fn(err);\n\t\t\tif(typeof row == \"undefined\") {\n\t\t\t\treturn fn(new Error('User not found!'));\n\t\t\t} else {\n\t\t\t\tconsole.log(pass);\n\t\t\t\tconsole.log(row.salt);\n\t\t\t\thash(pass, row.salt, function(err, hash){\n\t\t\t\t\tif (err) return fn(err);\n\t\t\t\t\tif (hash.toString() == row.hash) return fn(null, row);\n\t\t\t\t\tfn(new Error('Invalid password!'));\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n\tdb.close();\n}", "title": "" }, { "docid": "d861ef8047a326c900b0adb4246e22cd", "score": "0.5600473", "text": "function authenticate(name, pass, fn) {\n\tvar sqlite3 = require('sqlite3').verbose();\n\tvar db = new sqlite3.Database('domodb');\n\n \tdb.serialize(function () {\n\t\tconsole.log(name);\n\t\tvar stmt = 'SELECT * FROM users WHERE username = \"' + name + '\"';\n db.get(stmt, function(err, row){\n\t\t\t//db.each('SELECT * FROM users WHERE username = \"' + name + '\"', function (err, row) {\n\t\t\tif(err) return fn(err);\n\t\t\tif(typeof row == \"undefined\") {\n\t\t\t\treturn fn(new Error('User not found!'));\n\t\t\t} else {\n\t\t\t\tconsole.log(pass);\n\t\t\t\tconsole.log(row.salt);\n\t\t\t\thash(pass, row.salt, function(err, hash){\n\t\t\t\t\tif (err) return fn(err);\n\t\t\t\t\tif (hash.toString() == row.hash) return fn(null, row);\n\t\t\t\t\tfn(new Error('Invalid password!'));\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n\tdb.close();\n}", "title": "" }, { "docid": "890c3d36c91d27ff8c95f2f4a6704c27", "score": "0.55958563", "text": "static verifyUserAndPass(req, res, next) {\n if (! req.body.username || ! req.body.password) {\n return res.json({error: 'Username and password must be provided'});\n }\n next();\n }", "title": "" }, { "docid": "7f5694d2c98d1db547c032adbda96ec4", "score": "0.55842394", "text": "function login(data) {\n var index;\n\n // \"clean up\" data\n data = data.trim().toLowerCase();\n // find user:pass combination\n index = accounts.indexOf(data);\n\n // if login successful, return user\n return (index > -1) ? (accounts[index].split(':')[0]) : false;\n}", "title": "" }, { "docid": "cf7cbf9634563d40a599b992eacce846", "score": "0.557829", "text": "static async loginAdmin(username, password){\n let collections = await DbConn.getCollection(collectionName);\n \n let query = await collections.findOne({\"username\": username})\n\n if (query==null) // não encontrou usario\n {\n console.log(\"[INFO] Login attempted failed\")\n return false\n }\n else if (password === query.password && username === query.username){\n return true;\n }\n else {// senha errada\n console.log(\"[INFO] Login attempted failed\")\n return false\n }\n\n }", "title": "" }, { "docid": "9d787bd518c9031cc19b1e85b8aa9c5a", "score": "0.55778474", "text": "function authenticate(plainTextPassword, salt, dbPassword) {\n if(encryptPassword(plainTextPassword, salt) === dbPassword){\n return true;\n }\n else{\n return false;\n }\n}", "title": "" }, { "docid": "ea05419e471c1c258059665a727904a8", "score": "0.5575986", "text": "static async updatePassword(token, username, oldPassword, newPassword) {\n let res = await this.request(`users/${username}/change-password`, token, { oldPassword, newPassword }, 'patch');\n return { token: res.token, user: res.user };\n }", "title": "" }, { "docid": "a4792f97bdd64f0ece4d8d5972fe8f30", "score": "0.55721843", "text": "static async authenticate(username, password) {\n try { //TODO: don't need these try/catch; if you were doing something else on top, then it's useful; otherwise it'll propagate up on their own\n // Query DB for \"username\"\n const results = await db.query(`\n SELECT username, password\n FROM users\n WHERE username = $1`, [username])\n\n // Check if user exists\n if (results.rows.length !== 0) {\n if (await bcrypt.compare(password, results.rows[0].password) === true) {\n return true\n }\n }\n return false\n }\n catch (error) {\n throw error\n }\n }", "title": "" }, { "docid": "8affdc34b1dc0de89ecebde8b934844f", "score": "0.5570041", "text": "static async authenticate(username, password) {\n const result = await db.query(`SELECT password\n FROM users\n WHERE username = $1`,\n [username]);\n const user = result.rows[0];\n\n if (user) {\n return await bcrypt.compare(password, user.password);\n }\n return false;\n }", "title": "" }, { "docid": "42d8b7312114892ef3bcf6cec9ca855c", "score": "0.556401", "text": "function putPassword(req, res){\n\tif(!req.body.password){\n\t\tres.status(400).send('There is no password')\n\t\treturn\n\t}\n\tlet salt = \"\"\n\tlet generateSaltString = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"\n\tfor(let i=0; i < 5; i++ ){\n\t\tsalt =salt+generateSaltString.charAt(Math.floor(Math.random()*generateSaltString.length))\n\t}\n\tlet hash = md5(salt + req.body.password)\n\tUser.update({username: req.username}, {salt: salt, hash: hash}).exec(function(err, users) {\n\t\tif (err) {\n\t\t\tres.status(401).send('Failed to change password')\n\t\t} else {\n\t\t\tres.send({\n\t\t\t\tusername: req.username,\n\t\t\t\tpassword: req.body.password\n\t\t\t})\n\t\t}\n\t})\n}", "title": "" }, { "docid": "e0e61e8211bdbcdeba33879ece7e6a0d", "score": "0.55626816", "text": "function loginHandler(){\n\n console.log(usernameValue.value)\n console.log(passwordValue.value)\n let result = getUser(usernameValue.value, passwordValue.value);\n\nif (result.isUserAdmin == false || result.isPasswordValid == false) {\n console.log('Userame or Password incorrect')\n alert ('Userame or Password incorrect')\n} else {\n console.log('Welcome admin. username and password is correct') \n alert ('Welcome admin. username and password is correct') // getUser('admin', '123456');\n}\n}", "title": "" }, { "docid": "8d4bb9dd6328aaf6c756d3aa571c7b32", "score": "0.5560812", "text": "get password() { return this._password;}", "title": "" }, { "docid": "49da9aea7decc4b41dba2a87ffc220be", "score": "0.555886", "text": "function findUserByCredentials(username, password) {\n return $http.get(\"/api/assignment/user?username=\" + username + \"&password=\" + password);\n }", "title": "" }, { "docid": "1a0e576a75d1c9ead40afacf0f1d0845", "score": "0.5556465", "text": "defineAuth(user, pass) {\n this._user = user;\n this._pass = pass;\n }", "title": "" }, { "docid": "a2dc158039b1803c0d7407f95b117bed", "score": "0.5553461", "text": "authenticate(state) {\n state.isLoggedIn = auth.isLoggedIn();\n if (state.isLoggedIn) {\n state.username = auth.getUsername();\n state.userId = auth.getUserId();\n } else {\n state.userId = null;\n state.username = null;\n }\n }", "title": "" }, { "docid": "7039bb9dac2f172dc7aeda43d1b2d37b", "score": "0.555331", "text": "function YNetwork_set_userPassword(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('userPassword',rest_val);\n }", "title": "" }, { "docid": "1b058f546a648a9a92d589a08a463270", "score": "0.5548494", "text": "function check (ctx, login, password) {\n\t // Derive passwordAuth:\n\t var passwordAuth = scrypt(login.username + password, passwordAuthSnrp)\n\n\t // Compare what we derived with what we have:\n\t for (var i = 0; i < passwordAuth.length; ++i) {\n\t if (passwordAuth[i] !== login.passwordAuth[i]) {\n\t return false\n\t }\n\t }\n\t return true\n }", "title": "" }, { "docid": "f414571ad033d19a740cb5692fcde204", "score": "0.55470914", "text": "static async authenticate(username, password) {\n const results = await db.query(`\n SELECT username, password FROM users WHERE username = $1`, [username]);\n const user = results.rows[0];\n \n if (user) {\n if (await bcrypt.compare(password, user.password)) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "03c79d241121826082facaa113787f2e", "score": "0.5545216", "text": "function isTrue(username, password) {\n if (username && password) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "e2e3ef833efb0469d1c4fe89b7bd2ba8", "score": "0.55444086", "text": "function writePassword(lowercase, uppercase, numbers, specialChar) {\n if (lowercase && uppercase && numbers && specialChar) {\n return password;\n }\n\n}", "title": "" }, { "docid": "28c663a54c304f88941b36cc2b974b9e", "score": "0.5537474", "text": "function authenticate(name, pass, fn) {\n var user = users[name];\n // If the user doesn't exist, handle it:\n if (!user) return fn(new Error('cannot find user'));\n /* \n Apply the same algorithm to the POSTed password, applying\n the hash against the pass / salt, if there is a match we\n found the user. \n */\n if (user.pass == hash(pass, user.salt)) return fn(null, user);\n // Otherwise password is invalid:\n fn(new Error('invalid password'));\n}", "title": "" }, { "docid": "144c4232c5a262d8e167ad96d308e44b", "score": "0.5532836", "text": "function prepare_key_pw(password)\r\n{\r\n\treturn prepare_key(str_to_a32(password));\r\n}", "title": "" }, { "docid": "9ceaf87aae54ef99dafae546cfaa3acd", "score": "0.5529521", "text": "async authenticate(username, password) {\n return new Promise((resolve, reject) => {\n this.db().get(\"SELECT * FROM users WHERE username = ? AND password = ?;\", [username, password], async (error, user) => {\n if(!error) {\n console.log('Authenticated user:', user);\n resolve(user);\n } else {\n // Provide feedback for the error\n console.log(error);\n reject(error);\n }\n });\n });\n }", "title": "" }, { "docid": "69d7cd7cfede031fc16906c4172aa5ed", "score": "0.55261433", "text": "function testPasswordEncryption(req, res) {\r\r\n testEquals('test username encryption', true, bcrypt.compareSync('HelloWorld', bcrypt.hashSync('HelloWorld')));\r\r\n}", "title": "" }, { "docid": "1c07fcefe599bb583b81e92fbc06a3f6", "score": "0.55260885", "text": "async handelLogin () {\n console.log('handle login')\n const userName = 'admin123'\n const password = 'admin123'\n if (this.state.userName === userName && this.state.password === password) {\n this.setState({ error: false })\n setUser(userName)\n this.props.history.push('/')\n } else {\n this.setState({ error: true })\n }\n }", "title": "" }, { "docid": "f5686169500ae6bab775a0f2feaa9fdd", "score": "0.5525093", "text": "function _authBasic(authString) {\n let base64Buffer = Buffer.from(authString,'base64'); // <Buffer 01 02...>\n let bufferString = base64Buffer.toString(); // john:mysecret\n let [username,password] = bufferString.split(':'); // variables username=\"john\" and password=\"mysecret\"\n let userSignIn = {username,password}; // {username:\"john\", password:\"mysecret\"}\n\n return User.authenticateBasic(userSignIn)\n .then( user => _authenticate(user) );\n }", "title": "" }, { "docid": "0564ebd9ed4edccf3209b59c2f58d0d0", "score": "0.55233645", "text": "function ParseConfirmPassword(password, successFunction, errorFunction) {\n Parse.User.logIn(Parse.User.current().getUsername(), password, {\n success: function(user){\n successFunction();\n },\n error: function(user, error){\n errorFunction(error);\n }\n });\n}", "title": "" }, { "docid": "1769bb23241c34957a065711068b458e", "score": "0.55141264", "text": "function setup (ctx, login, password) {\n\t var setup = makeSetup(ctx, login.dataKey, login.username, password)\n\n\t var request = login.authJson()\n\t request['data'] = setup.server\n\t return ctx.authRequest('PUT', '/v2/login/password', request).then(function (reply) {\n\t login.userStorage.setItems(setup.storage)\n\t login.passwordAuth = setup.passwordAuth\n\t return null\n\t })\n }", "title": "" }, { "docid": "33b208382d8a8483c8d46975de1d3571", "score": "0.55130607", "text": "function ChangePassword() {\n\t}", "title": "" }, { "docid": "9554bb83abab81a445d8f775a24f2682", "score": "0.5510232", "text": "function breakAuthHeaderToUserPassword(req) {\n let authHeaders = '';\n if (req && req.headers && (req.headers.hasOwnProperty('Authorization') || req.headers.hasOwnProperty('authorization'))) {\n try {\n authHeaders = (req.headers['authorization'] || req.headers['Authorization']).split('Basic ')[1];\n }\n catch (e) {\n return {};\n }\n if (!authHeaders) {\n return {};\n }\n const base64DecodedBuffer = new Buffer(authHeaders, 'base64').toString('utf8').split(':');\n const clientId = base64DecodedBuffer[0];\n const password = base64DecodedBuffer[1];\n return { clientId, password };\n }\n else {\n return {};\n }\n}", "title": "" }, { "docid": "e4e1cddbb418f70a5daa1107ac7d7b45", "score": "0.5499864", "text": "function query_db_changepassword(req,res, currentpassword, newpassword, confirmpassword,username) {\n oracle.connect(connectData, function(err, connection) {\n if ( err ) {\n \tconsole.log(err);\n \t\n } else {\n \t//use this when you integrate to get the exact username\n \t//username=request.session.user\n \tvar i = 0;\n \tvar c = 0;\n \tvar bcrypt = require('bcrypt');\n \tconnection.execute(\"SELECT * FROM users WHERE LOGIN='\"+username+\"'\", \n\t \t\t\t [], \n\t \t\t\t function(err, results) {\n\t \t if ( err ) {\n\t \t \tconsole.log(err);\n\t \t } else {\n\t \t \tfor(i = 0 ; i<results.length; i++){\n\t \t \t\tconsole.log(results[i].PASSWORD);\n\t \t \t\tconsole.log(results[i].ISNEW);\n\t \t \t\tif(bcrypt.compareSync(currentpassword, results[i].PASSWORD)==true||results[i].ISNEW=='Y'){c = c + 1;}\n\t \t \t}\n\t \t \tconnection.close(); // done with the connection\n\t \t \toutput_query1(req,res, username, c, results, currentpassword, newpassword, confirmpassword);\n\t \t \t\n\t\n\t \t }\n\t \t}); // end connection.execute\n }\n }); // end oracle.connect\n}", "title": "" } ]
fa9770275579b3b50293d85edf318f70
Add a click handler (Callback) to a DOM object (DOMObj)
[ { "docid": "7868ab2c4c63310826fe22f695554657", "score": "0.85773265", "text": "function addClickHandler(DOMObj, Callback) {\n DOMObj.addEventListener(\"click\", Callback);\n}", "title": "" } ]
[ { "docid": "89de68b75fd863b89e68fa3e54b49068", "score": "0.6406131", "text": "function addClickHandler(handler) {\n document.addEventListener('click', handler);\n }", "title": "" }, { "docid": "9a4c2b070509951f93c0c14a91719946", "score": "0.6364634", "text": "function clickHandler()\n\t{\n\t\tthat.click(that);\n\t}", "title": "" }, { "docid": "1ba035a7f451d1310ec160e475c98c88", "score": "0.62784445", "text": "function onClick(elm, func) { (typeof elm === 'string' ? $('#'+elm) : elm).addEventListener('click', func, false); }", "title": "" }, { "docid": "1ba035a7f451d1310ec160e475c98c88", "score": "0.62784445", "text": "function onClick(elm, func) { (typeof elm === 'string' ? $('#'+elm) : elm).addEventListener('click', func, false); }", "title": "" }, { "docid": "1ba035a7f451d1310ec160e475c98c88", "score": "0.62784445", "text": "function onClick(elm, func) { (typeof elm === 'string' ? $('#'+elm) : elm).addEventListener('click', func, false); }", "title": "" }, { "docid": "e88ccd7f738dc62b55ff66115f157df5", "score": "0.6105064", "text": "function addClickListener(id, callback) {\n\tdocument.getElementById(id).addEventListener('click', callback);\n}", "title": "" }, { "docid": "f1f96d86fc16d07cd4c00196597fb073", "score": "0.6026104", "text": "function do_click(obj) {\n/*jshint strict:false */\n return this._click_event(obj);\n}", "title": "" }, { "docid": "d5831bd575b3b98c9b80f166e53a057a", "score": "0.5989164", "text": "clickHandler(event) {\n declarativeClickHandler(this);\n }", "title": "" }, { "docid": "f68b7d53fbb12a720807cd7909bdcfb8", "score": "0.5974102", "text": "function HtmlElement() {\n this.click = function () {\n console.log('clicked');\n } \n}", "title": "" }, { "docid": "aaa5d596da44b2777c5d6260ea448ba4", "score": "0.59250504", "text": "function implementListener(buttonRef, objRef) {\n buttonRef.addEventListener(\"click\", objRef);\n }", "title": "" }, { "docid": "8be465480fac0e636af30dc3c95d5bcb", "score": "0.59149337", "text": "function onClick(id,func)\r\n{\r\n\tgetId(id).addEventListener('click',func,false);\r\n}", "title": "" }, { "docid": "e6f125dd9d4949662fec1135aa7c7c4f", "score": "0.58859783", "text": "function onClickImpl(/*Document*/ doc, \n /*Pattern*/ pattern, \n /*String or Function*/ handler) {\n var node = patternAsNode(pattern, doc);\n node.addEventListener(\"click\", makeEventHandler(handler), false); \n}", "title": "" }, { "docid": "3b89a73cd9d92d8faa77543ccddf9db4", "score": "0.5860245", "text": "function clickHandler(wid)\n\t{\n\t\tthat.click && that.click(that.unit, wid.data);\n\t}", "title": "" }, { "docid": "2936767941cc8f26c7b1fd8ffb428f67", "score": "0.5817629", "text": "_addClickHandler () {\n \tvar namespace = '.'+this.application.appName,\n \t $action = this\n \t;\n \tthis.$element.off('click tap');\n \t\n \tthis.$element.on('click.'+namespace+' tap.'+namespace, function (oEvent) {\n \t\t\n \t\tif ($action.options.target == 'layer') {\n \t\t\t$action.openInLayer();\n \t\t} else if ($action.options.target == 'module') {\n \t\t\t$action.sendToModule();\n \t\t} else {\n \t\t\t$action.link();\n \t\t}\n \t\t\n \t\t// stop further event propagation\n \t oEvent.preventDefault();\n \t oEvent.stopPropagation();\n \t oEvent.stopImmediatePropagation();\n \t return (false);\n \t});\n \t\n }", "title": "" }, { "docid": "dbf6420cc520ef6003b236432f3a9761", "score": "0.5738361", "text": "function HtmlElement() {\r\n this.click = function () {\r\n console.log(\"click\");\r\n };\r\n}", "title": "" }, { "docid": "163e6e23373f9c6a2a3eea9c3f0909cb", "score": "0.57368475", "text": "function HtmlElement() {\n\tthis.click = function() {\n\t\tconsole.log('clicking');\n\t};\n}", "title": "" }, { "docid": "167fe8cedfb6d4088d3c93e11e268946", "score": "0.57263666", "text": "function click(elm){\r\n var evt = document.createEvent('MouseEvents');\r\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n elm.dispatchEvent(evt);\r\n}", "title": "" }, { "docid": "dc543b25b007904811bce5a80c8fd364", "score": "0.57243484", "text": "function click(elm) {\r\n\tvar evt = document.createEvent('MouseEvents');\r\n\tevt.initEvent('click', true, true);\r\n\telm.dispatchEvent(evt);\r\n}", "title": "" }, { "docid": "dc543b25b007904811bce5a80c8fd364", "score": "0.57243484", "text": "function click(elm) {\r\n\tvar evt = document.createEvent('MouseEvents');\r\n\tevt.initEvent('click', true, true);\r\n\telm.dispatchEvent(evt);\r\n}", "title": "" }, { "docid": "dc543b25b007904811bce5a80c8fd364", "score": "0.57243484", "text": "function click(elm) {\r\n\tvar evt = document.createEvent('MouseEvents');\r\n\tevt.initEvent('click', true, true);\r\n\telm.dispatchEvent(evt);\r\n}", "title": "" }, { "docid": "f2036a61409ce7a89c13fe3fc94908d0", "score": "0.571936", "text": "function fireOnclick(objID) {\n var target = document.getElementById(objID);\n if (!target) { return; }\n if (document.dispatchEvent) { // W3C\n var oEvent = document.createEvent(\"MouseEvents\");\n oEvent.initMouseEvent(\"click\", true, true, window, 1, 1, 1, 1, 1, false, false, false, false, 0, target);\n target.dispatchEvent(oEvent);\n }\n else if (document.fireEvent) { /* IE */target.fireEvent(\"onclick\"); }\n}", "title": "" }, { "docid": "5d2a64d357695b85d39211848900de29", "score": "0.5709062", "text": "performClickFunctionality(){}", "title": "" }, { "docid": "a5b87557121672b558c94484d3bbc033", "score": "0.5655123", "text": "function handleClick() {}", "title": "" }, { "docid": "bc8755708037c75d4a14cbb6c0755623", "score": "0.56529486", "text": "function _addClickEventListener() {\n _el.main.addEventListener(\"click\", _clickEventListener);\n }", "title": "" }, { "docid": "6120789d87e94b90b5b9344053608f4c", "score": "0.56309", "text": "function onClick(event, obj) {\n if (obj.isUsingMouse) {\n\n var code = event.button;\n\n var action = obj.Bindings[obj.ACTIONs.MouseCLICK][code];\n if (action) {\n action();\n }\n }\n }", "title": "" }, { "docid": "8f20678f8570af3bb360f7e96e047abd", "score": "0.56131077", "text": "_addEventListeners() {\n this.elementRef.addEventListener('click', this.onClick);\n }", "title": "" }, { "docid": "71c2b5eef96e24da5aa7114719b9a2a1", "score": "0.56094193", "text": "function addClickEvent(elementName, f) {\n addEvent(elementName, f, 'click');\n }", "title": "" }, { "docid": "d8aecf4c22162b8260ce95887408b10a", "score": "0.56078094", "text": "_setDomClickEvent() {\n return jquery(window).on(`click.${guidFor(this)}`, event => {\n return this.clickHandler(event);\n });\n }", "title": "" }, { "docid": "0db3064344254fc8290c1b54caf9afa2", "score": "0.56047124", "text": "function UTIL_domEventHandler(target, type, callback) {\n if (target.addEventListener) {\n target.addEventListener(type, callback, false);\n } else {\n target.attachEvent(\"on\" + type, callback);\n }\n}", "title": "" }, { "docid": "23af73498870433a38e4fa7a4043e6fd", "score": "0.5569402", "text": "onClicked(mouseClickEvent) {}", "title": "" }, { "docid": "623e57e07076bb4ddaa39898e6cf7917", "score": "0.55330014", "text": "onClick(callback) {\n this.onClickCallback = callback;\n }", "title": "" }, { "docid": "161712f5d1a2227afa33b852a9702b55", "score": "0.5531197", "text": "function HTMLElement() {\n this.click = function() {\n console.log('click');\n }\n}", "title": "" }, { "docid": "8cc3ca2effb56225f1e7323bdc2756aa", "score": "0.5520842", "text": "function addEventHandler(obj, eventName, handler)\n{\n if (document.attachEvent)\n {\n obj.attachEvent(\"on\" + eventName, handler);\n }\n else if (document.addEventListener)\n {\n obj.addEventListener(eventName, handler, false);\n }\n}", "title": "" }, { "docid": "52b6f91006051dff3fa1f6c4288cf66d", "score": "0.55167145", "text": "function dom_node_click (elem, x, y) {\n var doc = elem.ownerDocument;\n var view = doc.defaultView;\n\n var evt = doc.createEvent(\"MouseEvents\");\n evt.initMouseEvent(\"mousedown\", true, true, view, 1, x, y, 0, 0, /*ctrl*/ 0, /*event.altKey*/0,\n /*event.shiftKey*/ 0, /*event.metaKey*/ 0, 0, null);\n elem.dispatchEvent(evt);\n\n evt = doc.createEvent(\"MouseEvents\");\n evt.initMouseEvent(\"click\", true, true, view, 1, x, y, 0, 0, /*ctrl*/ 0, /*event.altKey*/0,\n /*event.shiftKey*/ 0, /*event.metaKey*/ 0, 0, null);\n elem.dispatchEvent(evt);\n\n evt = doc.createEvent(\"MouseEvents\");\n evt.initMouseEvent(\"mouseup\", true, true, view, 1, x, y, 0, 0, /*ctrl*/ 0, /*event.altKey*/0,\n /*event.shiftKey*/ 0, /*event.metaKey*/ 0, 0, null);\n elem.dispatchEvent(evt);\n}", "title": "" }, { "docid": "7c45a53583379801335ee8478d9e118d", "score": "0.5514098", "text": "onClick(handleClick) {\n this._handleClick = handleClick;\n return this;\n }", "title": "" }, { "docid": "1f47b091e89fcfe27c334cb3cfd6ca1f", "score": "0.5504708", "text": "handleClick() {}", "title": "" }, { "docid": "c535180f76ff791e8070fb1d3c525ab2", "score": "0.5488328", "text": "_myClickHandler() {\n console.log('Click handler');\n }", "title": "" }, { "docid": "83d16c45ea24ba7d51e1c40bd0eebc0b", "score": "0.5480399", "text": "function addEventHandler(obj, eventName, handler) {\n\tif(document.attachEvent) {\n\t\tobj.attachEvent(\"on\" + eventName, handler);\n\t} else if (document.addEventListener) {\n\t\tobj.addEventListener(eventName, handler, false);\n\t}\n}", "title": "" }, { "docid": "8c24a2b4664923b6549d6bdd9e4cc5a8", "score": "0.54741055", "text": "function addHandler(element, type, handler) {\r\n if (element.addEventListener) {\r\n element.addEventListener(type, handler, true);\r\n }\r\n else if (element.attachEvent) {\r\n element.attachEvent('on' + type, handler); //\"on\"click, onmousemove etc..\r\n }\r\n else {\r\n element['on' + type] = handler; //. can be replace with [], variable need to be place within []\r\n }\r\n}", "title": "" }, { "docid": "af23aaf32509e0dbc03c7f18c89716fc", "score": "0.5456062", "text": "function ogs_addEvent(obj, type, func, cap)\r\n{\r\n/*\tif (obj.addEventListener)\r\n\t{\r\n\t\tobj.addEventListener(type, func, cap);\r\n\t}\r\n\telse if (obj.attachEvent)\r\n\t{\r\n\t\tobj.attachEvent('on'+type, func);\r\n\t}\r\n\t*/\r\n}", "title": "" }, { "docid": "c0b2c942fa710559aa175e164995368e", "score": "0.5425493", "text": "setHandler(clickHandler) {\n csInterface.addEventListener(\n 'com.adobe.csxs.events.flyoutMenuClicked',\n clickHandler\n );\n }", "title": "" }, { "docid": "2aab5d43e9ecde59eaee2ee3a50b3901", "score": "0.54237527", "text": "function addEventHandler(obj, evt, handler) {\n if (obj.addEventListener) {\n // W3C method\n obj.addEventListener(evt, handler, false);\n } else if (obj.attachEvent) {\n // IE method.\n obj.attachEvent('on' + evt, handler);\n } else {\n // Old school method.\n obj['on' + evt] = handler;\n }\n }", "title": "" }, { "docid": "eeb37eb42b507ed0b4000b6aa795f744", "score": "0.5412045", "text": "appendCallback() {\n this.nodes.button.click();\n }", "title": "" }, { "docid": "c239a84c927b6fc8e5deb25e199bc65b", "score": "0.5402732", "text": "function fakeClick(obj) {\n var ev = document.createEvent(\"MouseEvents\");\n ev.initMouseEvent(\"click\", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n obj.dispatchEvent(ev);\n}", "title": "" }, { "docid": "c239a84c927b6fc8e5deb25e199bc65b", "score": "0.5402732", "text": "function fakeClick(obj) {\n var ev = document.createEvent(\"MouseEvents\");\n ev.initMouseEvent(\"click\", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n obj.dispatchEvent(ev);\n}", "title": "" }, { "docid": "4566b7ed27ed477b1864668bad9985b3", "score": "0.5400282", "text": "static addClickEventOnDynamicObj() {\n Array.from(document.querySelectorAll(\".delete\")).forEach(function(thisDeleteButton) {\n console.log(\"delete bttton [POLICY]\");\n thisDeleteButton.onclick = function clickEve() {\n console.log(\"Click on Delete DONE [POLICY]\");\n Policy_UI_Manager.deleteFromPolicyTable(thisDeleteButton);\n };\n });\n\n Array.from(document.querySelectorAll(\".editThisPolicy\")).forEach(function(thisEditButton) {\n console.log(\"edit bttton [POLICY]\");\n thisEditButton.onclick = function() { {\n console.log(\"Click on edit DONE [POLICY]\");\n currentEditClicker = thisEditButton;\n const currentTR = thisEditButton.parentElement.parentElement;\n const policy = Policy_UI_Manager.getPolicyDataFromPolicyTable(currentTR);\n Modal_UI_Manager.addPolicyDataToModal(policy);\n }\n }\n });\n }", "title": "" }, { "docid": "423673f15b0b076fa6a84a034337f213", "score": "0.5383282", "text": "function addEventHandler(obj, evt, handler) {\n if (obj.addEventListener) {\n // W3C method\n obj.addEventListener(evt, handler, false);\n } else if (obj.attachEvent) {\n // IE method.\n obj.attachEvent('on' + evt, handler);\n } else {\n // Old school method.\n obj['on' + evt] = handler;\n }\n}", "title": "" }, { "docid": "09e280bf03d76119e8be53b25aa61542", "score": "0.53818935", "text": "function novel_addOnClick(el, value) {\n el.onclick = function(e) {\n novel_menuJump.apply(window, [value, e]);\n return false;\n };\n}", "title": "" }, { "docid": "4107a62d710167c55a7a521cba7beeb9", "score": "0.53713834", "text": "click(callback) {\n if(callback instanceof Function) {\n this.on('click', callback);\n }\n else {\n throw new InvalidArgumentsError('click', 'argument must be a \"function\"');\n }\n }", "title": "" }, { "docid": "6336981dff0a6906d7c2bc84cbfe7a26", "score": "0.5367221", "text": "handleClick() {\n\n }", "title": "" }, { "docid": "416a8afe0689036c83baad09f8ead00b", "score": "0.5341951", "text": "function doClick(obj) {\n try {\n let evt = document.createEvent(\"MouseEvents\");\n evt.initMouseEvent(\"click\", true, true, window,0, 0, 0, 0, 0,\n false, false, false, false, 0, null);\n let canceled = !obj.dispatchEvent(evt);\n if(canceled) {\n // A handler called preventDefault\n } else {\n // None of the handlers called preventDefault\n }\n } catch(er) {\n obj.click(); //IE\n}\n}", "title": "" }, { "docid": "2d6ad8b66955a13eb1edf482f355fe32", "score": "0.5338559", "text": "function addClickHandler(arrOfElements) {\n arrOfElements.forEach(function(element) {\n element.addEventListener('click', handleClick);\n })\n}", "title": "" }, { "docid": "cc6bb60788b51921624df4711b5527a4", "score": "0.5337761", "text": "function addEvent(elem, type, handler) {\n if (elem.addEventListener) { // W3C DOM\n elem.addEventListener(type,handler,false);\n } else if (elem.attachEvent) { // IE DOM\n elem.attachEvent(\"on\"+type, handler);\n } else { // No much to do\n elem[\"on\" + type] = handler;\n }\n}", "title": "" }, { "docid": "7f8d3a973c66f57309806adde6cb09a7", "score": "0.532521", "text": "onClick(value) {\r\n this.feed.onclick(value);\r\n }", "title": "" }, { "docid": "1cafa5df87f9b956d4174be362ee65ad", "score": "0.53177834", "text": "function createClickHandlers() {\n\t$(\"#previous-link\").on(\"click\", navigatePrevious);\n\n $(\"#root-link\").on(\"click\", navigateRoot);\n\n $('.association').on(\"mousedown\", function(e) {\n \tvar guid = $(this).attr('data-guid');\n \tselectAssociation(guid);\n });\n}", "title": "" }, { "docid": "043f38a0fb204266c4840fce555314c5", "score": "0.53048486", "text": "function clickCanvasHandler() {\n\n}", "title": "" }, { "docid": "4962716fa67e16076cec1b3f4c59e7d0", "score": "0.5301494", "text": "function clickLink(elm) {\r\n\t\tvar evt = document.createEvent('MouseEvents');\r\n\t\tevt.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n\t\telm.dispatchEvent(evt);\r\n\t}", "title": "" }, { "docid": "948de1c20c40a3ae0a6ca9b103e492c8", "score": "0.5301084", "text": "function registerClickEvent(callback){\n this.callback = callback;\n}", "title": "" }, { "docid": "653fd97d63455603969823efdf5d284a", "score": "0.53006566", "text": "addEventHandlers(){\n\t\t$('.add').on('click',this.handleAdd);\n\t\t$('.cancel').on('click',this.handleCancel);\n\t\t$('.data').on('click',this.getDataFromServer);\n\t}", "title": "" }, { "docid": "73ac3e72deac050f802d677adf21c3f1", "score": "0.52940357", "text": "createClickHandler(title) {\n return (function() {\n alert(\"This link would usually navigate to a page for:\\n\\n'\" + title + \"'\\n\\nbut I don't have access to the whole API and this is only a demo\");\n }).bind(this); //technically this doesn't need to be bound since it's just creating an alert, but if it had real functionality this would be necessary\n }", "title": "" }, { "docid": "6271da24d9c5c8e1b3ecb4c96cecca24", "score": "0.52921915", "text": "function assignListenerToClass(elem, attr) {\n\tassignListener(getElementsWithAttr(elem, attr),'click');\t\n}", "title": "" }, { "docid": "0697be0ee001b69052903ecd3277449f", "score": "0.52802896", "text": "function handleOnClick() { }", "title": "" }, { "docid": "73dd1dfe43bbbce1490b41a5f89f5516", "score": "0.5276628", "text": "onAfterAttach(msg) {\n document.addEventListener('click', this, false);\n this.node.addEventListener('keydown', this, false);\n window.addEventListener('resize', this, false);\n }", "title": "" }, { "docid": "7fc5ff7b46e7446a819f81ac662843a1", "score": "0.5273007", "text": "function addClickListener(element, ref, ev) {\n const anchorRef = element.querySelector('a').getAttribute(ref);\n element.addEventListener(ev, function () {\n scrollToAction(anchorRef);\n });\n element.addEventListener(ev, function () {\n lastClickedClassAdd(element);\n });\n}", "title": "" }, { "docid": "2663c9c97b4feec5b442da790135a7a8", "score": "0.52702206", "text": "function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n return object.addEventListener(type, callback, false);\n }\n object.attachEvent('on' + type, callback);\n }", "title": "" }, { "docid": "32df19eef5ecffce1f95fdcb3414531c", "score": "0.52568877", "text": "function setOnclick(node, onclickValue){\n\tif(typeof node === 'string'){node=document.querySelector(node);}\n\tnode.setAttribute('onclick', onclickValue);\n}", "title": "" }, { "docid": "141fad87b4388648d9ffeeca9ee03b94", "score": "0.52538574", "text": "function addClickListener(node, onClick, onDblClick){ // addClickListener.clickInterval can be set to millisecond interval between clicks\n\tvar addClickListener = arguments.callee;\n\tif (typeof addClickListener.clickInterval === 'undefined'){\n\t\taddClickListener.clickInterval = 200; // milliseconds interval between first and second click\n\t}\n\t\n\tnode.addEventListener('click', function(e){\n\t var that;\n\t\tthat = arguments.callee;\n\t\tthat.clicks = (typeof that.clicks === 'undefined') ? 1 : that.clicks + 1;\n\t\t\n\t\tif (that.clicks === 2){\n\t\t\tonDblClick(e);\n\t\t\tthat.clicks = 0;\n\t\t}\n\t\telse {\n\t\t window.setTimeout(function(){\n\t\t if (that.clicks === 1){\n\t\t onClick(e);\n\t\t\t\t\tthat.clicks = 0;\n\t\t }\n\t\t }, addClickListener.clickInterval);\n\t\t}\n\t}, false);\n}", "title": "" }, { "docid": "a3e1cb5a39f0fde3bffbf977e7278543", "score": "0.52468026", "text": "function addHandler(selector, event, action) {\n var element = document.querySelector(selector);\n element.addEventListener(event, action);\n }", "title": "" }, { "docid": "d906a1698ac709a54bc305a657534f97", "score": "0.5235299", "text": "static addClickEventOnDynamicObj() {\n Array.from(document.querySelectorAll(\".delete\")).forEach(function(thisDeleteButton) {\n console.log(\"delete bttton [USERGORUP] \");\n thisDeleteButton.onclick = function clickEve() {\n console.log(\"Click on Delete DONE [USERGORUP] \");\n UserGroup_UI_Manager.deleteFromUserGroupsTable(thisDeleteButton);\n };\n });\n\n Array.from(document.querySelectorAll(\".editThisUserGroup\")).forEach(function(thisEditButton) {\n console.log(\"edit bttton [USERGROUP] \");\n thisEditButton.onclick = function() { {\n console.log(\"Click on edit DONE [USERGORUP] \");\n currentEditClicker = thisEditButton;\n const currentTR = thisEditButton.parentElement.parentElement;\n const userGroup = UserGroup_UI_Manager.getUserGroupDataFromUserGroupsTable(currentTR);\n Modal_UI_Manager.addUserGroupDataToModal(userGroup);\n }\n }\n });\n\n }", "title": "" }, { "docid": "40ed31ac9560ec4468446ce700205098", "score": "0.5213938", "text": "function listen(id, codeId) {\n\tdocument.addEventListener('DOMContentLoaded', function() {\n\t\tvar link = document.getElementById(id);\n\t\tlink.addEventListener('click', function() {\n\t\t\tfunc(codeId);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "74012eb2513d6a15a9892d9248e1c34f", "score": "0.52135336", "text": "function addEvent(object, event, handler) {\n if(object.addEventListener) object.addEventListener(event, handler, false);\n else if(object.attachEvent) object.attachEvent('on'+event, handler);\n }", "title": "" }, { "docid": "c611afb5f1e4866d3228904d79f5b9ce", "score": "0.52094984", "text": "function navClickhandler(elem, raise=false) {\n if (typeof(elem) == \"object\")\n var id = $(elem).attr(\"id\");\n else\n var id = elem;\n\n // Raise the D3 click event\n if (raise) {\n g.d3d._events[\"click:path\"][0].callback( g.file.index[id]['obj'] );\n }\n\n // Update article column\n articleUpdate(g.file.index[id]);\n // Update breadcrumbs in nav column\n breadcrumbUpdate(g.file.index[id]);\n // Update sunburst Labels etc\n updateSunburst(id)\n}", "title": "" }, { "docid": "d4b1e5a367ccce44bcbb063800ae08b8", "score": "0.52093834", "text": "setupBindings() {\n document.addEventListener('click', () => this.handleClick(event));\n }", "title": "" }, { "docid": "c5eefd93fb5016d6d8853044f914c25b", "score": "0.5201606", "text": "static setOnClickHandler(callback) {\n if (console) {\n console.warn(\"this method is obsolete, please use the new tsParticles.setOnClickHandler\");\n }\n\n window.tsParticles.setOnClickHandler(callback);\n }", "title": "" }, { "docid": "2148df1fb94eb2c03844caf6fa7689b4", "score": "0.5195662", "text": "static addClickEventOnDynamicObj() {\n Array.from(document.querySelectorAll(\".delete\")).forEach(function(thisDeleteButton) {\n console.log(\"delete bttton [REQUEST]\");\n thisDeleteButton.onclick = function clickEve() {\n console.log(\"Click on Delete DONE [REQUEST]\");\n Request_UI_Manager.deleteFromRequestTable(thisDeleteButton);\n };\n });\n\n Array.from(document.querySelectorAll(\".editThisRequest\")).forEach(function(thisEditButton) {\n console.log(\"edit bttton [REQUEST]\");\n thisEditButton.onclick = function() { {\n console.log(\"Click on edit DONE [REQUEST]\");\n currentEditClicker = thisEditButton;\n const currentTR = thisEditButton.parentElement.parentElement;\n const request = Request_UI_Manager.getRequestDataFromRequestTable(currentTR);\n Modal_UI_Manager.addRequestDataToModal(request);\n }\n }\n });\n }", "title": "" }, { "docid": "58895592234318c5fe22ef777be8cff1", "score": "0.5191926", "text": "handle_click(evt) {\n\n var obj = this.get_body_on_mouse_position(evt);\n if (obj) this.select_object(obj);\n else this.cancel_selection();\n }", "title": "" }, { "docid": "df6b042541f58384d0015c512464169d", "score": "0.51913387", "text": "function onClick(query, cb){\n\t\tvar elem = document.querySelectorAll(query)\n\t\tfor(var i=0; i<elem.length; i++){\n\t\t\telem[i].addEventListener('click', cb)\n\t\t}\n\t}", "title": "" }, { "docid": "c2244b4b839a5f81ba56853adeec286a", "score": "0.5185932", "text": "function handleClick(elem){\n\tvar li = elem.getElementsByTagName(\"li\");\n\tfor (var i = 0; i < li.length; i++)\n\t\tli[i].addEventListener(\"click\", loadMenu, false);\n\t\t// ^ doesn't exist in IE (attachEvent)\n}", "title": "" }, { "docid": "47fd7b32d02e8335123b386c36e1abd7", "score": "0.5168805", "text": "function SimularClick(idObjeto) {\n\n var nouEvent = document.createEvent(\"MouseEvents\");\n nouEvent.initMouseEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n var objecto = document.getElementById(idObjeto);\n var canceled = !objecto.dispatchEvent(nouEvent);\n}", "title": "" }, { "docid": "cb50f2544d7356c09665316688ec5b57", "score": "0.5167835", "text": "function setOnClick(li) {\n li.onclick = function () {\n $('<a href=\"/listing/?id=' + li.id + '\" target=\"_blank\"></a>')[0].click();\n }\n}", "title": "" }, { "docid": "ac8b826ad092d7831c99525f53fb462f", "score": "0.5161734", "text": "function RAZaddEventHandler(node, type, handler, removeFunc) {\n function wrapHandler(event) {\n handler(event || window.event);\n }\n if (typeof node.addEventListener == \"function\") {\n node.addEventListener(type, wrapHandler, false);\n if (removeFunc) return function() {node.removeEventListener(type, wrapHandler, false);};\n }\n else {\n node.attachEvent(\"on\" + type, wrapHandler);\n if (removeFunc) return function() {node.detachEvent(\"on\" + type, wrapHandler);};\n }\n}", "title": "" }, { "docid": "a65b7fcaae3d968a3a8665d48a10cd7c", "score": "0.5159327", "text": "function addEvent(object, event, handler) {\n\t\tif(object.addEventListener) object.addEventListener(event, handler, false);\n\t\telse if(object.attachEvent) object.attachEvent('on'+event, handler);\n\t}", "title": "" }, { "docid": "21ca3ace9d59b3c631b61ca4f8bc7fc5", "score": "0.5152651", "text": "click() {\n const mainLinkNode = this._mainLinkNode\n console.log('mainLinkNode = ' + !! mainLinkNode);\n if (! mainLinkNode) {\n return;\n }\n console.log('mainLinkNode.click() fired !');\n mainLinkNode.click();\n }", "title": "" }, { "docid": "7d79b02113051ea47c1697773c4de40e", "score": "0.51500016", "text": "function _attachClickHandlers() {\n\t\tvar items = document.querySelectorAll('a[href^=\"#\"]'),\n\t\t index = 0,\n\t\t ubound = items.length,\n\t\t item;\n\n\t\t// Loop over all the anchors that link to an ID in the document\n\t\tfor (; index < ubound; index++) {\n\t\t\t// Get the current item for easy reference\n\t\t\titem = items[index];\n\t\t\t// Check if the item does not have the ignore attribute; if it does\n\t\t\t// we need to skip this anchor, otherwise we need to attach a click\n\t\t\t// handler\n\t\t\tif (!item.hasAttribute(_options.attrIgnoreAnchor)) {\n\t\t\t\t// Anchor should not be ignored, attach a click handler\n\t\t\t\titem.addEventListener('click', _onClickHandler);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "eec97f37bec3d8b9e35ce837682ac7e9", "score": "0.5149639", "text": "function addEvent(wrapper) {\n var wrapper = document.querySelector(wrapper);\n wrapper.addEventListener('click', clickOnLink);\n }", "title": "" }, { "docid": "58ab439792bdf07d7452cb5eedbb0e8a", "score": "0.5149228", "text": "function insertDOM(element, id, classTag, style, wrapperID, onclick, content, name, type, value){\n var newElement = document.createElement(element);\n newElement.setAttribute('id', id);\n newElement.setAttribute('class', classTag);\n newElement.setAttribute('style', style);\n newElement.setAttribute('name', name);\n newElement.setAttribute('type', type);\n newElement.setAttribute('value', value);\n if(wrapperID == 'body')\n document.body.appendChild(newElement)\n else\n document.getElementById(wrapperID).appendChild(newElement);\n document.getElementById(id).innerHTML = content;\n document.getElementById(id).onclick = onclick;\n}", "title": "" }, { "docid": "6c33746c10d009dc5ba30c786e4f7e0e", "score": "0.5144455", "text": "function click(){\n if(this.callback){\n this.callback();\n }\n}", "title": "" }, { "docid": "edeadef869422f3cefc7db54fd33fa57", "score": "0.51434654", "text": "function addHandler(element, type, handler){\n if(element.addEventListener){\n addHandler = function(element, type, handler){\n element.addEventListener(type, handler, false);\n };\n }\n else if(element.attachEvent){\n addHandler = function(element, type, handler){\n element.attachEvent('on'+type, handler);\n };\n }\n return addHandler(element, type, handler);\n}", "title": "" }, { "docid": "57ec2ee7ed8dc178c570346a246d8938", "score": "0.51428753", "text": "set onclick(value) {\n this._onclick = value;\n }", "title": "" }, { "docid": "e4c6c264e8b4a5bc62e12d7724492a1e", "score": "0.5140932", "text": "function setOnClick() {\n document.getElementById('table').addEventListener(\"click\", reply_click);\n}", "title": "" }, { "docid": "af24939bcc6daf7472cdf650db59afed", "score": "0.51255256", "text": "function buttonClickedHandler() {\n\tlet buttons = document.querySelectorAll(\".toctree-l1\");\n\tfor (var i = 0; i < buttons.length; i++) {\n\t\tbuttons[i].onclick = buttonClicked;\n\t}\n}", "title": "" }, { "docid": "af5e19d7a6d56c4796a616728960bd40", "score": "0.5121638", "text": "_onClick(){\n\n }", "title": "" }, { "docid": "226cad8fb3fbb818234dce1ed19b77ca", "score": "0.51173973", "text": "function addEvent(obj, evType, fn){ \n if (obj.addEventListener){ \n obj.addEventListener(evType, fn, false); \n return true; \n } else if (obj.attachEvent){ \n var r = obj.attachEvent(\"on\"+evType, fn); \n return r; \n } else { \n return false; \n } \n}", "title": "" }, { "docid": "97108d5630b2265ea77bb604fd5d4ba3", "score": "0.51158667", "text": "onClick(handler) {\n this._click.on('started', handler);\n return this;\n }", "title": "" }, { "docid": "6a5cb84f8c789e13b102bf64de2f3fcc", "score": "0.5113896", "text": "function addtoev() {\n var bns = document.getElementsByTagName(\"button\");\n for (i = 0; i < bns.length; i++) {\n bns[i].addEventListener(\"click\", clickHandler);\n }\n}", "title": "" }, { "docid": "3e32b149fd108e5042a57659d4dbf308", "score": "0.5112923", "text": "function handleClick(event) {\n\ttheTarget = Event.element(event);\n\tif (theTarget.tagName == 'A') {clickedLink(event, theTarget)}\n\telse if (theTarget.tagName == 'SPAN') {\n\t\tballoonTarget = theTarget;\n\t\tclickedList();\n\t};\n}", "title": "" }, { "docid": "453be08e322b50b3517a2bb914f02b02", "score": "0.5112377", "text": "function onClick(e, d) {\n console.log(\"Node clicked!\");\n\t\t\tself.props.handler(d.name, d.type);\n\t\t\tself.makeGraph();\n\t\t}", "title": "" }, { "docid": "54a96f55ef3387ecb2152971c9cea22c", "score": "0.5107492", "text": "function addEvent(obj, type, fn) {\n if(obj.addEventListener) {\n obj.addEventListener(type, fn, true);\n } else if(obj.attachEvent) {\n obj.attachEvent(\"on\"+type, fn);\n };\n }", "title": "" }, { "docid": "e9c5a88efc1301937d3d658a07a453ac", "score": "0.51038855", "text": "function addEvent (obj, evType, fn)\r\n{\r\n\tif (obj.addEventListener)\r\n\t{\r\n\t\tobj.addEventListener(evType, fn, false);\r\n\t\treturn true;\r\n\t}\r\n\telse if (obj.attachEvent)\r\n\t{\r\n\t\tvar r = obj.attachEvent(\"on\"+evType, fn);\r\n\t\treturn r;\r\n\t}\r\n\telse return false;\r\n}", "title": "" }, { "docid": "4c19d852e2d5d6bc73d39728f2b2f100", "score": "0.5103498", "text": "function domHandler(eventObj ) {\n\t\t\t\t\tvar args;\n\n\t\t\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t\t\t\targs.unshift(event);\n\n\t\t\t\t\tif(!trigger.apply(this, args)) {\n\n\t\t\t\t\t\t//modern browsers\n\t\t\t\t\t\teventObj.stopPropagation && eventObj.stopPropagation();\n\t\t\t\t\t\teventObj.preventDefault && eventObj.preventDefault();\n\n\t\t\t\t\t\t//legacy browsers\n\t\t\t\t\t\ttypeof eventObj.cancelBubble !== 'undefined' && (eventObj.cancelBubble = true);\n\t\t\t\t\t\ttypeof eventObj.returnValue !== 'undefined' && (eventObj.returnValue = false);\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" } ]
85293b4201d71531afba4acffe79e4a4
declaring input and sucess or error message function
[ { "docid": "6990e3a36044dccc5039a0eb21d6c821", "score": "0.0", "text": "function setErrorFor(input, message) {\n const formContainer = input.parentElement;\n const small = formContainer.querySelector(\"small\");\n\n // add error message\n formContainer.className = \"form-container error\";\n small.innerText = message;\n}", "title": "" } ]
[ { "docid": "e52486aef620e2e1e277c87d38e7fb5a", "score": "0.6466662", "text": "function showError(input){\n\n console.log('input is empty')\n }", "title": "" }, { "docid": "a9315b4056fab628def06c54ec352ca7", "score": "0.6340438", "text": "function processInput(message)\r\n{\r\n console.log(\"i'm inside of the function\");\r\n if(message == \"Hello!\")\r\n console.log(\"Hello World\");\r\n else {\r\n return(\"you didn't say hello :(\");\r\n }\r\n}", "title": "" }, { "docid": "7b6146fb5a1bdfa866c58a8d460a0ed0", "score": "0.6225826", "text": "function enterValidInput(type) {\n\n\tvar title;\n var body;\n var boolean = true;\n \n if(type == \"new\"){\n\t\ttitle = document.getElementById('anntitle').value;\n\t body = document.getElementById('annbody').value;\n } else if(type == \"update\"){\n\t\ttitle = document.getElementById('updateTitle').value;\n\t body = document.getElementById('updateBody').value;\n }\n \n if(title === null || title === \"\" || title.length > 50){\n \t// TODO title input error notif\n \t//alert(\"Title should not be empty and not be more than 50 characters\");\n $('#titleerror').show();\n $('anntitle').css(\"border-color\", \"indianred\");\n $('updateTitle').css(\"border-color\", \"indianred\");\n \tboolean = false;\n }\n \t\n\tif(body === null || body === \"\" || body.length > 1000){\n\t\t// TODO body input error notif\n\t\t//alert(\"Body should not be empty and not be more than 1000 characters\");\n $('#bodyerror').show();\n $('anntitle').css(\"border-color\", \"indianred\");\n $('updateTitle').css(\"border-color\", \"indianred\");\n \tboolean = false;\n\t}\n\t\n\treturn boolean;\n}", "title": "" }, { "docid": "e8cfdc4a4ae9fded0a609026d7aa3ea1", "score": "0.61919403", "text": "function getInput(v1) {\n\nif (typeof v1 === \"string\") {\n console.log(\"DATA_RECEIVED: \" + v1)\n return \"DATA_RECEIVED: \" + v1\n}else if (typeof v1 === \"number\") {\n console.log(\"Please provide a string input, NOT a number\")\n return \"Please provide a string input, NOT a number\"\n}else\nconsole.log(\"Please provide string input.\")\nreturn \"Please provide string input.\"\n}", "title": "" }, { "docid": "675a3621244580c53b939cd51e1b3803", "score": "0.618254", "text": "function getInput(firstName, lastName, myCallback) {\r\n let nameFull = firstName+ ' '+ lastName;\r\n if(typeof myCallback === \"function\") {\r\n //pastikan bahwa parameter ke-3 adlh sebuah fungsi\r\n myCallback(nameFull);\r\n } else {\r\n console.log('are you kidding ? that\\'s not a function');\r\n }\r\n}", "title": "" }, { "docid": "ff66d905190e6ce96beb57cb4f72c9a1", "score": "0.60999393", "text": "function input(value,message){\n if(!value)\n value='';\n return {\n 'value':value,\n 'error':false,\n 'required':false,\n 'errorMessage':message\n }\n}", "title": "" }, { "docid": "96fec68998fe308c23d662bfa83e10df", "score": "0.6080416", "text": "function result(op,n1,n2){\n let res;\n switch(op){\n case 1:\n res = add(n1,n2);\n break;\n case 2:\n res = sub(n1,n2);\n break;\n case 3:\n res = multiply(n1,n2);\n break;\n case 4:\n try{//Checking value of divisor. It should not be 0.\n if(n2===0){\n throw \" Number cannot be divided by 0\";\n }\n res = divide(n1,n2);\n break;\n }\n catch(error){\n document.getElementById(\"error\").innerHTML = `Error :${error}`;\n return;\n }\n default :// If operator is not selected error message will be displayed.\n document.getElementById(\"error\").innerHTML = `Error : Operator not selected`;\n return;\n }\n document.getElementById(\"error\").innerHTML = \"No Error\"; // To reset the field to \"no error\" if execution of function is sucessfull.\n document.getElementById(\"result\").value = res; // For displaying output in text box\n}", "title": "" }, { "docid": "770a4bd3f4ca617a83f47ab532cf3842", "score": "0.60490465", "text": "function inputOutputFunc(inputOutput) { // inputOutput is a parameter or argument\n return `${inputOutput} has been received`;\n}", "title": "" }, { "docid": "44ccd687d989dbc3e2ae2a146eb35816", "score": "0.6047191", "text": "function getInfo() {\r\n fname = prompt(\"What is your first name?\", '');\r\n lname = prompt(\"What is your last name?\", '');\r\n pname = prompt(\"What is your pets name?\", '');\r\n if (fname === '' || fname.length == '0') {\r\n return alert(\"Please provide your first name.\");\r\n }\r\n if (lname === '' || lname.length == '0') {\r\n return alert(\"Please provide your last name.\");\r\n }\r\n if (pname === '' || pname.length == '0') {\r\n return alert(\"Please provide your pets name.\");\r\n }\r\n}", "title": "" }, { "docid": "942de2cffacf09aa8401e0eb138404ba", "score": "0.6043935", "text": "function verificationInput(choise){\r\n var firstname = $(\"#\"+ choise +\"UserFirstname\").val();\r\n var lastname = $(\"#\"+ choise +\"UserLastname\").val();\r\n var username = $(\"#\"+ choise +\"UserUsername\").val();\r\n var email = $(\"#\"+ choise +\"UserMail\").val();\r\n \r\n var error = 0;\r\n var errorMessage = \"\";\r\n \r\n if(firstname.length < 3 || firstname.length > 20){\r\n error ++;\r\n errorMessage += \"Le Prénom doit contenir entre 3 et 20 caracteres<br>\";\r\n }\r\n \r\n if(lastname.length < 3 || lastname.length > 20){\r\n error ++;\r\n errorMessage += \"Le Nom doit contenir entre 3 et 20 caracteres<br>\";\r\n }\r\n \r\n if(username.length < 3 || username.length > 20){\r\n error ++;\r\n errorMessage += \"Le Pseudo doit contenir entre 3 et 20 caracteres<br>\";\r\n }\r\n \r\n if(validateEmail(email) == false){\r\n error ++;\r\n errorMessage += \"L'email doit etre valide<br>\";\r\n }\r\n \r\n if(choise == \"add\"){\r\n var password = $(\"#addUserPwd\").val();\r\n if(password.length < 3 || password.length >20){\r\n error ++;\r\n errorMessage += \"Le Mot de passe doit contenir entre 3 et 20 caracteres<br>\";\r\n }\r\n }\r\n \r\n if(error == 0){\r\n return true;\r\n } else {\r\n return errorMessage;\r\n }\r\n}", "title": "" }, { "docid": "6cc9d6a5168e5d3f76b56af82be9eef1", "score": "0.6019403", "text": "function validName() {\n firstname = $(\"#fname\").val();\n message = document.getElementById(\"error\");\n if(firstname == \"\") {\n message.innerHTML = \"**Please fill in your name**\";\n return false;\n } else {\n message.innerHTML = \"\";\n return displayPrelimQ(preConf);\n }\n }", "title": "" }, { "docid": "8a5490b07ce2910d8c10b7a6feabcb86", "score": "0.59911096", "text": "function userInput (){\n\n}", "title": "" }, { "docid": "ee949d92fdaa2fdf56a8415b42aab6c9", "score": "0.5963423", "text": "function inputError(){\n document.getElementById(\"output1\").innerText = \"Please enter a number!\"\n document.getElementById(\"output2\").innerText = \"Please enter a number!\"\n}", "title": "" }, { "docid": "a9bd8752d0383aed152e792687f77bab", "score": "0.59599066", "text": "function Response(fname, lname, email, pnumber, dob) {\n if(fname.value == \"\"){\n alert(\"Enter first name\");\n return false;\n }\n if(lname.value == \"\"){\n alert(\"Enter last name\");\n return false;\n }\n if(email.value == \"\"){\n alert(\"Enter email address\");\n return false;\n }\n if(pnumber.value == \"\"){\n alert(\"Enter phone number\");\n return false;\n }\n if(dob.value == \"\"){\n alert(\"Enter date of birth\");\n return false;\n }\n\n alert(\"Sign up successful\");\n return true;\n }", "title": "" }, { "docid": "47ccefd4beb2fb78b314fddd69301617", "score": "0.5930821", "text": "function sayHelloTo(arg, arg1, arg2) {\n try {\n//If all three arguments are undefined\n if (arg == undefined && arg1 == undefined && arg2 == undefined)\n return(\"No Valid Input \");\n//If arg1 and arg2 are undefined\n else if (arg1 == undefined && arg2 == undefined)\n return(\"Hello \" + arg + \"!\");\n//If arg2 is undefined\n else if (arg2 == undefined)\n return(\"Hello \" + arg + \" \" + arg1 + \". I hope you are having a good day!\");\n else\n return(\"Hello \" + arg2 + \" \" + arg + \" \" + arg1 + \"! Have a good evening!\");\n }\n catch (err) {\n console.log(err);\n\n }\n}", "title": "" }, { "docid": "ad70d88834738753e0ead42219e5ee19", "score": "0.58897567", "text": "function functionExample(input){// input is defined\n return input;\n}", "title": "" }, { "docid": "0311f0bceacd9971983985e35d79fc98", "score": "0.5878832", "text": "function verificationInput(){\n var firstname = $(\"#addUserFirstnameCo\").val();\n var lastname = $(\"#addUserLastnameCo\").val();\n var username = $(\"#addUserUsernameCo\").val();\n var email = $(\"#addUserMailCo\").val();\n var password = $(\"#addUserPwdCo\").val();\n \n var error = 0;\n var errorMessage = \"\";\n \n if(firstname.length < 3 || firstname.length > 20){\n error ++;\n errorMessage += \"Le Prénom doit contenir entre 3 et 20 caracteres<br>\";\n }\n \n if(lastname.length < 3 || lastname.length > 20){\n error ++;\n errorMessage += \"Le Nom doit contenir entre 3 et 20 caracteres<br>\";\n }\n \n if(username.length < 3 || username.length > 20){\n error ++;\n errorMessage += \"Le Pseudo doit contenir entre 3 et 20 caracteres<br>\";\n }\n \n if(validateEmail(email) == false){\n error ++;\n errorMessage += \"L'email doit etre valide<br>\";\n }\n \n if(password.length < 6 || password.length >20){\n error ++;\n errorMessage += \"Le Mot de passe doit contenir entre 6 et 20 caracteres<br>\";\n }\n \n \n if(error == 0){\n return true;\n } else {\n return errorMessage;\n }\n}", "title": "" }, { "docid": "8929fdce540770499e90c247d025e231", "score": "0.58375657", "text": "function validateInput(){\n //check username is empty\n if(userName.value.trim()===\"\"){\n onError(userName,\"User Name cannot be Empty\");\n }\n\n //Execute if Username field is not empty\n else{\n onSuccess(userName);\n }\n\n //Execute if the email field is empty\n if(email.value.trim()===\"\"){\n onError(email, \"Email cannot be empty\");\n }\n\n //Execute if the email field is not in Email format having @ sign\n else if(!isValidEmail(email.value.trim())){\n onError(email, \"Email is not valid\");\n }\n\n //Execute if the email field is correctly filled according to email format\n else{\n onSuccess(email);\n }\n\n //Execute when the password field is empty\nif(pwd.value.trim()===\"\"){\n onError(pwd,\"Password cannot be empty\");\n }\n\n //Execute when the password field is filled\n else{\n onSuccess(pwd);\n }\n\n //Execute when the password field is empty\n if(conPwd.value.trim()===\"\"){\n onError(conPwd, \"Confirm Password cannot be empty\");\n }\n\n //Check the password and confirm password, execute if they dont match\n else if(pwd.value.trim()!==conPwd.value.trim()){\n onError(conPwd, \"Password & Confirm Password not Matching\")\n }\n\n //Execute if they match\n else{\n onSuccess(conPwd);\n }\n }", "title": "" }, { "docid": "2c4149159133d58b3b2ab5a100b91623", "score": "0.5823867", "text": "function inputFunc (input) { console.log(input); } // input is a parameter or argument", "title": "" }, { "docid": "4d9e95f7e788e49de83a3dd6de1f2ee5", "score": "0.58181703", "text": "validateInput(input){\n\t\treturn true;\n\t}", "title": "" }, { "docid": "7e782e7b2d6a954b8dae8d1a26146877", "score": "0.58050925", "text": "function checkErrors() {\n\n}", "title": "" }, { "docid": "3abdb36cc1c7dc1d798f4e0e06a6d510", "score": "0.5802772", "text": "function checkInput() {\r\n\t\tvar msg = \"\";\r\n\t\tif (materialNo.getValue() == \"\") {\r\n\t\t\tmsg = \"'物料编码'\";\r\n\t\t}\r\n\t\tif (txtMrOriginal.getValue() == \"\") {\r\n\t\t\tif (msg != \"\") {\r\n\t\t\t\tmsg = msg + \",计划来源'\";\r\n\t\t\t} else {\r\n\t\t\t\tmsg = \"计划来源'!\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Ext.get(\"appliedCount\").dom.value == \"\") {\r\n\t\t\tif (msg != \"\") {\r\n\t\t\t\tmsg = msg + \",申请数量'!\";\r\n\t\t\t} else {\r\n\t\t\t\tmsg = \"申请数量'!\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Ext.get(\"dueDate\").dom.value == \"\") {\r\n\t\t\tif (msg != \"\") {\r\n\t\t\t\tmsg = msg + \",'申请领用日期'!\";\r\n\t\t\t} else {\r\n\t\t\t\tmsg = \"'申请领用日期'!\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (msg != \"\") {\r\n\t\t\tExt.Msg.alert(\"提示\", \"请输入\" + msg);\r\n\t\t\treturn false\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "40a6b4fb2f62b2f503e10b8cafa33d50", "score": "0.57784575", "text": "function checkInputs() {\r\n const firstName = getFirstName.value;\r\n const lastName = getLastName.value;\r\n const email = getEmail.value;\r\n const password = getPassword.value;\r\n let msg = 'cannot be empty';\r\n\r\n if (firstName === '') {\r\n setError(getFirstName, `First Name ${msg}`);\r\n } else {\r\n setSuccess(getFirstName);\r\n }\r\n\r\n if (lastName === '') {\r\n setError(getLastName, `Last Name ${msg}`);\r\n } else {\r\n setSuccess(getLastName)\r\n }\r\n\r\n if (email === '') {\r\n getEmail.placeholder = 'email@example/com'\r\n setError(getEmail, 'Looks like this is not an email');\r\n } else {\r\n setSuccess(getEmail);\r\n getEmail.placeholder = 'Email Address'\r\n }\r\n\r\n if (password === '') {\r\n setError(getPassword, `Password ${msg}`);\r\n } else {\r\n setSuccess(getPassword);\r\n }\r\n\r\n if (firstName && lastName && email && password) {\r\n // alert('success')\r\n successLog();\r\n }\r\n}", "title": "" }, { "docid": "59f73d93d0f4e8d3d4991cea42b1eea6", "score": "0.5773091", "text": "function validatefirstname(firstname, message) {\n\n var char1;\n var hasNumber;\n\n if (firstname.value == \"\") {\n message.valueOf = \"First Name is required\";\n document.getElementById('firstName').style.borderColor = \"red\";\n return false;\n }\n\n if (firstname.length > 40) {\n message.valueOf = \"First Name must be at most 40 characters\";\n document.getElementById('lastName').style.borderColor = \"red\";\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "dcb3299fe06cc0ba5b1b087ca90f037f", "score": "0.5740799", "text": "function validateInputs() {\n\n // Check username input min length.\n if ($.trim($('#username').val()).length < 4) {\n // Return an object that contains the result and the error message.\n return {\n result: false,\n msg: 'Username must be minimum of 4 characters.'\n };\n }\n\n // Check username input max length.\n if ($.trim($('#username').val()).length > 15) {\n // Return an object that contains the result and the error message.\n return {\n result: false,\n msg: 'Username must be maximum of 15 characters.'\n };\n }\n\n // Check password input min length.\n if ($.trim($('#password').val()).length === 0) {\n // Return an object that contains the result and the error message.\n return {\n result: false,\n msg: 'Password cannot be empty.'\n };\n }\n\n // Return true if no errors on input validations.\n return {\n result: true\n };\n }", "title": "" }, { "docid": "deca2f0f6966dba6ebb25c9ff4e99f37", "score": "0.5740748", "text": "function validInputs(){\n \n /**\n * if first.value is empty and is different regex(textInput),\n * or first.length is less than 2 characters => error message\n */\n if(textInput.exec(firstName.value) === null || firstName.length < 2) {\n firstError.textContent = 'Veuillez renseigner 2 caractères minimum pour le prénom';\n firstError.style.color = 'red';\n firstError.style.marginLeft = '30px';\n firstError.style.fontSize = '15px';\n firstName.style.borderColor = 'red';\n firstName.style.borderWidth = '2px';\n return formValid === false;\n }else {\n firstError.style.display = 'none';\n firstName.style = 'default';\n }\n\n /** \n * if last.value is empty and is different regex(textInput),\n * or last.length is less than 2 characters => error message\n */\n if(textInput.exec(lastName.value) === null || lastName.length < 2) {\n lastError.textContent = 'Veuillez renseigner 2 caractères minimum pour le nom';\n lastError.style.color = 'red';\n lastError.style.marginLeft = '30px';\n lastError.style.fontSize = '15px';\n lastName.style.borderColor = 'red';\n lastName.style.borderWidth = '2px';\n return formValid === false;\n }else {\n lastError.style.display = 'none';\n lastName.style = 'default';\n }\n\n /**\n * if email doesn't correspond to regex => message error\n */\n \n if(mailInput.exec(email.value) === null) {\n emailError.textContent = 'Veuillez renseigner une adresse mail valide';\n emailError.style.color = 'red';\n emailError.style.marginLeft = '30px';\n emailError.style.fontSize = '15px';\n email.style.borderColor = 'red';\n email.style.borderWidth = '2px';\n return formValid === false;\n } else {\n emailError.style.display = 'none';\n email.style = 'default';\n }\n\n /**\n * if message.value is empty and is different regex(textInput),\n * or last.length is less than 2 characters => error message \n */\n if(textInput.exec(message.value) === null || message.length < 2) {\n messageError.textContent = 'Veuillez renseigner 2 caractères minimum pour votre message';\n messageError.style.color = 'red';\n messageError.style.marginLeft = '30px';\n messageError.style.fontSize = '15px';\n message.style.borderColor = 'red';\n message.style.borderWidth = '2px';\n return formValid === false;\n }else {\n messageError.style.display = 'none';\n message.style = 'default';\n }\n return formValid = true;\n\n}", "title": "" }, { "docid": "f7a0117873dcba73719f4f54877a6444", "score": "0.57346314", "text": "function showError(msg){ showMsg(msg, \"danger\"); }", "title": "" }, { "docid": "786d291e7f16a6193b6baec0f5f47418", "score": "0.5733487", "text": "function errorMsg() {\n console.log(\"Error!\");\n}", "title": "" }, { "docid": "42cd23735ba967b8ef8d1f99ebb3d41d", "score": "0.57230705", "text": "function getInput(input, msg) {\n var value = $(input).val();\n if (!value) {\n $(input + 'Error').html(msg + ' is required');\n return null;\n }\n $(input + 'Error').html('');\n return value;\n}", "title": "" }, { "docid": "9dc5339d57eddee3fbafac064a2f1359", "score": "0.57188034", "text": "function getMessage (){\r\n let tt = document.getElementById(\"inputBox\");\r\n textBox = tt.value;\r\n if (textBox === \"\"){\r\n console.log(\"No input content!!\");\r\n textBox = \"No Input Content\";\r\n }\r\n return textBox;\r\n}", "title": "" }, { "docid": "be7889662016e22c3ee223a31cd27912", "score": "0.57125974", "text": "function customValidation(input){\n \n}", "title": "" }, { "docid": "48b6ff8a6dc743e0f5d702ee16896186", "score": "0.57079476", "text": "function validate() {\n let valid = false;\n // Kunkanya: check Input for firstname if it is valid\n if (firstName.value === \"\" || firstName.value.length < 2) {\n // Kunkanya: when error go to setInputError function\n setInputError(firstName, nameErrorMessage);\n return false;\n } else {\n // Kunkanya: when success go to setInputError function\n setInputSuccess(firstName);\n }\n\n //Kunkanya: check Lastname\n if (lastName.value === \"\" || lastName.value.length < 2) {\n // Kunkanya: when error go to setInputError function\n setInputError(lastName, nameErrorMessage);\n return false;\n } else {\n // Kunkanya: when success go to setInputError function\n setInputSuccess(lastName);\n }\n\n //Kunkanya: check E-mail\n if (email.value === \"\" || email.value == null) {\n // Kunkanya: when error go to setInputError function\n setInputError(email, emailErrorMessage);\n return false;\n } else {\n // Kunkanya: when success go to setInputError function\n setInputSuccess(email);\n }\n\n //Kunkanya: check birthdate\n\n if (birthDate.value === \"\") {\n // Kunkanya: when error go to setInputError function\n setInputError(birthDate, birthDateErrorMessage);\n return false;\n } else {\n // Kunkanya: when success go to setInputError function\n setInputSuccess(birthDate);\n }\n\n //Kunkanya: check quantity\n if (quantity.value === \"\" || quantity.value === NaN) {\n // Kunkanya: when error go to setInputError function\n setInputError(quantity, quantityErrorMessage);\n return false;\n } else {\n // Kunkanya: when success go to setInputError function\n setInputSuccess(quantity);\n }\n\n // Kunkanya: check location. \n let locationValid = false;\n //Kunkanya: to select the parent element of the DOM\n let parent = locationTown[0].parentElement;\n //Kunkanya: to select the child of the parent with tag \"small\"\n let err = parent.querySelector(\"small\");\n //Kunkanya : check at least one round if it checked and break the loop if found the first checked.\n for (var i = 0; i < locationTown.length; i++) {\n if (locationTown[i].checked) {\n err.style.display = \"none\";\n locationValid = true;\n break;\n }\n }\n\n //Kunkanya: if location isnt checked show message error\n if (!locationValid) {\n err.style.display = \"block\";\n err.style.color = \"red\";\n err.innerText = locationErrorMessage;\n return false;\n }\n\n // Kunkanya: check condition general if checked\n if (!conditionGeneral.checked && valid == false) {\n let parent = conditionGeneral.parentElement;\n let err = parent.querySelector(\"small\");\n if (!conditionGeneral.checked) {\n err.style.display = \"block\";\n err.style.color = \"red\";\n err.innerText = conditionErrorMessage;\n return false;\n } else {\n err.style.display = \"none\";\n valid = true;\n }\n } else {\n valid = true;\n }\n\n //Kunkanya : if valid = true then show the thankyou page\n if (valid == true) {\n form.style.display = \"none\";\n const submitPage = document.getElementById(\"thankyou\");\n submitPage.style.display = \"block\";\n } \n}", "title": "" }, { "docid": "0a316546115e4446b44bee7a98af59f3", "score": "0.57049054", "text": "function inputManager () {\n\t\tvar userInputVal = userInput.value;\n\t\tif (userInputVal < 1) {\n\t\t\terrorMessage.innerHTML = \"Du f&aring;r inte ange mindre &auml;n 1\";\n\t\t} else if (userInputVal > 5) {\n\t\t\terrorMessage.innerHTML = \"Du f&aring;r inte ange större &auml;n 5\";\n\t\t} else {\n\t\t\tgameManager(userInputVal);\n\t\t\terrorMessage.innerHTML = \"\";\n\t\t}\n\t}", "title": "" }, { "docid": "28bb8b78188ceff0dc1e8d7973c4edec", "score": "0.5686111", "text": "function checkfn (req) {\n return function (callback) {\n\n switch (myArgs[0]) {\n case 'signup':\n var Bonus = signup[myArgs[1]];\n err = true;\n if(Bonus)\n result = \"Award Bonus \"+ Bonus;\n else\n result = \"Signup Cashback not applied for this website. Kindly check the value or contact admin.\"\n break;\n case 'spend':\n err = false;\n result = \"SPEND\";\n break;\n case 'redeem':\n var redeem = signup[myArgs[1]];\n err = true;\n if(redeem)\n result = \"Visit \"+redeem+\" to start earning cashback!\";\n else\n result = \"Redeem not applied for this website. Kindly check the value or contact admin.\"\n break; \n default:\n console.log('Wrong Input. Kindly check your parameter');\n }\n callback(err, result);\n }\n}", "title": "" }, { "docid": "7c309a8efbb67f780fc74249c5d3e100", "score": "0.56710666", "text": "function defaultError(error)\n{\n message(\"error:\" + error.responseText, 1);\n}", "title": "" }, { "docid": "a4d3069f55e95cdacac4af9ae2a1300f", "score": "0.5645489", "text": "function inputAsOutput(input){\n if(input.length === 0){\n return \"no input provided\";\n }else{\n return input;\n }\n\n}", "title": "" }, { "docid": "996524c68dbbc766b4e352fe7f9eb167", "score": "0.5634747", "text": "function onError(input, message){\n let parent =input.parentElement;\n let messageEle=parent.querySelector(\"small\");\n messageEle.style.visibility = \"visible\";\n messageEle.innerText = message;\n parent.classList.add(\"error\");\n parent.classList.remove(\"success\");\n}", "title": "" }, { "docid": "875a9c5aa3ac55fd9231875bfe8930ca", "score": "0.56296915", "text": "function oninput() {\n var message = checkFunction(input.value);\n\n if (input.value === '' || message === null) {\n checkOk.style.opacity = '0';\n checkNotOk.style.opacity = '0';\n } else if (message) {\n checkOk.style.opacity = '0';\n checkNotOk.style.opacity = '1';\n spanBubble.textContent = message;\n } else {\n checkOk.style.opacity = '1';\n checkNotOk.style.opacity = '0';\n }\n // @TODO: Stir the randomish\n }", "title": "" }, { "docid": "5124942e687563466d1b2657e0fac28a", "score": "0.5629287", "text": "error(message) {}", "title": "" }, { "docid": "5124942e687563466d1b2657e0fac28a", "score": "0.5629287", "text": "error(message) {}", "title": "" }, { "docid": "06a207904610f3e9a2af8c03a27093a9", "score": "0.56224567", "text": "function successOrErrorMeassages(messageDisplayDiv, defaultFunctionName, data, buttonValue, tableMessgeDisplayDiv) {\n data = JSON.parse(data);\n if (data == fail) {\n displayErrorMessages(messageDisplayDiv, \"Invalid username / password\" + \"\");\n setTimeout(function () {\n defaultFunctionName();\n }, 4000);\n } else if (data == unauthorized) {\n displayErrorMessages(messageDisplayDiv, unauthorizedMessage + \"\");\n setTimeout(function () {\n defaultFunctionName();\n }, 4000);\n } else if (data == statusException) {\n displayErrorMessages(messageDisplayDiv, statusExceptionMessage + \"\");\n setTimeout(function () {\n defaultFunctionName();\n }, 4000);\n } else if (data.statuscode == invalidSession) {\n callSessionTimeout();\n } else if (data == duplicate_Message) {\n displayErrorMessages(messageDisplayDiv, existed + \"\");\n setTimeout(function () {\n defaultFunctionName();\n }, 4000);\n } else if (data == delete_map) {\n displayErrorMessages(tableMessgeDisplayDiv, \"This Data\" + delete_map_message, \"\");\n setTimeout(function () {\n defaultFunctionName();\n }, 4000);\n } else {\n if (buttonValue === \"Save\") {\n displaySuccessMessages(messageDisplayDiv, successMessage, \"\");\n } else if (buttonValue === \"Update\") {\n displaySuccessMessages(messageDisplayDiv, updateSuccessMessage, \"\");\n } else if (buttonValue === \"Delete\") {\n displaySuccessMessages(tableMessgeDisplayDiv, deleteSuccessMessage, \"\");\n }\n setTimeout(function () {\n defaultFunctionName();\n }, 4000);\n }\n\n}", "title": "" }, { "docid": "66315dbada90c9a55275337086336f3d", "score": "0.5621565", "text": "function validateInput(strValidateStr,objValue,strError) \n{ \n var ret = true;\n var epos = strValidateStr.search(\"=\"); \n var command = \"\"; \n var cmdvalue = \"\"; \n if(epos >= 0) \n { \n command = strValidateStr.substring(0,epos); \n cmdvalue = strValidateStr.substr(epos+1); \n } \n else \n { \n command = strValidateStr; \n } \n\n switch(command) \n { \n case \"req\": \n case \"required\": \n { \n\t\t ret = TestRequiredInput(objValue,strError)\n break; \n }\n case \"maxlength\": \n case \"maxlen\": \n { \n\t\t\t ret = TestMaxLen(objValue,cmdvalue,strError)\n break; \n }\n case \"minlength\": \n case \"minlen\": \n { \n\t\t\t ret = TestMinLen(objValue,cmdvalue,strError)\n break; \n }\n case \"alnum\": \n case \"alphanumeric\": \n { \n\t\t\t\tret = TestInputType(objValue,\"[^A-Za-z0-9]\",strError, \n\t\t\t\t\t\tobjValue.name+\": Only alpha-numeric characters allowed \");\n\t\t\t\tbreak; \n }\n case \"alnum_s\": \n case \"alphanumeric_space\": \n { \n\t\t\t\tret = TestInputType(objValue,\"[^A-Za-z0-9\\\\s]\",strError, \n\t\t\t\t\t\tobjValue.name+\": Only alpha-numeric characters and space allowed \");\n\t\t\t\tbreak; \n }\t\t \n case \"num\": \n case \"numeric\": \n { \n ret = TestInputType(objValue,\"[^0-9]\",strError, \n\t\t\t\t\t\tobjValue.name+\": Only digits allowed \");\n break; \n }\n case \"alphabetic\": \n case \"alpha\": \n { \n ret = TestInputType(objValue,\"[^A-Za-z]\",strError, \n\t\t\t\t\t\tobjValue.name+\": Only alphabetic characters allowed \");\n break; \n }\n case \"alphabetic_space\": \n case \"alpha_s\": \n { \n ret = TestInputType(objValue,\"[^A-Za-z\\\\s]\",strError, \n\t\t\t\t\t\tobjValue.name+\": Only alphabetic characters and space allowed \");\n break; \n }\n case \"email\": \n { \n\t\t\t ret = TestEmail(objValue,strError);\n break; \n }\n case \"zip\": { \n\t\t\t ret = TestZip(objValue,strError);\n break; \n }\n case \"lt\": \n case \"lessthan\": \n { \n \t ret = TestLessThan(objValue,cmdvalue,strError);\n break; \n }\n case \"gt\": \n case \"greaterthan\": \n { \n\t\t\tret = TestGreaterThan(objValue,cmdvalue,strError);\n break; \n }\n case \"regexp\": \n { \n\t\t\tret = TestRegExp(objValue,cmdvalue,strError);\n break; \n }\n case \"dontselect\": \n { \n\t\t\t ret = TestDontSelect(objValue,cmdvalue,strError)\n break; \n }\n\t\tcase \"dontselectchk\":\n\t\t{\n\t\t\tret = TestDontSelectChk(objValue,cmdvalue,strError)\n\t\t\tbreak;\n\t\t}\n\t\tcase \"selmin\":\n\t\t{\n\t\t\tret = TestSelMin(objValue,cmdvalue,strError);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"selone\":\n\t\t{\n\t\t\tret = TestSelectOneRadio(objValue,strError);\n\t\t break;\n\t\t}\t\t \n\t\t//Comparisons\n\t\tcase \"eqelmnt\": \n\t\tcase \"ltelmnt\":\n\t\tcase \"leelmnt\":\n\t\tcase \"gtelmnt\":\n\t\tcase \"geelmnt\":\n\t\t{\n\t\t return TestComparison(objValue,cmdvalue,command,strError);\n \t\tbreak;\n\t\t}\n }//switch \n return ret; \n}", "title": "" }, { "docid": "0e4f7fe1e8a7de958f359ec9517a8de8", "score": "0.561063", "text": "function sayHello(name){\n if(name==\"Ravi\"){\n let msg =\"Welcome Valid user\"\n }else {\n let msg = \"Welcome InValid User\"\n }\n return msg;\n}", "title": "" }, { "docid": "a61427054797e59cb073cae4e30bae95", "score": "0.5607", "text": "function checkResult(input) {\r\n let str = result.toString();\r\n let num = input.dataset.key;\r\n let button = input.dataset.key;\r\n\r\n //Check if input is an number or operator\r\n if(str.match(/[0-9]/)) {\r\n if (button.match(/[0-9]/)) {\r\n //See number function\r\n number(input);\r\n } else {\r\n //See operator function\r\n operator(input);\r\n }\r\n } else {\r\n if (num.match(/[0-9]/)) {\r\n //Add a number\r\n addNumber(input)\r\n } else {\r\n //Add a operator\r\n addOperator(input);\r\n };\r\n };\r\n}", "title": "" }, { "docid": "1c2192e2a14a0316f3972c22058eb94f", "score": "0.5598958", "text": "function myFunction(input1) {\n \"use strict\";\n input1 = parseFloat(window.prompt(\"enter value 1\"));\n// var input2 = parseFloat(window.prompt(\"enter value 2\"));\n// var operator = (window.prompt(\"Enter an operator\"));\n /*window.document.write(\"output3\" + output3);\n window.document.write(\"input1\" + input1 + \"input2\" + input2 + \"operator==> \" + operator);\n window.document.write(\"input1:\" + input1);\n window.document.write(\"input1:\" + input2);\n window.document.write(\"operator:\" + operator);\n window.document.write(\"what the hell?\"); */\n var tada_result;\n if (isNaN(input1)) {\n window.alert(\"error will robinson, error!\\nInput1 is not numeric\");\n } else {\n tada_result = (input1 / 2);\n window.alert(\"wholefNumber= \" + input1 + \"\\nhalfNumber\" + tada_result);\n window.document.write(\"result: \" + tada_result);\n }\n //window.alert(\"result : \" + result1);\n //window.alert(\"result : \" + result2);\n //window.document.write(\"value: \" + tada_value);\n window.document.write(\"result: \" + tada_result);\n // return tada_value;\n\n}", "title": "" }, { "docid": "7c56fb56bb9dd6787e3482b21d3760f1", "score": "0.55958384", "text": "function runProgram(input) {\n var data = input;\n if (emailChecker(data) && domainName(data) && validEmail(data)) {\n console.log(\"Vaild\");\n } else {\n console.log(\"Not Valid\");\n }\n}", "title": "" }, { "docid": "0f1f5da86fe7a464cf10263bb7b98eab", "score": "0.55924916", "text": "function error(){\n var checkInstr = assemble();\n if (checkInstr == \"\"){\n errorMsg(\"Please type an instruction\");\n }else{\n var mnemonic = checkInstr.substring(0,3);\n var checkDiv = mnemonic.toUpperCase();\n if ( checkDiv != \"DIV\"){\n errorMsg(\"Enter the right DIV command\");\n }\n }\n }", "title": "" }, { "docid": "db7144e93b13043513407130329c2799", "score": "0.55720997", "text": "function onError(input, message){\r\n let parent = input.parentElement;\r\n let messageEle = parent.querySelector(\"small\");\r\n messageEle.style.visibility = \"visible\";\r\n messageEle.innerText = message; \r\n parent.classList.add(\"error\");\r\n parent.classList.remove(\"success\");\r\n\r\n}", "title": "" }, { "docid": "b6d2ceec8192f9e54c66120ef71b39b8", "score": "0.5568699", "text": "function getErrors() {\n let l = [];\n if (document.getElementById('artistInput').value === \"\") {\n l.push(' \\n no artist name given');\n }\n if (document.getElementById('interviewerInput').value === \"\") {\n l.push(' \\n no interviewer name given');\n }\n if (document.getElementById('previewImageSource').value === \"\") {\n l.push(' \\n no preview image url given');\n }\n if (document.getElementById('previewImageCaption').value === \"\") {\n l.push(' \\n no preview image caption given');\n }\n if (document.getElementById('descriptionInput').value === \"\") {\n l.push(' \\n no interview description given');\n }\n return l; \n}", "title": "" }, { "docid": "34e4f2cca1c143da028f1269db40bf51", "score": "0.55620295", "text": "function performLocalValidation(value, data){\n return null;\n return \"error msg\"\n }", "title": "" }, { "docid": "176d0bfaba0bfdd6b3192dd148fb4bc1", "score": "0.55607724", "text": "validate (input) {\n if (!input.validity.valid) {\n let { validationMessages } = this.args;\n\n if (isPresent (validationMessages)) {\n // The user wants to display a custom validation error message instead\n // of the default validation error message.\n\n for (let i = 0, len = VALIDATION_ERROR_TYPE.length; i < len; ++i) {\n const reason = VALIDATION_ERROR_TYPE[i];\n const failed = input.validity[reason];\n\n if (failed) {\n this.validationMessage = validationMessages[reason] || input.validationMessage;\n break;\n }\n }\n }\n else {\n // Set the default validation message.\n this.validationMessage = input.validationMessage;\n }\n }\n }", "title": "" }, { "docid": "1c44957d2a42b5e4edcbc3313b8768cb", "score": "0.55592966", "text": "function validate() {\n const form = document.getElementById(\"form\");\n const name = document.getElementById(\"name\");\n const email = document.getElementById(\"email\");\n const emailTitle = document.getElementById(\"title\");\n const message = document.getElementById(\"message\");\n const error_message = document.getElementById(\"error_message\");\n const success_message = document.getElementById(\"success_message\");\n\n var text;\n\n if (name.value === \"\" || name.value === null) {\n text = \"Name is required\";\n error_message.innerHTML = text;\n error_message.style.padding = \"10px\";\n return false;\n }\n if (email.value === \"\" || name.value === null) {\n text = \"Please enter a valid email\";\n error_message.innerHTML = text;\n error_message.style.padding = \"10px\";\n return false;\n }\n if (emailTitle.value == \"\" || name.value === null) {\n text = \"Title is required\";\n console.log(\"1\");\n error_message.innerHTML = text;\n error_message.style.padding = \"10px\";\n return false;\n }\n if (message.value == \"\" || name.value === null) {\n text = \"What did you want to tell us?\";\n console.log(\"2\");\n error_message.innerHTML = text;\n error_message.style.padding = \"10px\";\n return false;\n }\n text = \"Form Submitted Successfully!\";\n console.log(\"3\");\n success_message.innerHTML = text;\n success_message.style.padding = \"10px\";\n return true;\n}", "title": "" }, { "docid": "fb08ebc65e30778a46688ea97d05cbd4", "score": "0.55579966", "text": "function invalid() {\n console.log(\"\\nIt Seems You Entered An Invalid Input, Please Try Again\\n\");\n}", "title": "" }, { "docid": "7840ce0eea9fcbf470883d5fd6f2f3cd", "score": "0.55523837", "text": "validateOutput(output)\n {\n // could be anything...\n }", "title": "" }, { "docid": "4452221394c6656023f844190c48b5d1", "score": "0.5552105", "text": "function formValidation() {\r\n\r\n let uname = document.getElementById(\"username\").value;\r\n let uemail = document.getElementById(\"emailadd\").value;\r\n let umessage = document.getElementById(\"message\").value;\r\n\r\n if (ValidateMessage(umessage)) {\r\n if (ValidateName(uname)) {\r\n if (ValidateEmail(uemail)) {\r\n alert(\"Feedback Sent\");\r\n }\r\n }\r\n }\r\n\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "12d18b91c01f918a119d1afe01da41f8", "score": "0.5547303", "text": "function validateErrandInput(title, description, dueDate) {\r\n if (title == '') {\r\n document.getElementById('title').className = 'invalid'\r\n } else document.getElementById('title').className = 'valid'\r\n if (description == '') {\r\n document.getElementById('description').className = 'invalid'\r\n } else document.getElementById('description').className = 'valid'\r\n if (dueDate == '') {\r\n document.getElementById('dueDate').className = 'invalid'\r\n } else document.getElementById('dueDate').className = 'valid'\r\n }", "title": "" }, { "docid": "21834ffe7d5e2aa6808052fe92ec9a71", "score": "0.554315", "text": "function magicVial(myArg, useRequiredMessage) {\n\t// Available \"data-\" attributes\n\t// 1. data-validate=\"name\"\n\t// 2. data-error-message=\"Please enter a valid First Name\" (Note: can either contain a string as an \"error\" message, or can be left blank)\n\t// 3. data-required (Note: can either contain a string as a \"required\" error message, or can be left blank)\n\t//\n\t$(myArg+' input[type=\"submit\"], '+myArg+' #submit').on('click', function(e) {\n\t\tvar comprehensiveRequired;\n\t\t// Verify for inputs, selects, and radios\n\t\t$(myArg+' input, '+myArg+' select, '+myArg+' [data-radio]').each(function() {\n\n\t\t\t// check if passes \"validation\"\n\t\t\tvar validationResult = validation(this);\n\n\t\t\tif (validationResult === 'failed') {\n\t\t\t\te.preventDefault();\n\t\t\t\terrorMessage(this);\n\t\t\t}\n\t\t\tif (validationResult === 'passed') {\n\t\t\t\t$(this).siblings('.error-message').remove();\n\t\t\t}\n\n\t\t\t// check if passes \"required\"\n\t\t\tvar requiredResult = required(this);\n\n\t\t\tif (requiredResult === 'failed') {\n\t\t\t\te.preventDefault();\n\t\t\t\t$(this).addClass('is-required');\n\t\t\t\trequiredMessage(this);\n\t\t\t\tcomprehensiveRequired = 'failed';\n\t\t\t}\n\t\t\tif ($(this).attr('data-radio') !== undefined && requiredResult === 'passed'){\n\t\t\t\t$(this).removeClass('is-required');\n\t\t\t\t$(this).next('.required-message').remove();\n\t\t\t}\n\t\t\telse if (requiredResult === 'passed'){\n\t\t\t\t$(this).removeClass('is-required');\n\t\t\t\t$(this).siblings('.required-message').remove();\n\t\t\t}\n\n\t\t\tvar matchResult = match(this);\n\n\t\t\tif (matchResult === 'failed') {\n\t\t\t\te.preventDefault();\n\t\t\t\t$(this).addClass('no-match');\n\t\t\t\tmatchMessage(this);\n\t\t\t}\n\t\t\telse if (matchResult === 'passed') {\n\t\t\t\t$(this).removeClass('no-match');\n\t\t\t\t$(this).siblings('.no-match-message').remove();\n\t\t\t}\n\t\t});\n\t\tif (useRequiredMessage !== undefined || useRequiredMessage === '') {\n\t\t\tif ($('.status-message-box').length > 0) {\n\t\t\t\t$('.status-message-box').remove();\n\t\t\t}\n\t\t\tif (comprehensiveRequired === 'failed') {\n\t\t\t\trequiredStatusMessage();\n\t\t\t}\n\t\t}\n\t});\n\t\n\t// Correction for text inputs\n\t$(myArg+' input').on('change paste copy cut keyup keydown focusout', function() {\n\n\t\tif (validation(this) === 'failed') {\n\t\t\terrorMessage(this);\n\t\t}\n\t\tif (validation(this) === 'passed') {\n\t\t\t$(this).siblings('.error-message').remove();\n\t\t}\n\n\t\tvar requiredResult = required(this);\n\n\t\tif (requiredResult === 'passed'){\n\t\t\t$(this).siblings('.required-message').remove();\n\t\t}\n\n\t\tvar matchResult = match(this);\n\n\t\tif (matchResult === 'failed') {\n\t\t\t$(this).addClass('no-match');\n\t\t\tmatchMessage(this);\n\t\t}\n\t\telse if (matchResult === 'passed') {\n\t\t\t$(this).removeClass('no-match');\n\t\t\t$(this).siblings('.no-match-message').remove();\n\t\t}\n\t});\n\n\t// Correction for selects\n\t$(myArg+' select').on('change', function() {\n\n\t\tvar validationResult = validation(this);\n\n\t\tif (validationResult === 'failed') {\n\t\t\terrorMessage(this);\n\t\t}\n\t\tif (validationResult === 'passed') {\n\t\t\t$(this).siblings('.error-message').remove();\n\t\t}\n\n\t\tvar requiredResult = required(this);\n\n\t\tif (requiredResult === 'passed'){\n\t\t\t$(this).siblings('.required-message').remove();\n\t\t}\n\t});\n\n\t// Correction for radios\n\t$(myArg+' [data-radio]').on('change', function() {\n\n\t\tvar validationResult = validation(this);\n\n\t\tif (validationResult === 'failed') {\n\t\t\terrorMessage(this);\n\t\t}\n\t\tif (validationResult === 'passed') {\n\t\t\t$(this).siblings('.error-message').remove();\n\t\t}\n\n\t\tvar requiredResult = required(this);\n\n\t\tif (requiredResult === 'passed'){\n\t\t\t$(this).next('.required-message').remove();\n\t\t\t$(this).removeClass('is-required');\n\t\t}\n\t});\n\n\tfunction errorMessage(item) {\n\t\tvar myMessage;\n\t\t// Assign a message\n\t\tif ($(item).data('error-message') && $(item).data('error-message') !== \"\") {\n\t\t\tmyMessage = '<span class=\"error-message\">'+$(item).data('error-message')+'</span>';\n\t\t}\n\t\telse {\n\t\t\tmyMessage = '<span class=\"error-message\">Invalid</span>';\n\t\t}\n\t\t// Check\n\t\tif ($(item).siblings('.error-message')) {\n\t\t\t$(item).siblings('.error-message').remove();\n\t\t\t$(item).after(myMessage);\n\t\t}\n\t\telse {\n\t\t\t$(item).after(myMessage);\n\t\t}\n\t}\n\n\tfunction requiredMessage(item) {\n\t\tif ($(item).hasClass('is-required') && $(item).attr('data-radio') !== undefined) {\n\t\t\t$(item).next('.required-message').remove();\n\n\t\t\tif ($(item).data('required') === \"\") {\n\t\t\t\t$(item).after('<div class=\"required-message\">Required</div>');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(item).after('<div class=\"required-message\">'+$(item).data('required')+'</div>');\n\t\t\t}\n\t\t}\n\t\telse if ($(item).siblings('.required-message')) {\n\t\t\t$(item).siblings('.required-message').remove();\n\n\t\t\tif ($(item).data('required') === \"\") {\n\t\t\t\t$(item).after('<span class=\"required-message\">Required</span>');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(item).after('<span class=\"required-message\">'+$(item).data('required')+'</span>');\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ($(item).data('required') === \"\") {\n\t\t\t\t$(item).after('<span class=\"required-message\">Required</span>');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(item).after('<span class=\"required-message\">'+$(item).data('required')+'</span>');\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction requiredStatusMessage() {\n\t\t$(myArg).before('<div class=\"status-message-box\">'+ useRequiredMessage +'</div>');\n\t}\n\n\tfunction matchMessage(item) {\n\t\tif ($(item).siblings('.no-match-message').length === 0) {\n\t\t\t$(item).after('<span class=\"no-match-message\">Does not match.</span>');\n\t\t}\n\t}\n\n\tfunction match(item) {\n\t\tvar status;\n\t\tif ($(item).is('[data-match]')) {\n\t\t\tvar myMatch = $(item).data('match');\n\t\t\tif ($(item).val() !== $(myMatch).val()) {\n\t\t\t\t$(item).addClass('no-match');\n\t\t\t\tstatus = 'failed';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstatus = 'passed';\n\t\t\t}\n\t\t}\n\t\treturn status;\n\t}\n\n\tfunction required(item) {\n\t\tvar status;\n\t\t// For selects\n\t\tif ($(item).get(0).tagName === 'SELECT') {\n\t\t\tif ($(item).val() === \"\" && $(item).attr('data-required') !== undefined) {\n\t\t\t\tstatus = 'true';\n\t\t\t}\n\t\t}\n\t\t// For radios\n\t\tif ($(item).attr('data-radio') !== undefined && $(item).attr('data-required') !== undefined) {\n\t\t\tif ($(item).children('input[type=\"radio\"]:checked').length === 0) {\n\t\t\t\tstatus = 'failed';\n\t\t\t\t$(item).addClass('is-required');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstatus = 'passed';\n\t\t\t\t$(item).removeClass('is-required');\n\t\t\t}\n\t\t}\n\t\t// For all others\n\t\telse if ($(item).attr('data-required') !== undefined) {\n\t\t\t($(item).val() === \"\") ? status = 'failed' : status = 'passed';\n\t\t\tif (status === 'passed'){\n\t\t\t\t$(item).removeClass('is-required');\n\t\t\t}\n\t\t}\n\t\treturn status;\n\t}\n\n\t// Possible validation values:\n\t// 1. \"name\"\n\t// 2. \"email\"\n\t// 3. \"username\"\n\t// 4. \"password\"\n\tfunction validation(item) {\n\t\tvar errors = 'false';\n\t\tvar blackSimplePat = /(drop tables|drop table)|(^var[?= ]|^var$)|\\<script/;\n\t\tvar blackNamePat = /(drop tables|drop table)|(^var[?= ]|^var$)|\\<script|[\\[\\<\\>\\(\\)\\{\\};\\=\\]]/;\n\t\tvar blackUsernamePat = /(drop tables|drop table)|(^var[?= ]|^var$)|\\<script/;\n\t\tvar blackPasswordPat = /(drop tables|drop table)|(^var[?= ]|^var$)|\\<script/;\n\t\tvar whiteEmailPat = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/;\n\t\tswitch($(item).data('validate')) {\n\t\t\tcase 'name':\n\t\t\t\tif (blackNamePat.test($(item).val()) === true) {\n\t\t\t\t\terrors = 'true';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'simple':\n\t\t\t\tif (blackSimplePat.test($(item).val()) === true) {\n\t\t\t\t\terrors = 'true';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif (whiteEmailPat.test($(item).val()) === false && $(item).val() !== \"\") {\n\t\t\t\t\terrors = 'true';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'username':\n\t\t\t\tif (blackUsernamePat.test($(item).val()) === true) {\n\t\t\t\t\terrors = 'true';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'password':\n\t\t\t\tif (blackPasswordPat.test($(item).val()) === true) {\n\t\t\t\t\terrors = 'true';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t};\n\t\tvar status;\n\t\t(errors === 'true') ? status = 'failed' : status = 'passed';\n\t\tif (status === 'failed') {\n\t\t\t$(item).addClass('failed');\n\t\t}\n\t\tif (status === 'passed') {\n\t\t\t$(item).removeClass('failed');\n\t\t}\n\t\treturn status;\n\t}\n}", "title": "" }, { "docid": "5ed88e6f39f8eacb0968d5c1343f7c7f", "score": "0.5538037", "text": "function validateInput(input, bool) {\r\n\tswitch(input) {\r\n\t\tcase name:\r\n\t\t\tnameOk = bool;\r\n\t\t\tbreak;\r\n\t\tcase email:\r\n\t\t\temailOk = bool;\r\n\t\t\tbreak;\r\n\t\tcase password:\r\n\t\t\tpasswordOk = bool;\r\n\t\t\tbreak;\r\n\t\tcase passwordConfirm:\r\n\t\t\tpasswordConfirmOk = bool;\r\n\t\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "3c5faa9d714e75c6c6390b391366e10f", "score": "0.5519591", "text": "function validationContact(){\n let isError = false;\n const warning = document.getElementById(\"warning\");\n warning.innerHTML = \"\";\n let inputIds = [\"firstname\", \"name\", \"email\", \"adresse\", \"city\"];\n let inputTexts = [\"firstname\",\"name\", \"mail\", \"adresse\", \"ville\"];\n for (let i = 0; i < inputIds.length; i++){\n const input = document.getElementById(inputIds[i]);\n \n if (inputIds[i] === \"name\" || inputIds[i] === \"firstname\" || inputIds[i] === \"city\"){\n if (isAlpha(input.value) === false){\n isError = true;\n warning.appendChild(alertMessage(\"text-warning\",\"Merci de renseigner votre \"+ inputTexts[i]+ \" \" + \"en toutes lettres\" +\".\"));\n }\n }\n if (inputIds[i] === \"email\"){\n if (validateEmail(input.value) === false){\n isError = true;\n warning.appendChild(alertMessage(\"text-warning\",\"Merci de renseigner une adresse \" + inputTexts[i] +\" \" + \"valide\"));\n }\n }\n if (inputIds[i] === \"adresse\"){\n if (isAdresse(input.value) === false){\n isError = true;\n warning.appendChild(alertMessage(\"text-warning\",\"Merci de renseigner votre \" + inputTexts[i] +\" \" + \"postale\"));\n }\n }\n \n }\n return isError;\n}", "title": "" }, { "docid": "c0c954a89a43757ae803f6efe038f5d7", "score": "0.55179316", "text": "function generalError() {\n console.log(clc.red('Sorry the parameters you passed were incorrect. Please check the spelling, the format and try again.'));\n // console.log('Sorry the parameters you passed were incorrect. Please check the spelling, the format and try again.');\n}", "title": "" }, { "docid": "49f72bd358e15916b2b06519c620f740", "score": "0.55167955", "text": "function main () {\n\n let firstNumber, secondNumber, text;\n\n //get the value of the Width Input Field, id=\"textfield1\"\n firstNumber = document.getElementById(\"textfield1\").value;\n\n //validate if user typed a number, odd validation by TRUE conditional\n document.getElementById(\"validityTest1\").innerHTML = alert(testNaN (firstNumber));\n document.getElementById(\"validityTest1\").innerHTML = testNaN (firstNumber);\n\n // get the value of the hieght Input Field, id=\"textfield2\"\n secondNumber = document.getElementById(\"textfield2\").value;\n\n //validate if user typed a number , odd validation by TRUE conditional\n document.getElementById(\"validityTest2\").innerHTML = alert(testNaN (secondNumber));\n document.getElementById(\"validityTest2\").innerHTML = testNaN (secondNumber);\n\n if (stop == true) {\n document.getElementById(\"large\").innerHTML = \"Please input a real number, no text is to be written\" //Change to more appropriate message\n }\n else {\n console.log(\"What did you say?\", geometry (firstNumber, secondNumber)); // deiference between calling functions between calling arguments and sending parameter's, local variables\n document.getElementById(\"large\").innerHTML = \"What did you say? \" + geometry (firstNumber, secondNumber);\n }\n}", "title": "" }, { "docid": "580e34c810d2af9456eddfb159586921", "score": "0.5515708", "text": "function messageBuilder(validator, fizzub, fizzubSpan) {\n\n //Span tags for editing text color and size fo the message\n var whiteSpan = \"<span style='color: #fff; font-family:Times New Roman; font-size: 25px;'>\";\n var redSpan = \"<span style='color: #ea1515; font-family:Times New Roman; font-size: 25px;'>\";\n var spanEnd = \"</span>\";\n var brk = \"<br />\";\n var normSpan = \"<span style='color: #fff; font-family:Times New Roman; font-size: 20px;'>\";\n \n\n //Input is empty\n if (validator == -3) {\n\n return normSpan + \"You did not enter \" + spanEnd + fizzubSpan + fizzub + spanEnd + brk + fizzubSpan + fizzub + spanEnd + normSpan + \" must be an\" + spanEnd + redSpan + \" Integer \" + spanEnd + whiteSpan + \"between \" + spanEnd + redSpan + \"1\" + spanEnd + normSpan + \" and \" + spanEnd + redSpan + \"100\";\n }\n //Input is not an Integer between 1 and 100\n else if (validator == 0 || validator == -1 || validator == -2) {\n\n return fizzubSpan + fizzub + spanEnd + normSpan + \" must be an\" + spanEnd + redSpan + \" Integer \"+ spanEnd + whiteSpan + \"between \" + spanEnd + redSpan + \"1\" + spanEnd + normSpan + \" and \" + spanEnd + redSpan + \"100\";\n }\n //Input is good\n else if (validator == 1) {\n\n return fizzubSpan + fizzub + spanEnd + normSpan + \" is a \" + spanEnd + redSpan + \"valid \" + spanEnd + normSpan + \" input\" + spanEnd;\n }\n}", "title": "" }, { "docid": "26bf02d432f54e68ba32d4029ae0479c", "score": "0.5515624", "text": "function validation() {\r\n\t\t\t// selectors\r\n\t\tlet username = document.querySelector(\"#Username\").value;\r\n\t\tlet useremail = document.querySelector(\"#Useremail\").value;\r\n\t\tlet usernumber = document.querySelector(\"#Usernumber\").value;\r\n\t\tlet useraddresss = document.querySelector(\"#Useraddress\").value;\r\n\t\tlet usersubject = document.querySelector(\"#Usersubject\").value;\r\n\t\t\t// verification for name\r\n\t\t\t\tif((username == \"\") || (username.length < 2) || (username > 20)){\r\n\r\n\t\t\t\t\talert(\"PLease fill the username at least 2 character and maximum 20 characters.\");\r\n\t\t\t\t}\r\n\t\t\t// varification for email\r\n\t\t\t\telse if((useremail == \"\") || (useremail.indexOf('@') <= 0) || (useremail.charAt(useremail.length-4)!='.')){\r\n\t\t\t\t\talert(\"PLease fill the valid email.\");\r\n\t\t\t\t}\r\n\t\t\t// varification for number\r\n\t\t\t\telse if((isNaN(usernumber)) || (usernumber == \"\") || (usernumber.length <10) || (usernumber.length >10)){\r\n\t\t\t\t\talert(\"PLease fill the proper moblie number.\");\r\n\t\t\t\t}\r\n\t\t\t// varification for address\r\n\t\t\t\telse if((useraddresss == \"\") || (useraddresss.length < 10) || (username > 50)){\r\n\t\t\t\t\talert(\"PLease fill the address at least 10 characters and maximum 50 characters.\");\r\n\t\t\t\t}\r\n\t\t\t// varification for subject\r\n\t\t\t\telse if((usersubject == \"\") || (usersubject.length < 20) || (usersubject > 500)){\r\n\t\t\t\t\talert(\"PLease fill the subject at least 20 characters and maximum 500 characters.\");\r\n\t\t\t\t}\r\n\t\t\t// if all is right\r\n\t\t\telse{alert(\"form has succesful submit.\");\r\n\t\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "02f80f65a2149be7ce57d69fdbf15568", "score": "0.55151963", "text": "function validateSearchCriteriaInput()\n{\nvar errorMessage = messagesData.validValues + \"\\n\\n\";\nvar warningMessage = messagesData.alert + \"\\n\\n\";\nvar errorCount = 0;\nvar warnCount = 0;\n\n\nif (errorCount >0)\n{\n alert(errorMessage);\n return false;\n}\n\nreturn true;\n}", "title": "" }, { "docid": "de64d815f75cf78d2b64bd0dd8bdde1b", "score": "0.55142444", "text": "function onValidation(err,val){\n if(err){\n console.log(err.message);\n return err.message; \n }\n else{\n return true; \n }\n}", "title": "" }, { "docid": "195c6c64b2128ede38550cf883b5b415", "score": "0.55126935", "text": "function validateChangeBasicData() {\n var nickname = document.getElementById(\"lnickname\").value;\n var name = document.getElementById(\"lname\").value;\n var surname = document.getElementById(\"lsurname\").value;\n\n var errorMessage = \"\";\n if (!checkStringIsValid(nickname) || nickname.length > 100 || nickname.length < 2) {\n errorMessage += \"<li>The entered nickname is not valid (Probably is too short/long or empty)!</li>\";\n }\n if (!checkStringIsValid(name) || name.length > 100 || !checkNameStringFormat(name)) {\n errorMessage += \"<li>The name is not valid!</li>\";\n }\n if (!checkStringIsValid(surname) || surname.length > 100 || !checkNameStringFormat(surname)) {\n errorMessage += \"<li>The surname is not valid!</li>\";\n }\n if (errorMessage !== \"\") {\n ProfilePage_ShowChangeBasicDataError(errorMessage);\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "0945e40513f26f54b59327650a212219", "score": "0.55106074", "text": "function readability(input) {\n console.log(\n \"----------------------------------------------------------------------------------------------------\"\n );\n if (input == \"end\") {\n console.log(\"End of Program\");\n } else if (input !== \"end\") {\n // simple check for people entering other variables `end` or nothing at all into the function\n console.log(\"Next Function\");\n }\n console.log(\n \"----------------------------------------------------------------------------------------------------\"\n );\n return 0;\n}", "title": "" }, { "docid": "0945e40513f26f54b59327650a212219", "score": "0.55106074", "text": "function readability(input) {\n console.log(\n \"----------------------------------------------------------------------------------------------------\"\n );\n if (input == \"end\") {\n console.log(\"End of Program\");\n } else if (input !== \"end\") {\n // simple check for people entering other variables `end` or nothing at all into the function\n console.log(\"Next Function\");\n }\n console.log(\n \"----------------------------------------------------------------------------------------------------\"\n );\n return 0;\n}", "title": "" }, { "docid": "58dd06d65fcaa77576197875e4625b38", "score": "0.55104846", "text": "function checkBothDemoInputs() {\r\n if (genderEntered && ageEntered) {\r\n presentData();\r\n }\r\n}", "title": "" }, { "docid": "85a9865057da07758483c1b272cc42f4", "score": "0.5507657", "text": "function errorCheck(userInput) {\n var passedCheck = true;\n if (userInput.Distance<=0 || isNaN(userInput.Distance)) {\n document.getElementById('userDistanceAlert').style.visibility = 'visible';\n passedCheck = false;\n }\n if (userInput.Weight<=0 || isNaN(userInput.Weight)) {\n document.getElementById('userWeightAlert').style.visibility = 'visible';\n passedCheck = false;\n }\n if (userInput.fuelEff<=0 || isNaN(userInput.fuelEff)) {\n document.getElementById('userFuelAlert').style.visibility = 'visible';\n passedCheck = false;\n }\n if (!passedCheck) {\n document.getElementById('calcResults').innerHTML = '<h2>Oops...let\\'s check those numbers and try again!</h2>';\n document.getElementById('calcFoodNo').innerHTML = '...';\n document.getElementById('calcTreesNo').innerHTML = '...';\n document.getElementById('calcExerciseNo').innerHTML = '...';\n }\n return passedCheck;\n}", "title": "" }, { "docid": "353915f1117311370ab36b7d070c1345", "score": "0.5504419", "text": "function helloAgain() {\n\n //////////// DO NOT MODIFY\n let name; // DO NOT MODIFY\n //////////// DO NOT MODIFY\n\n name= prompt(\"What's your Name?\");\n p= document.getElementById(\"output2\");\n p.innerHTML= \"Hello, \" + name + \"!\";\n // WRITE YOUR EXERCISE 2 CODE HERE\n\n ///////////////////////////// DO NOT MODIFY\n check(\"helloAgain\", name); // DO NOT MODIFY\n ///////////////////////////// DO NOT MODIFY\n}", "title": "" }, { "docid": "42d65d86da584978b58617499b683357", "score": "0.54968363", "text": "function checkNameInput() {\n\n let name = $('#contact__form--name').val();\n let message = \"\";\n\n if (name.length == 0) {\n message = \"Your first and last name is required!\";\n isNameValid = false;\n getPrompt(message, \"contact__form--name-prompt\", red);\n\n return false;\n }\n if (!name.match(name_pattern)) {\n message = \"Enter first and last name only!\";\n isNameValid = false;\n getPrompt(message, \"contact__form--name-prompt\", red);\n\n return false;\n }\n\n message = \"Welcome \" + name;\n isNameValid = true;\n getPrompt(message, \"contact__form--name-prompt\", green);\n\n return true;\n\n } //end of the checkNameInput Function", "title": "" }, { "docid": "a12fc5c6cc80e03a5862155da399f000", "score": "0.5496823", "text": "function commandFinalCheck() {\n\t\tvar userErrors = false;\n\n\t\t// Check that project name has been set\n\t\tif (cmdArgs[1] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tprojectNameValidationInfoMessage = 'You must give a name to the project.';\n\t\t\tdocument.getElementById(\"projectNameValidationInfo\").innerHTML = projectNameValidationInfoMessage;\n\t\t\tdocument.getElementById(\"projectNameValidationInfo\").style.display = \"block\";\n\t\t}\n\n\t\t// Check that mapping by sequencing strategy has been set\n\t\tif (cmdArgs[2] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tanalysisTypeValidationInfoMessage = 'You must choose a mapping by sequencing strategy.';\n\t\t\tdocument.getElementById(\"analysisTypeValidationInfo\").innerHTML = analysisTypeValidationInfoMessage;\n\t\t\tdocument.getElementById(\"analysisTypeValidationInfo\").style.display = \"block\";\n\t\t}\n\n\t\t// Check that data source has been set\n\t\tif (cmdArgs[3] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tdataSourceValidationInfoMessage = 'You must choose a data source.';\n\t\t\tdocument.getElementById(\"dataSourceValidationInfo\").innerHTML = dataSourceValidationInfoMessage;\n\t\t\tdocument.getElementById(\"dataSourceValidationInfo\").style.display = \"block\";\n\t\t}\n\n\t\t// Check that reference sequence has been set\n\t\tif (cmdArgs[4] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\trefSeqValidationInfoMessage = 'You must select one or more reference sequence files.';\n\t\t\tdocument.getElementById(\"refSeqValidationInfo\").innerHTML = refSeqValidationInfoMessage;\n\t\t\tdocument.getElementById(\"refSeqValidationInfo\").style.display = \"block\";\n\t\t}\n\n\t\t// If user chose tagged sequence mapping, check that an insertion sequence file has been selected\n\t\tif (cmdArgs[2] == 'ins' && cmdArgs[5] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tinsFileValidationInfoMessage = 'You must select an insertion sequence file.';\n\t\t\tdocument.getElementById(\"insFileValidationInfo\").innerHTML = insFileValidationInfoMessage;\n\t\t\tdocument.getElementById(\"insFileValidationInfo\").style.display = \"block\";\n\t\t}\n\n\t\t// Check that gff file has been set\n\t\tif (cmdArgs[6] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tgffFileValidationInfoMessage = 'You must select a GFF file that matches the names the reference sequence(s) selected.';\n\t\t\tdocument.getElementById(\"gffFileValidationInfo\").innerHTML = gffFileValidationInfoMessage;\n\t\t\tdocument.getElementById(\"gffFileValidationInfo\").style.display = \"block\";\n\t\t}\n\n\t\t// Determine if ann file has been set\n\t\tif (cmdArgs[7] == 'n/p') {\n\t\t\tdocument.getElementById(\"annReminderMsg\").innerHTML = 'REMINDER: You did not select any gene functional annotation file. While easymap can run without it, this information can help to interpret the final results. To know more about where to find this information and how to format it for easymap, see the documentation';\n\t\t\tdocument.getElementById(\"annReminderMsg\").style.display = \"block\";\n\t\t}\n\n\t\t// If user chose MbS analysis, check if all two-way selectors were clicked on\n\t\tif (cmdArgs[2] == 'snp') {\n\t\t\tif (cmdArgs[16] == 'n/p') {\n\t\t\t\tuserErrors = true;\n\t\t\t\tdocument.getElementById(\"mutBackgroundValidationInfo\").innerHTML = 'You must select a mutant background.';\n\t\t\t\tdocument.getElementById(\"mutBackgroundValidationInfo\").style.display = \"block\";\n\t\t\t}\n\t\t\tif (cmdArgs[17] == 'n/p') {\n\t\t\t\tuserErrors = true;\n\t\t\t\tdocument.getElementById(\"crossTypeValidationInfo\").innerHTML = 'You must select the mapping cross performed.';\n\t\t\t\tdocument.getElementById(\"crossTypeValidationInfo\").style.display = \"block\";\n\t\t\t}\n\t\t\tif (cmdArgs[18] == 'n/p') {\n\t\t\t\tuserErrors = true;\n\t\t\t\tdocument.getElementById(\"contTypeValidationInfo\").innerHTML = 'You must select the origin of the control reads.';\n\t\t\t\tdocument.getElementById(\"contTypeValidationInfo\").style.display = \"block\";\n\t\t\t}\n\t\t}\n\n\t\t// If user chose own experimental data, check if problem reads file(s) have been specified\n\t\tif (cmdArgs[3] == 'exp' && cmdArgs[11] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tdocument.getElementById(\"readsProblemWarnMsg\").style.display = \"block\";\n\t\t}\n\n\t\t// If user chose own experimental data and MbS analysis, check if control reads file(s) have been specified\n\t\tif (cmdArgs[2] == 'snp' && cmdArgs[3] == 'exp' && cmdArgs[15] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tdocument.getElementById(\"readsControlWarnMsg\").style.display = \"block\";\n\t\t}\n\n\t\t// Check if user has selected, by mistake, one or more common files as the problem and control reads\n\t\tif (cmdArgs[2] == 'snp' && cmdArgs[3] == 'exp') {\n\t\t\tvar AllReadArgs = [cmdArgs[8], cmdArgs[9], cmdArgs[10], cmdArgs[12], cmdArgs[13], cmdArgs[14]];\n\t\t\tvar AllReads = AllReadArgs.filter(function(Read) {\n\t\t\t return Read != 'n/p';\n\t\t\t});\n\t\t\tif (HasDuplicates(AllReads)) {\n\t\t\t\tuserErrors = true;\n\t\t\t\tdocument.getElementById(\"readsProblemWarnMsg2\").style.display = \"block\";\n\t\t\t\tdocument.getElementById(\"readsControlWarnMsg2\").style.display = \"block\";\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(\"readsProblemWarnMsg2\").style.display = \"none\";\n\t\t\t\tdocument.getElementById(\"readsControlWarnMsg2\").style.display = \"none\";\n\t\t\t}\n\t\t}\n\n\t\t// If user chose simulated data, check if simMut and simSeq parameters have been set properly\n\t\tif (cmdArgs[3] == 'sim' && cmdArgs[20] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tdocument.getElementById(\"simMutValMsg\").innerHTML = 'The input in this field is not correct.';\n\t\t\tdocument.getElementById(\"simMutValMsg\").style.display = \"block\";\n\t\t}\n\n\t\tif (cmdArgs[3] == 'sim' && cmdArgs[22] == 'n/p') {\n\t\t\tuserErrors = true;\n\t\t\tdocument.getElementById(\"simSeqValMsg\").innerHTML = 'The input in this field is not correct.';\n\t\t\tdocument.getElementById(\"simSeqValMsg\").style.display = \"block\";\n\t\t}\n\n\t\t// If user chose MbS simulated data, check simRecsel parameters\n\t\tif (cmdArgs[2] == 'snp' && cmdArgs[3] == 'sim') {\n\t\t\tif (verifySimrecselFieldA() == true && verifySimrecselFieldB() == true) {\n\t\t\t\tvar InA = JSON.parse(document.getElementById(\"form1\").simRecselA.value);\n\t\t\t\tvar InB = JSON.parse(document.getElementById(\"form1\").simRecselB.value);\n\t\t\t\tvar str2 = Object.keys(InB).map(function(k){return InB[k]}).join(\"/\");\n\t\t\t\tvar str1 = InA.contigCausalMut + ',' + InA.posCausalMut + '~r~' + InA.numRecChrs;\n\t\t\t\tcmdArgs[21] = str2 + '~' + str1;\n\t\t\t\t//updateCmd();\n\t\t\t}\n\t\t\tif (verifySimrecselFieldA() == false) {\n\t\t\t\tuserErrors = true;\n\t\t\t\tdocument.getElementById(\"simRecselAValMsg\").innerHTML = 'The input in this field is not correct.';\n\t\t\t\tdocument.getElementById(\"simRecselAValMsg\").style.display = \"block\";\n\t\t\t}\n\t\t\tif (verifySimrecselFieldB() == false) {\n\t\t\t\tuserErrors = true;\n\t\t\t\tdocument.getElementById(\"simReqselBValMsg\").innerHTML = 'The input in this field is not correct.';\n\t\t\t\tdocument.getElementById(\"simReqselBValMsg\").style.display = \"block\";\n\t\t\t}\n\t\t}\n\n\t\t// In snp mode, check argument 23 (stringency). If user did not interact with the switch, select the default value 'high_stringency'\n\t\tif (cmdArgs[2] == 'snp' && cmdArgs[23] == 'n/p') {\n\t\t\tcmdArgs[23] = 'high_stringency';\n\t\t}\n\n\t\tif (userErrors == true) {\n\t\t\tdocument.getElementById(\"checkout-error\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"checkout-success\").style.display = \"none\";\n\t\t} else {\n\t\t\tdocument.getElementById(\"checkout-error\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"checkout-success\").style.display = \"block\";\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "185b2498e030ff848d203baccc9648a8", "score": "0.54967326", "text": "function Validation(){\n\n\t\t\tconst username = document.getElementById('first&lastname').value;\n\t\t\tlet mobilenumber = document.getElementById('contact').value;\n\t\t\tlet email = document.getElementById('emailaddress').value;\n\t\t\tlet subject = document.getElementById('query').value;\n\t\t\tlet message = document.getElementById('texting').value;\n\t\t\tlet validForm=true;\n\n\t\t\tif(username==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('fullname').innerHTML=\"Please Enter Your Full Name\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\n\t\t\tif(mobilenumber==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('digit').innerHTML=\"Please Enter Your Contact Number\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\n\t\t\tif(email==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('emailid').innerHTML=\"Please Enter Your Email Address\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\t\t\tif(subject==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('headline').innerHTML=\"Please Enter Your Subject\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\t\t\tif(message==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('text').innerHTML=\"Please Write Your Comments\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\t\t\t// else{\n\n\t\t\t// alert(\"Form Submitted Successfully!\");\n\t\t\t// return true;\n\t\t\t// }\n\n\t\t\treturn validForm;\n\t\t}", "title": "" }, { "docid": "d43a001f7ac6aaab47b9f04ec3f736e6", "score": "0.5494351", "text": "function checkMessageInput() {\n\n let form_message = $(\"#contact__form--message\").val();\n let characters_left = (required_message_length - form_message.length);\n let message = \"\";\n\n if (form_message.length < required_message_length) {\n\n message = characters_left + \" more characters required in message!\";\n isMessageValid = false;\n getPrompt(message, \"contact__form--message-prompt\", red);\n\n return false;\n\n } else {\n\n message = \"Valid message\";\n isMessageValid = true;\n getPrompt(message, \"contact__form--message-prompt\", green);\n\n return true;\n }\n\n } //end of the checkMessageInput Function", "title": "" }, { "docid": "f81e6574f9f589fc03400060d19eecdc", "score": "0.54847515", "text": "function showMessage(isValid, inputElement, errorMsg, errorElement){\n if (!isValid){\n //display error message:\n if (errorElement !== null) {\n errorElement.innerHTML = errorMsg;\n } else {\n alert(errorMsg);\n }\n //change class of inputElemtn so css displays differently\n if (inputElement !== null) {\n inputElement.className = \"error\";\n inputElement.focus();\n }\n } else {\n //reset to normal display\n if (errorElement !== null) {\n errorElement.innerHTML = \"\";\n }\n if (inputElement !== null) {\n errorElement.className = \"\";\n }\n }\n}", "title": "" }, { "docid": "3c0ce5a7dc30fa5f88cfd3d89e38e74d", "score": "0.54771316", "text": "function successAndErrorAlert(message) {\n const alert = {\n SUCCESS: () => {\n alertDiv.style.display = 'block';\n alertDiv.style.opacity = 1;\n alertDiv.className = \"alert alert-success text-center\";\n alertDiv.innerHTML = `You have successfully added <strong>${formsInput.value}!<i class=\"fas fa-times clickme\"></i></strong>`\n },\n FAILED: () => {\n alertDiv.style.display = 'block';\n alertDiv.style.opacity = 1;\n alertDiv.className = \"alert alert-danger text-center\";\n alertDiv.innerHTML = `<strong>${formsInput.value}</strong> was not found. Try again <i class=\"fas fa-times clickme\"></i>`\n },\n X: () => {\n alertDiv.style.opacity = 0;\n setTimeout(() => {\n alertDiv.style.display = 'none';\n }, 300)\n }\n }\n alert[message]()\n}", "title": "" }, { "docid": "904ecee5fb6c29806833530e438cdc7c", "score": "0.54734623", "text": "function hello(name){\n\t//tell the user what name they've entered\n}", "title": "" }, { "docid": "804b5f907f7a4081aa02be0512307463", "score": "0.5471828", "text": "function validation() {\n var x = document.forms[\"form\"][\"name\"].value; //Sets the value of x = to the value on the input field \"name\"\n \tif (x == \"\") { //If user didn't fill in any name the following code will execute\n document.getElementById(\"name\").innerHTML = \"Please fill in your name\";\n event.preventDefault();\n return false;\n }\n var y = document.forms[\"form\"][\"email\"].value; //Sets the value of y = to the value on the input field \"email\"\n \tif (y == \"\") { //If user didn't fill in any email the following code will execute\n \tdocument.getElementById(\"mail\").innerHTML = \"Please fill in your email\";\n \tevent.preventDefault();\n return false;\n }\n var z = document.forms[\"form\"][\"message\"].value; //Sets the value of z = to the value on the input field \"message\"\n\n//This will write down that the form was sent succefully and also the content of the form.\ndocument.getElementById(\"confirm\").innerHTML = \"Your'e email was succefully sent to: [email protected]\";\ndocument.getElementById(\"namefield\").innerHTML = \"<b>Name:</b> \" + x;\ndocument.getElementById(\"mailfield\").innerHTML = \"<b>Email:</b> \" + y;\ndocument.getElementById(\"messagefield\").innerHTML = \"<b>Message:</b> \" + z;\nevent.preventDefault();\n}", "title": "" }, { "docid": "db0c5db154f9fc84017e135142f092f6", "score": "0.5463891", "text": "function firstNameValid() {\n\n var firstname = $(\"#fname\").val();\n\n if (ValidAlpha(firstname)) {\n f_Valid = ShowError(\"#fid\", ' Please Enter Alphabets only');\n } else {\n f_Valid = true;\n done(\"#fid\", '');\n }\n }", "title": "" }, { "docid": "ebaa53d3015b1aee36688929e791c481", "score": "0.5460885", "text": "static validateInput(parameters) {\n let inputOk = true;\n\n if (parameters.amount < 1) {\n Error.addErrorMessage(\"You must have at least 1 question.\");\n inputOk = false;\n }\n else if (parameters.amount > 50) {\n Error.addErrorMessage(\"You cannot have more than 50 questions.\");\n inputOk = false;\n }\n\n return inputOk;\n }", "title": "" }, { "docid": "117c0740450e2d55dc042ecf69968d0d", "score": "0.5457783", "text": "function errorMessage(humanData) {\n if (humanData.name === \"\") {\n window.alert('Please enter a valid name.');\n return false;\n } else if (humanData.height < 1) {\n window.alert('Please enter a valid height.');\n return false;\n } else if (humanData.weight < 1) {\n window.alert('Please enter a valid weight.');\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "53d93579f2f4bdd5c155370753e1f95f", "score": "0.5456491", "text": "function requestform(e){\n e.preventDefault();\n loader.style.display= 'block';\n btn.style.display= 'none';\n \n \n\n //get values from request home tutor\n var name = getInputval('name');\n var email = getInputval('email');\n var phone = getInputval('phone');\n \n \n \n var subject = getInputval('subject');\n var address = getInputval('address');\n \n \n \n\n savemessage(name, email,phone,subject,address);\n \n}", "title": "" }, { "docid": "c2c9e7784e6e655e5c3f705500ae93fd", "score": "0.5452978", "text": "function errorHanddle(bol,errorID) {\n\n\t\t\t\tvar errorPoint=document.getElementById(errorID);\n\t\t\t\t\n\t\t\t\tif(bol){\n\t\t\t\t\terrorPoint.innerHTML=\"\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\terrorPoint.innerHTML=\"please enter valid inputs\";\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "1f3d83f9b7ec69098982885b8bd91a17", "score": "0.5435016", "text": "function inputValidation(event) {\n\tconsole.debug(\"inputValidation starts\");\n\n\tif (event.requestType === undefined || event.requestType === '' || event.requestType === null) {\n\t\treturn ERROR_TYPES.INVALID_REQUEST_TYPE\n\t} else {\n\t\tif (event.requestType === NOTIFICATION_REQUEST_TYPE.create_group) {\n\t\t\tif (event.additionalData === undefined || event.additionalData === '' || event.additionalData === null) {\n\t\t\t\treturn ERROR_TYPES.INVALID_ADDITIONAL_DATA\n\t\t\t}\n\t\t}\n\t}\n\tif (event.fromWhom === undefined || event.fromWhom === '' || event.fromWhom === null) {\n\t\treturn ERROR_TYPES.INVALID_USERID\n\t}\n\tif (event.toWhoms === undefined || event.toWhoms === '' || event.toWhoms === null) {\n\t\treturn ERROR_TYPES.INVALID_USERID\n\t}\n\tif (event.toWhoms.length <= NUMERIC_CONSTANTS.ZERO_INTEGER) {\n\t\treturn ERROR_TYPES.INVALID_RECEIVER_COUNT\n\t}\n\t// if everything is fine, return success\n\treturn SUCCESS_TYPES.SUCCESS;\n\n}", "title": "" }, { "docid": "8f2bb2a8fa5df37f5aaf6699e6de683f", "score": "0.5430948", "text": "function processUserInput(callback) {\n let name2 = prompt('Please enter your name.');\n callback(name2);\n}", "title": "" }, { "docid": "9185e51b98ece064daefdb12c91fa782", "score": "0.54290545", "text": "function validityCheck(inputVal){\n\t// if either if statment returns TRUE - input from user is not valid\n\tif(inputVal == \"\"){\n\t\tlet p1 = document.createElement(\"p\");\n\t\tp1.textContent = \"Please enter a value.\";\n\t\tdocument.body.appendChild(p1);\n\t\treturn true; \n\t}\n\n}", "title": "" }, { "docid": "e4109d17667e2f5319cd4e164663600b", "score": "0.54276717", "text": "function check_firstname1(first_name, min_size, max_size, isMandatory) {\r\n var firstname_length = first_name.length;\r\n\r\n if (!isMandatory && first_name.length == 0) {\r\n document.getElementById(\"error_firstName\").style.display = \"none\";\r\n return false;\r\n }\r\n\r\n if (firstname_length <= min_size) {\r\n $(\"#error_firstName\").html($('#fisrt_name_error_msg1').text());\r\n document.getElementById(\"error_firstName\").style.display = \"block\";\r\n return true;\r\n } else if (firstname_length > max_size) {\r\n $('#error_firstName').html($('#fisrt_name_error_msg2').text());\r\n document.getElementById(\"error_firstName\").style.display = \"block\";\r\n return true;\r\n } else if (!isValidName(first_name)) {\r\n $('#error_firstName').html($('#fisrt_name_error_msg3').text());\r\n document.getElementById(\"error_firstName\").style.display = \"block\";\r\n return true;\r\n } else {\r\n document.getElementById(\"error_firstName\").style.display = \"none\";\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "f4860e9019b62ad2a83296064242c2f9", "score": "0.54250836", "text": "function dialog_single_input(title, label, defval, success) {\n var dialog, label_elt, error_elt, nameinput;\n dialog = $(\"<div>\").attr({title: title});\n label_elt = $(\"<label>\");\n nameinput = $(\"<input type='text' style='width: 95%'>\").attr({value: defval});\n error_elt = $(\"<div class='error'>\");\n dialog.append(label_elt.text(label));\n dialog.append(nameinput);\n dialog.append(error_elt);\n function submit() {\n var val = nameinput.val();\n if (val) {\n success(val); \n close_dialog();\n } else {\n error_elt.text(\"(Required)\");\n }\n }\n close_dialog();\n current_dialog = dialog;\n current_dialog.dialog({\n buttons: {\n \"Insert\": submit,\n \"Cancel\": close_dialog\n },\n width: 600,\n });\n nameinput.focus();\n nameinput.select();\n nameinput.onEnter(submit);\n return false;\n}", "title": "" }, { "docid": "6a394aeb5773a9a2fd1533a492d681ab", "score": "0.5424413", "text": "function Tfunction() {\r\n if(messagesR != null && messagesS != null) {\r\n if(messagesR.error != null) {\r\n messages = messagesR;\r\n } else if (messagesS.error != null) {\r\n messages = messagesS;\r\n } else {\r\n messages = functions.messages(messagesR,messagesS,filter);\r\n userList = functions.list(messagesR, messagesS);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ea07f19e3da371aad78b0732bafba86d", "score": "0.5422934", "text": "function checkInputs() {\r\n\t\r\n\tvar firstnameValue = firstname.value.trim();\r\n\tvar lastnameValue=lastname.value.trim();\r\n\tvar usernameValue=username.value.trim();\r\n\tvar emailValue = email.value.trim();\r\n\tvar mobilenumberValue=mobilenumber.value.trim();\r\n\tvar postalcodeValue = postalcode.value.trim();\r\n \r\n //first name validation\r\n\t\r\n\tif(firstnameValue === '' || firstnameValue == null) {\r\n\t\tsetErrorFor(firstname, 'First Name cannot be empty');\r\n\t} else if(firstnameValue.length> 6 )\r\n\t{\r\n\tsetErrorFor(firstname, 'Do not enter more than 6 characters');\r\n\t}\r\n\telse if(firstnameValue.match(/^[A-Za-z]+$/)){\r\n\tsetSuccessFor(firstname);\r\n\t}\r\n\telse{\r\n\tsetErrorFor(firstname, 'Enter only characters');\r\n\t}\r\n\t\r\n //last name validation\r\n \r\n\tif(lastnameValue === '' || lastnameValue == null) {\r\n\t\tsetErrorFor(lastname, 'LastName cannot be empty');\r\n\t} else if(lastnameValue.length> 6 )\r\n\t{\r\n\tsetErrorFor(lastname, 'Do not enter more than 6 characters');\r\n\t}\r\n\telse if(lastnameValue.match(/^[A-Za-z]+$/)){\r\n\tsetSuccessFor(lastname);\r\n\t}\r\n\telse{\r\n\tsetErrorFor(lastname, 'Enter only characters');\r\n\t}\r\n\t\r\n\t//User name validation\r\n\t\r\n\tif(usernameValue === '' ) {\r\n\t\tsetErrorFor(username, 'Username cannot be empty');\r\n\t} \r\n\telse if(usernameValue.match(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\\s).{8,15}$/))\r\n\t{\r\n\tsetSuccessFor(username);\r\n\t}\r\n\telse{\r\n\tsetErrorFor(username, 'It must contain one alphabet,numeric,special chars');\r\n }\r\n\t\r\n\t//email validation\r\n\r\n\tif(emailValue === ''|| emailValue === null) {\r\n\t\tsetErrorFor(email, 'Email cannot be empty');\r\n\t} else if (!isEmail(emailValue)) {\r\n\t setErrorFor(email, 'It is not a valid email');\r\n\t\t\r\n\t} else {\r\n\t\tsetSuccessFor(email);\r\n\t}\r\n\t\r\n\t//mobile number validation\r\n\r\n if(mobilenumberValue === '' || mobilenumberValue == null) \r\n {\r\n setErrorFor(mobilenumber, 'Mobile Number cannot be empty');\r\n }\r\n\t else if(mobilenumberValue.match(/^\\d{10}$/)){\r\n\tsetSuccessFor(mobilenumber);\r\n\t}\r\n\telse{\r\n\tsetErrorFor(mobilenumber, 'It is Not a valid Number');\r\n }\r\n \r\n\t//postal code validation\r\n\t\r\n if(postalcodeValue === '' || postalcodeValue == null) \r\n {\r\n setErrorFor(postalcode, 'postal code cannot be empty');\r\n }\r\n\telse if(postalcodeValue.match(/^\\d{8}$/)){\r\n\tsetSuccessFor(postalcode);\r\n\t}\r\n\telse{\r\n\tsetErrorFor(postalcode, 'Enter only 8 digits');\r\n\t}\r\n\t\r\n\t\r\n}", "title": "" }, { "docid": "bb75e56e9afd37fefa1b4168c6d6ecd6", "score": "0.54159445", "text": "function onSuccess(input) {\r\n const parent = input.parentElement;\r\n const messageElement = parent.querySelector(\"small\");\r\n // parent looks for 'small'\r\n // change property value from hidden to visible and insert line 19 to innertext\r\n messageElement.style.visibility = \"hidden\";\r\n // remove the error class if was applied\r\n parent.classList.remove(\"error\");\r\n // changing border color to green\r\n parent.classList.add(\"success\");\r\n}", "title": "" }, { "docid": "a74a3ca4c631fd9559f17fbc3c7bd96d", "score": "0.54151124", "text": "function inputAndOutput(a, b){ //parameters\n return a + b;\n}", "title": "" }, { "docid": "b4c52247f49373a7498f401430a3d697", "score": "0.5410231", "text": "function validation(){\n\tvar desc = document.getElementById(\"desc\").value;\n\tvar amount = document.getElementById(\"amount\").value;\n\tvar value = document.getElementById(\"value\").value;\n\tvar errors = \"\";\n\tdocument.getElementById(\"errors\").style.display = \"none\";\n\n\tif(desc === \"\"){\n\t\terrors += '<p>Fill out description</p>';\n\t}\n\tif(amount === \"\"){\n\t\terrors += '<p>Fill out a quantity</p>';\n\t}else if(amount != parseInt(amount)){\n\t\terrors += '<p>Fill out a valid amount</p>';\n\t}\n\tif(value === \"\"){\n\t\terrors += '<p>Fill out a value</p>';\n\t}else if(value != parseFloat(value)){\n\t\terrors += '<p>Fill out a valid value</p>';\n\t}\n\n\tif(errors != \"\"){\n\t\tdocument.getElementById(\"errors\").style.display = \"block\";\n\t\tdocument.getElementById(\"errors\").innerHTML = \"<h3>Error:</h3>\" + errors;\n\t\treturn 0;\n\t}else{\n\t\treturn 1;\n\t}\n}", "title": "" }, { "docid": "38712db222f04d7e4d076fdc47f6b2d7", "score": "0.5408865", "text": "function error(input,message){\n input.className = 'form-control is-invalid'; //error fonksiyonu çalışır ve form-control sınıfı ile birlikte is-invalid css sınıfı kullanılır\n const div = input.nextElementSibling; //mesajın yazdırılacağı element (inputtan hemen sonraki element, div)\n div.innerText = message; //div içine mesaj yazdırıldı\n div.className = 'invalid-feedback'; //mesajın yazdırılacağı div'e invalid-feedback class'ı eklendi\n}", "title": "" }, { "docid": "cf5cbc8fbb631199956259482dd7006e", "score": "0.5404491", "text": "function HandleWarningsAndErrors({\n length\n}, string, Temp_inputNodes, i) {\n if (length === 0)\n createWarning(`Error! \"${string}\" Does not exist as a tag in the output file`, \"XML_inputText_Div\", \" alert-danger\");\n if (length != Temp_inputNodes.length && (length != 0))\n createWarning(`Warning, the Number of Input tags with the name ' ${tag_list[i].tag.name} ' Is not equal to the number of output tags named ' ${string} '. Some tags may not be processed.`, \"XML_inputText_Div\", \" alert-warning\");\n}", "title": "" }, { "docid": "d00a981ff4c6ab5564f3c19019b509de", "score": "0.5402248", "text": "function notValid(){\n alert(\"Could not find that individual based on the input given. Please try again or say 'no' to proceed to next question.\");\n return false;\n}", "title": "" }, { "docid": "566968f3ad98c0d01f8453ce4d54d766", "score": "0.5400013", "text": "function validate(){\n var input = dom.input.value //.value is property of input that holds the text\n\n if(input < 1 || input > 10){\n dom.output.innerHTML = 'Invalid! Enter a number between 1-10';\n }else if(isNaN(input)){\n dom.output.innerHTML = 'Invalid! Enter a number';//isNaN is not a number. Only numbers are accepted\n }else if(input == \" \"){\n dom.output.innerHTML = 'Invalid! Enter a value';\n }else{\n play(input);//play function from below is called here\n }\n }", "title": "" }, { "docid": "db07a83910498321b93309dd6908318c", "score": "0.539966", "text": "function isSetMessage(input) {\n if (input.value !== '') {\n setSuccessFor(input);\n } else {\n setErrorFor(input, \"Enter a message\");\n }\n}", "title": "" }, { "docid": "7536ca8cd69a8ca7707578775976f19b", "score": "0.5398262", "text": "function ValidateName(field)//function to validate the name input\r\n{\r\n\tvar message='';\r\n\tif(field=='')//tests for empty field \r\n\t{\r\n\t\treturn \"Please enter the name\";\r\n\t}\r\n\t\r\n\tif(/^[a-z]/.test(field))//tests whether the name starts with a lower case letter\r\n\t{\r\n\t\tmessage+=\"A name should start with an upper case letter. \";\r\n\t}\r\n\t\r\n\tif(/[\\d]/.test(field))//tests for occurrence of a digit in the string\r\n\t{\r\n\t\tmessage+=\"The name cannot contain a number.\";\r\n\t}\r\n\tif((/[\\W]/.test(field))&& !(/\\s/.test(field)))//checks if the contains a non-alphabetical character which is not a \"space\"\r\n\t{\r\n\t\tmessage+=\"A name cannot contain non-alphabetic character(s). \";\r\n\t}\r\n\tif(!(/^[A-z][a-zA-Z]+\\s[A-Z][a-zA-Z]+/.test(field)))//checks if there are atleast two names each starting with a capital letter\r\n\t{//if a single name is input or if the name starts with a lower case letter, the name will be rejected\r\n\t\tmessage+=\"There should be atleast two or more names: each starting with a capital letter.\";\r\n\t}\r\n\tif(message=='')//returns appropriate error message(s)\r\n\t{\r\n\t\treturn 1;\r\n\t}\r\n\telse{\r\n\t\treturn message;\r\n\t}\r\n}", "title": "" }, { "docid": "75f0c6e162e72c8f5a5586d210401293", "score": "0.53964514", "text": "function handleUserInput(code, date) {\n if (code >= 0 && date !== undefined) {\n //use function that uses ajax both parameters\n getCrimeDataDateAndCode(date, code);\n }\n //one or the other is valid. if date is valid do ajax with date\n else if (date !== undefined) {\n getCrimeDataDate(date);\n }\n //if crime code is valid, do ajax with crime code\n else if (code > 0) {\n getCrimeDataCrime(code);\n }\n //else alert error\n else {\n alert(\"Error\");\n }\n}", "title": "" } ]
3ba784acbb40e6ec5037c7e7426db09f
========================================= | | | MultiCheck checkbox | | | =========================================
[ { "docid": "8b9480878cbaedc8c787cdb7e47ad7c1", "score": "0.6587663", "text": "function checkall(clickchk, relChkbox) {\n var checker = $(\"#\" + clickchk);\n var multichk = $(\".\" + relChkbox);\n\n checker.click(function() {\n multichk.prop(\"checked\", $(this).prop(\"checked\"));\n });\n}", "title": "" } ]
[ { "docid": "a355d29b1e15dfb5ab7c573708fba098", "score": "0.7569054", "text": "function multiCheck(e) {\n\n let checked = [];\n \n if(e.shiftKey === true && e.target.checked === false) {\n for(let box of checkboxes) {\n box.checked = false;\n }\n } else if(e.shiftKey === true) {\n for(let box of checkboxes) {\n if(box.checked === true) {\n checked.push(checkboxes.indexOf(box));\n }\n }\n for(let i = checked[0]; i <= checked[1]; i++) {\n checkboxes[i].checked = true;\n }\n }\n}", "title": "" }, { "docid": "e65131923ff2034bca288b6ee9b68adb", "score": "0.7056036", "text": "function MultiStateCheckBox(paramName) \r\n{\r\n this.paramName = paramName;\r\n this.multicheckBox = dwscripts.findDOMObject(paramName);\r\n // alert(\"this.paramName: \" + this.paramName + \"\\nthis.multicheckBox: \" + this.multicheckBox + \"\\nthis.multicheckBox.outerHTML:\\n\" + this.multicheckBox.outerHTML); \r\n}", "title": "" }, { "docid": "7e79471cb44279ab5245d7e98c15563b", "score": "0.6868489", "text": "function updateCheckbox(){\n var allSelected = true, semiSelected = false;\n $.each(buttonList, function(index/*, button*/){\n if (!selectedOnMap[index])\n allSelected = false;\n if (selectedOnMap[index] != selectedOnMap[0])\n semiSelected = true;\n });\n\n $checkbox.find('input')\n ._cbxSet(allSelected || semiSelected, true)\n .prop('checked', allSelected || semiSelected)\n .toggleClass('semi-selected', semiSelected);\n }", "title": "" }, { "docid": "e2a79e2f1dcacce3b0955be773931044", "score": "0.6828955", "text": "function updateCheckboxes(item, listName){\n if (item == \"\") {\n $('input[type=checkbox]').checked = false;\n return;\n }\n var list = item[listName];\n for(var j = 0; j < list.length; j++){\n $.each($('input[type=checkbox]'), function(i, checkboxVal){\n if (list[j][0] == checkboxVal['value']) {\n checkboxVal.checked = true;\n }\n });\n }\n }", "title": "" }, { "docid": "ffc0cf6cd8d6906bec2b49b3ca70f6a3", "score": "0.6777682", "text": "function multiCheck(tb_var) {\n tb_var.on(\"change\", \".chk-parent\", function() {\n var e=$(this).closest(\"table\").find(\"td:first-child .child-chk\"), a=$(this).is(\":checked\");\n $(e).each(function() {\n a?($(this).prop(\"checked\", !0), $(this).closest(\"tr\").addClass(\"active\")): ($(this).prop(\"checked\", !1), $(this).closest(\"tr\").removeClass(\"active\"))\n })\n }),\n tb_var.on(\"change\", \"tbody tr .new-control\", function() {\n $(this).parents(\"tr\").toggleClass(\"active\")\n })\n }", "title": "" }, { "docid": "4e00c08113c7f0b1753313d2edddbe5b", "score": "0.67664254", "text": "function checkboxSelected(){\n var ckTrue=0;\n for (var i=0; i < ckBox.length; i++) {\n ckTrue += ckBox[i].checked;\n }\n if (ckTrue > 1) {\n for (var i = 0; i < ckBox.length; i++){\n // set enabled here\n ckBox[i].disabled=false;\n }\n }else {\n for (var i = 0; i < ckBox.length; i++){\n // set Disabled here\n if (ckBox[i].checked){\n ckBox[i].disabled=true;\n }\n }\n }\n} //End of function", "title": "" }, { "docid": "a8467f6728e5ef8efed41393808680bb", "score": "0.673017", "text": "function checkall(clickchk, relChkbox) {\n\n var checker = $('#' + clickchk);\n var multichk = $('.' + relChkbox);\n\n\n checker.click(function () {\n multichk.prop('checked', $(this).prop('checked'));\n }); \n}", "title": "" }, { "docid": "a8467f6728e5ef8efed41393808680bb", "score": "0.673017", "text": "function checkall(clickchk, relChkbox) {\n\n var checker = $('#' + clickchk);\n var multichk = $('.' + relChkbox);\n\n\n checker.click(function () {\n multichk.prop('checked', $(this).prop('checked'));\n }); \n}", "title": "" }, { "docid": "d5d19fd0300fd4e8a484c5c702531807", "score": "0.6724386", "text": "function setAllChecked(domElement, event) {\n\tif(multiselect) {\n\t\tvar tbody = domElement.parentNode.parentNode.parentNode.parentNode.getElementsByTagName(\"tbody\")[0];\n\t\tvar trs = tbody.getElementsByTagName(\"tr\");\n\t\tfor(var i = 0; i < trs.length; i++) {\n\t\t\tvar check = trs[i].children[0].children[0];\n\t\t\tif(domElement.checked != check.checked) {\n\t\t\t\tcheck.checked = domElement.checked;\n\t\t\t\tcheck.onclick(event);\n\t\t\t}\n\t\t}\n\t}\n\tevent.stopPropagation();\n}", "title": "" }, { "docid": "fb84f0914a6cd67968e6c35cdcd73e92", "score": "0.66898084", "text": "checkBoxMain(){\n for (let i = 0; i < this.users.length; i++) {\n this.users[i].checked = this.mainCheckValue;\n }\n }", "title": "" }, { "docid": "2faedbec47e8ddf50cc0efa01f851d26", "score": "0.66724277", "text": "function checkForMultipleRowSelect() {\n var counter = 0;\n var isSingle = false;\n $('input:checkbox.getVal').each(function () {\n var sThisVal = (this.checked ? $(this).val() : \"\");\n if (sThisVal) counter++;\n if (counter > 1) return false;\n });\n if (counter > 1) {\n $('input:checkbox.getVal').each(function () {\n var sThisVal = (this.checked ? $(this).val() : \"\");\n if (sThisVal) $(this).prop('checked', false);\n });\n companyGb = null;\n isSingle = true;\n }\n return isSingle;\n}", "title": "" }, { "docid": "eab42058b468eef09130c12b01d7a8d9", "score": "0.66551214", "text": "static bindSelectAllCheckbox ($cbAll, list) {\n\t\t$cbAll.change(() => {\n\t\t\tconst isChecked = $cbAll.prop(\"checked\");\n\t\t\tlist.visibleItems.forEach(item => {\n\t\t\t\tif (item.data.cbSel) item.data.cbSel.checked = isChecked;\n\n\t\t\t\tif (isChecked) item.ele instanceof $ ? item.ele.addClass(\"list-multi-selected\") : item.ele.classList.add(\"list-multi-selected\");\n\t\t\t\telse item.ele instanceof $ ? item.ele.removeClass(\"list-multi-selected\") : item.ele.classList.remove(\"list-multi-selected\");\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "64ade2c86cc74da43bf72b4ef6db897e", "score": "0.66357934", "text": "function updateCheckbox(item, values){\n item.asCheckboxItem().setChoiceValues(values)\n}", "title": "" }, { "docid": "9fb446b1d08323c6ae632d52c5dec94d", "score": "0.65964025", "text": "function activity_selected(){\n for(let i = 0; i < activities_field.length; i++){\n if(activities_field[i].type === \"checkbox\"){\n if(activities_field[i].checked){\n return true;\n } \n }\n }\n return false;\n}", "title": "" }, { "docid": "5da75fd61d547a66291701f9d6f48063", "score": "0.6552653", "text": "setCheckedItems(items) {\n this.checkedItems = items;\n }", "title": "" }, { "docid": "5851f7e636b4fb1312e24b135f59d494", "score": "0.65400237", "text": "hasCheckboxAtIndex() {\n return false;\n }", "title": "" }, { "docid": "ca55a6deb9910405d1f199fffe1ee598", "score": "0.65357536", "text": "function populateCheckBox(subj) {\n for (let i = 0; i < subj.length; i++) {\n addCheckBoxInput(subj[i]);\n }\n}", "title": "" }, { "docid": "b8fe723e83d48cb7cb05ad54635a63f0", "score": "0.65119857", "text": "function SelectAllCheckboxes(theBox){\n \n\t\txState=theBox.checked; \n elm=theBox.form.elements;\n for(i=0;i<elm.length;i++)\n if(elm[i].type==\"checkbox\" && elm[i].id!=theBox.id)\n {\n //elm[i].click();\n if(elm[i].checked!=xState)\n elm[i].click();\n //elm[i].checked=xState;\n }\n }", "title": "" }, { "docid": "a7e21e0c22a3fa278871e637777d9c80", "score": "0.65053725", "text": "getCheckBoxes() {\n var jobs = [\"Rigger\", \"Loft Head\", \"Loft Employee\", \"Tandem Instructor\",\n \"AFP Instructor\", \"Packer\", \"Manifest\", \"Videographer\",\n \"Hanger Master\", \"Administrator\"];\n var col1 = [];\n var col2 = [];\n var col3 = [];\n\n for (var i = 0; i < jobs.length; i++) {\n var nextJob = jobs[i];\n var t = true;\n var nextItem = <Checkbox isChecked={false} key={i} label={nextJob} updateCheckBoxArray={this.jobsChanged} />\n\n if (i % 3 === 0) {\n col1.push(nextItem);\n } else if (i % 3 === 1) {\n col2.push(nextItem);\n } else if (i % 3 === 2) {\n col3.push(nextItem);\n }\n }\n return (<div>\n <div>{col1}</div>\n <div>{col2}</div>\n <div>{col3}</div>\n </div>\n );\n }", "title": "" }, { "docid": "5c3552372ce8e904ca1c1a90c6d0760b", "score": "0.65026647", "text": "function checkAll() {\n if ($('[data-toggle=\"checkall\"]').length) {\n $('[data-toggle=\"checkall\"]').each(function (index, item) {\n $(item).on(\"change\", function () {\n var checkbox = $(item).parent().parent().next().find(\"input\");\n if (this.checked) {\n checkbox.prop(\"checked\", true);\n } else {\n checkbox.prop(\"checked\", false);\n }\n });\n });\n }\n }", "title": "" }, { "docid": "510357d65cca6fbea1211fbd07123ea4", "score": "0.64908326", "text": "onChange(checkedList) {\n this.setState({\n checkedList,\n indeterminate:\n !!checkedList.length && checkedList.length < plainOptions.length,\n checkAll: checkedList.length === plainOptions.length\n });\n }", "title": "" }, { "docid": "f10a3cd9862fddbf2ba328c55af46dab", "score": "0.64772546", "text": "function checkSelectAll(item) {\n let selectbox = item.childNodes;\n let count = 0;\n selectbox.forEach(item => {\n if (item.children[0].checked === true) {\n count++\n }\n });\n if (selectbox.length == count) {\n inputcheckbox.checked = true;\n } else {\n inputcheckbox.checked = false;\n }\n}", "title": "" }, { "docid": "0a8fb2928ba5b0d97cee344f4a785ace", "score": "0.6476833", "text": "function selectAllCheckBoxes(state,targetDiv,src,topDiv){\n var chkElements = document.getElementById(targetDiv).getElementsByTagName('INPUT');\n var len=chkElements.length;\n for(var i=0;i<len;i++){\n if (chkElements[i].type.toUpperCase()=='CHECKBOX' && chkElements[i].name=='multiSpecialChk'){\n chkElements[i].checked=state;\n document.getElementById(src).options[chkElements[i].value].selected=state;\n }\n }\n totalSelected(src,topDiv,initialTextForMultiDropDowns);//to update the top div\n }", "title": "" }, { "docid": "f46945ff8ca04fa9c42237d9b695341a", "score": "0.64702284", "text": "function setCheckboxes(aForm)\r\n{\r\n for( var i = 0; i < aForm.length; i++)\r\n {\r\n var e = aForm.elements[i];\r\n \r\n if( e.type == 'checkbox' )\r\n {\r\n \tvar value = new String(e.value);\r\n \tif ( value.charAt(0) == 'Y' ) \r\n \t{//value says that yes, the checkbox should be checked\r\n \te.defaultChecked = true; \r\n \te.checked = true; \r\n \t}\r\n \telse\r\n \t{//values says no, the checkbox should not be checked\r\n \te.defaultChecked = false; \r\n \te.checked = false; \r\n \t}\r\n }\r\n }\r\n return;\r\n}", "title": "" }, { "docid": "02d83d705ccbb217707cd00f9892af81", "score": "0.6466942", "text": "function CheckCheckAll(fmobj) {\n var TotalBoxes = 0;\n var TotalOn = 0;\n for (var i=0;i<fmobj.elements.length;i++) {\n var e = fmobj.elements[i];\n if ((e.name != 'allbox') && (e.type=='checkbox')) {\n TotalBoxes++;\n if (e.checked) {\n TotalOn++;\n }\n }\n }\n if (TotalBoxes==TotalOn) {\n fmobj.allbox.checked=true;\n }\n else {\n fmobj.allbox.checked=false;\n }\n}", "title": "" }, { "docid": "55b8aefacc88860e2052d0d07bfd0ce8", "score": "0.6466285", "text": "function setCheckedCheckboxes(fields,checked){\n// for(var i=0;i<checked.length;i++){\n// alert(checked[i]);\n// }\n for(var i=0;i<fields.length;i++){\n fields[i].checked = false;\n if((checked.indexOf(fields[i].value)) > -1){ fields[i].checked = true; }\n }\n}", "title": "" }, { "docid": "f86e1c97e5dad2239270955cbc247db5", "score": "0.64587", "text": "function chkAllCheckBoxes(Object1,Object2)\n{\n\n\tvar TB=TO=0;\n\tvar intNoOfItems = 0;\n\n\t if(Object2)\n\t {\n\t\tintNoOfItems = Object2.length;\n\t }\n\n\t if (isNaN(intNoOfItems))\n\t {\n\t intNoOfItems = 1;\n\n \t }\n\n\tfor (var i=0;i<intNoOfItems;i++)\n\t{\n\t TB++;\n\n\t if(intNoOfItems == 1)\n\t {\n\t if(Object2.checked)\n\t TO++;\n\t }\n\t else\n\t {\n\t if(Object2[i].checked)\n\t\tTO++;\n\t }\n\t}\n\n\tif (TO==TB)\n\t\tObject1.checked=true;\n\telse\n\t\tObject1.checked=false;\n}", "title": "" }, { "docid": "baae45d4ce7895c4923a82215e871feb", "score": "0.6455264", "text": "function checkAll(field)\r\n{\r\n for (i = 0; i < field.length; i++)\r\n field[i].checked = true ;\r\n}", "title": "" }, { "docid": "59e01b75f891324bffca29e334dde8a6", "score": "0.64550555", "text": "function jqCheckAll(status) { \r\n\r\n\t$(\"form#ui-form input:checkbox\").each(function() { \r\n this.checked = status;\r\n }); \r\n\t\r\n}", "title": "" }, { "docid": "ea75b0aef57b6284ec953b24a9e0e79b", "score": "0.6435694", "text": "function checkSelectedCheckbox(attr, elm) {\n for (let i = 0; i < elm.length; i++) {\n for (let j = 0; j < elm.length; j++) {\n if (realLogedIn[attr][i] == elm[j].value) {\n elm[j].checked = true;\n }\n }\n }\n}", "title": "" }, { "docid": "8a5852db17d7d001545481e1d92b97ab", "score": "0.64313567", "text": "function checkAllCheckboxes() {\n // $(\":checkbox\").prop(\"checked\", true);\n $('input[type=\"checkbox\"]').prop(\"checked\", true);\n}", "title": "" }, { "docid": "78292e72fc94e7e0ab5f70665d2f50bc", "score": "0.64267373", "text": "getCheckBoxItems(state){\n return state.checkBoxItems;\n }", "title": "" }, { "docid": "046afb0d6ff36afa06ab69cb77278738", "score": "0.6422901", "text": "function changeAllCheck(checked) {\n for (var i = 0; i < Object.keys(TAGS).length; i++) {\n var tagCheck = document.getElementById(Object.keys(TAGS)[i] + \"-check\");\n tagCheck.checked = !tagCheck.checked;\n var smallTagCheck = document.getElementById(\n \"sm-\" + Object.keys(TAGS)[i] + \"-check\"\n );\n smallTagCheck.checked = !smallTagCheck.checked;\n }\n\n changeSelectedTags();\n}", "title": "" }, { "docid": "196f223222291d859a3838e09fadbe13", "score": "0.6422649", "text": "function ShowCheckBoxes() {\n return (\n <div className={classes.checkboxContainer}>\n <FormControlLabel control={ \n <Checkbox checked={studentChecked} \n disabled = { staffChecked ? true : false }\n onChange={HandleStudentChecked}\n inputProps= {{\n 'aria-label': 'primary checkbox'\n }}\n /> }\n label='Student' \n />\n\n\n <FormControlLabel control={\n <Checkbox checked={staffChecked} \n disabled = { studentChecked ? true : false }\n onChange={HandleStaffChecked}\n inputProps= {{\n 'aria-label': 'primary checkbox'\n }}\n /> }\n label='Staff'\n />\n\n </div>\n )\n }", "title": "" }, { "docid": "f084442dd838d6cc3f3df350f2bd2ee7", "score": "0.64154774", "text": "function CheckAll(chk, chk_item) {\n var i, chk_items, isChecked;\n\n chk_items = document.getElementsByName(chk_item);\n isChecked = chk.checked;\n\n if (chk_items == null) {\n return;\n }\n\n if (chk_items.length > 0) {\n // MULTIPLE ITEMS\n for (i = 0; i < chk_items.length; i++) {\n chk_items[i].checked = isChecked; // this line\n }\n }\n else {\n // ONE ITEM ONLY\n chk_items.checked = isChecked;\n }\n}", "title": "" }, { "docid": "8c7b42819957cfc51b347444c5756462", "score": "0.64115924", "text": "function _checked_all(obj_all, obj_list) {\n if (obj_all.checked) {\n for (i = 0; i < obj_list.length; i++) {\n obj_list[i].checked = true;\n }\n } else {\n for (i = 0; i < obj_list.length; i++) {\n obj_list[i].checked = false;\n }\n }\n}", "title": "" }, { "docid": "5eab7d21f1da200b25c70f382490f53c", "score": "0.6409261", "text": "function set_check_all(chk_obj, option) {\n if (option == 1)\n for (i = 0; i < chk_obj.length; i++)\n chk_obj[i].checked = true;\n else\n for (i = 0; i < chk_obj.length; i++)\n chk_obj[i].checked = false;\n}", "title": "" }, { "docid": "2d7890afb2cd661d32a9810bfca7e756", "score": "0.6407581", "text": "function checkAll(bx) {\r\n var cbs = document.querySelectorAll(\".checkbox\");\r\n var cbs = document.querySelectorAll(\".checkbox\");\r\n for(var i=0; i < cbs.length; i++) {\r\n cbs[i].click();\r\n cbs[i].checked=bx.checked;\r\n }\r\n}", "title": "" }, { "docid": "455ef33db77af26cb1bcee4dc833d4b1", "score": "0.6404967", "text": "function SelectAllCheckBox() {\n angular.forEach(ClientConfigCtrl.ePage.Entities.Header.Data.WmsClientParameterByWarehouse, function (value, key) {\n if (ClientConfigCtrl.ePage.Masters.SelectAll) {\n value.SingleSelect = true;\n ClientConfigCtrl.ePage.Masters.EnableDeleteButton = true;\n ClientConfigCtrl.ePage.Masters.EnableCopyButton = true;\n }\n else {\n value.SingleSelect = false;\n ClientConfigCtrl.ePage.Masters.EnableDeleteButton = false;\n ClientConfigCtrl.ePage.Masters.EnableCopyButton = false;\n }\n });\n }", "title": "" }, { "docid": "1f4f0ea20152e15398f90785534b0baa", "score": "0.6402552", "text": "function checkbox() {\n $('input[type=\"checkbox\"].minimal, input[type=\"radio\"].minimal').iCheck({\n checkboxClass: 'icheckbox_minimal-blue',\n radioClass: 'iradio_minimal-blue'\n });\n}", "title": "" }, { "docid": "bbbb4c11def3c693325e3af08a842e75", "score": "0.6394152", "text": "checkBoxChanged(){\n console.log(\"chenged checkbox: \");\n \n /*this.users[this.users.indexOf(user)].selected = true;*/ \n /*user.checked = true;*/\n }", "title": "" }, { "docid": "d559a7b830703067bb9ecc80619eab2d", "score": "0.6387249", "text": "function MultiStateCheckBox_getCheckedState()\r\n{\r\n // todo: to be filled in later (or merged possible) \r\n var retValue; \r\n \r\n\r\n \r\n return retValue; \r\n}", "title": "" }, { "docid": "94b4bcfab1920e6bd4c54d305aa038a0", "score": "0.6384998", "text": "function setCheckboxes(the_form, do_check)\n{\n var elts = document.forms[the_form].elements['selected_tbl[]'];\n var elts_cnt = elts.length;\n\n for (var i = 0; i < elts_cnt; i++) {\n elts[i].checked = do_check;\n } // end for\n\n return true;\n} // end of the 'setCheckboxes()' function", "title": "" }, { "docid": "e310d9fae9fe29f23a6f698e51593324", "score": "0.6370776", "text": "function select_all_check_box(form_name, name , check_all,multicheck)\n{\n\tvar control_name = \"\";\n\tif(name !='undefined' && name !=null)\n\t{\n\t\tcontrol_name = name;\n\t}\n\tvar select_name = \"checkall\";\n\tif(check_all !='undefined' && check_all !=null)\n\t{\n\t\tselect_name = check_all;\n\t}\n\t \n\tvar frm = eval(\"document.\"+form_name);\n\t\n\tvar chk_length = frm.length;\n\n\tvar counter = 0; \n\tvar select_all = document.getElementById(select_name);\n\t\n\t\n\tif(select_all.checked == true)\n\t{\n\t\tfor(var i=0; i<chk_length; i++)\n\t\t{\n\t\t\tvar element = frm.elements[i];\n\t\t\tif(multicheck == 'multicheck')\n\t\t\t{\n\t\t\t\tvar element_name = element.alt;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar element_name = element.name;\n\t\t\t}\n\t\t\tif(element.type == 'checkbox' && element.disabled == false )\n\t\t\t{\n\t\t\t\tif(control_name != \"\" && element_name == control_name)\n\t\t\t\t{\n\t\t\t\t\telement.checked = true;\n\t\t\t\t\tif($(element).parent().parent().hasClass('checker'))\n\t\t\t\t\t\t$(element).parent().addClass('checked');\n\t\t\t\t}\n\t\t\t\telse if(control_name == \"\")\n\t\t\t\t{\n\t\t\t\t\telement.checked = true;\n\t\t\t\t\tif($(element).parent().parent().hasClass('checker'))\n\t\t\t\t\t\t$(element).parent().addClass('checked');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor(var i=0; i<chk_length; i++)\n\t\t{\n\t\t\tvar element = frm.elements[i];\n\t\t\tif(multicheck == 'multicheck')\n\t\t\t{\n\t\t\t\tvar element_name = element.alt;\n\t\t\t}\n\t\t\telse\n\t\t\tvar element_name = element.name;\n\t\t\tif(element.type == 'checkbox')\n\t\t\t{\n\t\t\t\tif(control_name !=\"\" && element_name == control_name)\n\t\t\t\t{\n\t\t\t\t\telement.checked =false;\n\t\t\t\t\t//018 02 OCT 2013 - ID:9994\n\t\t\t\t\tif($(element).parent().parent().hasClass('checker'))\n\t\t\t\t\t\t$(element).parent().removeClass('checked');\n\t\t\t\t}\n\t\t\t\telse if(control_name ==\"\")\n\t\t\t\t{\n\t\t\t\t\telement.checked =false;\n\t\t\t\t\t//018 02 OCT 2013 - ID:9994\n\t\t\t\t\tif($(element).parent().parent().hasClass('checker'))\n\t\t\t\t\t\t$(element).parent().removeClass('checked');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2613a160637aa86e661f007c7417d878", "score": "0.6369313", "text": "toggleCheckbox() {\n this.setState({\n isChecked: !this.state.isChecked\n });\n /*\n **handleCheckboxChange is invoked on onChange event on the Checkbox\n **category is the subheading as Frameworks, Building Tools and Test Frameworks\n **label contains the corresponding list items associated with each category\n */\n this.props.handleCheckboxChange(this.props.category,this.props.label);\n }", "title": "" }, { "docid": "98e1d5348b1b6f12a23a5940bd36f64e", "score": "0.63585746", "text": "toggleCheckBoxes() { \n [...elements.filterOptions.children].forEach((element) => {\n element.children[0].checked = (this.checked) ? false : true;\n });\n this.checked = !this.checked;\n }", "title": "" }, { "docid": "529c6cbf7f2a88f33b43a85143c50b27", "score": "0.6356441", "text": "function addcheckboxlistsingleselect(label, dbfieldname, ismandatory, blankmsg, items, values, style) {\r\n if (values == null)\r\n values = items;\r\n if (ismandatory == null)\r\n ismandatory = 0;\r\n var table = '<table validatecheckboxlist=\"' + ismandatory + '\" dbfieldname=\"' + dbfieldname + '\" id=\"' + dbfieldname + '\" blankmsg=\"' + blankmsg + '\">';\r\n var k = items.length;\r\n for (i = 0; i < k; i++)\r\n table = table + ('<tr><td><input class=\"unique\" type=\"checkbox\" value=\"' + values[i] + '\"/><label>' + items[i] + '</label></td></tr>');\r\n table = table + '</table>';\r\n $(\"div#divDisplayField\").append('<div class=\"' + setstyle(style) + ' checkboxlist\"><label>' + label + '</label>' + table + '</div>');\r\n}", "title": "" }, { "docid": "6172af29bf625225366c8699a3f26bec", "score": "0.63560474", "text": "function bulkSelection(value) {\n var list = contactList.\n querySelectorAll('.block-item:not([data-uuid=\"#uid#\"]');\n\n var total = list.length;\n for (var c = 0; c < total; c++) {\n setChecked(list[c].querySelector('input[type=\"checkbox\"]'), value);\n }\n }", "title": "" }, { "docid": "ea29d35aa4301ddcf723a41f83019a32", "score": "0.63532287", "text": "function checkAllIfOne(formId, listName, thisStatus, checkboxAll){\n\tvar allCheck = document.getElementById(formId).elements[checkboxAll];\n\tif(!thisStatus.checked)\t//uncheck one checkbox\n\t\tallCheck.checked = false;\n\telse{\t//check one checkbox\n\t\t//var checkList = document.getElementsByName(listName);\n\t\tvar checkList = document.getElementById(formId).elements[listName];\n\t\tvar listSize = checkList.length;\n\t\tif(listSize == undefined) {\n\t\t\tif(checkList.checked) {\n\t\t\t\tallCheck.checked = true;\n\t\t\t}\n\n\t\t} else {\n\t\t\tif(listSize > 0){ //Have one or more elements\n\t\t\t\tfor(i = 0;i < listSize; i++)\n\t\t\t\t\tif(!checkList[i].checked)\n\t\t\t\t\t\treturn false;\n\t\t\t\tallCheck.checked = true;\n\t\t\t}\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "8dd8cd452369b10a037bca288979f542", "score": "0.63497704", "text": "function checkboxSeleccionar(obj,ncheckbox) {\n if (obj.checked==true) for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=true; \n else for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=false; \n}", "title": "" }, { "docid": "8dd8cd452369b10a037bca288979f542", "score": "0.63497704", "text": "function checkboxSeleccionar(obj,ncheckbox) {\n if (obj.checked==true) for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=true; \n else for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=false; \n}", "title": "" }, { "docid": "8dd8cd452369b10a037bca288979f542", "score": "0.63497704", "text": "function checkboxSeleccionar(obj,ncheckbox) {\n if (obj.checked==true) for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=true; \n else for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=false; \n}", "title": "" }, { "docid": "58237a4992810e7528e52332ddfa97d2", "score": "0.63463265", "text": "function selectAll(checkboxGroup) {\n for (var i = 0; i < checkboxGroup.length; i++) {\n checkboxGroup[i].checked = true;\n }\n}", "title": "" }, { "docid": "cba537a4ae7ad14f4458a7866ad7f253", "score": "0.6345829", "text": "_checkboxListener() {\n const checkedBoxes = document.querySelectorAll(`input[name=\"${this.el.name}\"]:checked`);\n if (!checkedBoxes || !checkedBoxes.length) {\n this.vm.$validator.validate(this.fieldName, null, getScope(this.el));\n return;\n }\n\n [...checkedBoxes].forEach(box => {\n this.vm.$validator.validate(this.fieldName, box.value, getScope(this.el));\n });\n }", "title": "" }, { "docid": "bb2226e5e440a0cd25dc568f30979cf5", "score": "0.63433", "text": "function checkAll(checkboxlist,size) {\n for (var i = 0; i < size; i++) {\n box = eval(checkboxlist + i ); \n if (box.checked == false)\n box.checked = true;\n }\n}", "title": "" }, { "docid": "7f911225c1ef683e0393c56874be5fd1", "score": "0.63399476", "text": "function checkTheBoxes(checkboxes, index1, index2) {\n let index = 1;\n checkboxes.forEach((check) => {\n if (index2 > index1) {\n if (index >= index1 && index <= index2) check.checked = true;\n } else {\n if (index >= index2 && index <= index1) check.checked = true;\n }\n index++;\n });\n}", "title": "" }, { "docid": "68fe73ab660706a6af372e7ca65aea13", "score": "0.6330942", "text": "function MultiStateCheckBox_initializeUI() \r\n{\r\n // nothing needed here \r\n}", "title": "" }, { "docid": "fc5092fe10c7bd31c5ab057b75e2c33a", "score": "0.6330294", "text": "multipleChanged(prev, next) {\n var _a;\n\n this.ariaMultiSelectable = next ? \"true\" : null;\n (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {\n o.checked = next ? false : undefined;\n });\n this.setSelectedOptions();\n }", "title": "" }, { "docid": "e895c3b6cd80853f706c8aa8c66df5a5", "score": "0.63252723", "text": "function CheckAll(fmobj) {\n for (var i=0;i<fmobj.elements.length;i++) {\n var e = fmobj.elements[i];\n if ( (e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled) ) {\n e.checked = fmobj.allbox.checked;\n }\n }\n}", "title": "" }, { "docid": "5d237aeda9691a7f7c433c8c1f421e12", "score": "0.63084", "text": "function SelectAllCheck(AllClassName, SingleClassName) {\n\tvar AllSelect = true;\n\t$('.' + SingleClassName + ' input[type=\"checkbox\"]').each(function () {\n\t\tif (!$(this).prop('checked')) {\n\t\t\tAllSelect = false;\n\t\t}\n\t});\n\t$('.' + AllClassName + ' input[type=\"checkbox\"]').prop(\"checked\", AllSelect);\n}", "title": "" }, { "docid": "43bed309573d079a8b09d7a621d63e48", "score": "0.63016975", "text": "function checkSelected() {\r\n var all = $(\"input.select-all\")[0];\r\n var total = $(\"input.select-item\").length;\r\n var len = $(\"input.select-item:checked:checked\").length;\r\n console.log(\"total:\" + total);\r\n console.log(\"len:\" + len);\r\n all.checked = len === total;\r\n }", "title": "" }, { "docid": "e3f311f8be700356b0396f4299719cea", "score": "0.62996316", "text": "handleCheckAll () {\n if (this.isAllChecked) {\n this.checkboxGroupModel = [];\n\n const allLen = this.tableData_.length;\n\n if (allLen > 0) {\n for (let i = 0; i < allLen; i++) {\n if (this.disabledUnChecked.indexOf(i) === -1) {\n this.checkboxGroupModel.push(i);\n }\n }\n }\n } else {\n this.checkboxGroupModel = this.disabledChecked();\n }\n\n this.selectAll && this.selectAll(this.getCheckedTableRow);\n\n this.setIndeterminateState();\n }", "title": "" }, { "docid": "c67b3416db5e4e4dd720f4a912f38ee1", "score": "0.6290422", "text": "function selectsAll(Object1,Object2)\n{\n\n var intNoOfItems = 0;\n\n if(Object2)\n {\n\tintNoOfItems = Object2.length;\n }\n\n if (isNaN(intNoOfItems))\n {\n intNoOfItems = 1;\n\n }\n\n if(Object1.checked)\n {\n\t if(intNoOfItems == 1)\n\t {\n\t\tObject2.checked = true;\n\t }\n\telse\n\t {\n\t\tfor (i=0;i<intNoOfItems;i++)\n\t\t{\n\t\t Object2[i].checked = true;\n\t\t}\n \t }\n\n \tObject1.checked = true;\n\n\n\n }\n else\n {\n\t if(intNoOfItems == 1)\n\t {\n Object2.checked = false;\n\t }\n\t else\n\t {\n\t for (i=0;i<intNoOfItems;i++)\n\t {\n\t Object2[i].checked = false;\n\t }\n\t }\n\n Object1.checked = false;\n\n\n\n }\n}", "title": "" }, { "docid": "22370382afc32cab0a7f78c6ddc35438", "score": "0.6283558", "text": "function selectAll() {\n var i;\n var id;\n var checked = checkBoxHead.checked;\n for (i = 0; i < checkBoxCount; i++) {\n id = checkBoxId + i;\n document.getElementById(id).checked = checked;\n }\n}", "title": "" }, { "docid": "fd2a9d5149ccfaadcba95cc86eb5350c", "score": "0.62784064", "text": "function checkAll(curobj)\n{\n\tvar list_input = document.getElementsByTagName ('input');\n\n\tif (list_input )\n\t{\n\t\tfor (var i = 0; i < list_input.length; ++i)\n\t\t{\n\t\t\tvar e = list_input[i]; \n\t\t\tif (e.type == \"checkbox\")\n\t\t\t\tif(curobj.checked==true)\n\t\t\t\t\te.checked=true;\n\t\t\t\telse\n\t\t\t\t\te.checked=false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4f79b5a4f45c268a756877fc665eccb9", "score": "0.6275268", "text": "function mCheckAllCheckbox(check, nameInput){\n\tvar els = document.getElementsByTagName(\"input\");\n\t\n\tfor(var i = 0; i < els.length; i++){\n\t\telement = els[i];\n\t\n\t\tif((element.type == \"checkbox\") && (element.name == nameInput)){\n\t\t\t if(check == true) element.checked = true;\n\t\t\t else element.checked = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b0d7c4b234d7b16583dd40e2319928f1", "score": "0.6273388", "text": "toggleChecked(currentSelection){\n // toggling the selected category and returning a new array, NewSubcategories is becoming a new state for Mobilier component\n const NewSubcategories = this.state.subCategories.map(subCategory => {\n if (subCategory.name === currentSelection) {\n subCategory.checked = !subCategory.checked\n }\n return subCategory\n })\n\n // new function allowing user to toggle only ONE checkbox\n this.state.subCategories.forEach(subCategory => {\n if (subCategory.checked === true && subCategory.name !== currentSelection) {\n subCategory.checked = false\n }\n })\n\n // ****** OLD RULES *****\n // //if everything is unchecked set the first \"all\" to be checked\n // const isEveryCategoryUnChecked = NewSubcategories.every((subCategory) => {\n // return subCategory.checked === false\n // })\n // if (isEveryCategoryUnChecked) {\n // NewSubcategories[0].checked = true\n // }\n // // if any of the other categories / normal ones is checked, we are unchecking the first one\n // const allSubcategoriesExceptTheFirst = NewSubcategories.slice(1)\n // const anyOfTheOtherSubCategoriesAreChecked = allSubcategoriesExceptTheFirst.some((subCategory) => subCategory.checked)\n // if (anyOfTheOtherSubCategoriesAreChecked && currentSelection !== \"Toutes les catégories\") {\n // NewSubcategories[0].checked = false\n // }\n // //if you sepcifically selected \"All\", we uncheck the rest of the categories\n // if (currentSelection === \"Toutes les catégories\") {\n // allSubcategoriesExceptTheFirst.forEach(subCategory => subCategory.checked = false)\n // }\n\n this.setState({subCategories: NewSubcategories})\n }", "title": "" }, { "docid": "fa4e3bf2a0bf4bc9eb3f0fb0b09bd6c5", "score": "0.62652344", "text": "function isMultipleChecked(Object,MsgOption,msg)\n{\n var intNoOfLines = 0;\n var NumChecked;\n\n NumChecked = 0;\n\n if(Object)\n {\n intNoOfLines = Object.length;\n }\n\n if(isNaN(intNoOfLines))\n {\n intNoOfLines = 1;\n\n }\n\n if(intNoOfLines == 1)\n {\n if (Object.checked)\n\t{\n\t NumChecked++;\n\t}\n }\n else\n {\n for(i=0;i<intNoOfLines;i++)\n {\n\n if (Object[i].checked)\n\t{\n\n\t NumChecked++;\n\n\t}\n }\n }\n\n if(NumChecked > 1)\n {\n if(MsgOption)\n {\n\n\t if(trim(msg) != \"\" || isMultipleChecked.arguments.length > 2)\n \t\talert(msg);\n \t }\n\n return true;\n }\n\n if(!MsgOption)\n\t {\n\n\t if(trim(msg) != \"\" && isMultipleChecked.arguments.length > 2)\n\t alert(msg);\n \t }\n\n return false;\n\n}", "title": "" }, { "docid": "64913dfd3db77b73e49decbe78643963", "score": "0.6258688", "text": "function activateMultipleActions() {\r\n\r\n // Activate the select/deselect all items.\r\n $(document).on('click', '.multiple_action_check_all input', function(){\r\n $('.line_admin_checkbox input').prop('checked', $(this).prop('checked'));\r\n });\r\n\r\n // Activate the action with the multiple items.\r\n $(document).on('click', '.multipleOption', function(event){\r\n event.stopImmediatePropagation();\r\n let postValues = [];\r\n $('.line_admin_checkbox input').each(function(index, ele){\r\n if ($(ele).prop('checked')==true) postValues.push($(ele).attr('name'));\r\n });\r\n if (postValues.length > 0) {\r\n $.post($(this).data('url'), {'list_ids': postValues}).done(function() { location.reload(); });\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "2b1e64307e23acf1fb7f2abd8b0a968a", "score": "0.6253664", "text": "function SelectAllCheckBox() {\n angular.forEach(DeliveryLineCtrl.ePage.Entities.Header.Data.UIWmsDeliveryLine, function (value, key) {\n if (DeliveryLineCtrl.ePage.Masters.SelectAll) {\n value.SingleSelect = true;\n DeliveryLineCtrl.ePage.Masters.EnableDeleteButton = true;\n DeliveryLineCtrl.ePage.Masters.EnableCopyButton = true;\n } else {\n value.SingleSelect = false;\n DeliveryLineCtrl.ePage.Masters.EnableDeleteButton = false;\n DeliveryLineCtrl.ePage.Masters.EnableCopyButton = false;\n }\n });\n }", "title": "" }, { "docid": "dec3e744c512e394d40ea9d920cb46ce", "score": "0.6253377", "text": "setSelectedKeys(selectedKeys){\n this.x().a(this.options.map(option =>\n Labeled(option[1], this.checkBoxes[option[0]] = \n CheckBox({id: option[0], changedCallback: checked => {\n this.store({\n selectedKeys: this.getSelectedKeys()\n })\n }})\n .setChecked(selectedKeys.includes(option[0]))\n )\n ))\n\n this.store({\n selectedKeys: selectedKeys\n })\n }", "title": "" }, { "docid": "1c48f9d65ee3af7b505d97bcfa72ff35", "score": "0.62524974", "text": "function wasallcheckd() {\n var res = 'true'\n $('input.chckbox').each(function(){ \n if($(this).is(':not(:checked)')){\n res = 'false'; \n } \n });\n if (res == 'false') {\n return false;\n }\n }", "title": "" }, { "docid": "711efd156a0ddcbac61d24edbca55956", "score": "0.62519944", "text": "function resetAllCheckboxes() {\n $(checkoxInps).each(function (el, m) {\n $(m).on(\"click\", function () {\n let k = $(this).parent().parent().parent().children().children();\n\n $(k).each(function (el, it) {\n if ($(it).children().length > 1)\n {\n let inp = $(it).children()[1];\n\n // console.log(inp);\n $(inp).prop('checked', false);\n }\n })\n });\n });\n }", "title": "" }, { "docid": "cbcc9329652bf490f557460f4806ac9f", "score": "0.6251865", "text": "function select_all_items_in_queue(){\n\t$('#datacart_items_chkbox').find(':input').each(function(){\n\t\tswitch(this.type){\n\t\t\tcase 'checkbox': \n\t\t\t\t$(this).attr('checked', true);\n\t\t}\t\n\t});\n}", "title": "" }, { "docid": "31d236b0fb7af4ff9494a704bb9d8878", "score": "0.6251534", "text": "function __mfn_checkboxes(toggle)\n\t\t{\n\t\t\ttoggle = is_defined(toggle) ? toggle : true;\n\n\t\t\tif (toggle) {\n\n\t\t\t\tdom.supplies.removeAttr('disabled');\n\t\t\t\tdom.instructions.removeAttr('disabled');\n\n\t\t\t\t__mfn_allow_submit();\n\n\n\t\t\t\t// Check boxes toggle cosmetics\n\t\t\t\tdom.supplies.switcher();\n\t\t\t\tdom.instructions.switcher(function (is_checked) {\n\n\t\t var text = dom.instruction_area;\n\n\t\t if (is_checked) {\n\n\t\t text.removeClass('hidden').hide().fadeIn(500);\n\n\t\t } else {\n\n\t\t text.siblings('#instruction_area').val('');\n\t\t text.addClass('hidden');\n\t\t }\n\t\t });\n\n\t\t\t} else {\n\n\t\t\t\tdom.supplies.prop('disabled', 'disabled');\n\t\t\t\tdom.instructions.prop('disabled', 'disabled');\n\n\t\t\t\t__mfn_allow_submit(false);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4144a7ed19bd9eb415bdbd7f51b61174", "score": "0.6245164", "text": "function SingleSelectCheckBox() {\n var Checked = ChargecodeInvoiceCtrl.ePage.Entities.Header.Data.UIAccChargeTypeOverride.some(function (value, key) {\n if (!value.SingleSelect)\n return true;\n });\n if (Checked) {\n ChargecodeInvoiceCtrl.ePage.Entities.Header.GlobalVariables.SelectAll = false;\n } else {\n ChargecodeInvoiceCtrl.ePage.Entities.Header.GlobalVariables.SelectAll = true;\n }\n\n var Checked1 = ChargecodeInvoiceCtrl.ePage.Entities.Header.Data.UIAccChargeTypeOverride.some(function (value, key) {\n return value.SingleSelect == true;\n });\n if (Checked1 == true) {\n ChargecodeInvoiceCtrl.ePage.Masters.EnableDeleteButton = false;\n ChargecodeInvoiceCtrl.ePage.Masters.EnableCopyButton = false;\n } else {\n ChargecodeInvoiceCtrl.ePage.Masters.EnableDeleteButton = true;\n ChargecodeInvoiceCtrl.ePage.Masters.EnableCopyButton = true;\n }\n }", "title": "" }, { "docid": "30f521ce7227d0d1b6bb0ce9f2def215", "score": "0.6244539", "text": "function onCheckboxChange() {\n if (!lodash.isNil(ctrl.option)) {\n if (lodash.includes(ctrl.option, 'allProjects')) {\n lodash.set(ctrl.optionList, '[0].disabled', true);\n\n if (ctrl.option.length === 1) {\n ctrl.option.unshift('singleProject');\n }\n } else {\n lodash.set(ctrl.optionList, '[0].disabled', false);\n }\n ctrl.optionList = angular.copy(ctrl.optionList);\n ctrl.option = angular.copy(ctrl.option);\n checkedItem = lodash.get(ctrl.option, [ctrl.option.length - 1]);\n } else {\n checkedItem = 'singleFunction';\n }\n }", "title": "" }, { "docid": "3ae63af3b11f32884182a2cd5c7b0a17", "score": "0.6240709", "text": "function checkboxOccurrencesTypes(i, type){\n if($(\"#OccurrencesType\"+i+type).prop(\"checked\"))\n $(\"#OccurrencesType\"+i+type).prop('checked', false);\n else\n $(\"#OccurrencesType\"+i+type).prop('checked', true);\n}", "title": "" }, { "docid": "4f360d92e2eea8cc3b2929177c148cd1", "score": "0.62356", "text": "function onClickCheckbox() {\n setupButtons();\n}", "title": "" }, { "docid": "49ae032896db79fa509dc6e018bda2af", "score": "0.6223973", "text": "function chekB(arrayMembers) {\n document.getElementById(\"rep\").checked = true;\n document.getElementById(\"dem\").checked = true;\n document.getElementById(\"ind\").checked = true;\n\n}", "title": "" }, { "docid": "25208c4c049ad1c86ba1bfe6abcdf6c5", "score": "0.62236977", "text": "function sureChange(){\n if (_selected.includes('1')) {\n $('#defaultUnchecked1').prop('checked', true)\n }else{\n $('#defaultUnchecked1').prop('checked', false)\n }\n if (_selected.includes('2')) {\n $('#defaultUnchecked2').prop('checked', true)\n }else{\n $('#defaultUnchecked2').prop('checked', false)\n }\n if (_selected.includes('3')) {\n $('#defaultUnchecked3').prop('checked', true)\n }else{\n $('#defaultUnchecked3').prop('checked', false)\n }\n if (_selected.includes('4')) {\n $('#defaultUnchecked4').prop('checked', true)\n }else{\n $('#defaultUnchecked4').prop('checked', false)\n }\n }", "title": "" }, { "docid": "3d3ec9083fc12b72088bdad3459f6502", "score": "0.62127846", "text": "function getchkd(elm) {\n var init = jQuery(elm).attr('data-inival');\n var arrval = new Array();\n arrval = init.split(',');\n var arrlen = arrval.length;\n for(i=0;i<arrlen;i++) {\n jQuery(':checkbox[value='+arrval[i]+']').attr('checked','checked');\n }\n}", "title": "" }, { "docid": "ab4af0618b2521755920c6865b572fff", "score": "0.62109196", "text": "function CheckCheckBoxes(cbid, hidden, display) {\n var i;\n var id;\n var disable;\n\n disable = false;\n for (i = 0; i < checkBoxCount; i++) {\n id = cbid + i;\n if (document.getElementById(id).checked) {\n id = hidden + id;\n if (document.getElementById(id) != null) {\n disable = true;\n break;\n }\n }\n }\n\n ToggleButton(display, disable);\n}", "title": "" }, { "docid": "2a1e56008756527d474f33a094bbc67a", "score": "0.6192367", "text": "function selectAll() {\n var items = document.getElementsByName('check');\n for (var i = 0; i < items.length; i++) {\n if (items[i].type == 'checkbox') {\n if (items[i].checked == false)\n items[i].checked = true;\n else items[i].checked = false;\n\n } \n }\n}", "title": "" }, { "docid": "118ac20f31283b60f42c1482efc48bc3", "score": "0.6191146", "text": "function MultiStateCheckBox_updateUI()\r\n{\r\n // disabled -> checked\r\n if (this.multicheckBox.getAttribute(\"value\") == \"disabled\")\r\n {\r\n this.multicheckBox.setAttribute(\"value\",\"checked\"); \r\n this.multicheckBox.setAttribute(\"src\",chImagePathChecked); \r\n }\r\n // checked -> unchecked\r\n else if (this.multicheckBox.getAttribute(\"value\") == \"checked\")\r\n {\r\n this.multicheckBox.setAttribute(\"value\",\"unchecked\"); \r\n this.multicheckBox.setAttribute(\"src\",cbImagePathUnchecked); \r\n }\r\n // unchecked -> disabled \r\n else if (this.multicheckBox.getAttribute(\"value\") == \"unchecked\") \r\n {\r\n this.multicheckBox.setAttribute(\"value\",\"disabled\"); \r\n this.multicheckBox.setAttribute(\"src\",cbImagePathDisabled); \r\n }\r\n else{\r\n // do nothing \r\n }\r\n}", "title": "" }, { "docid": "e454d6fd3a5871db268be9ee7a73dae0", "score": "0.6186702", "text": "function refreshCheckboxUI() {\n var all_checked = checkboxes.filter(':checked').length === checkboxes.length;\n var none_checked = checkboxes.filter(':checked').length === 0;\n\n $('button.psap-move-checked').prop('disabled', none_checked);\n if (all_checked) {\n $('.psap-check-all').prop('disabled', true);\n $('.psap-uncheck-all').prop('disabled', false);\n } else if (none_checked) {\n $('.psap-check-all').prop('disabled', false);\n $('.psap-uncheck-all').prop('disabled', true);\n } else {\n $('.psap-check-all').prop('disabled', false);\n $('.psap-uncheck-all').prop('disabled', false);\n }\n }", "title": "" }, { "docid": "d11619787f34c433d809322faeec09bd", "score": "0.6181602", "text": "function selectedCheckboxCheck() {\n var isChecked = false;\n $(\"tbody .css-checkbox\").each(function () {\n if ($(this).is(':checked')) {\n isChecked = true;\n }\n });\n\n if (isChecked) {\n $('.group-control').fadeIn(200);\n }\n else {\n $('.group-control').fadeOut(200);\n }\n }", "title": "" }, { "docid": "95fc0feec42dd8f30d55b99a74cdea29", "score": "0.6178959", "text": "function allow_multiple() {\n var multiple_checkbox = $(\"#multiple_annotations\");\n return multiple_checkbox.is(':checked') || annotator.selectFeature.multiple;\n}", "title": "" }, { "docid": "ce15a280b27538464a5a2671cec49561", "score": "0.6172604", "text": "function select_all_checkbox(f, objname) {\n for (i = 0; i < f.length; i++) {\n var e = f.elements[i];\n if (e.name == objname && !e.disabled) {\n f.elements[i].checked = true;\n }\n }\n return true;\n}", "title": "" }, { "docid": "873944da76f201760eb1535a1286cf6e", "score": "0.61725324", "text": "function checkUncheckAll(theElement) {\r\n var theForm = theElement.form, z = 0;\r\n\t for(z=0; z<theForm.length;z++){\r\n if(theForm[z].type == 'checkbox' && theForm[z].name != 'chkParent'){\r\n\t theForm[z].checked = theElement.checked;\r\n\t }\r\n }\r\n}//checkAll Function", "title": "" }, { "docid": "62774bd4df11d1cb9aad481d1c2607fb", "score": "0.61707395", "text": "checkCheckBoxAll() {\n let rows = this.state.rows;\n var count = 0;\n // Check checkbox checked all\n if (rows.length === 0) {\n return false;\n }\n rows.forEach(row => {\n if (row.checkbox === true) count++;\n });\n if (count === rows.length) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "7dee5679dbec452cf44393919025c192", "score": "0.6168391", "text": "function onCheckUncheckAllClick(e) {\n $(e).closest(\".k-grid\").data(\"kendoGrid\").tbody.find(\":checkbox\").attr(\"checked\", e.checked);\n\n //If there is any checkbox disabled then the checkbox's checked attribute should remain be false \n $(e).closest(\".k-grid\").data(\"kendoGrid\").tbody.find(\":checkbox[disabled='disabled']\").attr(\"checked\", false);\n}", "title": "" }, { "docid": "9efb8f1607c405c240379c4b56ea62a1", "score": "0.6159555", "text": "function updateAllCheckboxes()\n{\n for ( var j = 0; j < classArray.length; j++ )\n {\n updateCheckbox( true, classArray[ j ][ 0 ] + \"x\" + classArray[ j ][ 1 ] );\n }\n updateSlider();\n}", "title": "" }, { "docid": "dd37c1d7e738637e46d2dde230bf1b64", "score": "0.61589587", "text": "handleCheckboxChange(e, parentKey, parentObj, selected) {\n let tmpQuestions = this.state.questions;\n let tmpArr = [];\n tmpQuestions[parentKey].attributes.answer = [];\n tmpQuestions[parentKey].attributes.errMessage = null;\n tmpQuestions[parentKey].attributes.choices.map(function(choice, key) {\n if (choice.id === selected.id) {\n choice.checked = choice.checked ? false : true ;\n }\n // id any of choices are checked\n if (choice.checked) {\n tmpQuestions[parentKey].attributes.answer.push(choice.id);\n }\n tmpArr.push(choice);\n });\n tmpQuestions[parentKey].attributes.choices = tmpArr;\n this.setState({ questions: tmpQuestions });\n }", "title": "" }, { "docid": "105c6fcfe1911d09a1c3c2d0f3eeb9b1", "score": "0.6158601", "text": "function selectChosenCheckBoxItems(formFieldString, chosenList)\n{\n var frm = document.forms[0];\n\n with (frm)\n {\n if (chosenList.length > 0)\n {\n var chkbox = elements[formFieldString];\n\n if (typeof chkbox.length == 'undefined')\n {\n chkbox = new Array(chkbox);\n }\n\n for (var i = 0; i < chkbox.length; i++)\n {\n for(var j=0; j < chosenList.length; j++)\n {\n if (chkbox[i].value == chosenList[j])\n {\n chkbox[i].checked = true;\n }\n }\n }\n }\n\n }\n}", "title": "" }, { "docid": "16818dc88208621c0b82f4259be32d1b", "score": "0.6156846", "text": "function validateCheckboxes() {\n for (let i = 0; i < groupOfCheckboxes.length; i++) {\n groupOfCheckboxes[i].addEventListener(\"change\", checkCheckbox);\n }\n}", "title": "" }, { "docid": "6d91ec8e61e9aefa1581f9c58c52b019", "score": "0.6152923", "text": "function checkAllCheckboxes() {\n let checkAll = document.querySelector(\"#check-all\");\n let checkboxes = document.querySelectorAll(\"tbody input[type='checkbox']\");\n if (checkAll && checkboxes) {\n checkAll.addEventListener(\"click\", () => {\n if (checkAll.checked) {\n for (let i = 0; i < checkboxes.length; i++) {\n var status =\n checkboxes[i].parentNode.parentNode.parentNode.lastChild\n .lastChild;\n checkboxes[i].checked = true;\n status.nodeValue = \"Selected\";\n }\n } else {\n for (let i = 0; i < checkboxes.length; i++) {\n checkboxes[i].checked = false;\n status.nodeValue = \"-\";\n }\n }\n });\n }\n }", "title": "" }, { "docid": "9d6baaa7a182ce812f950adf18ce5262", "score": "0.6150384", "text": "function uncheckAllCheckboxes()\r\r\n{\r\r\n firstChecked = true; // Set ke true\r\r\n $('input[type=\"checkbox\"]').attr('checked', false)\r\r\n}", "title": "" }, { "docid": "56b18c7d9bd9fda0219752310f30e1f7", "score": "0.6145996", "text": "function ebx_selectAllCkbName(checkboxName, buttonId) {\r\n\tvar button = document.getElementById(buttonId);\r\n\tif (button === null) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar form = button.form;\r\n\tif (form === undefined) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar ckbs = form[checkboxName];\r\n\tif (ckbs === undefined) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar i = ckbs.length;\r\n\tif (i === undefined) {\r\n\t\t// case inputEls is an element, because there was only one with this name\r\n\t\tckbs.checked = true;\r\n\t} else {\r\n\t\twhile (i--) {\r\n\t\t\tckbs[i].checked = true;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "56b18c7d9bd9fda0219752310f30e1f7", "score": "0.6145996", "text": "function ebx_selectAllCkbName(checkboxName, buttonId) {\r\n\tvar button = document.getElementById(buttonId);\r\n\tif (button === null) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar form = button.form;\r\n\tif (form === undefined) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar ckbs = form[checkboxName];\r\n\tif (ckbs === undefined) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar i = ckbs.length;\r\n\tif (i === undefined) {\r\n\t\t// case inputEls is an element, because there was only one with this name\r\n\t\tckbs.checked = true;\r\n\t} else {\r\n\t\twhile (i--) {\r\n\t\t\tckbs[i].checked = true;\r\n\t\t}\r\n\t}\r\n}", "title": "" } ]
1ac5b21ff45e8fe944f8342470562eff
Semester components that make up individual plans and which are made up of a series of courses, all received from database (semester and course table) passed here Semester creates multiple Course components
[ { "docid": "3a2ba60630c7392a8a5c55307cb40fcc", "score": "0.6544071", "text": "render() {\n const { sem_data, ...other } = this.props;\n const courses = [];\n for (let i = 0; i < sem_data.length; i++) {\n courses.push(\n <Course\n course_data={sem_data[i]}\n c_key={i}\n key={i}\n {...other}\n />);\n }\n return (\n <div className=\"sem_container\">\n <div className=\"semester_text\">\n {\"Semester \"+this.props.s_key}\n </div>\n <div className=\"semester_courses\">\n {courses}\n </div>\n </div>\n );\n }", "title": "" } ]
[ { "docid": "5f34c081d2b6768358d704f030b85f14", "score": "0.6127874", "text": "function buildCourses (courses) {\n\n var $badges = $('#badges');\n // console.table(courses)\n\n courses.forEach(function(course) {\n \n $div = $('<div />', {'class': 'course'}).appendTo($badges);\n\n $('<h3 />', { text: course.title}).appendTo($div);\n $('<img />', { src: course.badge}).appendTo($div);\n $('<a />', {\n 'class' : 'btn btn-primary',\n target : '_blank',\n href : course.url,\n text : 'See Course'\n }).appendTo($div);\n\n });\n }", "title": "" }, { "docid": "cdb584f32a3977a5c0f0e09362437e23", "score": "0.598365", "text": "function getCourse() {\n\t\t\t// SEND DATA TO SERVER FOR VALIDATION\n\t\t\t// STORE COURSE DATA IN SESSIONSTORAGE\n\t\t\t// RENDER NEW COURSE COMPONENT\n\t\t}", "title": "" }, { "docid": "c5635ea3dd4910fe1b09bbedd33c1222", "score": "0.58772004", "text": "render() {\n const { courses } = this.state;\n\n if (courses.length > 0) {\n return (\n <div>\n {courses.map(course =>\n <div key={course.id} className=\"grid-33\" >\n <Link className=\"course--module course--link\"\n to={`/courses/${course.id}`}>\n <h4 className=\"course--label\">Course</h4>\n <h3 className=\"course--title\">{course.title}</h3>\n </Link>\n </div>)}\n <div className=\"grid-33\">\n <Link className=\"course--module course--add--module\" to=\"/courses/create\">\n <h3 className=\"course--add--title\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 13 13\" className=\"add\">\n <polygon points=\"7,6 7,0 6,0 6,6 0,6 0,7 6,7 6,13 7,13 7,7 13,7 13,6 \"></polygon>\n </svg>New Course</h3>\n </Link></div>\n </div>\n )\n } else {\n return (\n <NotFound />\n )\n }\n\n }", "title": "" }, { "docid": "07747f40706675f17c274cbde860381e", "score": "0.5777815", "text": "function buildCourse(number){\n \n switch(number){\n case 1:\n buildCourse1();\n break;\n }\n}", "title": "" }, { "docid": "a33516a14ca5511ada17b983f69707e3", "score": "0.5773992", "text": "function addCourses(courses) {\n for (var i = 0; i < courses.length; i++) {\n getCourseInfo(courses[i].course_code);\n }\n}", "title": "" }, { "docid": "f748a8f04648b674e551dc45a4b55ab8", "score": "0.56791556", "text": "constructor(course, section, instructor, students, lectures){\n this.course = course;\n this.section = section;\n this.instructor = instructor;\n this.students = students;\n this.lectures = lectures;\n }", "title": "" }, { "docid": "b26053fd8eb1d1bcae2ed5e628da9bbd", "score": "0.5666542", "text": "render() {\n return (\n <div>\n <div className=\"wrap main--grid\">\n {this.state.courses.map(course => \n <Link className=\"course--module course--link\" key={course.id} to={`/courses/${course.id}`}>\n <h2 className=\"course--label\"> Course </h2>\n <h3 className=\"course--title\">{course.title} </h3>\n </Link>\n )}\n \n <Link className=\"course--module course--add--module\" to=\"/courses/create\">\n\t\t\t\t\t\t<h3 className=\"course--add--title\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 13 13\" className=\"add\">\n <polygon points=\"7,6 7,0 6,0 6,6 0,6 0,7 6,7 6,13 7,13 7,7 13,7 13,6 \"></polygon>\n </svg>Create Course</h3>\n\t\t\t\t\t</Link> \n </div>\n </div>\n );\n }", "title": "" }, { "docid": "ae801d7b87a6706709e6b0bb7e44cf82", "score": "0.56417924", "text": "get courses() {\n return {\n appetizers: this.appetizers,\n mains: this.mains,\n desserts: this.desserts,\n };\n }", "title": "" }, { "docid": "6e73bed930e5bfd0ac81c45956e8f5b9", "score": "0.5640492", "text": "renderCourses() {\n return this.state.courses.map(course =>\n <CourseList\n course={course}\n key={course._id}\n getCourses={this.getCourses}\n setCourse={this.setCourse}\n />\n );\n }", "title": "" }, { "docid": "41509881609f7e961f94cb7b2fc4ba28", "score": "0.56231153", "text": "function major_change()\r\n{\r\n //changes title of planner to the correct major\r\n major_selector = document.getElementById(\"major_select\");\r\n document.getElementById(\"major_name\").innerHTML = \"AREA OF STUDY: \".concat(major_selector.value);\r\n\r\n degree_type = document.getElementsByClassName('dropdown_1')[0].value;\r\n\r\n //this should be changed to read the db and get all compulsory units for the major in a list\r\n var compulsory_units = get_compulsory_units(major_selector.value);\r\n\r\n var course_types = document.getElementsByClassName(\"course_type\");\r\n\r\n var fees = document.getElementsByClassName(\"fee\");\r\n\r\n var credit_points = document.getElementsByClassName(\"unit_credit\")\r\n\r\n var unit_eftsl = document.getElementsByClassName(\"unit_eftsl\")\r\n\r\n //since we dont get the start times of the compulsory units, \r\n //it may be best to just have them 1st then have the electives next\r\n //so this loop will go through the compulsory units and enter them into the planner\r\n for(let i = 1; i < compulsory_units.length+1; i++)\r\n {\r\n let unit_num = \"+unit\".concat(i);\r\n document.getElementById(unit_num).innerHTML = compulsory_units[i-1]; \r\n document.getElementById(unit_num).style.color = 'black'; \r\n\r\n course_types[i-1].innerHTML = \"Compulsory\"\r\n //There should be a funciton here that gets the unit price efstl and credit points from the db\r\n fees[i-1].innerHTML = \"$\".concat(\"1000\"); \r\n credit_points[i-1].innerHTML = \"6\";\r\n unit_eftsl[i-1].innerHTML = \"0.125\"\r\n\r\n }\r\n\r\n var price_total = 0;\r\n for(let i = 0; i < fees.length; i++)\r\n {\r\n price_total += parseInt(fees[i].innerHTML.replace('$', '').replace(',',''));\r\n \r\n }\r\n\r\n var credit_total = 0;\r\n for(let i = 0; i < fees.length; i++)\r\n {\r\n credit_total += parseInt(credit_points[i].innerHTML.replace('$', '').replace(',',''));\r\n \r\n }\r\n\r\n var eftsl_total = 0;\r\n for(let i = 0; i < fees.length; i++)\r\n {\r\n eftsl_total += parseFloat(unit_eftsl[i].innerHTML);\r\n \r\n }\r\n\r\n document.getElementById(\"total_price\").innerHTML = \"$\".concat(price_total); \r\n document.getElementById(\"total_credits\").innerHTML = (credit_total); \r\n document.getElementById(\"total_eftsl\").innerHTML = (eftsl_total); \r\n check_eftsl()\r\n\r\n document.getElementById(\"error_message\").style.visibility = \"visible\";\r\n}", "title": "" }, { "docid": "b40a29820b2f404ab59955332992a965", "score": "0.56185347", "text": "get courses() {\n return {appetizers: this.appetizers, mains: this.mains, desserts: this.deserts};\n }", "title": "" }, { "docid": "864b7255f4bdf22ea7b1ddb6bdf5cd37", "score": "0.5612767", "text": "get courses() {\n return {\n appetizers: this.appetizers,\n mains: this.mains,\n desserts: this.desserts,\n }\n }", "title": "" }, { "docid": "fc452504eae7b1697a94ea230777a63a", "score": "0.56038296", "text": "function compute_schedule() {\n\t\tCOURSE_RESOLUTION_MAP = {};\n\t\tdocument.getElementById(\"merged-table\").innerHTML = \"\";\n\t\tdocument.getElementById(\"detail-list\").innerHTML = \"\";\n\t\tlet checked = document.querySelectorAll('#course-list :checked');\n \tlet selected = [...checked].map(option => option.value);\n \tlet links = [];\n \tselected.forEach((course_with_name, i) => {\n \t\tlet course = course_with_name.split('-')[0].trim();\n \t\tlet course_number = course.match(/\\d+/g);\n \t\tlet subject_name = course.match(/[a-zA-Z]+/g);\n \t\tlet link = BASE_URL + '?subject='+subject_name+'&course=' + course_number;\n \t\tlinks.push(fetch(link));\n \t})\n \tPromise.all(links)\n \t.then(function(responses) {\n \t\treturn Promise.all(responses.map(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}));\n \t}).then(function (all_courses) {\n \t\tassign_css_classes_to_courses(all_courses);\n \t\tlet value = detect_conflicts_in_courses(all_courses);\n \t\tif(value) {\n \t\t\tgenerate_merged_table();\n \t\t\tshow_result_banner(true);\n \t\t} else {\n \t\t\tgenerate_individual_tables(all_courses);\n \t\t\tshow_result_banner(false);\n \t\t}\n \t\tall_courses.forEach((data, i) => {\n\t\t\t\tpopulate_selected_course_description_list(data);\n\t\t\t})\n\t\t}).catch(error_handling)\n\t}", "title": "" }, { "docid": "3cef7ac61653c512c78de732b7bc3010", "score": "0.5601042", "text": "function setupCourses() {\n const navBtns = document.querySelectorAll('.expertise-btn');\n \n navBtns.forEach(navBtn => {\n navBtn.addEventListener('click', () => {\n // Determine the content generated height \n // and apply it to the div \n // Removes the active class from the .expertise-btn:\n navBtns.forEach(navBtn => {\n navBtn.classList.remove('expertise-btn--active');\n })\n // Removes the active class from the .expertise-menu__layout:\n const expertiseBoxes = document.querySelectorAll('.expertise-menu__box');\n expertiseBoxes.forEach(box => {\n box.classList.remove('expertise-menu__box--active');\n });\n \n // Get the course number\n const expertiseName = navBtn.dataset.forExpertise;\n \n // And show the corresponding course in the menu\n const courseItems = document.querySelectorAll(`.expertise-menu__box[data-expertise=\"${expertiseName}\"]`);\n courseItems.forEach(courseItem => {\n courseItem.classList.add('expertise-menu__box--active');\n })\n navBtn.classList.add('expertise-btn--active');\n });\n });\n // Count checked items\n function updateCount() {\n var x = jQuery(\".expertise-menu__input:checked\").length;\n document.querySelector('.counter__number').innerHTML = x;\n \n if(x > 0) {\n document.querySelector('.text--empty').style.display = \"none\";\n } else {\n document.querySelector('.text--empty').style.display = \"block\";\n \n }\n \n if(x === 1) {\n document.querySelector('.counter__text').innerHTML = \"Course Selected\";\n } else {\n document.querySelector('.counter__text').innerHTML = \"Courses Selected\";\n }\n \n };\n \n \n $('.expertise-menu__input').change((e) => {\n let courseLabelElem = e.target.parentNode.querySelector('label');\n let courseName = courseLabelElem.querySelector('.expertise-menu__text').innerText\n let courseId = courseLabelElem.querySelector('.expertise-menu__text--sub').innerText\n \n \n if(e.target.checked){\n $('#selected___courses').append(\n `<li class=\"selected___course___item\" id=\"selected_${courseId}\">\n <button class=\"remove__course__button\" id=\"remove_${courseId}\">\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 16 16\" class=\"bi bi-x\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" d=\"M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z\"/>\n <path fill-rule=\"evenodd\" d=\"M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z\"/>\n </svg>\n </button>\n ${courseName} ${courseId}\n </li>`)\n\n\n $('.wpcf7-hidden').val($('.wpcf7-hidden').val() + ' ' + courseId);\n\n jQuery(`#remove_${courseId}`).click(() =>{\n e.target.checked = false\n jQuery(`#selected_${courseId}`).remove();\n updateCount();\n })\n \n } else {\n jQuery(`#selected_${courseId}`).remove();\n }\n \n updateCount();\n \n });\n \n \n }", "title": "" }, { "docid": "d49f2ed32ea8925e82b3e7ace67e1df4", "score": "0.5598419", "text": "function getCourseFromData(i) {\n return {\n year: parseInt(vm.data[i].semester.substring(2, 4)),\n season: vm.data[i].semester.substring(0, 2),\n semester: vm.data[i].semester,\n courseID: vm.data[i].courseID,\n err: null,\n succ: null\n };\n }", "title": "" }, { "docid": "35a519eb7d24d36d080e5744b274231c", "score": "0.5579025", "text": "function createStudent(name, year) {\n return {\n name: name,\n year: year,\n courses: [],\n info: function() {\n console.log(this.name + \" is a \" + this.year + \" student\");\n },\n\n listCourses: function() {\n return this.courses;\n },\n\n addCourse: function(course) {\n this.courses.push(course);\n },\n\n addNote: function(courseCode, note) {\n var course = this.courses.filter(function(course) {\n return course.code === courseCode;\n })[0];\n\n if (course) {\n if (course.note) {\n course.note += '; ' + note;\n } else {\n course.note = note;\n }\n }\n\n },\n\n viewNotes: function() {\n this.courses.forEach(function(course) {\n if (course.note) {\n console.log(course.name + ': ' + course.note);\n }\n });\n },\n\n updateNote: function(courseCode, note) {\n var course = this.courses.filter(function(course) {\n return course.code === courseCode;\n })[0];\n\n if (course) {\n course.note = note;\n }\n },\n };\n}", "title": "" }, { "docid": "3070534f15938a3864233ca694081629", "score": "0.55691236", "text": "function _courseAdd(course) {\n // courseAdd é o obj que chama a função da service\n if (!$scope.fatec) {\n alert('não há fatec cadastrada!');\n return 0;\n };\n //course.codeInstitution = admin.instCode; //pega o codigo da fatec cadastrada e seta no curso\n course.situation = 1; //define situação ativa\n \n courseService.courseAdd(course, admin.instCode).then(function (status) {\n if (status != 200) {\n alert(':/ Ops! problema ao cadastrar.');\n } else {\n $scope.courseList(admin.instCode);\n alert(\"Salvo com sucesso.\");\n $scope.course.name = '';\n }\n\n });\n\n \n \n }", "title": "" }, { "docid": "e1d47b45e11ddad033cc0b11cee6c971", "score": "0.55614763", "text": "function addCoreCourse (userInput) {\n //reqMet is requirement(s) satisfied by course\n var reqMet = coreReq[userInput];\n //gets length of requirements the course fufills \n var numReqMet = coreReq[userInput].length;\n\n //makes sure the reqMet is an object which means its a double dipper\n if(numReqMet > 1 && typeof(reqMet)=='object') {\n //for loop checks each requirement\n for(var k=0;k<numReqMet;k++){\n //enters check if course fails check\n if (coreReqCheck(userInput, reqMet[k])) {\n //for loop checks current classes being used against potential double dipper class\n for(var i = 0; i<tableObj.core.length;i++){\n //course variable from list of core classes already in use\n var course = tableObj.core[i];\n //check sees if double dipper can replace a single dipper class\n //checks if added course's requirement has already been satisfied and that if the requirement's course is not a double dipper\n if(reqMet[k] == coreReq[course] && typeof(coreReq[course])!='object'){\n var remTdElem = reqMet[k] + \" (\" + course + \")\";\n //single dipper removed and added to enrichments\n resetCoreBox(remTdElem);\n addEnrich(course);\n //insert double dipper course one requirement at a time\n coreHTMLInject(userInput, reqMet[k]);\n }\n \n }\n\n continue;\n }\n //adds course and requirement to HTML\n coreHTMLInject(userInput, reqMet[k]);\n }\n }\n //single dipper classes\n else {\n //checks course, comes back true if it fails\n if (coreReqCheck(userInput, reqMet)) {\n //added to enrichment if it fails\n addEnrich(userInput);\n return;\n }\n\n //inputs core single dipper class into HTML\n coreHTMLInject(userInput, reqMet);\n\n }\n\n //pushes class entered into core array\n tableObj.core.push(userInput);\n //console.log(tableObj.core + \" *post add core classes\");\n //console.log(tableObj.reqSat + \" *req satisfied obj\");\n}", "title": "" }, { "docid": "faae9384b5a6cc7ff290ae2baee46340", "score": "0.55405277", "text": "function courses(category = \"all\") {\n $('#loader2').show();\n var today = new Date().getTime;\n const proxy = \"https://tranquil-dawn-42121.herokuapp.com/\";\n const urlCourses = 'https://frontend-hiring.appspot.com/all_courses';\n const url2=proxy + urlCourses;\n $.ajax({\n url: url2,\n type: 'GET',\n data: {\n secret : secret_keys\n },\n success: function (data) {\n $('#courses').empty();\n if (category == 'all') {\n var courseArray=eval(JSON.parse(data)['payload']);\n $('#courseArrayLength').text(courseArray.length + ' courses open for registration');\n for (var i = 0; i < courseArray.length; i++){\n var courses = '<div class= \"card\" style = \"height: 25rem; width: 22rem ; margin: 10px;\" data-string=\"'+courseArray[i]['title']+' '+courseArray[i]['instructor_name']+' '+courseArray[i]['start_date']+' '+courseArray[i]['end_date']+' '+courseArray[i]['estimated_workload']+'\">';\n courses += '<div class=\"card-body\">';\n courses += '<h5 class=\"card-title\" id=\"courseTitle\" >' + courseArray[i]['title'] + '</h5>';\n courses += '<h6 class=\"card-subtitle mb-2 text-muted\" id=\"courseInstructor\">' + courseArray[i]['instructor_name'] + '</h6>';\n courses += '<div class=\"row\" style=\"margin-top:50px\">';\n courses += '<div class=\"col-sm-3\" style=\"text-align:center\"><i class=\"fas fa-exclamation-circle\"></i></div>';\n courses += '<div class=\"col-sm-9\"><p class=\"card-text\" id=\"courseDescription\">' + courseArray[i]['description'] + '</p></div></div >';\n courses += '<div class=\"row\">';\n courses += '<div class=\"col-sm-3\" style=\"text-align:center\"><i class=\"far fa-calendar-alt\"></i></div>';\n var start_date = new Date(courseArray[i]['start_date']).getTime();\n var end_date = new Date(courseArray[i]['end_date']).getTime();\n if (today < start_date) {\n courses += '<div class=\"col-sm-9\" id=\"otherDetails\"><p>Pre-registration<br>'+courseArray[i]['start_date']+'-'+courseArray[i]['end_date']+'<br>'+courseArray[i]['estimated_workload']+'</p></div>';\n }\n else if (start_date < today < end_date){\n courses += '<div class=\"col-sm-9\" id=\"otherDetails\"><p>Ongoing<br>'+courseArray[i]['start_date']+'-'+courseArray[i]['end_date']+'<br>'+courseArray[i]['estimated_workload']+'</p></div>';\n }\n else{\n courses += '<div class=\"col-sm-9\" id=\"otherDetails\"><p>Completed<br>'+courseArray[i]['start_date']+'-'+courseArray[i]['end_date']+'<br>'+courseArray[i]['estimated_workload']+'</p></div>';\n }\n courses += '</div></div>';\n $('#courses').append(courses);\n }\n }\n else {\n $('#courses').empty();\n var courseArray = eval(JSON.parse(data)['payload']);\n var filterArray=getChoosenCourses(courseArray, 'category', category);\n $('#courseArrayLength').text(filterArray.length + ' courses open for registration');\n for (var i = 0; i < filterArray.length; i++){\n var courses = '<div class= \"card\" style = \"height: 25rem; width: 22rem ; margin: 10px;\" data-string=\"'+filterArray[i]['title']+' '+filterArray[i]['instructor_name']+' '+filterArray[i]['start_date']+' '+filterArray[i]['end_date']+' '+filterArray[i]['estimated_workload']+'\">';\n courses += '<div class=\"card-body\">';\n courses += '<h5 class=\"card-title\" id=\"courseTitle\">' + filterArray[i]['title'] + '</h5>';\n courses += '<h6 class=\"card-subtitle mb-2 text-muted\" id=\"courseInstructor\">' + filterArray[i]['instructor_name'] + '</h6>';\n courses += '<div class=\"row\" style=\"margin-top:50px\">';\n courses += '<div class=\"col-sm-3\" style=\"text-align:center\"><i class=\"fas fa-exclamation-circle\"></i></div>';\n courses += '<div class=\"col-sm-9\"><p class=\"card-text\" id=\"courseDescription\">' + filterArray[i]['description'] + '</p></div></div >';\n courses += '<div class=\"row\">';\n courses += '<div class=\"col-sm-3\" style=\"text-align:center\"><i class=\"far fa-calendar-alt\"></i></div>';\n var start_date = new Date(filterArray[i]['start_date']).getTime();\n var end_date = new Date(filterArray[i]['end_date']).getTime();\n if (today< start_date) {\n courses += '<div class=\"col-sm-9\" id=\"otherDetails\"><p>Pre-registration<br>'+filterArray[i]['start_date']+'-'+filterArray[i]['end_date']+'<br>'+filterArray[i]['estimated_workload']+'</p></div>';\n }\n else if (start_date < today < end_date){\n courses += '<div class=\"col-sm-9\" id=\"otherDetails\"><p>Ongoing<br>'+filterArray[i]['start_date']+'-'+filterArray[i]['end_date']+'<br>'+filterArray[i]['estimated_workload']+'</p></div>';\n }\n else{\n courses += '<div class=\"col-sm-9\" id=\"otherDetails\"><p>Completed<br>'+filterArray[i]['start_date']+'-'+filterArray[i]['end_date']+'<br>'+filterArray[i]['estimated_workload']+'</p></div>';\n }\n courses += '</div></div>';\n $('#courses').append(courses);\n } \n }\n },\n });\n $('#loader2').hide(500);\n}", "title": "" }, { "docid": "87b98a79fd6e8c808f1c01cf6b5cb99f", "score": "0.5540069", "text": "getCourse(courses){\n let data = []\n if( courses ){\n courses.map(function(option,index){\n data.push({value:option.id, label:option.name })\n })\n }\n return data\n }", "title": "" }, { "docid": "a1c615e46767db937e5052d1b8ef8170", "score": "0.55392396", "text": "function loadCourseData() {\n // All code that needs to run before adapt starts should go here\n var language = Adapt.config.get('_defaultLanguage');\n\n var courseFolder = \"course/\" + language +\"/\";\n\n $('html').attr(\"lang\", language);\n\n Adapt.course = new CourseModel(null, {url:courseFolder + \"course.json\", reset:true});\n\n Adapt.contentObjects = new AdaptCollection(null, {\n model: ContentObjectModel,\n url: courseFolder +\"contentObjects.json\"\n });\n\n Adapt.articles = new AdaptCollection(null, {\n model: ArticleModel,\n url: courseFolder + \"articles.json\"\n });\n\n Adapt.blocks = new AdaptCollection(null, {\n model: BlockModel,\n url: courseFolder + \"blocks.json\"\n });\n\n Adapt.components = new AdaptCollection(null, {\n model: function(json) {\n\n //use view+model object\n var ViewModelObject = Adapt.componentStore[json._component];\n\n //if model defined for component use component model\n if (ViewModelObject.model) {\n return new ViewModelObject.model(json);\n }\n\n var View = ViewModelObject.view || ViewModelObject;\n //if question type use question model\n if (View._isQuestionType) {\n return new QuestionModel(json);\n }\n\n //otherwise use component model\n return new ComponentModel(json);\n },\n url: courseFolder + \"components.json\"\n });\n }", "title": "" }, { "docid": "0cbafb187c73aeb1b92d5757ad94e935", "score": "0.55366105", "text": "function processStudent(page) {\n let curr = [] ;\n // Find user name and lastname from incoming result (html)\n let lastname = $(\".row2:first td:eq(1)\", page).html();\n let name = $(\".row1:first td:eq(1)\", page).html();\n\n // Find all tables for semesters. All semester tables have caption with h3 tag starting with \"Fall or Spring\"\n $(\"caption h3\", page)\n .filter( function(i) {\n return $(this).html().match(/^(Fall|Spring)/) ;\n })\n .each(function(i) {\n // for each semester, access course rows.\n $(\"tr:gt(0)\",$(this).parent().parent()).each(function(i){\n // for each course, add into curr(iculum) array of the student\n let code = $(\"td:first\", $(this)).html();\n let name = $(\"td:eq(1)\", $(this)).html().replace(/\\n|\\s+/g, \" \").trim();\n let status = $(\"td:eq(2)\", $(this)).html();\n let grade = $(\"td:eq(3)\", $(this)).html().replace(/&nbsp;/g, \"\");\n let taken = $(\"td:eq(6)\", $(this)).html().replace(/&nbsp;/g, \"\").replace(\"<br>\",\"\");\n curr.push({\n code, name, status, grade, taken\n });\n }); \n });\n \n // If a course has an empty grade, check out if the student took that course before\n // It fills with F,FX,FZ or W instead of blank.\n for ( let i=0; i < curr.length; i++) {\n\n if ( curr[i].status == \"Not graded\") {\n curr[i].grade = \"X\" ;\n } else if (curr[i].status == \"Exempted\") {\n curr[i].grade = \"M\"\n } else if ( curr[i].code == \"\" && curr[i].name == \"\") {\n if ( curr[i-1].grade == \"\") {\n curr[i-1].grade = curr[i].grade ;\n }\n }\n }\n\n // Delete rows that represent previous taken courses\n let courses = curr.filter(item => item.code != \"\" || item.name != \"\") ;\n \n \n // Add student fullname and her courses/grades into \"all\" array.\n all.push({\n \"fullname\" : lastname + \" \" + name,\n \"courses\" : courses\n });\n}", "title": "" }, { "docid": "7640f0b3b17e669c658f47e9ad7f51b6", "score": "0.5490451", "text": "render() {\n var p1b1 = [];\n var p1b2 = [];\n var p1b3 = [];\n var p1b4 = [];\n var p1none = [];\n\n var p2b1 = [];\n var p2b2 = [];\n var p2b3 = [];\n var p2b4 = [];\n var p2none = [];\n\n var codes = [];\n var courseItem;\n\n var _this = this;\n this.props.courses.forEach(function(course) {\n courseItem = <ScheduleItem\n key={ course.code }\n handleCourseDel={ _this.handleCourseDel }\n course={ course }\n />\n codes.push(course.code);\n switch (course.block1) {\n case '1': p1b1.push(courseItem); break;\n case '2': p1b2.push(courseItem); break;\n case '3': p1b3.push(courseItem); break;\n case '4': p1b4.push(courseItem); break;\n case '-': p1none.push(courseItem); break;\n default:\n }\n switch (course.block2) {\n case '1': p2b1.push(courseItem); break;\n case '2': p2b2.push(courseItem); break;\n case '3': p2b3.push(courseItem); break;\n case '4': p2b4.push(courseItem); break;\n case '-': p2none.push(courseItem); break;\n default:\n }\n });\n\n var defaultClasses = \"col-md-2 col-xs-2 light-grey noborder schedule-header\";\n var slotClasses = \"col-md-5 col-xs-5 block-box-container\";\n\n\n return (\n <div className=\"schedule\">\n <div className=\"row my-row schedule-header\">\n <div className=\"col-md-2 col-xs-3 light-grey noborder block-corner\">\n <h5>Block</h5>\n </div>\n <div className=\"col-md-5 col-xs-5 light-grey noborder\">\n <h5>Period 1</h5>\n </div>\n <div className=\"col-md-5 col-xs-4 light-grey noborder\">\n <h5>Period 2</h5>\n </div>\n </div>\n\n <div className=\"row my-row row-eq-height\">\n <div className={ defaultClasses }>\n 1\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p1b1'].selected } onClick={() => {this.handleBlockClick({ 'period': '1', 'block': '1', 'id': 'p1b1'})}}>\n <div className=\"row select-row block-box\">\n { p1b1 }\n </div>\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p2b1'].selected} onClick={() => {this.handleBlockClick({ 'period': '2', 'block': '1', 'id': 'p2b1'})}}>\n <div className=\"row select-row block-box\">\n { p2b1 }\n </div>\n </div>\n </div>\n\n <div className=\"row my-row row-eq-height\">\n <div className={ defaultClasses }>\n 2\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p1b2'].selected } onClick={() => {this.handleBlockClick({ 'period': '1', 'block': '2', 'id': 'p1b2'})}}>\n <div className=\"row select-row block-box\">\n { p1b2 }\n </div>\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p2b2'].selected } onClick={() => {this.handleBlockClick({ 'period': '2', 'block': '2', 'id': 'p2b2'})}}>\n <div className=\"row select-row block-box\">\n { p2b2 }\n </div>\n </div>\n </div>\n <div className=\"row my-row row-eq-height\">\n <div className={ defaultClasses }>\n 3\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p1b3'].selected } onClick={() => {this.handleBlockClick({ 'period': '1', 'block': '3', 'id': 'p1b3'})}}>\n <div className=\"row select-row block-box\">\n { p1b3 }\n </div>\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p2b3'].selected } onClick={() => {this.handleBlockClick({ 'period': '2', 'block': '3', 'id': 'p2b3'})}}>\n <div className=\"row select-row block-box\">\n { p2b3 }\n </div>\n </div>\n </div>\n <div className=\"row my-row row-eq-height\">\n <div className={ defaultClasses }>\n 4\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p1b4'].selected } onClick={() => {this.handleBlockClick({ 'period': '1', 'block': '4', 'id': 'p1b4'})}}>\n <div className=\"row select-row block-box\">\n { p1b4 }\n </div>\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p2b4'].selected } onClick={() => {this.handleBlockClick({ 'period': '2', 'block': '4', 'id': 'p2b4'})}}>\n <div className=\"row select-row block-box\">\n { p2b4 }\n </div>\n </div>\n </div>\n <div className=\"row my-row row-eq-height\">\n <div className={ defaultClasses }>\n -\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p1none'].selected } onClick={() => {this.handleBlockClick({ 'period': '1', 'block': '-', 'id': 'p1none'})}}>\n <div className=\"row select-row block-box\">\n { p1none }\n </div>\n </div>\n <div className={ slotClasses + ' ' + this.state.clickStatus['p2none'].selected } onClick={() => {this.handleBlockClick({ 'period': '2', 'block': '-', 'id': 'p2none'})}}>\n <div className=\"row select-row block-box\">\n { p2none }\n </div>\n </div>\n </div>\n\n <div className=\"row button-row\">\n <div className=\"col-md-8 col-sm-12\">\n\n <fieldset disabled={\"{{ '' if current_user.is_authenticated else 'disabled'}}\"}>\n <button className='btn btn-default' onClick={() => {this.handleCartSave()}}>\n Spara kurser\n </button>\n <button className='btn btn-default' onClick={() => {this.handleCartLoad()}}>\n Ladda kurser\n </button>\n </fieldset>\n </div>\n\n <div className=\"col-md-4 col-sm-12\">\n <button className='btn btn-danger' onClick={() => {this.handleCourseDel('all')}}>\n Ta bort alla\n </button>\n </div>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "c438c2c51b2a56cf0221c8ac603a2e63", "score": "0.54892635", "text": "function _addCourse(cou) {\n var level = $scope.levelRef[cou.level];\n\n // Compile to DOM\n angular.element(document.getElementById('CourseCards')).append($compile(\n '<div class=\"col-sm-3\">' +\n '<md-card class=\"general-card md-whiteframe-8dp no-padding\" id=' + cou._id + '>' +\n '<div class=\"header-card\">' +\n '<img src=\"/static/images/design/blackboard.svg\" width=\"50px\" height=\"50px\" />' +\n '</div>' +\n '<md-card-title-text>' +\n '<div class=\"center-card\">' +\n '<h1 class=\"md-headline no-margin\"> ' + cou._id + ' </h1>' +\n '<p class=\"md-subhead\"> Nombre:' + cou.name + '</p>' +\n '</div>' +\n '<md-button class=\"md-raised button-eliminate md-primary\" ng-click=\"editCourse(\\'' + cou._id + '\\', $event)\">Editar</md-button>' +\n '<md-button class=\"md-raised button-eliminate md-warn\" ng-click=\"deleteCourse(\\'' + cou._id + '\\')\">Eliminar</md-button>' +\n '</md-card-title-text> ' +\n '</md-card></div>'\n )($scope));\n }", "title": "" }, { "docid": "ebc59d071e69eb9ff0fc3d34099dd72b", "score": "0.5483638", "text": "function courseSchedule() {\n\t// member varables\n\tthis.m_coursesDetailList = [];\n\tthis.m_coursesList = [];\n\tthis.m_coursesCount = 0;\n\tthis.m_currentDate = \"0\";\n\tthis.m_termCode = \"0\";\n}", "title": "" }, { "docid": "ff907b2c0898971525bf5960f0333121", "score": "0.5470147", "text": "getCourses() {\n let courses = [];\n\n for(const course of Object.entries(this.props.data)) {\n courses.push(\n <CheckedClass key={course[0]} data={course[1]} name={course[0]} pushClass={(cls) => this.pushClass(cls)} setCourses={() => this.setCourses()}/>\n );\n }\n if (courses.length === 0) {\n return \"Please add your course to the cart first :)\\n\";\n }\n return courses;\n }", "title": "" }, { "docid": "0d99bfafe96e1b576442329f0e3d59af", "score": "0.5469106", "text": "function createStudent(name, year) {\n return {\n name,\n year,\n courses: [],\n\n info() {\n return `${this.name} is a ${this.year} year student`;\n },\n\n addCourse(courseObj) {\n this.courses.push(courseObj);\n },\n\n listCourses() {\n return this.courses\n },\n\n addNote: function(courseCode, note) {\n let course = this.courses.filter(course => {\n return course.code === courseCode;\n })[0];\n\n if (course) {\n if (course.note) {\n course.note += `; ${note}`;\n } else {\n course.note = note;\n }\n }\n\n },\n\n viewNotes: function() {\n this.courses.forEach(course => {\n if (course.note) {\n console.log(`${course.name}: ${course.note}`);\n }\n });\n },\n\n updateNote: function(courseCode, note) {\n let course = this.courses.filter(course => {\n return course.code === courseCode;\n })[0];\n\n if (course) {\n course.note = note;\n }\n },\n };\n}", "title": "" }, { "docid": "669476384ce0eedce971eb5826e60d08", "score": "0.5462446", "text": "headstart() {\n this.Restangular\n .one('guides', 1)\n .getList('courses', {\n semester: 1,\n year: this.UserService.details.mat_year,\n term: this.UserService.details.mat_term,\n })\n .then(guide => {\n forEach(guide, course => {\n const fieldId = course.singleField\n ? course.singleField\n : get(course, 'fields[0].field_id', null);\n this.UserService.addCourse(course, fieldId);\n });\n });\n }", "title": "" }, { "docid": "9ff12b858a854c78fa61c5d8eb95dbba", "score": "0.5460735", "text": "generateCourses(courseData){\n let role = this.props.auth.role\n let filterCourses = courseData.filter(el => {\n if (role === 1) { return true }\n else {\n if (el.courseStatus === 'enabled') {\n return true\n }\n return\n }\n })\n\n return filterCourses.map(val => {\n return (\n <tr key={val._id}>\n <td>{val.name}</td>\n <td>{this.calcMaterial(val.videos, val.filePaths)}</td>\n <td>{val.members.length}</td>\n {role === 1 && <td>{val.courseStatus}</td>}\n <td className=\"align-middle\">\n <Link to={`/course/${val._id}`}>\n <Button >See course</Button>\n </Link>\n </td>\n </tr>)\n })\n }", "title": "" }, { "docid": "9ff12b858a854c78fa61c5d8eb95dbba", "score": "0.5460735", "text": "generateCourses(courseData){\n let role = this.props.auth.role\n let filterCourses = courseData.filter(el => {\n if (role === 1) { return true }\n else {\n if (el.courseStatus === 'enabled') {\n return true\n }\n return\n }\n })\n\n return filterCourses.map(val => {\n return (\n <tr key={val._id}>\n <td>{val.name}</td>\n <td>{this.calcMaterial(val.videos, val.filePaths)}</td>\n <td>{val.members.length}</td>\n {role === 1 && <td>{val.courseStatus}</td>}\n <td className=\"align-middle\">\n <Link to={`/course/${val._id}`}>\n <Button >See course</Button>\n </Link>\n </td>\n </tr>)\n })\n }", "title": "" }, { "docid": "a8b9fe272f96ce1e94ee800a2b7510d8", "score": "0.545953", "text": "render(){\n let y = localStorage.getItem(\"bb\");\n let x = y.split(\",\");\n localStorage.setItem(\"cc\", y);\n let z =0;\n\n //array for first semester\n\n\n function Compare (value) {\n let i = 0;\n while (value !== x[i]){\n if (i === x.length-1)\n return false;\n i++;\n\n\n }\n return true\n }\n\n function ListSem1Courses(props) {\n\n //if (compareCourses(dummy, propsValue)) {\n // return <li><strike>{props.value}</strike></li>;\n // }\n // for (let i =0 ; i< x.length ; i++) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n // }\n }\n\n function CoursesList1(props) {\n const courses1 = props.courses1;\n return (\n <ul>\n {courses1.map((course) =>\n <ListSem1Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n\n\n\n\n //array for second semester\n function ListSem2Courses(props) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n }\n\n function CoursesList2(props) {\n const courses2 = props.courses2;\n return (\n <ul>\n {courses2.map((course) =>\n <ListSem2Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n //array for third semester\n function ListSem3Courses(props) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n }\n\n function CoursesList3(props) {\n const courses3 = props.courses3;\n return (\n <ul>\n {courses3.map((course) =>\n <ListSem3Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n //array for semester 4\n function ListSem4Courses(props) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n }\n\n function CoursesList4(props) {\n const courses4 = props.courses4;\n return (\n <ul>\n {courses4.map((course) =>\n <ListSem4Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n //array for semester 5\n function ListSem5Courses(props) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n }\n\n function CoursesList5(props) {\n const courses5 = props.courses5;\n return (\n <ul>\n {courses5.map((course) =>\n <ListSem5Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n //array for semester 6\n function ListSem6Courses(props) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n }\n\n function CoursesList6(props) {\n const courses6 = props.courses6;\n return (\n <ul>\n {courses6.map((course) =>\n <ListSem6Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n //array for semester 7\n function ListSem7Courses(props) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n }\n\n function CoursesList7(props) {\n const courses7 = props.courses7;\n return (\n <ul>\n {courses7.map((course) =>\n <ListSem7Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n //array for semester 8\n function ListSem8Courses(props) {\n if (Compare(props.value))\n return <li><i><b><strike>{props.value}</strike></b></i></li>;\n else return <li>{props.value}</li>;\n }\n\n function CoursesList8(props) {\n const courses8 = props.courses8;\n return (\n <ul>\n {courses8.map((course) =>\n <ListSem8Courses key={course.toString()} value={course} />\n )}\n </ul>\n );\n }\n\n const courses1 = [\"COMP248\" , \"COMP232\", \"ENGR201\", \"ENGR213\", \"General Elective\"];\n const courses2= [\"COMP249\" , \"SOEN228\", \"ENGR233\", \"SOEN287\", \"Basic Science 1\"];\n const courses3= [\"COMP348\" , \"COMP352\", \"ENCS282\", \"ENGR202\", \"Basic Science 2\"];\n const courses4= [\"COMP346\" , \"ELEC275\", \"ENGR371\", \"SOEN331\", \"SOEN341\"];\n const courses5= [\"COMP335\" , \"SOEN384\", \"ENGR391\", \"SOEN342\", \"SOEN343\"];\n const courses6= [\"SOEN344\" , \"SOEN345\", \"SOEN357\", \"SOEN390\", \"Elective 1\"];\n const courses7= [\"ENGR301\" , \"SOEN321\", \"SOEN490\", \"Elective 2\", \"Elective 3\"];\n const courses8= [\"ENGR392\" , \"SOEN385\", \"SOEN490\", \"Elective 4\", \"Elective 5\"];\n\n return (\n <div className=\"sequence\">\n <Router>\n <Header />\n </Router>\n <div className=\"course_seq\">\n <hr/>\n <h3 className=\"middle\">Software Engineering - General Program </h3>\n <hr/>\n <div className=\"row\">\n <div className=\"col-6 add_space\">\n <h4><i className=\"fa fa-book\"> </i> Semester 1</h4>\n <CoursesList1 courses1={courses1} />\n <h4><i className=\"fa fa-book\"> </i> Semester 2</h4>\n <CoursesList2 courses2={courses2} />\n <h4><i className=\"fa fa-book\"> </i> Semester 3</h4>\n <CoursesList3 courses3={courses3} />\n <h4><i className=\"fa fa-book\"> </i> Semester 4</h4>\n <CoursesList4 courses4={courses4} />\n </div>\n <div className=\"col-6 add_space\">\n <h4><i className=\"fa fa-book\"> </i> Semester 5</h4>\n <CoursesList5 courses5={courses5} />\n <h4><i className=\"fa fa-book\"> </i> Semester 6</h4>\n <CoursesList6 courses6={courses6} />\n <h4><i className=\"fa fa-book\"> </i> Semester 7</h4>\n <CoursesList7 courses7={courses7} />\n <h4><i className=\"fa fa-book\"> </i> Semester 8</h4>\n <CoursesList8 courses8={courses8} />\n </div>\n </div>\n\n </div>\n\n </div>\n\n );\n }", "title": "" }, { "docid": "50864ca5eff2b43c33fb056e6e03314b", "score": "0.54567003", "text": "addCourse(courseObj, toSemester){\n this.setState((prevState) => {\n\n let courseObjEditCommand = {\n id: {$set: generateUniqueKey(courseObj, toSemester.season, toSemester.yearIndex, 0, \"\", new Date().getTime())},\n isElective: {$set: \"false\"},\n electiveType: {$set: \"\"}\n };\n\n let addCommand = {\n yearList: {\n [toSemester.yearIndex]: {\n [toSemester.season]: {\n courseList: {$splice: [[0, 0, update(courseObj, courseObjEditCommand)]]}\n }\n }\n }\n };\n\n return {\n courseSequenceObject: update(prevState.courseSequenceObject, addCommand)\n };\n });\n }", "title": "" }, { "docid": "924d5ec9982268597b32e0eddc85a741", "score": "0.54460084", "text": "function get_angel_courses() {\r\n $.ajax({\r\n type: \"GET\",\r\n url: \"https://\" + location.hostname.toLowerCase() + \"/api/lti/accounts/85746/jwt_token\",\r\n data: {\r\n tool_id: 188455,\r\n },\r\n cache: false,\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n $(\"#dashtabs-2\").html('<div class=\"loading center loadingIndicator\"></div>');\r\n },\r\n success: function (data) {\r\n if (typeof data.jwt_token !== undefined && data.jwt_token !== \"\") {\r\n var tokenkey = data.jwt_token;\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: ANGELBase() + \"/Canvas/UserCourseAPI.aspx\",\r\n data: {\r\n hash: tokenkey,\r\n semester: \"2016/17 S1\"\r\n },\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n $(\"#dashtabs-2\").html('<div class=\"loading center loadingIndicator\"></div>');\r\n },\r\n success: function (data) {\r\n var htmldata = '';\r\n if (typeof data.error !== \"undefined\") {\r\n $(\"#dashtabs-2\").html('<h3>Unable to get ANGEL courses</h3><br/><small>' + data.error + '</small>');\r\n } else {\r\n $.each(data, function (index, element) {\r\n element.semester = typeof element.semester === undefined ? \"\" : element.semester;\r\n htmldata += '<div aria-label=\"' + element.title + '\" style=\"border-bottom-color:#666;\" class=\"ic-DashboardCard\" data-order=\"' + element.sortnum + '\"> ' +\r\n\t\t\t\t\t\t\t\t\t\t'<div class=\"\"><div style=\"background-color:#0076b8;\" class=\"ic-DashboardCard__header_hero\"></div>' +\r\n\t\t\t\t\t\t\t\t\t\t'<div class=\"ic-DashboardCard__header_content\">' +\r\n\t\t\t\t\t\t\t\t\t\t'<h2 title=\"' + element.title + '\" class=\"ic-DashboardCard__header-title ellipsis\">' +\r\n\t\t\t\t\t\t\t\t\t\t'<a href=\"' + element.url + '\" class=\"ic-DashboardCard__link\" target=\"_blank\">' + element.title + ' </a></h2>' +\r\n\t\t\t\t\t\t\t\t\t\t'<p title=\"' + element.semester + '\" class=\"ic-DashboardCard__header-subtitle ellipsis\">' + element.semester + '</p></div>' +\r\n\t\t\t\t\t\t\t\t\t\t'</div>' +\r\n\t\t\t\t\t\t\t\t\t\t'</div>' + \"\\n\";\r\n });\r\n\r\n if (htmldata == \"\") {\r\n htmldata = \"<h3>No ANGEL courses found</h3>\";\r\n }\r\n $(\"#dashtabs-2\").html(htmldata);\r\n }\r\n },\r\n error: function () {\r\n $(\"#dashtabs-2\").html(\"<h3>Error loading. Please try again later</h3>\");\r\n }\r\n });\r\n } else {\r\n $(\"#dashtabs-2\").html(\"<h3>Canvas Error loading. Please try again later</h3>\");\r\n }\r\n },\r\n error: function () {\r\n $(\"#dashtabs-2\").html(\"<h3>Canvas Error loading. Please try again later</h3>\");\r\n }\r\n\r\n });\r\n\r\n }", "title": "" }, { "docid": "f753ddba121aa537d65da0e9d9a00b4b", "score": "0.5433443", "text": "createCourseList(data) {\n\n // Checks if a course is mandatory\n function isObl(c){\n if(DaViSettings.userSection === \"IN\")\n return c.mandatory_I\n return c.mandatory_C\n }\n\n // Sorts by mandatory courses\n function copareCourses(a,b){\n if(isObl(a[1])){\n if(!isObl(b[1]))\n return -1\n }else if(isObl(b[1]))\n return 1;\n return a[0]>b[0];\n }\n\n // Starts the creation of the div\n let table = document.getElementById(DaViSettings.courseListId);\n\n let tbody = document.createElement(\"tbody\");\n table.appendChild(tbody);\n\n let titlerow = document.createElement(\"tr\");\n let cell = document.createElement(\"th\");\n cell.innerHTML = \"Courses\";\n cell.className = \"detailsTile\"\n\n titlerow.appendChild(cell)\n tbody.appendChild(titlerow)\n data.sort(copareCourses)\n let i = 0\n // For each course we create a cell with all the information inside\n for(let [course, metadata] of data) {\n let row = document.createElement(\"tr\");\n row.className = DaViSettings.courseListRowClass;\n tbody.appendChild(row);\n\n let courseName = document.createElement(\"td\");\n row.appendChild(courseName)\n\n let hover = document.createElement(\"div\");\n hover.id = this.getId(course) + \"_button\";\n hover.style.background = \"#f6f6f6\"\n hover.className = DaViSettings.tooltipClass;\n hover.innerHTML = \"\"\n // If the course is mandatory add a diamond\n if(isObl(metadata))\n hover.innerHTML += \"🔸 \"\n hover.innerHTML += course;\n let speSpan = document.createElement(\"span\");\n let speSpanClasses = [\"speSpanClass0\"].concat(metadata.specialisations[DaViSettings.userSection].map(x =>\"speSpanClass\"+x));\n speSpan.className = speSpanClasses.join(\" \");\n hover.appendChild(speSpan);\n courseName.appendChild(hover)\n\n // Creates the tooltip\n let hoverInside = document.createElement(\"div\");\n hoverInside.className = DaViSettings.tooltipTextClass;\n hoverInside.id = \"Fixme2\"+i\n hover.appendChild(hoverInside)\n\n d3.select(\"#\"+hoverInside.id)\n .append(\"span\")\n .text(course)\n .classed(\"tooltipTitle\",true)\n\n var activities = createActivityData(metadata);\n\n var inside = d3.select(\"#\"+hoverInside.id)\n .append(\"div\")\n\n // Creates the chart inside the hover\n inside.append(\"div\")\n .style(\"float\", \"left\")\n .selectAll('div')\n .data(activities.filter(d=>d.duration>0)).enter()\n .append('div')\n .text(function(d) { return d.duration; })\n .style(\"background\", d => DaViSettings.cellColorMap[d.activity])\n .style(\"color\", \"#333333\")\n .style(\"font-weight\",\"bold\")\n .style(\"font-size\",\"14px\")\n .style(\"width\", \"15px\")\n .style(\"height\", function(d) { return d.duration*15 + \"px\"; });\n\n inside.append(\"div\")\n .text(\"Credits: \")\n .append(\"b\")\n .text(metadata.credits)\n\n //exam type/block/\n var season = getSeason(metadata.exam_time, metadata.exam_type)\n inside.append(\"div\")\n .text(\"Exam : \"+metadata.exam_type+\" \" + season);\n let teach = \"Teacher\"\n let coursteach = metadata.teachers\n if(coursteach.indexOf(\",\") >0)\n teach+=\"s\"\n\n inside.append(\"div\").text(teach+\": \").append(\"b\").text(coursteach);\n i ++;\n }\n }", "title": "" }, { "docid": "ca10c95c5e177b54812a40a8098ed950", "score": "0.54307806", "text": "function courseUnits(year,semester,duration,type,difficulty){\n this.year = year; \n this.semester = semester;\n this.duration = duration;\n this.type = type;\n this.difficulty = difficulty;\n}", "title": "" }, { "docid": "cfbbfc2ff2d1a9505844f32cd26146f1", "score": "0.54137063", "text": "function Course(name) {\n this.name = name;\n this.grades = [];\n }", "title": "" }, { "docid": "9ff13b11b7e73920bb56ff97507142a0", "score": "0.5401185", "text": "function renderCourses(){\n \n // Clear courses.\n $(\".course-list tbody\").html(\" \");\n\n // Iterate through courses\n for (var i = courses.length - 1; i >= 0; i--) {\n \n var tr = $(\"<tr>\");\n \n // Select content to be placed in table\n var content = [courses[i].description, courses[i].category, courses[i].name];\n\n // Create table data cells\n for (var j = content.length - 1; k=j >= 0; k=j--) {\n tr.append($(\"<td>\").append(content[j]));\n };\n\n // HTML for buttons (edit)\n var buttons = '<button type=\"button\" class=\"btn btn-primary pull-right\" onclick=\"editCourse(' + i + ')\">';\n buttons += '<span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span>';\n buttons += '</button>';\n\n // HTML for buttons (delete)\n buttons += '<button type=\"button\" class=\"btn btn-danger pull-right\" onclick=\"deleteCourse(' + i + ')\">';\n buttons += '<span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span>';\n buttons += '</button>';\n\n // Add EDIT buttons to table row\n tr.append($(\"<td>\").append(buttons));\n\n // Add content to page\n $(\".course-list\").append(tr);\n }\n}", "title": "" }, { "docid": "d90dc87af87a9217aeccbc127625995f", "score": "0.5397195", "text": "function update_coursework() {\n var r = Classroom.Courses.list({pageSize: 20, studentId: 'me', courseStates: ['ACTIVE']});\n \n var courseWork = {};\n var studentSubmissions = {};\n var courses = [];\n var studentId = null;\n\n if (r.courses && r.courses.length > 0) {\n for (var i in r.courses) {\n\n // grab up to 200 assignments for this course, and hash them\n var cwr = Classroom.Courses.CourseWork.list(r.courses[i].id, {pageSize: 200}); \n if (cwr.courseWork && cwr.courseWork.length > 0) {\n\n for (var k in cwr.courseWork) {\n courseWork[ cwr.courseWork[k].id ] = cwr.courseWork[k];\n }\n } \n \n // grab up to 200 student submissions for this course, and process them\n var completed = 0;\n var this_week = 0;\n var completed_this_week = 0;\n var ssr = Classroom.Courses.CourseWork.StudentSubmissions.list(r.courses[i].id, '-', {pageSize: 200, userId: 'me'});\n if (ssr.studentSubmissions && ssr.studentSubmissions.length > 0) {\n\n if (!studentId && ssr.studentSubmissions[0].userId) { studentId = ssr.studentSubmissions[0].userId; }\n\n var state = '';\n for (var j in ssr.studentSubmissions) {\n \n // fill in the assignment's state\n var r = get_status(courseWork[ssr.studentSubmissions[j].courseWorkId], ssr.studentSubmissions[j]);\n ssr.studentSubmissions[j].state = r.state;\n ssr.studentSubmissions[j].subState = r.subState;\n ssr.studentSubmissions[j].statusColor = r.statusColor;\n ssr.studentSubmissions[j].statusImage = r.statusImage;\n \n studentSubmissions[ ssr.studentSubmissions[j].courseWorkId ] = ssr.studentSubmissions[j];\n \n var state = ssr.studentSubmissions[j].state;\n if (state == 'TURNED_IN' || state == \"RETURNED\") { completed++; }\n \n if (due_this_week(courseWork[ssr.studentSubmissions[j].courseWorkId].dueDate)) { \n this_week++;\n if (state == 'TURNED_IN' || state == \"RETURNED\") { completed_this_week++; }\n }\n \n \n\n // Store the assignments in firebase\n var DESC_LEN = 50;\n firebase.setData(\"users/\" + studentId + \"/assignments/\" + cw.id, \n { id: cw.id, \n title: cw.title, \n description: cw.description.substring(0,DESC_LEN),\n due: cw.d.getTime(),\n late: ss.late,\n status: ss.state,\n subStatus: ss.subState,\n statusImg: ss.statusImage,\n submissionId: ss.id,\n submissionLink: ss.alternateLink,\n maxPoints: cw.maxPoints, \n earnedPoints: ss.assignedGrade, \n lastUpdateSubmission: ss.updateTime,\n studentId: studentId\n });\n firebase.setData(\"assignments/\" + cw.id, \n { id: cw.id, \n assigned: cw.creationTime, \n title: cw.title, \n description: cw.description,\n due: cw.d.getTime(),\n courseId: cw.courseId, \n courseLink: r.courses[i].alternateLink,\n assignmentLink: cw.alternateLink, \n maxPoints: cw.maxPoints, \n lastUpdateAssignment: cw.updateTime \n });\n \n // ...and enqueue a sync to the google spreadsheet that powers the no-code app (and is SO going to melt once we have traffic)\n // Classwork tab in Google Sheets has these headers; store data for Google sheet in the same format we'll want it for the sheet:\n // Due Date\tStatus\tStatus Detail\tAssignment Name\tAssigned Date\tCourse\tCourse ID\tLink to Course\tAssignment ID\tLink to Assignment\tStudent Work ID\tLink to Student Work\tStatus Image\tLate\tStudent ID\tDescription\tGrade\tMax Points\tLast Update Coursework\tLast Update Submission\tE-mail\tIgnore\tStatus_new\tCourseXStudent\t\t\t\n var ss = ssr.studentSubmissions[j];\n var cw = courseWork[ss.courseWorkId];\n firebase.setData(\"queue/glideapp-sheet/update/classwork/\" + ss.courseWorkId, \n [ ss.d, ss.state, ss.subState, cw.title, cw.creationTime, cw.courseId, r.courses[i].alternateLink, cw.id, cw.alternateLink, ss.id, ss.alternateLink, ss.statusImage, ss.late, studentId, cw.description, ss.assignedGrade, cw.maxPoints, cw.updateTime, ss.updateTime, null, null, null, \"\" + cw.courseId + studentId ]\n );\n\n }\n }\n \n \n // Course tab in Google Sheets has these headers; store data for Google sheet in the same format we'll want it for the sheet:\n // Courseename\tCourseID\tLinktocourse\tStudentID\tStudentemail\tCourseXStudent\t🔒 Row ID\tAssign_all-time\tComple_all-time\tComple_all-time%\tAssign_this-week\tComplete_this-week\tComple_this-week%\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n courses[i] = \n firebase.setData(\"queue/glideapp-sheet/update/courses/\" + r.courses[i].id, \n [ r.courses[i].name, r.courses[i].id, r.courses[i].alternateLink, studentId, null, \"\" + r.courses[i].id + studentId, null, j, completed, null, this_week, completed_this_week, null ]\n );\n \n }\n \n\n } else {\n Logger.log('No courses found.');\n }\n}", "title": "" }, { "docid": "5ff663497e7653deeeeb04e358ac4a72", "score": "0.539385", "text": "async addGroupToCourse() {\n\n }", "title": "" }, { "docid": "ae3f89e6276a3a9d7ca08e00c55585cc", "score": "0.53904706", "text": "function createParallelTable(data) {\n //note: two first elements of data are course_code, course_name\n var courses = data;\n courses.pop(); //removes last empty element after split\n document.getElementById(\"course_name\").innerHTML = courses[0] + \" \" + courses[1];\n var appendString = \"\";\n for (var i = 2; i < courses.length-1; i+=2) {\n var parallel = courses[i];\n var parallel_id = courses[i+1];\n appendString+=(\"<div id='\"+ parallel_id + \"' class='courseElement' onclick='selectParallel(this)' '><p class='courseName'>\" +\n parallel + \" </p><p class='parallelName'></div>\");\n $(\"#div_pallellist\").html(appendString);\n //remember \"fake\" space\n }\n}", "title": "" }, { "docid": "fc683a5d234e89a62041c268dd0c181a", "score": "0.5388343", "text": "function getCoursesById() {\r var coursesid = +document.querySelector(\"#search_courses\").value;\r if (coursesid != 0) {\r $.ajax({\r url: '/api/admin/subjectdetails/findCoursesByCoursesId/' + coursesid,\r type: \"GET\",\r datatype: \"JSON\",\r success: function(result) {\r var render = '';\r\r for (var j = 2; j <= 5; j++) {\r render += '<div class=\"accordion-item\"><h2 class=\"accordion-header\" id=\"heading' + (j) + '\">';\r render += ' <button class=\"accordion-button collapsed\" onclick=\"getSubjectDetailsSem(' + (j) + ')\" style=\"font-weight:900\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#collapse' + (j) + '\" aria-expanded=\"true\" aria-controls=\"collapse' + (j - 1) + '\">';\r render += 'Semester' + (j - 1) + '_(' + result.cournm + ')</button>';\r render += '</h2>';\r render += '<div id=\"collapse' + (j) + '\" class=\"accordion-collapse collapse \" aria-labelledby=\"headingOne' + (j) + '\" data-bs-parent=\"#accordionExample\">'\r render += '<div class=\"accordion-body\" id=\"accobody' + (j) + '\">'\r render += '</div></div></div>';\r }\r\r $(\"#accordionExample\").html(render);\r }\r })\r }\r\r}", "title": "" }, { "docid": "c6bd974f793478145c9a52bbe56b81f2", "score": "0.537633", "text": "function AddCourses(courses)\n{\n courseList = courses;\n}", "title": "" }, { "docid": "688d1a3bf10060263bce0cf22736393d", "score": "0.53688705", "text": "static createScheduleQuery(courses) {\n const REWARDS = [1, 100, 10000]\n\n // the query sent to the server\n let query = []\n \n // maps sent data to application data\n let queryMap = []\n\n // courses actually sent to the server\n let sentCourses = courses.filter(c => c.allowed && c.groups.some(g => g.allowed))\n\n for (let i = 0; i < sentCourses.length; i++) {\n let course = sentCourses[i]\n let sentGroups = course.groups.filter(g => g.allowed)\n\n query.push({\n id: course.type + \";\" + course.name, // TODO: does the server need this argument?\n name: course.name,\n reward: REWARDS[(course.priority || 2) - 1],\n options: sentGroups.map(g => g.serializeForQuery())\n })\n\n queryMap.push({\n course: course,\n sentGroups: sentGroups\n })\n }\n\n return [query, queryMap]\n }", "title": "" }, { "docid": "0c6a6ce384ceb2028307034b15d6f2e3", "score": "0.5366737", "text": "function displayCourses () {\n // back button functionality\n document.querySelector('#backButton').addEventListener('click', function () {\n // clear local storage\n localStorage.setItem('courses', '[]')\n localStorage.setItem('sections', '[]')\n localStorage.setItem('node_positions', '{}')\n window.location.replace('index.team6.html')\n })\n\n // grab courses from localStorage\n const data = JSON.parse(window.localStorage.getItem('courses'))\n const sections = JSON.parse(window.localStorage.getItem('sections'))\n\n // grab table from results.html and clear it\n const t = document.getElementById('courseTable')\n const table = document.getElementById('courseTable').getElementsByTagName('tbody')[0]\n while (table.rows.length > 1) {\n table.deleteRow(1)\n }\n let profName;\n let i=0;\n\n // create one row per course in the search result\n for (let code of Object.keys(data)) {\n\n let course = data[code];\n \n // error check for null course\n if (course === null) continue\n\n let avail = 0; let capac = 0\n let currentCode = ''\n\n // Adds all availaibility & capacity info for each course using the\n // sections part of the json\n for (let sectionCode of Object.keys(sections)) {\n let section = sections[sectionCode];\n currentCode = section['code']['type'] + '*' + section['code']['number']\n if (currentCode == code) {\n profName = section['faculty']\n if (parseInt(section['available']) != null && parseInt(section['capacity'])) {\n avail += parseInt(section['available'])\n capac += parseInt(section['capacity'])\n }\n }\n }\n\n // grab table from results.html and insert a new row\n const len = table.rows.length\n const row = table.insertRow(len)\n row.setAttribute('course', course['code'])\n\n // populate each column of this row with correct data\n row.insertCell(0).innerHTML = course['code']\n row.insertCell(1).innerHTML = course['title']\n row.insertCell(2).innerHTML = course['semester']\n row.insertCell(3).innerHTML = course['credit']\n row.insertCell(4).innerHTML = course['description']\n row.insertCell(5).innerHTML = profName;\n if(!profName.includes('TBA')) {\n table.rows[i].cells.item(5).innerHTML += '<br><br><button type=\"button\" class=\"profButton\" value=\"' + profName + \"#\" + course['departments']+ '\">View Photo!</button><br><br></br>';\n }\n row.insertCell(6).innerHTML = course['departments']\n if(course['prerequisites'] != '') {\n row.insertCell(7).innerHTML = course['prerequisites'] + '<br><br><button type=\"button\" class=\"treeButton\" value=\"' + course.code + '\">View Prerequisite Tree!</button><br><br>'\n } else {\n row.insertCell(7).innerHTML = \"This course has no prerequisites!\"\n }\n row.insertCell(8).innerHTML = avail + ' / ' + capac;\n i++;\n }\n\n // after populating table, generate d3 visualization underneath\n buildForceGraphJSON()\n const node_positions = JSON.parse(localStorage.getItem('node_positions'))\n $(document).ready(function () {\n // add table pagination/search\n const t = $('#courseTable').DataTable()\n\n // enable zooming on graph\n const svgElement = document.querySelector('.course_visualization')\n const zoomyzoom = svgPanZoom(svgElement, { minZoom: 0, maxZoom: 800, center: true })\n // zoom out if the graph is a big boi\n if (data.length > 200) {\n zoomyzoom.zoomAtPointBy(0.15, { x: node_positions['Search Results'].x - 2600, y: node_positions['Search Results'].y - 2600 })\n }\n\n // on click for each row\n $('#courseTable tbody').on('click', 'tr', function () {\n const data = t.row(this).data()\n const code = data[0]\n console.log('ROW CLICKED!!!! ' + code)\n\n // reset from previous zoom\n zoomyzoom.fit()\n zoomyzoom.center()\n\n // zoom in on node position\n document.querySelector('.course_visualization').querySelector('rect').setAttribute('width', 1200)\n zoomyzoom.updateBBox()\n zoomyzoom.zoomAtPointBy(2, { x: node_positions[code].x, y: node_positions[code].y })\n })\n\n // event listener for button in table\n $('#courseTable tbody').on('click', '.treeButton', function () {\n let code = $(this).attr(\"value\");\n console.log('clicked tree button ' + code)\n\n // open modal with title\n $('#myModal').modal('show')\n $('#myModalTitle').html(code + ' Prerequisite Dependency Tree')\n\n // hit /tree endpoint to get d3 json for this course then build graph\n buildTreeDiagramJSON(code) \n })\n\n // clear graph when modal closes\n $('.closeTree').on('click', function () {\n d3v4.selectAll(\"#tree_graph g\").remove();\n })\n\n // download buttons\n const downloadSVG = document.querySelector('#downloadSVG');\n downloadSVG.addEventListener('click', downloadSVGAsText);\n const downloadPNG = document.querySelector('#downloadPNG');\n downloadPNG.addEventListener('click', downloadSVGAsPNG);\n })\n\n // event listener for button in table\n $('#courseTable tbody').on('click', '.profButton', function () {\n let values = $(this).attr(\"value\").split(\"#\");\n let profName = values[0];\n let dept = values[1].split(\":\");\n department = dept[1];\n\n let tb = $('#courseTable').DataTable();\n\n // Set default\n console.log('clicked prof button ' + values)\n\n let searchTerm = \"dr \" + profName + \" university of guelph\" + department;\n let Url = 'https://api.bing.microsoft.com/v7.0/images/search' + '?q=' + encodeURIComponent(searchTerm);\n\n console.log('hitting ' + Url)\n // make GET request to /key endpoint\n $.ajax({\n url: 'http://cis4250-06.socs.uoguelph.ca:443/key',\n type:\"GET\",\n success: function(result){\n $.ajax({\n url: Url,\n type: 'GET',\n beforeSend: function(xhrObj){\n // Request headers\n xhrObj.setRequestHeader(\"Ocp-Apim-Subscription-Key\",result);\n },\n success: function(data){ \n // let json = JSON.parse(data)\n if(data['value']) {\n console.log(`PROF IMAGE ${data['value'][0]['contentUrl']}`)\n let imageUrl = data['value'][0]['contentUrl'];\n $('#imageModalBody').html(\"<center><img src='\" + imageUrl + \"' width='600' style='border-radius:10px;'></center>\")\n $('#imageModal').modal('show')\n $('#imageModalTitle').html('Dr. ' + profName + ' at the University of Guelph') \n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n console.log(textStatus, errorThrown);\n }\n })\n },\n error:function(error){\n console.log(`ERR ${JSON.stringify(error)}`)\n }\n })\n })\n}", "title": "" }, { "docid": "67d8a2e9172181b310c21b9bb2ea88c2", "score": "0.5365677", "text": "addCourse(course) {\n this.courses[course.getID()] = course;\n }", "title": "" }, { "docid": "ae8b2fe43d78e2513a85f9e0e04b2787", "score": "0.5364002", "text": "createCoursework(COURSE_INFO = {\r\n \"assigneeMode\": \"ALL_STUDENTS\",\r\n \"associatedWithDeveloper\": true,\r\n \"description\": \"describe what your assignment is about here.\",// <<< UPDATE THIS\r\n \"maxPoints\": 40, // <<< UPDATE THIS\r\n \"state\": \"PUBLISHED\",\r\n \"submissionModificationMode\": \"SUBMISSION_MODIFICATION_MODE_UNSPECIFIED\",\r\n \"title\": \"Unit 2 - External Grade import\", // <<< UPDATE THIS\r\n \"workType\": \"ASSIGNMENT\"\r\n }) {\r\n var newCourse = Classroom.Courses.CourseWork.create(COURSE_INFO, this.courseId);\r\n return newCourse.id;\r\n }", "title": "" }, { "docid": "0539b0e5f5914a18de57ad567f790e9d", "score": "0.5349419", "text": "function Course(coursename, unique, profname, datetimearr, status, link, registerlink) {\n\tthis.coursename = coursename;\n\tthis.unique = unique;\n\tthis.profname = profname;\n\tthis.datetimearr = datetimearr;\n\tthis.status = status;\n\tthis.link = link;\n\tthis.registerlink = registerlink;\n}", "title": "" }, { "docid": "334c72901f3e1e8e4590055f7af7929a", "score": "0.533998", "text": "function courseCard(props){\n\n return(\n \n <div className='row card-content'>\n \n <div className='left col s12 m3 center-align left-pane-course'>\n <div className='row white-text center-align'>\n <div className='col s12'>\n <h3 className=' classDate'>{readDay(splitDate(props.course.startDate)[1])}</h3>\n </div>\n </div>\n <div className='row'>\n {/* <div className=\"col s6 classMonth white-text right-align flow-text\"><p>March</p></div> */}\n <div className=\"col s12 classMonth center-align white-text flow-text\"><p>{readMonth(splitDate(props.course.startDate)[0])} </p></div>\n {/* <div className=\"col s6 classYear white-text left-align flow-text\"><p> 1993</p></div> */}\n </div>\n\n <div className='row'>\n <div className='col s12 center-align white-text flow-text'><p>2019</p></div>\n </div>\n \n <div className='row'>\n <div className='col s12 white-text flow-text'><p>{props.course.startTime}</p></div>\n </div>\n \n </div>\n \n \n \n <div className='right col s12 m9'>\n <div className='softContainer'>\n <div className='row'>\n <div className='col s12'>\n <p className='right-text flow-text className'>{props.course.name}</p>\n </div> \n </div>\n\n <div className='row'>\n <div className='col s12'>\n <p className='flow-text classTimeLocation'>{props.course.location}</p>\n </div>\n\n <br/>\n <div className='col s12 m12 l12'>\n <p className='flow-text classEnd'><span className='classUntil'>To </span>{readDate(props.course.endDate)}</p>\n </div>\n </div>\n \n <div className='row'>\n {/* <div className='col s12'>\n <p className='flow-text'><span className='classUntil'>To</span> {props.course.endDate}</p>\n </div> */}\n </div>\n\n <div className='row'>\n <div className='col s12'>\n <p className='flow-text classStudents'>Students Enrolled: {props.course.students.length}</p>\n </div>\n\n <div className='col s12'>\n <p className='flow-text classRemaining'>Seats Remaining: {props.course.numberOfSeats - props.course.students.length}</p>\n </div>\n </div>\n <div className='row'>\n {/* <div className='col s12'>\n <p className='flow-text classRemaining'>Seats Remaining: {props.course.numberOfSeats - props.course.students.length}</p>\n </div> */}\n </div>\n \n </div>\n </div>\n \n \n </div>\n\n )\n}", "title": "" }, { "docid": "ad4fd023fd903add5eb3b3d1426e88a9", "score": "0.5336629", "text": "groupSlots() {\n\n // We keep a list of base colors to assign to courses. If there are more\n // courses than colors, we'll start from the beginning but change the color.\n const colors = [\n [241, 196, 15], [26, 188, 156], [52, 152, 219], [155, 89, 182],\n [243, 156, 18], [46, 204, 113], [231, 76, 60], [149, 165, 166],\n [52, 73, 94], [189, 195, 199]\n ];\n\n // Groups slots by day\n const coursesByDay = [[], [], [], [], [], [], []];\n this.props.courses.forEach((course, courseIndex) => {\n course.dayIndex.forEach((dayIndex) => {\n coursesByDay[dayIndex].push({\n dayIndex,\n courseName: course.name,\n timeIndex: course.timeIndex,\n color: getColorForCourse(courseIndex)\n });\n });\n });\n\n // Groups if overlapped\n return coursesByDay.map(groupOverlappingCourses)\n\n function getColorForCourse(courseIdx) {\n const color = colors[courseIdx % colors.length];\n if (courseIdx / colors.length >= 1) {\n color[0] = (color[0] + 43) % 256;\n color[1] = (color[1] + 43) % 256;\n color[2] = (color[2] + 43) % 256;\n }\n return [...color];\n }\n\n function groupOverlappingCourses(courses) {\n // Sorts courses by start time\n const sortedCourses = courses.sort((course1, course2) => {\n return course1.timeIndex[0] - course2.timeIndex[0];\n });\n\n // Puts overlapping courses into the same group\n const groups = [];\n let currentGroup = null;\n for (const course of sortedCourses) {\n if (!currentGroup || course.timeIndex[0] >= currentGroup.endTime) {\n currentGroup = {endTime: course.timeIndex[1], slots: [course]};\n groups.push(currentGroup);\n }\n else {\n currentGroup.slots.push(course);\n currentGroup.endTime = Math.max(currentGroup.endTime, course.timeIndex[1]);\n }\n }\n return groups;\n }\n }", "title": "" }, { "docid": "0c9aa47ae148a5b6bd32d328c909a306", "score": "0.5334688", "text": "function addCourseToTable() {\n\n\t\t// Run a batch operation against the Excel object model\n\t\tExcel.run(function (ctx) {\n\n\t\t\t// Create a proxy for the tables rows\n\t\t\tvar tableRows = ctx.workbook.tables.getItem('CoursesTable').rows;\n\n\t\t\t// Queue a command to add a new row at the end of the table for the course\n\t\t\ttableRows.add(null, [[$(\"#course-name option:selected\").text(), $(\"#course-id\").val(), $(\"#credit-type\").val(), $(\"#credits\").val(), $(\"input[type='radio']:checked\").val(), $(\"#semester\").val()]]);\n\n\t\t\t// Run the queued-up commands, and return a promise to indicate task completion\n\t\t\treturn ctx.sync();\n\t\t})\n\t\t.catch(function (error) {\n\t\t\t// Always be sure to catch any accumulated errors that bubble up from the Excel.run execution\n\t\t\tapp.showNotification(\"Error: \" + error);\n\t\t\tconsole.log(\"Error: \" + error);\n\t\t\tif (error instanceof OfficeExtension.Error) {\n\t\t\t\tconsole.log(\"Debug info: \" + JSON.stringify(error.debugInfo));\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "79e22baa141c23596b14b67717bb2584", "score": "0.53245395", "text": "createCourse(name, course) {\n return axios.post(`${JPA_API_URL}/users/${name}/courses/`, course);\n }", "title": "" }, { "docid": "89144a1d97c21cd188fde0e65e4a7b2f", "score": "0.5317411", "text": "get courses() {\n return {\n appetizers: this._courses.appetizers,\n mains: this._courses.mains,\n desserts: this._courses.desserts,\n };\n }", "title": "" }, { "docid": "5c3d1abe2c8c2d3091821d1e2ed0d837", "score": "0.5309731", "text": "render(){\n return(\n <div className=\"standard-content\">\n <div id=\"instructor-courses\" className=\"_Theme_outerBorder_Default_\">\n <contentTitle>\tCourses\t</contentTitle>\n\n <Link to=\"/addCourse\" className=\"pd-btn rounded-border\t btn-primary\">Add course</Link>\n\n <div className=\"_Theme_innerBorder_Default_\">\n <Bootstrap_InputGlyphicon glyphiconClassName=\"glyphicon-search\"\n typingFuncContext={this} />\n <hr className=\"_Theme_hr_Default_\"/>\n\n {this.state.courses}\n\n </div>\n </div>\n\n <div id=\"instructor-students\" className=\"_Theme_outerBorder_Default_\">\n <contentTitle>\tStudents\t</contentTitle>\n\n <button className=\"pd-btn rounded-border\t btn-primary\">Add student</button>\n\n <div className=\"_Theme_innerBorder_Default_\">\n <Bootstrap_InputGlyphicon glyphiconClassName=\"glyphicon-search\"\n typingFuncContext={this} />\n <hr className=\"_Theme_hr_Default_\"/>\n\n {this.state.students}\n\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "51390c470b46feeff8aef7a800d7d468", "score": "0.5308795", "text": "function addMajorCourse (userInput) {\n //reqMet is requirement(s) satisfied by course\n var reqMet = majorReq[userInput];\n //returns true if fails check so it enters if, false if it passes\n if (majorReqCheck(userInput, reqMet)) {\n addEnrich(userInput)\n return;\n }\n\n //checks if requirement met was a coen elective\n if (reqMet == 'coen elective'){\n //creates coen elective variable accounting for one of possible three\n var checkReqMet = reqMet + \" \" + count\n //checks current requirements met to adjust current coen elective count\n for(var i = 0; i<tableObj.reqSat.length;i++){\n \tcheckReqMet = reqMet + \" \" + count;\n //if coen elective found, count up\n \tif(tableObj.reqSat[i] == checkReqMet){\n \t\tcount++;\n \t}\n }\n\n //when coen elect greater than 3 it is added to enrichment\n if (count > 3){\n alert(\"coen electives already met, will be added to enrichment\");\n addEnrich(userInput);\n return;\n }\n\n //inputting user course and req satisfied into html\n reqMet = reqMet + \" \" + count;\n var tdElement = reqMet + \" (\" + userInput + \")\";\n //removes thick border if it still exsits\n $( \"td:contains('\" + reqMet + \"')\" ).removeClass();\n //adds X button functionality to corresponding table data element\n var button = '<button type=\"reset\" value=\"reset\" onclick=\"resetElectBox(\\''+tdElement+'\\')\">X</button>'\n //changes background color to green and injuects html\n $( \"td:contains('\" + reqMet + \"')\" ).css(\"background-color\", \"#adebad\");\n $( \"td:contains('\" + reqMet + \"')\" ).append(\" (\"+userInput+\") \"+button);\n //increments count to account for added coen elective\n count++;\n }\n else {\n //inputting user course and req satisfied into html\n var tdElement = reqMet + \" (\" + userInput + \")\"\n //removes thick border if it still exsits\n //filter function finds exact match of requirement met corresponding to course input\n $(\"td\").filter(function() {return $(this).text() === reqMet;}).removeClass();\n //adds X button functionality to corresponding table data element\n var button = '<button type=\"reset\" value=\"reset\" onclick=\"resetBox(\\''+tdElement+'\\')\">X</button>'\n //finds user input in html table data, changes color to green\n $(\"td\").filter(function() {return $(this).text() === reqMet;}).css(\"background-color\", \"#adebad\");\n //finds user input in html table data, appends the users class to the row\n $(\"td\").filter(function() {return $(this).text() === reqMet;}).append(\" (\"+userInput+\") \"+button);\n \n }\n // pushes requirement and course into major array and requirement array\n tableObj.reqSat.push(reqMet);\n tableObj.major.push(userInput);\n\n //console.log(tableObj.major + \" *post add coen classes\");\n // console.log(tableObj.reqSat + \" *req satisfied obj\");\n}", "title": "" }, { "docid": "4a3b084d74f76f8e518a9bf37857b904", "score": "0.52822995", "text": "function addCourse(course) {\n var div = document.createElement(\"div\");\n div.addEventListener(\"click\", courseClicked, false);\n div.id = course.code;\n div.setAttribute(\"class\", \"container\");\n\n addTextNode(course.title + \", \" + course.code, div);\n addTextNode(course.programme + \", \" + course.level, div);\n addTextNode(\"Semester: \" + course.semester, div);\n\n var btn = document.createElement(\"button\");\n btn.textContent = \"leave\";\n btn.addEventListener(\"click\", buttonClicked, false);\n btn.id = course.code;\n div.append(btn);\n\n document.getElementById(\"courses\").append(div);\n}", "title": "" }, { "docid": "b5f41fb65961e3367acc264ddb7bf6d7", "score": "0.5279265", "text": "function allCourses() {\n let rawData = JSON.parse(localStorage.getItem(\"filteredJson\")); // Raw course data\n let unfilteredProfessors = []; // Single array containing all professor names for the class\n let filteredProfessors = []; // Single array containing all the unique professor names for the class\n \n let professorClasses = []; // Double array [Professor's Name][All the sections they teach for the past semesters (as objects)]\n let sectionGPA = [];\n\n // Creates a list of professors \n for (let i = 0; i < rawData.length; i++) {\n unfilteredProfessors.push(rawData[i].professor);\n }\n\n // Creates a new array without professor name duplicates\n filteredProfessors = [...new Set(unfilteredProfessors)];\n\n // Fills the professorClasses double array with professor names\n for (let l = 0; l < filteredProfessors.length; l++) {\n sectionGPA.push([filteredProfessors[l]]);\n professorClasses.push([filteredProfessors[l]]);\n }\n\n // Grab section data (grades) for each professor for the past semesters, inject it into professorClasses as an object (if a prof has three objects in their name, it means they taught 3 sections)\n for (let k = 0; k < professorClasses.length; k++) {\n for (let j = 0; j < rawData.length; j++) {\n \n // Find match by professor's name\n if (professorClasses[k][0] === rawData[j].professor) {\n professorClasses[k].push(rawData[j]);\n\n }\n }\n }\n\n // Add new property to each for average GPA by semester\n for (let q = 0; q < professorClasses.length; q++) {\n \n points = 0; // Grade quantity multiplied by the GPA value\n totalGrades = 0; // Number of grade objects (students)\n\n // This for loop goes into each section per professor\n for (let insideSection = 1; insideSection < professorClasses[q].length; insideSection++) {\n currentSection = professorClasses[q][insideSection];\n\n points += \n (currentSection[\"A+\"] * 4.0) + (currentSection[\"A\"] * 4.0) + (currentSection[\"A-\"] * 3.7)\n + (currentSection[\"B+\"] * 3.3) + (currentSection[\"B\"] * 3.0) + (currentSection[\"B-\"] * 2.7)\n + (currentSection[\"C+\"] * 2.3) + (currentSection[\"C\"] * 2.0) + (currentSection[\"C-\"] * 1.7)\n + (currentSection[\"D+\"] * 1.3) + (currentSection[\"D\"] * 1.0) + (currentSection[\"D-\"] * 0.7)\n + (currentSection[\"F\"] * 0);\n \n totalGrades += \n (currentSection[\"A+\"]) + (currentSection[\"A\"]) + (currentSection[\"A-\"]) + \n (currentSection[\"B+\"]) + (currentSection[\"B\"]) + (currentSection[\"B-\"]) +\n (currentSection[\"C+\"]) + (currentSection[\"C\"]) + (currentSection[\"C-\"]) +\n (currentSection[\"D+\"]) + (currentSection[\"D\"]) + (currentSection[\"D-\"]) + \n (currentSection[\"F\"]);\n\n professorClasses[q][insideSection][\"GPA\"] = (points/totalGrades);\n }\n \n }\n\n return professorClasses;\n}", "title": "" }, { "docid": "191f3960485fe54b478a11b3c3adf800", "score": "0.52698755", "text": "function getPrograms(course)\r\n{\r\n\tif(!isEmpty(course))\r\n\t{\r\n\t\tvar URL=nlapiResolveURL('SUITELET', 'customscript_softype_ederp_coursesched', 'customdeploy_softype_ederp_coursesched');\r\n\t\tURL+='&action=getprograms&course='+course;\r\n\t\tif(method=='scratch')\r\n\t\t\tURL+='&term='+$(\"#listTerms\").val()+'&year='+$(\"#listAcadYr\").val();\r\n\t\telse\r\n\t\t\tURL+='&term='+$(\"#listTermsP\").val()+'&year='+$(\"#listAcadYrP\").val();\r\n\r\n\t\t$.ajax({\r\n\t\t\turl: URL,\r\n\t\t\tasync: false\r\n\t\t})\r\n\t\t.done(function( data ) {\r\n\t\t\tif(data.length != 0 )\r\n\t\t\t{\r\n\t\t\t\tvar text='';\r\n\t\t\t\tdata=data.split(',');\r\n\t\t\t\tfor(var i=0;i<data.length;i++)\r\n\t\t\t\t\ttext+='-'+ data[i] +'\\n';\r\n\t\t\t\tif(method=='scratch')\r\n\t\t\t\t\t$('#listPrograms').val(text);\r\n\t\t\t\telse\r\n\t\t\t\t\t$('#listProgramsH').val(text);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(method=='scratch')\r\n\t\t\t\t\t$('#listPrograms').val('--No approved section plans found--');\r\n\t\t\t\telse\r\n\t\t\t\t\t$('#listProgramsH').val('--No approved section plans found--');\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\r\n\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "8df2a055d4e6a2de3b1528c5b99ad086", "score": "0.5269465", "text": "function getCourses(data) {\n\n\tconst courses = data.find(d => d.id =='page-content').getElementsByClassName(\"courseblock\");\n\n\treturn courses;\n \n\n}", "title": "" }, { "docid": "b106839856e167648086f61f47d06781", "score": "0.5262369", "text": "function addCourseToSchedule(courseCodeIdx) {\n for (var i = 0; i < data[courseCodeIdx][\"time\"].length; i++) {\n var courseCode = data[courseCodeIdx][\"courseCode\"];\n var time = data[courseCodeIdx][\"time\"][i];\n var startTimeHour = data[courseCodeIdx][\"startTimeHour\"][i];\n var startTimeMinute = data[courseCodeIdx][\"startTimeMinute\"][i];\n var endTimeHour = data[courseCodeIdx][\"endTimeHour\"][i];\n var endTimeMinute = data[courseCodeIdx][\"endTimeMinute\"][i];\n var days = data[courseCodeIdx][\"days\"][i];\n\n if (days.length !== 1 && days.trim() !== \"Th\") {\n // For each day the course is taught\n for(var dayIdx = 0; dayIdx < days.length; dayIdx++) {\n var currHour = startTimeHour;\n var currMinute = startTimeMinute;\n\n // Morning class\n if (parseInt(startTimeHour) > 7 && parseInt(startTimeHour) < 12) {\n $('#s' + startTimeHour + startTimeMinute + 'AM-' + days[dayIdx]).addClass(\"schedule-highlighted\");\n $('#s' + startTimeHour + startTimeMinute + 'AM-' + days[dayIdx]).addClass(courseCode);\n // Afternoon or evening class\n } else {\n $('#s' + startTimeHour + startTimeMinute + 'PM-' + days[dayIdx]).addClass(\"schedule-highlighted\");\n $('#s' + startTimeHour + startTimeMinute + 'PM-' + days[dayIdx]).addClass(courseCode); \n }\n }\n } else {\n var currHour = startTimeHour;\n var currMinute = startTimeMinute;\n\n // Morning class\n if (parseInt(startTimeHour) > 7 && parseInt(startTimeHour) < 12) {\n $('#s' + startTimeHour + startTimeMinute + 'AM-' + days).addClass(\"schedule-highlighted\");\n $('#s' + startTimeHour + startTimeMinute + 'AM-' + days).addClass(courseCode);\n\n // Fill schedule depending on time of course\n while((parseInt(currHour) + 1 <= endTimeHour && parseInt(currMinute) + 30 !== parseInt(endTimeMinute) + 10) || (parseInt(currHour) + 2 <= endTimeHour && parseInt(currMinute) + 60 !== parseInt(endTimeMinute) + 10)) {\n if(parseInt(currMinute) === 30) {\n temp = parseInt(currHour) + 1;\n if(parseInt(temp) < 10) {\n temp = \"0\" + temp;\n }\n\n $('#s' + temp + '00AM-' + days).addClass(\"schedule-highlighted\");\n $('#s' + temp + '00AM-' + days).addClass(courseCode);\n currMinute = 0;\n\n } else {\n currHour++;\n if(parseInt(currHour) < 10) {\n currHour = \"0\" + currHour;\n }\n\n $('#s' + currHour + '30AM-' + days).addClass(\"schedule-highlighted\");\n $('#s' + currHour + '30AM-' + days).addClass(courseCode);\n currMinute = 30;\n }\n }\n // Afternoon or evening class\n } else {\n $('#s' + startTimeHour + startTimeMinute + 'PM-' + days).addClass(\"schedule-highlighted\");\n $('#s' + startTimeHour + startTimeMinute + 'PM-' + days).addClass(courseCode); \n }\n }\n }\n }", "title": "" }, { "docid": "10c22ac6aa59ca7d31d2089282e77782", "score": "0.52565515", "text": "function urp_fetch_coursetable(semester_id)\n{\n //console.log(\"urp_fetch_coursetable()\", semester_id);\n return new Promise( function (resolve, reject) {\n //Services.cookies.add(\"www.urp.fudan.edu.cn:92\", \"/eams\", \"semester.id\", semester_id, false, true, false, 0x7fffffff);\n $.get(\"http://www.urp.fudan.edu.cn:92/eams/courseTableForStd!index.action\").done( function (data) {\n //console.log(\"courseTableForStd!index.action\", data);\n // grep ids\n var ids_data = data.match(/bg\\.form\\.addInput\\(form,\"ids\",\"(\\d+)\"\\);/);\n if (!ids_data || !ids_data[1]) { reject(\"parse error: can't find ids\"); return; }\n var ids = ids_data[1];\n $.post(\"http://www.urp.fudan.edu.cn:92/eams/courseTableForStd!courseTable.action\", {\n \"ignoreHead\": \"1\",\n \"setting.kind\": \"std\",\n \"startWeek\": \"1\",\n \"semester.id\": semester_id,\n \"ids\": ids,\n }, null, \"text\").done( function (data, textStatus, jqXHR) {\n //console.log(\"courseTableForStd!courseTable.action\", data);\n // begin parse data\n\n // find range and trim\n var st = data.indexOf(\"// function CourseTable in TaskActivity.js\");\n if (st < 0) { reject(\"parse error: [// function CourseTable in TaskActivity.js] not found\"); return; }\n var ed = data.indexOf(\"</script>\", st);\n if (ed < 0) { reject(\"parse error: [</script>] not found\"); return; }\n data = data.substring(st, ed);\n\n // split each class into array (cstrlist = course string list)\n var cstrlist = data.split(\"new TaskActivity\");\n\n var clist = new Array();\n cstrlist.forEach( function (element, index, array) {\n if (index == 0) return; // drop first element (it's trash)\n var p = element.indexOf(\"\\n\");\n if (p < 0) { reject(\"parse error: [\\\\n] not found\"); return; }\n \n // split course data\n var cdatajsonstr = \"[\" + element.substring(0, p).match(/\\((.*)\\)/)[1] + \"]\"; // get data in '(' and ')'\n var cdatajson = $.parseJSON(cdatajsonstr);\n\n var cid = cdatajson[2].match(/\\((.*)\\)/)[1];\n var cname = cdatajson[3].replace(\"(\" + cid + \")\", \"\");\n var cclassroom = cdatajson[5];\n var cteacher = cdatajson[1];\n var cavlweek = cdatajson[6];\n\n // split course time\n var ctime = element.substring(p + 1) // fetch the remaining string\n .match(/(index =\\d+\\*unitCount\\+\\d+;)/g) // match all string like \"index =3*unitCount+7;\"\n .map(function (str) { return str.match(/(\\d+)/g); }) // parse string to array, like [\"3\", \"7\"]\n .map(function (tup) { return tup.map(function (x) { return parseInt(x) + 1; }); }); // convert to int and add one, like [4, 8]\n\n // append to array \n clist.push({\n cid: cid,\n cname: cname,\n cclassroom: cclassroom,\n cteacher: cteacher,\n cavlweek: cavlweek,\n ctime: ctime,\n });\n });\n\n //console.log(clist);\n resolve(clist);\n \n }).fail( function (xhr, textStatus, errorThrown) {\n reject(\"courseTableForStd!courseTable.action failed: \" + textStatus + \", \" + errorThrown);\n });\n }).fail( function (xhr, textStatus, errorThrown) {\n reject(\"courseTableForStd!index.action failed: \" + textStatus + \", \" + errorThrown);\n });\n });\n}", "title": "" }, { "docid": "97f3f877b8eaac04efd138887dd41096", "score": "0.5249091", "text": "function populateCourseSelect() {\n \n return courseService.getCourses(10000, 0).then(function(data) {\n $scope.courses = courseService.courseList;\n $scope.totalItems = courseService.totalItems;\n $scope.selectedCourse = \"0\"; \n });\n\n\n }", "title": "" }, { "docid": "e9511b3ddbb347328785371a403fa1de", "score": "0.5247532", "text": "function populateCourseDetails() {\n var classroomSS = SpreadsheetApp.getActiveSpreadsheet();\n try{\n var courses = getAllCourses();\n \n if (courses && courses.length > 0) {\n for (i = 0; i < courses.length; i++) {\n var course = courses[i];\n var courseSheet = createSheet(classroomSS, course.name);\n var courseWork = getAllCourseWork(course.id);\n populateCourseWorkList(course.id, courseWork, courseSheet);\n populateStudentGradeList(course.id, courseWork, courseSheet);\n }\n } else {\n return 'No courses found.';\n }\n }\n catch (err) {\n Logger.log(err);\n return \"An error has occured while trying to get courses.\";\n }\n return \"Success.\"\n}", "title": "" }, { "docid": "a4d4ffa4f14f06556853f9ba7d05c18e", "score": "0.5245333", "text": "function coursesLoaded(courses)\n{\n $(\"#courses\").html(renderTemplate(\"course-template\",{courses:courses}));\n courses.forEach(function(course)\n {\n $(\"#course\"+course.id).click(handleCourse(course));\n });\n}", "title": "" }, { "docid": "42af598a8773cbfdc884f638330550fd", "score": "0.52406365", "text": "update(courses){\n\t\tfunction isObl(c){\n\t if(DaViSettings.userSection === \"IN\")\n\t return c.mandatory_I\n\t return c.mandatory_C\n\t }\n\t\tlet totalCreditCount = 0\n\t\tlet mandCreditCount = 0\n\t\tlet hoursSum = 0\n\t\tlet slotDict = {};\n\t\tlet speCreds = {};\n\t\tfor(let course of courses){\n\t\t\tlet courseinfo = ISA_data[course]\n\t\t\ttotalCreditCount += courseinfo.credits;\n\t\t\tif(isObl(courseinfo)){\n\t\t\t\tmandCreditCount+=courseinfo.credits;\n\t\t\t}\n\t\t\tfor(let slot of courseinfo.timeslots){\n\t\t\t\tslotDict[slot.day+\"_\"+slot.time] = true;\n\t\t\t}\n\t\t\thoursSum = dictLen(slotDict)\n\t\t\tlet speAllSec = courseinfo.specialisations\n\t\t\tfor(let spe of speAllSec[DaViSettings.userSection]){\n\t\t\t\tif(!speCreds[spe])\n\t\t\t\t\tspeCreds[spe] = 0;\n\t\t\t\tspeCreds[spe] += courseinfo.credits;\n\t\t\t}\n\t\t}\n\t\tlet credSumColor =\"black\"\n\t\tif(totalCreditCount>=35)\n\t\t\tcredSumColor = \"#FD7C04\"\n\t\td3.select(\"#creditsSum\").transition()\n\t\t\t.duration(DaViSettings.shortNoticeableDelay)\n\t\t\t.ease(d3.easeQuad)\n\t\t\t.tween(\"text\", function() {\n\t var that = d3.select(this),\n\t i = d3.interpolateNumber(that.text(), totalCreditCount);\n\t return function(t) { that.text(Math.round(i(t))); };\n\t })\n\t\t\t.style(\"color\",credSumColor)\n\n\t\td3.select(\"#mandCreditsSum\").transition()\n\t\t\t.duration(DaViSettings.shortNoticeableDelay)\n\t\t\t.ease(d3.easeQuad)\n\t\t\t.tween(\"text\", function() {\n\t var that = d3.select(this),\n\t i = d3.interpolateNumber(that.text(), mandCreditCount);\n\t return function(t) { that.text(Math.round(i(t))); };\n\t })\n\t\td3.select(\"#workloadSum\").transition()\n\t\t\t.duration(DaViSettings.shortNoticeableDelay)\n\t\t\t.ease(d3.easeQuad)\n\t\t\t.tween(\"text\", function() {\n\t var that = d3.select(this)\n\t let spl = that.text().split(\"+\")\n\t let i1 = d3.interpolateNumber(spl[0], hoursSum)\n\t let i2 = d3.interpolateNumber(spl[1], totalCreditCount*2-hoursSum);\n\t return function(t) { that.text(Math.round(i1(t))+\"+\"+ Math.round(i2(t))); };\n\t })\n\t\tthis.updateSpe(speCreds)\n\t\t//this.updateStar()\n\t}", "title": "" }, { "docid": "5f10e98d173df8826b1577d5ea52cbb0", "score": "0.5238682", "text": "function populate_courses(response) {\n\t\tresponse.forEach((course,i) => {\n\t\t\tlet element = document.createElement(\"Option\");\n\t\t\telement.value = course;\n\t\t\telement.innerText = course;\n\t\t\tif(i === 0) {\n\t\t\t\telement.checked = true;\n\t\t\t}\n\t\t\tdocument.getElementById(\"course-list\").appendChild(element);\n\t\t});\n\n\t\tdocument.getElementById(\"compute-button\").classList.remove(\"invisible\");\n\t\tdocument.getElementById(\"compute-button\").addEventListener(\"click\", compute_schedule);\n\t}", "title": "" }, { "docid": "0f96fbb96ac986b93db93676a6290646", "score": "0.52349705", "text": "function selectACourse() {\n // get the course the user select\n userChosenCourse = document.getElementById(\"courseInputField\").value;\n let index = courseList.indexOf(userChosenCourse);\n selectedCourse = POSSIBLE_COURSES[index];\n getUnitData();\n}", "title": "" }, { "docid": "312a09a14d622058e177bb1b2372cfca", "score": "0.52347195", "text": "async function processCourse(courseId, termsConfig, studentEmail, enrollmentsStore, restoredAccessEnrollmentsStore, courses, iSupeCourses) {\n\n // If this is the first time we're handling this course, we need to query\n // Canvas about it & save the data.\n if (!enrollmentsStore[courseId]) {\n // console.log('query restored access iSupervision course', courseId);\n\n enrollmentsStore[courseId] = await getCourseEnrollments(courseId);\n await loadCourseAssignmentsPromise(courseId);\n\n restoredAccessEnrollmentsStore[courseId] = []\n\n // Accumulate list of all restored access iSupervision courses.\n // We should stash the same structure for iSupervision courses as cacheISupeCourseList.js.\n const course = courses.find( e => e.id === courseId);\n if (course) {\n iSupeCourses.push({\n id: course.id,\n sis_course_id: course.sis_course_id\n });\n }\n } // end if we need to query Canvas for course data.\n\n let enrollments = enrollmentsStore[courseId];\n\n // Get the student's section, so we can get the faculty enrollments for that section\n const studentEnrollment = enrollments.find( e => e.user.login_id === studentEmail);\n\n // If we didn't find the student's enrollment in the Canvas course, skip the CAM record\n if (!studentEnrollment) return;\n\n // 12.18.2019 tps Try to figure out the student's corresponding modules course by\n // checking all their enrollments & seeing if one matches one of the semester's\n // term courses.\n // console.log('find corresponding modules term for restored access isupervision course for', studentEnrollment.user.login_id, studentEnrollment.user.id);\n const enrollmentsForStudent = await getUserEnrollments(studentEnrollment.user_id);\n const courseIdsForStudent = enrollmentsForStudent.map( e => e.course_id);\n const matchingModulesTerm = termsConfig.find( e => courseIdsForStudent.includes(e.course_id));\n // if (matchingModulesTerm) {\n // console.log('Found matching term', matchingModulesTerm.name, matchingModulesTerm.course_id,'for', studentEnrollment.user.login_id);\n // studentEnrollment.modules_term_course_id = matchingModulesTerm.course_id;\n // } else {\n // console.log('Found no matching term for', studentEnrollment.user.login_id);\n // }\n studentEnrollment.modules_term_course_id = matchingModulesTerm ? matchingModulesTerm.course_id : null;\n\n // Save the student's course enrollment\n restoredAccessEnrollmentsStore[courseId].push(studentEnrollment);\n\n // We're also interested in saving the faculty enrollments for this section.\n // If there's more than 1 student in a restored access section, don't\n // collect the teacher enrollments again.\n\n const teacherEnrollments = enrollments.filter( e => {\n return FACULTY_TYPES.includes(e.type) && e.course_section_id === studentEnrollment.course_section_id;\n });\n for (let teacherEnrollment of teacherEnrollments) {\n if (!restoredAccessEnrollmentsStore[courseId].find( e => e.id === teacherEnrollment.id)) {\n restoredAccessEnrollmentsStore[courseId].push(teacherEnrollment);\n }\n } // end loop through section's teacher enrollments\n} // end function", "title": "" }, { "docid": "df9a5aa950145bcbc8472f82b7e815cf", "score": "0.52255017", "text": "programCourses(req, res) {\n var program = req.body.program;\n pool.query(\"SELECT id, host_program, host_course_name, host_course_number, gu_course_name, gu_course_number, signature_needed, core\" +\n \" FROM course_equivalencies WHERE host_program = ? ORDER BY gu_course_number ASC\", [program],\n function(queryError, queryResult) {\n if(queryError) {\n res.send(queryError);\n } else {\n res.send(queryResult);\n }\n });\n }", "title": "" }, { "docid": "b32fef154f4ee97bcce89852c018bc24", "score": "0.52240247", "text": "createCourseworkMaterial(COURSE_INFO = {\r\n \"assigneeMode\": \"ALL_STUDENTS\",\r\n \"description\": \"describe what your assignment is about here.\",// <<< UPDATE THIS\r\n \"state\": \"PUBLISHED\",\r\n \"title\": \"insert title\" // <<< UPDATE THIS\r\n }){\r\n var newCourseMaterial = Classroom.Courses.CourseWorkMaterials.create(COURSE_INFO, this.courseId);\r\n return newCourseMaterial.id;\r\n }", "title": "" }, { "docid": "6e2d60826406feef3c04f35b8c4235bc", "score": "0.5214868", "text": "function generate_individual_tables(courses) {\n\t\tdocument.getElementById(\"merged-table-space\").classList.add(\"invisible\");\n\t\tdocument.getElementById(\"clashed-course-space\").classList.remove(\"invisible\");\n\t\tdocument.getElementById(\"table-container\").innerHTML = \"\";\n\t\tcourses.forEach((course, i) => {\n\t\t\tlet heading = document.createElement(\"h3\");\n\t\t\theading.innerText = \"Course Schedule for Course: \" + course['course_number'];\n\n\t\t\tlet table = document.createElement(\"table\");\n\n\t\t\tdocument.getElementById(\"table-container\").appendChild(heading);\n\t\t\tdocument.getElementById(\"table-container\").appendChild(table);\n\n\t\t\tlet counter = MIN_START_TIME;\n\n\t\t\tlet row = document.createElement(\"tr\");\n\n\t\t\tlet data = document.createElement(\"th\");\n\t\t\tdata.innerText = \"\";\n\t\t\trow.appendChild(data);\n\n\t\t\twhile(counter < MAX_END_TIME) {\n\t\t\t\tlet data = document.createElement(\"th\");\n\t\t\t\tdata.innerText = counter++ + \":00 - \" + counter + \":00\";\n\t\t\t\trow.appendChild(data);\n\t\t\t}\n\t\t\ttable.appendChild(row);\n\n\t\t\tlet timings = course['timings'];\n\t\t\tfor(let j = 0; j < DAYS_OF_WEEK.length; j++) {\n\t\t\t\tlet day_of_week = DAYS_OF_WEEK[j];\n\t\t\t\tlet all_hours_covered_in_day = [];\n\t\t\t\tif(day_of_week in timings) {\n\t\t\t\t\tlet all_timings_for_day_of_week = timings[day_of_week];\n\t\t\t\t\tall_timings_for_day_of_week.forEach((individual_time, k) => {\n\n\t\t\t\t\t\tlet start = individual_time['start'];\n\t\t\t\t\t\tlet end = individual_time['end'];\n\t\t\t\t\t\tlet start_hour = get_starting_hour_from_time(start);\n\t\t\t\t\t\tlet time_counter = start_hour;\n\n\t\t\t\t\t\twhile(true) {\n\t\t\t\t\t\t\tlet current_time = '01/01/2011 ' + time_counter + \":00:00\";\n\t\t\t\t\t\t\tlet end_time = '01/01/2011 ' + end + \":00:00\";\n\t\t\t\t\t\t\tif(Date.parse(current_time) > Date.parse(end_time)) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tall_hours_covered_in_day.push(time_counter);\n\t\t\t\t\t\t\ttime_counter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\trow = document.createElement(\"tr\");\n\n\t\t\t\tlet day = document.createElement(\"td\");\n\t\t\t\tday.innerText = day_of_week;\n\t\t\t\trow.appendChild(day);\n\n\t\t\t\tcounter = MIN_START_TIME;\n\t\t\t\twhile(counter < MAX_END_TIME) {\n\t\t\t\t\tlet data_value = document.createElement(\"td\");\n\n\t\t\t\t\tif(all_hours_covered_in_day.includes(counter)) {\n\t\t\t\t\t\tdata_value.innerText = course['course_number'];\n\t\t\t\t\t\tdata_value.classList.add(CLASS_DESIGNATION_MAP[course['course_number']]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdata_value.classList.add(\"grey\");\n\t\t\t\t\t\tdata_value.innerText = 'X';\n\t\t\t\t\t}\n\t\t\t\t\tcounter++;\n\n\t\t\t\t\trow.appendChild(data_value);\n\t\t\t\t}\n\t\t\t\ttable.appendChild(row);\n\t\t\t}\n\n\n\t\t\ttable.classList.add(\"clashed-table\");\n\t\t})\n\t}", "title": "" }, { "docid": "38107f56ce47dcc11645f1846373f583", "score": "0.52036464", "text": "function buildCourse1(){ //alert(\"buildCourse1()\");\n \n //locate the drone and parcel at the start of the course\n droneHomeX = 5;\n droneHomeY = 145;\n parcelHomeX = 130;\n parcelHomeY = 105;\n\n //add game neutral objects\n buildBackground(\"sky1\");\n buildWall(0,150,170,15,\"black\"); //starting platform drone and parcel\n buildWall(275,0,10,400,\"black\");\n buildWall(425,250,10,265,\"black\");\n buildWall(425,250,300,10,\"black\");\n buildWall(700,500,100,10,\"black\");\n buildWall(435,500,150,15,\"black\"); //drop zone platform\n buildDropZone2(434, 350, 150,150, \"blue\");\n \n //add game hazards\n buildOcean(10,10,15,0,20);\n \n //add movable objects\n buildBird(350, 175, 700, 1);\n buildBird(25, 450, 350, 1.5);\n \n //add actors\n buildDrone();\n buildContainer(); //drone before container for proper container bounds\n buildParcel();\n\n //stores the amount of time given to complete the course\n startTime = COURSE_1_TIME; //set start time//starting positions per course\n \n stage.update();\n}", "title": "" }, { "docid": "2bf565ef75838dec3d2893cbebfafd6f", "score": "0.5198619", "text": "function initCourse(id, name, completed, baseModule) {\n this.type = 'course';\n this.id = id;\n this.name = name;\n this.completed = completed;\n this.baseModule = baseModule;\n\n}", "title": "" }, { "docid": "f797052963eac9ecd204d797b7b4baf6", "score": "0.51922303", "text": "function selectCourse(index){\n // show user error and success messages\n $scope.error = null;\n $scope.message = null;\n\n $scope.selectedCourseIndex = index;\n\n $scope.Course = {\n date : $scope.courses[index]._id,\n name : $scope.courses[index].name,\n professor: $scope.schedules[index].professor\n };\n\n }", "title": "" }, { "docid": "0120fb9d6a9c17907beb97dab8f9fefa", "score": "0.5179385", "text": "function createCourse(name, price, expense, enrollment) {\n // Create a json \"course\" with keys \"name\", \"price\", \"expense\", \"enrollment\".\n // Assign the values from parameters.\n let course = {\n \"name\": name,\n \"price\": price,\n \"expense\": expense,\n \"enrollment\": enrollment\n };\n return course; // this function will return the json when its called\n}", "title": "" }, { "docid": "edb7e6f819febea4dc2ba5be716a0f28", "score": "0.5163325", "text": "function add_sems(num_of_sems, year, year_number, num_of_units_per_sem)\r\n{\r\n const span = document.createElement(\"td\");\r\n span.setAttribute(\"colspan\", 7);\r\n year.appendChild(span);\r\n\r\n const table = document.createElement(\"table\");\r\n table.classList.add('table', 'table-borderless', 'planner-table-year');\r\n span.appendChild(table);\r\n\r\n const tbody = document.createElement(\"tbody\");\r\n table.appendChild(tbody);\r\n\r\n for (let i = 1; i <= num_of_sems; i++)\r\n {\r\n const sem = document.createElement(\"tr\");\r\n tbody.append(sem);\r\n\r\n const sem_col = document.createElement(\"td\");\r\n sem_col.classList.add('semester-column')\r\n sem.append(sem_col);\r\n\r\n const sem_div = document.createElement(\"div\");\r\n sem_div.classList.add('semester-text');\r\n sem_col.append(sem_div);\r\n \r\n const sem_text = document.createElement(\"h3\");\r\n const text = document.createTextNode(\"Sem \" + i);\r\n sem_text.appendChild(text);\r\n sem_div.append(sem_text);\r\n \r\n // Add units\r\n add_units(num_of_units_per_sem, sem, year_number, i);\r\n }\r\n}", "title": "" }, { "docid": "c2f99350458e40b9a36c121627ebe907", "score": "0.5161481", "text": "function createRandomCourses(){\n var coursesToAdd = [];\n for (var i = 0; i < 10; i ++){\n coursesToAdd.push({courseName: randomString(), courseSubject: randomSubject(), courseCode: randomString()})\n }\n CoursesService.Create(coursesToAdd).then(function(response){\n if(response.status === 'success'){\n FlashService.Success('Success');\n }else {\n FlashService.Error(response.message);\n }\n });\n }", "title": "" }, { "docid": "ec768fdc4cf85d0b21e4eac39896a1ee", "score": "0.515322", "text": "function getCourseList(students) {\n // get a unique array of courses\n var courses = students.reduce((accum, student) => {\n if (!accum.includes(student.D2L_COURSE_TITLE))\n accum.push(student.D2L_COURSE_TITLE);\n\n return accum;\n }, []);\n\n // Loop magic to create course objects that contain student data\n var tempObj,\n finalList = courses.map(course => {\n tempObj = {\n name: course,\n students: []\n };\n // get each student matched to the current course\n students.forEach(student => {\n if (student.D2L_COURSE_TITLE == course) {\n tempObj.students.push({\n name: `${student.LAST_NAME}, ${student.FIRST_NAME}`,\n phone: student.PRIMARY_PHONE,\n email: student.EMAIL\n });\n }\n });\n return tempObj;\n });\n\n var unusedStudents = students.filter(student => !courses.includes(student.D2L_COURSE_TITLE));\n if (unusedStudents.length > 0) console.log(chalk.yellow('Students without courses found'));\n\n formatStudents(finalList);\n }", "title": "" }, { "docid": "8735c122417b51b300a636d680db03f9", "score": "0.51521385", "text": "index(req, res, next) {\n Course.find({})\n .then((courses) => {\n res.render('home', {\n courses: multipleMongooseToObject(courses),\n });\n })\n .catch(next);\n }", "title": "" }, { "docid": "f91baf27b782b2b2e048a7d0ce7fdb1a", "score": "0.5148154", "text": "getCourses() {\n return this.courses;\n }", "title": "" }, { "docid": "64dd372bb86df218bddb07f0b388436f", "score": "0.51371306", "text": "function fillCourses(data) {\n let table = $(\"<table>\").addClass(\"course-list\");\n let headerRow = $(\"<tr>\").append(\n $(\"<th>\").text(\"Course name:\"),\n $(\"<th>\").text(\"Ranking:\"),\n $(\"<th>\").text(\"Experience\")\n );\n table.append(headerRow);\n data.courses.sort(sortByRanking);\n for (item in data.courses) {\n let insideRow = $(\"<tr>\").append(\n $(\"<td>\").text(data.courses[item].code),\n $(\"<td>\").text(data.courses[item].rank),\n $(\"<td>\").text(data.courses[item].experience)\n );\n table.append(insideRow);\n }\n table.insertAfter($(\"#applicants\"));\n}", "title": "" }, { "docid": "42fe4dda45f56f9ecfb4a2d319177f46", "score": "0.513376", "text": "function CourseTable(course) {\n\tvar parentDiv = $('<div draggable=\"true\" onclick=\"selectCard(this)\" ondragstart=\"drag(event)\" ondragover=\"cardDragOver(this)\" ondragleave=\"cardDragLeave(this)\"></div>');\n\t\tparentDiv.attr(\"catalognumber\", course.CatalogNumber);\n\t\tparentDiv.addClass(\"course-card flex row static std-margin unselectable\");\n\tvar col1 = $('<div class=\"card-col-1\"></div>')\n\t\t.append(newRowDiv(course.Title))\n\t\t.append(newRowDiv(course.Location))\n\t\t.append(newRowDiv(\"Credits: \" + course.NumCredits));\n\tvar col2 = $('<div class=\"card-col-2\"></div>')\n\t\t.append(newRowDiv(course.Instructors))\n\t\t.append(newRowDiv(course.Subject))\n\t\t.append(newRowDiv(course.CatalogNumber).addClass(\"CourseNumber\"));\n\tparentDiv.append(col1).append(col2);\n\tparentDiv.get(0).addEventListener('contextmenu', function(e){\n\t\tshowCourseInformation(e.currentTarget.getAttribute(\"catalognumber\"));\n\t\te.preventDefault();\n\t});\n\treturn parentDiv;\n}", "title": "" }, { "docid": "2ae28b83274181fd6b349c7fba495858", "score": "0.5132708", "text": "function Courses(props) {\n const context = useContext(Context);\n const [canFetch, setCanFetch] = useState(true); //setup state to track/allow fetching of courses data\n const [courses, setCourses] = useState([]);\n\n useEffect(() => {\n const getCourses = async () => {\n //Get courses using data with context\n await context.data.getCourses()\n .then( response => { //check for response\n if(response.courses.length > 0) { //ensure there are existing courses\n setCourses(response.courses) //add response data to courses state\n } else {\n <Redirect to=\"/notfound\" /> //if no course data exists, send to /notfound route\n }\n\n })\n .catch(error => {\n console.log('Error fetching and parsing data from database ', error);\n <Redirect to=\"/error\" /> //forward to UnhandledError route\n });\n }\n //check if getCourses can load\n if(canFetch){\n getCourses();\n setCanFetch(false);\n }\n }, [canFetch, courses, context.data]);\n\n return (\n <div className=\"wrap main--grid\">\n { courses.length > 0 ?\n courses.map(course =>\n <Link className=\"course--module course--link\" to={`/courses/${course.id}`} key={course.id}>\n <h2 className=\"course--label\">Course</h2>\n <h3 className=\"course--title\">{course.title}</h3>\n </Link>\n ) : <h2>Loading...</h2> }\n <Link className=\"course--module course--add--module\" to=\"/courses/create\">\n <span className=\"course--add--title\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 13 13\" className=\"add\"><polygon points=\"7,6 7,0 6,0 6,6 0,6 0,7 6,7 6,13 7,13 7,7 13,7 13,6 \"></polygon></svg>\n New Course\n </span>\n </Link>\n </div>\n );\n}", "title": "" }, { "docid": "cf6f329d3b5b35540be4f483e637f610", "score": "0.51324373", "text": "function CartCourse(course) {\n this.course = course;\n}", "title": "" }, { "docid": "d272b993b5ffa6997d6d5b2d50f5bdbf", "score": "0.5112486", "text": "function updateAllCourses(courses) {\n\t// Go on each course\n\tupdateAllCoursesHelper(courses, 0);\n}", "title": "" }, { "docid": "84d0736ac8ca4abc801cadeed21c844a", "score": "0.5111604", "text": "function getCourses() {\n\t\tUtil.showPage('course-list');\n\t\t\n\t\tUtil.callout(endpoint).then(courses => {\n\t\t\tconst tableRows = [];\n\t\t\t\n\t\t\tconst listItems = courses.map(course => {\n\t\t\t\tconst tr = document.createElement('tr');\n\t\t\t\tconst td = document.createElement('td');\n\t\t\t\ttd.innerHTML = '<a href=\"index.html?courseId=' + Util.escapeOutput(course.Id) + '\">' + Util.escapeOutput(course.Name) + '</a>';\n\t\t\t\ttr.appendChild(td);\n\t\t\t\ttableRows.push(tr);\n\t\t\t});\n\t\t\t\n\t\t\tUtil.setTableRows('courses-table', tableRows);\n\t\t});\n\t}", "title": "" }, { "docid": "8aefa9cd85666b6778a014d722fffe93", "score": "0.5110629", "text": "async function registerCourse(req){\n let username = req.user.sub;\n let student = await User.findOne({\"_id\": username});\n //Check if the user is a student\n if (student.role.toString() === \"Guest\"){\n throw \"Guests cannot register for classes\";\n }\n let studentCourses = student.courses;\n studentCourses.push(req.body._id);\n await User.updateOne({\"_id\": username}, {$push: {\"courses\": req.body._id}});\n}", "title": "" }, { "docid": "386bb94695cef2a606c59441c36e9cb2", "score": "0.5110119", "text": "function getCourses(res, mysql, context, complete){\r\n mysql.pool.query(\"SELECT course_id, title FROM md_course\", function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n context.course3 = results;\r\n complete();\r\n });\r\n }", "title": "" }, { "docid": "94a56ff7db7a0f9e4de11ffbe1c17016", "score": "0.5108746", "text": "renderCourse(course) {\n\t\tconst courseInfo = (\n\t\t\t<li key={course.slugName}>{course.name}</li>\n\t\t);\n\t\treturn courseInfo;\n\t}", "title": "" }, { "docid": "e9850a94c444a5978ac297583189033a", "score": "0.50990623", "text": "render() {\n return (\n <div>\n <CourseHeader addCourse={this.props.addCourse}/>\n <table className=\"table\">\n <thead>\n <tr>\n <th className=\"jo-title-col h4\">Title</th>\n <th className=\"jo-quizzes-col h4\">\n Quizzes\n </th>\n <th className=\"jo-owner-col\n d-none\n d-sm-table-cell h4\">Owner</th>\n <th className=\"jo-modified-col\n d-none\n d-lg-table-cell h4\">\n Last Modified By\n </th>\n <th className=\"jo-icons-col\">\n <div className=\"text-nowrap float-right\">\n <i className=\"fas fa-folder fa-2x jo-header-icon-padding\"></i>\n <i className=\"fas fa-sort-alpha-up fa-2x jo-header-icon-padding\"></i>\n <Link to=\"/courses/display/grid\">\n <i className=\"fas fa-th fa-2x jo-header-icon-padding\"></i>\n </Link>\n </div>\n </th>\n </tr>\n </thead>\n <tbody>\n {\n // Use map to dynamically create the course rows\n this.props.courses.map((course, ndx) =>\n <CourseRow\n // Give the row access to the delete and update functions\n deleteCourse = {this.props.deleteCourse}\n updateCourse={this.props.updateCourse}\n // Pass the course to the row\n course = {course}\n // Give each row a unique identifier\n key = {ndx}\n title = {course.title}\n owner = {course.owner}\n lastModified = {course.lastModified}\n />)\n }\n </tbody>\n </table>\n </div>\n )\n }", "title": "" }, { "docid": "36b8e0ab65776d225c69c0357f730e44", "score": "0.5096838", "text": "addNewSection() {\n const prevSchedule = this.props.currentSchedule.slice();\n const titles = prevSchedule.map(e => ClassUtils.formatSectionNum(e));\n for (let Class of this.props.classData) {\n const classTitle = ClassUtils.formatClassTitle(Class.title);\n if (!titles.includes(classTitle)) {\n for (let section of Class.sections) {\n prevSchedule.push(section.sectionNum);\n break;\n }\n }\n }\n this.props.setCurrentSchedule(prevSchedule);\n }", "title": "" }, { "docid": "32a6d35a16a2e2c67fe0fdcf47ca6529", "score": "0.50955474", "text": "function CoursePage(props) {\n\n\tconsole.log(props)\n\n\treturn (\n\n\t\t<div style={{ height: '100%' }}>\n\t\t\t{props.userData.type && props.userData.type.msg.status === 2 && (\n\t\t\t\t<CourseItem courseData={props.courseData} userData={props.userData} dispatch={props.dispatch} ></CourseItem>\n\t\t\t)}\n\t\t\t{props.userData.type && props.userData.type.msg.status === 1 && (\n\t\t\t\t<CourseItemStu myCourse={props.myCourse} courseData={props.courseData} userData={props.userData} dispatch={props.dispatch} ></CourseItemStu>\n\t\t\t)}\n\t\t\t{!props.userData.type &&\n\t\t\t\t<Empty />\n\t\t\t}\n\t\t</div>\n\n\t)\n\n}", "title": "" }, { "docid": "1e5ef39d256cf3874be05b0765f7af28", "score": "0.5092605", "text": "function getCourses()\r\n{\r\n\tvar URL=nlapiResolveURL('SUITELET', 'customscript_softype_ederp_coursesched', 'customdeploy_softype_ederp_coursesched');\r\n\tURL+=\"&action=getcourses\";\r\n\tif(arguments.length==1)\r\n\t\tURL+='&term='+arguments[0];\r\n\r\n\t$.ajax({\r\n\t\turl: URL,\r\n\t\tasync: false\r\n\t})\r\n\t.done(function( data ) {\r\n\t\tif(data.length != 0 )\r\n\t\t{\r\n\t\t\tdata=data.split(',');\r\n\t\t\tvar jsonArr = [];\r\n\r\n\t\t\tfor (var i = 0; i < data.length; i++) {\r\n\t\t\t\tvar temp=data[i].split(':');\r\n\t\t\t\tjsonArr.push({value:temp[0],data:temp[1]});\r\n\t\t\t\tif($('#autocomplete').val()!='' && $('#autocomplete').val()==temp[0])\r\n\t\t\t\t{\r\n\t\t\t\t\tselectedCourseId=temp[1];\r\n\t\t\t\t}\r\n\t\t\t\telse if($('#autocompleteH').val()!='' && $('#autocompleteH').val()==temp[0])\r\n\t\t\t\t{\r\n\t\t\t\t\tselectedCourseId=temp[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Initialize autocomplete with local lookup:\r\n\t\t\t$('#autocompleteH').autocomplete({\r\n\t\t\t\tlookup:jsonArr,\r\n\t\t\t\tminChars: 0,\r\n\t\t\t\tonSelect: function (suggestion) {\r\n\t\t\t\t\tif(!isEmpty(suggestion.data))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcallCommonAjax('&action=getDescription&item='+parseInt(suggestion.data),function(desc){\r\n\t\t\t\t\t\t\tif(desc)\r\n\t\t\t\t\t\t\t\t$('#descFldH').text(desc);\r\n\t\t\t\t\t\t\tif($('#listTermsP').val()!='' && !isEmpty(suggestion.data) && $('#listAcadYrP').val()!='')\r\n\t\t\t\t\t\t\t\tgetPrograms(suggestion.data);\r\n\t\t\t\t\t\t\tselectedCourseId=suggestion.data;\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\tshowNoSuggestionNotice: true,\r\n\t\t\t});\r\n\t\t\t$('#autocomplete').autocomplete({\r\n\t\t\t\tlookup:jsonArr,\r\n\t\t\t\tminChars: 0,\r\n\t\t\t\tonSelect: function (suggestion) {\r\n\t\t\t\t\tif(!isEmpty(suggestion.data))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcallCommonAjax('&action=getDescription&item='+parseInt(suggestion.data),function(desc){\r\n\t\t\t\t\t\t\tif(desc)\r\n\t\t\t\t\t\t\t\t$('#descFld').text(desc);\r\n\t\t\t\t\t\t\tif($('#listTerms').val()!='' && !isEmpty(suggestion.data) && $('#listAcadYr').val()!='')\r\n\t\t\t\t\t\t\t\tgetPrograms(suggestion.data);\r\n\t\t\t\t\t\t\tselectedCourseId=suggestion.data;\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\tshowNoSuggestionNotice: true,\r\n\t\t\t});\r\n\t\t\t$('#autocomplete').val('');\r\n\t\t\t$('#autocompleteH').val('');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\r\n\t\t\t$('#autocomplete').autocomplete({\r\n\t\t\t\tlookup:[],\r\n\t\t\t\tminChars: 0,\r\n\t\t\t\tshowNoSuggestionNotice: true\r\n\t\t\t});\r\n\t\t\t$('#autocompleteH').autocomplete({\r\n\t\t\t\tlookup:[],\r\n\t\t\t\tminChars: 0,\r\n\t\t\t\tshowNoSuggestionNotice: true\r\n\t\t\t});\r\n\t\t} \r\n\r\n\t});\r\n\r\n\r\n}", "title": "" }, { "docid": "6b39eacc8c1c0f06b1f4b97cc22145d0", "score": "0.5087311", "text": "function getPairs(courses) {\n\tlet pairs = [];\n\n\tfor(let course of courses) {\n\t\t// add the lecture sections\n\t\tpairs.push({\n\t\t\tname: course.name,\n\t\t\tsections: course.sections\n\t\t});\n\n \t\t// add the lab section\n\t\tif(course.hasLab) {\n\t\t\tpairs.push({\n\t\t\t\tname: course.name + \" [lab]\",\n\t\t\t\tsections: course.labSections\n\t\t\t});\n\t\t}\n\t}\n\n\treturn pairs;\n}", "title": "" }, { "docid": "a9f7c86dac0e9273fc405378240082fd", "score": "0.5067941", "text": "function _appendCourse(course, school) {\n var courseTemplate = $('.dashboard-course-template').clone()\n courseTemplate.attr('data-course-id', course.id)\n courseTemplate.find('img').attr('src', course.course_img_url)\n courseTemplate.find('a').attr('href', course.course_url)\n courseTemplate.find('.course-description a').append(course.title.slice(0, 36))\n courseTemplate.find('.course-description p').append(school.name.slice(0, 39))\n if (course.start_date === null) {\n courseTemplate.find('.course-description .date-display').text(\"Start Date: TBD\")\n } else {\n courseTemplate.find('.course-description .date-display').text(\"Start Date: \" + course.start_date)\n }\n return courseTemplate\n }", "title": "" }, { "docid": "e3ee26d2529bdc0b21215b296fd89795", "score": "0.50650316", "text": "function checkboxCourses(){\n var checked = document.getElementsByClassName('checkbox');\n\n for(var a=0; a<checked.length; a++){\n // if the check box is checked, determines which course is selected\n if(checked[a].checked == true)\n // CSET 155\n if(checked[a].value == '1'){\n var course ={\n number : \"CSET 155\",\n name : \"Database Design\"\n }\n courseArray.push(course);\n }\n // CSET 160\n else if(checked[a].value == '2'){\n var course ={\n number : \"CSET 160\",\n name : \"Web Development II\"\n }\n courseArray.push(course);\n }\n // CSET 170\n else if(checked[a].value == '3'){\n var course ={\n number : \"CSET 170\",\n name : \"Security & Professional Ethics\"\n }\n courseArray.push(course);\n }\n // CSET 180\n else if(checked[a].value == '4'){\n var course ={\n number : \"CSET 180\",\n name : \"Software Project II\"\n }\n courseArray.push(course);\n }\n }\n // displays selected courses for debugging purposes\n for(var b=0; b< courseArray.length; b++){\n console.log(courseArray[b].name);\n }\n}", "title": "" }, { "docid": "cde3d39e1559a961eff52af4f6d03842", "score": "0.50643444", "text": "function enrichReAdd (){\n //gets the size of the enrichment classes array\n var size = tableObj.enrich.length;\n for(var j=0; j<size, j++){\n for(var i=0;i<size;i++){\n // if(size>tableObj.enrich.length){\n // i = 0;\n // }\n //temporaryily saves the enrichment course \n var course = tableObj.enrich[i];\n \n //checks to see if the current list of enrichment classes can be moved to the major or core list\n //if class fits into another list, then it is removed from enrichment list and added to appropiate group\n //checks if class fits in to major list\n if(majorReq[course]){\n resetEEBox(course);\n addMajorCourse(course);\n }\n //checks if class fits in to core list\n else if(coreReq[course]) {\n resetEEBox(course);\n addCoreCourse(course);\n }\n else{\n continue;\n }\n }\n }", "title": "" }, { "docid": "2fd2dc0ee0abe768e4ed6dcf3d83249a", "score": "0.5062268", "text": "static fromJson (json) {\n let course = new Course(json.type, json.name)\n course.groups = json.groups.map(g => Group.fromJson(course, g))\n course.allowed = json.allowed\n course.priority = json.priority\n return course\n }", "title": "" }, { "docid": "f1f3ca9da4fd9a7cc4374cad8782278b", "score": "0.50602645", "text": "async function scrapeCourse() {\n log(`\\n${chalk.white('Course')} '${chalk.yellow(_cid)}'`);\n\n let weekNum = 0;\n for (const week of _courseDetails.weeks) {\n weekNum += 1;\n await scrapeWeek(weekNum, week);\n }\n }", "title": "" }, { "docid": "702052d5a791ce073d2d792ba8bda329", "score": "0.50549847", "text": "function Course(cName, cCredits, cTiming, cLanguage, cType) {\n \"use strict\";\n this.cName = cName;\n this.cCredits = cCredits;\n this.cTiming = cTiming;\n this.cLanguage = cLanguage;\n this.cType = cType;\n \n this.toString = function () {\n var output = \"Name: \" + this.cName + \", Credits: \" + this.cCredits + \", Timing: \" + this.cTiming + \", Language: \" + this.cLanguage + \", Type: \" + this.cType;\n console.log(output);\n return output;\n }\n}", "title": "" }, { "docid": "d70bff08f51b94d7234ae7a252d9618d", "score": "0.5052803", "text": "function populate_selected_course_description_list(data) {\n\t\tdocument.getElementById(\"course-info\").classList.remove(\"invisible\");\n\n\t\tlet list_item = document.createElement(\"li\");\n\t\tlist_item.classList.add(CLASS_DESIGNATION_MAP[data['course_number']]);\n\n\t\tlet inner_list = document.createElement(\"ul\");\n\t\tlist_item.appendChild(inner_list);\n\n\t\tlet course_number = document.createElement(\"li\");\n\n\t\tlet span = document.createElement(\"span\");\n\t\tlet u = document.createElement(\"u\");\n\t\tlet strong = document.createElement(\"strong\");\n\t\tu.appendChild(strong);\n\t\tspan.appendChild(u);\n\t\tcourse_number.appendChild(span);\n\t\tstrong.innerText = \"Course Number:\";\n\n\t\tspan = document.createElement(\"span\");\n\t\tspan.innerText = \" \" + data['course_number'];\n\t\tcourse_number.appendChild(span);\n\t\tinner_list.appendChild(course_number);\n\n\t\tlet course_name = document.createElement(\"li\");\n\t\tspan = document.createElement(\"span\");\n\t\tu = document.createElement(\"u\");\n\t\tstrong = document.createElement(\"strong\");\n\t\tu.appendChild(strong);\n\t\tspan.appendChild(u);\n\t\tcourse_name.appendChild(span);\n\t\tstrong.innerText = \"Course Name:\";\n\n\t\tspan = document.createElement(\"span\");\n\t\tspan.innerText = \" \" + data['course_name'];\n\t\tcourse_name.appendChild(span);\n\t\tinner_list.appendChild(course_name);\n\n\t\tlet instructor = document.createElement(\"li\");\n\t\tspan = document.createElement(\"span\");\n\t\tu = document.createElement(\"u\");\n\t\tstrong = document.createElement(\"strong\");\n\t\tu.appendChild(strong);\n\t\tspan.appendChild(u);\n\t\tinstructor.appendChild(span);\n\t\tstrong.innerText = \"Course Instructor(s):\";\n\n\t\tspan = document.createElement(\"span\");\n\t\tspan.innerText = \" \" + data['instructor'];\n\t\tinstructor.appendChild(span);\n\t\tinner_list.appendChild(instructor);\n\n\t\tlet description = document.createElement(\"li\");\n\t\tspan = document.createElement(\"span\");\n\t\tu = document.createElement(\"u\");\n\t\tstrong = document.createElement(\"strong\");\n\t\tu.appendChild(strong);\n\t\tspan.appendChild(u);\n\t\tdescription.appendChild(span);\n\t\tstrong.innerText = \"Course Description:\";\n\n\t\tspan = document.createElement(\"span\");\n\t\tspan.innerText = \" \" + data['course_description'];\n\t\tdescription.appendChild(span);\n\t\tinner_list.appendChild(description);\n\n\t\tlet credits = document.createElement(\"li\");\n\t\tspan = document.createElement(\"span\");\n\t\tu = document.createElement(\"u\");\n\t\tstrong = document.createElement(\"strong\");\n\t\tu.appendChild(strong);\n\t\tspan.appendChild(u);\n\t\tcredits.appendChild(span);\n\t\tstrong.innerText = \"Credits for Course:\";\n\n\t\tspan = document.createElement(\"span\");\n\t\tspan.innerText = \" \" + data['credits'];\n\t\tcredits.appendChild(span);\n\t\tinner_list.appendChild(credits);\n\n\t\tdocument.getElementById(\"detail-list\").appendChild(list_item);\n\t}", "title": "" } ]
ef8107e8f9487554d53369244a2dc6ec
onSelectOperator: callback for operator type arguments: event: event object type: selected filter type
[ { "docid": "1280bf6003e6817c4caf9d05fd9d4d2a", "score": "0.86650145", "text": "onSelectOperator(event, type){\n let { callback, idx } = this.props;\n this.filterData.operator = type;\n callback(this.filterData, idx, false);\n }", "title": "" } ]
[ { "docid": "74dc70907865bf1ffe71c0a0d072bc2c", "score": "0.72170883", "text": "function selectedOperator(event) {\n\tconsole.log(event.target.id);\n\toperator = event.target.id;\n}", "title": "" }, { "docid": "79337a31d53915c1cee35aafc6d141d0", "score": "0.6592951", "text": "onSelectFilter(event, type){\n let { filterType, disableSubmit} = this.state;\n let { callback, idx } = this.props;\n filterType = type;\n this.filterData.lhs = type;\n callback(this.filterData, idx, disableSubmit);\n this.setState({filterType});\n }", "title": "" }, { "docid": "74088dcdd005314745ca3e86493f3253", "score": "0.63705105", "text": "function retrieveOperator(event) {\n event.preventDefault();\n mathOperator = this.value;\n console.log('Clicked operator: ', this.value);\n}", "title": "" }, { "docid": "ee7dc6d26f575546a66a6807ab657ac3", "score": "0.6352351", "text": "function operator_pressed(event) {\n set_op(event.target.value);\n }", "title": "" }, { "docid": "fc11190f048b02c7e3fa364b9ed2a8e7", "score": "0.6335063", "text": "function handleConditionOperatorChange( ev ) {\n\t\t\tvar $el = $( ev.currentTarget );\n\t\t\tvar val = $el.val();\n\t\t\tvar $row = $el.closest('div.cond-container');\n\t\t\tvar cond = getConditionIndex()[ $row.attr( 'id' ) ];\n\n\t\t\tcond.operator = val;\n\t\t\tsetUpConditionOpFields( $row, cond );\n\t\t\tconfigModified = true;\n\t\t\tupdateConditionRow( $row, $el );\n\t\t}", "title": "" }, { "docid": "0792b9dc8552d72ce4fcf8263d811a18", "score": "0.6236607", "text": "function filterOperatorChanged(e)\n{\n\tif (!e) e = window.event; \n\tvar obj = e.srcElement;\n\tif(!obj) obj = e.target;\n\t//var win = obj.ownerDocument.window;\n\t\n\t//alert(\"fieldClicked src=\"+obj+\" src.id=\"+obj.id);\n\tif (!obj.id) return; // event from an unknown field\n\t\n\tvar val = obj.options[obj.selectedIndex].value;\n\t// id of the drop-down is <fieldName>Operator. get the field name by substringing\t\n\tvar fieldName = new String(obj.id);\n\tfieldName = fieldName.substr(0,fieldName.length-8);\n\tvar fld1 = document.getElementById(fieldName);\n\tvar div2 = document.getElementById(fieldName+'ToDiv');\n\tvar fld2 = document.getElementById(fieldName+'To');\n\t\n\tif (div2)\n\t{\n\t\t// Second field is visible only if val==6 i.e. operator = BETWEEN\n\t\tif (val == 6){\n\t\t\tdiv2.style.display = 'inline';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdiv2.style.display = 'none';\n\t\t\tfld2.value = '';\n\t\t}\n\t}\n\t//and, first value is to be displayed except when the operator is 'any'\n\tif (val == 0)\n\t{\n\t\tfld1.style.display = 'none';\n\t\tfld1.value = '';\n\t}\n\telse\n\t{\n\t\tfld1.style.display = 'inline';\n\t\tfld1.focus();\n\t}\n}", "title": "" }, { "docid": "582c56d7601d7611acbe90c4ef39bb97", "score": "0.62107676", "text": "function chooseOperator (event) {\n\n /* This checks whether the operator has already been activated and if it did it will calculate\n a temporary result and display this value. From then on it will proceed with the normal function \n body. \n\n If operator is set to active, because it has already been used \n --> calculate temporary result and display it \n --> from there proceed normally with the updated operator value \n */\n if (event.target.className == \"active\") {\n console.log(\"-----IF PART ACTIVE-----\")\n console.log(`OPERATOR CHOSEN: ${operator}`);\n operate(operator, savedValue, displayValue); \n }\n\n\n // saving the selected operator\n operator = event.target.value;\n console.log(`The chosen operator is: ${operator}`);\n\n // saving the currently displayed value\n savedValue = displayValue;\n console.log(`The saved value is: ${savedValue}`);\n\n // Sets the mode to \"active\"\n setModeOperators.setActive();\n\n // display the correct symbol on the textbox\n addOperatorSymbol(operator);\n\n\n // sets the mode to \"secondValue\"\n setModeNumbers.setSecondValue();\n\n hasDecimal = false;\n}", "title": "" }, { "docid": "e541204283aae887e17337fbd463cbfd", "score": "0.6210146", "text": "function handleGeofenceOperatorChange( ev ) {\n\t\t\tvar el = $( ev.currentTarget );\n\t\t\tvar row = el.closest( 'div.cond-container' );\n\t\t\tvar val = el.val() || \"is\";\n\t\t\tif ( \"at\" === val || \"notat\" === val ) {\n\t\t\t\t$( 'div.re-geolong', row ).show();\n\t\t\t\t$( 'div.re-geoquick', row ).hide();\n\t\t\t} else {\n\t\t\t\t$( 'div.re-geolong', row ).hide();\n\t\t\t\t$( 'div.re-geoquick', row ).show();\n\t\t\t}\n\t\t\thandleConditionRowChange( ev );\n\t\t}", "title": "" }, { "docid": "c333bfbabb2d106adbd90eefbe81b5e2", "score": "0.6184413", "text": "function typeOperator (event) {\n currentOperator = event.target.innerHTML\n textView.innerHTML = currentOperator\n num1 = Number(userInput.join(''))\n userInput = []\n}", "title": "" }, { "docid": "c6688ff937cecbd449dd5b05fc97ed62", "score": "0.6169983", "text": "function handleOnGridFilterInit(e) {\n var type = e.sender.dataSource.options.schema.model.fields[e.field].type\n\n if (type == \"date\") {\n var beginOperator = e.container.find(\"[data-role=dropdownlist]:eq(0)\").data(\"kendoDropDownList\");\n beginOperator.value(\"gte\");\n beginOperator.trigger(\"change\");\n\n var endOperator = e.container.find(\"[data-role=dropdownlist]:eq(2)\").data(\"kendoDropDownList\");\n endOperator.value(\"lte\");\n endOperator.trigger(\"change\");\n }\n}", "title": "" }, { "docid": "bbe027ef324e7023eb6a2e091f736d92", "score": "0.6120046", "text": "onChangeHandler(e)\n {\n var filterType = e.target.value;\n super.dispatch(Event.MSG_FILTER_CHANGE, filterType, \"ComboView::onChangeHandler()\", 53);\n }", "title": "" }, { "docid": "8e0414e03bd706a7aa9f8c5e2e881845", "score": "0.61149496", "text": "function observeOperator() {\n document.querySelector('#operator-dropdown').addEventListener('change', function(event) {\n let selectValue = document.querySelector('select#value-input');\n if (!selectValue) {\n return;\n }\n if (event.target.value == 'equals') {\n document.querySelector('select#value-input').multiple = false;\n } else {\n document.querySelector('select#value-input').multiple = true;\n }\n });\n}", "title": "" }, { "docid": "92317e173c88589a4ddac81519e8ca5f", "score": "0.6067119", "text": "function handleOperator(e) {\n let result = 0;\n \n // Check whether the previous input was also an operator\n if (lastAction != null) {\n // Nothing happens if it's just operator after operator\n if (lastAction === 'ops') { \n currentOperation = e.target.attributes['data-value'].value; \n return;\n }\n } else {\n return;\n }\n\n lastAction = 'ops';\n\n // If the user has put in digits, push the whole number to the history\n if (hasUserTyped) {\n history.push(Number(userInput));\n }\n\n // If an operations has been selected, calculate the proper result\n if (currentOperation != null) {\n // It's always the last and second-to-last element of the history array\n result = calculateResult(history[history.length - 2], history[history.length - 1]);\n\n if (isNaN(result)) {\n handleDivisionByZero(result);\n return;\n }\n\n result = fitNumber(result);\n \n // Check if number was too big\n if (isNaN(result)) {\n handleTextOutput(result);\n return;\n }\n \n history.push(result);\n }\n\n // Get the operator that was selected \n currentOperation = e.target.attributes['data-value'].value;\n\n updateScreen(Number(history[history.length - 1]));\n\n // Reset the display value without updating the screen, so this happens as soon as a new number key is pressed\n userInput = 0;\n hasUserTyped = false;\n}", "title": "" }, { "docid": "a4a46a1925df0457ed90fc0029e9d8ae", "score": "0.600374", "text": "function handleOperator(oper) {\n if (operator === '') {\n operator = oper;\n operatorChosen = true;\n } else {\n handleTotal();\n operator = oper;\n } \n}", "title": "" }, { "docid": "0c3a69c4f12de8bac04555f207ca3b95", "score": "0.58401525", "text": "function changeComparison(event) {\n\t\tprops.value.comparison = event.target.value;\n\t\tprops.changeValue(props.value.ID, props.value, undefined);\n\t}", "title": "" }, { "docid": "23c07f68df4ac035a96f8f6dbdeb7af5", "score": "0.582114", "text": "function initializeFilterOperators() {\n\n // Get our current column filter property\n var filter = properties.activeColumn.enhancedTable.filter;\n\n // Get our operator contentItems\n var operatorContentItems = [];\n operatorContentItems.push(properties.screen.findContentItem(properties.filterPopupOperatorName1));\n operatorContentItems.push(properties.screen.findContentItem(properties.filterPopupOperatorName2));\n\n var operators;\n var defaultValueIndex = 0;\n\n if (filter.dataType.indexOf(\":String\") != -1) {\n\n defaultValueIndex = 2;\n operators = [\n\t\t\t\t\t\t\t{ stringValue: \"Is equal to\", value: \"eq\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is not equal to\", value: \"ne\" },\n\t\t\t\t\t\t\t{ stringValue: \"Starts with\", value: \"startswith\" },\n\t\t\t\t\t\t\t{ stringValue: \"Contains\", value: \"substringof\" },\n\t\t\t\t\t\t\t{ stringValue: \"Does not contain\", value: \"not substringof\" },\n\t\t\t\t\t\t\t{ stringValue: \"Ends with\", value: \"endswith\" }\n ];\n\n } else if (filter.dataType.indexOf(\":Date\") != -1) {\n operators = [\n\t\t\t\t\t\t\t{ stringValue: \"Is equal to\", value: \"eq\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is not equal to\", value: \"ne\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is after or equal to\", value: \"ge\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is after\", value: \"gt\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is before or equal to\", value: \"le\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is before\", value: \"lt\" }\n ];\n\n } else {\n operators = [\n\t\t\t\t\t\t\t{ stringValue: \"Is equal to\", value: \"eq\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is not equal to\", value: \"ne\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is greater than or equal to\", value: \"ge\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is greater than\", value: \"gt\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is less than or equal to\", value: \"le\" },\n\t\t\t\t\t\t\t{ stringValue: \"Is less than\", value: \"lt\" }\n ];\n\n }\n\n for (var i = 0; i < operatorContentItems.length; i++) {\n var defaultValue = operators[defaultValueIndex].value;\n var defaultStringValue = operators[defaultValueIndex].stringValue;\n\n // If there was a saved filter, get it\n if (filter.set[i] != undefined && filter.set[i].operator != undefined) {\n var savedFilter = _.find(operators, function (op) {\n return op.value == filter.set[i].operator;\n });\n\n if (savedFilter) {\n // Save our value into the screen property\n defaultValue = savedFilter.value;\n defaultStringValue = savedFilter.stringValue;\n }\n\n }\n\n // Set our values\n operatorContentItems[i].choiceList = operators;\n operatorContentItems[i].value = defaultValue;\n operatorContentItems[i].stringValue = defaultStringValue;\n properties.screen[operatorContentItems[i].name] = defaultValue;\n }\n\n }", "title": "" }, { "docid": "b6854c25d43b503db1dd3b46d1e591b8", "score": "0.57298315", "text": "function getOperator(event) {\n if (inputOne !== undefined) {\n operatorSymbol = event.target.textContent;\n }\n if (operatorSymbol === undefined) {\n operatorSymbol = event.target.textContent;\n }\n if (inputTwo !== undefined) {\n operating();\n operatorSymbol = event.target.textContent;\n }\n console.log(operatorSymbol);\n}", "title": "" }, { "docid": "ab529943854b7e3ac3d9cb58f954401b", "score": "0.5722934", "text": "getFilterComparisonOperator(pFilterOperator){let tmpOperator='=';switch(pFilterOperator){case'EQ':tmpOperator='=';break;case'NE':tmpOperator='!=';break;case'GT':tmpOperator='>';break;case'GE':tmpOperator='>=';break;case'LT':tmpOperator='<';break;case'LE':tmpOperator='<=';break;case'LK':tmpOperator='LIKE';break;case'NLK':tmpOperator='NOT LIKE';break;case'IN':tmpOperator='IS NULL';break;case'NN':tmpOperator='IS NOT NULL';break;case'INN':tmpOperator='IN';break;case'FOP':tmpOperator='(';break;case'FCP':tmpOperator=')';break;}return tmpOperator;}", "title": "" }, { "docid": "16f9ba8183ed213a3d51221a8c349b7e", "score": "0.5721983", "text": "onFilterChange(e) {\n this._genotype = e.detail.value;\n this.errorState = e.detail.errorState;\n console.log(\"onFilterChange\", this._genotype);\n this.requestUpdate();\n }", "title": "" }, { "docid": "1aa77ff36bfe214d12f511335fbb8f26", "score": "0.57010275", "text": "function onClickOperator() {\n secondOperand = firstOperand;\n firstOperand = \"\";\n operator = this.getAttribute(\"data-op\");\n}", "title": "" }, { "docid": "d6d5fcba030689ef19e97cfa477cfd67", "score": "0.57003736", "text": "filter(event) {\n this.props.changeFilter(event.target.value);\n }", "title": "" }, { "docid": "608c94a2e89179205e219d7fd2c48ad4", "score": "0.5634846", "text": "function selectOperator(input){\n operator = input;\n savedNumber = number;\n number = '';\n showDisplay();\n}", "title": "" }, { "docid": "d6004a2b78e748857559390914e69e1d", "score": "0.562672", "text": "function createOnConditionTypeChange(index, condItemSelect, condVariableSelect, condCompareSelect, condValueInput, condCustomTextInput) {\n\t\treturn function(event) {\n\t\t\tconsole.log(\"CHANGE CONDITIONAL TYPE \" + event.target.value);\n\n\t\t\tvar condition = ifNode.conditions[index];\n\n\t\t\tcondItemSelect.style.display = \"none\";\n\t\t\tcondVariableSelect.style.display = \"none\";\n\t\t\tcondCompareSelect.style.display = \"none\";\n\t\t\tcondValueInput.style.display = \"none\";\n\t\t\tcondCustomTextInput.style.display = \"none\";\n\n\t\t\tvar doesConditionMatchUI = event.target.value === getConditionType( condition );\n\n\t\t\tif(event.target.value === \"item\") { // TODO: negative numbers don't work\n\t\t\t\tcondItemSelect.style.display = \"inline\";\n\t\t\t\tcondCompareSelect.style.display = \"inline\";\n\t\t\t\tcondValueInput.style.display = \"inline\";\n\n\t\t\t\tif(doesConditionMatchUI) {\n\t\t\t\t\tvar itemId = condition.left.children[0].arguments[0].value;\n\t\t\t\t\tif(names.item.has(itemId)) itemId = names.item.get(itemId);\n\t\t\t\t\tcondItemSelect.value = itemId;\n\n\t\t\t\t\tvar operator = condition.operator;\n\t\t\t\t\tcondCompareSelect.value = operator;\n\n\t\t\t\t\tvar compareVal = condition.right.value;\n\t\t\t\t\tcondValueInput.value = compareVal;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar itemId = condItemSelect.value;\n\t\t\t\t\tif(item[itemId].name != null) itemId = item[itemId].name;\n\t\t\t\t\tvar condStr = '{item \"' + itemId + '\"} ' + condCompareSelect.value + ' ' + condValueInput.value;\n\t\t\t\t\tconsole.log(condStr);\n\t\t\t\t\tifNode.conditions[index] = scriptInterpreter.CreateExpression( condStr );\n\t\t\t\t\tserializeAdvDialog();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.target.value === \"variable\") {\n\t\t\t\tcondVariableSelect.style.display = \"inline\";\n\t\t\t\tcondCompareSelect.style.display = \"inline\";\n\t\t\t\tcondValueInput.style.display = \"inline\";\n\n\t\t\t\tif(doesConditionMatchUI) {\n\t\t\t\t\tconsole.log(\"VAR MATCH\");\n\t\t\t\t\tvar varId = condition.left.name;\n\t\t\t\t\tconsole.log(varId);\n\t\t\t\t\tcondVariableSelect.value = varId;\n\n\t\t\t\t\tvar operator = condition.operator;\n\t\t\t\t\tcondCompareSelect.value = operator;\n\n\t\t\t\t\tvar compareVal = condition.right.value;\n\t\t\t\t\tcondValueInput.value = compareVal;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar varId = condVariableSelect.value;\n\t\t\t\t\tvar condStr = varId + ' ' + condCompareSelect.value + ' ' + condValueInput.value;\n\t\t\t\t\tifNode.conditions[index] = scriptInterpreter.CreateExpression( condStr );\n\t\t\t\t\tserializeAdvDialog();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.target.value === \"default\") {\n\t\t\t\tif(!doesConditionMatchUI) {\n\t\t\t\t\tifNode.conditions[index] = scriptInterpreter.CreateExpression( \"else\" );\n\t\t\t\t\tserializeAdvDialog();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.target.value === \"custom\") {\n\t\t\t\tcondCustomTextInput.style.display = \"inline\";\n\n\t\t\t\t// custom conditions can contain anything so no need to change the existing condition\n\t\t\t\tcondCustomTextInput.value = condition.Serialize();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7beccdc73d1ea6d4cca649fa7e0b457f", "score": "0.560939", "text": "onFilterSelected(e) {\n this.$store.dispatch('getFilter', { id: e.target.value });\n }", "title": "" }, { "docid": "2bda4ed7f7c702820dcf907df990eab7", "score": "0.55804104", "text": "onSelect(event) {\n // Empty\n }", "title": "" }, { "docid": "b522975ce23e7b1e802e0a38be40bed7", "score": "0.5577264", "text": "onFilterSelected(filter) {\n\n let newFilterValue = !this.state[filter];\n\n let actionData = {\n \"changedParam\": SearchConstants.SEARCHFILTER_CHANGED,\n \"searchFilterParam\": filter,\n \"searchFilterParamValue\": newFilterValue\n };\n\n WorkbenchActions.searchParamsChanged(actionData);\n }", "title": "" }, { "docid": "e19da2ba60b397fdbe4079c5aee3e58f", "score": "0.55153173", "text": "function setOperator(e){\n if(input.value !== ''){\n operand1 = parseFloat(input.value)\n operator = e.target.innerText\n input.value += ` ${e.target.innerText} `\n tempStr = input.value.trim()\n }\n \n}", "title": "" }, { "docid": "f040d8bf31232e7f401de6702af0f118", "score": "0.55128103", "text": "function handleOperator() {\n operator = this.value;\n if (lastNum === '') {\n lastNum = currentNum;\n } else if (needsNum === false){\n lastNum = calculate();\n }\n currentNum = '';\n addToScreen(lastNum);\n needsNum = true;\n}", "title": "" }, { "docid": "f93f93bbacde3568fd37f1401b43763a", "score": "0.547586", "text": "setTypeFilter() {\n this.props.onConditionChange({ type: this._checkboxFilter('type') });\n }", "title": "" }, { "docid": "ce74403c5f26c77411f1045ed8d353a5", "score": "0.5456491", "text": "onGranularitySelect(e){\n this.props.onGranularitySelect(e.target.value);\n }", "title": "" }, { "docid": "9cd25fe9735ab79d980b209d9e3fb5ae", "score": "0.5454942", "text": "function parseOperator(spec) {\n const ctx = this;\n\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n }", "title": "" }, { "docid": "9afe912337650dc5af1605111266d329", "score": "0.54456204", "text": "function selectOperator(display, operator) {\n //$('#new-filter-operator-display').html(display);\n document.getElementById(\"new-filter-operator-display\").innerHTML = String(display) + '<i class=\"material-icons right\">arrow_drop_down</i>';\n $('#new-filter-operator').val(operator);\n}", "title": "" }, { "docid": "779551a80ef68f1b2a102be2571b532f", "score": "0.5430625", "text": "onSelect() {}", "title": "" }, { "docid": "21b9de77e93382b46624662a06ce6cd1", "score": "0.5424316", "text": "getResult(e) {\n this.props.onValueSelected(e.target.innerText);\n }", "title": "" }, { "docid": "22ecd68c79ba8739599dbaa95ed80372", "score": "0.54180926", "text": "function selectHandler(e) {\n\t\tvar selection = chartMM.getSelection();\n\t\tfor (var i = 0; i < selection.length; i++) { // a slice is a \"row\"\n\t\t\tvar item = selection[i];\n\t\t\tif (item.row != null) {\n\t\t\t\t\tvar str = pieData.getFormattedValue(item.row, 0);\n\t\t\t\t\tif (str == \"High Growth\") {\n\t\t\t\t\t\tvar filter = \"152~\";\n\t\t\t\t\t\tupdateFilter([{field: 'cached_growth_score', operator: '>=', value: 152}]);\n\t\t\t\t\t} else if (str == \"Growth\") {\n\t\t\t\t\t\tvar filter = \"0~151\";\n\t\t\t\t\t\tupdateFilter([{field: 'cached_growth_score', operator: '>=', value: 0},{field: 'cached_growth_score', operator: '<=', value: 151}]);\n\t\t\t\t\t} else if (str == \"Not Growing\") {\n\t\t\t\t\t\tvar filter = \"~0\";\n\t\t\t\t\t\tupdateFilter([{field: 'cached_growth_score', operator: '<', value: 0}]);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "4a5d69d3e2032a7e30a8ff440041cb36", "score": "0.5405846", "text": "function parseOperator(spec, ctx) {\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec,\n spec.update ? operatorExpression(spec.update, ctx) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n }", "title": "" }, { "docid": "d30fad757f852ebebd55879aef98d943", "score": "0.53938806", "text": "function parseOperator(spec) {\n const ctx = this;\n\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n}", "title": "" }, { "docid": "2b602e3f1b5689c6df3805f0c60dff5c", "score": "0.5389169", "text": "function getOperator() {\n console.log('operator working');\n operation = $(this).text();\n}//end getOperator", "title": "" }, { "docid": "bd4a52883b63323460ce79f950afaf19", "score": "0.5387801", "text": "enterComparisonOperator(ctx) {\n\t}", "title": "" }, { "docid": "eb6323a5d0f571cfa77d01fe39d8a0e1", "score": "0.53831476", "text": "function _OperatorExpressionEmitter() {\n}", "title": "" }, { "docid": "72b0bfadfea1317eef2994ca2704ddf5", "score": "0.5377304", "text": "enterCompareOperator(ctx) {\r\n\t}", "title": "" }, { "docid": "91232ab047aeb27fe442c757fd070161", "score": "0.5377177", "text": "function operatorClick(event) {\n var operator = event.target.innerHTML;\n var content = document.getElementById(numberScreen).innerHTML;\n\n switch (operator) {\n case '=':\n evaluate();\n break;\n case 'C':\n clearScreen();\n break;\n case '.':\n decimal();\n break;\n default:\n operating = true;\n operand = operator;\n content += operator;\n document.getElementById(numberScreen).innerHTML = content;\n break;\n }\n}", "title": "" }, { "docid": "946d6fd75ab598823249101fcea4a5c1", "score": "0.53702897", "text": "function expression(model, filterOp, node) {\n return Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"logicalExpr\"])(filterOp, (predicate) => {\n if (Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(predicate)) {\n return predicate;\n }\n else if (Object(_predicate__WEBPACK_IMPORTED_MODULE_1__[\"isSelectionPredicate\"])(predicate)) {\n return Object(_selection_parse__WEBPACK_IMPORTED_MODULE_3__[\"parseSelectionPredicate\"])(model, predicate.selection, node);\n }\n else {\n // Filter Object\n return Object(_predicate__WEBPACK_IMPORTED_MODULE_1__[\"fieldFilterExpression\"])(predicate);\n }\n });\n}", "title": "" }, { "docid": "12b338fd9094934a10390872c17ff15b", "score": "0.53586924", "text": "handleChange(field, rawValue) {\n\n const data = {\n ...this.state.data,\n operator: rawValue\n };\n\n this.setState({\n ...this.state,\n data\n });\n\n // Trigger onChange only if the value of the filter field is not empty, since changing operatos with empty values should not change the filter\n const valueField = this.children[1];\n\n const value = valueField.getValue();\n\n if (value) { // The first child is the operator combo box\n\n const {\n name,\n parent: filterField\n } = valueField.props;\n\n var filterPanel = filterField.props.parent;\n\n filterPanel.updateFilter(name, data.operator, value);\n }\n }", "title": "" }, { "docid": "1a1a7b3bcef6eec3babc7a5ad5ba217e", "score": "0.5342622", "text": "onSelectOrderType (event) {\n this.currentOrder.OrderType = event.target.value\n this.setOrderRequestParams()\n }", "title": "" }, { "docid": "2c781b0d252dd39f95c0dcc4d3786aa7", "score": "0.53363395", "text": "function setType(event) {\n // alert(\"workinh\")\n let type = event;\n // alert(type);\n divimg.innerHTML = \"\"\n\n if (type === 'all') {\n Val(store);\n return;\n }\n // Pressing the button will get you its value\n let filterdList = store.filter(getVal);\n function getVal(values) {\n\n return values.type == event;\n }\n // console.log(filterdList)\n Val(filterdList);\n}", "title": "" }, { "docid": "3a392224ee9e71a033af4fc7d83a3801", "score": "0.5332684", "text": "_onSelect(option) {\n // Set the global\n when = option.value;\n }", "title": "" }, { "docid": "8ed50e5a4bb98035b646229992e698cc", "score": "0.5325612", "text": "function updateOperatorSelector() {\n var operator = getLastOperator();\n var options = ['with', 'without'];\n if (operator) {\n options = ['and', 'or', 'and with', 'and without', 'or with', 'or without'];\n if (operator.innerHTML === 'or') {\n options.splice(0, 1);\n }\n else if (operator.innerHTML === 'and') {\n options.splice(1, 1);\n }\n }\n\n while (filterNewOperator.hasChildNodes()) {\n filterNewOperator.removeChild(filterNewOperator.lastChild);\n }\n\n for (var i = 0, l = options.length; i < l; i++) {\n var option = document.createElement('option');\n option.value = options[i];\n option.innerHTML = options[i];\n filterNewOperator.appendChild(option);\n }\n }", "title": "" }, { "docid": "d30ee8030e805575d61bbf172107e826", "score": "0.53244996", "text": "function getOperator(operator) {\n switch (operator) {\n case '+':\n return (a, b) => a + b;\n case '-':\n return (a, b) => a - b;\n case \"/\":\n return (a, b) => a / b;\n case \"X\":\n return (a, b) => a * b;\n default:\n return (a, b) => a; \n }\n }", "title": "" }, { "docid": "686131db70fbf4310bb626b3829a4a7d", "score": "0.5323912", "text": "function OperatorExpression() {\n}", "title": "" }, { "docid": "27bb99fcc6d87365344925cb6ffa53cd", "score": "0.5321516", "text": "operator(e) {\n let toArray = this.state.input;\n if (toArray[0] === '0' && toArray.length === 1) {\n let mini = this.state.mininput;\n this.setState({ operand: e.target.innerHTML })\n return this.setState({ mininput: mini });\n } else {\n this.setState({ operand: e.target.innerHTML });\n }\n if (e.target.innerHTML === \"*\") {\n this.setState({ last: \"*\" })\n }\n this.ac();\n this.mini();\n }", "title": "" }, { "docid": "26109c335571f35c7d0852c2eb16aaaf", "score": "0.5318471", "text": "function expression(model, filterOp, node) {\n return (0,_util__WEBPACK_IMPORTED_MODULE_2__.logicalExpr)(filterOp, (predicate) => {\n if ((0,vega_util__WEBPACK_IMPORTED_MODULE_0__.isString)(predicate)) {\n return predicate;\n }\n else if ((0,_predicate__WEBPACK_IMPORTED_MODULE_1__.isSelectionPredicate)(predicate)) {\n return (0,_selection_assemble__WEBPACK_IMPORTED_MODULE_3__.assembleSelectionPredicate)(model, predicate.selection, node);\n }\n else {\n // Filter Object\n return (0,_predicate__WEBPACK_IMPORTED_MODULE_1__.fieldFilterExpression)(predicate);\n }\n });\n}", "title": "" }, { "docid": "78723ca67b8c8149a71c99130855e20d", "score": "0.5311518", "text": "function _addOperators(operators) {\n var operatorDropdown = $('#new-filter-operator-dropdown');\n // Remove previous operators from dropdown\n operatorDropdown.empty();\n // Populate dropdown\n $.each(operators, function(i, o) {\n if (i == 0) {\n // Set the first operator\n //$('#new-filter-operator-display').html(operators[0][0]);\n document.getElementById(\"new-filter-operator-display\").innerHTML = String(operators[0][0]) + '<i class=\"material-icons right\">arrow_drop_down</i>';\n $('#new-filter-operator').val(operators[0][1]);\n }\n operatorDropdown.append('<li><a href=\"#\" style=\"line-height: 50px; height: 50px;\" onClick=\"javascript:selectOperator(\\'' + o[0] + '\\', \\'' + o[1] + '\\')\">' + o[0] + '</a></li>');\n });\n}", "title": "" }, { "docid": "ff2e887aa00e35f6c8e13d04021d870d", "score": "0.53110135", "text": "function getFilterOperators(inc) \n{\t\n\tvar listSelectOperation = $('operator'+inc);\n\t// reset the operators list first\n\twhile( listSelectOperation.options.length )\n\t\tlistSelectOperation.remove(listSelectOperation.options.length-1);\n\t\t\t\t\t\t\t\t\n\tvar params = \n\t{\n\t\tmethod: 'post', \n\t\tpostBody: 'sid='\n\t\t\t+sid\n\t\t\t+'&op=reports.ajax.getFilterOperators'\n\t\t\t+'&table_name='+$F('table_name')\n\t\t\t+'&field_name='+$F('filter'+inc),\n\t\tonSuccess: function(t){\n\t\t\t\t// get field type\n\t\t\t\t// retrieve select value and label\t\n\t\t\t\tname_nodes = t.responseXML.getElementsByTagName('operator_id');\n\t\t\t\tlabel_nodes = t.responseXML.getElementsByTagName('operator_label');\n\t \tfor (var i = 0; name_nodes.length > i; i++) \n\t \t{\n\t\t\t\t\tlistSelectOperation.options[i] = new Option( \n\t\t\t\t\t\tlabel_nodes[i].firstChild.data,\tname_nodes[i].firstChild.data, \n\t\t\t\t\t\t(name_nodes[i].firstChild.data == $('operator'+inc))?true:false);\n\t\t\t\t}\n\t\t\t\t$('field_type'+inc).value = t.responseXML.getElementsByTagName('field_type')[0].firstChild.data;\n\t\t \tshowopdiv(inc);\n\t\t\t\t$('criteria'+inc).value = '' ;\n\t\t\t\t$('period'+inc).value = '' ;\n\t\t\t},\n\t\tonFailure: function(t){\n\t\t\ttop.growler.error(getTranslation('common','Error'));\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t};\n\tnew Ajax.Request('raw.php', params);\n}", "title": "" }, { "docid": "1fffb01ecdde4a2b16eb76894ac4de25", "score": "0.52986705", "text": "handleCheckboxFilterSelection(e) {\n this.checkboxFilterSelection(e);\n }", "title": "" }, { "docid": "8dabb4ce90a077a0a43d84ead1806be9", "score": "0.5291545", "text": "applyFilter(filterField, filterValue, operator) {\r\n\r\n // var gridData = this.grid\r\n\r\n // var currFilterObj = gridData.dataSource.filter();\r\n\r\n // // get current set of filters, which is supposed to be array.\r\n // // if the oject we obtained above is null/undefined, set this to an empty array\r\n // var currentFilters = currFilterObj ? currFilterObj.filters : [];\r\n\r\n // // iterate over current filters array. if a filter for \"filterField\" is already\r\n // // defined, remove it from the array\r\n // // once an entry is removed, we stop looking at the rest of the array.\r\n // if (currentFilters && currentFilters.length > 0) {\r\n // for (var i = 0; i < currentFilters.length; i++) {\r\n // if (currentFilters[i].field == filterField) {\r\n // currentFilters.splice(i, 1);\r\n // break;\r\n // }\r\n // }\r\n // }\r\n\r\n // // if \"filterValue\" is \"0\", meaning \"-- select --\" option is selected, we don't \r\n // // do any further processing. That will be equivalent of removing the filter.\r\n // // if a filterValue is selected, we add a new object to the currentFilters array.\r\n // if (filterValue === \"isnull\") {\r\n // currentFilters.push({\r\n // field: filterField,\r\n // operator: \"isnull\",\r\n // value: filterValue\r\n // });\r\n // } else if (filterValue === \"isnotnull\") {\r\n // // currentFilters.push({\r\n // // field: filterField,\r\n // // operator: \"isnotnull\",\r\n // // value: filterValue\r\n // // });\r\n // } else {\r\n // if (filterValue != \"0\") {\r\n // currentFilters.push({\r\n // field: filterField,\r\n // operator: \"eq\",\r\n // value: filterValue\r\n // });\r\n // }\r\n // }\r\n\r\n // // finally, the currentFilters array is applied back to the Grid, using \"and\" logic.\r\n // gridData.dataSource.filter({\r\n // logic: \"and\",\r\n // filters: currentFilters\r\n // });\r\n\r\n }", "title": "" }, { "docid": "234ae1b888e5bf0e770f8b5bdd17ea8f", "score": "0.52780414", "text": "function criteria_selected(val, type) {\n display_filter(type + \"_filter\", val);\n reset_filter_option(filter_options[type], dropdown_options[type][\"criteria\"][val - 1]);\n filter_options[type][\"criteria\"] = val;\n if(val == -1) reset_all_filters(type);\n redraw_chart(type);\n}", "title": "" }, { "docid": "22151185c326b7b4da69c5559515d984", "score": "0.5271846", "text": "function handleOpInput(event) {\n const calcDisplay = document.querySelector(\"#calc-display\");\n const numDisplay = document.querySelector(\"#result-display\");\n const opInput = getInputValue(event, this.textContent);\n\n //remove trailing zeros from operand if they exist\n numDisplay.textContent = parseFloat(numDisplay.textContent);\n\n //if there are enough operands to do a calculation when operator\n //is pressed\n if (opTracking.lastBtnPressed === \"num\" && calcDisplay.textContent !== \"\") {\n if (opTracking.operation === \"÷\" && numDisplay.textContent === \"0\") {\n alert(\"Nice try, no cataclysm for you today.\");\n }\n else {\n let result = operate(opTracking.operation, opTracking.savedOperand,\n numDisplay.textContent);\n\n numDisplay.textContent = result;\n calcDisplay.textContent = `${result} ${opInput}`;\n opTracking.savedOperand = result;\n opTracking.lastBtnPressed = \"op\";\n opTracking.operation = opInput;\n }\n }\n else {\n opTracking.savedOperand = numDisplay.textContent;\n calcDisplay.textContent = `${opTracking.savedOperand} ${opInput}`;\n opTracking.lastBtnPressed = \"op\";\n opTracking.operation = opInput;\n }\n }", "title": "" }, { "docid": "19d96e74532ce7ca5e82fc462eb17188", "score": "0.5265917", "text": "function chooseOperator(operator) {\n (operation === \"\") ? currentValue: currentValue = currentValue.slice(0, -1);\n operation = operator;\n currentValue += operation;\n updateDisplay();\n}", "title": "" }, { "docid": "271d47b362c2d2137f1268563f89d560", "score": "0.5258405", "text": "function getFilterOperator(filter) {\n if (hasClass(filter, 'filter')) {\n var sibling = filter.previousSibling;\n while (sibling !== filterNew) {\n if (hasClass(sibling, 'operator-wrapper')) {\n return sibling;\n }\n sibling = sibling.previousSibling;\n }\n }\n return null;\n }", "title": "" }, { "docid": "29c423542085b0d75b7c0bece2c4f78b", "score": "0.5258345", "text": "function expression(model, filterOp, node) {\n return (0, _util.logicalExpr)(filterOp, predicate => {\n if ((0, _vegaUtil.isString)(predicate)) {\n return predicate;\n } else if ((0, _predicate.isSelectionPredicate)(predicate)) {\n return (0, _parse.parseSelectionPredicate)(model, predicate.selection, node);\n } else {\n // Filter Object\n return (0, _predicate.fieldFilterExpression)(predicate);\n }\n });\n}", "title": "" }, { "docid": "ea66ee9abe2fbfa49c23235f0a72a6be", "score": "0.5253593", "text": "_onChange(event) {\n event.preventDefault();\n event.stopPropagation();\n const {name, value} = event.target;\n this.props.setFilter({key: name, value});\n }", "title": "" }, { "docid": "217f6dd80305074dc1f27b301e312d8a", "score": "0.52522093", "text": "function addOperatorListener() {\n\tconst operatorBtns = document.querySelectorAll('.operator-btn');\n\toperatorBtns.forEach(operatorBtn => {\n\t\toperatorBtn.addEventListener('click', event => {\n\t\t\tstoreNumOperator(operatorBtn.textContent);\n\t\t\tconst decimalBtn = document.querySelector('#decimal');\n\t\t\tdecimalBtn.addEventListener('click', displayDigits);\n\t\t\t_isClear = true;\n\t\t\t_displayVar = null;\n\t\t})\n\t})\n}", "title": "" }, { "docid": "e577c43539defe73fd50aace1ad9dffc", "score": "0.5252127", "text": "function onSelect(item) {\n if (item.action) {\n item.action();\n }\n}", "title": "" }, { "docid": "6e51d3b35f301a7b967bfb98ff27f9cc", "score": "0.52480406", "text": "filterOnChange(filter) {\n // Ajouter un event change sur le filtre //\n filter.addEventListener('change', () => {\n this.manageAndDisplayRestaurants();\n removeFilterOptions();\n addFilterOptions();\n });\n }", "title": "" }, { "docid": "30a75d8eaea091148f18a9cc709e0c70", "score": "0.5244874", "text": "function parseOperator(spec) {\n const ctx = this;\n if (Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"isOperator\"])(spec.type) || !spec.type) {\n ctx.operator(\n spec,\n spec.update ? ctx.operatorExpression(spec.update) : null\n );\n } else {\n ctx.transform(spec, spec.type);\n }\n}", "title": "" }, { "docid": "b4fc9690bf5f8e9fdcc8abc759437247", "score": "0.52416146", "text": "handleFilter(event) {\n this.filterValue = event.target.value;\n }", "title": "" }, { "docid": "0caac2baafae09c7b61faccf270989d8", "score": "0.52352643", "text": "onChangeEventOnFilter(e) {\n\n if (e.keyCode !== 9 && e.keyCode !== 39 && e.keyCode !== 37) {\n\n\n //get all inputs\n var queryInputs = this.vGrid.element.querySelectorAll(\".\" + this.vGridConfig.css.filterHandle);\n\n\n //loop all of them\n var queryParams = [];\n\n\n for (var i = 0; i < queryInputs.length; i++) {\n\n\n //get the attribute, valiue etc\n var dataSourceAttribute = queryInputs[i].getAttribute(this.vGridConfig.atts.dataAttribute);\n var valueFormater = this.vGridConfig.colFormaterArray[this.vGridConfig.attributeArray.indexOf(dataSourceAttribute)];\n var operator = this.vGridConfig.filterArray[this.vGridConfig.attributeArray.indexOf(dataSourceAttribute)];\n var coltype = this.vGridConfig.colTypeArray[this.vGridConfig.attributeArray.indexOf(dataSourceAttribute)];\n var value = valueFormater ? valueFormater.fromView(queryInputs[i].value) : queryInputs[i].value;\n\n\n //FF issue, it have value of \"on\" sometimes...\n if (coltype === \"checkbox\" && value !== \"true\" && value !== \"false\") {\n value = \"\";\n }\n\n\n //do value exist and is not blank?\n if (value !== \"\" && value !== undefined) {\n\n\n //push into array that we send back after\n queryParams.push({\n attribute: dataSourceAttribute,\n value: value,\n operator: operator\n });\n\n\n //store the value, since I rebuild the grid when doing sorting...\n this.vGrid.vGridFilter.queryStrings[dataSourceAttribute] = queryInputs[i].value;\n\n } else {\n\n //reset to blank for later\n if (value === \"\") {\n this.vGrid.vGridFilter.queryStrings[dataSourceAttribute] = queryInputs[i].value;\n }\n\n }\n\n\n }//end for loop\n\n\n //run query/filter\n this.vGridConfig.onFilterRun(queryParams)\n }\n\n\n }", "title": "" }, { "docid": "80fc3b4173fd20a62eaa5b77cc057ac5", "score": "0.5228692", "text": "function updateSelectedOperation() {\r\n switch (this.event.target.innerText) {\r\n case `+`:\r\n operation = `plus`;\r\n break;\r\n case `-`:\r\n operation = `minus`;\r\n break;\r\n case `×`:\r\n operation = `multiply`;\r\n break;\r\n case `÷`:\r\n operation = `divide`;\r\n break;\r\n default:\r\n console.log(`Error`)\r\n break;\r\n\r\n }\r\n}", "title": "" }, { "docid": "a3b95849858b222172c86c4a1b43ba4f", "score": "0.5226981", "text": "function onOperatorClick(event) {\n symbol = String(event.target.value);\n if (lastButtonOperator) {\n if (symbol == \".\") {\n display = \"0.\";\n lastButtonOperator = false;\n } else if (symbol == \"+/-\") {\n if (display.charAt(0) == '-') {\n display = display.substr(1);\n } else {\n display = \"-\" + display;\n }\n } else if (symbol == \"C\") {\n display = \"0\"\n buttonState = true;\n calculations = [];\n } else if (symbol == \"CE\") {\n display = \"0\"\n buttonState = true;\n }\n } else if (symbol == '.') {\n display += '.';\n } else {\n if (symbol == \"+/-\" && display != \"0\") {\n if (display.charAt(0) == '-') {\n display = display.substr(1);\n } else {\n display = \"-\" + display;\n }\n } else if (symbol == \"DEL\") {\n if (!buttonState) {\n buttonState = true;\n display = \"0\"\n }\n if (display != \"0\") {\n if (display[display.length-1] == \";\"){\n display = display.substr(0, display.length - (\"&#960;\".length));\n }else{\n display = display.substr(0, display.length - 1);\n }\n if (display.length == 0 || display == \"-\") {\n display = \"0\";\n }\n }\n } else if (symbol == \"C\") {\n display = \"0\"\n buttonState = true;\n calculations = [];\n } else if (symbol == \"CE\") {\n display = \"0\"\n buttonState = true;\n }\n }\n lastButtonEquals = false;\n updateDisplay();\n}", "title": "" }, { "docid": "7afd762c401299d4fc0589a3653d7001", "score": "0.5226832", "text": "function handleOperator(nextOperator){\n // destructure of calculator object properties\n const { firstOperand, screenValue, operator} = calculator;\n // using parseFloat change string calculator.screenValue into a number with decimals\n const inputValue = parseFloat(screenValue);\n\n // checking if firstOperand === null (should be if it's the first action) and if inputValue is a number\n if (firstOperand === null && !isNaN(inputValue)){\n calculator.firstOperand = inputValue;\n \n // checking if operator was clicked, then give the result\n } else if (operator) {\n const result = calculate(firstOperand, inputValue, operator);\n calculator.screenValue = String(result);\n calculator.firstOperand = result;\n }\n\n calculator.waitingForSecondOperand = true;\n calculator.operator = nextOperator;\n\n console.log(calculator);\n}", "title": "" }, { "docid": "9b835b91a5b1b526ab0ef96d503d6ae9", "score": "0.521887", "text": "function operatorSelector() {\n $(this).addClass('colorBtn');\n operator = $(this).prop('name');\n return operator;\n}", "title": "" }, { "docid": "f69f1dc31cab320ff9da09524381d25d", "score": "0.52170503", "text": "getFilterInput(type) {\n this[\"filter\" + type] = event.target.value;\n }", "title": "" }, { "docid": "a339c6fa37ebee0f26e9a421f34b407f", "score": "0.5212795", "text": "function updateFilterOpt(e) {\n const currCompletion = self.completionStore.selected;\n currCompletion.filterType = e.target.value;\n if (e.target.value === \"Quantile\") {\n currCompletion.selectedQ = [1, 1, 1, 1];\n currCompletion.regionStore.quartileVisible([1, 1, 1, 1]);\n } else if (e.target.value === \"Score\") {\n currCompletion.interval = [0, 100];\n currCompletion.regionStore.labelVisible([0, 100]);\n } else {\n currCompletion.regionStore.resetVisible();\n }\n }", "title": "" }, { "docid": "d307794bd9c25d3dc956d13cc448ac5c", "score": "0.52099127", "text": "function onClickOperate() {\n firstOperand = parseFloat(firstOperand);\n secondOperand = parseFloat(secondOperand);\n\n switch (operator) {\n case \"plus\":\n result = secondOperand + firstOperand;\n break;\n case \"minus\":\n result = secondOperand - firstOperand;\n break;\n case \"times\":\n result = secondOperand * firstOperand;\n break;\n case \"divided by\":\n result = secondOperand / firstOperand;\n break;\n\n default:\n break;\n }\n\n viewer.innerHTML = result;\n firstOperand = result;\n}", "title": "" }, { "docid": "b1a78b8286641a360dede16598b1ae57", "score": "0.52016395", "text": "function dialOperator(value) {\n //in the context of this listeners...when this function is called it will only deal with operators so it doesn't need to account for other possibilities.\n\n\n return value === '+' || value === '-' || value === 'x' || value === '÷'\n\n}", "title": "" }, { "docid": "fa7bb3a4af46155355486590e84646c9", "score": "0.51957375", "text": "onChangeRhs(event,opts=null){\n let { disableSubmit} = this.state;\n let { callback, idx } = this.props;\n if(event && event.target.name === 'revenue') {\n if(!event.target.validity.valid){\n disableSubmit = true;\n }else {\n disableSubmit = false;\n }\n }\n let value = '';\n if( opts && opts.length) {\n value = opts;\n }else {\n value = event.target.value;\n }\n this.filterData.rhs = value;\n callback(this.filterData, idx, disableSubmit);\n }", "title": "" }, { "docid": "82ed57eca86b79c51fa790721c0e4eec", "score": "0.5193626", "text": "function addOperators(event) {\n\tlet operand = event.target.value;\n\n\t//Push numbers and operands to the array\n\texpressionArray.push(stringNumber);\n\texpressionArray.push(operand);\n\n\t//Set stringNumber back to nothing\n\tstringNumber = '';\n\n\t//Empty DOM for id appending-number and current\n\t$('#appending-number').empty();\n\t$('#current').empty();\n\n\t//Append DOM for id current using for loop\n\tfor(let item of expressionArray) {\n\t\t$('#current').append(`${item} `);\n\t}\n}", "title": "" }, { "docid": "216954af3c1564cd879c8c618e727cef", "score": "0.5173392", "text": "function setFilterMenuEvent() {\n\t\tvar charTypeIndex = $(_elementid.charttypelist).val();\n\n\t\tshowSpinner();\n\n\t\t_chart.offset = parseInt( this.value );\n\t\tsetChart( _chart, charTypeIndex, false );\n\t}", "title": "" }, { "docid": "f21ab5e1317a9886175b563a0be9d6c0", "score": "0.5165581", "text": "onSortTypeChange(type) {\n this.changeCriteria('sort_type', type)\n }", "title": "" }, { "docid": "cf95ccb1fbbd51391dc4c41547641435", "score": "0.5165104", "text": "function selectFilterOption(event) {\n // check if the currentClickedLeftItem is not null run the event\n if (currentClickedLeftItem !== null) {\n renderFilterToMiddleOrRightColumn(true, \"L\");\n filterOptionsBlock.html(noOptionsMsg);\n currentClickedLeftItem = null;\n }\n}", "title": "" }, { "docid": "1db7a3681f83bb8b3172ebe12a8a167d", "score": "0.5163993", "text": "onFilterChange(event) {\n this.props.setVisibilityFilter(event.target.value);\n }", "title": "" }, { "docid": "0de6f5c11e5d81518e9ec4bb07235455", "score": "0.5157381", "text": "function whatToDo(event) {\n if (calcState[\"operator\"] == \"\") {\n readFirstNumber(event.target.value);\n } else if (\n calcState[\"operator\"] == \"plus\" ||\n calcState[\"operator\"] == \"minus\" ||\n calcState[\"operator\"] == \"multiply\" ||\n calcState[\"operator\"] == \"divide\"\n ) {\n readSecondNumber(event.target.value);\n } else if (calcState[\"secondNumber\"] == \"\") {\n readSecondNumber(event.target.value);\n }\n}", "title": "" }, { "docid": "c89391a3edf28497a8cf101ed14ccce0", "score": "0.515626", "text": "executeOnChange(selected) {\n const { onChange } = this.props;\n if (onChange instanceof Function) {\n onChange(selected);\n }\n }", "title": "" }, { "docid": "fb1a0d9ba52c86c78700e49b6f2cf24f", "score": "0.5154215", "text": "_selectEvent(payload) {\n this.selectedEvent = payload.event;\n this.emit('change');\n }", "title": "" }, { "docid": "f90e8e849ad6309b6aff0c1343f80eb0", "score": "0.51518977", "text": "function selectType(event){\n //remember what was selected\n selectedType = event.target.getAttribute(\"data-type\");\n\n //reset selected class\n filterButtons.forEach((button) =>{\n button.classList.remove(\"selected\")\n });\n\n //add the selected class to the item that was clicked\n event.target.classList.add(\"selected\");\n}", "title": "" }, { "docid": "2b1af7d7cf267925e25d818a13a60212", "score": "0.5128857", "text": "function expression(model, filterOp, node) {\n return logicalExpr(filterOp, function (predicate) {\n if (isString(predicate)) {\n return predicate;\n }\n else if (isSelectionPredicate(predicate)) {\n return selectionPredicate(model, predicate.selection, node);\n }\n else { // Filter Object\n return fieldFilterExpression(predicate);\n }\n });\n }", "title": "" }, { "docid": "a7e5ed513607ef2666c7761461db84b1", "score": "0.5118399", "text": "filterSelected(i, event) {\n const filter = event.target.name;\n const currentFilters = this.state.currentFilters;\n currentFilters[filter] = !this.state.currentFilters[filter];\n this.setState({ currentFilters: currentFilters });\n }", "title": "" }, { "docid": "93b1eead14685920b85900c347b6ece0", "score": "0.5113057", "text": "handleCompSelect(evt) {\n let compValue = evt.target.dataset.id;\n this.options.forEach(item => {\n if (item.value == compValue && item.metaName == this.currentView) {\n item.checked = evt.target.checked;\n }\n })\n this.partialCheck();\n helper.handlePreviewXml(this);\n }", "title": "" }, { "docid": "a89b974cc09eabbf9c1d2d219f5b332f", "score": "0.51107025", "text": "enterLogicalOperator(ctx) {\n\t}", "title": "" }, { "docid": "10ff467912660cdca195d507439529c1", "score": "0.510483", "text": "onSelected( selectedItem ) {\n // console.log(\"selectedItem: %s\", selectedItem);\n this.searchType = selectedItem\n }", "title": "" }, { "docid": "08d7f03dc53758761486423a9cfed678", "score": "0.5100538", "text": "dispatchChange() {\n const {\n startDate,\n endDate,\n selectedMetric,\n } = this.getProperties('startDate', 'endDate', 'selectedMetric');\n this.sendEventAction('onchange', { startDate, endDate, selectedMetric }, this);\n }", "title": "" }, { "docid": "9109a3b64658d761173b37a08bd5ebe3", "score": "0.5100173", "text": "function onchange(e) {\n type=e.target.value\n update(dataLoad,type)\n \n}", "title": "" }, { "docid": "0ea456509c8a3e3baae5cea467d40b83", "score": "0.50950086", "text": "function Operator() {\n}", "title": "" }, { "docid": "b411e5d1a327349279140e0a923a5a9e", "score": "0.50895584", "text": "handleSearchOptionChange(event) {\n this.selectedBoatTypeId = event.detail.value;\n // Create the const searchEvent\n // searchEvent must be the new custom event search\n const searchEvent = new CustomEvent('search',{detail:{boatTypeId:this.selectedBoatTypeId}});\n this.dispatchEvent(searchEvent);\n }", "title": "" }, { "docid": "37604978ad1bb29ffd397c5b0e8ba757", "score": "0.508899", "text": "function operatorButtonClicked(operator) {\n const display = document.querySelector(\".display-text\");\n console.log(operation);\n if (operation.a === undefined) {\n getInputtedNumber(\"a\");\n operation.operator = operator;\n } else if (operation.b === undefined) {\n getInputtedNumber(\"b\");\n let result = operate(operation.a, operation.b, operation.operator);\n displayResult(result);\n operation.operator = operator;\n\n // if operator other than equals pressed, store result in a for further\n // evaluations\n operation.a = operator === \"=\" ? undefined : result;\n operation.b = undefined;\n console.log(\"a after: \" + operation.a);\n console.log(\"b after: \" + operation.b);\n } \n}", "title": "" }, { "docid": "efadf074e20d5dad726f2e70a4c8dd37", "score": "0.5087283", "text": "toggleFilter(e){if(e===void 0||this.filterColumn==e.detail.columnNumber&&this.filtered){this.filtered=!1;this.filterText=null;this.filterColumn=null}else{this.filterText=e.detail.text;this.filterColumn=e.detail.columnNumber;this.filtered=!0}}", "title": "" }, { "docid": "eb0fb899f16a31561491ef26f176a2fa", "score": "0.5081323", "text": "function action(e) {\n /* Older IE browsers have a srcElement property,\n but other browsers have a 'target' property;\n Set btn to whichever exists. */\n let btn = e.target || e.srcElement;\n\n /* Get the clicked element's innerHTML */\n if (btn.id === \"btnEql\") {\n const [operand1, operand2] = res.split(operator);\n const expression = parseInt(operand1, 2) + operator + parseInt(operand2, 2);\n res = (eval(expression) >>> 0).toString(2);\n } else if (btn.id === \"btnClr\") {\n res = \"\";\n } else if (['btnSum', 'btnSub', 'btnMul', 'btnDiv'].indexOf(btn.id) !== -1) {\n operator = document.getElementById(btn.id).innerHTML;\n res += operator;\n } else {\n res += document.getElementById(btn.id).innerHTML;\n }\n document.getElementById(\"res\").innerHTML = res;\n}", "title": "" }, { "docid": "d504c30c1c6d8ee3b1064702f1a6922e", "score": "0.5080494", "text": "onOptionSelected(event) {\n const selectEvent = event.detail.event;\n const target = selectEvent.target ? selectEvent.target.activeElement : selectEvent.target;\n if (target.classList.contains(this.selectorMonth)) {\n this.onMonthSelected(Number(selectEvent.target.value));\n }\n if (target.classList.contains(this.selectorYear)) {\n this.onYearSelected(Number(selectEvent.target.value));\n }\n }", "title": "" }, { "docid": "3ebe302d7f053983ac66c47166a68979", "score": "0.5077158", "text": "function commandHandler(aEvent) {\n let filterValue = aMuxer.getFilterValueForMutation(\n TagFacetingFilter.name\n );\n filterValue.mode = aEvent.target.value;\n aMuxer.updateSearch();\n }", "title": "" } ]
105f67eb06eb9de31ecb7d61d75409d0
Enclose containing values in []
[ { "docid": "35852ecb844f65745b9f0243aef9b78d", "score": "0.0", "text": "function arrayExpressionToValue(arry) {\n var value = '[';\n for (var i=0; i<arry.elements.length; i++) {\n var v = expressionToValue(arry.elements[i]);\n if (v === undefined)\n v = CANT_CONVERT;\n if (i !== 0)\n value += ', ';\n value += v;\n }\n value += ']';\n return value;\n}", "title": "" } ]
[ { "docid": "44ba3d09e9c9697a5fe6ec1ae9acfac1", "score": "0.6297318", "text": "function arrayify(val) {\n return !Array.isArray(val) ? [val] : val;\n}", "title": "" }, { "docid": "44ba3d09e9c9697a5fe6ec1ae9acfac1", "score": "0.6297318", "text": "function arrayify(val) {\n return !Array.isArray(val) ? [val] : val;\n}", "title": "" }, { "docid": "44ba3d09e9c9697a5fe6ec1ae9acfac1", "score": "0.6297318", "text": "function arrayify(val) {\n return !Array.isArray(val) ? [val] : val;\n}", "title": "" }, { "docid": "a5bf269bab23a056dbf3eb19cd927e01", "score": "0.6283595", "text": "function arrayify(val) {\n return val ? Array.isArray(val) ? val : [val] : [];\n}", "title": "" }, { "docid": "2bdc2a36479de783f50edbb926609707", "score": "0.6215439", "text": "function arrayify(val) {\r\n return val ? (Array.isArray(val) ? val : [val]) : [];\r\n}", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "925431e64f1c6fcbb9be4e336856a823", "score": "0.61969584", "text": "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "title": "" }, { "docid": "390016b0b048cf1a98a48ffa7bc0b24c", "score": "0.6170222", "text": "function arrayWrap(val) {\n\t return isArray(val) ? val : isDefined(val) ? [val] : [];\n\t }", "title": "" }, { "docid": "0f12a49ec5c335f5690b94bb5cf7d1c0", "score": "0.6167993", "text": "function arrayify(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "title": "" }, { "docid": "0f12a49ec5c335f5690b94bb5cf7d1c0", "score": "0.6167993", "text": "function arrayify(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "title": "" }, { "docid": "0f12a49ec5c335f5690b94bb5cf7d1c0", "score": "0.6167993", "text": "function arrayify(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "title": "" }, { "docid": "0f12a49ec5c335f5690b94bb5cf7d1c0", "score": "0.6167993", "text": "function arrayify(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "title": "" }, { "docid": "0f12a49ec5c335f5690b94bb5cf7d1c0", "score": "0.6167993", "text": "function arrayify(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "title": "" }, { "docid": "c2b0849c280cf03a77c47fc416838b39", "score": "0.60941714", "text": "asArray(value) {\n return typeof value === 'string' ? [ value ] : value;\n }", "title": "" }, { "docid": "2bd602896e084009e46d7b01d1df8930", "score": "0.6047151", "text": "function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }", "title": "" }, { "docid": "a85dc36f454fce12058c1a48895d1a14", "score": "0.6015111", "text": "function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }", "title": "" }, { "docid": "d3dcd6dda3af185705956b50625f31ec", "score": "0.5938569", "text": "function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "title": "" }, { "docid": "1b29a5a573fb95ddf490fae96776d313", "score": "0.59214514", "text": "function addArrayToRes(elts) {\n for (let i = 0; i < elts.length; i++) {\n if (elts[i].type === 'Literal') {\n res.push(elts[i].value);\n }\n }\n }", "title": "" }, { "docid": "2d76acaf62da139119c782f8e447f704", "score": "0.58833617", "text": "turnArray() {\n this.fieldname = this.fieldname.map((item) => item).join(\", \");\n }", "title": "" }, { "docid": "0a7e9ac4040961c3c5e0aa580915f384", "score": "0.5784154", "text": "function makeArray(e){return Array.isArray(e)?e:[e]}", "title": "" }, { "docid": "87b88c37bb29855e502ef1ae5a39f553", "score": "0.56798714", "text": "function Jd(t){return t instanceof Array||(t=[t,t]),t}", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.56784123", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.56784123", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.56784123", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.56784123", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.56784123", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "7125e1916a794937dfb6c53151f5a455", "score": "0.56765294", "text": "function arrayify(d) {\n //Changes any values that are not an array into an array of length one.\n //This is in order to ensure the rest of the functions can assume an array is given.\n for (key of Object.keys(d)) {\n let val = d[key];\n if (typeof val != \"object\") {\n d[key] = [val];\n }\n }\n return d;\n}", "title": "" }, { "docid": "ba77038fcbb1aca0cb461c7d8952a26c", "score": "0.56303006", "text": "function z(se,de){return de&&(se=se||[],se.push(de)),se}", "title": "" }, { "docid": "5e21dbf1bd420d630988f3c834c35660", "score": "0.5594328", "text": "static _encodeArray(arr, elemTypeOid) {\n const quoteElem = elem => {\n if (elem == null) return 'NULL';\n elem = this.encode(elem, elemTypeOid);\n elem = elem.replace(/(?=\\\\|\")/g, '\\\\');\n return `\"${elem}\"`;\n };\n const delim = ','; // TODO box[] uses semicolon\n return `{${arr.map(quoteElem).join(delim)}}`;\n }", "title": "" }, { "docid": "039ea315d733490bc2a6b08defd64d47", "score": "0.5555617", "text": "function array(val) {\n return val.split(',');\n}", "title": "" }, { "docid": "80f497726589b7b2693d4eda6fd0181f", "score": "0.5516494", "text": "function buildGetMapArray() \n{\n let obj = [1.1, 2.2];\n let arr = [obj, obj];\n let tmp = {escapeVal: obj.length}; \n return [obj[tmp.escapeVal], obj, arr];\n}", "title": "" }, { "docid": "7e9ff7e79b23244b7dfac69ae9efb815", "score": "0.5516387", "text": "function asArray(value) {\n if (Array.isArray(value))\n return value;\n return [value];\n}", "title": "" }, { "docid": "1d5e6bd5790a344a448043059f9c102d", "score": "0.55111945", "text": "toString() {\n return '[' + _.values(this).join(', ') + ']';\n }", "title": "" }, { "docid": "3bfdf10b633c70eb92f9914b6f3375ef", "score": "0.54909307", "text": "function u(e,t){return t&&(e=e||[],e.push(t)),e}", "title": "" }, { "docid": "d2b7af71e04904f39e00624422cd9c51", "score": "0.54806465", "text": "function arrayString(val) {\n var result = '{';\n for (var i = 0 ; i < val.length; i++) {\n if(i > 0) {\n result = result + ',';\n }\n if(val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL';\n }\n else if(Array.isArray(val[i])) {\n result = result + arrayString(val[i]);\n }\n else if(val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex');\n }\n else\n {\n result += escapeElement(prepareValue(val[i]));\n }\n }\n result = result + '}';\n return result;\n}", "title": "" }, { "docid": "258d3069d97cc2645ddb57d10ce0e7b6", "score": "0.5473328", "text": "function bracketIfNecessary(a) {\n if (a.length === 1) {\n return `${a}`;\n }\n return `[${a.join(', ')}]`;\n}", "title": "" }, { "docid": "84b871a03f638c1111ccfdb7873f0d8d", "score": "0.54727036", "text": "function arrayString(val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "title": "" }, { "docid": "84b871a03f638c1111ccfdb7873f0d8d", "score": "0.54727036", "text": "function arrayString(val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "title": "" }, { "docid": "29477e057d732641d35958db57b907da", "score": "0.5466812", "text": "function encodeArray(arrayValue) {\n return arrayValue.map(encodeURIComponent).join(',');\n}", "title": "" }, { "docid": "29477e057d732641d35958db57b907da", "score": "0.5466812", "text": "function encodeArray(arrayValue) {\n return arrayValue.map(encodeURIComponent).join(',');\n}", "title": "" }, { "docid": "2de375d4f4ba0557217258ebd9e649e1", "score": "0.53888524", "text": "function sf(t){return t instanceof Array||(t=[t,t]),t}", "title": "" }, { "docid": "86e082fa356843b79b7d22a74564c206", "score": "0.53790784", "text": "merge(value) {\n if (Array.isArray(value)) return value.join(\", \");\n return value;\n }", "title": "" }, { "docid": "396847af79f7cc1c62ba7b3e0877db67", "score": "0.5376191", "text": "values () {\n return this.each(function (val) {\n this.push(val)\n }, [])\n }", "title": "" }, { "docid": "d7f0531311d9ae33b422bbf22d7b7707", "score": "0.53638554", "text": "function makeArray(values){\n\t\tif(typeof values !== 'undefined'){\n\t\t\tif (!(values instanceof Array)){\n\t\t\t\tif(typeof values === 'string'){\n\t\t\t\t\tif(values.indexOf(' ') >= 0){\n\t\t\t\t\t\tif(((typeof opts !== 'undefined') && (typeof opts.breakIntoLetters !== 'undefined') && opts.breakIntoLetters)){\n\t\t\t\t\t\t\tvalues = values.replace(/([\\s]+)/ig, \"\");\n\t\t\t\t\t\t\tvalues = values.split(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvalues = values.replace(/([!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+)([^\\s]+)/ig, '$1 $2'); //add space after special characters if there is no space \n\t\t\t\t\t\t\tvalues = values.replace(/([^\\s]+)([!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+)/ig, '$1 $2'); //add space before special characters if there is no space\n\t\t\t\t\t\t\tvalues = values.split(\" \");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvalues = values.split(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(isNumber(values)){\n\t\t\t\t\tvalues = ''+values+'';\n\t\t\t\t\tvalues = values.split(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tvalues = opts.values.slice(0);\n\t\t}\n\t\t\n\t\treturn values;\n\t}", "title": "" }, { "docid": "924b9b88cdd1bd41460d2dd998485e77", "score": "0.5358013", "text": "get assignedValuesString() {\n return `[ ${this.assignedValues.join(', ')} ]`;\n }", "title": "" }, { "docid": "a56a4243156edc30420134f2b9e34bfd", "score": "0.5344506", "text": "function sequl(data){\n//create array to pass in\n\tvar array = [];\n\n\t for(var keys in data){\n\n\t \tvar value = data[keys];\n//check whether should be '' around value\n// e.g. {name: 'Lana Del Grey'} => [\"name='Lana Del Grey'\"]\n // e.g. {sleepy: true} => [\"sleepy=true\"]\n\n\t \tif (typeof value === \"string\" && value.indexOf(\" \") >=0){\n\t \t\tvalue = \"'\" + value + \"'\"\n\t \t}\n\t \tarray.push(`${keys} = ${value}`)\n\t }\n\n\t return array;\n\n}", "title": "" }, { "docid": "f2d7b93ae1e6b3611fc71e91b4bb424e", "score": "0.5343219", "text": "function inspect(value) {\n return formatValue(value, []);\n }", "title": "" }, { "docid": "f4a9049b0e6926f826b5100f26dd4b7f", "score": "0.53264636", "text": "function commaList(array) {}", "title": "" }, { "docid": "9c7f90f77b11c4a1a87f6da6a20a313f", "score": "0.5322502", "text": "function wrapReferences(values) {\n return values.getArray().map(function (i) { return util_1.wrapReference(i.getOpaque()); });\n }", "title": "" }, { "docid": "c6d0ab25c8bffb26677121370f486a8c", "score": "0.53085333", "text": "function visitArrayLiteralExpression(node) {\n if (node.transformFlags & 64 /* ES2015 */) {\n // We are here because we contain a SpreadElementExpression.\n return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, node.multiLine, /*hasTrailingComma*/ node.elements.hasTrailingComma);\n }\n return ts.visitEachChild(node, visitor, context);\n }", "title": "" }, { "docid": "dab8838d36a49e617cbf5570d35797ea", "score": "0.529994", "text": "function wrapValue(value) {\n var wrapCls;\n if (value instanceof Array &&\n value.length &&\n (wrapCls = getWrapClass(value[0]))) {\n var result = [];\n for (var i = 0; i < value.length; ++i)\n result.push(new wrapCls(value[i]));\n return result;\n }\n wrapCls = getWrapClass(value);\n return wrapCls ? new wrapCls(value) : value;\n}", "title": "" }, { "docid": "7165bf0327cf27872d6bd302cb1f1a37", "score": "0.5281763", "text": "function visitArrayLiteralExpression(node) {\n return visitElements(node.elements, /*leadingElement*/ undefined, /*location*/ undefined, node.multiLine);\n }", "title": "" }, { "docid": "c9a779a0a9eef6f988c2a1ec39ee2c1f", "score": "0.52816033", "text": "function listToArray(list) {\nvar arr = [];\nwhile (list.rest !== null) {\n arr.push(list.value);\n list = list.rest;\n}\narr.push(list.value);\nreturn arr;\n}", "title": "" }, { "docid": "c2f3d8a44bbcd5afe395661f51571cd8", "score": "0.5271164", "text": "function array(a, indent, nl) {\r\n for (var i = 0, output = ''; i < a.length; i++) {\r\n if (output) output += BR + indent +', ';\r\n output += value(a[i], indent, '');\r\n }\r\n if (!output) return '[]';\r\n return '<span class=\\'unfolded arr\\'><span class=content>' +\r\n (nl ? nl + indent : '') +'[ '+ output + BR +\r\n indent +']</span></span>';\r\n }", "title": "" }, { "docid": "cb4f63824cbd68496803c1cbb0a5c333", "score": "0.5268743", "text": "function arrayToList(array) {\n\t\tvar list = new pl.type.Term(\"[]\", []);\n\t\tfor (var i = array.length - 1; i >= 0; i--)\n\t\t\tlist = new pl.type.Term(\".\", [array[i], list]);\n\t\treturn list;\n\t}", "title": "" }, { "docid": "5bd40cbcd1317b9a266a1c6f792c4b6d", "score": "0.5268084", "text": "function wrapInArray(obj) {\n if (typeof obj === \"string\") {\n return [obj];\n // (parameter) obj: string\n }\n else {\n return obj;\n }\n }", "title": "" }, { "docid": "3574e22306d4d2c9da7164a8ef2a86b1", "score": "0.5265346", "text": "function fromNonEmptyArray(as) {\n return as;\n}", "title": "" }, { "docid": "bba9bc48357ef8219caee09c1f246919", "score": "0.52645", "text": "valueOf () {\n const ret = [];\n ret.push(...this);\n return ret\n }", "title": "" }, { "docid": "cd9af23e808546cca0ba305f512c78c6", "score": "0.5255213", "text": "valueOf() {\n const ret = [];\n ret.push(...this);\n return ret;\n }", "title": "" }, { "docid": "697e273526b9e946a8d2387cfdaded2e", "score": "0.5249863", "text": "asArray() {\n const result = [];\n this.toArray(result, 0);\n return result;\n }", "title": "" }, { "docid": "a2c3548258f67c395898cbc22452e4eb", "score": "0.5241129", "text": "toArray() {\r\n // copy\r\n return this.values.map((v) => v);\r\n }", "title": "" }, { "docid": "6b31be2cb263738da4881dae782d113c", "score": "0.5226955", "text": "toStrArray(array, level = 0, encloseValue = false) {\n var i, j, ref, str;\n str = \"[\";\n for (i = j = 0, ref = array.length; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {\n str += this.toStr(array[i], ++level, encloseValue);\n str += i < array.length - 1 ? \",\" : \"\";\n }\n str += \"]\";\n if (level === 0) {\n return this.toSingleQuote(str);\n } else {\n return str; // Single quotes added nnly when double quotes inside\n }\n }", "title": "" }, { "docid": "18971e0abcc0a6cee518c233b5574312", "score": "0.5222451", "text": "function array(it){\r\n\t return String(it).split(',');\r\n\t}", "title": "" }, { "docid": "eec78bc1252f110eb1c120a3dfe814fe", "score": "0.5216701", "text": "function inspect(value) {\n return formatValue(value, []);\n}", "title": "" }, { "docid": "7b51a824490ed741ada5c2534a12549d", "score": "0.5214905", "text": "normalizeEls(els) {\n\n\t\tif (typeof els === 'string') {\n\n\t\t\tels = utils.qsa(els);\n\n\t\t} else if (els.length) {\n\n\t\t\tels = els;\n\n\t\t} else {\n\n\t\t\tels = [els];\n\n\t\t}\n\n\t\treturn els;\n\n\t}", "title": "" }, { "docid": "1163875be1427cb2bbd749aed8470058", "score": "0.5214318", "text": "_coerceValue(value) {\n return value == null ? [] : coerceArray(value);\n }", "title": "" }, { "docid": "79295708cc6a7fd2c75e0ab69b34ff0f", "score": "0.5213454", "text": "function splitArray(el) {\r\n return el.toString().replace(/,/g, \" \");\r\n}", "title": "" }, { "docid": "08c4e181afb640dfc8c23ee89c8db6e6", "score": "0.5207387", "text": "convert(value) {\n return value instanceof expressionProperties_1.ArrayExpression ? value : new expressionProperties_1.ArrayExpression(value);\n }", "title": "" }, { "docid": "60de2c6cadf43e3416340cb6ac6ec860", "score": "0.51804954", "text": "valueOf () {\r\n const ret = [];\r\n ret.push(...this);\r\n return ret\r\n }", "title": "" }, { "docid": "20bc832109af32613ad87701b28360c9", "score": "0.51767683", "text": "function X(t) {\n return G(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\n}", "title": "" }, { "docid": "e1742f46b83c26cea7bcbbefccb2a0b4", "score": "0.5169891", "text": "function arrayWrap(obj) {\n var arr = [];\n arr.push(obj);\n return arr;\n}", "title": "" }, { "docid": "c12bc50c6ff6219a738b1c1b06a88f7b", "score": "0.51685727", "text": "function caml_js_to_array(a) { return raw_array_cons(a,0); }", "title": "" }, { "docid": "60a516200647d3e0a8d8a8bfecc01195", "score": "0.5165796", "text": "function items(array){\n return array.map(e => e = ' ' + e);\n }", "title": "" }, { "docid": "c62b98895764da4f3d5113adde325b59", "score": "0.51607156", "text": "function helper(arr) { \n\treturn arr.map(i => i.map( j => j).join('=')).join('\\n');\n}", "title": "" }, { "docid": "a17ad1fc41da041dd02f9abea8e8f4a2", "score": "0.5160096", "text": "unwrap(value, returnJson) {\n const values = this.crate.utils.asArray(value);\n var newValues = []\n for (let val of values) {\n if (val[\"@id\"]) {\n const target = this.crate.getItem(val[\"@id\"]);\n if (target) {\n if(target.name && !returnJson) {\n newValues.push(target.name);\n }\n else {\n // TODO - should this use a better serialiser\n newValues.push(JSON.stringify(target).replace(/\"/, '\\\"'));\n }\n }\n }\n else {\n newValues.push(val)\n }\n return newValues;\n }\n }", "title": "" }, { "docid": "3799a376364d571d4161701ef8ff3cf7", "score": "0.5142381", "text": "constructor(values = []) {\n this.length = 0;\n values.forEach((v) => {\n this.append(v);\n });\n // Ensure if you concat() a list it actually spreads like [...list] and thus\n // is flattened\n this[Symbol.isConcatSpreadable] = true;\n }", "title": "" }, { "docid": "afe8b0864d30a4073545418b2127df96", "score": "0.51355016", "text": "function array(it){\r\n return String(it).split(',');\r\n}", "title": "" }, { "docid": "7d04c590707c7b711b8c2129092531a1", "score": "0.51314265", "text": "function inspect(value) {\n return formatValue(value, []);\n}", "title": "" }, { "docid": "7d04c590707c7b711b8c2129092531a1", "score": "0.51314265", "text": "function inspect(value) {\n return formatValue(value, []);\n}", "title": "" }, { "docid": "7d04c590707c7b711b8c2129092531a1", "score": "0.51314265", "text": "function inspect(value) {\n return formatValue(value, []);\n}", "title": "" } ]
ca9913f5bb478f5fc4b62019c03acfef
Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00"
[ { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.7972269", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" } ]
[ { "docid": "0de39ac937fb97d0cfad64a2f7926b45", "score": "0.8442578", "text": "function isTime (s)\r\n{\r\n if (isEmpty(s)) \r\n if (isTime.arguments.length == 1) return defaultEmptyOK;\r\n else return (isTime.arguments[1] == true);\r\n if (isWhitespace(s)) return false;\r\n\r\n var vhora = new Array();\r\n var dd, mm, ss, c, i, j;\r\n\r\n j = 0;\r\n vhora[j] = \"\";\r\n\r\n for (i=0; i<s.length; i++) {\r\n c = s.charAt(i);\r\n\r\n if (c == \":\") {\r\n j++;\r\n vhora[j] = \"\";\r\n }else{\r\n vhora[j] += c;\r\n }\r\n }\r\n\r\n if (!(vhora.length >= 1 && vhora.length <= 3)) {\r\n return false;\r\n }\r\n\r\n hh = vhora[0];\r\n\r\n if (hh == \"\" || !(hh >= 00 && hh <= 23)) {\r\n return false;\r\n }\r\n\r\n\tif (vhora.length >= 2) {\r\n mm = vhora[1];\r\n\r\n if (mm == \"\" || !(mm >= 00 && mm <= 59)) {\r\n return false;\r\n }\r\n }\r\n\r\n\tif (vhora.length == 3) {\r\n ss = vhora[2];\r\n\r\n if (ss == \"\" || !(ss >= 00 && ss <= 59)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.7935016", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.7935016", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.7935016", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.7935016", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.7935016", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.7935016", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "24340b2e6386cced817a6ffeff36381a", "score": "0.79273945", "text": "function isTimeString(str) {\n return /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n }", "title": "" }, { "docid": "5b91855e1b3e2ae0f11c0c8d7522c7c8", "score": "0.79179007", "text": "function isTimeString(str) {\n\t\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n\t}", "title": "" }, { "docid": "e1f1d728added6a86d0e05f01400a85e", "score": "0.79169697", "text": "function isTimeString(str) {\r\n return typeof str === 'string' &&\r\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\r\n}", "title": "" }, { "docid": "e1f1d728added6a86d0e05f01400a85e", "score": "0.79169697", "text": "function isTimeString(str) {\r\n return typeof str === 'string' &&\r\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\r\n}", "title": "" }, { "docid": "e1f1d728added6a86d0e05f01400a85e", "score": "0.79169697", "text": "function isTimeString(str) {\r\n return typeof str === 'string' &&\r\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\r\n}", "title": "" }, { "docid": "d0972bbe8d0b45e29da2377f073c37ad", "score": "0.7893884", "text": "function validTime(str) {\n // write code here.\n const arr = str.split(\":\")\n if (arr[0] <= 24 && arr[1] < 60) {\n return true\n }\n return false\n}", "title": "" }, { "docid": "bdc3a9985608e776ff329ed002865de2", "score": "0.784084", "text": "function isTimeString(str) {\n\t\treturn typeof str === 'string' && /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n\t}", "title": "" }, { "docid": "567e1ca9700ba1bd97846730497a54d2", "score": "0.7834781", "text": "function validateTimeInput(timeInput){\n\tvar isValidTime = /^(((([0-1][0-9])|(2[0-3])):[0-5][0-9])|(24:00))/.test(timeInput);\n\treturn isValidTime;\n}", "title": "" }, { "docid": "a9efa1eb98ef5082b8edc463f1b68c39", "score": "0.7725869", "text": "function validTimeArne(str) {\n let hm = str.split(':')\n if (hm[0] < 24 && hm[0] >= 0 && hm[1] < 60 && hm[1] >= 0) return true\n return false\n}", "title": "" }, { "docid": "f74f360e47d0b7e5c355f44168839a36", "score": "0.7635148", "text": "function isValidTime(time) {\n\n var regex = /^(\\d{1,2}):(\\d{2})(?::?\\d{2})?\\s?([ap]m)?$/; // Remember match of HH MM AM/PM. Allow SS but do not remember for match.\n var parts;\n\n time = stripWhiteSpace(time).toLowerCase();\n if (time != '') {\n if (time.match(regex)) {\n parts = time.match(regex);\n hours = parts[1];\n minutes = parts[2];\n\n // 12-hour time format AM/PM\n if (parts[3]) {\n if (hours < 1 || hours > 12)\n return (false);\n } else {\n if (hours > 23)\n return (false);\n }\n\n if (minutes > 59)\n return (false);\n } else\n return (false);\n\n return (true);\n }\n}", "title": "" }, { "docid": "e09a59f9c40a409cf06bfc55e41a5234", "score": "0.7631387", "text": "function validate_time(str) {\nreturn /^([1-9]|1[0-2]):[0-5]d(:[0-5]d(.d{1,3})?)?$/.test(str);\n}", "title": "" }, { "docid": "2cf80545acdebe38a6bfba3512009908", "score": "0.7622113", "text": "function is_timeString()\r\n{\r\n var str = document.getElementById(\"time_is_timeString\").value;\r\n regexp = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/;\r\n\r\n if (regexp.test(str))\r\n {\r\n document.getElementById(\"result_is_timeString\").innerHTML = \"The result is : \" + true;\r\n }\r\n else\r\n {\r\n document.getElementById(\"result_is_timeString\").innerHTML = \"The result is : \" + false;\r\n }\r\n}", "title": "" }, { "docid": "1996c4b1c91509a4154ad772db53bf80", "score": "0.76201874", "text": "function checkIsTimeDay(str) {\n let hr = parseInt(str.split(\" \")[1].split(\":\")[0])\n return (hr >= 6 && hr <= 18);\n}", "title": "" }, { "docid": "8abae2726b1f1b0abd2e63ac62b39e2c", "score": "0.7554193", "text": "function isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}", "title": "" }, { "docid": "8abae2726b1f1b0abd2e63ac62b39e2c", "score": "0.7554193", "text": "function isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}", "title": "" }, { "docid": "4367dca34881d0f67ae42e97fff05655", "score": "0.7511978", "text": "function isValidTime(time){\n return !/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(time)\n}", "title": "" }, { "docid": "429cefad72336b13c1541e42c17776b7", "score": "0.74871254", "text": "function validTime(time) {\n\n const timeArr = time.split(\":\");\n return 0 <= timeArr[0] && 24 > timeArr[0] && 0 <= timeArr[1] && 60 > timeArr[1];\n\n}", "title": "" }, { "docid": "1b265560fd1f9285e76b28a3eeaaed70", "score": "0.74319607", "text": "function validTime(time) {\n if (Number(time.substring(0, 2)) < 24 && Number(time.substring(3, 5)) < 60)\n return true;\n return false;\n}", "title": "" }, { "docid": "68bd31972c40ae7ed6a56996bf073540", "score": "0.74240315", "text": "function isValidTime(value) {\n var colonCount = 0;\n var hasMeridian = false;\n for (var i = 0; i < value.length; i++) {\n var ch = value.substring(i, i + 1);\n if ((ch < '0') || (ch > '9')) {\n if ((ch != ':') && (ch != ' ') && (ch != 'a') && (ch != 'A') && (ch != 'p') && (ch != 'P') && (ch != 'm') && (ch != 'M')) {\n return false;\n }\n }\n if (ch == ':') { colonCount++; }\n if ((ch == 'p') || (ch == 'P') || (ch == 'a') || (ch == 'A')) { hasMeridian = true; }\n }\n if ((colonCount < 1) || (colonCount > 2)) { return false; }\n var hh = value.substring(0, value.indexOf(\":\"));\n if ((parseFloat(hh) < 0) || (parseFloat(hh) > 23)) { return false; }\n if (hasMeridian) {\n if ((parseFloat(hh) < 1) || (parseFloat(hh) > 12)) { return false; }\n }\n if (colonCount == 2) {\n var mm = value.substring(value.indexOf(\":\") + 1, value.lastIndexOf(\":\"));\n } else {\n var mm = value.substring(value.indexOf(\":\") + 1, value.length);\n }\n if ((parseFloat(mm) < 0) || (parseFloat(mm) > 59)) { return false; }\n if (colonCount == 2) {\n var ss = value.substring(value.lastIndexOf(\":\") + 1, value.length);\n } else {\n var ss = \"00\";\n }\n if ((parseFloat(ss) < 0) || (parseFloat(ss) > 59)) { return false; }\n return true;\n}", "title": "" }, { "docid": "4b8f44d753f28bbcef2d0d3fd8780dc4", "score": "0.7423696", "text": "function validTime(x) {\n\t//Matches to time format\n\tif(x.match(/[^\\d{1}\\:\\d{1,2}\\$]/)) {\n\t\talert(x + \" is invalid. Time should be formatted 0:00'\");\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "da6656d65fd79fa1a0e87007049e9735", "score": "0.7360447", "text": "function isTime(objTime){\n\tvar time = objTime.value;\n\tvar timePatern = /^(([0,1][0-9])|(2[0-3]))(:|\\.)(([0-5][0-9]))$/;\n\tvar matchArray = time.match(timePatern); // is the format ok?\n\n\tif(time.length == 0) return true;\n\n\ttime = time.replace('.', ':');\n\t \n\tif(matchArray == null){\n\t\talert(\"Invalid time?\");\n\t\tobjTime.value ='';\n\t\tobjTime.focus();\n\t\treturn false;\n\n\t} else {\n\t\tobjTime.value = time;\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "358418e9d86c60630adc6355155a18f8", "score": "0.73395705", "text": "function isValidTime(time){\n if (time === null || time.length === 0){\n return false;\n }\n if (time.indexOf('a') === -1 && time.indexOf('p') === -1){\n return false;\n }\n time = time.split(':');\n var hours;\n var minutes;\n var meridiem;\n if (time.length === 2){\n // 12:30pm\n hours = parseInt(time[0]);\n if (isNaN(hours) || hours < 1 || hours > 12){\n return false;\n }\n minutes = time[1];\n if (minutes.indexOf('p') !== 2 && minutes.indexOf('a') !== 2){\n return false;\n }\n minutes = parseInt(minutes);\n if (isNaN(minutes) || minutes < 0 || minutes > 59){\n return false;\n }\n return true;\n }else if (time.length === 1){\n // 12pm\n hours = parseInt(time[0]);\n if (isNaN(hours) || hours < 1 || hours > 12){\n return false;\n }\n minutes = \"00\";\n return true;\n } else{\n return false;\n }\n}", "title": "" }, { "docid": "8d4fa5f46fd4b557ddd6f294984ba195", "score": "0.7301867", "text": "function isValidTimeInput(input) {\n if (!input.value) {\n return false;\n }\n if (input.value.length != 5) { \n if (input.value.length == 4) {\n input.value = \"0\" + input.value;\n }\n else {\n return false; \n }\n }\n if (input.value[2] != \":\") {\n return false;\n }\n hrInput = input.value.substring(0, 2);\n minInput = input.value.substring(3, 5);\n if (isNaN(hrInput) || isNaN(minInput)) {\n return false;\n }\n if (hrInput < 0 || hrInput > 23 || minInput < 0 || minInput > 59) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "404e757a16c0da6a85787a2c916bd92b", "score": "0.72817636", "text": "function validateTime(myTime)\n{\n var sTmp=myTime;\n var iTmp1 = sTmp.indexOf(\":\");\n var iTmp2 = sTmp.lastIndexOf(\":\");\n var bValid;\n if (iTmp1 == -1)\n {\n bValid = false;\n }\n else\n {\n if (iTmp1 == iTmp2){\n var sTmp1 = sTmp.substr(0,iTmp1);\n var sTmp2 = sTmp.substr(iTmp1+1);\n bValid = ((!isNaN(sTmp1)) && (!isNaN(sTmp2)) && (sTmp1>=0) && (sTmp1<24) && (sTmp2>=0) && (sTmp2<60));\n }else{\n var sTmp1 = sTmp.substr(0,iTmp1);\n var sTmp2 = sTmp.substr(iTmp1+1,2);\n var sTmp3 = sTmp.substr(iTmp2+1);\n bValid = ((!isNaN(sTmp1)) && (!isNaN(sTmp2)) && (!isNaN(sTmp3)) && (sTmp1>=0) && (sTmp1<24) && (sTmp2>=0) && (sTmp2<60) && (sTmp3>=0) && (sTmp3<60));\n }\n }\n return bValid;\n}", "title": "" }, { "docid": "126228d89e4feac42b32b6ff3d384e16", "score": "0.72140986", "text": "function isValidInput(inputstr) {//works for both mm:ss and seconds input\r\n var i, letter,\r\n coloncounter = 0;\r\n\r\n if (!inputstr) {\r\n return false;\r\n }\r\n\r\n for (i = 0; i < inputstr.length; i) {//for each character in string\r\n letter = inputstr.charAt(i);\r\n if (letter === ':') {\r\n coloncounter++;\r\n }\r\n if (coloncounter > 1 || (isNaN(parseFloat(letter)) && letter != \".\" && letter != ':')) {//if too many colons, or any \r\n return false;//if too many colons or any character invalid\r\n }\r\n i = i + 1;\r\n }\r\n return true;//no problems!!\r\n }", "title": "" }, { "docid": "b39c5b815176b660cf1769a64f871fa8", "score": "0.7116677", "text": "function qfs_isTimeUUMM(inputObj) {\n\tvar input = inputObj.value;\n\tvar hour;\n\tvar minute;\n\n\tvar match1 = /^[0-9][0-9]:[0-9][0-9]$/;\n\tvar match2 = /^[0-9]:[0-9][0-9]$/;\n\tvar match3 = /^[0-9][0-9]:[0-9]$/;\n\tvar match4 = /^[0-9]:[0-9]$/;\n\n\tif (match2.test(input) || match4.test(input)) {\n\t\tinput = \"0\" + input;\n\t}\n\n\tif (match1.test(input)) {\n\t\thour = input.substring(0,2);\n\t\tminute = input.substring(3,5);\n\t} else if (match3.test(input)) {\n\t\thour = input.substring(0,2);\n\t\tminute = \"0\" + input.substring(3,4);\n\t} else {\n\t\treturn false;\n\t}\n\n\tif (hour > 23) {return false;}\n\tif (minute > 59) {return false;}\n\n\tinputObj.value = hour + \":\" + minute;\n\n\treturn true;\n}", "title": "" }, { "docid": "0954e4c5ca5569bf52bf4e2f1031a668", "score": "0.70343167", "text": "function isValidTime(strTime, format)\n{\n\n strTime = trimStr(strTime);\n\n var hh, mm, ss;\n\n\n //extract hours , mins and secs from given time string.\n switch (format)\n {\n case 0:\n pattern = '^[0-9]{2}\\\\:[0-9]{2}\\\\:[0-9]{2}$';\n timePatt = new RegExp(pattern, '');\n\n if (timePatt.test(strTime))\n {\n arrTime = strTime.split(':');\n hh = arrTime[1];\n mm = arrTime[0];\n ss = arrTime[2];\n\n } else\n {\n return false;\n }\n break;\n case 1:\n pattern = '^[0-9]{2}\\\\:[0-9]{2}$';\n timePatt = new RegExp(pattern, '');\n\n if (timePatt.test(strTime))\n {\n arrTime = strTime.split(':');\n hh = arrTime[1];\n mm = arrTime[0];\n return true;\n } else\n {\n return false;\n }\n break;\n\n default :\n return false;\n\n }\n\n\n\n if (hh >= 24 || mm >= 60 || ss >= 60)\n {\n return false;\n }\n\n return true;\n\n}", "title": "" }, { "docid": "a2f36ec6d0d3b9b7f7810ae9d621897b", "score": "0.6992416", "text": "function\nMainTimeVerify(InString)\n{\n var a;\n var hour, minute, second;\n \n if ( null == InString ) {\n\treturn MainTimeInvalidFormat;\n }\n\n a = InString.split(':');\n if ( a.length != 2 && a.length != 3 ) {\n\treturn MainTimeInvalidFormat;\n }\n\n for ( i = 0 ; i < a.length; i++ ) {\n if ( a[i] == \"\" ) {\n return MainTimeInvalidFormat;\n }\n }\n second = 0;\n hour = parseInt(a[0], 10);\n minute = parseInt(a[1], 10);\n if ( a.length == 3 ) {\n\tsecond = parseInt(a[2], 10);\n }\n if ( hour > 23 ) {\n\treturn MainTimeInvalidHour;\n }\n if ( minute > 59 ) {\n\treturn MainTimeInvalidMinute;\n }\n if ( second > 59 ) {\n\treturn MainTimeInvalidSecond;\n }\n return MainTimeOK;\n}", "title": "" }, { "docid": "fa75cfa0fb073dc762d1f2b6c3898cb5", "score": "0.6984077", "text": "function isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}", "title": "" }, { "docid": "fa75cfa0fb073dc762d1f2b6c3898cb5", "score": "0.6984077", "text": "function isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}", "title": "" }, { "docid": "1fe321f777ae760ae983bb51948240a4", "score": "0.68835306", "text": "function isDateTime (s)\r\n{\r\n\ts = s.split(\" \");\r\n\ts1 = s[0];\r\n\ts2 = s[1];\r\n\tif (!isDate(s1) || !isTime(s2)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n}", "title": "" }, { "docid": "32c3ecd88b7efdb1e6cfdde5730df34f", "score": "0.6878305", "text": "function checkTime(fieldid) {\n // see https://stackoverflow.com/questions/5563028/how-to-validate-with-javascript-an-input-text-with-hours-and-minutes\n var isValid = /^((([0-1]?[0-9]|2[0-4]):)?([0-5]?[0-9]):)?([0-5][0-9])(.[0-9]*)?$/.test($(fieldid).val());\n\n if (isValid) {\n $(fieldid).addClass('valid');\n $(fieldid).removeClass('invalid');\n \n // prepend 00: until three time parts, i.e., need hh:mm:ss\n var timeparts = $(fieldid).val().split(':');\n while (timeparts.length < 3) {\n timeparts.splice(0,0,'00');\n };\n $(fieldid).val(timeparts.join(':'));\n } else {\n $(fieldid).addClass('invalid');\n $(fieldid).removeClass('valid');\n }\n \n return isValid;\n}", "title": "" }, { "docid": "3b41c99d9dd8aa6a14c9a2e4f344e845", "score": "0.68584657", "text": "function isUnitTime(time, limit) {\n // time ==== hour, sec or min\n // limit ==== can be 24 or 60 which tell what to check hour or min/sec\n // it will check the input is valid or not. as hour,min or sec\n try {\n if (time.constructor === String) {\n time = Number(time);\n }\n if (\n time.constructor === Number &&\n time < limit &&\n time >= 0 &&\n !(time % 1)\n ) {\n return time;\n }\n } catch (error) {\n return false;\n }\n return false;\n }", "title": "" }, { "docid": "4e7d95294135d45ed71a177b9406d764", "score": "0.683275", "text": "function ValidateAdvancedTime(time, formatType){\n\ttime = time.replace(\".\", \":\");\n\tvar newTime = time.substring(0, (time.indexOf(\":\") + 3)); // Strip out the seconds\n\tvar status = ValidateTime(newTime, formatType);\n\t\n\tif(status == false) \n\t\treturn false;\n\t\t\n\tvar seconds = time.substring(time.indexOf(\":\") + 4, time.length);\n\tif(seconds.length > 2) \n\t\tseconds = seconds.substring(0, 2); // Remove any AM/PM afterwards\n\t\t\n\tif(!isNaN(seconds)) {\t\t\t // Make sure its a number and it's between 0 and 59\n\t\tif((seconds <= 59) && (seconds >= 0)) \n\t\t\treturn true;\n\t}\n\treturn false;\t\n}", "title": "" }, { "docid": "4178a417a7795467aa9a0233ef5fb9ff", "score": "0.67513245", "text": "function ValidateTime(time, formatType) {\n\tvar segments;\t\t\t// Break up of the time into hours and minutes\n\tvar hour;\t\t\t\t\t// The value of the entered hour\n\tvar minute;\t\t\t\t// The value of the entered minute\n\t\t\n\ttime = time.replace(\".\", \":\");\n\t\t\n\tif (formatType == 1) {\t\t\t\t\t\t /* Validating standard time */\n\t\tsegments = time.split(\":\");\n\t\t\n\t\tif (segments.length == 2) {\n\t\t\tsegments[1] = segments[1].substring(0,2);\n\t\t\thour = segments[0];\t\t\t\t // Test the hour\n\t\t\tif ((hour > 12) || (hour < 1)) \n\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\tminute = segments[1];\t\t\t // Test the minute\n\t\t\tif (( minute <= 59) && (minute >= 0)) \n\t\t\t\treturn true;\n\t\t}\n\t\t\t\n\t}\n\telse {\t\t\t\t\t\t\t\t\t\t\t\t /* Validating military time */\n\t\tsegments = time.split(\":\");\n\t\t\n\t\tif (segments.length == 2) {\n\t\t\thour = segments[0];\t\t\t\t // Test the hour\n\t\t\tif ((hour > 23) || (hour <= -1)) \n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\tminute = segments[1];\t\t\t // Test the minute\n\t\t\tif (( minute <= 59) && (minute >= 0)) \n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "c4daef707bf862f6f53f4f1acfd1d21f", "score": "0.6741056", "text": "function validateMinuteSecond(inputField) {\r\n var isValid = false;\r\n if (inputField.match(/^([0-5][0-9]:[0-5][0-9])$/)) {\r\n isValid = true;\r\n } else {\r\n isValid = false;\r\n }\r\n return isValid;\r\n}", "title": "" }, { "docid": "6af1ba299b1832c0f6af7eaf40b0f14c", "score": "0.6611478", "text": "function doTimeTest( t, type ) {\n \n var d = new Date( t );\n var r = false;\n\n switch ( type ) {\n case \"working\":\n r = ( d.getDay() > 0 && d.getDay() < 6 && \n ( ( d.getHours() >= 10 && d.getHours() <= 16 ) || \n ( d.getHours() == 9 && d.getMinutes() >= 30 ) ||\n ( d.getHours() == 17 && d.getMinutes() < 30 ) \n ) );\n break;\n\n case \"daytime\":\n r = ( d.getHours() >= 8 && d.getHours() < 22 );\n break;\n\n default:\n r = true;\n } \n\n return r;\n}", "title": "" }, { "docid": "cc3c6c9282e20e193ffc9134ed12d9d9", "score": "0.6534249", "text": "function parseTimeString(value) {\n if (!value) {\n return false;\n }\n let tempVal = value.split('.');\n if (tempVal.length === 1) {\n // Ideally would handle more cleanly than this but for now handle case where ms not set\n tempVal = [tempVal[0], '0'];\n }\n else if (tempVal.length !== 2) {\n return false;\n }\n let msString = tempVal[1];\n let msStringEnd = msString.length < 3 ? msString.length : 3;\n let ms = parseInt(tempVal[1].substring(0, msStringEnd), 10);\n tempVal = tempVal[0].split(':');\n if (tempVal.length !== 3) {\n return false;\n }\n let h = parseInt(tempVal[0], 10);\n let m = parseInt(tempVal[1], 10);\n let s = parseInt(tempVal[2], 10);\n return ms + (h * msInH) + (m * msInM) + (s * msInS);\n}", "title": "" }, { "docid": "06c8682c299f664af00cf7f8df9a8995", "score": "0.63913095", "text": "function checkAndConvertTime(timeString) {\n var minutes = null;\n // Check that input is a valid hh:mm\n var isValid = /^([01]\\d|2[0-3]):?([0-5]\\d)$/.test(timeString);\n if (isValid) {\n // Convert hh:mm to an int representing minutes\n var half = timeString.split(\":\");\n minutes = +half[0] * 60 + +half[1];\n }\n return minutes;\n}", "title": "" }, { "docid": "1610537c33c2f95b14c19dd451e33896", "score": "0.63570607", "text": "function validaHora(hora) {\r\n if (/(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]/.test(hora)) {\r\n return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "6c14c17da5cd2ccb86ee72bfe7b0157e", "score": "0.6354633", "text": "function durationHasTime(dur) {\r\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\r\n}", "title": "" }, { "docid": "6c14c17da5cd2ccb86ee72bfe7b0157e", "score": "0.6354633", "text": "function durationHasTime(dur) {\r\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\r\n}", "title": "" }, { "docid": "6c14c17da5cd2ccb86ee72bfe7b0157e", "score": "0.6354633", "text": "function durationHasTime(dur) {\r\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\r\n}", "title": "" }, { "docid": "51e25abdf522660ca94c3ff4d8b3ad14", "score": "0.63380045", "text": "function durationHasTime(dur) {\n\t\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n\t}", "title": "" }, { "docid": "51e25abdf522660ca94c3ff4d8b3ad14", "score": "0.63380045", "text": "function durationHasTime(dur) {\n\t\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n\t}", "title": "" }, { "docid": "ccc948cdd5f9891f8bc74bd2d70d6416", "score": "0.63374615", "text": "function testingDateTimeStr(str) {\n if (str) {\n console.log('validating datetime.');\n var t = str.match(/[0-1]\\d\\/[0-3]\\d\\/\\d{4} [0-1]\\d:[0-5]\\d[AaPp][Mm]/);\n if (t === null)\n return false;\n\n return true;\n } else {\n console.log('datetime not available to validate.');\n return true;\n }\n }", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.6334779", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.6313068", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.6313068", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.6313068", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.6313068", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.6313068", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.6313068", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "e9a30323fa92bbd94d877850c691b816", "score": "0.62945735", "text": "function is_tmstmp(input){\n var re = /^\\d{10}$/;\n console.log(re.test(input)+' tesing TIMESTAMP');\n return re.test(input);\n}", "title": "" }, { "docid": "667a12c990c4c29327299401762927be", "score": "0.6286455", "text": "function validTime() {\r\n // todo: write logic\r\n curTime = moment().tz('America/Los_Angeles')\r\n hourOfDay = parseInt(curTime.format('HH'))\r\n startHour = 19\r\n if (curTime.days() == 6 || curTime.days() == 7) {\r\n startHour = 15\r\n }\r\n return !(hourOfDay>=12 && hourOfDay<startHour)\r\n}", "title": "" }, { "docid": "5a2e49a6b9a249d0d0dbac59c030dcc9", "score": "0.6275055", "text": "function IsValidTime(timeStr) \n{\n // Checks if time is in HH:MM:SS AM/PM format.\n // The seconds and AM/PM are optional.\n\n var timePat = /^(\\d{1,2}):(\\d{2})(:(\\d{2}))?(\\s?(AM|am|PM|pm))?$/;\n\n var matchArray = timeStr.match(timePat);\n if (matchArray == null)\n {\n alert(\"Time is not in a valid format.\");\n return false;\n }\n hour = matchArray[1];\n minute = matchArray[2];\n second = matchArray[4];\n ampm = matchArray[6];\n\n if (second==\"\") { second = null; }\n if (ampm==\"\") { ampm = null }\n\n if (hour < 0 || hour > 23)\n {\n alert(\"Hour must be between 1 and 12. (or 0 and 23 as 24-hours time)\");\n return false;\n }\n// if (hour <= 12 && ampm == null) \n// {\n// if (confirm(\"Please indicate which time format you are using. OK = Standard Time, CANCEL = 24 Hours Time\")) \n// {\n//// alert(\"You must specify AM or PM. Press OK = AM, CANCEL = PM\");\n//// return false;\n// if(confirm(\"You must specify AM or PM. Press OK = AM, CANCEL = PM\"))\n// {\n// document.getElementById('txtTime').value = timeStr + \" AM\";\n// }\n// else\n// {\n// document.getElementById('txtTime').value = timeStr + \" PM\";\n// }\n// }\n// }\n if (hour > 12 && ampm != null)\n {\n alert(\"You can't specify AM or PM for military time.\");\n return false;\n }\n if (minute<0 || minute > 59)\n {\n alert (\"Minute must be between 0 and 59.\");\n return false;\n }\n if (second != null && (second < 0 || second > 59)) \n {\n alert (\"Second must be between 0 and 59.\");\n return false;\n }\n return false;\n}", "title": "" }, { "docid": "829a2be2d4c2b21a2057f2a427479d6b", "score": "0.62710303", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n }", "title": "" }, { "docid": "d7eb75bc1eacfe1939736c906f702517", "score": "0.6232757", "text": "function checkTime(inputTime){\n\tvar parseText = inputTime.split(\" \");\n\treturn new Date(parseInt(parseText[2]), changeMonth(parseText[0]), parseInt(parseText[1]));\n}", "title": "" }, { "docid": "2ec25cb15bfc6cd3f5847e72c9d6a772", "score": "0.6225488", "text": "function isTime(req, res, next){\n const { data = {} } = req.body;\n \n if (/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(data['reservation_time']) || /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/.test(data['reservation_time']) ){\n return next();\n }\n next({ status: 400, message: `Invalid reservation_time` });\n}", "title": "" }, { "docid": "b53b76036d3b302622acd57dc80c2874", "score": "0.619463", "text": "function isDateOrTime(value) {\n return Atomic.dateTime.matches(value) || Atomic.date.matches(value) || Atomic.time.matches(value);\n }", "title": "" }, { "docid": "c7a527ffd9b9161be0393d84b9162672", "score": "0.6184758", "text": "function greet(inputTime) {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt\n // https://stackoverflow.com/questions/8232776/javascript-split-string-to-array-of-int\n let parsedTime = parseInt(inputTime.split(\":\")); \n \n if(parsedTime < 12){\n return \"Good Morning\"; \n }\n\n else if(parsedTime >= 12 && parsedTime <= 17){\n return \"Good Afternoon\"; \n }\n\n else if(parsedTime > 17){\n return \"Good Evening\"; \n }\n}", "title": "" }, { "docid": "81f3eb8a30f04d576b109fdfa87b4913", "score": "0.6130844", "text": "compareStartTime(time, timeArr) {\r\n const hr = Number(time.slice(0,2));\r\n const min = Number(time.slice(3,5));\r\n const sec = Number(time.slice(6,8));\r\n \r\n if (hr == timeArr[0]) {\r\n if (min > timeArr[1]) {\r\n return true;\r\n } else if (min < timeArr[1]) {\r\n return false;\r\n } else {\r\n return true; //sec >= timeArr[2];\r\n }\r\n } else if (hr > timeArr[0]) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "3b70b3d7d8e99ca603fb8cf6b252dec1", "score": "0.61266965", "text": "function TestTime(test)\n{\nvar hrs = test.value.substring(2,0); \nvar min = test.value.substring(3,5);\nif(hrs <1 || hrs > 12)\n{\nalert('Invalid Time Format');\ntest.focus();\nreturn false;\n}\nif(min >59)\n{\nalert('Invalid Time Format');\ntest.focus();\nreturn false;\n}\nreturn;\n}", "title": "" }, { "docid": "bc2ea650f85be2e4a86123b6285e24d5", "score": "0.6109343", "text": "function is_hoursinput(elt) {\n if (!is_input(elt)) {\n return false;\n }\n return is_class(elt,'hours');\n}", "title": "" }, { "docid": "08b9dfc19733948ba7b65e0ee2673843", "score": "0.61079365", "text": "function checktime(timeLine){\n switch (timeLine){\n case \"8:00\" : return 1;\n case \"9:00\" : return 2;\n case \"10:00\": return 3;\n case \"11:00\": return 4;\n case \"12:00\": return 5;\n case \"13:00\": return 6;\n case \"14:00\": return 7;\n case \"15:00\": return 8;\n case \"16:00\": return 9;\n case \"17:00\": return 10;\n default: return 0;\n }\n }", "title": "" }, { "docid": "0f9c858e1490549f3ebab5a823bd0ca8", "score": "0.61008173", "text": "function isTimeAnInt(arr) {\n\n\tif (isNaN(arr[2])) {\n\t\talert(\"'Cooking time' must be a number representing minutes. e.g. '90'.\");\n\t\treturn false;\n\t} \n\telse {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "06396fa404cb5e05300b432ac487af74", "score": "0.60898924", "text": "function checkFieldForSimpleTimeMinutes(thetextfield , alerttext) {\n field = eval(thetextfield);\n var text = new String(field.value);\n re = /^\\s*(\\d+\\s*[dD])?\\s*(\\d+\\s*[hH])?\\s*(\\d+\\s*[mM])?\\s*$/;\n if (re.exec(text)) {\n\t return true;\n }\n alert(alerttext);\n return false;\n}", "title": "" }, { "docid": "8e3844cdda67afd70ac67a4dc91eecae", "score": "0.6083799", "text": "function greet(StringOfTime) {\n let times = StringOfTime.split(\" \");\n console.log(times);\n let hour = parseInt(times[0]);\n console.log(hour);\n if (hour < 12) {\n return \"Good Morning\";\n } else if ([12, 13, 14, 15, 16, 17].includes(hour)) {\n return \"Good Afternoon\";\n } else {\n return \"Good Evening\";\n }\n}", "title": "" }, { "docid": "289e8dcaf6eb6ef553d13d7e3647b3cb", "score": "0.607794", "text": "function IsValidTime(timeStr, txtno) \n{\n // Checks if time is in HH:MM:SS AM/PM format.\n // The seconds and AM/PM are optional.\n\n var timePat = /^(\\d{1,2}):(\\d{2})(:(\\d{2}))?(\\s?(AM|am|PM|pm))?$/;\n var strtxt = 'txt' + txtno;\n var matchArray = timeStr.match(timePat);\n \n if (matchArray == null)\n {\n alert(\"Time is not in a valid format.\");\n return false;\n }\n \n hour = matchArray[1];\n minute = matchArray[2];\n second = matchArray[4];\n ampm = matchArray[6];\n\n if (second==\"\") { second = null; }\n if (ampm==\"\") { ampm = null }\n\n if (hour < 0 || hour > 23)\n {\n alert(\"Hour must be between 1 and 12. (or 0 and 23 as 24-hours time)\");\n return false;\n }\n// if (hour <= 12 && ampm == null) \n// {\n// if (confirm(\"Please indicate which time format you are using. OK = Standard Time, CANCEL = 24 Hours Time\")) \n// {\n//// alert(\"You must specify AM or PM. Press OK = AM, CANCEL = PM\");\n//// return false;\n// if(confirm(\"You must specify AM or PM. Press OK = AM, CANCEL = PM\"))\n// {\n// document.getElementById('txtTime').value = timeStr + \" AM\";\n// }\n// else\n// {\n// document.getElementById('txtTime').value = timeStr + \" PM\";\n// }\n// }\n// }\n if (hour > 12 && ampm != null)\n {\n alert(\"You can't specify AM or PM for military time.\");\n return false;\n }\n if (minute<0 || minute > 59)\n {\n alert (\"Minute must be between 0 and 59.\");\n return false;\n }\n if (second != null && (second < 0 || second > 59)) \n {\n alert (\"Second must be between 0 and 59.\");\n return false;\n }\n return false;\n}", "title": "" }, { "docid": "d90a6eaeab0555b1a17a6ebb2f778703", "score": "0.6074946", "text": "function isValidTime(obj){\n\t if(typeof obj == \"string\"){\n\t\t obj = document.getElementById(obj);\n\t }\n\tvar valid = true;\n\tvar valstr = obj.value;\n\tif (!isWhitespace(valstr)) {\n\t\tvar validTimeExp = /^\\d{4}$/;//0105\n\t \n\t var tmp = \"\";\n\t var hr = 0;\n\t var min = 0;\n\t var indx = -1;\n\t var flgTm = 0;\n\t // STEP 1 - CHECK TO SEE IF THE LENGTH IS BETWEEN 3 AND 5\n\t if (valstr.length < 3 || valstr.length > 5){\n\t \tflgTm = 1;\n\t }\n\t // STEP 2 - PARSE THE TIME INTO IT'S COMPONENTS\n\t if (flgTm < 1) \n\t {\n\t\t\t\tif (valstr.indexOf(\":\") != -1) indx = valstr.indexOf(\":\");\n\t\t\t\telse if (!validTimeExp.test(obj.value)) flgTm = 1;\n\t\t\t\t\n\t\t\t\tif (flgTm < 1){\n\t\t\t\t if (indx <0)\n\t\t\t\t \tindx =2;\n\t\t\t\t hr = valstr.substring(0,indx);\n\t\t\t\t if (hr.length < 2) hr = \"0\" + hr;\n\t\t\t\t if (valstr.indexOf(\":\") != -1)\n\t\t\t\t\t min = valstr.substring(indx+1);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmin = valstr.substring(indx);\n\t\t\t\t if (min.length == 0) min = \"00\";\n\t\t\t\t if (min.length < 2) min = \"0\" + min;\n\t\t\t\t}\n\t\t\t\t\n\t }\n\t // STEP 3 - CHECK TO SEE THAT THE COMPONENTS ARE GOOD\n\t if (flgTm < 1)\n\t {\n\t\t\t\tif (isNaN(hr)) flgTm = 1;\n\t\t\t\tif (isNaN(min)) flgTm = 1;\n\t\t\t\tif (hr < 0 || hr > 23) flgTm = 1;\n\t\t\t\tif (min < 0 || min > 59) flgTm = 1;\n\t\t}\n\t if (flgTm > 0)\n\t {\n\t \tvalid = false;\n\t }\n\t else {\n\t\t\tobj.value = hr + \":\" + min;\n\t\t\tvalid = true;\n\t }\n\t}\n\treturn valid;\n}", "title": "" }, { "docid": "a0bc859bd82d77317eba43ee5ad786a1", "score": "0.6049251", "text": "function isTimeFormatFieldDef(fieldDef) {\n const formatType = (isPositionFieldDef(fieldDef) && fieldDef.axis && fieldDef.axis.formatType) ||\n (isMarkPropFieldDef(fieldDef) && fieldDef.legend && fieldDef.legend.formatType) ||\n (isTextFieldDef(fieldDef) && fieldDef.formatType);\n return formatType === 'time' || (!formatType && isTimeFieldDef(fieldDef));\n}", "title": "" }, { "docid": "ddadb49701cb7564c64c19634c22e5e2", "score": "0.6032849", "text": "timeIgnore(date){\n\t\t\tif(moment(date,'HH:mm:ss').isBetween(moment('09:30:00','HH:mm:ss'),moment('11:30:00','HH:mm:ss')) || \n\t\t\t\tmoment(date,'HH:mm:ss').isBetween(moment('13:00:00','HH:mm:ss'),moment('15:00:00','HH:mm:ss'))) return false;\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "669173e98e9022a805561971aacd80be", "score": "0.6032204", "text": "checkTime() {\n let time = this.props.weatherInfo.time.split(\":\");\n var hours = 0;\n if (time[1].includes(\"PM\") && parseInt(time[0]) === 12) {\n hours = parseInt(time[0]);\n } else if (time[1].includes(\"AM\") && parseInt(time[0]) === 12) {\n hours = parseInt(time[0]) + 12;\n } else if (time[1].includes(\"PM\")) {\n hours = parseInt(time[0]) + 12;\n } else {\n hours = parseInt(time[0]);\n }\n return hours;\n }", "title": "" }, { "docid": "051c083184c9b6861d8ddaac251d8cd6", "score": "0.6020958", "text": "function T(a){return/^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(a)}", "title": "" } ]
0f000c1e1de803a66757bb28e8388f94
Validates the provided positional argument is an object, and its keys and values match the expected keys and types provided in optionTypes.
[ { "docid": "5e1097ae3eaa92062b0e74e4ea1c1040", "score": "0.0", "text": "function validateOptionNames(functionName, options, optionNames) {\n forEach(options, function (key, _) {\n if (optionNames.indexOf(key) < 0) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Unknown option '\" + key + \"' passed to function \" + functionName + \"(). \" +\n 'Available options: ' +\n optionNames.join(', '));\n }\n });\n}", "title": "" } ]
[ { "docid": "08be095de01e20b3ebec5ddbf7fccc63", "score": "0.6590858", "text": "function validateObject(arg, value, options) {\n if (!validateOptional(value, options)) {\n if (!util_1.isObject(value)) {\n throw new Error(invalidArgumentMessage(arg, 'object'));\n }\n }\n}", "title": "" }, { "docid": "79e3be76dde9eefded36cbfd9d85d51c", "score": "0.5956772", "text": "function validateSchemaTypeOptions(obj) {\n\t\t var doc = obj[KEYWORD_DOC]\n\t\t , docType = typeof doc\n\t\t , optional = obj[KEYWORD_OPTIONAL]\n\t\t , optionalType = typeof optional;\n\t\t \n\t\t if ((docType !== \"undefined\") && \n\t\t \t\t(Object.prototype.toString.call(doc) !== JS_TYPE_STRING)) {\n\t\t \t\n\t\t throw \"The 'doc' field's value must be of type string: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t if ((optionalType !== \"undefined\") && \n\t\t \t\t(Object.prototype.toString.call(optional) !== JS_TYPE_BOOLEAN)) {\n\t\t \t\n\t\t throw \"The 'optional' field's value must be of type boolean: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t}", "title": "" }, { "docid": "43649df0dfee6866ff5a62a588663e9d", "score": "0.58379775", "text": "function validateSchemaOptions(obj) {\n var doc = obj[KEYWORD_DOC]\n , docType = typeof doc\n , optional = obj[KEYWORD_OPTIONAL]\n , optionalType = typeof optional;\n \n if ((docType !== \"undefined\") && \n (Object.prototype.toString.call(doc) !== JS_TYPE_STRING)) {\n \n throw \"The 'doc' field's value must be of type string: \" + \n JSON.stringify(obj);\n }\n \n if ((optionalType !== \"undefined\") && \n (Object.prototype.toString.call(optional) !== JS_TYPE_BOOLEAN)) {\n \n throw \"The 'optional' field's value must be of type boolean: \" + \n JSON.stringify(obj);\n }\n }", "title": "" }, { "docid": "6ffed32acb6fa8603e931f1a979997c4", "score": "0.579959", "text": "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "title": "" }, { "docid": "6ffed32acb6fa8603e931f1a979997c4", "score": "0.579959", "text": "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "title": "" }, { "docid": "6ffed32acb6fa8603e931f1a979997c4", "score": "0.579959", "text": "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "title": "" }, { "docid": "fa30c7e777bb3d898888746d00417488", "score": "0.5786481", "text": "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n}", "title": "" }, { "docid": "fa30c7e777bb3d898888746d00417488", "score": "0.5786481", "text": "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n}", "title": "" }, { "docid": "fa30c7e777bb3d898888746d00417488", "score": "0.5786481", "text": "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n}", "title": "" }, { "docid": "fa30c7e777bb3d898888746d00417488", "score": "0.5786481", "text": "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n}", "title": "" }, { "docid": "fa30c7e777bb3d898888746d00417488", "score": "0.5786481", "text": "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n}", "title": "" }, { "docid": "fa30c7e777bb3d898888746d00417488", "score": "0.5786481", "text": "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n}", "title": "" }, { "docid": "1a5875f8f58e3ce3130e47c250dc8005", "score": "0.5762542", "text": "function validateParameters(requiredParams, obj) {\r\n const array = [];\r\n\r\n for (const param of requiredParams) {\r\n if (obj[param] === undefined) {\r\n array.push(param);\r\n }\r\n // additional dependency for radio and dropdown input type\r\n if ((param == 'radio' || param == 'dropdown') &&\r\n (obj.selections === undefined || obj.selections.length <= 0)) {\r\n array.push('selections');\r\n }\r\n }\r\n\r\n if (array.length > 0) {\r\n throw {type: 'missing params', arr: array, o: obj};\r\n }\r\n }", "title": "" }, { "docid": "51f0320f28e0797cea35207d94d759fc", "score": "0.57591784", "text": "function typeCheckObject(param, paramName) {\n if ((typeof param === 'undefined' ? 'undefined' : _typeof(param)) !== 'object') {\n throw new error.InvalidParameterError('Parameter ' + paramName + ' must be a well defined JSON object. ' + 'Object: ' + param);\n }\n}", "title": "" }, { "docid": "7a239ef75b23ad4eb9c4c4e30fd7fc27", "score": "0.57148945", "text": "function validateOptions(\n options: ?Object\n): { options: Options, errors: Array<string> } {\n options = {\n ...defaultOptions,\n ...options\n };\n const errors = [];\n if (\n \"width\" in options &&\n (typeof options.width !== \"number\" || options.width <= 0)\n ) {\n errors.push(\"option width should be a positive number\");\n delete options.width;\n }\n if (\n \"height\" in options &&\n (typeof options.height !== \"number\" || options.height <= 0)\n ) {\n errors.push(\"option height should be a positive number\");\n delete options.height;\n }", "title": "" }, { "docid": "061e6e372cbb384e78dbd5e51351048e", "score": "0.56464237", "text": "function validateProperty(object, name, typeName, values = []) {\n if (!object.hasOwnProperty(name)) {\n throw Error(`Missing property '${name}'`);\n }\n const value = object[name];\n if (typeName !== void 0) {\n let valid = true;\n switch (typeName) {\n case 'array':\n valid = Array.isArray(value);\n break;\n case 'object':\n valid = typeof value !== 'undefined';\n break;\n default:\n valid = typeof value === typeName;\n }\n if (!valid) {\n throw new Error(`Property '${name}' is not of type '${typeName}'`);\n }\n if (values.length > 0) {\n let valid = true;\n switch (typeName) {\n case 'string':\n case 'number':\n case 'boolean':\n valid = values.includes(value);\n break;\n default:\n valid = values.findIndex(v => v === value) >= 0;\n break;\n }\n if (!valid) {\n throw new Error(`Property '${name}' is not one of the valid values ${JSON.stringify(values)}`);\n }\n }\n }\n}", "title": "" }, { "docid": "b1dcbfea0a83e51e7b175ead53dbb143", "score": "0.5636092", "text": "function argChecks(obj) {\n if (!obj) {\n throw new Error(\"data argument was not supplied\");\n }\n\n if (typeof obj !== \"object\") {\n throw new Error(`requires an object for data you sent a ${typeof obj}`);\n }\n\n if (Array.isArray(obj)) {\n throw new Error(`requires an object for data you sent an array`);\n }\n\n if (!obj.title) {\n throw new Error(\"data must have at least a title field\");\n }\n}", "title": "" }, { "docid": "9460c24ce399cfc788f43f383ce88489", "score": "0.563297", "text": "function checkValuesType(options, valueType){\n for(var i=0, len = options.length; i < len; i++){\n var currData = options[i];\n for(var prop in currData){\n if(typeof(currData[prop]) != valueType){\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "f47bd48f9637e7eb168001ccfc591760", "score": "0.56218034", "text": "function checkValidObject(obj) {\n if (\n !obj || !obj.constructor.name == 'GeoCordinate' || !obj.hasOwnProperty('latitude') || !obj.hasOwnProperty('longitude')) {\n throw new Error(\"Arguments should be valid GeoCordinate elements.\");\n }\n }", "title": "" }, { "docid": "d4d7f3e1d77c8900ed83da3b5f331548", "score": "0.5583064", "text": "function validateArgumentType(arg, argName, expectedType) {\n if (typeof arg === 'undefined') {\n throw new Error('Missing argument: ' + argName + '. ' +\n 'Expected type: ' + expectedType + '.');\n } else if (typeof arg !== expectedType) {\n throw new Error('Invalid argument: ' + argName + '. ' +\n 'Expected type: ' + expectedType + ', got: ' + (typeof arg));\n }\n}", "title": "" }, { "docid": "1981603c9d4c386fb51a3d18832647f5", "score": "0.55640864", "text": "legalArguments(args, params) {\n doCheck(\n args.length === params.length,\n `Expected ${params.length} args in call, got ${args.length}`,\n );\n args.forEach((arg, i) => {\n if (params[i].type === StringType && arg.type !== StringType) {\n arg.type = StringType;\n }\n this.isAssignableTo(arg, params[i].type);\n });\n }", "title": "" }, { "docid": "85a40a789ef1d0f77fde7a1bbc63e1cf", "score": "0.5531267", "text": "validateArgs(args, requiredArgs, optionalArgs) {\n for (var key in requiredArgs) {\n if (args[key] === undefined) throw new Error(`Key not found: ${key}`)\n\n for (var i = 0; i < requiredArgs[key].length; i++) {\n if (typeof requiredArgs[key][i] !== 'function')\n throw new Error('Validator is not a function')\n\n if (!requiredArgs[key][i](args[key]))\n throw new Error(`Validation failed for ${key}`)\n }\n }\n\n for (var key in optionalArgs) {\n if (args[key]) {\n for (var i = 0; i < optionalArgs[key].length; i++) {\n if (typeof optionalArgs[key][i] !== 'function')\n throw new Error('Validator is not a function')\n\n if (!optionalArgs[key][i](args[key]))\n throw new Error(`Validation failed for ${key}`)\n }\n }\n }\n return true\n }", "title": "" }, { "docid": "1ed297f58207066bb8d5f5cbac1080e6", "score": "0.55302995", "text": "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "title": "" }, { "docid": "1ed297f58207066bb8d5f5cbac1080e6", "score": "0.55302995", "text": "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "title": "" }, { "docid": "1ed297f58207066bb8d5f5cbac1080e6", "score": "0.55302995", "text": "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5526288", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5526288", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5526288", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5526288", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5526288", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "67176a48197abc30c4bd9561ea1360d6", "score": "0.5526288", "text": "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "title": "" }, { "docid": "c6fdfcf5ad1c8309248860d7749f77f0", "score": "0.54909986", "text": "function checkContainTwoObject(...args) {\n // it is an object and not undefined;\n if (args == undefined)\n throw `${args} is not exitst`;\n else if (!Array.isArray(args))\n throw `${args} is not array`;\n // check that there are at least 2 arguments.\n else if (args.length < 2)\n throw `${args} at least have 2 arguments`;\n else {\n args.forEach(element => checkObject(element));\n }\n return;\n}", "title": "" }, { "docid": "807924fc901e24fcfc54b39a2eb50fdf", "score": "0.54788584", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\r\n if (argument !== undefined) {\r\n validateNamedType(functionName, type, optionName, argument);\r\n }\r\n}", "title": "" }, { "docid": "807924fc901e24fcfc54b39a2eb50fdf", "score": "0.54788584", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\r\n if (argument !== undefined) {\r\n validateNamedType(functionName, type, optionName, argument);\r\n }\r\n}", "title": "" }, { "docid": "807924fc901e24fcfc54b39a2eb50fdf", "score": "0.54788584", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\r\n if (argument !== undefined) {\r\n validateNamedType(functionName, type, optionName, argument);\r\n }\r\n}", "title": "" }, { "docid": "11d0b972c826cb086c006952ea262ea9", "score": "0.54724294", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\n if (argument !== undefined) {\n validateNamedType(functionName, type, optionName, argument);\n }\n}", "title": "" }, { "docid": "11d0b972c826cb086c006952ea262ea9", "score": "0.54724294", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\n if (argument !== undefined) {\n validateNamedType(functionName, type, optionName, argument);\n }\n}", "title": "" }, { "docid": "11d0b972c826cb086c006952ea262ea9", "score": "0.54724294", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\n if (argument !== undefined) {\n validateNamedType(functionName, type, optionName, argument);\n }\n}", "title": "" }, { "docid": "11d0b972c826cb086c006952ea262ea9", "score": "0.54724294", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\n if (argument !== undefined) {\n validateNamedType(functionName, type, optionName, argument);\n }\n}", "title": "" }, { "docid": "11d0b972c826cb086c006952ea262ea9", "score": "0.54724294", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\n if (argument !== undefined) {\n validateNamedType(functionName, type, optionName, argument);\n }\n}", "title": "" }, { "docid": "11d0b972c826cb086c006952ea262ea9", "score": "0.54724294", "text": "function validateNamedOptionalType(functionName, type, optionName, argument) {\n if (argument !== undefined) {\n validateNamedType(functionName, type, optionName, argument);\n }\n}", "title": "" }, { "docid": "9c6e60bff285eb8c8823e00ac522b422", "score": "0.5471875", "text": "function validateSchemaType(obj) {}", "title": "" }, { "docid": "891a00c199e0fef8d3cfa6e09b3eb51c", "score": "0.54381824", "text": "function isArguments(object) {\n return Object.prototype.toString.call(object) === '[object Arguments]';\n}", "title": "" }, { "docid": "e74ccc084570a47aace284bf62110057", "score": "0.5418591", "text": "function isArguments(object) {\n return Object.prototype.toString.call(object) === \"[object Arguments]\";\n}", "title": "" }, { "docid": "24f566b539afd3f8c930a72196cfcae4", "score": "0.53661865", "text": "function check_options_correctness_against_schema(obj, schema, options) {\r\n if (!factories_schema_helpers_1.parameters.debugSchemaHelper) {\r\n return; // ignoring set\r\n }\r\n options = options || {};\r\n // istanbul ignore next\r\n if (!_.isObject(options) && !(typeof (options) === \"object\")) {\r\n let message = chalk_1.default.red(\" Invalid options specified while trying to construct a \")\r\n + \" \" + chalk_1.default.yellow(schema.name);\r\n message += \"\\n\";\r\n message += chalk_1.default.red(\" expecting a \") + chalk_1.default.yellow(\" Object \");\r\n message += \"\\n\";\r\n message += chalk_1.default.red(\" and got a \") + chalk_1.default.yellow((typeof options)) + chalk_1.default.red(\" instead \");\r\n // console.log(\" Schema = \", schema);\r\n // console.log(\" options = \", options);\r\n throw new Error(message);\r\n }\r\n // istanbul ignore next\r\n if (options instanceof obj.constructor) {\r\n return true;\r\n }\r\n // extract the possible fields from the schema.\r\n const possibleFields = obj.constructor.possibleFields || schema._possibleFields;\r\n // extracts the fields exposed by the option object\r\n const currentFields = Object.keys(options);\r\n // get a list of field that are in the 'options' object but not in schema\r\n const invalidOptionsFields = _.difference(currentFields, possibleFields);\r\n /* istanbul ignore next */\r\n if (invalidOptionsFields.length > 0) {\r\n // tslint:disable:no-console\r\n console.log(\"expected schema\", schema.name);\r\n console.log(chalk_1.default.yellow(\"possible fields= \"), possibleFields.sort().join(\" \"));\r\n console.log(chalk_1.default.red(\"current fields= \"), currentFields.sort().join(\" \"));\r\n console.log(chalk_1.default.cyan(\"invalid_options_fields= \"), invalidOptionsFields.sort().join(\" \"));\r\n console.log(\"options = \", options);\r\n }\r\n /* istanbul ignore next */\r\n if (invalidOptionsFields.length !== 0) {\r\n // tslint:disable:no-console\r\n console.log(chalk_1.default.yellow(\"possible fields= \"), possibleFields.sort().join(\" \"));\r\n console.log(chalk_1.default.red(\"current fields= \"), currentFields.sort().join(\" \"));\r\n throw new Error(\" invalid field found in option :\" + JSON.stringify(invalidOptionsFields));\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "89999a3685a1475f9a214d7974a54218", "score": "0.5352975", "text": "function validateArgs(args) {\r\n\r\n // basic validation / setting default values\r\n if(typeof args.responsive === 'undefined')\r\n args.responsive = false;\r\n\r\n if(typeof args.min_length === 'undefined')\r\n args.min_length = 6;\r\n\r\n if(typeof args.max_length === 'undefined')\r\n args.max_length = 12;\r\n\r\n if(typeof args.include === 'undefined')\r\n args.include = '';\r\n\r\n if(typeof args.include_append === 'undefined')\r\n args.include_append = 'right';\r\n\r\n if(typeof args.include_field === 'undefined')\r\n args.include_field = true;\r\n\r\n if(typeof args.length_field === 'undefined')\r\n args.length_field = true;\r\n\r\n if(typeof args.readable === 'undefined')\r\n args.readable = false;\r\n\r\n if(typeof args.show_hint === 'undefined')\r\n args.show_hint = true;\r\n\r\n if(typeof args.show_copy === 'undefined')\r\n args.show_copy = true;\r\n\r\n if(typeof args.show_debug === 'undefined')\r\n args.show_debug = false;\r\n\r\n // further validation / type check\r\n if(typeof args.responsive !== 'boolean')\r\n throwNewError('args.responsive', 'only supports type', 'boolean', args, true);\r\n\r\n if(typeof args.min_length !== 'number')\r\n throwNewError('args.min_length', 'only supports type', 'number', args, 6);\r\n\r\n if(typeof args.max_length !== 'number')\r\n throwNewError('args.max_length', 'only supports type', 'number', args, 12);\r\n\r\n if(typeof args.include_append !== 'string')\r\n throwNewError('args.include_append', 'only supports type', 'string', args, 'right');\r\n\r\n if(typeof args.include !== 'string')\r\n throwNewError('args.include', 'only supports type', 'string', args, '');\r\n\r\n if(typeof args.include_field !== 'boolean')\r\n throwNewError('args.include_field', 'only supports type', 'boolean', args, false);\r\n\r\n if(typeof args.length_field !== 'boolean')\r\n throwNewError('args.length_field', 'only supports type', 'boolean', args, false);\r\n\r\n if(typeof args.readable !== 'boolean')\r\n throwNewError('args.readable', 'only supports type', 'boolean', args, false);\r\n\r\n if(typeof args.show_hint !== 'boolean')\r\n throwNewError('args.show_hint', 'only supports type', 'boolean', args, true);\r\n\r\n if(typeof args.show_copy !== 'boolean')\r\n throwNewError('args.show_copy', 'only supports type', 'boolean', args, true);\r\n\r\n if(typeof args.show_debug !== 'boolean')\r\n throwNewError('args.show_debug', 'only supports type', 'boolean', args, false);\r\n\r\n return args;\r\n }", "title": "" }, { "docid": "0623a254d9228feac551bb32d66217d3", "score": "0.5339191", "text": "_validateOptions(options) {\n\t\t// Prefix\n\t\tconst prefix = options.prefix;\n\t\tif (!prefix || typeof prefix !== 'string') {\n\t\t\tthis.logger.fatal('Command prefix is not a string', typeof prefix);\n\t\t}\n\n\t\t// Owners\n\t\tconst owners = options.owners;\n\t\tif (!owners || !Array.isArray(owners)) {\n\t\t\tthis.logger.fatal('Bot owners is not an array', typeof owners);\n\t\t}\n\t\tif (!owners.every(owner => util.isId(owner))) {\n\t\t\tthis.logger.fatal('Bot owners are not valid user ids', owners);\n\t\t}\n\t\tif (owners.length === 0) {\n\t\t\tthis.logger.warn('Bot has no owners');\n\t\t}\n\n\t\tthis.logger.debug('Command handler options validated');\n\t}", "title": "" }, { "docid": "a976069c5b804a25682618ab40b48cd1", "score": "0.5266126", "text": "function isValidArguments(casper) {\n var keys = Object.keys(casper.cli.options);\n return (keys.length >= ALL_KEYS.length);\n // && \n // ALL_KEYS.every(function(item) {\n // return keys.includes(item);\n // });\n}", "title": "" }, { "docid": "71ca5b0fc512a45aeab976088aa67e73", "score": "0.5258237", "text": "function validateNamedType(functionName, type, optionName, argument) {\r\n validateType(functionName, type, optionName + \" option\", argument);\r\n}", "title": "" }, { "docid": "71ca5b0fc512a45aeab976088aa67e73", "score": "0.5258237", "text": "function validateNamedType(functionName, type, optionName, argument) {\r\n validateType(functionName, type, optionName + \" option\", argument);\r\n}", "title": "" }, { "docid": "71ca5b0fc512a45aeab976088aa67e73", "score": "0.5258237", "text": "function validateNamedType(functionName, type, optionName, argument) {\r\n validateType(functionName, type, optionName + \" option\", argument);\r\n}", "title": "" }, { "docid": "8d41c78c97379b3e771eef0c5efa42aa", "score": "0.5253563", "text": "function checkType(object, string, type) {\n if (type == \"array\") {\n if (!Array.isArray(object)) {\n unitError(string + \" is not an array\");\n }\n return;\n }\n if (type == \"int\" || type == \"integer\") {\n if (!Number.isInteger(object)) {\n unitError(string + \" is not an integer\");\n }\n return;\n }\n if (typeof object != type) {\n unitError(string + \" is not of type \" + type);\n }\n }", "title": "" }, { "docid": "7c496832f01e0a23dc10b6676c5b2f00", "score": "0.5206936", "text": "function validateSchemaType(obj) {\n\t\t var type = obj[KEYWORD_TYPE]\n\t\t , typeType;\n\t\t \n\t\t if (type === null) {\n\t\t \tthrow \"The '\" + KEYWORD_TYPE + \"' field cannot be null: \" + \n\t\t \t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t typeType = typeof type;\n\t\t if (typeType === \"undefined\") {\n\t\t \tthrow \"The '\" + KEYWORD_TYPE + \"' field is missing: \" + \n\t\t \t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t if (Object.prototype.toString.call(type) !== JS_TYPE_STRING) {\n\t\t \tthrow \"The '\" + KEYWORD_TYPE + \"' field is not a string: \" + \n \t\t\t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t if (type === TYPE_BOOLEAN) {\n\t\t \tvalidateSchemaBooleanType(obj);\n\t\t }\n\t\t else if (type === TYPE_NUMBER) {\n\t\t validateSchemaNumberType(obj);\n\t\t }\n\t\t else if (type === TYPE_STRING) {\n\t\t validateSchemaStringType(obj);\n\t\t }\n\t\t else if (type === TYPE_OBJECT) {\n\t\t \tvalidateSchemaObjectType(obj);\n\t\t }\n\t\t else if (type === TYPE_ARRAY) {\n\t\t \tvalidateSchemaArrayType(obj);\n\t\t }\n\t\t else {\n\t\t throw \"Type unknown: \" + type;\n\t\t }\n\t\t\n\t\t validateSchemaTypeOptions(obj);\n\t\t}", "title": "" }, { "docid": "2c2823203c9395b3ebcbe6e8531a69bc", "score": "0.520361", "text": "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n}", "title": "" }, { "docid": "2c2823203c9395b3ebcbe6e8531a69bc", "score": "0.520361", "text": "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n}", "title": "" }, { "docid": "2c2823203c9395b3ebcbe6e8531a69bc", "score": "0.520361", "text": "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n}", "title": "" }, { "docid": "2c2823203c9395b3ebcbe6e8531a69bc", "score": "0.520361", "text": "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n}", "title": "" }, { "docid": "2c2823203c9395b3ebcbe6e8531a69bc", "score": "0.520361", "text": "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n}", "title": "" }, { "docid": "2c2823203c9395b3ebcbe6e8531a69bc", "score": "0.520361", "text": "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n}", "title": "" }, { "docid": "57a159153a5a409fe57e37ce43608c23", "score": "0.5152623", "text": "function isValidForm(arg) {\n if (!isPlainObject(arg)) {\n throw new TypeError(`${arg} is not a plain object`);\n }\n if (\n !arg.metadata ||\n !arg.metadata.expiresAt ||\n typeof arg.metadata.expiresAt !== 'number'\n ) {\n throw new TypeError(`'metadata.expiresAt' is not set on ${arg}`);\n }\n return true;\n }", "title": "" }, { "docid": "268dda26a23541e0a4b48a59ada434af", "score": "0.5151755", "text": "legalArguments(args, params) {\n doCheck(\n args.length === params.length,\n `Expected ${params.length} args in call, got ${args.length}`,\n )\n args.forEach((arg, i) => this.sameType(arg, params[i]))\n }", "title": "" }, { "docid": "83699634c5d8a151c12995849f2399f6", "score": "0.5125167", "text": "function atLeastOne(object) {\n const parameters = Object.keys(object);\n if (!parameters.some((parameter) => object[parameter] !== undefined)) {\n throwError('Please set at least one of the following parameters: ' +\n parameters.map((p) => `'${p}'`).join(', '));\n }\n}", "title": "" }, { "docid": "ffece01990a69f03f2503317170dccea", "score": "0.5107074", "text": "function validate(options) {\n if (options == null) return\n if (typeof options !== 'object' || Array.isArray(options)) throw new ComposerError('Invalid options', options)\n options = JSON.stringify(options)\n if (options === '{}') return\n return JSON.parse(options)\n}", "title": "" }, { "docid": "8a59367323a9d75ab354f225fbcd1d19", "score": "0.5102614", "text": "_argumentTypeCheck(argument, argumentIndex) {\n\n if ( argument instanceof HTMLElement ) {\n this.argumentType[argumentIndex] = '[object HTMLElement]';\n } else {\n this.argumentType[argumentIndex] = toString.call(argument);\n }\n\n }", "title": "" }, { "docid": "f9293f97f1867ec5a51b5b5ba6522d10", "score": "0.50897354", "text": "function _arguments(o,args){\n\n\t\tvar p = {},\n\t\t\ti = 0,\n\t\t\tt = null,\n\t\t\tx = null;\n\t\t\n\t\t// define x\n\t\tfor(x in o){if(o.hasOwnProperty(x)){\n\t\t\tbreak;\n\t\t}}\n\n\t\t// Passing in hash object of arguments?\n\t\t// Where the first argument can't be an object\n\t\tif((args.length===1)&&(typeof(args[0])==='object')&&o[x]!='o!'){\n\t\t\t// return same hash.\n\t\t\treturn args[0];\n\t\t}\n\n\t\t// else loop through and account for the missing ones.\n\t\tfor(x in o){if(o.hasOwnProperty(x)){\n\n\t\t\tt = typeof( args[i] );\n\n\t\t\tif( ( typeof( o[x] ) === 'function' && o[x].test(args[i]) ) || ( typeof( o[x] ) === 'string' && (\n\t\t\t\t\t( o[x].indexOf('s')>-1 && t === 'string' ) ||\n\t\t\t\t\t( o[x].indexOf('o')>-1 && t === 'object' ) ||\n\t\t\t\t\t( o[x].indexOf('i')>-1 && t === 'number' ) ||\n\t\t\t\t\t( o[x].indexOf('a')>-1 && t === 'object' ) ||\n\t\t\t\t\t( o[x].indexOf('f')>-1 && t === 'function' )\n\t\t\t\t) )\n\t\t\t){\n\t\t\t\tp[x] = args[i++];\n\t\t\t}\n\t\t\t\n\t\t\telse if( typeof( o[x] ) === 'string' && o[x].indexOf('!')>-1 ){\n\t\t\t\tlog(\"Whoops! \" + x + \" not defined\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}}\n\t\treturn p;\n\t}", "title": "" }, { "docid": "7ca85ef23ec5278f37e975b3f5f6e7a5", "score": "0.5087868", "text": "function ArgumentsOfCorrectType(context) {\n\t return {\n\t Argument: function Argument(node) {\n\t var argDef = context.getArgument();\n\t if (argDef) {\n\t var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, node.value);\n\t if (errors && errors.length > 0) {\n\t context.reportError(new _error.GraphQLError(badValueMessage(node.name.value, argDef.type, (0, _printer.print)(node.value), errors), [node.value]));\n\t }\n\t }\n\t return false;\n\t }\n\t };\n\t}", "title": "" }, { "docid": "7dbfdba2116facd843dd85c6be1ec93f", "score": "0.50874037", "text": "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(node) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, node.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(node.name.value, argDef.type, (0, _printer.print)(node.value), errors), [node.value]));\n }\n }\n return false;\n }\n };\n}", "title": "" }, { "docid": "db07f7c706872140289e01b883007616", "score": "0.5078424", "text": "function validateSchema(obj) {\n var type = obj[KEYWORD_TYPE]\n , typeType\n , optional = obj[KEYWORD_OPTIONAL]\n , optionalType = typeof optional;\n \n if (type === null) {\n throw \"The root object's '\" + \n KEYWORD_TYPE + \n \"' field cannot be null: \" + \n JSON.stringify(obj);\n }\n typeType = typeof type;\n if (typeType === \"undefined\") {\n throw \"The root object's '\" +\n KEYWORD_TYPE +\n \"' field is missing: \" + \n JSON.stringify(obj);\n }\n if (Object.prototype.toString.call(type) !== JS_TYPE_STRING) {\n throw \"The root object's '\" +\n KEYWORD_TYPE +\n \"' field must be a string: \" +\n JSON.stringify(obj);\n }\n if ((type !== TYPE_OBJECT) && (type !== TYPE_ARRAY)) {\n throw \"The root object's '\" +\n KEYWORD_TYPE +\n \"' field must either be \" +\n \"'object' or 'array': \" + \n JSON.stringify(obj);\n }\n \n if ((optionalType !== \"undefined\") && optional) {\n throw \"The 'optional' field is not allowed at the root of \" +\n \"the definition.\";\n }\n \n validateSchemaInternal(obj);\n\n return obj;\n }", "title": "" }, { "docid": "5e667f1dbc2a21e1912c11bb95d271e3", "score": "0.5073407", "text": "function validateSchemaObjectType(obj) {\n\t\t var schema = obj[KEYWORD_SCHEMA]\n\t\t , schemaType\n\t\t , i\n\t\t , field\n\t\t , name\n\t\t , nameType;\n\t\t \n\t\t // Verify the schema isn't null.\n\t\t if (schema === null) {\n\t\t throw \"The '\" + KEYWORD_SCHEMA + \"' field's value is null: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t // Verify that the schema is present and is a JSON array.\n\t\t schemaType = typeof schema;\n\t\t if (schemaType === \"undefined\") {\n\t\t throw \"The '\" + KEYWORD_SCHEMA + \"' field is missing: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t if (Object.prototype.toString.call(schema) !== JS_TYPE_ARRAY) {\n\t\t throw \"The '\" +\n\t\t \t\tKEYWORD_SCHEMA +\n\t\t \t\t\"' field's value must be a JSON array: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t // For each of the JSON objects, verify that it has a name and a\n\t\t // type.\n\t\t for (i = 0; i < schema.length; i += 1) {\n\t\t field = schema[i];\n\t\t \t// Verify that the index isn't null.\n\t\t if (field === null) {\n\t\t throw \"The element at index \" + \n\t\t \t\ti + \n\t\t \t\t\" of the '\" +\n\t\t \t\tKEYWORD_SCHEMA +\n\t\t \t\t\"' field is null: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t // Verify that the index is a JSON object and not an array.\n\t\t if (Object.prototype.toString.call(field) !== JS_TYPE_OBJECT) {\n\t\t throw \"The element at index \" + \n\t\t \t\ti + \n\t\t \t\t\" of the '\" +\n\t\t \t\tKEYWORD_SCHEMA +\n\t\t \t\t\"' field is not a JSON object: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t // Verify that the JSON object contains a \"name\" field and that\n\t\t // it's not null.\n\t\t name = field[KEYWORD_NAME];\n\t\t if (name === null) {\n\t\t throw \"The '\" +\n\t\t \t\tKEYWORD_NAME +\n\t\t \t\t\"' field for the JSON object at index \" + \n\t\t \t\ti + \n\t\t \t\t\" is null: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t // Verify that the \"name\" field exists and is a string.\n\t\t nameType = typeof name;\n\t\t if (name === \"undefined\") {\n\t\t \tthrow \"The '\" +\n\t\t \t\t\tKEYWORD_NAME +\n\t\t \t\t\t\"' field for the JSON object at index \" + \n\t\t \t\t\ti + \n\t\t \t\t\t\" is misisng: \" + \n\t\t \t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t if (Object.prototype.toString.call(name) !== JS_TYPE_STRING) {\n\t\t throw \"The type of the '\" +\n\t\t \t\tKEYWORD_NAME +\n\t\t \t\t\"' field for the JSON object at index \" + \n\t\t \t\ti + \n\t\t \t\t\" is not a string: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t // Validates the type of this field.\n\t\t validateSchemaType(field);\n\t\t }\n\t\t}", "title": "" }, { "docid": "949a2568a21539cc2cbbac521325a672", "score": "0.50592625", "text": "function checkType(type,value){if(type){if(typeof type=='string'&&type!='any'&&(type=='null'?value!==null:typeof value!=type)&&!(value instanceof Array&&type=='array')&&!(value instanceof Date&&type=='date')&&!(type=='integer'&&value%1===0)){return[{property:path,message:typeof value+\" value found, but a \"+type+\" is required\"}];}if(type instanceof Array){var unionErrors=[];for(var j=0;j<type.length;j++){// a union type\nif(!(unionErrors=checkType(type[j],value)).length){break;}}if(unionErrors.length){return unionErrors;}}else if(typeof type=='object'){var priorErrors=errors;errors=[];checkProp(value,type,path);var theseErrors=errors;errors=priorErrors;return theseErrors;}}return[];}", "title": "" }, { "docid": "8651f7453e3008c58400d7de89b00f94", "score": "0.50502616", "text": "function validateOptions(options) {\n options = { ...defaultOptions, ...options };\n const errors = [];\n if (\"width\" in options && (typeof options.width !== \"number\" || options.width <= 0)) {\n errors.push(\"option width should be a positive number\");\n delete options.width;\n }\n if (\"height\" in options && (typeof options.height !== \"number\" || options.height <= 0)) {\n errors.push(\"option height should be a positive number\");\n delete options.height;\n }\n if (typeof options.quality !== \"number\" || options.quality < 0 || options.quality > 100) {\n errors.push(\"option quality should be a number between 0 and 100\");\n options.quality = defaultOptions.quality;\n }\n if (typeof options.snapshotContentContainer !== \"boolean\") {\n errors.push(\"option snapshotContentContainer should be a boolean\");\n }\n if (acceptedFormats.indexOf(options.format) === -1) {\n options.format = defaultOptions.format;\n errors.push(\n \"option format '\" + options.format + \"' is not in valid formats: \" + acceptedFormats.join(\" | \")\n );\n }\n if (acceptedResults.indexOf(options.result) === -1) {\n options.result = defaultOptions.result;\n errors.push(\n \"option result '\" + options.result + \"' is not in valid formats: \" + acceptedResults.join(\" | \")\n );\n }\n return { options, errors };\n}", "title": "" }, { "docid": "0b64d72fbc710ea9e7b0589074f05275", "score": "0.50339824", "text": "function _checkParameters(params){\n if(typeof params !== 'object') throw new Error(\"Parameters must be passed in as an object\");\n if(!params.customerIpAddress) throw new Error(\"Customer ip address must be sent in as customerIpAddress\");\n if(!params.customerUserAgent) throw new Error(\"Customer user agent string address must be sent in as customerUserAgent\");\n }", "title": "" }, { "docid": "2b25df1c2eebb6a06a5468946c4e11f6", "score": "0.5033221", "text": "function checkSchema(o){\n if (typeof o !== 'object' || o === null) throw new Error('Schema not passed')\n Object.keys(o).forEach(k=>{\n Object.keys(o[k]).forEach(n=>{\n if (n.startsWith('__')) return\n o[k][n].forEach(v=>{\n const isPrimitive = safeCheck(schema, 'function|Type|LiteralType', v)\n if (!isPrimitive){\n check(schema, 'ObjectType', v)\n // Don't check the schema for generic types (e.g. T)\n if (o[k].__generics && o[k].__generics.params.includes(v.type)){\n return\n }\n \n const generics = genericChecker(v.type)\n const type = generics ? generics.name : v.type\n if (!o[type]) {\n throw new Error(`ObjectType ${type} not found`)\n }\n if (generics) {\n if (generics.params.length !== o[type].__generics.params.length) {\n throw new Error('Did not receive the correct number of generic arguments')\n }\n generics.params.forEach(p=>{\n const isGenericPrimitive = safeCheck(schema, 'Type|LiteralType', {type:p})\n if (isGenericPrimitive) return\n if (!o[p] && (!o[k].__generics || !o[k].__generics.params.includes(p))){\n throw new Error('Generic param not found: ' + p)\n }\n })\n } else {\n if (o[type].__generics){\n throw new Error(`Generic type needs parameters: ${type}`)\n }\n }\n }\n })\n })\n })\n}", "title": "" }, { "docid": "2dd5438dbaa57fb995280c7589929d54", "score": "0.50145614", "text": "function validateSchema(obj) {\n\t\t var type = obj[KEYWORD_TYPE]\n\t\t , typeType\n\t\t , optionalType = typeof obj[KEYWORD_OPTIONAL];\n\t\t \n\t\t if (type === null) {\n\t\t \tthrow \"The root object's '\" + \n\t\t \t\t\tKEYWORD_TYPE + \n\t\t \t\t\t\"' field cannot be null: \" + \n\t\t \t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t typeType = typeof type;\n\t\t if (typeType === \"undefined\") {\n\t\t \tthrow \"The root object's '\" +\n\t\t \t\t\tKEYWORD_TYPE +\n\t\t \t\t\t\"' field is missing: \" + \n\t\t \t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t if (Object.prototype.toString.call(type) !== JS_TYPE_STRING) {\n\t\t \tthrow \"The root object's '\" +\n\t\t \t\t\tKEYWORD_TYPE +\n\t\t \t\t\t\"' field must be a string: \" +\n\t\t \t\t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t if ((type !== TYPE_OBJECT) && (type !== TYPE_ARRAY)) {\n\t\t throw \"The root object's '\" +\n\t\t \t\tKEYWORD_TYPE +\n\t\t \t\t\"' field must either be \" +\n\t\t \t\t\"'object' or 'array': \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t if (optionalType !== \"undefined\") {\n\t\t \tthrow \"The 'optional' field is not allowed at the root of the definition.\";\n\t\t }\n\t\t \n\t\t validateSchemaType(obj);\n\n\t\t return obj;\n\t\t}", "title": "" }, { "docid": "9ab5f42dbb69c8474e29875a28ccd994", "score": "0.50095135", "text": "function assertValidExecutionArguments(schema, document, rawVariableValues) {\n\t (0, _invariant2.default)(schema, 'Must provide schema');\n\t (0, _invariant2.default)(document, 'Must provide document');\n\t (0, _invariant2.default)(schema instanceof _schema.GraphQLSchema, 'Schema must be an instance of GraphQLSchema. Also ensure that there are ' + 'not multiple versions of GraphQL installed in your node_modules directory.');\n\n\t // Variables, if provided, must be an object.\n\t (0, _invariant2.default)(!rawVariableValues || typeof rawVariableValues === 'object', 'Variables must be provided as an Object where each property is a ' + 'variable value. Perhaps look to see if an unparsed JSON string ' + 'was provided.');\n\t}", "title": "" }, { "docid": "0b865b685c0edf0df1dee943cf5e5a91", "score": "0.50029165", "text": "function processOptionsFromArgs() {\n\tlet rawOptions = getOptionsFromArgs();\n\tfor (let key in rawOptions) {\n\t\tif (!options.hasOwnProperty(key)) {\n\t\t\tconsole.warn(`Unknown option: ${key}`);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet context = exports.getTestMode();\n\t\tlet optionsData = options[key];\n\t\tif (!optionsData.context.includes(context)) {\n\t\t\tconsole.warn(`The option is not allowed in ${context} context: ${key}`);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet val = rawOptions[key];\n\t\ttry {\n\t\t\tswitch (optionsData.type) {\n\t\t\t\tcase TYPE_BOOLEAN: {\n\t\t\t\t\toptions[key].value = processBooleanOption(val);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TYPE_ARRAY: {\n\t\t\t\t\toptions[key].value = processArrayOption(val);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.warn(`Unknown value of '${key}' option: ${val}`);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "94f42c0f52b735abf456fd2de5c9a46d", "score": "0.4998125", "text": "validateRunArgs(gameObject, functionName, args) {\n const schema = this.validateGameObject(gameObject, functionName);\n if (schema instanceof Error) {\n return schema;\n }\n const sanitizedArgs = new Map();\n for (const arg of schema.args) {\n const value = utils_1.objectHasProperty(args, arg.argName)\n ? args[arg.argName]\n : arg.defaultValue;\n const sanitized = sanitize_1.sanitizeType(arg, value);\n if (sanitized instanceof Error) {\n return {\n invalid: `${gameObject.gameObjectName}.${functionName}()'s '${arg.argName}' arg was sent ${utils_1.quoteIfString(value)} - ${sanitized.message}`,\n };\n }\n sanitizedArgs.set(arg.argName, sanitized);\n }\n return sanitizedArgs;\n }", "title": "" }, { "docid": "0f2df1fc747f2aa999ef77fe09261969", "score": "0.4989755", "text": "function check_keys( json_input ) {\n\tif ( !json_input.hasOwnProperty( \"type\" ) || !json_input.hasOwnProperty( \"data\" ) ) {\n\t\tpost( \"json must contain 'type' and 'data' keys\", '\\n');\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "00ce2d293797c10cf922e3b9ecf1b5ef", "score": "0.49842644", "text": "function validateParameters(parametersObject){\r\n\t// to be implemented.\r\n\treturn true;\r\n}", "title": "" }, { "docid": "cf7975b46aa1517c684be42b932f1b74", "score": "0.49766707", "text": "function validateParams(params) {\n if (params == null) {\n throw new Error('Transloadit: The `params` option is required.');\n }\n\n if (typeof params === 'string') {\n try {\n // eslint-disable-next-line no-param-reassign\n params = JSON.parse(params);\n } catch (err) {\n // Tell the user that this is not an Uppy bug!\n var error = new Error('Transloadit: The `params` option is a malformed JSON string.');\n err.cause = err;\n throw error;\n }\n }\n\n if (!params.auth || !params.auth.key) {\n throw new Error('Transloadit: The `params.auth.key` option is required. ' + 'You can find your Transloadit API key at https://transloadit.com/account/api-settings.');\n }\n }", "title": "" }, { "docid": "127e5ff7b17c0620432179bda12aebf3", "score": "0.49680296", "text": "function validateParams () {\n if (typeof arguments[0] !== 'number' || typeof arguments[1] !== 'number') {\n throw new TypeError('params should be numbers')\n }\n\n if (arguments[0] == null || arguments[1] == null) {\n throw new TypeError('params are required')\n }\n}", "title": "" }, { "docid": "dafc23ee378cf2ab4b94ceab31c8d50c", "score": "0.49632698", "text": "function gotOption (option) {\n if (map[option]) {\n option = map[option]\n var name = option[0]\n // Assume a boolean, and set to true because the argument is present.\n var value = true\n // If it takes arguments, override with a value.\n var count = option[2]\n while (count--) {\n value = argv[++index]\n if (argv.length === index) {\n return cli.error('The \"' + name + '\" option requires an argument.')\n }\n }\n // If it needs type conversion, do it.\n var type = option[1]\n if (type === 'Array') {\n value = value.split(',')\n } else if (type === 'RegExp') {\n try {\n value = new RegExp(value)\n } catch (e) {\n return cli.error('The \"' + name + '\" option received an invalid expression: \"' + value + '\".')\n }\n } else if (type === 'Number') {\n var number = value * 1\n if (isNaN(number)) {\n return cli.error('The \"' + name + '\" option received a non-numerical argument: \"' + value + '\".')\n }\n }\n args[name] = value\n } else {\n return cli.error('Unknown option: \"' + option + '\".')\n }\n }", "title": "" }, { "docid": "f19440f2c6ff7ab15968b9de7c5dcffd", "score": "0.49507654", "text": "function act_param_check (args, actmeta, done) {\n assert.ok(_.isObject(args), 'act_param_check; args; isObject')\n assert.ok(_.isObject(actmeta), 'act_param_check; actmeta; isObject')\n assert.ok(_.isFunction(done), 'act_param_check; done; isFunction')\n\n if (actmeta.parambulator) {\n actmeta.parambulator.validate(args, function (err) {\n if (err) return done(\n error('act_invalid_args', {\n pattern: actmeta.pattern,\n message: err.message,\n args: common.clean(args)\n }))\n return done()\n })\n }\n else return done()\n }", "title": "" }, { "docid": "49cabfef0a2586bb8b29ca9f5e494592", "score": "0.49423188", "text": "function IsObject(validationOptions) {\n return Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"ValidateBy\"])({\n name: IS_OBJECT,\n validator: {\n validate: function (value, args) { return isObject(value); },\n defaultMessage: Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"buildMessage\"])(function (eachPrefix) { return eachPrefix + \"$property must be an object\"; }, validationOptions)\n }\n }, validationOptions);\n}", "title": "" }, { "docid": "fcb3e043c650690ba666848f6e8a437c", "score": "0.49409813", "text": "function _validateArguments(options, cb){\n // Validate and prepare our arguments\n\n //If path is not given kick in defaults\n if(!options.path && options.mode === 'file'){\n options.path = process.cwd()+\"\\\\\"+defaults.path;\n console.log((\"Warning: No path specified. Setting it to \" + options.path).warn);\n }\n\n // Do the same for dest\n if(!options.dest){\n options.dest = process.cwd()+\"\\\\\"+defaults.dest;\n console.log((\"Warning: No destination specified. Setting it to \" + options.dest).warn);\n }\n\n // Set url\n if(!options.url && options.mode === 'url'){\n options.url = defaults.url;\n console.log((\"Warning: No destination specified. Setting it to \" + options.dest).warn);\n }\n\n // Set format type\n options.format = (!options.format) ? defaults.format : options.format;\n cb(options);\n}", "title": "" }, { "docid": "2782dd2bd81ef49ce12ed3c9c118b25f", "score": "0.4923805", "text": "function object_key_check(object /*, key_1, key_2... */)\n {\n var keys = Array.prototype.slice.call(arguments, 1);\n var current = object;\n\n // Iterate over keys\n for (var i = 0; i < keys.length; i++) {\n\n // Check if current key exists\n if (typeof current[keys[i]] === 'undefined') {\n return false;\n }\n\n // Check if all but last keys are for object\n if (i < (keys.length - 1) && typeof current[keys[i]] !== 'object') {\n return false;\n }\n\n // Go one step down\n current = current[keys[i]];\n }\n\n // If we reached this point all keys from path\n return true;\n }", "title": "" }, { "docid": "7422b6ea556b70dc11753182529baa48", "score": "0.49178046", "text": "function testIt() {\n var objectA = {\n id: 2,\n name: 'Jane Doe',\n age: 34,\n city: 'Chicago'\n }\n\n var objectB = {\n id: 3,\n age: 33,\n city: 'Peoria'\n }\n\n var objectC = {\n id: 9,\n name: 'Billy Bear',\n age: 62,\n city: 'Milwaukee',\n status: 'paused'\n }\n\n var expectedKeys = ['id', 'name', 'age', 'city'];\n\n if (typeof validateKeys(objectA, expectedKeys) !== 'boolean') {\n console.error('FAILURE: `validateKeys` should return a boolean value');\n return;\n }\n\n if (!validateKeys(objectA, expectedKeys)) {\n console.error('FAILURE: running `validateKeys` with the following object and keys ' +\n 'should return `true` but returned `false`:\\n' + objectA + '\\n' + expectedKeys)\n return;\n }\n\n if (validateKeys(objectB, expectedKeys)) {\n console.error('FAILURE: running `validateKeys` with the following object and keys ' +\n 'should return `false` but returned `true`:\\n' + objectB + '\\n' + expectedKeys);\n }\n\n if (validateKeys(objectC, expectedKeys)) {\n console.error('FAILURE: running `validateKeys` with the following object and keys ' +\n 'should return `false` but returned `true`:\\n' + objectC + '\\n' + expectedKeys);\n }\n\n console.log('SUCCESS: `validateKeys` is working');\n}", "title": "" }, { "docid": "11a10ef871868d52df331b6b31c1d984", "score": "0.49174133", "text": "function assertValidExecutionArguments(schema, document, rawVariableValues) {\n document || (0, _devAssert$4.default)(0, 'Must provide document.'); // If the schema used for execution is invalid, throw an error.\n\n (0, _validate$4.assertValidSchema)(schema); // Variables, if provided, must be an object.\n\n rawVariableValues == null || (0, _isObjectLike$1.default)(rawVariableValues) || (0, _devAssert$4.default)(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.');\n }", "title": "" }, { "docid": "e87481079bff68c7589b989c56eb1047", "score": "0.49081546", "text": "function checkIsProperObject(val, variableName) {\n if (val === undefined || typeof val !== \"object\") {\n throw `${variableName || 'provided variable'} is not an Object, it is ${typeof(val)}`;\n }\n}", "title": "" }, { "docid": "4baf8d04de81df589475466164872db7", "score": "0.49053764", "text": "_needArg (argument) {\n return typeof this.options[argument] === 'undefined';\n }", "title": "" }, { "docid": "35c07ae8870dfb6ca8fd3b8931def10b", "score": "0.48894107", "text": "function validateType(functionName, type, inputName, input) {\n if (typeof input !== type || (type === 'object' && !isPlainObject(input))) {\n var description = valueDescription(input);\n throw new error_FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires its \" + inputName + \" \" +\n (\"to be of type \" + type + \", but it was: \" + description));\n }\n}", "title": "" }, { "docid": "dcb20a6579e4ba2fab4e9b78cea82e79", "score": "0.4886637", "text": "function checkDonationArgsType(args) {\n const [project, itemType, amount] = args;\n const validity =\n this.isValidProject(project) &&\n this.isValidItemType(itemType) &&\n this.isValidAmount(amount);\n return validity;\n}", "title": "" }, { "docid": "76173f86ce21fa83c742aec6b63823cf", "score": "0.48814523", "text": "function checkStartInfo(startInfo) {\n let sStartInfo = JSON.stringify(startInfo);\n if (sStartInfo > MAX_START_INFO_LENGTH) { throw Error(\"startInfo too large\"); }\n if (typeof startInfo.oracle === \"undefined\") { throw Error(\"startInfo.oracle is required\"); }\n if (!Array.isArray(startInfo.oracle)) { throw Error(\"startInfo.oracle must be an array\"); }\n if (!startInfo.question) { throw Error(\"startInfo.question is required\"); }\n if (!startInfo.outcomes) { throw Error(\"startInfo.outcomes is required\"); }\n}", "title": "" }, { "docid": "ed963f463328ed8515c19b7329037ce6", "score": "0.48797232", "text": "function assertStringOrObject(obj, name) {\n if (typeof (obj) !== 'string' && typeof (obj) !== 'object') {\n assert.ok(false, name + ' ([string] or [object]) required');\n }\n}", "title": "" }, { "docid": "56e8f3b2c64701f48db45c28045ddbe4", "score": "0.487893", "text": "function assertValidExecutionArguments(schema, document, rawVariableValues) {\n document || (0, _devAssert.default)(0, 'Must provide document.'); // If the schema used for execution is invalid, throw an error.\n\n (0, _validate.assertValidSchema)(schema); // Variables, if provided, must be an object.\n\n rawVariableValues == null || (0, _isObjectLike.default)(rawVariableValues) || (0, _devAssert.default)(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.');\n}", "title": "" }, { "docid": "56e8f3b2c64701f48db45c28045ddbe4", "score": "0.487893", "text": "function assertValidExecutionArguments(schema, document, rawVariableValues) {\n document || (0, _devAssert.default)(0, 'Must provide document.'); // If the schema used for execution is invalid, throw an error.\n\n (0, _validate.assertValidSchema)(schema); // Variables, if provided, must be an object.\n\n rawVariableValues == null || (0, _isObjectLike.default)(rawVariableValues) || (0, _devAssert.default)(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.');\n}", "title": "" }, { "docid": "56e8f3b2c64701f48db45c28045ddbe4", "score": "0.487893", "text": "function assertValidExecutionArguments(schema, document, rawVariableValues) {\n document || (0, _devAssert.default)(0, 'Must provide document.'); // If the schema used for execution is invalid, throw an error.\n\n (0, _validate.assertValidSchema)(schema); // Variables, if provided, must be an object.\n\n rawVariableValues == null || (0, _isObjectLike.default)(rawVariableValues) || (0, _devAssert.default)(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.');\n}", "title": "" }, { "docid": "c226043fd234c87e9c30fedafc6fda60", "score": "0.48777923", "text": "function assertValidExecutionArguments(schema, document, rawVariableValues) {\n document || devAssert(0, 'Must provide document.'); // If the schema used for execution is invalid, throw an error.\n\n assertValidSchema(schema); // Variables, if provided, must be an object.\n\n rawVariableValues == null || isObjectLike(rawVariableValues) || devAssert(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.');\n}", "title": "" }, { "docid": "69f82731683046170608e3b182bffb5e", "score": "0.4875885", "text": "function validateType(functionName, type, inputName, input) {\n if (typeof input !== type || (type === 'object' && !isPlainObject(input))) {\n var description = valueDescription(input);\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires its \" + inputName + \" \" +\n (\"to be of type \" + type + \", but it was: \" + description));\n }\n}", "title": "" }, { "docid": "30ec60cd1e3764ca3ba3548d354c2494", "score": "0.48710006", "text": "function validate(schemaNameOrObject, objectOrValidationOptions, maybeValidatorOptions) {\n if (typeof schemaNameOrObject === \"string\") {\n return container_1.getFromContainer(Validator_1.Validator).validate(schemaNameOrObject, objectOrValidationOptions, maybeValidatorOptions);\n }\n else {\n return container_1.getFromContainer(Validator_1.Validator).validate(schemaNameOrObject, objectOrValidationOptions);\n }\n}", "title": "" }, { "docid": "493d8ca59cff5d4ccebd27a02f709aec", "score": "0.48695558", "text": "function isObject(arg) {\n return Object.prototype.toString.call(arg)==='[object Object]';\n}", "title": "" } ]
bed61a5a2d5d99571a3c47f85b314a39
at this point, the user has presumably seen the 'readable' event, and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively.
[ { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.0", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" } ]
[ { "docid": "538af8e5b5aebeacecf3d28c40a02912", "score": "0.7310373", "text": "_read() {\n this._readingPaused = false;\n setImmediate(this._onReadable.bind(this));\n }", "title": "" }, { "docid": "b0fe652b190976fe2dba87b79106fff2", "score": "0.7021824", "text": "function checkIfCanRead() {\n if (parsers.canReadNext) {\n seek();\n } else {\n setTimeout(function() {\n checkIfCanRead();\n }, 300);\n }\n }", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6745738", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.674331", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.674331", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "27c0179c538e809f7cd8d5a7434733f9", "score": "0.67033917", "text": "_read(/* size */) {\n this._reading = true\n this.emit('read')\n }", "title": "" }, { "docid": "5cf21affec1ef2cf55d7bf9e891f1161", "score": "0.670212", "text": "_flushRead() {\n try {\n var frames = this._zmq.readv(); /* can throw */\n if (!frames) {\n return false;\n }\n\n this.emit('frames', frames);\n /* user may pause socket while handling frames so check again here */\n } catch (error) {\n this.emit('error', error); // can throw\n }\n\n return !this._paused;\n }", "title": "" }, { "docid": "8885f37ca1689b8896f84b1dc1993457", "score": "0.666021", "text": "_onReadable() {\n // Read all the data until one of two conditions is met\n // 1. there is nothing left to read on the socket\n // 2. reading is paused because the consumer is slow\n while (!this._readingPaused) {\n // First step is finding the message length which is the second token in the start-line\n\t let minimum_bytes = 32\n let buf = this._socket.read(minimum_bytes)\n if (!buf) return;\n\n let len\n\t try {\n\t \tlen = mp.get_msg_len(buf)\n } catch(err) {\n\t \tthis._socket.destroy(err)\n\t\treturn\n\t }\n\n if(!len) {\n this._socket.unshift(buf)\n\t }\n\n // ensure that we don't exceed the max size of 256KiB (TODO: need to review this for MRCP)\n if (len > 2 ** 18) {\n this.socket.destroy(new Error('Max length exceeded'));\n return\n }\n\n // With the length, we can then consume the rest of the body.\n let msg = this._socket.read(len - minimum_bytes);\n\n // If we did not have enough data on the wire to read the body\n // we will wait for the body to arrive and push the length\n // back into the socket's read buffer with unshift.\n if (!msg) {\n this._socket.unshift(buf);\n return;\n }\n\n msg = Buffer.concat([buf, msg])\n\n let parsed_msg = mp.parse_msg(msg)\n \n // Push the data into the read buffer and capture whether\n // we are hitting the back pressure limits\n let pushOk = this.push(parsed_msg);\n\n // When the push fails, we need to pause the ability to read\n // messages because the consumer is getting backed up.\n if (!pushOk) this._readingPaused = true;\n }\n }", "title": "" }, { "docid": "e565f8ee7bda70dbfad6d8128ad68d46", "score": "0.6655049", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "fe5601eade33cdc34797cc948860bd60", "score": "0.6654061", "text": "function $15f86ecbbb2f836a$var$howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;\n else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = $15f86ecbbb2f836a$var$computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "bc9dea0909c36f916541b619025d6817", "score": "0.6623238", "text": "function $c93d3462432c76c3$var$howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;\n else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = $c93d3462432c76c3$var$computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "18427f2d3d1c867c901f2b6538e7ac86", "score": "0.66193265", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "a15dbb50046269c70a87639f48e782ec", "score": "0.6604493", "text": "function onReaderClosed() {\n if (!reading) {\n readableClosed();\n }\n }", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.6499846", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "b1524892bf385c9a71a61e443065710c", "score": "0.64948314", "text": "function howMuchToRead(n, state) {\r\n if (n <= 0 || state.length === 0 && state.ended) return 0;\r\n if (state.objectMode) return 1;\r\n\r\n if (n !== n) {\r\n // Only flow one buffer at a time\r\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\r\n } // If we're asking for more than the current hwm, then raise the hwm.\r\n\r\n\r\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\r\n if (n <= state.length) return n; // Don't have enough\r\n\r\n if (!state.ended) {\r\n state.needReadable = true;\r\n return 0;\r\n }\r\n\r\n return state.length;\r\n } // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "609351c71b640a50894a5c0984fa2a9d", "score": "0.64841515", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.", "title": "" }, { "docid": "d87489addd07dde75526ecbcf8243297", "score": "0.6479484", "text": "get isReading() {}", "title": "" }, { "docid": "40f012ce75ef9ba9c76ebb41692385df", "score": "0.6473687", "text": "function checkRead() {\n if (accumulated >= goal)\n achieved.resolve();\n }", "title": "" }, { "docid": "d5d76b475ea96f9ab1df91b973249821", "score": "0.63921297", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "7930264f2e16cba8a3b729d3cc2c90a8", "score": "0.6382496", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "737c4ab818b0e17df2457cf3974e8475", "score": "0.63673604", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "737c4ab818b0e17df2457cf3974e8475", "score": "0.63673604", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "737c4ab818b0e17df2457cf3974e8475", "score": "0.63673604", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "41a534cb6249022d932c6d66e9ac9be3", "score": "0.6363346", "text": "preRead() {\n\n //\n if (this.isReading || (this.numOfFailedAjaxRead >= 20)) { return false; }\n\n this.isReading = true;\n\n return true;\n }", "title": "" }, { "docid": "69892f7ca81cb4194f3616cd00363495", "score": "0.6355017", "text": "function maybeReadMore(stream, state) {\r\n\t if (!state.readingMore) {\r\n\t state.readingMore = true;\r\n\t process.nextTick(function() {\r\n\t maybeReadMore_(stream, state);\r\n\t });\r\n\t }\r\n\t}", "title": "" }, { "docid": "64206293ec74f224b6e3a9eaae07c78c", "score": "0.63440955", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "58337fed7c6362840f309ac37612cbce", "score": "0.6339559", "text": "function needMoreData(state) {\r\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\r\n }", "title": "" } ]
5cbf0a454d9ca198b93acac0b0dfe365
Display dialog box showing tweet text and asking user if they would like to navigate to the link contained within the tweet
[ { "docid": "c229c2667420f8d115b1ecbcd0783977", "score": "0.70890784", "text": "function urlConfirmAssignment(theText, theURL) {\n\t\tvar question = confirm(theText + \n\t\t\t\"\\n\\n Are you sure you sure you want to navigate to the link contained in the outlined tweet?\");\n\n\t\tif (question) {\n\t\t\twindow.open(theURL);\n\t\t} else return;\n\t}", "title": "" } ]
[ { "docid": "ccc2559d768ec30e079c7eea13d76072", "score": "0.73274547", "text": "function openTwitter() {\n $analytics.eventTrack(documentModel.documentId, {\n category: 'cm.openTwitter',\n label: selectionService.paragraphId\n });\n closeContextMenu();\n var activeLink = linkService.getActiveLink(documentModel.documentId, selectionService.serializedSelection);\n linkService.shortenLink(activeLink)\n .then(function(response) {\n console.log(response.result.id);\n selectionService.shortLink = response.result.id;\n var tweetText = createTweetText();\n window.open('https://twitter.com/intent/tweet?text=' + tweetText, '_blank',\n 'toolbar=no,location=no, status=no,menubar=no,scrollbars=yes,resizable=yes,top=300, left=300,width=550,height=420');\n\n }, function(reason) {\n $log.error(reason);\n });\n\n }", "title": "" }, { "docid": "04357901c7261a2f2f1de1b9b37ba65c", "score": "0.7144108", "text": "function tweet() {\n var myUrl = 'https://twitter.com/intent/tweet?text=' + quoteTweet + ' ' + '- '+authorTweet;\n window.open(myUrl, 'twitter');\n return false;\n }", "title": "" }, { "docid": "805e1a83370ab73648f44ed247894278", "score": "0.7109225", "text": "function twitterClickToGoToWebPage() {\n\t\t\twindow.open(\"https://twitter.com/intent/tweet?text=%23YJuan\", \"_blank\");\n\t\t}", "title": "" }, { "docid": "87cf312a67aef1e046bd2d57a538f96f", "score": "0.703083", "text": "function twitter() {\n var url = window.location.href;\n var text = \"\";\n window.open('http://twitter.com/share?url='+encodeURIComponent(url)+'&text='+encodeURIComponent(text), '', 'left=0,top=0,width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0');\n }", "title": "" }, { "docid": "6be46eceb5dbceede23a92beca0a7524", "score": "0.6935214", "text": "function tweetQuote(){\nwindow.open(\"https://twitter.com/intent/tweet?text=\" + $(\"#quote\").text() + \" -\" + $(\"#author\").text()); \n}", "title": "" }, { "docid": "f67a70e701d1392de9e2360d5850fb18", "score": "0.68786055", "text": "function tweetQutoe(){\n const quote = quoteText.innerText;\n const author = quoteAuthor.innerText;\n const twitterUrl = `https://twitter.com/intent/tweet?text=${quote} by ${author}`;\n // Opening new tab with the specified URL.\n window.open(twitterUrl,'_blank');\n}", "title": "" }, { "docid": "ad134b593fad70888ef931e326da9206", "score": "0.68378186", "text": "function showTwitterShare() {\n // Opens a pop-up with twitter sharing dialog\n let shareURL = 'http://twitter.com/share?'; //url base\n //params\n const params = {\n url: `http://sv6.yuco.com/?x=${DEEP_LINK_ID}`,\n text: 'Celebrate the final season with this custom title sequence generator.',\n via: 'HBO',\n hashtags: \"BeTheValley,SiliconValley,HBO\"\n }\n for (let prop in params) shareURL += '&' + prop + '=' + encodeURIComponent(params[prop]);\n\n window.open(shareURL, '', 'left=0,top=0,width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0');\n}", "title": "" }, { "docid": "1d539d6f91d80ae22525a33c672e8caa", "score": "0.6820394", "text": "function tweetQuote() {\n const quote = quoteText.innerText;\n const author = authorText.innerText;\n const twitterUrl = `https://twitter.com/intent/tweet?text=${quote} – ${author}`;\n window.open(twitterUrl, '_blank');\n}", "title": "" }, { "docid": "b8bf1a5da65cc530fe0a8e4041e672ea", "score": "0.67538524", "text": "function tweetQuote() {\n const quote = quoteText.innerText;\n const author = authorText.innerText;\n const twitterUrl = `https://twitter.com/intent/tweet?text=${quote} - ${author}`\n window.open(twitterUrl, '_blank');\n}", "title": "" }, { "docid": "14fc4e6eb3c8b62281361e942a24fed8", "score": "0.6737419", "text": "function tweetQuote() {\n const tweeterUrl = `https://twitter.com/intent/tweet?text=${quote_text.textContent} - ${author_text.textContent}`;\n window.open(tweeterUrl, '_blank');\n}", "title": "" }, { "docid": "c1873fd6daf6b5fb5701284476581362", "score": "0.6618717", "text": "function tweetNominations() {\n tweetText = encodeURI(\"I nominate: \\n\" + nominations.join(\"\\n\") + \"\\n\");\n window.open('https://twitter.com/intent/tweet?hashtags=shoppies&text=' + tweetText, '_blank');\n}", "title": "" }, { "docid": "989b9c97a561264ab2a95ce210b75594", "score": "0.6598451", "text": "function shareOnTwitter() {\n var urlParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var text = arguments.length > 1 ? arguments[1] : undefined;\n var via = arguments.length > 2 ? arguments[2] : undefined;\n var title = arguments.length > 3 ? arguments[3] : undefined;\n var shareUrl = \"\".concat(window.location.origin).concat(window.location.pathname);\n var newText = stripTags(text);\n\n if (urlParams) {\n shareUrl += \"?\".concat(urlParams);\n }\n\n if (newText.length > 111) {\n newText = \"\".concat(newText.substring(0, 111), \"...\");\n }\n\n var shareServiceUrl = 'https://twitter.com/intent/tweet/';\n popUpWindow(\"\".concat(shareServiceUrl, \"?url=\").concat(encodeURIComponent(shareUrl), \"&text=\").concat(encodeURI(newText), \"&via=\").concat(encodeURI(via)), \"\".concat(encodeURI(title)), 450, 320);\n}", "title": "" }, { "docid": "e0f7493a1cecff2fc795747dd3a24b26", "score": "0.65914774", "text": "function posttwitter(){\n var url = 'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + encodeURIComponent(currentQuote +' -'+currentAuthor);\n window.open(url, 'Share', 'width=550, height=400, toolbar=0, scrollbars=1 ,location=0 ,statusbar=0,menubar=0, resizable=0');\n}", "title": "" }, { "docid": "90f50d143e0bdef81dc5eddd6d527af1", "score": "0.6590063", "text": "function loadTweet(text){\r\n var quote = text.quoteText.replace(' ','%20');\r\n var author = text.quoteAuthor;\r\n var tweetLink = 'https://twitter.com/intent/tweet?url=/&text=\"'\r\n var link = tweetLink + quote +'\"'+ author;\r\n $(\"#tweet\").attr(\"href\", link);\r\n }", "title": "" }, { "docid": "127e70fad8898d57c91e6e262d96f6aa", "score": "0.65760285", "text": "function tweetQuote() {\r\n const quote = document.querySelector(\".quote-text\").innerText;\r\n const author = document.querySelector(\"#author\").innerText;\r\n const twitterUrl = `https://twitter.com/intent/tweet?text=\"${quote}\"-${author}`;\r\n window.open(twitterUrl, \"_blank\");\r\n}", "title": "" }, { "docid": "4b416cf9fba562d0247bf0c2c5c52604", "score": "0.65728325", "text": "function onClickTweet(e, tweet) {\n e.preventDefault();\n var windowOpts = 'width=440,height=250,status=no,menubar=no,titlebar=no';\n window.open(tweet, '_blank', windowOpts);\n}", "title": "" }, { "docid": "ee6ba1755db2b59ec7288825c8a20670", "score": "0.64909273", "text": "function tweet(){\n let text = encodeURIComponent(document.getElementById('theQuote').textContent);//Get the text of the quote and encode that text as a URI.\n let a = document.getElementById('tweet');\n a.href = \"https://twitter.com/intent/tweet?text=\" + text;\n}", "title": "" }, { "docid": "f8a6669ecc19f91b7547537a136d4235", "score": "0.64462537", "text": "function shareTwitterQuoteHandler() {\n const twitterUrl = `https://twitter.com/intent/tweet?text=${textQuote.textContent} - ${authorQuote.textContent}`;\n window.open(twitterUrl, '_blank');\n }", "title": "" }, { "docid": "4f94b18e16472b837420976c96ab4058", "score": "0.6421276", "text": "function showTweet(tid){\r\n //tid is the tweet id - '1234567897654321'\r\n twttr.widgets.createTweet(\r\n tid, \r\n document.getElementById('tweet-box') //what div in the HTML to put the tweet in\r\n ); \r\n}", "title": "" }, { "docid": "45dce05d6511d58fab404a70d26aef8d", "score": "0.6402132", "text": "function showResponse(data){\n let url = \"\";\n activity.innerHTML = data.activity;\n participants.innerHTML = data.participants;\n type.innerHTML = data.type;\n // Check if there's a link available\n if(data.link == \"\"){\n link.innerHTML = \"\";\n } else {\n url = data.link;\n link.href = url;\n link.innerHTML = \"&#x1f517; \"+url.substring(0, 20)+\"...\";\n }\n tweet.href = \"https://twitter.com/intent/tweet/?text=Bored? \"+data.activity+\"&hashtags=\"+data.type+\" \"+url+ \" (Im-bored.now.sh)\";\n showContent();\n}", "title": "" }, { "docid": "e79c83ed1a335afdd471982cbf98c092", "score": "0.6382357", "text": "function shareQuote() {\r\n var text = \"'\" + $(\".content h3\").text() + \"'\" + $(\".content h4\").text();\r\n var url = \"https://twitter.com/intent/tweet?hashtags=GiveMeAQuote&text=\" + text;\r\n window.open(url);\r\n}", "title": "" }, { "docid": "2d06b441817fef79dcbe717952539cf9", "score": "0.63479835", "text": "function tweetQuote() {\n var tweetUrl = ' https://twitter.com/intent/tweet?text=' + encodeURIComponent(generatedQuote);\n window.open(tweetUrl);\n }", "title": "" }, { "docid": "ca01ce69ecdc3d2d73e7f75ed9fb384c", "score": "0.6314411", "text": "showSharePopUp(destinationUrl, thanksText) {\n\t\t\t// This code taken from the twitter example in the docs\n\t\t\tconst width = 600;\n\t\t\tconst height = 420;\n\t\t\tconst winHeight = window.innerHeight;\n\t\t\tconst winWidth = window.innerWidth;\n\t\t\tconst left = Math.round((winWidth / 2) - (width / 2));\n\t\t\tlet top = 0;\n\n\t\t\tif (winHeight > height) {\n\t\t\t\ttop = Math.round((winHeight / 2) - (height / 2));\n\t\t\t}\n\t\t\twindow.open(\n\t\t\t\tdestinationUrl,\n\t\t\t\t'intent',\n\t\t\t\t// eslint-disable-next-line max-len\n\t\t\t\t`scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=${width},height=${height},left=${left},top=${top}`\n\t\t\t);\n\t\t\tthis.$showTipMsg(thanksText);\n\t\t}", "title": "" }, { "docid": "99b7b1f6ba811b4e4d0ef99dc7c5a876", "score": "0.6280412", "text": "setHrefLink() {\n this.popover.href = 'http://twitter.com/intent/tweet?text=' + encodeURI(Selection.getSelectedText());\n }", "title": "" }, { "docid": "775fed5a1ed3f66187cc58871871c00e", "score": "0.6270849", "text": "function twitter(type){\r\n jQuery('#sonnyGif').attr('onclick', 'analytics(\"twitter_share\")').click();\r\n var hashtag = 'kindnessApp';\r\n if(type == 'finished'){ // compassion challenge finished\r\n var msg = 'I%20finished%20the%2010%20day%20compassion%20challenge!%20That\\'s%2010%20acts%20of%20kindness%20in%2010%20days!%20Try%20it%20now';\r\n }\r\n else{ // pulling kindness from cal view\r\n msg = jQuery('.taskDetail'+ type +' .kindnessTxt').text();\r\n msg = encodeURIComponent(msg);\r\n }\r\n var url = 'http%3A%2F%2Fthekindnessapp.com';\r\n var mrmoonhead = 'mr_moonhead';\r\n var tweet = '?hashtags='+hashtag+'&original_referer=https%3A%2F%2Fdev.twitter.com%2Fweb%2Ftweet-button&ref_src=twsrc%5Etfw&related=twitterapi%2Ctwitter&text=' + msg + '&tw_p=tweetbutton&url=' + url;\r\n \r\n var url = \"https://twitter.com/intent/tweet\" + tweet;\r\n window.open(url, '_blank'); \r\n }", "title": "" }, { "docid": "ab0cb093d402cffacf64b488085bead0", "score": "0.6239229", "text": "function sharetwitter(u,t)\n\t{\n url= curl + \"index.php?seccion=motel&id=\" + u;\n title=\"Cinco Letras, La guía de moteles en Guadalajara :: Motel \" + t;\n\twindow.open('http://twitter.com/share?url='+encodeURIComponent(url)+'&text='+encodeURIComponent(title),'Twitter','toolbar=0,status=0,width=626,height=436');\n\treturn false;\n\t}", "title": "" }, { "docid": "fbc90db8a28330485ef335513944db60", "score": "0.6235148", "text": "function tweetit(str) {\n var twitterDiv = document.getElementById('twitterButton');\n twitterDiv.parentNode.removeChild(twitterDiv);\n var twitter = document.createElement('a');\n var tweetNode = document.createTextNode(\"Tweet\");\n var tweet = \"https://twitter.com/intent/tweet?text=\" + str;\n twitter.setAttribute('href', tweet);\n twitter.setAttribute('id', 'twitterButton');\n twitter.setAttribute('target', '_blank');\n twitter.appendChild(tweetNode);\n document.getElementById('twitter').appendChild(twitter);\n}", "title": "" }, { "docid": "1e8cfdfc6ac3552a8aca14271b9317a9", "score": "0.62065554", "text": "shareOnTwitter(url = null, message = '') {\n const sharedUrl = url || window.location.href;\n this.openUrlInNewTab(`http://twitter.com/share?text=${message}&url=${escape(sharedUrl)}`);\n }", "title": "" }, { "docid": "28b30632294e4a52bfcc345125701478", "score": "0.60231733", "text": "function tweeter() {\n console.log('tweettweet');\n tweetQ.setAttribute(\n 'href',\n 'https://twitter.com/intent/tweet?hashtags=freecodecamp,quotemachine&related=freecodecamp&text=' +\n encodeURIComponent('\"' + curQuote + '\"')\n );\n}", "title": "" }, { "docid": "7fc3db03b2bc29c2c045e8e9afbe9217", "score": "0.6009081", "text": "async test_twitter_link(){\n await basePage.open_link(this.twitter)\n }", "title": "" }, { "docid": "ae69b016d4d83c7f9d5d73fcfe729c62", "score": "0.598866", "text": "function openLinkDialog() {\n $.prompt('<input id=\"inviteLinkRef\" type=\"text\" value=\"'\n + encodeURI(roomUrl) + '\" onclick=\"this.select();\" readonly>',\n {\n title: \"Share this link with everyone you want to invite\",\n persistent: false,\n buttons: { \"Cancel\": false},\n loaded: function(event) {\n document.getElementById('inviteLinkRef').select();\n }\n });\n}", "title": "" }, { "docid": "4496a3f26bca25e7a663d91f22f89dc4", "score": "0.5983263", "text": "function tweet() {\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"What do you want to tweet via Griffin's account?\\nFor your own safety, please don't put anything strange, or he will eliminate you..I promise.\\nIf you chose this feature by mistake, just simply press \\\"Ctrl + C\\\" and run me again.\\n\",\n\t\t\tname: \"post\"\n\t\t}\n\t]).then(function(res) {\n\t\tkeys.post('statuses/update', {status: res.post + \" ---sent from Liri\"}, function(error, tweets, response) {\n\t\t\tif (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tconsole.log(\"\\n-------------------------------------------------\\n\");\n\t\t\tconsole.log(\"Tweet \\\"\" + res.post + \"\\\" has been posted by @liri_bot_griff already!\");\n\t\t\tconsole.log(\"Go to https://twitter.com/liri_bot_griff or choose \\\"View my owner\\'s tweets\\\" below to check it.\\n\")\n\t\t\twhatelse();\n\t\t})\n\t})\n}", "title": "" }, { "docid": "ec6fa4f890665c29df899b61f958240a", "score": "0.59555566", "text": "function TwitterShare(result){\r\n\tresult = result.replace(/<br><br>/g, \"%0a\");\r\n\tresult = result.replace(/<br>/g, \"%0a\");\r\n\tresult = result.replace(/<.*?>/g, \"\");\r\n\tresult = result.replace(/,/g, \"%E2%80%9A\");\r\n\r\n\t//console.log(result);\r\n\r\n\tdocument.getElementById(\"tweet\").href = \"https://twitter.com/intent/tweet?text=I've been transformed!&hashtags=TFGenerator\" + \"%0a%0a\"+ result;\r\n\t//document.getElementById(\"tweet\").setAttribute('onclick',\"https://twitter.com/intent/tweet?text=Check out this cool TF generator that generates random transformation scenarios!&url=https://unidentified-tf.github.io/TF-Generator/&hashtags=TFgenerator','_blank')\")\r\n}", "title": "" }, { "docid": "88449fa1503cc81472712bd5a4f88b59", "score": "0.5841972", "text": "function twitterCallback_withOptions(obj, divid, username, linksinnewwindows, includetimestamp) {\n\tvar wwwregular = /\\bwww\\.\\w.\\w/ig;\n\tvar regular = /((https?|s?ftp|ssh)\\:\\/\\/[^\"\\s\\<\\>]*[^.,;'\">\\:\\s\\<\\>\\)\\]\\!])/g;\n\tvar atregular = /\\B@([_a-z0-9]+)/ig;\n\tvar twitters = obj;\n\tvar statusHTML = \"\";\n\t\n\tfor (var i=0; i<twitters.length; i++) {\n\t\tvar posttext = \"\";\n\t\tposttext = twitters[i].text.replace(wwwregular, 'http://$&');\n\t\tposttext = posttext.replace(regular, '<a href=\"$1\">$1</a>');\n\t\tposttext = posttext.replace(atregular, '@<a href=\"http://twitter.com/$1\">$1</a>');\n\t\t\n\t\tstatusHTML += ('<li><span>'+posttext+'</span>');\n\t\tif (includetimestamp) {\n\t\t\tstatusHTML += (' <a style=\"font-size:85%\" href=\"http://twitter.com/'+username+'/status/'+twitters[i].id_str+'\" title=\"Tweet 固定链接\">'+relative_time(twitters[i].created_at)+'</a>');\n\t\t}\n\t\tstatusHTML += ('</li>');\n\t}\n\t\n\tvar twitterupdatelist = document.createElement('ul');\n\ttwitterupdatelist.innerHTML = statusHTML;\n\t\n\tif (linksinnewwindows)\n\t{\n\t\tvar m = twitterupdatelist.getElementsByTagName(\"A\");\n\t\tfor (var i=0; i<m.length; i++) {\n\t\t\tm[i].target = \"_blank\";\n\t\t}\n\t}\n\t\n\tvar twitterupdatediv = document.getElementById(divid);\n\ttwitterupdatediv.appendChild(twitterupdatelist);\n}", "title": "" }, { "docid": "ea542d30d194453a14d39b8c7888500c", "score": "0.58223593", "text": "function echo_tweet(tweet) {\n console.log(tweet)\n var text = tweet.full_text\n\n if(tweet.truncated){\n console.log(tweet)\n text = tweet.extended_tweet.full_text\n }\n\n twitter_writer.post('statuses/update', {'status': text}, function(err, data, response){\n if(err) {\n console.log(err);\n }\n else {\n console.log(\"Successfully echoed tweet: \" + text);\n }\n })\n}", "title": "" }, { "docid": "59d09a505bc7d8bb1f5e02cc756c8bd4", "score": "0.5796939", "text": "function show_twitter_on_tile() {\n\t\tvar rooturl = location.protocol + '//' + location.host;\n\t\t$.getJSON( rooturl + '/Matrix/tweets.php', function(data){\n // Result\n var tweet = \"\";\n\t\tfor (i = 0; i < data.length; i++) {\n\t\ttweet += \"<li>\" + data[i].text + \"</li>\";\n\t\t}\n \n // Links\n tweet = tweet.replace(/(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig, function(url) {\n return '<a target=\"_blank\" href=\"'+url+'\">'+url+'</a>';\n }).replace(/B@([_a-z0-9]+)/ig, function(reply) {\n return reply.charAt(0)+'<a href=\"http://twitter.com/'+reply.substring(1)+'\">'+reply.substring(1)+'</a>';\n });\n // Output\n $(\"#tweeter\").html(tweet);\n\t\t});\n\t\t\n\t}//end show_twitter_on_tile();", "title": "" }, { "docid": "19482eb0848bdba074293b0b1afd59b6", "score": "0.5778832", "text": "function displayTwitter() {\n\n\t \tvar params = {screen_name: mediaString};\n\t \tclient.get('statuses/user_timeline/', params, function(error, data, response) {\n\t \t\tif (!error) {\n\t \t\t\tconsole.log(\"\\nTweets for screen name: \" + mediaString);\n\t \t\t\tfor (var i = 0; i < data.length; i++) {\n\t \t\t\t\tconsole.log(\"\\n--------------------- tweet \" + (i+1) + \"------------------------\")\n\t \t\t\t\tconsole.log(data[i].text);\n\t \t\t\t\tconsole.log(\"Created: \" + data[i].created_at + \" by \" + data[i].user.name);\n\t \t\t\t}; \n\t \t\t}\n\t \t\telse{\n\t \t\t\tconsole.log(\"Error: \" + error);\n\t \t\t\treturn;\n\t \t\t}\n\t \t}); \n\t}", "title": "" }, { "docid": "34a54379ec5ce1bdcdd7690b93ebf6a2", "score": "0.57253087", "text": "function linkSel() {\n\tvar linkURL = prompt(\"Enter URL:\", \"http://\");\n\trichTextBox.document.execCommand(\"CreateLink\", false, linkURL);\n}", "title": "" }, { "docid": "a39cbfdaa4f74f3293458d57b19375e3", "score": "0.57230574", "text": "function openDialogForTwitterID(){\r\n\t\t\t\r\n\t\t\t\tvar originalContent=$('#twitter_dialog').html();\r\n\t\t\t\t$('#twitter_dialog').dialog(\"open\");\r\n\t\t\t\t $('#twitter_dialog').dialog({\r\n\t\t\t\ttitle:' Enter Twitter IDs of Your known Leaders & Parties',\r\n\t\t\t\theight: 'auto',\r\n\t\t\t\twidth: 560,\r\n\t\t\t\tmodal: true,\r\n\t\t\t\tresizable:false,\r\n\t\t\t\tautoopen:false,\r\n\t\t\t\topen:function(){\r\n\t\t\t\t\t$(\"#innerdiv\").css(\"display\",\"block\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).parent(\".ui-dialog\").find(\".ui-dialog-titlebar-close\").click(function(){\r\n\t\t\t\t\t\t$(this).dialog('close');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\t\r\n\t\t\t\tbuttons: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttext: \"Send\",\r\n\t\t\t\t\t\"class\":'btn btn-inverse btn-small',\r\n\t\t\t\t\t\"click\":function(){\r\n\t\t\t\t\t\tgetInsertData();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\t {\r\n\t\t\t\t\ttext: \"Cancel\",\r\n\t\t\t\t\t\"class\":'btn btn-inverse btn-small',\r\n\t\t\t\t\t\"click\":function(){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).dialog('close');\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\t],\r\n\t\t\t\tclose: function(){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('#twitter_dialog').html(originalContent);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\t\t });\r\n}", "title": "" }, { "docid": "2a76f5aa4c417f34ea17440f740f6d39", "score": "0.57206976", "text": "function twShare(url, title, winWidth, winHeight) {\n const winTop = 100;\n const winLeft = 100;\n window.open(`https://twitter.com/intent/tweet?text=${title}`, 'sharer', `top=${winTop},left=${winLeft},toolbar=0,status=0,width=${winWidth},height=${winHeight}`);\n}", "title": "" }, { "docid": "6127a7326d5b9880507446f176d91ac8", "score": "0.5705595", "text": "function onPageDetailsReceived(pageDetails) {\n var name = pageDetails.title.split(' on Twitter: ')\n name = name[0]\n document.getElementById('title').value = name;\n var id = pageDetails.url.split('/')\n id = id[id.length-1]\n document.getElementById('url').value = id;\n document.getElementById('summary').innerText = pageDetails.summary;\n}", "title": "" }, { "docid": "336a4571834ae88c0acb66fb50bd7ad7", "score": "0.5654879", "text": "function handleTweetText(data) {\n for (var i = 0; i < data.content.length; i++) {\n const tweetHtml = data.content[i].content.bodyHtml;\n // If tweet exists, return it\n if(tweetHtml && tweetHtml != '') {\n // Regex to grab entire anchor tag\n const regEx = /<a(\\s[^>]*)?>.*?<\\/a>/ig\n // Replace anchor with empty string and remove empty space\n const splitTweetText = tweetHtml.replace(regEx, '').trim()\n const allWords = splitTweetText.split(' ')\n // tweets.push(splitTweetText) displays the entire tweet, but not sure if correct\n\n allWords.forEach(word => tweets.push(word))\n }\n }\n}", "title": "" }, { "docid": "ad96dc4c8727ff8d992b80d0187d62ea", "score": "0.56347424", "text": "function goHelpTranscribe() {\n// bootbox.alert(trjs.help.transcribe, function () {});\n trjs.displayhelp(\"transcribe\");\n }", "title": "" }, { "docid": "a0b7d4e24b2535b1ad2b70993ee3d6c7", "score": "0.56264424", "text": "openChat(text) {\r\n window.open('http://www.twitch.tv/' + text + '/chat?popout=', '', 'height=500,width=300');\r\n }", "title": "" }, { "docid": "6cd4c6b0656377922830f49da5650364", "score": "0.5625119", "text": "function link_text() {\r\n if (!dataHolder) {\r\n dataHolder = timeline.dataHolder;\r\n }\r\n var track = dataHolder.getSelectedTrack();\r\n if (!track || (track.getType() !== TAG.TourAuthoring.TrackType.artwork && track.getType() !== TAG.TourAuthoring.TrackType.image)) {\r\n creationError(\"There is no artwork or image track selected. Please select a valid track or create an unlinked annotation.\");\r\n return false;\r\n }\r\n\r\n // First, check if the text is a valid (non-empty) ink by checking the value of the textbox. If invalid, show a warning message.\r\n if (isTextboxEmpty()) {\r\n creationError(\"Unable to attach an empty annotation. Please add to annotation component before attaching.\");\r\n return false;\r\n }\r\n // next, check to make sure the playhead is in a display; if not, show a warning message\r\n var inDisplay = checkInDisplay(track);//.getDisplays());\r\n // also check if the selected track is an artwork or an image\r\n if (!inDisplay) {\r\n creationError(\"Please move the playhead within the currently selected track's display.\");\r\n return false; // if a warning popped up, return false\r\n }\r\n var keyframe = viewer.captureKeyframe(track.getTitle());\r\n if (!keyframe) {\r\n creationError(\"The track selected must be fully on screen in order to attach an annotation. Please seek to a location where the track is visible.\");\r\n return false;\r\n }\r\n\r\n\r\n save_text();\r\n return link();\r\n }", "title": "" }, { "docid": "e44239c91a38b267559ea56f32cef2b0", "score": "0.56093895", "text": "function changeContents(){\n\t//formulate results string so as to be reusable later for tweet button\n\tvar text = document.getElementById(\"inputarea\").value;\n\t\n\tvar out = \"<span style=\\\"font-size:x-large;font-weight:bold;color:#3355FF;\\\">\\n\" \n\t\t + text + \"\\n</span><br><br>\\n\" \n\t\t + \"<span id=\\\"restwbtn\\\">Tweet: </span>\\n\";\n\t\n\tdocument.getElementById(\"output\").innerHTML = out;\n\t\n\t//*** append results tweet button\n\tvar twtxt = text;\n\tif(twtxt.length > 95){\n\t\ttwtxt = twtxt.substring(0,92) + \"...\";\n\t}\n\ttwtxt += \"\\nTwitter-Button-Test\\n\";\n\t\n\tvar twa = document.createElement(\"a\");\n\ttwa.className = \"twitter-share-button\";\n\ttwa.href = \"http://twitter.com/share\";\n\t\n\t//HACK: need to treat hyphenated properties separately\n\tvar DATAURL = \"https://02f41be48d339da0cde243ece33c283e3f0c321e.googledrive.com/host/0B9f3hv6KkjXcS19ZMmxxdGE5bUE/twbtn-test/twitter-button-test.html\";\n\tif(twa.setProperty){\n\t\ttwa.setProperty(\"data-url\", DATAURL, null);\n\t\ttwa.setProperty(\"data-text\", twtxt, null);\n\t}else{\n\t\ttwa.setAttribute(\"data-url\", DATAURL);\n\t\ttwa.setAttribute(\"data-text\", twtxt);\n\t}\n\t\n\tdocument.getElementById(\"restwbtn\").appendChild(twa);\n\t\n\t//HACK: call twitterAPI function directly; could change?\n\ttwttr.widgets.load();\n\t\n\t//change display for start button\n\tdocument.getElementById(\"startbutton\").value=\"v Change Contents v\";\n\t\n}", "title": "" }, { "docid": "53fe74da6103b48569078b8db91fe343", "score": "0.5598395", "text": "function Ok() {\n\tvar sUrl = 'javascript: void();';\n\t\n\tif (!GetE('TTtxt').value || !GetE('TTalter').value) {\n\t\talert('Не сте въвели текст!');\n\t\treturn false;\n\t}\n\t\n\tif (!oLink) {\n\t\t// Nqma link => suzdavame\n\t\toLink = oEditor.FCK.CreateLink(sUrl)[0];\n\t}\n\t\n\toLink.removeAttribute('href');\n\t\n\toLink.innerHTML = GetE('TTtxt').value;\n\tSetAttribute(oLink, 'title', GetE('TTalter').value);\n\t\n\tif (oEditor.FCKBrowserInfo.IsIE) {\n\t\tSetAttribute(oLink, 'className', 'ttword') ;\n\t} else {\n\t\tSetAttribute(oLink, 'class', 'ttword');\n\t}\n\t\n\treturn true ;\n}", "title": "" }, { "docid": "330a01a1d4f419aea9f539c1326a7cac", "score": "0.5580846", "text": "function tweetItFollow(txt) {\n //var r = Math.floor(Math.random() * 100)\n var tweet = {\n status: txt\n }\n T.post('statuses/update', tweet, tweeted);\n\n function tweeted(err, data, response) {\n if (err) {\n console.log(\"something went wrong\")\n } else {\n console.log(\"It worked\")\n }\n }\n}", "title": "" }, { "docid": "0a65d4caf091f06d76aad71beeedf86d", "score": "0.55698746", "text": "function runScript() {\n var location = window.location;\n var hostname = location.host;\n var pathname = location.pathname;\n\n if (isTwitter(hostname))\n openTweetbot(pathname);\n}", "title": "" }, { "docid": "11707f303aef28884efef956780669bb", "score": "0.55608344", "text": "function getInput() {\n let url = window.prompt('Enter the full tweet url');\n if (url.includes('status/')==false) {\n alert('Enter the full url');\n return; \n }\n sendReq(url);\n}", "title": "" }, { "docid": "30081e15c6d150c1f62e087f096b3c74", "score": "0.5560412", "text": "function doPost(tweetText){\n\t\tvar postHTML = \"<article class=\\\"tweet\\\">\\\n\t\t\t\t\t\t<div class=\\\"content\\\">\\\n\t\t\t\t\t\t\t<img class=\\\"avatar\\\" src=\\\"\" + userInfo.img + \"\\\" />\\\n\t\t\t\t\t\t\t<strong class=\\\"fullname\\\">\" + userInfo.name + \"</strong>\\\n\t\t\t\t\t\t\t<span class=\\\"username\\\">\" + userInfo.username + \"</span>\\\n\t\t\t\t\t\t\t<i class=\\\"fa fa-star-o fa-star\\\"></i>\\\n\t\t\t\t\t\t\t<p class=\\\"tweet-text\\\">\" + tweetText + \"</p>\\\n\\\n\t\t\t\t\t\t\t<div class=\\\"tweet-actions\\\">\\\n\t\t\t\t\t\t\t\t<ul>\\\n\t\t\t\t\t\t\t\t\t<li><span class=\\\"icon action-reply\\\"></span> Reply</li>\\\n\t\t\t\t\t\t\t\t\t<li><span class=\\\"icon action-retweet\\\"></span> Retweet</li>\\\n\t\t\t\t\t\t\t\t\t<li class=\\\"favorite\\\"><span class=\\\"icon action-favorite\\\"></span> Favorite</li>\\\n\t\t\t\t\t\t\t\t\t<li><span class=\\\"icon action-more\\\"></span> More</li>\\\n\t\t\t\t\t\t\t\t</ul>\\\n\t\t\t\t\t\t\t</div>\\\n\\\n\t\t\t\t\t\t\t<div class=\\\"stats\\\">\\\n\t\t\t\t\t\t\t\t<div class=\\\"retweets\\\">\\\n\t\t\t\t\t\t\t\t\t<p class=\\\"num-retweets\\\">30</p>\\\n\t\t\t\t\t\t\t\t\t<p>RETWEETS</p>\\\n\t\t\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\t\t\t<div class=\\\"favorites\\\">\\\n\t\t\t\t\t\t\t\t\t<p class=\\\"num-favorites\\\">6</p>\\\n\t\t\t\t\t\t\t\t\t<p>FAVORITES</p>\\\n\t\t\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\t\t\t<div class=\\\"users-interact\\\">\\\n\t\t\t\t\t\t\t\t\t<div>\\\n\\\n\t\t\t\t\t\t\t\t\t\t<img class=\\\"hasTooltip\\\" src=\\\"img/alagoon.jpg\\\" />\\\n\t\t\t\t\t\t\t\t\t\t<img class=\\\"hasTooltip\\\" src=\\\"img/vklimenko.jpg\\\" />\\\n\t\t\t\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\t\t\t</div>\\\n\\\n\t\t\t\t\t\t\t\t<abbr class=\\\"timeago\\\" title=\\\"2014-04-04T09:35:00Z\\\">\\\n\t\t\t\t\t\t\t\t</abbr>\\\n\t\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\t\t<div class=\\\"reply\\\">\\\n\t\t\t\t\t\t\t\t<img class=\\\"avatar\\\" src=\\\"img/alagoon.jpg\\\" />\\\n\t\t\t\t\t\t\t\t<textarea class=\\\"tweet-compose\\\" placeholder=\\\"Reply to @mybff\\\"/></textarea>\\\n\t\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\t</div>\\\n\t\t\t\t\t</article><!-- .tweet -->\";\n\t\t$(\"#stream\").prepend(postHTML);\n\t\t$(\"abbr.timeago\").timeago(); //Refresh the timeago plugin\n\t}", "title": "" }, { "docid": "43d04f03b8631d802a837806eedb7d28", "score": "0.5541329", "text": "function tweetNow(text) {\n let tweet = {status: text}\n\n T.post('statuses/update', tweet, (err, data, response) => {\n if (err) {console.log('ERROR: Cannot Reply. Not a first time follower')}\n console.log('SUCCESS: Replied to Follower')\n })\n}", "title": "" }, { "docid": "e8e938e95ac87d5b28435f1da2829b81", "score": "0.5525136", "text": "function revealSocial(type,link,title,image,desc,twvia,twrel) {\n title = typeof title !== 'undefined' ? title : false;\n image = typeof image !== 'undefined' ? image : false;\n desc = typeof desc !== 'undefined' ? desc : false;\n twvia = typeof twvia !== 'undefined' ? twvia.toString().replace('@','') : false;\n twrel = typeof twrel !== 'undefined' ? twrel.toString().replace('@','') : false;\n //type can be twitter, facebook or gplus\n var srcurl = '';\n if (type == 'twitter') {\n srcurl = 'http://twitter.com/intent/tweet?text=' + encodeURIComponent(title).replace('|','%7c') + '&url=' + link + '&via=' + twvia + '&related=' + twrel;\n } else if (type == 'facebook') {\n srcurl = 'http://www.facebook.com/sharer/sharer.php?s=100&p[url]=' + link + '&p[images][0]=' + image + '&p[title]=' + encodeURIComponent(title).replace('|','%7c') + '&p[summary]=' + encodeURIComponent(desc).replace('|','%7c');\n } else if (type == 'gplus') {\n srcurl = 'https://plus.google.com/share?url=' + link;\n }\n console.log(srcurl);\n if (srcurl.length > 1) {\n window.open(srcurl, type, 'left=60,top=60,width=500,height=500,toolbar=1,resizable=1').focus();\n }\n return false;\n}", "title": "" }, { "docid": "9e2197e0a52cdee626ee5d14b10f9fba", "score": "0.5522049", "text": "function linkTweet() {\n\tvar linkArray = [];\n\tvar tweetArray = [];\n\tT.get('search/tweets', getRandomHashtag(), function (error, data) {\n\t\tvar tweets = data.statuses;\n\t\tfor (var i = 0; i < tweets.length; i++) {\n\t\t\tuserInfo = tweets[i].user;\n\t\t\tif (userInfo.lang == 'en') {\n\t\t\t\ttweet = tweets[i].full_text;\n\t\t\t\tif (tweet.includes('https:')) {\n\t\t\t\t\tvar splitTweet = tweet.split(\" \");\n\t\t\t\t\ttweetArray.push(splitTweet);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (var t in splitTweet) {\n\t\t\tif (splitTweet[t].includes('https:')) {\n\t\t\t\tlink = splitTweet[t];\n\t\t\t\tlinkArray.push(link);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvar randomInt = getRandomInt(2);\n\t\tvar randomLink = linkArray[Math.floor(Math.random()*linkArray.length)];\n\t\tif (randomInt == 0) {\n\t\t\tvar randomDialogue = linkTweetArray1[Math.floor(Math.random()*linkTweetArray1.length)];\n\t\t\tT.post('statuses/update', { status: randomDialogue + randomLink}, function(err, data, response) {\n\t\t\tconsole.log(data)\n\t\t\t})\n\t\t} else if (randomInt == 1) {\n\t\t\tvar randomDialogue = linkTweetArray2[Math.floor(Math.random()*linkTweetArray2.length)];\n\t\t\tT.post('statuses/update', { status: randomLink + randomDialogue}, function(err, data, response) {\n\t\t\tconsole.log(data)\n\t\t\t})\n\t\t}\n\t})\n}", "title": "" }, { "docid": "978543f81ba3c3da40e03a46245994a9", "score": "0.55206496", "text": "function createArticleTwitterLink(params, productDescription) {\n\tvar twitterURL = $('input#twitterURL').val();\n\tvar twitterMsg = $('input#twitterMsg').val();\n\tvar hashMsg = $('input#twitterHashTag').val();\n\tvar twitterVia=$('input#twitterVia').val();\n\tvar browserUrl = $('input#browserUrl').val();\n\t\n\tbrowserUrl = browserUrl + params;\n\tif(twitterURL != 'undefined' && twitterURL != \"\" && twitterMsg != 'undefined' && hashMsg != 'undefined')\n \t{\n\t\tvar encodedURI = encodeURI(\"original_referer=\" + browserUrl + \"&tw_p=tweetbutton&url=\"\t+ browserUrl + \"&text=\");\n\t\tvar encodedDescription = encodeURI(productDescription +\", by @\"+twitterVia);\n\t\tencodedDescription = encodedDescription.replace(\"&\", \"%26\");\t\t\t\t\n\t\tvar twitterURLString = encodedURI + encodedDescription\t\t\n\t\tvar tempUrl = twitterURL+twitterURLString;\n\t\tpopup(tempUrl, 'twitter', 655, 300, true);\n\t}\n}", "title": "" }, { "docid": "748021074cf4527d120d389e916c3984", "score": "0.5517163", "text": "function on_click(e) {\n if (inLink) {\n window.location = linkText;\n }\n}", "title": "" }, { "docid": "19657ffc6b29a5bfc5df319453b39901", "score": "0.55144495", "text": "function printTweet(api, tweet, channels) {\n\t\tvar i,\n\t\t\tmsg = \"##url## @##user##: ##text##\"\n\t\t\t\t.replace(\"##user##\", tweet.user.screen_name)\n\t\t\t\t.replace(\"##text##\", tweet.text)\n\t\t\t\t.replace(/&lt;/g, \"<\")\n\t\t\t\t.replace(/&gt;/g, \">\")\n\t\t\t\t.replace(/\"\\r\\n|\\n\"/g, \"\");\n\n\t\tchannels = channels || api.channelFilters.twitter;\n\n\t\tapi.bitly.shorten(\"http://twitter.com/\" + tweet.user.screen_name + \"/status/\" + tweet.id_str, function (result) {\n\t\t\tmsg = msg.replace(\"##url##\", result.data.url || '');\n\n\t\t\tfor (i = 0; i < channels.length; i++) {\n\t\t\t\tapi.jerk.say( channels[ i ], msg );\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2f6a26881a8866ef13a39a4e2d52c972", "score": "0.55129206", "text": "function GetTweetHTML(tweet){\n\n\tvar intToString = [\"Zero\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\"];\n\n\tvar mediaString = \"\";\n\n\t// HTML Tweet Text that needs to be returned\n\tvar tweetHTML = \"\";\n\n\t// Text of the Tweet\n\tvar tweetText = tweet['text'];\n\n\t// Array of words in the Tweet\n\tvar tweetWords = tweet['text'].split(\" \");\n\n\tvar hashtags = tweet['entities']['hashtags'];\n\tvar symbols = tweet['entities']['symbols'];\n\tvar urls = tweet['entities']['urls'];\n\tvar media = tweet['entities']['media'];\n\tvar userMentions = tweet['entities']['user_mentions'];\n\n\t// Replace all the Hashtags with hashtag links\n\tif(hashtags != undefined && hashtags['length'] > 0){\n\n\t\thashtags.forEach(function(hashtag){\n\n\t\t\ttweetText = tweetText.replace('#' + hashtag['text'], '<a class=\"hashtagLink\" target=\"_blank\" href=\"https://twitter.com/hashtag/' + hashtag['text'] + '?src=hash\">#' + hashtag['text'] + '</a>');\n\t\t});\n\t}\n\n\t// Replace all the user-Mentions with User Links\n\tif(userMentions != undefined && userMentions['length'] > 0){\n\n\t\tuserMentions.forEach(function(user){\n\n\t\t\ttweetText = tweetText.replace('@' + user['screen_name'], '<a class=\"userMentionLink\" target=\"_blank\" href=\"https://twitter.com/' + user['screen_name'] + '\">@' + user['screen_name'] + '</a>');\n\t\t});\n\t}\n\n\t// Replace is all the Media Content with HTML Links\n\t// Twitter Dev URL: https://dev.twitter.com/overview/api/entities-in-twitter-objects#media\n\t// NOTE: The media type (media['type']) for now only supports 'photo'. If later it supports more\n\t// media content such as video etc, that also needs to be taken care of in the Application.\n\tif(media != undefined && media['length'] > 0){\n\n\t\tvar index = 1;\n\n\t\tmedia.forEach(function(mediaEle){\n\n\t\t\t// TODO --> Ask for Width and height Properties and set them for the image\n\t\t\ttweetText = tweetText.replace(mediaEle['url'], '<div class=\"imgLink link' + intToString[index] + '\">' + mediaEle['url'] + '</div>');\n\t\t\tmediaString += '<img class=\"tweetImg img' + intToString[index] + '\" width=\"450px\" style=\"display: none;\" height=\"auto\" src=\"' + mediaEle['media_url'] + '\">';\n\t\t\tindex += 1;\n\t\t});\n\t}\n\n\t// Replace all the Url(s) with the HTML links for the Url(s)\n\tif(urls != undefined && urls['length'] > 0){\n\n\t\turls.forEach(function(url){\n\n\t\t\ttweetText = tweetText.replace(url['url'], '<a class=\"webLink\" target=\"_blank\" href=\"' + url['expanded_url'] + '\">' + url['url'] + '</a>');\n\t\t});\n\n\t}\n\n\t// Replace all the Symbols with the Symbol HTML Links\n\tif(symbols != undefined && symbols['length'] > 0){\n\n\t\tsymbols.forEach(function(symbol){\n\n\t\t\ttweetText = tweetText.replace('$' + symbol['text'], '<a class=\"symbolLink\" target=\"_blank\" href=\"https://twitter.com/search?q=$' + symbol['text'] + '&src=tyah\">$' + symbol['text'] + '</a>');\n\t\t});\n\t}\n\n\ttweetHTML = '<p>' + tweetText + mediaString + '</p>';\n\treturn tweetHTML;\n}", "title": "" }, { "docid": "8e935febdc82729400ac5adf641361e4", "score": "0.550088", "text": "function shareLink() {\n\t$.shareDialog.show();\n}", "title": "" }, { "docid": "a3b71a044dc3acc81acc3321a0278796", "score": "0.5484825", "text": "function createTweet(tweet) {\n var div = document.createElement('div');\n div.className = 'widget-twitter-tweet';\n\n var tr = document.createElement('tr');\n var tdProfileImage = document.createElement('td');\n var imgProfileImage = document.createElement('img');\n imgProfileImage.src = tweet.profile_image_url;\n var pText = document.createElement('p');\n pText.innerHTML = processTweetLinks(tweet.text);\n\n var cite = document.createElement('cite');\n var aFromUser = document.createElement('a');\n cite.innerHTML = tweet.from_user_name + ' (<a href=\"http://twitter.com/' + tweet.from_user +'\">@' + tweet.from_user + '</a>)';\n\n div.appendChild(imgProfileImage);\n\n var tdFromUser = document.createElement('td');\n aFromUser.href = 'http://twitter.com/' + tweet.from_user;\n tdFromUser.appendChild(aFromUser);\n\n\n var tdCreatedAt = document.createElement('td');\n tdCreatedAt.innerHTML = tweet.created_at;\n\n tr.appendChild(tdProfileImage);\n tr.appendChild(tdFromUser);\n div.appendChild(pText);\n pText.appendChild(cite);\n tr.appendChild(tdCreatedAt);\n\n\n return div;\n\n\n \n // Source: http://stackoverflow.com/questions/8020739/regex-how-to-replace-twitter-links\n function processTweetLinks(text) {\n var exp = /(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/i;\n text = text.replace(exp, \"<a href='$1' target='_blank'>$1</a>\");\n exp = /(^|\\s)#([\\wæøåÆØÅ]+)/g;\n text = text.replace(exp, \"$1<a href='http://search.twitter.com/search?q=%23$2' target='_blank'>#$2</a>\");\n exp = /(^|\\s)@([\\wæøåÆØÅ]+)/g;\n text = text.replace(exp, \"$1<a href='http://www.twitter.com/$2' target='_blank'>@$2</a>\");\n return text;\n }\n }", "title": "" }, { "docid": "d0f502e1e45257998c76d9d50914d565", "score": "0.54696244", "text": "function about() {\n // Set about text based on current mode (ie. which tab is displayed)\n var msg;\n if (mode == \"locator\") {\n msg = \"<h2 class=\\\"about\\\">Tweet mapper</h2>\\\n <p class=\\\"about\\\">Click on the map to search for tweets near that location or use the searchbar to show a user's recent timeline.</p>\\\n <h3 class=\\\"about\\\">Help</h3>\\\n <p class=\\\"about\\\">Twitter stores 3 kinds of location data:\\\n <ol>\\\n <li><b>Coordinates</b> Individual tweets can be tagged with coordinates of where the tweet was sent.\\\n \tThis is the most accurate type of location data available, but requires that the user has set this feature on\\\n \tfrom his/her Twitter account.\\\n </li>\\\n <li><b>Place</b> Users can add a separate place attribute to their tweets to let others know that their tweet is either\\\n \tcoming from a specific place or is about a place.\\\n </li>\\\n <li><b>Location</b> Users can also set a fixed location on their Twitter page as their place of residence.\\\n \tThis is the least accurate type of location data as all tweets share the same value and it need not be a real place.\\\n \tAdditionally, ambiguous locations may get located to the wrong place.\\\n </li>\\\n </ol>\\\n </p>\\\n <p class=\\\"about\\\">Once tweets are displayed, click <img src=\\\"http://maps.google.com/mapfiles/marker.png\\\" alt=\\\"marker icon\\\" height=\\\"28\\\"> to\\\n show tweet details and <img src=\\\"./img/location-map-marker-icons_red.png\\\" alt=\\\"timeline icon\\\" height=\\\"28\\\"> to\\\n show timeline details on the lower bar. For compatible tweet languages <img src=\\\"./img/speaker.png\\\" alt=\\\"timeline icon\\\" height=\\\"28\\\">\\\n provides a text-to-speech option.</p>\\\n <img src=\\\"./img/tweet_example2.png\\\" alt=\\\"example result\\\" width=\\\"320\\\" style=\\\"margin-left: 20px\\\">\\\n <hr/>\\\n <div class=\\\"about\\\" style=\\\"width:300px;vertical-align:top;font-family: Arial;font-size:9pt;line-height: normal\\\">\\\n <a rel=\\\"license\\\" href=\\\"//responsivevoice.org/\\\"><img title=\\\"ResponsiveVoice Text To Speech\\\" src=\\\"https://responsivevoice.org/wp-content/uploads/2014/08/120x31.png\\\"\\\n style=\\\"float:left;padding-right:2px\\\" /></a><span xmlns:dct=\\\"http://purl.org/dc/terms/\\\" property=\\\"dct:title\\\">\\\n <a href=\\\"//responsivevoice.org/\\\" target=\\\"_blank\\\" title=\\\"ResponsiveVoice Text To Speech\\\">ResponsiveVoice</a></span>\\\n used under <a rel=\\\"license\\\" href=\\\"http://creativecommons.org/licenses/by-nc-nd/4.0/\\\"\\\n title=\\\"Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License\\\">Non-Commercial License</a></div>\\\n <div style=\\\"clear:both;\\\">&nbsp;</div>\";\n }\n else {\n msg = \"<h2 class=\\\"about\\\">Trend analyser</h2>\\\n <p class=\\\"about\\\">The map displays the countries for which Twitter has trending topic information available.</p>\\\n <h3 class=\\\"about\\\">Help</h3>\\\n <p class=\\\"about\\\">Click on a country to display a list of currently trending topics in that country.</p>\\\n <p class=\\\"about\\\">Click on a listed topic to see all countries where that topic is trending or enter a searchterm to the input field.</p>\\\n <p class=\\\"about\\\">Use the <i>Worldwide</i> button on the map to reset the map back to worldwide data.</p>\\\n <p class=\\\"about\\\">Trends are listed with icons for opening a Twitter search for that topic\\\n <img src=\\\"./img/Twitter_Logo_Blue.png\\\" alt=\\\"Twitter icon\\\" height=\\\"28\\\"> and for opening a search near the current location\\\n <img src=\\\"./img/map-marker.png\\\" alt=\\\"map marker\\\" height=\\\"28\\\"></p>\\\n <p class=\\\"about\\\">Tweet volume is listed for worldwide trend list</p>\";\n }\n\n setMessage(msg, true);\n clearDetails();\n // Remove and re-add the sidebar to restat the anmation\n var tweets = document.getElementById(\"tweets\");\n var newone = tweets.cloneNode(true);\n tweets.parentNode.replaceChild(newone, tweets);\n}", "title": "" }, { "docid": "dd868ddda7762382e556c9b8d8cbbba8", "score": "0.5469216", "text": "function openLinkDialog() {\n var inviteAttributes = void 0;\n\n if (roomUrl === null) {\n inviteAttributes = 'data-i18n=\"[value]roomUrlDefaultMsg\" value=\"' + APP.translation.translateString(\"roomUrlDefaultMsg\") + '\"';\n } else {\n inviteAttributes = \"value=\\\"\" + encodeURI(roomUrl) + \"\\\"\";\n }\n APP.UI.messageHandler.openTwoButtonDialog(\"dialog.shareLink\", null, null, '<input id=\"inviteLinkRef\" type=\"text\" ' + inviteAttributes + ' onclick=\"this.select();\" readonly>', false, \"dialog.Invite\", function (e, v) {\n if (v && roomUrl) {\n JitsiMeetJS.analytics.sendEvent('toolbar.invite.button');\n emitter.emit(_UIEvents2.default.USER_INVITED, roomUrl);\n } else {\n JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel');\n }\n }, function (event) {\n if (roomUrl) {\n document.getElementById('inviteLinkRef').select();\n } else {\n if (event && event.target) {\n $(event.target).find('button[value=true]').prop('disabled', true);\n }\n }\n }, function (e, v, m, f) {\n if (!v && !m && !f) JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');\n });\n}", "title": "" }, { "docid": "d7a603a580b561647945bd49f7912ff7", "score": "0.5452183", "text": "function displayQuote(quote) {\n\tconst authorText = document.querySelector('.author-text');\n\tconst quoteText = document.querySelector('.quote-text');\n\tquoteText.textContent = quote.quote;\n\tauthorText.textContent = quote.author;\n\n\tconst tweetButton = document.querySelector('.tweet');\n\ttweetButton.setAttribute('href', \"https://twitter.com/intent/tweet?text=\" + quote.quote + \" By \" + quote.author);\n\n\n}", "title": "" }, { "docid": "68af3f243541f12d0d515f5c9f10273a", "score": "0.5450436", "text": "function Command(UserText) {\n setOPL();\n let fridayToSpeak = \"\";\n\n // Open Instagram\n if (UserText.includes(UserText.includes(\"friday\") && UserText.includes(\"instagram\"))) {\n fridayToSpeak = \"Open instagram\";\n Speak(fridayToSpeak);\n window.open(\"https://www.instagram.com\");\n }\n\n // Search for google\n else if (UserText.includes(\"friday\") && UserText.includes(\"search google for \")) {\n var searchKeyword = UserText.split(\"search google for \")[1];\n var keyword = searchKeyword.replace(\" \", \"+\");\n fridayToSpeak = \"Searching for \" + searchKeyword;\n Speak(fridayToSpeak);\n window.open(\"https://www.google.com/search?q=\" + keyword + \"&sxsrf=ALeKk03sVEDsI9OOb0iUnBoaAHFebmCnWA%3A1622786896460&ei=UMO5YJa-G4aI4-EPgOyLuA8&oq=%22How+to+&gs_lcp=Cgdnd3Mtd2l6EAMYATIECCMQJzIECCMQJzIECCMQJzIFCAAQkQIyBQgAEJECMgUIABCRAjIFCAAQkQIyBQgAEJECMgcIABCHAhAUMgcIABCHAhAUOgcIIxDqAhAnOgQIABBDOgQILhBDOgUIABCxAzoHCAAQsQMQQzoCCABQoRJYpTtg8UZoA3ACeACAAbECiAH8CZIBBzAuOC4wLjGYAQCgAQGqAQdnd3Mtd2l6sAEKwAEB&sclient=gws-wiz\");\n }\n\n // search youtube\n else if (UserText.includes(\"friday\") && UserText.includes(\"search youtube\")) {\n var searchKeyword = UserText.split(\"youtube\")[1];\n fridayToSpeak = \"Searching for \" + searchKeyword;\n Speak(fridayToSpeak);\n window.open(\"https://www.youtube.com/results?search_query=\" + searchKeyword);\n }\n\n // friday help\n else if (UserText.includes(\"friday\") && UserText.includes(\"help\")) {\n fridayToSpeak = \"How may I help you?\" + searchKeyword;\n Speak(fridayToSpeak);\n }\n\n // open youtube\n else if (UserText.includes(\"friday\") && UserText.includes(\"youtube\")) {\n fridayToSpeak = \"Opening youtube\"\n Speak(fridayToSpeak);\n\n window.open(\"https://www.youtube.com\");\n }\n\n // open google meet\n else if (UserText.includes(\"friday\") && UserText.includes(\"google\") && UserText.includes(\"meet\")) {\n fridayToSpeak = \"Starting meet session\";\n Speak(fridayToSpeak);\n\n window.open(\"https://meet.google.com/vdn-ykrc-ztz\");\n }\n\n // open google classroom\n else if (UserText.includes(\"friday\") && UserText.includes(\"google\") && UserText.includes(\"classroom\")) {\n fridayToSpeak = \"Opening google\";\n Speak(fridayToSpeak);\n\n window.open(\"https://classroom.google.com/u/2/h\");\n }\n\n else if (UserText.includes(\"friday\") && UserText.includes(\"college\") && UserText.includes(\"google\") && UserText.includes(\"drive\")) {\n fridayToSpeak = \"Opening college google drive\";\n Speak(fridayToSpeak);\n\n window.open(\"https://drive.google.com/drive/u/2/my-drive\");\n }\n\n // open google \n else if (UserText.includes(\"friday\") && UserText.includes(\"google\")) {\n fridayToSpeak = \"Opening google\";\n Speak(fridayToSpeak);\n\n window.open(\"https://www.google.com\");\n }\n\n // open github\n else if (UserText.includes(\"friday\") && UserText.includes(\"github\")) {\n fridayToSpeak = \"Opening github\";\n Speak(fridayToSpeak);\n\n window.open(\"https://github.com/\");\n }\n\n // open pyadav5000 mail\n else if (UserText.includes(\"friday\") && UserText.includes(\"mail\") && UserText.includes(\"first one\")) {\n fridayToSpeak = \"Opening p yadav 5000 mail\";\n Speak(fridayToSpeak);\n\n window.open(\"https://mail.google.com/mail/u/0/?tab=wm#inbox\");\n setTimeout(Listening, 3000);\n }\n\n // open college mail\n else if (UserText.includes(\"friday\") && UserText.includes(\"mail\") && UserText.includes(\"college\")) {\n fridayToSpeak = \"Opening college mail\";\n Speak(fridayToSpeak);\n\n window.open(\"https://mail.google.com/mail/u/2/#inbox\");\n setTimeout(Listening, 3000);\n }\n\n // open figma file of friday \n else if (UserText.includes(\"friday\") && UserText.includes(\"your\") && UserText.includes(\"figma\")) {\n fridayToSpeak = \"Opening my figma file\";\n Speak(fridayToSpeak);\n window.open(\"https://www.figma.com/file/T8KvvogfSiNRfaTWh6wQuM/FRIDAY?node-id=1%3A2\");\n setTimeout(Listening, 3000);\n }\n\n // hello to friday\n else if (UserText.includes(\"friday\") && UserText.includes(\"hello\")) {\n fridayToSpeak = \"Hello, sir!\";\n Speak(fridayToSpeak);\n setTimeout(Listening, 3000);\n }\n\n // sleep friday\n else if (UserText.includes(\"friday\") && UserText.includes(\"quit\") || UserText.includes(\"bye\") || UserText.includes(\"quit\") || UserText.includes(\"sleep\")) {\n fridayToSpeak = \"Ok sir\";\n Speak(fridayToSpeak);\n\n programRun = false\n }\n // say friday\n else if (UserText.includes(\"friday\")) {\n fridayToSpeak = \"Yes sir, how may I help you?\";\n Speak(fridayToSpeak);\n setTimeout(Listening, 3500);\n }\n // else didn't get that\n else {\n fridayToSpeak = \"Sorry, I didn't get that\";\n Speak(fridayToSpeak);\n\n setTimeout(Listening, 3000);\n }\n setOPH();\n}", "title": "" }, { "docid": "58075dd7ebb559445783887009952ca9", "score": "0.54401934", "text": "function twitterSignIn(e){\n\te.preventDefault();\n\t$.oauthpopup({\n\t\tpath: 'assets/twitter/twitterConnect.php',\n\t\tcallback: function(){\n\t\t\t$.ajax({\n\t\t\t\turl: 'assets/twitter/responseConnect.php', \n\t\t\t\tsuccess: function(response) { \n\t\t\t\t\t$('#landing-page #unlock-badges .sign-in').addClass('hidden');\n\t\t\t\t\t$('#landing-page #unlock-badges .signed-in').removeClass('hidden');\n\t\t\t\t\t$(\"#landing-page #unlock-badges .signed-in h2 span\").html('Welcome!');\n\t\t\t\t\t$(\"#landing-page #unlock-badges .signed-in .sign-in-twitter\").hide();\n\t\t\t\t\tbadges.claim('acolyte');\n\n\t\t\t\t\t$('#user img').attr('src', response.profile_image_url);\n\t\t\t\t\t$('#user .name').html(response.name);\n\t\t\t\t\t$('#user .screen_name a').attr('href', 'http://twitter.com/'+response.screen_name);\n\t\t\t\t\t$('#user .screen_name a').html('@'+response.screen_name);\n\t\t\t\t\tshowTweetBox();\n\t \t }\n\t \t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "93001020fba35902d9037365662a7dae", "score": "0.54347116", "text": "function openDialog() {\n\t\tFB.ui({\n\t\t\tmethod: 'feed',\n\t\t\tname: details.title,\n\t\t\tlink: details.url,\n\t\t\tpicture: details.image,\n\t\t\tcaption: details.caption,\n\t\t\tdescription: details.description\n\t\t});\n\t}", "title": "" }, { "docid": "d3a6ddf818c73ceef0e656d7b2fd31e3", "score": "0.54310334", "text": "function handOffToDialog(userIntentText) {\r\n\r\n var dialogInput = userIntentText;\r\n if (isDialogRequiredIntent()) {\r\n // Use the invite type to redirect the Dialog flow to the current intent.\r\n dialogInput = intentType + \" \" + userIntentText;\r\n }\r\n\r\n var path = '/proxy/api/v1/dialogs/' + conversation.dialog_id + '/conversation?proxyType=dialog';\r\n var params = {\r\n input: dialogInput,\r\n conversation_id: conversation.conversation_id,\r\n client_id: conversation.client_id\r\n };\r\n\r\n $.post(path, params).done(function(data) {\r\n var replyText = data.response.join('<br/>');\r\n\r\n // Determine if current dialog completed\r\n var index = replyText.indexOf(\"DIALOG_COMPLETED\");\r\n var dialogCompleted = index >= 0;\r\n if (dialogCompleted) {\r\n replyText = replyText.substring(0,index-5); // also remove the \"<br/>\"\r\n }\r\n displayWatsonChat(replyText);\r\n getProfile();\r\n saveConversation(userIntentText,intentType,replyText);\r\n\r\n if (dialogCompleted) {\r\n initConversation(false);\r\n }\r\n scrollToBottom();\r\n }).fail(function(response){\r\n displayWatsonChat(\"I'm unable to process your request at the moment.\");\r\n scrollToBottom();\r\n });\r\n}", "title": "" }, { "docid": "e86117ad479909b9cd1b402fe08255e3", "score": "0.5421694", "text": "function displayTweets() {\n var params = {\n screen_name: 'TorieBootcamp',\n count: 20\n };\n\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n\n for (var i = 0; i < tweets.length; i++) {\n console.log(' Tweet: ' + tweets[i].text)\n }\n });\n}", "title": "" }, { "docid": "c164bb99eb20530c56e44d1b75656fbd", "score": "0.5417924", "text": "followLink(editor) {\n monaco.languages.setLanguageConfiguration('plaintext', {\n // Allow http:// to be part of a word.\n wordPattern: /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\#\\%\\^\\&\\*\\(\\)\\=\\+\\{\\}\\\\\\|\\;\\'\\\"\\,\\<\\>\\?\\s]+)/g,\n });\n var linkCondition = editor.createContextKey('linkCondition', false);\n editor.addAction({\n // An unique identifier of the contributed action.\n id: 'link-context-id',\n // A label of the action that will be presented to the user.\n label: 'Follow the link',\n // A precondition for this action.\n precondition: 'linkCondition',\n // A rule to evaluate on top of the precondition in order to dispatch the keybindings.\n keybindingContext: null,\n contextMenuGroupId: 'navigation',\n contextMenuOrder: 1.5,\n // Method that will be executed when the action is triggered.\n // @param editor The editor instance is passed in as a convinience\n run: function (ed) {\n window.open(editor.getModel().getWordAtPosition(ed.getPosition()).word, '_blank');\n return null;\n }\n });\n const contextmenu = editor.getContribution('editor.contrib.contextmenu');\n const realMethod = contextmenu._onContextMenu;\n contextmenu._onContextMenu = function (e) {\n // console.log(e.target.element.className);\n var a = e.target.element.className;\n if (a.includes('detected-link')) {\n linkCondition.set(true);\n }\n else {\n linkCondition.set(false);\n }\n realMethod.apply(contextmenu, arguments);\n };\n }", "title": "" }, { "docid": "72d90a91531d59d7948157d9f6f47a38", "score": "0.5413302", "text": "function specificTweetfunct(tweetid){\n if(tweetid!=null){\n \toutputText.innerHTML=\" \";\n\t\tvar xmlHttp = new XMLHttpRequest();\n\t\txmlHttp.onreadystatechange = function(){\n\t\tif(xmlHttp.readyState == 4 && xmlHttp.status == 200){\n\t\t\toutputText.innerHTML=xmlHttp.responseText;\n\t\t\t}\n\t\t}\n \txmlHttp.open(\"GET\", \"http://127.0.0.1:3000/tweet/\"+tweetid, true); // false for synchronous request\n \txmlHttp.send(null);\n }else{\n \toutputText.innerHTML=(\"Sorry you did not enter a tweet id\");\n }\n}", "title": "" }, { "docid": "c124266bb105f0f26a86c9ae582ae731", "score": "0.53985107", "text": "function addTweetToPreview(tweet){\n var tweet_time = Date.parse(tweet.created_at)\n var isotime = ISOTime(tweet_time)\n var humantime = elapsedTime(tweet_time)\n var in_reply_to = (tweet.in_reply_to_status_id != null && tweet.in_reply_to_screen_name != null) ? \n ' <a href=\"http://twitter.com/'+tweet.in_reply_to_screen_name+'/status/'+tweet.in_reply_to_status_id+'\">in reply to '+tweet.in_reply_to_screen_name+'</a>' : ''\n var newTweet = new Element('li',{\n 'id' : 'status_'+tweet.id,\n 'class' : 'hentry status u-'+tweet.user.screen_name,\n 'style' : 'left:-100%',\n '_time' : tweet_time})\n var html = ''\n html += ' <div class=\"thumb vcard author\">'\n html += ' <a class=\"url\" href=\"http://twitter.com/'+tweet.user.screen_name+'\">'\n html += ' <img width=\"48\" height=\"48\" src=\"'+tweet.user.profile_image_url+'\" class=\"photo fn\" alt=\"'+tweet.user.name+'\"/>'\n html += ' </a>'\n html += ' </div>'\n html += ' <div class=\"status-body\">'\n html += ' <a class=\"author\" title=\"'+tweet.user.name+'\" href=\"http://twitter.com/'+tweet.user.screen_name+'\">'+tweet.user.screen_name+'</a>'\n html += ' <span class=\"entry-content\">'\n html += ' '+twitter_at_linkify(linkify(tweet.text))\n html += ' </span>'\n html += ' <span class=\"meta entry-meta\">'\n html += ' <a rel=\"bookmark\" class=\"entry-date\" href=\"http://twitter.com/'+tweet.user.screen_name+'/status/'+tweet.id+'\">'\n html += ' <span title=\"'+isotime+'\" class=\"published\">'+humantime+'</span></a> <span>from '+tweet.source+'</span>'+in_reply_to\n html += ' </span>'\n html += ' </div>'\n html += ' <div class=\"actions\">'\n html += ' <a class=\"del\" href=\"#\" id=\"del_'+tweet.id+'\" onclick=\"return removeTweet(this);\">x</a>'\n html += ' </div>'\n newTweet.set('html', html)\n //existing tweets in the quote preview\n var quote_tweets = $$('li')\n if(quote_tweets.length == 1){\n quote_tweets[0].style.display = 'none'\n var container = $('quote')\n newTweet.inject(container)\n } else {\n for(var i=0; i< quote_tweets.length; i++){\n if (tweetComesBefore(newTweet, quote_tweets[i])){\n newTweet.inject(quote_tweets[i],'before')\n quote_tweets[i].style.top = '-'+newTweet.offsetHeight+'px'\n quote_tweets[i].set('tween', {duration: 'short'})\n quote_tweets[i].tween('top', '0px')\n break\n }\n //last position\n if (i == quote_tweets.length-1){\n newTweet.inject(quote_tweets[i],'after')\n }\n }\n }\n updateForm()\n newTweet.set('tween', {duration: 'long'});\n newTweet.tween('left', '0%');\n}", "title": "" }, { "docid": "c0516d83b8dcf9d8a02d43c26b12c0d6", "score": "0.5396605", "text": "function goToPage() {\n let shareLink = document.getElementById(\"shareURL\").textContent;\n window.location.href = shareLink;\n}", "title": "" }, { "docid": "0b0a51fedfed6f25472e1989dc6a7379", "score": "0.53940296", "text": "checkLinkType() {\n if (this.CURRENT_TAB == 'twitter.com') return 'unknown';\n else if (this.redirectLink.includes('/status/')) return 'tweet';\n }", "title": "" }, { "docid": "48a59a34f004063c1910004bacffe6d2", "score": "0.53920674", "text": "function get_text(tweet) {\n let txt = tweet.retweeted_status ? tweet.retweeted_status.full_text : tweet.full_text;\n return txt.split(/ |\\n/).filter(v => !v.startsWith('http')).join(' ');\n}", "title": "" }, { "docid": "dc1b1e19b8b15e97ca7c8a88d51688c2", "score": "0.53828883", "text": "function tweet(text) {\n client.post(\"statuses/update\", {status: text}, function (error, tweet, response) {\n if (!error) {\n console.log(tweet);\n } else {\n throw error[0].message;\n }\n });\n}", "title": "" }, { "docid": "54246d10f1cfd4a144c9ae3c417d6b6e", "score": "0.5382557", "text": "function stringToClickToTweetURL(str, user) {\n\n // Format user incase it doesn't start with an @\n var formattedUser = \"\";\n // console.log(user[0])\n if (user[0] !== \"@\") {\n formattedUser = \"@\" + user;\n } else {\n formattedUser = user;\n }\n\n\n // Add user @name to the string so they are notified\n var stringToConvert = str + \" \" + formattedUser;\n\n // Convert to Click to Tweet URL\n stringToConvert = stringToConvert.split(\" \").join(\"%20\").split(\"@\").join(\"%40\").split(\"!\").join(\"%21\");\n\n // Put 'Click to Tweet' URL suffix at the begining\n var resultString = \"https://twitter.com/intent/tweet?text=\" + stringToConvert;\n\n // Return properly formatted \"Click to Tweet URL\"\n return resultString;\n}", "title": "" }, { "docid": "de9bd46936c72c13e2a7f4c54581160f", "score": "0.5369889", "text": "function tweetIt(txt) {\n\t//status = text to be tweeted\n\tvar tweet = {\n\t\tstatus: txt\n\t}\n\n\t//Post on Twitter\n\tT.post('statuses/update', tweet, tweeted);\n\n\t//Return wether the program completed task\n\tfunction tweeted(err, data, response) {\n\t if (err) {\n\t \tconsole.log(\"Tweet was unsuccessful\");\n\t } else {\n\t console.log(\"Tweet was successful\");\n\t }\n\t}\n}", "title": "" }, { "docid": "73b9764901ddaba6be4ee51566932852", "score": "0.5362408", "text": "function handleChangeOfTwitterLink(e) {\n setTWITTER_LINK(e.target.value)\n\n }", "title": "" }, { "docid": "49fefeff63a1e94bd89b7c06e7ea0450", "score": "0.5361686", "text": "function tweetMessage(txt)\r\n{\r\n\tvar tweet = {\r\n\t\tstatus: txt\r\n\t}\r\n\tconsole.log(\"Response:\")\r\n\tconsole.log(tweet)\r\n\tconsole.log(\" \")\r\n\r\n\t//T.post is using the post from the twit library SYNTAX>>> T.Post(<type>, <variable>, <function to exec>)\r\n\tT.post('statuses/update', tweet, tweeted);\r\n\t// tweeted();\r\n\r\n\tfunction tweeted(err, data, response) {\r\n\t\tif(err){\r\n\t\t\tconsole.log(\"Something went wrong!\")\r\n\t\t}\r\n\t\telse{\r\n\t\t\tconsole.log(\"Tweet Posted!\")\r\n\t\t}\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "08cc296af9ab041bae386d2453ef2a0d", "score": "0.53581756", "text": "function twitter() {\n\tlogAndDisplay('so far so good');\n\tvar params = {screen_name: 'waltdakind'};\nclient.get('statuses/user_timeline', params, function(error, tweets, response){\n if (!error) {\n for(var i=0; i<tweets.length; i++){\n \tlogAndDisplay('-------------------------');\nlogAndDisplay(tweets[i].created_at);\nlogAndDisplay('');\nlogAndDisplay(tweets[i].text);\n \tlogAndDisplay('-------------------------');\n \t \tlogAndDisplay('');\n }\n }\n});\n}", "title": "" }, { "docid": "702eb737c3fd1d97d0f18b91b39b3636", "score": "0.53546417", "text": "function twitterify(tweet) {\n var text = tweet.text;\n if (!text) { return \"\"; }\n text += \" \";\n // convert normal links\n text = text.replace(/http:(.*?)\\s/g,\"<a href=\\\"http:$1\\\">http:$1</a> \");\n\n // convert hash marks\n text = text.replace(/#(.*?)(\\s)/g, \"<a href=\\\"http://twitter.com/search?q=%23$1\\\">#$1</a>$2\");\n\n // convert users\n text = text.replace(/@(.*?)([:\\s])/g, \"<a href=\\\"http://twitter.com/$1\\\">@$1</a>$2\");\n\n return text.replace(/\\s*$/,'');\n}", "title": "" }, { "docid": "a4a28db54140283eaade6747b7153d9e", "score": "0.5346089", "text": "function twitter (){\n var tweetTimeLine = { screen_name: 'Confess_booth', count: 13};\n client.get('statuses/user_timeline', tweetTimeLine, function(error, tweets, response) {\n if(!error){\n console.log(\"==============================================\");\n console.log(\"Some Phyllis Dyller Quotes:\");\n tweets.forEach(function(tweets) {\n console.log(\"_____________________________________________\");\n console.log(tweets.text);\n });\n }\n });\n}", "title": "" }, { "docid": "18bc495d265396fc9428b3f328cf71bf", "score": "0.53333956", "text": "function twitter() {\n return \"Here ya go: www.twitter.com/matchyman1\"\n}", "title": "" }, { "docid": "da77876c40d2c07c1de1c363f04aa920", "score": "0.5330503", "text": "function teh_help(url) {\n\twindow.open(url, \"_blank\");\n\treturn false;\n}", "title": "" }, { "docid": "90093b3c790a566043a21dc3087e9051", "score": "0.53291863", "text": "function tumbl(){\n let text = encodeURIComponent(document.getElementById(\"q\").textContent);\n let sayer = encodeURIComponent(document.getElementById(\"attr\").textContent.replace(/—+/g, ''));\n let a = document.getElementById('tumbl');\n a.href = \"https://www.tumblr.com/widgets/share/tool?posttype=quote&content=\" + text + \"&title=\" + sayer + \"&canonicalUrl=https%3A%2F%2Fs.codepen.io%2Frekerc4%2Fdebug%2FZrZOxz%2FNQMzYnXNpBdk&shareSource=tumblr_share_button\";\n }", "title": "" }, { "docid": "d513f575542d4084f96529932b88a310", "score": "0.53273666", "text": "function tweet(){\n\t//What screen name do you want it to search through\n\tvar params = {screen_name: 'valuablequottes'};\n\tkeyList.get('statuses/user_timeline', params, function(error, tweets, response) {\n\t \tif (!error) {\n\t \t//for loop to run through and print only the tweet and time created at\n\t \t\tfor (var i = 0; i < tweets.length; i++) {\n\t \t\t\tconsole.log(tweets[i].created_at + \": \" + tweets[i].text);\n\t \t\t}\n\t \t} \n\t});\n}", "title": "" }, { "docid": "e6904f83cdbee6342ffb4479e5012a99", "score": "0.53265166", "text": "function whatsapp() {\n Linking.openURL(`whatsapp://send?text=Hola%2C%20te%20escribo%20por%20tu%20post%20en%20AdoptaPY%20sobre%20la%20adopción%20de%20${item.petData.petName}.&phone=595${item.petContact.number}`)\n }", "title": "" }, { "docid": "f6a84d691d706f5f8526206b766a7a10", "score": "0.5325022", "text": "function dialog() {\n\n\t// calling the dialog.\n\tvar video_dialog = new Dialog();\n\n\t// Modify the dialog.\n\n\tvideo_dialog.setTitle(language_handler.getText(null, 'dialog_video_title'));\n\tvideo_dialog.setSize(550, 366);\n\n\t$('a.youtube').not('.mobile').click(function(event) {\n\n\t\t// prevent link from working.\n\t\tevent.preventDefault();\n\n\t\t// set content from URL and show it.\n\t\tvideo_dialog.setContentFromURL($(this).attr('href'));\n\t\tvideo_dialog.showWhenReady();\n\t\tvideo_dialog.setClearOnClose(true);\n\t});\n}", "title": "" }, { "docid": "fc194eb0ae77fbf62c981ccd21924689", "score": "0.5313991", "text": "async function addMessage(message) {\n await page.waitForSelector('div.twitbox form');\n\n const form = await page.$('div.twitbox form');\n const messageField = await form.$('input[name=\"text\"]');\n\n await messageField.type(message);\n\n await form.$eval('input[value=\"Share\"]', async (el) => await el.click());\n}", "title": "" }, { "docid": "266d7bd0b73e41fb6ea6850a4630a052", "score": "0.53120387", "text": "function toggleNewTweet() {\n $('.new-tweet').slideToggle();\n $('.new-tweet textarea').focus();\n document.body.scrollTop = 0; // scrolls the window to the top\n}", "title": "" }, { "docid": "ee2d153424871cdd761b4280b40ebfaa", "score": "0.53112215", "text": "function getOpenLinkCmd(nluResult, inputText){\n\t\tvar iconUrl = \"\";\n\t\tvar title = \"Link\";\n\t\tvar desc = \"Click to open\";\n\t\tvar url = \"https://sepia-framework.github.io/app/search.html\";\n\t\tvar answer = \"Ok\";\n\t\tif (inputText){\n\t\t\tinputText = inputText.replace(/.*\\b(for|nach|search|find|such(e|)|finde|link)\\b/i, \"\").trim();\n\t\t}\n\t\tif (inputText && (inputText.indexOf('http:') == 0 || inputText.indexOf('https:') == 0)){\n\t\t\turl = inputText;\n\t\t\ttitle = \"Link\";\n\t\t\tdesc = \"<i>\" + inputText + \"</i>\";\n\t\t}else if (inputText){\n\t\t\tvar prefSE = SepiaFW.config.getPreferredSearchEngine();\n\t\t\turl = \"search.html?default=\"+ encodeURIComponent(prefSE) + \"&direct=1&q=\" + encodeURIComponent(inputText);\n\t\t\ttitle = \"Web Search\";\n\t\t\tdesc = \"<i>\" + inputText + \"</i>\";\n\t\t}else{\n\t\t\ticonUrl = \"https://sepia-framework.github.io/img/icon.png\";\n\t\t\ttitle = \"S.E.P.I.A.\";\n\t\t\tdesc = \"Your personal, private, open-source assistant\";\n\t\t\turl = \"https://sepia-framework.github.io\";\n\t\t\tif (nluResult.language == \"de\"){\n\t\t\t\tanswer = \"Kennst du eigentlich meine Homepage?\";\n\t\t\t}else if (nluResult.language == \"en\"){\n\t\t\t\tanswer = \"Have you seen my homepage?\";\n\t\t\t}\t\n\t\t}\n\t\tnluResult.result = \"success\";\n\t\tnluResult.context = \"open_link\";\n\t\tnluResult.parameters = {\n\t\t\t\"icon_url\": iconUrl,\n\t\t\t\"answer_set\": answer,\n\t\t\t\"description\": desc,\n\t\t\t\"title\": title,\n\t\t\t\"url\": url\n\t\t};\n\t\tnluResult.command = \"open_link\";\n\t\treturn nluResult;\n\t}", "title": "" }, { "docid": "81b6457d9f61284d864b61db99e7e8fa", "score": "0.53096753", "text": "function showYouWon(){\n const text = \"Awesome job, you got it!\"\n dialog = getDialog(\"won\", text);\n document.getElementById(\"result\").innerHTML = dialog;\n}", "title": "" }, { "docid": "3228321cfe504e792fe19dcd0f7969c0", "score": "0.53072953", "text": "function SendTweet(tweetText) {\n // twitter API Access \n var signsAndTokens= {\n TWITTER_CONSUMER_KEY: \"TWITTER_CONSUMER_KEY\",\n TWITTER_CONSUMER_SECRET: \"TWITTER_CONSUMER_SECRET\",\n TWITTER_ACCESS_TOKEN: \"TWITTER_ACCESS_TOKEN\",\n TWITTER_ACCESS_SECRET: \"TWITTER_ACCESS_SECRET\" \n };\n \n // Gets the user access for this script\n var props = PropertiesService.getUserProperties();\n \n // sets the properties for the api tokens\n props.setProperties(signsAndTokens);\n \n //attemps to access the twitter api using api keys\n var twit = new Twitter.OAuth(props);\n \n //if the api connects send the tweet text\n if ( twit.hasAccess() ) { \n var status = tweetText;\n var response = twit.sendTweet(status, { }); \n } \n}", "title": "" }, { "docid": "c7c119a7e8a5a9e2910e1a058b41d22f", "score": "0.5306939", "text": "function confirmAddTwitterTimeline(){\n //Check if username is empty or not?\n if ( $('#twitter-username').val().trim() === \"\"){\n $('#twitter-error').text(msg(\"simplepage.twitter-name-notblank\"));\n $('#twitter-error-container').show();\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "884d86146bc6efb2fac1a8321b0f8f7b", "score": "0.53063697", "text": "function showLink() {\n\tvar queryParts = [];\n\tfunction inputToLink() {\n\t\tif ( this.id && this.id !== \"permalink\" ) {\n\t\t\tqueryParts.push(\n\t\t\t\t\tencodeURIComponent( this.id ) + \"=\"\n\t\t\t\t\t+ encodeURIComponent( this.value ) );\n\t\t}\n\t}\n\t$( \"textarea\" ).each( inputToLink );\n\tvar url = location.href.replace( /[#?][\\s\\S]*$/, \"\" )\n\t\t\t+ \"?\" + queryParts.join( \"&\" );\n\tvar permalink = $( \"#permalink\" );\n\tpermalink.text( url );\n\tpermalink.fadeIn( 500, null, function () { this.focus(); this.select(); } );\n}", "title": "" }, { "docid": "9ac000b6154b2f23295831740e505f47", "score": "0.5302686", "text": "function BotTweet() {\n\n\tunirest.get(\"https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies&count=1\")\n\t\t.header(\"X-Mashape-Key\", \"UbSVbpHdq4mshb5iK5E3qsCfYrW5p1VYTgbjsnl17XRvrDG390\")\n\t\t.header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\t\t.header(\"Accept\", \"application/json\")\n\t\t.end(function (result) {\n\t\t\tBot.post('statuses/update', { status: result.body.quote +' #movies #quotes' + \"\\n\\n[\" + result.body.author + ']'}, function(err, data, response) {\n\t\t\t\tconsole.log('Tweeted a fucking quote!');\n\t\t\t})\n\t\t});\n\n\t\tfavoriteTweet();\n}", "title": "" }, { "docid": "f513da984cbbaa4509384710aab062a3", "score": "0.5299092", "text": "function getTweet(api, target, tweetId) {\n\t\t_twitter.showStatus(tweetId, function(tweet) {\n\n\t\t\tif ( validateTweet(tweet, api.jerk, target) ) {\n\t\t\t\tprintTweet( api, tweet, target );\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "58096324fa32b4c92024212f9096f248", "score": "0.52947474", "text": "function respondToTweet(tweetData){\n\t\n\t//only make the lamp active if it is dormant\n\tif(!lamp.isActive &&\n\t\tbehavior.active.enabled){\n\t\ttwitterHand.log(tweetData);\n\n\t\tif(!lamp.previewing){\n\t\t\t//logic for flashing lights goes here...\n\t\t\tlamp.setActive();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0ace58046ecba806b0d40b25a6b58581", "score": "0.5287894", "text": "function sendTweet(txt) {\n var tweet = {status: txt }\n T.post('statuses/update', tweet, tweetSent);\n\n function tweetSent(err, data, response) {\n if (err) {\n console.log(\"Didn't work :(\");\n } else {\n console.log(\"All seems good!\");\n }\n }\n\n}", "title": "" }, { "docid": "8698f8862d74dd39dadebe65d2722b3a", "score": "0.52875906", "text": "function twittercall(){\n client.get('statuses/user_timeline', { screen_name: 'elonmusk' }, function (error, tweets, response) {\n if (error) { console.log(error) }\n else {\n for (var i = 0; i < t; i++) {\n console.log(tweets[i].text);\n console.log(\"------------------------\")\n }\n // promptcaller()\n }\n });;\n}", "title": "" } ]
96a28cdfdfaf7a92270f1360b5f321c5
Convert input to process stdout implementation
[ { "docid": "1525c65cc6b401314088e3fb90fccb83", "score": "0.0", "text": "function _initConverter(){\n var csvConverter = new Converter_1();\n var started = false;\n var writeStream = process.stdout;\n csvConverter.on(\"record_parsed\",function(rowJSON){\n if (started){\n writeStream.write(\",\\n\");\n }\n writeStream.write(JSON.stringify(rowJSON)); //write parsed JSON object one by one.\n if (started === false){\n started = true;\n }\n });\n writeStream.write(\"[\\n\"); //write array symbol\n\n csvConverter.on(\"end_parsed\",function(){\n writeStream.write(\"\\n]\"); //end array symbol\n });\n csvConverter.on(\"error\",function(err){\n console.error(err);\n process.exit(-1);\n });\n return csvConverter;\n }", "title": "" } ]
[ { "docid": "a81d152cf86f0d78ab7fcd37b8441ab4", "score": "0.5832351", "text": "function convertInput() {\n var cov = JSON.parse(chunks.join(\"\"));\n process.stdout.write(fn({\n cov: cov,\n coverageClass: coverageClass\n }));\n}", "title": "" }, { "docid": "f5b4bbe95e4cebd63f284543beec73a4", "score": "0.57790184", "text": "proxyTo(destinationProcess) {\n // isTTY tells us whether the script is being piped\n if (!process.stdin.isTTY) {\n process.stdin.resume();\n\n process.stdin.on('data', function(data) {\n destinationProcess.stdin.write(data);\n });\n\n process.stdin.on('end', function(code) {\n destinationProcess.stdin.end();\n });\n }\n\n destinationProcess.stdout.on('data', function(data) {\n process.stdout.write(data);\n });\n\n destinationProcess.stderr.on('data', function(data) {\n process.stdout.write(data);\n });\n }", "title": "" }, { "docid": "105a0ab820eda62e63dc1b05a7ceda9d", "score": "0.57464063", "text": "function output() {}", "title": "" }, { "docid": "c31b30b170becf3af0aefff04a370812", "score": "0.5651309", "text": "function handlePipedContent() {\n let data = '';\n\n stdin.on('readable', () => {\n const chunk = stdin.read();\n if (chunk !== null) {\n data += chunk;\n }\n });\n stdin.on('end', () => console.log(groupText(data)));\n}", "title": "" }, { "docid": "2fecf35ededdd49bf7e3db879b90d5b9", "score": "0.5621746", "text": "async preview () {\n let output = await this.process()\n return output\n }", "title": "" }, { "docid": "9f20b8f7745bc26bcf7ede9131dd9d05", "score": "0.5606416", "text": "function _output(data, cmd, callback) {\n if(typeof data === 'object') {\n var output = JSON.stringify(data, null, cmd.indent);\n process.stdout.write(output);\n } else if(typeof data === 'string') {\n process.stdout.write(data.trim());\n } else {\n process.stdout.write(data);\n }\n if(cmd.newline) {\n process.stdout.write('\\n');\n }\n callback();\n}", "title": "" }, { "docid": "35144974fc63f6809a2d5317fc2fd1bd", "score": "0.551304", "text": "function handleStdout(go, data) {\n\n\t// append data to the buffer for every stdout\n bufferData += data.toString();\n\n // if reached the end of the message in the stdout parse it\n\t// and reset the buffer for the next stdout\n if (bufferData.endsWith(\"\\n\")) {\n // Response may be several command responses separated by new lines\n bufferData.toString().split(\"\\n\").forEach(function(resp) {\n // Discard empty lines\n if(resp.length > 0) {\n // Parse each command response with a event-loop in between to avoid blocking\n process.nextTick(function(){parseResponse(go, resp)});\n }\n });\n bufferData = \"\";\n }\n}", "title": "" }, { "docid": "fdca56fcff6bd7e0cf91c1300d65e18a", "score": "0.5461719", "text": "function done(output){\n\t\tprocess.stdout.write(output);\n\t\tprocess.stdout.write('\\nprompt > ');\n\t}", "title": "" }, { "docid": "71ba9b55d3cf3fd8e1c0e2468923981a", "score": "0.5437061", "text": "function output(string) {\n process.stdout.write(string);\n}", "title": "" }, { "docid": "3d316bfba8a5af5d75ca12ba9a42971f", "score": "0.5396838", "text": "function pipe() {\n if (arguments.length == 0)\n return 'Illegal Arugments: zero legnth'\n\n var output = runAsFirstCommand(arguments[0])\n\n for (i = 1; i < arguments.length; i++) {\n output = runAsIntermediateProcess(arguments[i], output)\n }\n\n return inputStreamToString(output)\n}", "title": "" }, { "docid": "19e8101453d3676e6bfcefd9800ba016", "score": "0.52948725", "text": "function processDriver(proc) {\n\t\t\tproc.stdout.setEncoding('utf-8');\n\t\t\tproc.stdout.on('data', function (data) {\n\t\t\t\tvar res = data.toString()\t\n\t\t\t\t//echoIO(res)\n\t\t\t\t//console.log( \" . STDOUT \" + res )\t\t\t\n\t\t\t\ttry {\t\t\t\t\n\t\t\t\t\tsendProcState(JSON.parse(res))\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\techoIO(\" * malformed process state\")\n\t\t\t\t}\n\t\t\t})\n\t\t\tproc.stderr.on('data', function (data) {\n\t\t\t\tconsole.log( \" . ERR \" + data)\n\t\t\t\tvar res = data.toString()\n\t\t\t\techoIO(res)\n\t\t\t})\n\n\t\t\tproc.on('exit', function (code) {\n\t\t\t\tconsole.log( \" . EXIT \" + code)\n\t\t\t\tstateOff()\n\t\t\t\techoIO(\"exit \" + code)\n\t\t\t\tsendProcState(JSON.parse('{\"status\":\"not_running\"}'))\n\t\t\t})\n\t\t}// END DRIVER", "title": "" }, { "docid": "09e765346c45b0b2fd4e265666837dfc", "score": "0.52889615", "text": "function processFile(incomingStream){\n\t\n\t/*\n\t\tv1, dump stdout to outStream directly\n\t*/\n\tlet outStream = incomingStream\n\n\t//output\n\tconst targetStream = process.stdout;\n\n\t//piping the targetStream TO the outStream?!\n\toutStream.pipe(targetStream)\n}", "title": "" }, { "docid": "25d832dadfcc572799a6c2b5610c0143", "score": "0.52645195", "text": "function Output(options) {\n options = options || {};\n this.command = options.command || '';\n this.args = options.args || {};\n this.typed = options.typed || '';\n this.canonical = options.canonical || '';\n this.hidden = options.hidden === true ? true : false;\n\n this.data = undefined;\n this.completed = false;\n this.error = false;\n this.start = new Date();\n\n this.onClose = util.createEvent('Output.onClose');\n this.onChange = util.createEvent('Output.onChange');\n}", "title": "" }, { "docid": "81f5725be2b14dc02abee5f7bd39f012", "score": "0.5254096", "text": "function pipesToString(stdout, stderr) {\n return __awaiter(this, void 0, void 0, function* () {\n let str = '';\n const promises = [];\n for (const stream of [stdout, stderr]) {\n if (!stream) {\n continue;\n }\n stream.setEncoding('utf8');\n stream.on('data', function (chunk) {\n str += chunk;\n });\n promises.push(new Promise((resolve) => {\n stream.on('end', resolve);\n }));\n }\n yield Promise.all(promises);\n return str;\n });\n}", "title": "" }, { "docid": "1e5d5013ea05d4b6441109f9c5da4eee", "score": "0.5239803", "text": "function handleOutput(text) {\n try {\n let m = new MarkovMachine(text);\n console.log(m.makeText());\n } catch (err) {\n console.log(err);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "f6719e4e458c477073f4aae91dd77e86", "score": "0.52346075", "text": "function processData(inputString) {\n // This line of code prints the first line of output\n // let inputString = \" \"\n console.log(\"Hello, World.\");\n \n // Write the second line of output that prints the contents of 'inputString' here.\n console.log(inputString);\n \n}", "title": "" }, { "docid": "87c1cabae5ad10b5acdc412ff15efd6c", "score": "0.5206494", "text": "get output() { return this.out('out'); }", "title": "" }, { "docid": "64d8c2922e785ef314c15f830edb3800", "score": "0.5187723", "text": "function sc_withOutputToString(thunk) {\n var p = new sc_StringOutputPort();\n sc_withOutputToPort(p, thunk);\n return p.close();\n}", "title": "" }, { "docid": "64d8c2922e785ef314c15f830edb3800", "score": "0.5187723", "text": "function sc_withOutputToString(thunk) {\n var p = new sc_StringOutputPort();\n sc_withOutputToPort(p, thunk);\n return p.close();\n}", "title": "" }, { "docid": "ff5f51ab58b8cec95892cae65aabbef0", "score": "0.5170971", "text": "commandOutput(arg) {\n return this.request(`${this.prefix}command_output`, [arg]);\n }", "title": "" }, { "docid": "0d0aa9435706ed6f511b7565e9dea72a", "score": "0.5166132", "text": "function processio(inpipe, re, transfline, outpipe) {\nconsumeStream(inpipe,\n /*acceptor*/ (_buffstr) => {\n //console.log(JSON.stringify(_buffstr))\n const m = new RegExp(re).exec(_buffstr);\n //console.log(m)\n if (!m) return null;\n // m[1] is trivially === '\\n'\n //console.log('m.index', m.index)\n const l=[m.index, m[1].length];\n assert(l[0] + l[1] > 0); //assert(m.index > 0);\n //assert(hm <= buffstr.length && hm > 0);\n return l; // discharge size\n },\n /*consumer*/(outchunks, isLastPiece) => {\n outpipe.write(transfline(outchunks[0]) + (isLastPiece?'🕯 ':'⏎ ') );\n const transfline2 = x=>x; // preserve the newline\n outpipe.write(transfline2(outchunks[1]) )\n assert(outchunks.length === 2);\n });\n}", "title": "" }, { "docid": "3b94e3b6004b77ae63ca5b130dee1bca", "score": "0.51541555", "text": "function input(incoming){\n console.log(incoming);\n}", "title": "" }, { "docid": "e0b5b7892ca24c3e37a268cb16d9e41b", "score": "0.5144209", "text": "function appendOutput(msg) { getCommandOutput().value += (msg+'\\n'); }", "title": "" }, { "docid": "798e3b2444106cd8dbd233e7e23b61ad", "score": "0.51417947", "text": "getOutput(input) { return {}; }", "title": "" }, { "docid": "331350c8367936b5f84024d3809318da", "score": "0.51386", "text": "function Output(output) { this.output = output; }", "title": "" }, { "docid": "6c32dd037eb0a624c50fcc1c2e3b57a3", "score": "0.5123178", "text": "function mainProcess(input)\n{\n\t\n\ttry {\t\n\t\tvalidateStringSize(input)\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t\treturn e + \"Input Error\"\n\t}\n\t//data is valid now convert to a collection of 6 characters\n\tlet Temp = inputToArray(input)\n\t\n\t//process bBinary to string of text\n\treturn processString(Temp)\n\n\n}", "title": "" }, { "docid": "125483e4b369c9861f010a6cebbe5884", "score": "0.5107787", "text": "function exampleProcessing(inputString) {\n console.log(inputString);\n}", "title": "" }, { "docid": "aecc5a6d2b6e898913acf1160c0f030a", "score": "0.5107147", "text": "function write_cli(cli_console, msg) {\n\t\tcli_console.stdin.write(msg);\n\t\tcli_console.stdin.end();\n\t}", "title": "" }, { "docid": "2ecf527ea433bcace6cd69d44ab29084", "score": "0.5106715", "text": "static makePrompt(text, next)\n\t{\n\t\t// show text first\n\t\tprocess.stdout.write(text)\n\t\t// create input interface\n\t\tlet rl = readline.createInterface({\n\t\t\tinput: process.stdin\n\t\t})\n\t\tlet result;\n\n\t\t// show input interface\n\t\trl.question('', command => {\n\t\t\tresult = command\n\n\t\t\trl.close()\n\t\t\t\t\n\t\t\t// pass the result to the callback\n\t\t\tnext(result)\n\t\t})\n\t}", "title": "" }, { "docid": "da25bd9a38dc32776439c46269175214", "score": "0.50976765", "text": "receiveStdout() {\n const req = new XMLHttpRequest();\n req.open('GET', '/read');\n req.onload = function() {\n const content = JSON.parse(req.response);\n const stdout = content['stdout'];\n console.log('stdout: ' + stdout);\n this.printChars.bind(this)(stdout);\n\n if (this.cursor.y > this.canvas.height) {\n this.canvas.height = this.cursor.y;\n this.draw();\n console.log('this.canvas.height = ' + this.canvas.height);\n window.scrollTo(0, document.body.scrollHeight);\n }\n this.receiveStdout();\n }.bind(this);\n req.send();\n console.log('waiting for the server');\n }", "title": "" }, { "docid": "32a941b2ea0acd59ea4736fb862558c3", "score": "0.50786585", "text": "function makeText(input) {\n return console.log(new MarkovMachine(input).makeText());\n}", "title": "" }, { "docid": "3e363463523ed9c97e9e920e9df94233", "score": "0.5070035", "text": "constructor() {\n this._stream = process.stdout;\n // So log messages roughly match what's output by the bole in dev mode :^)\n if (isDev()) {\n const pretty = require('bistre')({ time: true });\n this._stream = pretty.pipe(this._stream);\n }\n }", "title": "" }, { "docid": "860a1457c335baec628a9e663a6e5ff7", "score": "0.5063095", "text": "function onStdout (data) {\n haibu.emit('drone:stdout', 'info', data.toString(), meta);\n }", "title": "" }, { "docid": "8e26603c516af5f627dd1bf1575f60dd", "score": "0.5060737", "text": "_wrapStdio(stream) {\n const originalWrite = stream.write;\n let buffer = [];\n\n const flushBufferedOutput = () => {\n const string = buffer.join('');\n buffer = []; // This is to avoid conflicts between random output and status text\n\n this._clearStatus();\n\n if (string) {\n originalWrite.call(stream, string);\n }\n\n this._printStatus();\n\n this._bufferedOutput.delete(flushBufferedOutput);\n };\n\n this._bufferedOutput.add(flushBufferedOutput);\n\n stream.write = chunk => {\n buffer.push(chunk);\n flushBufferedOutput();\n return true;\n };\n }", "title": "" }, { "docid": "0ef4dbc9aa53c86816848309bd191282", "score": "0.5060273", "text": "function processOutput() {\n resultsOutput.val(resultsFormatter())\n SubmitSlack.prop('disabled', false)\n }", "title": "" }, { "docid": "92defd0d042c49f229da7c9b0911ce37", "score": "0.50352335", "text": "function processCommands(input) {\n let commandProcessor = (function () {\n let arr = [];\n let add = function (str) {\n arr.push(str);\n };\n let remove = function (str) {\n arr = arr.filter((el) => el != str);\n };\n let print = function () {\n console.log(arr.join(\",\"));\n };\n return {\n add,\n remove,\n print\n };\n })();\n\n let data = input.slice(0);\n data.forEach((el) => {\n let tokens = el.split(\" \");\n let command = tokens[0];\n let param = tokens[1];\n if ( command === \"add\" ) {\n commandProcessor.add(param);\n } else if ( command === \"remove\" ) {\n commandProcessor.remove( param );\n } else if ( command === \"print\" ) {\n commandProcessor.print();\n }\n });\n}", "title": "" }, { "docid": "68d98777722bb204c53c827445271d3a", "score": "0.50234115", "text": "function CaptureStdout() {\n var oldWrite = process.stdout.write;\n var fs = require ('fs');\n var captured = false;\n var logFile, oldLogFile;\n\n var _interface = {\n capture: function (verbose, logDirectory, logName, fileSize){\n if (!captured){\n try {fs.mkdirSync (logDirectory);}\n catch (e) {}\n logFile = logDirectory + '/' + logName + '.log';\n oldLogFile = logFile + '.old';\n process.stdout.write = function(string, encoding, fd) {\n var size = 0;\n if (verbose){\n oldWrite.apply(process.stdout, arguments);\n }\n if (logFile){\n fs.appendFile(logFile, string);\n try {size = fs.statSync (logFile).size;}\n catch (e) {}\n if (size > fileSize){\n fs.writeFileSync(logFile + '.old', fs.readFileSync(logFile));\n fs.writeFileSync(logFile, ''); // clear out the log file\n }\n }\n };\n captured = true;\n }\n },\n release: function (){\n process.stdout.write = oldWrite;\n }\n };\n return _interface;\n}", "title": "" }, { "docid": "0f840f7728d1216e93fa015ef8106d02", "score": "0.5017934", "text": "function sc_withOutputToProcedure(proc, thunk) {\n var t = function(s) { proc(sc_jsstring2string(s)); };\n return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);\n}", "title": "" }, { "docid": "0f840f7728d1216e93fa015ef8106d02", "score": "0.5017934", "text": "function sc_withOutputToProcedure(proc, thunk) {\n var t = function(s) { proc(sc_jsstring2string(s)); };\n return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);\n}", "title": "" }, { "docid": "fae5472ceb1bb1537d33043d39dfdc38", "score": "0.49994558", "text": "async formatUsingProcess() {\n return new Promise((resolve, reject) => {\n const cmd = this.command;\n const startTime = Date.now();\n const format = { error: false, success: false, content: '' };\n const stdOut = [];\n const stdErr = [];\n const process = new Process('/usr/bin/env', {\n args: cmd\n });\n\n log('Calling PHP Formatting using a process');\n\n process.onStdout((result) => {\n stdOut.push(result);\n });\n process.onStderr((line) => {\n stdErr.push(line);\n });\n\n process.onDidExit((status) => {\n const elapsedTime = Date.now() - startTime;\n log(`PHP formatted in process took ${elapsedTime}ms`);\n /*let formattedJson = false;\n \n try {\n if (stdOut) {\n formattedJson = JSON.parse(stdOut);\n }\n } catch (error) {\n console.error(error);\n }\n\n if (formattedJson && formattedJson.hasOwnProperty('files')) {\n if (formattedJson.files.length) {\n let phpCode = formattedJson.files[0].diff;\n //phpCode = phpCode.replace('-- Original\\n+++ New\\n@@ @@\\n ', '');\n //phpCode = phpCode.replace(/\\n\\s+?\\n$/gm, '\\n');\n //phpCode = phpCode.replace(/^[^\\n]/gm, '');\n\n format.success = true;\n format.content = phpCode;\n\n resolve(format);\n } else {\n format.content = this.text;\n resolve(format);\n }\n } else if (stdErr && stdErr.length > 0) {\n let errorMessage = stdErr.join(' ');\n log('Formatting process error');\n log(errorMessage);\n\n format.error = errorMessage;\n reject(format);\n }*/\n\n if (stdOut && stdOut.join('').includes('Fixed all files')) {\n let phpCode = '';\n\n const filePath = this.tmpFile;\n const file = nova.fs.open(filePath);\n phpCode = file.read();\n file.close();\n\n format.success = true;\n format.content = phpCode;\n\n resolve(format);\n } else if (!stdOut.length && stdErr.length == 2 && stdErr[1].includes('cache')) {\n format.success = true;\n format.content = this.text; // return the original code\n resolve(format);\n } else if (stdErr && stdErr.length > 0) {\n let errorMessage = stdErr.join(' ');\n log('Formatting process error');\n log(errorMessage);\n\n format.error = errorMessage;\n reject(format);\n }\n });\n\n process.start();\n });\n }", "title": "" }, { "docid": "cbda93d030aebee1c1cbde383ded0971", "score": "0.4995302", "text": "output (...msg) {\n this.log.clearProgress()\n console.log(...msg)\n this.log.showProgress()\n }", "title": "" }, { "docid": "0bf8fd5ce4602154c40d52a782cc3ea7", "score": "0.49806455", "text": "log(output){\n var text_element = window.document.createElement(\"p\"); // create a new text element to hold the output; note, `window.document` (rather than just `document`) is used to support node.js env testing\n text_element.innerHTML = output; // define the content of the text element; allow html formatting\n this.output_holder.appendChild(text_element); // add the text element to the output\n }", "title": "" }, { "docid": "5536a8689fc02c03cde5147fee282fd8", "score": "0.49693644", "text": "async function histogramFromStdin() {\n process.stdin.setEncoding(\"utf-8\"); // Read Unicode strings, not bytes\n let histogram = new Histogram();\n for await (let chunk of process.stdin) {\n histogram.add(chunk);\n }\n return histogram;\n }", "title": "" }, { "docid": "65de09bed0e88dc3c471476ab5c199a3", "score": "0.49662113", "text": "text(callback) {\n\t\tthis.process().then((data) => callback(data, this.input));\n\t}", "title": "" }, { "docid": "999d592546aa72bf28f9a1dfb2791b42", "score": "0.49609837", "text": "static write(str, next) {\n process.stdout.write(str, next)\n }", "title": "" }, { "docid": "189721533028bb460d3952bd9a12728c", "score": "0.4951774", "text": "onInputRequest(msg, future) {\n // Add an output widget to the end.\n let factory = this.contentFactory;\n let stdinPrompt = msg.content.prompt;\n let password = msg.content.password;\n let panel = new widgets_1.Panel();\n panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n panel.addClass(OUTPUT_AREA_STDIN_ITEM_CLASS);\n let prompt = factory.createOutputPrompt();\n prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);\n panel.addWidget(prompt);\n let input = factory.createStdin({ prompt: stdinPrompt, password, future });\n input.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n panel.addWidget(input);\n let layout = this.layout;\n layout.addWidget(panel);\n /**\n * Wait for the stdin to complete, add it to the model (so it persists)\n * and remove the stdin widget.\n */\n input.value.then(value => {\n // Use stdin as the stream so it does not get combined with stdout.\n this.model.add({\n output_type: 'stream',\n name: 'stdin',\n text: value + '\\n'\n });\n panel.dispose();\n });\n }", "title": "" }, { "docid": "313c2433f7b72c128a45c23f1c35bbcf", "score": "0.4947408", "text": "function pts_decode(text){\n\n try {\n var jsdata = JSON.parse(text);\n for (key in jsdata) {\n // TODO: multiple fds for pty.js\n if (key==\"1\") {\n stdout_process(unhex_utf8( jsdata[key]))\n //stdout_process( jsdata[key] )\n continue\n }\n try {\n embed_call(jsdata[key])\n } catch (e) {\n console.log(\"IOEror : \"+e)\n }\n }\n\n\n } catch (x) {\n // found a raw C string via libc\n console.log(\"C-OUT [\"+text+\"]\")\n flush_stdout()\n try {\n posix.syslog(text)\n } catch (y) {\n term_impl(text+\"\\r\\n\")\n }\n\n }\n}", "title": "" }, { "docid": "c23b23d2a10699fd24fd48fbf647a1c4", "score": "0.49427548", "text": "function print(input) {\r\n console.log(input);\r\n}", "title": "" }, { "docid": "8b341cb3538d12e3f76b1ecc60e5f90f", "score": "0.4941169", "text": "function puts(error, stdout, stderr) { sys.puts(stdout)}", "title": "" }, { "docid": "17ad427d44e7dd3bb9e658d4b9af1185", "score": "0.4918299", "text": "function input() {\n var cmd = $('.console-input').val()\n $(\"#outputs\").append(\"<div class='output-cmd'>\" + cmd + \"</div>\")\n $('.console-input').val(\"\")\n autosize.update($('textarea'))\n $(\"html, body\").animate({\n scrollTop: $(document).height()\n }, 300);\n return cmd;\n}", "title": "" }, { "docid": "b903ef7d74b175b1f34a1d7691dd1467", "score": "0.49047652", "text": "function stdinWrite (settings) {\n if (settings.inputData) {\n settings.scriptHandler.stdin.write(`${settings.inputData}\\n`);\n }\n}", "title": "" }, { "docid": "2017ebb057042987d18c0fd9b8e22b06", "score": "0.48941174", "text": "function consoleStream() {\n let line = ''\n const stream = through(write, flush)\n\n function write(buf) {\n for (let i = 0; i < buf.length; i++) {\n const c = typeof buf === 'string'\n ? buf.charAt(i)\n : String.fromCharCode(buf[i])\n if (c === '\\n') flush()\n else line += c\n }\n }\n\n function flush() {\n console.log(line)\n line = ''\n }\n\n return stream\n}", "title": "" }, { "docid": "c41b05ff3a5f46b3d49248ac846a5492", "score": "0.488662", "text": "renderOutput(output) {\n \n // strip out backspace characters. TODO maybe strip out other control\n // characters too? We'll likely never want them. \n output = output.replace(/\\x08/, '');\n \n // strip out any ANSI directives for color, cursor movement, etc.\n // TODO render them correctly instead of just stripping them.\n output = AnsiUp.ansi_to_text(output);\n \n // don't render empty output\n if (output.length === 0) return;\n \n // console.log(`rendering output: ${output}`);\n // for (var i = 0, len = output.length; i < len; i++) {\n // console.log(output[i], output.charCodeAt(i));\n // }\n\n var promptRange = this.findPromptRange(output);\n var insertedRange = this.buffer.insert(\n this.processInsertionPoint, \n output,\n {undo: 'skip'}\n );\n \n if (promptRange) {\n var promptMarker = this.textEditor.markBufferRange(\n [\n insertedRange.start.traverse([0, promptRange.offset]), \n insertedRange.start.traverse([0, promptRange.offset + promptRange.size])\n ],\n {comintPrompt: true, invalidate: 'inside'}\n );\n\n var promptDecoration = this.textEditor.decorateMarker(promptMarker, {\n type: 'highlight',\n class: 'prompt'\n });\n\n }\n \n this.processInsertionPoint = insertedRange.end;\n \n // we clip it and leave a \"no-mans land\" of one character in between. this\n // is so that typing won't expand that range, since we would be typing\n // adjacent to the range marker. We later have to put that extra character\n // back on when computing where to insert artificial user input -- i.e. \n // from the input ring.\n var clippedRange = [\n [insertedRange.start.row, insertedRange.start.column],\n [insertedRange.end.row, insertedRange.end.column - 1]\n ];\n this.lastInsertedRangeMarker = this.buffer.markRange(\n clippedRange, \n {comintProcessOutput: true, invalidate: 'never'}\n );\n \n if (this.textEditor.getCursorBufferPosition()\n .isGreaterThanOrEqual(this.processInsertionPoint)) {\n this.textEditor.scrollToBufferPosition(insertedRange.end);\n }\n \n }", "title": "" }, { "docid": "4bec445d6ffd948b3380ca0f5dd6c354", "score": "0.48825115", "text": "function processOutput(output) {\n //pretty much no idea whats going on here...\n return _.values(_.mapValues(_.cloneDeep(output.data), function(n) {\n return n;\n }));\n }", "title": "" }, { "docid": "60029e6fe7f6f7c112d2d1a55e4f2d8a", "score": "0.48790807", "text": "function processData(input) {\n var prep = input.split(', ').join(' ^ ');\n console.log(eval(prep));\n}", "title": "" }, { "docid": "42d3ae7c45fc35cd9eed2f3ef5e6133f", "score": "0.48713592", "text": "function pipe(input, output) {\n /*TODO pipe needs to take in function. refactor the api */\n if(typeof input === 'string' && typeof output === 'object') {\n // piping blob to video element\n output.src = input;\n } else if(typeof input === 'object' && typeof output === 'object') {\n // piping video to canvas\n output\n .getContext('2d')\n .drawImage(input, 0, 0, output.width, output.height);\n }\n\n return output;\n}", "title": "" }, { "docid": "f687e601ba6ab708ea65803ebd0eb52b", "score": "0.48702174", "text": "function CreateLogStreamCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "4faef2e816b94be12f64eb3ca7bdd97f", "score": "0.48531875", "text": "function print(incoming){\n console.log(incoming);\n}", "title": "" }, { "docid": "fa91013a7fba812c7568c4d0ba4df84f", "score": "0.48494294", "text": "createStdin(options) {\n return new outputarea_1.Stdin(options);\n }", "title": "" }, { "docid": "df98c7a9c23323bd1a356e89f818a0da", "score": "0.48455995", "text": "function sc_openOutputString() {\n return proxy( new sc_StringOutputPort());\n}", "title": "" }, { "docid": "6e2821c1532e931e3805ee8823fc673b", "score": "0.48236078", "text": "input(){}", "title": "" }, { "docid": "efa945630f991c0b282a60a199337e55", "score": "0.48122758", "text": "receive(input) {\n var inputTokens = this.parse(input);\n return this.core.process(inputTokens).then(this.render);\n }", "title": "" }, { "docid": "644577d4ac3eef04567b9acea4ef337e", "score": "0.48058912", "text": "function Stream(program, stdin) {\n var s = new stream.Duplex({ read, write, final });\n s.expr = program;\n s.stack = [];\n s.pendingChunk = null;\n s.pendingChunkIndex = null;\n s.pendingChunkCallback = null;\n s.okToEmit = false;\n s.noMoreChunks = false;\n s.finalCallback = null;\n s.advancing = false;\n s.stdin = stdin;\n s.stdinActive = false;\n s.closed = false;\n return s;\n\n function intermediateResult(result) {\n debugRT('intermediateResult %s', rt.nodeType(result));\n var moreToDo;\n if (s.stack.length > 0) {\n s.expr = new rt.Apply(s.stack.pop(), [result]);\n moreToDo = true;\n } else {\n s.expr = null;\n moreToDo = false;\n }\n return moreToDo;\n }\n\n function ensureStdinActive() {\n if (!s.stdinActive && s.stdin) {\n s.stdinActive = true;\n s.stdin.pipe(s);\n }\n }\n\n function finishPendingWrite(err) {\n s.pendingChunk = null;\n s.pendingChunkIndex = null;\n process.nextTick(s.pendingChunkCallback, err);\n s.pendingChunkCallback = null;\n }\n\n function advance() {\n if (s.advancing) {\n debugRT('advance shortcircuit');\n return;\n }\n debugRT('advance');\n s.advancing = true;\n var moreToDo = s.expr != null;\n while (moreToDo) {\n rt.evaluate(s.expr);\n s.expr = rt.smashIndirects(s.expr);\n switch (s.expr.tag) {\n case rt.IOPURE:\n moreToDo = intermediateResult(s.expr.fields[0]);\n break;\n case rt.IOBIND:\n s.stack.push(s.expr.fields[1]);\n s.expr = s.expr.fields[0];\n moreToDo = true;\n break;\n case rt.PUTCHAR:\n if (!s.okToEmit) {\n debugIO('putchar stall');\n moreToDo = false;\n } else {\n var char = s.expr.fields[0];\n rt.evaluate(char);\n char = rt.smashIndirects(char);\n process.nextTick(function (c) {\n debugIO('putchar %j', c);\n s.okToEmit = s.push(c);\n }, char.fields[0]);\n moreToDo = intermediateResult(rt.Unit);\n }\n break;\n case rt.GETCHAR:\n if (!s.pendingChunk) {\n debugIO('getchar stall');\n ensureStdinActive();\n moreToDo = false;\n } else {\n var char = s.pendingChunk.charAt(s.pendingChunkIndex++);\n debugIO('getchar %j', char);\n moreToDo = intermediateResult(new rt.Box(char));\n if (s.pendingChunkIndex >= s.pendingChunk.length)\n finishPendingWrite();\n }\n break;\n case rt.ISEOF:\n if (s.pendingChunk) {\n debugIO('iseof false');\n moreToDo = intermediateResult(rt.False);\n } else if (s.noMoreChunks) {\n debugIO('iseof true');\n moreToDo = intermediateResult(rt.True);\n } else {\n debugIO('iseof stall');\n ensureStdinActive();\n moreToDo = false;\n }\n break;\n default:\n throw new Error('weird tag in: ' + JSON.stringify(s.expr));\n }\n }\n if (!s.expr) {\n debugRT('program ending');\n process.nextTick(function () {\n if (!s.closed) {\n debugRT('closing stdout');\n s.push(null);\n s.closed = true;\n }\n });\n if (s.pendingChunk)\n finishPendingWrite(new Error(\"could not write input to humbaba program, because it ended\"));\n if (s.finalCallback) {\n process.nextTick(s.finalCallback);\n s.finalCallback = null;\n }\n }\n s.advancing = false;\n }\n\n function read() {\n debugRT('reading on stdout');\n s.okToEmit = true;\n advance();\n }\n\n function write(chunk, _encoding, callback) {\n debugRT('writing %d to stdin', chunk.length);\n if (s.pendingChunk)\n throw new Error(\"_write() was called again before the previous call's callback was invoked, which violates the protocol between stream.Writable and this function\");\n s.pendingChunk = chunk.toString();\n s.pendingChunkIndex = 0;\n s.pendingChunkCallback = callback;\n advance();\n }\n\n function final(callback) {\n debugRT('closing stdin');\n s.noMoreChunks = true;\n s.finalCallback = callback;\n advance();\n }\n\n}", "title": "" }, { "docid": "dcb779f257291334e43d225370ed6f38", "score": "0.47988293", "text": "function accumulate_output(str) {\n accumulated_output_info = accumulated_output_info + str + \"\\n\";\n}", "title": "" }, { "docid": "76f8ddaf6a40b182251765f82d9b1c7b", "score": "0.47655362", "text": "start () {\n this.stdin.setEncoding('utf8')\n\n this.stdin.on('readable', () => {\n const chunk = this.stdin.read()\n if (chunk) {\n const transformed = this.transform(chunk.trimRight())\n const filter = !!transformed\n if (filter) this.values = [...this.values, transformed]\n }\n })\n\n return new Promise((resolve, reject) => {\n this.stdin.on('end', () => {\n this.endValue = this.end(this.values)\n return resolve(this.endValue)\n })\n })\n }", "title": "" }, { "docid": "9c1fc73101ada2ba5feb0acc9673bc1d", "score": "0.4764467", "text": "function output(message) {\n var node = document.getElementById('output');\n node.value += message + '\\n';\n }", "title": "" }, { "docid": "cc72f1e0b063dc88c99e1d8863aa93f6", "score": "0.47643378", "text": "function output(msg, format = identify) {\n msg = format(msg)\n console.log(msg)\n}", "title": "" }, { "docid": "984d7c39b4faa87caf9239c4b92a8b2a", "score": "0.47612903", "text": "function output(msg, formatFn = identity) {\r\n msg = formatFn(msg);\r\n console.log(msg);\r\n}", "title": "" }, { "docid": "25845131ab87e57aff3eb11ffad88f0f", "score": "0.47567075", "text": "function _enableOutputBuffering(out) {\n if (out.__fuHacked) return false;\n out.__fuHacked = true;\n out.__fuStack = [];\n out.__fuCurrent = out;\n out.push = function() {\n this.__fuStack.push(this.__fuCurrent);\n this.__fuCurrent = new StringBuffer();\n };\n out.pop = function() {\n var ret = this.__fuCurrent;\n // never overwrite __fuCurrent with null! make sure that\n // out.puts() always does something.\n if (this.__fuStack.length) {\n this.__fuCurrent = this.__fuStack.pop();\n }\n return ret;\n };\n out.__fuOrigWrite = out.write;\n out.write = function(str) {\n return this.__fuCurrent[\n this.__fuCurrent.__fuOrigWrite ? '__fuOrigWrite' : 'write'\n ](str);\n };\n return true;\n}", "title": "" }, { "docid": "4654f30ee89d9575442c1b1dd47f660f", "score": "0.47539383", "text": "run(cmd) {\r\n return new Promise((resolve, reject) => {\r\n this.runner = exec(cmd, {maxBuffer:2000*1024},(err, stdout, stderr) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n else {\r\n resolve(stdout || stderr)\r\n }\r\n })\r\n\r\n this.stdin = this.runner.stdin;\r\n this.stdout = this.runner.stdout;\r\n this.stderr = this.runner.stderr;\r\n\r\n })\r\n }", "title": "" }, { "docid": "0430fa9a0124820ad3b7420ea974a739", "score": "0.47530782", "text": "function prompt(question, callback) {\n var stdin = process.stdin,\n stdout = process.stdout;\n\n stdin.resume();\n stdout.write(question);\n\n stdin.once('data', function (data) {\n callback(data.toString().trim());\n });\n}", "title": "" }, { "docid": "0430fa9a0124820ad3b7420ea974a739", "score": "0.47530782", "text": "function prompt(question, callback) {\n var stdin = process.stdin,\n stdout = process.stdout;\n\n stdin.resume();\n stdout.write(question);\n\n stdin.once('data', function (data) {\n callback(data.toString().trim());\n });\n}", "title": "" }, { "docid": "d6a87a2f93b88ee1d39fe6c7dccc0cbb", "score": "0.4750338", "text": "function handleInput() {\n process(input.value());\n}", "title": "" }, { "docid": "59b9e91490d72e6aa5d5812ce2020f43", "score": "0.47477818", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return ''\n } else if (typeof input === 'string' || input instanceof String) {\n return input\n }\n return JSON.stringify(input)\n }", "title": "" }, { "docid": "677fd5e694997810284d7bf7a560682c", "score": "0.47427484", "text": "function output(msg)\n{\n\tdocument.getElementById(\"output\").value = (msg + \"\\n\" + document.getElementById(\"output\").value);\n}", "title": "" }, { "docid": "e36dea689bb051be6cc959a2c30095aa", "score": "0.47408828", "text": "function printOutScript(){\n\t\n\tconsole.log(output);\n\n}", "title": "" }, { "docid": "b4d36e7a801fa39096bc3f4a5daa187a", "score": "0.47370315", "text": "function DumpOutput(output, outboxId) {\n\t//Create a new text element in a PRE.\n\tvar textNode = document.createTextNode(output);\n\tvar formatterTextTag = document.createElement(\"PRE\");\n\tformatterTextTag.appendChild(textNode);\n\t\n\t//Replace content with the new text element.\n\tvar outbox = document.getElementById(outboxId);\n\toutbox.innerHTML = \"\";\n\toutbox.appendChild(formatterTextTag);\n}", "title": "" }, { "docid": "4d3da8d928a3b631fce8b151a5f400c9", "score": "0.4736493", "text": "createOutputPrompt() {\n return new OutputPrompt();\n }", "title": "" }, { "docid": "6c40009166f64858f0d4349dee3b2cdc", "score": "0.47300673", "text": "function exec(cmd, argv, opts) {\n\n var info = callback(arguments)\n , cb = info.cb\n , args = info.args\n , i;\n\n //console.dir(argv);\n //console.dir(arguments.length);\n\n if(typeof argv === 'function') {\n argv = [];\n }\n\n cmd = args[0];\n argv = args[1];\n opts = info.opts;\n\n // ensure args is always an array\n if(!Array.isArray(argv)) {\n argv = argv !== undefined ? [argv] : [];\n }\n\n // gather subsequent arguments into argv array\n // allows flattened style declaration (without array)\n for(i = 2;i < args.length;i++) {\n if(args[i] && typeof args[i] !== 'object') {\n argv.push(args[i]);\n }\n }\n\n //console.log('cmd %s', cmd);\n //console.log('args %j', argv);\n //console.dir(argv);\n\n var stream = new ProcessStream(cmd, argv, opts);\n if(typeof cb === 'function') {\n stream.once('executed', cb);\n }\n\n i = this.pipeline.length - 1;\n var last = this.pipeline[i]\n , fd;\n\n // attempt to find last process stream in pipeline\n while(last && !(last instanceof ProcessStream)){\n last = this.pipeline[--i];\n }\n\n // check if it has an fd assigned\n fd = (last && last.cmd && last.info && last.info.fd !== undefined)\n ? last.info.fd : undefined;\n\n // link processes stdout/stderr/combine\n if(fd === 1 || fd === 2 || fd === -1) {\n stream.once('spawn', function onSpawn(/* ps */) {\n // scope is now the process stream\n // pipe both streams\n if(fd === -1 && last.out && last.err) {\n last.out.pipe(this.in);\n last.err.pipe(this.in);\n }else if(fd === 1 && last.out) {\n last.out.pipe(this.in);\n }else{\n last.err.pipe(this.in);\n }\n })\n }\n\n return this.fuse(stream, util.format('%s %s', cmd, argv.join(' ')));\n}", "title": "" }, { "docid": "156b8340631efc74772a7996dc511db5", "score": "0.4725204", "text": "function _configureStreams(instance, input, output) {\n \n var buffer = '',\n willParse = false;\n \n function handleData(data) {\n buffer += data;\n \n // parse the buffer on the next tick\n if (! willParse) {\n process.nextTick(parseBuffer);\n }\n } // handleData\n \n function parseBuffer(processRemaining) {\n // if the buffer has a new line\n if (buffer && (reTrailingNewline.test(buffer) || processRemaining)) {\n buffer.replace(reTrailingNewline, '').split(/\\n/).forEach(processLine);\n \n // reset the buffer\n buffer = '';\n }\n \n // flag the will parse to false\n willParse = false;\n }\n \n function processLine(data) {\n // if not paused, then deal with the line\n // otherwise ignore it as it's possible a subinstance is dealing with the input\n if (! instance.paused) {\n instance._queueLine(data);\n }\n }\n \n // resume the stream\n instance.input.resume();\n\n // monitor the input stream\n instance.input.setEncoding('utf8');\n\n if (instance.input.isTTY) {\n // create the readline interface\n instance.rli = _rli || (_rli = rl.createInterface(instance.input, output || process.stdout));\n // tty.setRawMode(true);\n // instance.input._handle.setRawMode(true);\n \n instance.rli.on('line', instance.handlers.line = processLine);\n\n // on ^C exit\n instance.input.on('keypress', instance.handlers.keypress = function(chr, key) {\n if (key && key.ctrl && key.name == 'c') {\n instance.out('\\n');\n process.exit();\n }\n });\n }\n else {\n instance.input.on('data', instance.handlers.data = handleData);\n }\n \n instance.input.on('end', instance.handlers.end = function() {\n // parse the buffer and process the remaining fragments\n if (! willParse) {\n parseBuffer(true);\n }\n \n instance.ended = true;\n if (instance.actions.length > 0) {\n debug('stdin ended - we have more to do...');\n }\n });\n}", "title": "" }, { "docid": "04519d9c2b9e397d13042684edb6c6da", "score": "0.47094446", "text": "function print() {\n var stdout = process.stdout;\n var writer = function (s) { stdout.write(s); };\n this.draw(writer);\n}", "title": "" }, { "docid": "507a73e6d25dab6c61d252109055638a", "score": "0.47051662", "text": "bindDrainEvent() {\n process.stdout.on('drain', () => {\n this.printLine();\n });\n }", "title": "" }, { "docid": "be018cf1389bbd3e8c4b7eea710e2d17", "score": "0.469619", "text": "function pts_decode(text){\n\n try {\n var jsdata = JSON.parse(text);\n for (key in jsdata) {\n // TODO: multiple fds for pty.js\n if (key==\"1\") {\n stdout_process( jsdata[key] )\n continue\n }\n if (key==\"id\") {\n embed_call(jsdata)\n continue\n }\n console.log(\"muliplexer noise : \"+ key+ \" = \" + jsdata[key] )\n }\n\n } catch (x) {\n // found a raw C string via libc\n console.log(\"C-STR:\"+x+\":\"+text)\n flush_stdout()\n term_impl(text+\"\\r\\n\")\n }\n\n}", "title": "" }, { "docid": "ea77915763fa5cbcb1a3479f1827346d", "score": "0.46958235", "text": "function TEST(input) {\n\tconsole.log(prettyPasteV2(input));\n}", "title": "" }, { "docid": "f3a775faaf74764f2a9336817f5633a5", "score": "0.46881908", "text": "function OutputPrompt() {\n var _this = _super.call(this) || this;\n _this._executionCount = null;\n _this.addClass(OUTPUT_PROMPT_CLASS);\n return _this;\n }", "title": "" }, { "docid": "37083469ed9cec8a863d9372d9c9a33d", "score": "0.46797338", "text": "function showOutput (input) {\n $(\"#output\").text(input);\n $(\"#output-section\").show();\n}", "title": "" }, { "docid": "26ec43b1803b5606940bb379480e8d57", "score": "0.46780974", "text": "function converter(user_input){\n let converted_text_container = [];\n let converted_text = \"\";\n let formatted = user_input.split('\\n');\n\n // the converter goes to each line\n //checks for line type, then converts\n for(let i = 0; i < formatted.length; i++){\n\n \n if (formatted[i] == \"\"){\n //dont include empty lines, blank lines/extra whitespace should be specified\n continue;\n } else if(isHeader(formatted[i])){\n converted_text_container.push(convertHeader(formatted[i])); \n } else if (isBlankLine(formatted[i])) {\n converted_text_container.push(convertBlankLine(formatted[i]));\n } else {\n //it's a body statement\n converted_text_container.push(convertBody(formatted[i]));\n }\n\n }\n\n converted_text = converted_text_container.join(\"<br />\");\n\n return converted_text;\n}", "title": "" }, { "docid": "a7c6ae7770d7057dfbf204c0f9ee3be3", "score": "0.46747202", "text": "process(inputTokens) {\n var commandToken = inputTokens['command'];\n var args = inputTokens['args'];\n\n var cmd = access(this.commands, commandToken).bind(this);\n\n return cmd(args);\n }", "title": "" }, { "docid": "fb378da29649b26ae7d0c2782be62f35", "score": "0.46742857", "text": "static convertMarkdown(input) {\n input = this.convertParagraphs(input);\n input = this.convertHeaders(input);\n input = this.convertLinks(input);\n return input;\n }", "title": "" }, { "docid": "6bc12d1e4eaf50540b84db04760f3bc1", "score": "0.46709377", "text": "function displayInput(input) {\n\n console.log(input);\n }", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" }, { "docid": "b99803a562a27ead4fddd8dc7f4e8e61", "score": "0.46679538", "text": "function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}", "title": "" } ]
4d987fe1779e25cff5c2f7f7c91627be
Enter a parse tree produced by MySqlParsertableOptionAutoIncrement.
[ { "docid": "054f30d952bf9e1ff104013e6e65bd9f", "score": "0.6540364", "text": "enterTableOptionAutoIncrement(ctx) {\n\t}", "title": "" } ]
[ { "docid": "2b9d8e1c03cb5045e32423e79412bf5e", "score": "0.5561603", "text": "enterAutoIncrementColumnConstraint(ctx) {\n\t}", "title": "" }, { "docid": "166e4679b86aac98642bf89a5581538c", "score": "0.55217147", "text": "exitTableOptionAutoIncrement(ctx) {\n\t}", "title": "" }, { "docid": "a80bad133b189355041713f4b9b70acf", "score": "0.50973856", "text": "enterSetAutocommitStatement(ctx) {\n\t}", "title": "" }, { "docid": "d9351b2e6f2d2a26c6bab5838029e96c", "score": "0.49273556", "text": "enterPostIncrementExpression(ctx) {\n\t}", "title": "" }, { "docid": "1b297859f041728a4d890d4066eb428c", "score": "0.4917646", "text": "_createAutoIncrementTriggerAndSequence() {\n // TODO Add warning that sequence etc is created\n this.pushAdditional(function() {\n const tableName = this.tableCompiler.tableNameRaw;\n const createTriggerSQL = Trigger.createAutoIncrementTrigger(\n this.client.logger,\n tableName\n );\n this.pushQuery(createTriggerSQL);\n });\n }", "title": "" }, { "docid": "a5854b9cbf9624d77ea77d63e5673186", "score": "0.48962244", "text": "exitAutoIncrementColumnConstraint(ctx) {\n\t}", "title": "" }, { "docid": "5e0f4a6d11fc01429706f9dea9348408", "score": "0.479951", "text": "enterSetAutocommit(ctx) {\n\t}", "title": "" }, { "docid": "f082ab590b272426c137df4dc330d1dc", "score": "0.47735256", "text": "enterAlterByAddPrimaryKey(ctx) {\n\t}", "title": "" }, { "docid": "45668f3ed4b104833b375281d190dc83", "score": "0.47640955", "text": "schemaApplyAutoIncrement(schema, collectionName) {\n\t\t// console.log('schemaAddIncrement:', collectionName);\n\n\t\tschema.plugin(autoIncrement.plugin, {\n\t\t\tmodel: collectionName,\n\t\t\tfield: 'id',\n\t\t\tstartAt: serverSettings.db.idStartAt,\n\t\t\tincrementBy: 1\n\t\t});\n\t}", "title": "" }, { "docid": "d4932373dad36ea0479350f02aa8bdd0", "score": "0.4756236", "text": "function insertNode() {\n pushtree();\n const $checked = $(\"#edit\").find(\":checked\");\n const $firstsel = $checked.eq(0).closest(\"li\");\n const linenr = $firstsel.find(\"label.ln:first\").text();\n $firstsel.before(HTMLtoInsert(linenr)); //create new node\n $(\"#new\").append($checked.closest(\"li\")).removeAttr(\"id\").parents(\"ol:first\").attr(\"class\", \"lvlx\"); //move selection to it\n utils.setnodeattributes(\"edit\");\n }", "title": "" }, { "docid": "ec49abb12032d2f128a7851824de444b", "score": "0.4709553", "text": "enterTableOptionInsertMethod(ctx) {\n\t}", "title": "" }, { "docid": "e65355225d4188c3215f09cc2801c7ad", "score": "0.46050102", "text": "initializeAutoIncrement() {\n\t\tautoIncrement.initialize(mongoose.connection);\n\t}", "title": "" }, { "docid": "fbe15c23e7502490a6df3c24744316a0", "score": "0.45744243", "text": "enterMysqlCreateDatabaseOption(ctx) {\n\t}", "title": "" }, { "docid": "5a251abc36ea4d59d78c3da623fa8cef", "score": "0.45474648", "text": "insert(data) {\n let node = new Node(data);\n if (data.parent_id === null) {\n this.start.push(node);\n } else {\n //if parent_id isn't present in nodes hash table then create a key with the node inside an array to account for multiple children else we push inside the value at that key\n !this.nodes[data.parent_id] ? this.nodes[data.parent_id] = [node] : this.nodes[data.parent_id].push(node);\n }\n }", "title": "" }, { "docid": "9f1a97452827de1845de792e72baf7f9", "score": "0.45399764", "text": "visitPostIncrementExpression(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "9e9a40ccc3a05c83dfc0c34295b32b2e", "score": "0.45114812", "text": "enterTableOptionPersistent(ctx) {\n\t}", "title": "" }, { "docid": "ec071353fe2c5fc32fb6d70314994550", "score": "0.44922715", "text": "enterSetDelimiterMysql(ctx) {\n\t}", "title": "" }, { "docid": "c9a8934adcab862eb919aebeac09c1b0", "score": "0.4473619", "text": "insertBefore() {}", "title": "" }, { "docid": "5c0a1461c7b37230b468a98c9387346c", "score": "0.44641975", "text": "enterCreateDatabaseOption(ctx) {\n\t}", "title": "" }, { "docid": "ade9eaeba1ebc5041a0728c8422ee5a1", "score": "0.44431907", "text": "visitPostIncrementExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "5d60ef55f5daa8be01ac2fc80705b5d2", "score": "0.44347158", "text": "enterPreIncrementExpression(ctx) {\n\t}", "title": "" }, { "docid": "b8941723e129073e6cc696d8da31376b", "score": "0.44196573", "text": "execute(params) {\n let state = this.getCommandState(params)\n if (state.disabled) return\n let editorSession = this._getEditorSession(params)\n editorSession.transaction((tx) => {\n let nodeData = this.createNodeData(tx, params)\n tx.insertInlineNode(nodeData)\n })\n }", "title": "" }, { "docid": "200eb47360006e8683c9ab2023e169bf", "score": "0.4383123", "text": "function setToplevelId(node) {\n topLevelId = node.data('id');\n}", "title": "" }, { "docid": "33508381b5698ee685c7acd921117a4a", "score": "0.43824905", "text": "enterSqlGapsUntilOption(ctx) {\n\t}", "title": "" }, { "docid": "39d0a9a13b24d79838eb3dabba33b1c3", "score": "0.43814018", "text": "enterAlterByTableOption(ctx) {\n\t}", "title": "" }, { "docid": "b0064eda8406634a4a5cf0aa8cb2ab28", "score": "0.43672004", "text": "enterCreateTableLikeOption(ctx) {\n\t}", "title": "" }, { "docid": "bc174d9ae8c53506599bdc8be02be852", "score": "0.4358586", "text": "visitPreIncrementExpression(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "fbbeb62b1fbc1ae7494a832f16247f64", "score": "0.4350954", "text": "enterCreateTableCreateOption(ctx) {\n\t}", "title": "" }, { "docid": "689739d92ff959760882979b8c9a76e5", "score": "0.4344931", "text": "enterTableOptionComment(ctx) {\n\t}", "title": "" }, { "docid": "d7b00f4d66d8e0fc4e345e6f1edbe012", "score": "0.43443406", "text": "enterFromInsertStatementSelect(ctx) {\n\t}", "title": "" }, { "docid": "dc55a2609725f4d7b0697f0ebd4040a5", "score": "0.43374333", "text": "function addEmployee() { \n inquirer.prompt([\n {\n name: 'first_name',\n type: 'input',\n message: \"Enter employee's first name:\"\n },\n {\n name: 'last_name',\n type: 'input',\n message: \"Enter employee's last name: \"\n },\n {\n name: 'role',\n type: 'list',\n message: \"Enter employee's role: \",\n choices: displayRoles()\n },\n {\n name: 'choice',\n type: 'list',\n message: \"Select employee's manager: \",\n choices: displayManagers()\n }\n ])\n .then(function (values) {\n //+1 bc otherwise youll not be able to add to child table\n let chosenRole = displayRoles().indexOf(values.role) +1;\n let chosenManager = displayManagers().indexOf(values.choice) + 1;\n //console.log(values.first_name);\n //console.log(values.lastName);\n //? == user selection\n db.query(`INSERT INTO employees SET ?`, \n {\n first_name: values.first_name,\n last_name: values.last_name,\n manager_id: chosenManager,\n role_id: chosenRole\n \n }, \n function(err){\n if (err) throw err\n console.table(values)\n promptUser();\n })\n});\n}", "title": "" }, { "docid": "f955c5f5b788a4e12c86668d51d07dce", "score": "0.4328668", "text": "async dbInsertMyTree_old(level=null, extraParents=null, myself=true, updateSiblingsOrder=false) {\n if (level===0) return true;\n if (level) level--;\n let newId=this.props.id;\n if (myself!==false) {\n newId=await this.dbInsertMySelf(extraParents, updateSiblingsOrder);\n }\n const myReturn = new Node({id: newId});\n for (const rel of this.relationships) {\n myReturn.addRelationship(await rel.dbInsertMyTree(level, extraParents));\n }\n return myReturn;\n }", "title": "" }, { "docid": "678a2962aca3f810add8de958d72d0e0", "score": "0.43237862", "text": "visitDynamicSqlParserStart(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "2d2092e4a542fab088becc103995dfba", "score": "0.4322659", "text": "exitSetAutocommitStatement(ctx) {\n\t}", "title": "" }, { "docid": "d9719c841515a73dca95ec771ff4b45f", "score": "0.43005714", "text": "async dbInsertMyTreeOld(level=null, extraParents=null) {\n if (level===0) return true;\n if (level) level--;\n const myResult=new this.constructor();\n for (const child of this.children) {\n myResult.addChild(await child.dbInsertMyTree(level, extraParents));\n }\n return myResult;\n }", "title": "" }, { "docid": "c1233a2d98eff8dbe4b9c8715ab3dc5e", "score": "0.4294767", "text": "enterMergeInsertClause(ctx) {\n\t}", "title": "" }, { "docid": "ae1c51d957be08d5ef502d06a9f2a4f6", "score": "0.42901483", "text": "enterAlterDatabaseOption(ctx) {\n\t}", "title": "" }, { "docid": "e83241d0e292c0edf7e3c5feb3e39d06", "score": "0.42840692", "text": "_auto(block) {\n if (block.node.inputs.length) {\n return this._append(block);\n } else {\n return this._insert(block);\n }\n }", "title": "" }, { "docid": "42b116440d45e0bb1977ee13c57d8855", "score": "0.42820477", "text": "enterInceptorCreateDatabaseOption(ctx) {\n\t}", "title": "" }, { "docid": "878c357ef31ce1b7bce45b7bd3102814", "score": "0.42813176", "text": "function add_child(p,u) {\r\n\t\tif (p == null){\r\n\t\t\troot = u;\r\n\t\t}else{\r\n\t\t\tif (u.val < p.val){\r\n\t\t\t\tp.left = u;\r\n\t\t\t}else if (u.val > p.val){\r\n\t\t\t\tp.right = u;\r\n\t\t\t}else {\r\n\t\t\t\talert(\"Error: number is already in the tree\"); \r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tu.parent = p;\r\n\t\t}\r\n\t\tsize++;\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "d75742d606ffd1ba745a7c5a07855a57", "score": "0.4280467", "text": "visitPreIncrementExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "51284fd81acc2f66b70c2d6db11275e4", "score": "0.4275051", "text": "enterInsertStatement(ctx) {\n\t}", "title": "" }, { "docid": "1ab2283ad5463d96def88ad459bcbb8e", "score": "0.42625555", "text": "visitExplicitInsertStatement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1ce2de2cb7d8b4e701c8475ede576602", "score": "0.42594022", "text": "async insert() {\n const { rows } = await db.query(`INSERT INTO perfume_has_tag(perfume_id, tag_id) VALUES ($1, $2) RETURNING *;`, [this.perfumeId, this.tagId]);\n this.id = rows[0].id;\n }", "title": "" }, { "docid": "e60a2b2f9e362949a6894a8a94010ce2", "score": "0.42575914", "text": "function dbPopulate(tx) {\n log.debug(\"Executing DROP stmts\")\n\n tx.executeSql('DROP TABLE IF EXISTS Settings;');\n\n log.debug(\"Executing CREATE stmts\");\n\n tx.executeSql('CREATE TABLE IF NOT EXISTS Version( '\n + 'version_id INTEGER PRIMARY KEY NOT NULL); ').catch((error) => {\n errorCB(error)\n });\n\n tx.executeSql('CREATE TABLE IF NOT EXISTS Settings( '\n + 'name VARCHAR(20), '\n + 'value VARCHAR(20)) ; ').catch((error) => {\n errorCB(error)\n });\n\n log.debug(\"Executing INSERT stmts\")\n\n tx.executeSql('INSERT INTO Settings (name, value) VALUES (\"Key One\", \"Value for Key One\");');\n tx.executeSql('INSERT INTO Settings (name, value) VALUES (\"Key Two\", \"Value for Key One\");');\n log.debug(\"all config SQL done\");\n}", "title": "" }, { "docid": "0b9116f96c0349a7a27b879ff611a3cd", "score": "0.42565447", "text": "insertAfter() {}", "title": "" }, { "docid": "fb7dffec0f2c3ffc748eeee710834920", "score": "0.42557907", "text": "enterAlterByDropPrimaryKey(ctx) {\n\t}", "title": "" }, { "docid": "05b67c96a8a98105674b2fcd9ee02839", "score": "0.42332962", "text": "insert() {\n\n }", "title": "" }, { "docid": "3567573a957fc495e224159b8dce8861", "score": "0.42125162", "text": "function nextTreeId()\n{\n return ++treeIdCounter;\n}", "title": "" }, { "docid": "5989acde7392ae05357b14f2a2e8135d", "score": "0.41980478", "text": "enterCreateUserMysqlV57(ctx) {\n\t}", "title": "" }, { "docid": "31e4e287378eac65b9c8cc3bb05b7ef9", "score": "0.41955182", "text": "enterFromInsertStatementInsert(ctx) {\n\t}", "title": "" }, { "docid": "c6b1964e0510ade019dc5863c7237588", "score": "0.4185542", "text": "function populateAdjacentDropdownInARow(controlID,cell,ChildNode,TextField,ValueField,SPName, ParamName) {\n\tvar rowObj = controlID.parentElement.parentElement;\n\tif(controlID.value != \"\") {\n\t\tvar spm = new SPMaster (\"http://tempuri.org/\",\"../../webservice/Services.asmx\", SPName);\n\t\tspm.addParam(ParamName, controlID.value);\n\t\tvar xmlDom = new JXmlDom(spm.execute(),false);\n\t\tpopulateDropDownByXML(rowObj.cells[cell].childNodes[ChildNode],xmlDom,\"//row\",TextField,ValueField);\n\t}\n\telse {\n\t\trowObj.cells[cell].childNodes[ChildNode].selectedIndex=0;\n\t}\n}", "title": "" }, { "docid": "f02a97b594c39860ae1e8b23142dfbe9", "score": "0.41833752", "text": "enterFromInsertStatement(ctx) {\n\t}", "title": "" }, { "docid": "191524d2ab7a1b710d27a14813498ae3", "score": "0.41827974", "text": "function addOneLineElement(element) {\n\t\t//if this is the very first move to add to the main program, add the main program comment\n\t\t//if (!firstMove) {\n\t\t//\taddMainProgramComment();\n\t\t\tfirstMove = true;\n\t\t//}\n\n\t\tvar indentStr = findIndentation(editor.getSelectedRowIndex());\t// get the correct indentation\n\t\t//var indentStr = \"\";\n\n\t\t// depending on which element it is, format the row correspondingly\n\t\tif (element == \"assignment\"){\n\t\t\t//adds \"ID = EXPR;\n\t\t\teditor.addRow(editor.getSelectedRowIndex(),\n\t\t\t\t[{text:indentStr},\n {text:\"ID\", type:\"aID scope\" + insertionScope},\n\t\t\t\t{text:\"&nbsp;\"},\n\t\t\t\t{text:\"=\"},\n\t\t\t\t{text:\"&nbsp\"},\n {text:\"EXPR\", type:\"expr scope\" + insertionScope},\n\t\t\t\t{text:\";\"}]);\n\t\t}\n\t\telse if (element == \"write\") {\n\t\t\t//adds \"document.write(EXPR);\"\n\t\t\teditor.addRow(editor.getSelectedRowIndex(),\n\t\t\t\t[{text:indentStr},\n\t\t\t\t{text:\"document.write\", type:\"keyword\"},\n\t\t\t\t{text:\"(\", type:\"openParen\"},\n {text:\"EXPR\", type:\"expr write scope\" + insertionScope},\n\t\t\t\t{text:\")\", type:\"closeParen\"},\n\t\t\t\t{text:\";\"}]);\n\t\t}\n\t\telse if (element == \"writeln\") {\n\t\t\t//adds \"document.writeln(EXPR);\"\n\t\t\teditor.addRow(editor.getSelectedRowIndex(),\n\t\t\t\t[{text:indentStr},\n\t\t\t\t{text:\"document.writeln\", type:\"keyword\"},\n\t\t\t\t{text:\"(\", type:\"openParen\"},\n {text:\"EXPR\", type: \"expr write scope\" + insertionScope},\n\t\t\t\t{text:\")\", type:\"closeParen\"},\n\t\t\t\t{text:\";\"}]);\n\t\t}\n\t\telse if (element == \"stringPrompt\") {\n\t\t\t//adds \"ID = prompt(EXPR, EXPR);\"\n\t\t\teditor.addRow(editor.getSelectedRowIndex(),\n\t\t\t\t[{text:indentStr},\n {text:\"ID\", type:\"taID scope\" + insertionScope},\n\t\t\t\t{text:\"&nbsp;\"},\n\t\t\t\t{text:\"=\"},\n\t\t\t\t{text:\"&nbsp;\"},\n\t\t\t\t{text:\"prompt\", type:\"keyword\"},\n\t\t\t\t{text:\"(\", type:\"openParen\"},\n {text:\"EXPR\", type:\"expr text scope\" + insertionScope},\n\t\t\t\t{text:\",&nbsp;\"},\n {text:\"EXPR\", type:\"expr text scope\" + insertionScope},\n\t\t\t\t{text:\")\", type:\"closeParen\"},\n\t\t\t\t{text:\";\"}]);\n\t\t}\n\t\telse if (element == \"numericPrompt\") {\n\t\t\t//adds \"ID = parseFloat(prompt(EXPR, EXPR));\n\t\t\teditor.addRow(editor.getSelectedRowIndex(),\n\t\t\t\t[{text:indentStr},\n {text:\"ID\", type:\"naID scope\" + insertionScope},\n\t\t\t\t{text:\"&nbsp;\"},\n\t\t\t\t{text:\"=\"},\n\t\t\t\t{text:\"&nbsp;\"},\n\t\t\t\t{text:\"parseFloat\", type:\"keyword\"},\n\t\t\t\t{text:\"(\", type:\"openParen\"},\n\t\t\t\t{text:\"prompt\", type:\"keyword\"},\n\t\t\t\t{text:\"(\", type:\"openParen\"},\n {text:\"EXPR\", type: \"expr text scope\" + insertionScope},\n\t\t\t\t{text:\",\"},\n {text:\"EXPR\", type: \"expr numeric scope\" + insertionScope},\n\t\t\t\t{text:\")\", type:\"closeParen\"},\n\t\t\t\t{text:\")\", type:\"closeParen\"},\n\t\t\t\t{text:\";\"}]);\n\t\t}\n\t\telse if (element == \"functionCall\") {\n\t\t\t//adds \"ID = FUNCTION();\"\n\t\t\teditor.addRow(editor.getSelectedRowIndex(),\n\t\t\t\t[{text:indentStr},\n {text:\"FUNCTION\", type: \"fcall scope\" + insertionScope},\n\t\t\t\t{text:\"(\", type:\"openParen\"},\n\t\t\t\t{text:\")\", type:\"closeParen\"},\n\t\t\t\t{text:\";\"}]);\n\t\t}\n\t\telse if (element == \"return\") {\n\t\t\t//adds \"return EXPR;\"\n\t\t\teditor.addRow(editor.getSelectedRowIndex(),\n\t\t\t\t[{text:indentStr},\n\t\t\t\t{text:\"return\", type:\"keyword\"},\n\t\t\t\t{text:\"&nbsp;\"},\n {text:\"EXPR\", type:\"expr return scope\" + insertionScope},\n\t\t\t\t{text:\";\"}]);\n\t\t}\n\n\t\t//selectRow(selRow+1);\t\t\t\t// increase the selected row by one\n\n\t\t// if the selected row is less than the program start line (editing a function), increase program start\n\t\tif (editor.getSelectedRowIndex() < programStart) programStart++;\n\t\tprogramCount++;\n\t\t//toggleEvents();\t\t\t\t\t\t\t\t\t// toggle events to refresh them\n\t\t//refreshLineCount();\t\t\t\t\t\t\t\t// and also refresh line count\n\t\n\t\n\t//;;;;;;;;;;;;; Editor Add Functions ;;;;;;;;;;;;;;;;;;;;;\n\t\n\t/*\n\t * The level parameter corresponds to the level of indention. I do it manually here.\n\t * This can be done automatically. Feel free to throw that in here. Other than that,\n\t * this section should be self explanatory using the Watson Editor API.\n\t */\n\t \n\tfunction addBlankLine(index) {\n\t\teditor.addRow(index, [ { text: \" \" } ]); \n\t}\n\t\n\tfunction addVariable(index, name, type, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\teditor.addRow(index, [ { text: indent }, { text: \"var\", type: \"keyword\" }, { text: \"&nbsp\" }, { text: name }, { text: \";\" }, { text: \"&nbsp\" }, { text: \"/*\" + type + \"*/\", type: \"datatype\" } ]);\n\t}\n\t\n\tfunction addStringPrompt(index, varName, prompt, defaultValue) {\n\t\teditor.addRow(index, [ { text: varName }, { text: \"&nbsp=&nbsp\" }, { text: \"prompt\", type: \"keyword\" }, { text: \"(\", type: \"openParen\" },\n\t\t\t\t\t\t\t\t{ text: prompt, type: \"literal\" }, { text: \",&nbsp;\" }, { text: defaultValue, type: \"literal\" },\n\t\t\t\t\t\t\t\t{ text: \")\", type: \"closeParen\" }, { text: \";\" } ]);\n\t}\n\t\n\tfunction addNumericPrompt(index, varName, prompt, defaultValue, level) {\n\t\tvar indent = getIndent(level);\n\t\teditor.addRow(index, [ {text: indent }, { text: varName }, { text: \"&nbsp=&nbsp\" }, { text: \"parseFloat\", type: \"keyword\" }, { text: \"(\", type: \"openParen\" },\n\t\t\t\t\t\t\t\t{ text: \"prompt\", type: \"keyword\" }, { text: \"(\", type: \"openParen\" }, { text: prompt, type: \"literal\" },\n\t\t\t\t\t\t\t\t{ text: \",&nbsp;\" }, { text: defaultValue, type: \"literal\" }, { text: \")\", type: \"closeParen\" },\n\t\t\t\t\t\t\t\t{ text: \")\", type: \"closeParen\" }, { text: \";\" } ]);\n\t}\n\t\n\t// The write function can potentially have multiple things to write concatenated by a plus sign.\n\t// I didn't add the functionality, but I kind of set up the framework for that.\n\tfunction addWrite(index, str, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\tif (str.length == 1) {\n\t\t\tif (str[0].charAt(0) == '\"') {\n\t\t\t\teditor.addRow(index, [ { text: indent }, { text: \"document.write\", type: \"keyword\" }, { text: \"(\", type: \"openParen\" }, { text: str[0], type: \"literal\" },\n\t\t\t\t\t\t\t\t\t{ text: \")\", type: \"closeParen\" }, { text: \";\" } ]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\teditor.addRow(index, [ { text: indent }, { text: \"document.write\", type: \"keyword\" }, { text: \"(\", type: \"openParen\" }, { text: str[0] },\n\t\t\t\t\t\t\t\t\t{ text: \")\", type: \"closeParen\" }, { text: \";\" } ]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction addWriteln(index, str, level) {\n\t\tvar indent = getIndent(level);\n\t\tif (str.length == 1) {\n\t\t\tif (str[0].charAt(0) == '\"') {\n\t\t\t\teditor.addRow(index, [ { text: indent }, { text: \"document.writeln\", type: \"keyword\" }, { text: \"(\", type: \"openParen\" }, { text: str[0], type: \"literal\" },\n\t\t\t\t\t\t\t\t\t{ text: \")\", type: \"closeParen\" }, { text: \";\" } ]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\teditor.addRow(index, [ { text: indent }, { text: \"document.writeln\", type: \"keyword\" }, { text: \"(\", type: \"openParen\" }, { text: str },\n\t\t\t\t\t\t\t\t\t{ text: \")\", type: \"closeParen\" }, { text: \";\" } ]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction addAssignExpr(index, leftSide, params, level) {\n\t\tvar indent = getIndent(level);\n\t\tvar arr = [];\n\n\t\tarr.push({text: indent});\n\t\tarr.push({text: leftSide});\n\t\tarr.push({text: \"&nbsp;=&nbsp;\"});\n\t\tfor (var i = 0; i < params.length; i++) {\n\t\t\tif (i == params.length - 1)\n\t\t\t\tarr.push({text: params[i]+\";\"});\n\t\t\telse\n\t\t\t\tarr.push({ text: params[i]+\"&nbsp;\" });\n\t\t}\n\t\t\n\t\teditor.addRow(index, arr);\n\t}\n\t\n\tfunction addAssignment(index, leftSide, operand1, operator, operand2, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\tif (!operator || (operator == \"\" && operand2 == \"\")) {\n\t\t\teditor.addRow(index, [ { text: indent }, { text: leftSide }, { text: \"&nbsp;=&nbsp;\" }, { text: operand1 }, { text: \";\" } ]);\n\t\t} else \n\t\teditor.addRow(index, [ { text: indent }, { text: leftSide }, { text: \"&nbsp;=&nbsp;\" }, { text: operand1 }, { text: \"&nbsp;\" + operator + \"&nbsp;\" }, {text: operand2 }, { text: \";\" } ]);\n\t}\n\t\n\tfunction addAssignFunction(index, leftside, funcName, values, level) {\n\t\tvar indent = getIndent(level);\n\t\tvar arr = [];\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\t\t\tarr.push( { text: values[i].param } );\n\t\t\tif (i != values.length - 1)\n\t\t\t\tarr.push( { text: \",\" }, { text: \"&nbsp;\" } );\n\t\t}\n\t\t\n\t\tvar arr2 = [];\n\t\tarr2.push({text: indent});\n\t\tarr2.push({text: leftside});\n\t\tarr2.push({text: \"&nbsp;=&nbsp;\"});\n\t\tarr2.push({text: funcName});\n\t\tarr2.push( { text: \"(\", type: \"openParen\" } );\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tarr2.push(arr[i]);\n\t\t}\n\t\tarr2.push( { text: \")\", type: \"closeParen\" } );\n\t\tarr2.push( { text: \";\" } );\n\t\t\n\t\teditor.addRow(index, arr2);\n\t}\n\t\n\tfunction addFunctionCall(index, funcName, values, level) {\n\t\tvar arr = [];\n\t\tvar indent = getIndent(level);\n\t\t\n\t\t// variable amount of parameters must be taken into consideration\n\t\tfor (var i = 0; i < values.length; i++) {\n\t\t\tarr.push( { text: values[i].param } );\n\t\t\tif (i != values.length - 1)\n\t\t\t\tarr.push( { text: \",\" }, { text: \"&nbsp;\" } );\n\t\t}\n\t\t\n\t\tvar arr2 = [];\n\t\tarr2.push( { text: indent } );\n\t\tarr2.push( { text: funcName } );\n\t\tarr2.push( { text: \"(\", type: \"openParen\" } );\n\t\tfor (var i = 0; i < arr.length; i++) { arr2.push(arr[i]); }\n\t\tarr2.push( { text: \")\", type: \"closeParen\" } );\n\t\tarr2.push( { text: \";\" } );\n\t\t\n\t\teditor.addRow(index, arr2);\n\t}\n\t\n\tfunction addIfThen(index, leftSide, boolSym, rightSide, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\teditor.addRow(index, [ { text: indent }, { text: \"if \", type: \"keyword\" }, { text: \"(\", type: \"openParen\" }, { text: leftSide }, { text: \"&nbsp;\" + boolSym + \"&nbsp;\" },\n\t\t\t\t\t\t\t\t{ text: rightSide }, { text: \")\", type: \"keyword\" }, { text: \" \" } ]);\n\t\teditor.addRow(index + 1, [ { text: indent }, { text: \"{\", type: \"openBrack\" } ]);\n\t\teditor.addRow(index + 2, [ { text: indent }, { text: \"}\", type: \"closeBrack\" } ]);\n\t}\n\t\n\tfunction addIfElse(index, leftSide, boolSym, rightSide, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\teditor.addRow(index, [ { text: indent }, { text: \"if \", type: \"keyword\" }, { text: \"(\", type: \"openParen\" }, { text: leftSide }, { text: \"&nbsp;\" + boolSym + \"&nbsp;\" },\n\t\t\t\t\t\t\t\t{ text: rightSide }, { text: \")\", type: \"keyword\" }, { text: \" \" } ]);\n\t\teditor.addRow(index + 1, [ { text: indent }, { text: \"{\", type: \"openBrack\" } ]);\n\t\teditor.addRow(index + 2, [ { text: indent }, { text: \"}\", type: \"closeBrack\" } ]);\n\t\teditor.addRow(index + 3, [ { text: indent }, { text: \"else \", type: \"keyword\" } ]);\n\t\teditor.addRow(index + 4, [ { text: indent }, { text: \"{\", type: \"openBrack\" } ]);\n\t\teditor.addRow(index + 5, [ { text: indent }, { text: \"}\", type: \"closeBrack\" } ]);\n\t}\n\t\n\tfunction addFor(index, var1, operand1, operator1, operand2, operator2, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\teditor.addRow(index,\n\t\t\t[{text: indent},\n\t\t\t {text: \"for\", type: \"keyword\"},\n\t\t\t {text: \"(\", type: \"openParen\"},\n\t\t\t {text: var1},\n\t\t\t {text: \"&nbsp;=&nbsp;\"},\n\t\t\t {text: operand1+\";\"},\n\t\t\t {text: \"&nbsp;\"+var1+\"&nbsp;\"},\n\t\t\t {text: operator1},\n\t\t\t {text: \"&nbsp;\"+operand2+\";&nbsp;\"},\n\t\t\t {text: var1+operator2},\n\t\t\t {text: \")\", type: \"closeParen\"}]);\n\t\t\n\t\teditor.addRow(index + 1, [ { text: indent }, { text: \"{\", type: \"openBrack\" } ]);\n\t\teditor.addRow(index + 2, [ { text: indent }, { text: \"}\", type: \"closeBrack\" } ]);\n\t}\n\t\n\tfunction addWhile(index, param1, param2, param3, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\teditor.addRow(index,\n\t\t\t[{text: indent+\"while\", type: \"keyword\"},\n\t\t\t {text: \"(\", type: \"openParen\"},\n\t\t\t {text: param1},\n\t\t\t {text: \"&nbsp;\"+param2+\"&nbsp;\"},\n\t\t\t {text: param3},\n\t\t\t {text: \")\", type: \"closeParen\"}]);\n\t\t\n\t\teditor.addRow(index + 1, [ { text: indent }, { text: \"{\", type: \"openBrack\" } ]);\n\t\teditor.addRow(index + 2, [ { text: indent }, { text: \"}\", type: \"closeBrack\" } ]);\n\t}\n\t\n\tfunction addArray(index, left, num, type, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\teditor.addRow(index,\n\t\t\t[{ text: indent },\n\t\t\t { text: \"var\", type: \"keyword\"},\n\t\t\t { text: \"&nbsp\" },\n\t\t\t { text: left },\n\t\t\t { text: \"&nbsp;=&nbsp;\"},\n\t\t\t { text: \"new\", type: \"keyword\"},\n\t\t\t { text: \"&nbsp;Array(\"},\n\t\t\t { text: num },\n\t\t\t { text: \");&nbsp;\"},\n\t\t\t { text: \"/*\" + type + \"*/\", type: \"datatype\" } ]);\n\t}\n\t\n\tfunction addReturn(index, value, level) {\n\t\tvar indent = getIndent(level);\n\t\t\n\t\teditor.addRow(index,\n\t\t\t[{text: indent},\n\t\t\t {text: \"return\", type: \"keyword\"},\n\t\t\t {text: \"&nbsp;\"+value},\n\t\t\t {text: \";\"}]);\n\t}\n\t\n\tfunction addFunction(index, funcName, values, commentType) {\n\t\tvar arr = [];\n\t\t\n\t\t// variable amount of parameters must be taken into consideration\n\t\tfor (var i = 0; i < values.length; i++) {\n\t\t\tarr.push( { text: values[i].name } );\n\t\t\tarr.push( { text: \"&nbsp;\" } );\n\t\t\tarr.push( { text: \"/*\" + values[i].type + \"*/\", type: \"keyword\" } );\n\t\t\tif (i != values.length - 1) arr.push( { text: \",\" }, { text: \"&nbsp;\" } );\n\t\t}\n\t\t\n\t\tvar arr2 = [];\n\t\tarr2.push( { text: \"function\", type: \"keyword\" } );\n\t\tarr2.push( { text: \"&nbsp;\" } );\n\t\tarr2.push( { text: funcName } );\n\t\tarr2.push( { text: \"(\", type: \"openParen\" } );\n\t\tfor (var i = 0; i < arr.length; i++) { arr2.push(arr[i]); }\n\t\tarr2.push( { text: \")\", type: \"closeParen\" } );\n\t\tarr2.push({text: \"&nbsp;\"+\"/*\", type: \"keyword\"});\n\t\tarr2.push({text: commentType, type: \"keyword\"});\n\t\tarr2.push({text: \"*/\", type: \"keyword\"});\n\t\t\n\t\teditor.addRow(index, arr2);\n\t\teditor.addRow(index + 1, [ { text: \"{\", type: \"openBrack\" } ]);\n\t\teditor.addRow(index + 2, [ { text: \"}\", type: \"closeBrack\" } ]);\n\t}\n\t\n\tfunction getIndent(level) {\n\t\tvar indent = \"\";\n\t\tfor (var i = 0; i < level; i++) indent += \"&nbsp;\";\n\t\treturn indent;\n\t}\n\t\n\tfunction addComment(row, param) {\n\t\teditor.addRow(row, [{ text: \"//&nbsp;\"+param, type: \"comment\" }]);\n\t}\n\t\n\t//end editor stuff-------------------------------------\n\t\n\t\n\t}//end of function JSEditor", "title": "" }, { "docid": "d294117657b939a5fc4f025d52ea1605", "score": "0.41779125", "text": "function kvStartNode(name) {\n\tname = stripQuotes(name);\n\tkvIndent();\n\tkvTree += '\\\"' + name + '\\\"';\n\tkvNewLine();\n\tkvIndent();\n\tkvTree += '{';\n\tkvNewLine();\n\t\n\tkvTreeDepth++;\n}", "title": "" }, { "docid": "6a642ef167691666bc880630a8931e97", "score": "0.41685328", "text": "enterInsertStatementValue(ctx) {\n\t}", "title": "" }, { "docid": "57fc93da4dff94b01cf4d28133601b5f", "score": "0.41608778", "text": "visitMergeInsertClause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "997ae6234774585f026d6a7e9c2e041b", "score": "0.41583946", "text": "enterDecimalMasterOption(ctx) {\n\t}", "title": "" }, { "docid": "da2c55890b3dc7701cce529f874a99ad", "score": "0.41413057", "text": "enterSetTransactionStatementMysql(ctx) {\n\t}", "title": "" }, { "docid": "c4dfde8a0aa3458cc23611711f852a36", "score": "0.41378328", "text": "insert() {\n const insertValues = this.single.insert || [];\n let sql = 'insert into ' + this.tableName + ' ';\n let end = '';\n const { returning } = this.single;\n const returningSql = returning\n ? this._returning('insert', returning) + ' '\n : '';\n\n if (Array.isArray(insertValues)) {\n if (insertValues.length === 0) {\n return '';\n }\n } else if (typeof insertValues === 'object' && isEmpty(insertValues)) {\n return {\n sql: sql + returningSql + this._emptyInsertValue,\n returning,\n };\n }\n\n if (insertValues.length > 0) {\n sql = `execute block as begin\n ${sql} `;\n end = `\n end;`;\n }\n\n const insertData = this._prepInsert(insertValues);\n sql += `(${this.formatter.columnize(insertData.columns)}) values (`;\n if (typeof insertData === 'string') {\n sql += `${insertData} ${returningSql}`;\n } else {\n if (insertData.columns.length) {\n let i = -1;\n while (++i < insertData.values.length) {\n if (i !== 0) {\n sql +=\n ` insert into ${this.tableName} (` +\n `${this.formatter.columnize(insertData.columns)}) values (`;\n }\n\n sql += `${this.formatter.parameterize(insertData.values[i])})${\n returningSql.length === 0 ? ';' : ''\n }`;\n }\n sql += ` ${returningSql}${insertValues.length > 0 ? '' : ';'}`;\n sql += end;\n } else if (insertValues.length === 1 && insertValues[0]) {\n sql += returningSql + this._emptyInsertValue;\n } else {\n sql = '';\n }\n }\n\n // if (sql) {\n // sql = 'execute block as begin ' + sql;\n // }\n\n return {\n sql: sql,\n returning: returning,\n };\n }", "title": "" }, { "docid": "dfb2504f0f30e300f3031eff4de9895b", "score": "0.4127095", "text": "visitInsertClause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "03ae2e15a6265cd4e5b56f4eeb49a269", "score": "0.41244516", "text": "function insert () {\n if (previousNumber >= 0) {\n const currentInt = parseInt(currentNumber)\n const previousInt = parseInt(previousNumber)\n\n const minLineNumber = Math.min(currentInt, previousInt)\n const maxLineNumber = Math.max(currentInt, previousInt)\n\n const rangeLength = (maxLineNumber - minLineNumber) + 1\n\n parsedRange.push(...[...Array(rangeLength).keys()]\n .map(i => i + minLineNumber))\n } else {\n parsedRange.push(parseInt(currentNumber))\n }\n }", "title": "" }, { "docid": "05b5405bc6f754b18eb9db401e5dda47", "score": "0.41045034", "text": "function generateID(){\r\n var str = id.val();\r\n var int = parseInt(str);\r\n var idVal = (int + 1);\r\n id.val(idVal.toString());\r\n }", "title": "" }, { "docid": "3cc00fb8d7ac9f8ddecc1e6db8aa02fd", "score": "0.40997255", "text": "enterTableOptionUnion(ctx) {\n\t}", "title": "" }, { "docid": "d251a47022e074fa302f4b2d3592ffed", "score": "0.40964448", "text": "enterCursorDialectOption(ctx) {\n\t}", "title": "" }, { "docid": "89c53d5bbcc25efbf610d935c6b1e6fa", "score": "0.40942407", "text": "set RecursiveUp(value) {}", "title": "" }, { "docid": "641d3be8fd2718e5ea30b8ae1c353e2e", "score": "0.4079796", "text": "enterSelectSpecMysql(ctx) {\n\t}", "title": "" }, { "docid": "f8824c0a1446c321aefc432b03e8dc51", "score": "0.4075375", "text": "enterAlterByOrder(ctx) {\n\t}", "title": "" }, { "docid": "daa271e282513493aeb47bb3f7b12e06", "score": "0.40707088", "text": "enterCursorManipulationStatements(ctx) {\n\t}", "title": "" }, { "docid": "9876a97571e977d7b9823acb42f101e5", "score": "0.40645555", "text": "enterInsertValueClause(ctx) {\n\t}", "title": "" }, { "docid": "eb6d5d16631b93b2d2e4d93a5cb5a422", "score": "0.40628803", "text": "function tree_insert(nodes, insertion, i, parent_id) {\n var items = [];\n (0,_tree_walk_preorder__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({\n roots: (0,_tree_from_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(insertion.map(_tree_map_orig__WEBPACK_IMPORTED_MODULE_1__[\"default\"])).roots,\n visit: function visit(_ref) {\n var node = _ref.node,\n stack = _ref.stack;\n\n if (stack.length == 1) {\n node.orig.parent_id = parent_id;\n }\n\n items.push(node.orig);\n }\n });\n nodes.splice.apply(nodes, [i, 0].concat(items));\n return nodes;\n}", "title": "" }, { "docid": "e42a232d51f2451f6dd393bc0c76fb25", "score": "0.4061723", "text": "enterAlterByAddUniqueKey(ctx) {\n\t}", "title": "" }, { "docid": "6fcabd8e110808feb9db824d29886b9a", "score": "0.40584883", "text": "exitTableOptionInsertMethod(ctx) {\n\t}", "title": "" }, { "docid": "178b92e115286bbed8ff1609e1a2b0ce", "score": "0.40517446", "text": "async function autoGenerateIdMenu (kode_kantin) {\n try {\n let data = await Menu.find({'_id': new RegExp(kode_kantin, 'i')}).sort([['_id', 'descending']])\n if (data.length < 1){\n return kode_kantin+'001'\n } else {\n let lastId = data[0][\"_id\"]\n lastId = lastId.split(kode_kantin).join('')\n let newId = parseInt(lastId) + 1\n if (newId < 10) {\n newId = '00' + newId.toString()\n }\n else if (newId < 100) {\n newId = '0' + newId.toString()\n }\n else if (newId < 1000) {\n newId = '' + newId.toString()\n }\n return kode_kantin+newId\n }\n }\n catch(err) {\n console.log(err)\n return err\n }\n}", "title": "" }, { "docid": "e56960573a0e6f042e9bb0be5a951326", "score": "0.40517294", "text": "enterAlterSpecificationMysql(ctx) {\n\t}", "title": "" }, { "docid": "e00d3a51188b04e79f4a7c70fa443d0b", "score": "0.40480807", "text": "addNew() {\n return db.result(`INSERT into property\n (property_name,street_address,county,city,state,zipcode,squarefeet,description,directions,contact_id,type,show_mp,show_di,show_pd,pd_description,year_opened,major_tenants,photo,mapx,mapy)\n values\n ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20) returning id`,[this.propertyName,this.streetAddress, this.county, this.city, this.state,this.zipcode, this.squarefeet,this.description,this.directions, this.contactId,this.type,this.showMP, this.showDI, this.showPD,this.pdDescription,this.yearOpened, this.majorTenants, this.photo, this.mapx, this.mapy]);\n\n // ('${this.propertyName}','${this.streetAddress}','${this.county}','${ this.city }','${this.state}','${this.zipcode}', ${this.squarefeet},'${this.description}','${this.directions}', ${this.contactId},'${this.type}',${this.showMP}, ${this.showDI}, ${this.showPD},'${this.pdDescription}',${this.yearOpened},'${this.majorTenants}',${this.photo}, ${this.mapx},${this.mapy}) returning id` );\n \n// ('${this.propertyName}','${this.streetAddress}','${this.county}','${ this.city }','${this.state}','${this.zipcode}',\n// ${this.squarefeet},'${this.description}','${this.directions}', ${this.contactId},'${this.type}',${this.showMP}, ${this.showDI}, ${this.showPD},'${this.pdDescription}',${this.yearOpened},\n// '${this.majorTenants}',${this.photo}, ${this.mapx},${this.mapy}) returning id` );\n \n }", "title": "" }, { "docid": "a685d570098b88eb21cbb521753758bc", "score": "0.40219036", "text": "function onEnter(input) {\n\n input.parentNode.className == \"node\" || \"node array\" || \"node obj\";\n let array = input.parentNode.className != \"node\"\n let val = input.value != \"\";\n let semicolon = input.value[input.value.length-1] == \":\"\n let node = input.parentNode;\n switch (input.className) {\n case 'string':\n if (val){\n if (semicolon) {\n createValInput(input);\n makeArray(input, true)\n input.value = input.value.replace(\":\", \"\");\n moveCursor('next');\n } else {\n if (true) {\n\n }\n input.parentNode.parentNode.appendChild(createNode());\n\n }\n } else {\n input.parentNode.appendChild(createNode());\n makeArray(input.firstChild, false);\n }\n break;\n case 'key':\n if (val){\n\n } else {\n\n }\n break;\n case 'val' || 'int':\n if (val){\n if (input.value == ':') {\n makeArray(input, true);\n } else {\n node.parentNode.appendChild(createNode(true));\n moveCursor('next');\n }\n } else {\n node.appendChild(createNode());\n makeArray(node.lastChild.getElementsByTagName('input')[0]);\n }\n break;\n default:\n\n }\n\n\n // make int\n if (parseInt(input.value, 10 ) >= 0 && input.className == \"val\") {\n input.className = \"int\";\n }\n }", "title": "" }, { "docid": "166ec4ebfee4f2603a95e868a4cf3ba1", "score": "0.4019554", "text": "enterCreateUserMysqlV56(ctx) {\n\t}", "title": "" }, { "docid": "1f4d2deac3113f39677ccebeb3bb5423", "score": "0.4018378", "text": "static addNewBlank() {\n return db.result(`INSERT into property (property_name) values ('A New Property') returning id`);\n }", "title": "" }, { "docid": "f83148d380e99e73257cee40826e6fcf", "score": "0.40183663", "text": "enterTransactionOption(ctx) {\n\t}", "title": "" }, { "docid": "8bb52e47b8f27a0a5664ced24c919f94", "score": "0.4013875", "text": "exitAlterByAddPrimaryKey(ctx) {\n\t}", "title": "" }, { "docid": "2511aebfcbc2396b121778784c988053", "score": "0.40137467", "text": "insert() {\n let insertValues = this.single.insert || [];\n let { returning } = this.single;\n\n if (!Array.isArray(insertValues) && isPlainObject(this.single.insert)) {\n insertValues = [this.single.insert];\n }\n\n // always wrap returning argument in array\n if (returning && !Array.isArray(returning)) {\n returning = [returning];\n }\n\n if (\n Array.isArray(insertValues) &&\n insertValues.length === 1 &&\n isEmpty(insertValues[0])\n ) {\n return this._addReturningToSqlAndConvert(\n `insert into ${this.tableName} (${this.formatter.wrap(\n this.single.returning\n )}) values (default)`,\n returning,\n this.tableName\n );\n }\n\n if (\n isEmpty(this.single.insert) &&\n typeof this.single.insert !== 'function'\n ) {\n return '';\n }\n\n const insertData = this._prepInsert(insertValues);\n\n const sql = {};\n\n if (isString(insertData)) {\n return this._addReturningToSqlAndConvert(\n `insert into ${this.tableName} ${insertData}`,\n returning\n );\n }\n\n if (insertData.values.length === 1) {\n return this._addReturningToSqlAndConvert(\n `insert into ${this.tableName} (${this.formatter.columnize(\n insertData.columns\n )}) values (${this.formatter.parameterize(insertData.values[0])})`,\n returning,\n this.tableName\n );\n }\n\n const insertDefaultsOnly = insertData.columns.length === 0;\n\n sql.sql =\n 'begin ' +\n map(insertData.values, (value) => {\n let returningHelper;\n const parameterizedValues = !insertDefaultsOnly\n ? this.formatter.parameterize(value, this.client.valueForUndefined)\n : '';\n const returningValues = Array.isArray(returning)\n ? returning\n : [returning];\n let subSql = `insert into ${this.tableName} `;\n\n if (returning) {\n returningHelper = new ReturningHelper(returningValues.join(':'));\n sql.outParams = (sql.outParams || []).concat(returningHelper);\n }\n\n if (insertDefaultsOnly) {\n // no columns given so only the default value\n subSql += `(${this.formatter.wrap(\n this.single.returning\n )}) values (default)`;\n } else {\n subSql += `(${this.formatter.columnize(\n insertData.columns\n )}) values (${parameterizedValues})`;\n }\n subSql += returning\n ? ` returning ROWID into ${this.formatter.parameter(returningHelper)}`\n : '';\n\n // pre bind position because subSql is an execute immediate parameter\n // later position binding will only convert the ? params\n\n subSql = this.formatter.client.positionBindings(subSql);\n\n const parameterizedValuesWithoutDefault = parameterizedValues\n .replace('DEFAULT, ', '')\n .replace(', DEFAULT', '');\n return (\n `execute immediate '${subSql.replace(/'/g, \"''\")}` +\n (parameterizedValuesWithoutDefault || returning ? \"' using \" : '') +\n parameterizedValuesWithoutDefault +\n (parameterizedValuesWithoutDefault && returning ? ', ' : '') +\n (returning ? 'out ?' : '') +\n ';'\n );\n }).join(' ') +\n 'end;';\n\n if (returning) {\n sql.returning = returning;\n // generate select statement with special order by to keep the order because 'in (..)' may change the order\n sql.returningSql =\n `select ${this.formatter.columnize(returning)}` +\n ' from ' +\n this.tableName +\n ' where ROWID in (' +\n sql.outParams.map((v, i) => `:${i + 1}`).join(', ') +\n ')' +\n ' order by case ROWID ' +\n sql.outParams\n .map((v, i) => `when CHARTOROWID(:${i + 1}) then ${i}`)\n .join(' ') +\n ' end';\n }\n\n return sql;\n }", "title": "" }, { "docid": "35d5a3ffbed93da7da2b8a363a589779", "score": "0.4013608", "text": "async function addEmployee() {\n const roleId = \"select id, title from role;\";\n const roleData = await connection.query(roleId);\n const empOpts =\n \"select id, CONCAT(first_name,' ',last_name) AS 'Name' from employee;\";\n const empData = await connection.query(empOpts);\n\n const emp = await inquirer.prompt([\n {\n name: \"first_name\",\n message: `What is the ${EMPLOYEE} First Name?`,\n },\n {\n name: \"last_name\",\n message: `What is the ${EMPLOYEE} Last Name?`,\n },\n {\n name: \"role_id\",\n message: `What is the ${ROLE} for this ${EMPLOYEE}? `,\n type: \"list\",\n choices: roleData.map((roleItem) => ({\n name: roleItem.title,\n value: roleItem.id,\n })),\n },\n {\n name: \"mngr_id\",\n message: `Who is the Manager for this ${EMPLOYEE}? `,\n type: \"list\",\n choices: empData.map((empItem) => ({\n name: empItem.Name,\n value: empItem.id,\n })),\n },\n ]);\n\n console.log(emp.mngr_id);\n console.log(emp.role_id);\n var query = await connection.query(\"INSERT INTO employee SET ?\", {\n first_name: emp.first_name,\n last_name: emp.last_name,\n role_id: emp.role_id,\n manager_id: emp.mngr_id,\n });\n console.log(` ${EMPLOYEE} inserted!\\n`);\n}", "title": "" }, { "docid": "655f3d7c1db7c36e2cee082c8b84b4f4", "score": "0.40098825", "text": "function populateDB(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS PETS (id unique,nombre,salud numeric,hambre numeric,diversion numeric,sucio numeric,caca numeric,ncaca numeric,muerto numeric)');\n \n }", "title": "" }, { "docid": "7d574c89f89af042e09d93c39d6dde05", "score": "0.39960256", "text": "enterAlterSimpleDatabase(ctx) {\n\t}", "title": "" }, { "docid": "cd92c90afb70804f4a1c486a0523eb9f", "score": "0.39873314", "text": "function getNextID(callback){\n\tmCounter.findOne({id: \"MapperID\"}, function(err, mapperID){\n\t\tif(!err){\n\t\t\tmapperID.seq++;\n\t\t\tmapperID.save(function(err){\n\t\t\tcallback(mapperID.seq);\t\n\t\t\t});\n\t\t\t}\t\t\n\t});\n\t\n}", "title": "" }, { "docid": "0196e1147fc2e6af1f80237eb931bfef", "score": "0.3986476", "text": "enterMasterDecimalOption(ctx) {\n\t}", "title": "" }, { "docid": "395ce3469f2d970f8d7a36158e340a94", "score": "0.3984051", "text": "function add_merge_node(cfg, i){\n let merge_next = cfg[i];\n let type = merge_next.parent.type === 'WhileStatement' ? 'NULL' : ' ';\n let shape = merge_next.parent.type === 'WhileStatement' ? 'rectangle' : 'circle';\n let merge_node = {next: [merge_next], prev: merge_next.prev, normal: merge_next, type: type, shape: shape};\n merge_next.prev = merge_node;\n for(let i = 0; i < merge_node.prev.length; i += 1){\n let prev = merge_node.prev[i];\n prev.normal = merge_node;\n prev.next = [merge_node];\n }\n return merge_node;\n\n}", "title": "" }, { "docid": "09b95068aaba8aa498b6699e3658ad75", "score": "0.39807472", "text": "enterPrimaryKeyColumnConstraint(ctx) {\n\t}", "title": "" }, { "docid": "4a5c302271b4f1afa3ecdadd1a7bf79d", "score": "0.39792278", "text": "function poptree() {\n const tree = glob.Tstack[glob.Tstack.length - 1];\n if (!tree) {\n utils.myAlert(\"stack empty\", false, null, null);\n } else {\n utils.myAlert(\"Restore previous edit?\", true, function () {\n const $ed = $(\"#edit\");\n glob.Tstack[glob.Tstack.length - 1] = null; //to make obj unreachable. Necessary?\n glob.Tstack.pop();\n $ed.find(\"ol:first\").remove();\n $ed.append(tree);\n utils.setnodeattributes(\"edit\");\n updateUndoSelect();\n });\n }\n }", "title": "" }, { "docid": "78bb1b8cdc57411be05c06e87a399c4f", "score": "0.39785933", "text": "insert(value) {\n //create new node that takes in a val\n //start at root, if no root new Node becomes root\n //if there is a root, check the value of the new node is greater or less than value of root\n //if it is greater\n //check to see if there is a node to the right\n //if ther is move on to the next node and repeat these steps\n //if there is no node, add that node as the right property\n //else if it is less\n //check to see if there is a node to the right\n //if there is a node, move to left of that node and repeat these steps\n //if there is no node, add that node as the left property\n const newNode = new Node(value);\n if (!this.root) {\n this.root = newNode;\n return this;\n } else {\n let currentNode = this.root;\n while (true) {\n if (value === currentNode.value) {\n return undefined;\n }\n if (value < currentNode.value) {\n if (currentNode.left === null) {\n currentNode.left = newNode;\n return this;\n } else {\n currentNode = currentNode.left;\n }\n } else if (value > currentNode.value) {\n if (currentNode.right === null) {\n currentNode.right = newNode;\n return this;\n } else {\n currentNode = currentNode.right;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "e22e81fac98ff7cb0264d872bc661883", "score": "0.39742213", "text": "enterAlterSpecificationConstraintPrimaryKey(ctx) {\n\t}", "title": "" }, { "docid": "28e343c560440db59c78d23093a5b697", "score": "0.3973351", "text": "exitPostIncrementExpression(ctx) {\n\t}", "title": "" }, { "docid": "0f5012314b4e21c3d648fbcba6a3593b", "score": "0.39727098", "text": "enterAlterDatabaseAnchor(ctx) {\n\t}", "title": "" }, { "docid": "8c5dcc6c429e8f48bca05e0d742eb203", "score": "0.39680046", "text": "insert(datum) {\n const tree = this;\n tree.root = f(tree.root, datum);\n tree.root.color = BLACK;\n tree.root.parent = undefined;\n function f(h, datum) {\n if (h === undefined) {\n tree.valueCount++;\n tree.nodeCount++;\n return new Node(datum);\n }\n const c = tree.compare(datum, h.datum);\n if (c === 0) {\n if (tree.duplicatesAllowed) {\n tree.valueCount++;\n if (h.extras === undefined) {\n h.extras = [datum];\n }\n else {\n h.extras.push(datum);\n }\n }\n else {\n h.datum = datum; // replace old value\n }\n }\n if (c !== 0) {\n const dir = c > 0 ? RIGHT : LEFT;\n h[dir] = f(h[dir], datum);\n h[dir].parent = h;\n }\n if (isRed(h[RIGHT]) && !isRed(h[LEFT])) {\n h = tree_rotate(LEFT, h);\n }\n if (isRed(h[LEFT]) && isRed(h[LEFT][LEFT])) {\n h = tree_rotate(RIGHT, h);\n }\n if (isRed(h[LEFT]) && isRed(h[RIGHT])) {\n flipColors(h);\n }\n return h;\n }\n }", "title": "" }, { "docid": "9614ce91105610b416d83528835efef1", "score": "0.39666906", "text": "enterAlterUserMysqlV57(ctx) {\n\t}", "title": "" }, { "docid": "50b43f16f48b24f7d99a21765a814d88", "score": "0.39618903", "text": "function insertIntoBracesOrSourceFileWithFillAndGetChildren(opts) {\n if (opts.structures.length === 0)\n return [];\n var startChildren = opts.getIndexedChildren();\n var parentSyntaxList = opts.parent.getChildSyntaxListOrThrow();\n var index = helpers_1.verifyAndGetIndex(opts.index, startChildren.length);\n var childIndex = getChildIndex();\n insertIntoBracesOrSourceFile(__assign({}, opts, { children: parentSyntaxList.getChildren(), separator: opts.sourceFile.global.manipulationSettings.getNewLineKind(), index: childIndex }));\n return helpers_1.fillAndGetChildren(__assign({}, opts, { allChildren: opts.getIndexedChildren(), index: index }));\n function getChildIndex() {\n if (index === 0)\n return 0;\n // get the previous member in order to get the implementation signature + 1\n return startChildren[index - 1].getChildIndex() + 1;\n }\n}", "title": "" }, { "docid": "c0a6c3461c8851f2cfd9b49877e5d6e8", "score": "0.3955748", "text": "function addTransactionRow() {\n 'use strict';\n createTxidInput();\n removeAddButton();\n document.getElementById(\"txid\").focus();\n}", "title": "" }, { "docid": "55909a640d91d1d1afe47f397aedc53b", "score": "0.39543152", "text": "function parseIntExpr(){\n\tconsole.log('intexpr');\n CST.addNode('IntExpr', 'branch');\n\tconsole.log('current: ' + tokenParse[parseCounter+1][0]);\n if (tokenParse[parseCounter][1] == 'Digit'){ // this needed to be a capital D\n\t\tconsole.log('current: ' + tokenParse[parseCounter+1][0]);\n\t\tparseDigit();\n\t\tif (tokenParse[parseCounter][0] == '+'){\n\t\t\tconsole.log('current: ' + tokenParse[parseCounter+1][0]);\n\t\t\tparseIntOp();\n\t \tparseExpr();\n\t\t\tconsole.log('current: ' + tokenParse[parseCounter+1][0]);\n\t\t}\n\t}\n\telse if(tokenParse[parseCounter][1] == 'identifier'){\n\t\tparseId();\n\t\tif (tokenParse[parseCounter][0] == '+'){\n\t\t\tconsole.log('current: ' + tokenParse[parseCounter+1][0]);\n\t\t\tparseIntOp();\n\t \tparseExpr();\n\t\t\tconsole.log('current: ' + tokenParse[parseCounter+1][0]);\n\t\t}\n\t}\n\telse{\n\t\tdocument.getElementById('outputParse').value += 'Error: Expected digit, Found: ' + tokenParse[parseCounter][0] + \"\\n\"\n\t\tthrow new Error('Not a Digit. Found: ' + tokenParse[parseCounter][0]);\n\t}\n\tCST.endChildren();\n}", "title": "" }, { "docid": "6a1166bddee71c217b82993202e0f8f1", "score": "0.3953466", "text": "enterTableOptionCollate(ctx) {\n\t}", "title": "" } ]
4a342ff068fd7fc0257ef1588b937b13
Inject the connector's JWT token into to the Swagger client
[ { "docid": "822fa597353bfc0dfa7aa97b22c47c91", "score": "0.62646556", "text": "function addTokenToClient(connector, clientPromise) {\n // ask the connector for the token. If it expired, a new token will be requested to the API\n var obtainToken = Promise.promisify(connector.addAccessToken.bind(connector));\n var options = {};\n return Promise.all([clientPromise, obtainToken(options)]).then(function (values) {\n var client = values[0];\n var hasToken = !!options.headers.Authorization;\n if (hasToken) {\n var authHeader = options.headers.Authorization;\n client.clientAuthorizations.add('AuthorizationBearer', new Swagger.ApiKeyAuthorization('Authorization', authHeader, 'header'));\n }\n\n return client;\n });\n }", "title": "" } ]
[ { "docid": "3efa6da0b38c0a70689dda013c37de85", "score": "0.6267704", "text": "setJwtToken(token) {\n this.getApiService().setJwtToken(token);\n }", "title": "" }, { "docid": "965a1c8ba36a917e38f14d8843030df0", "score": "0.59298116", "text": "@action init() {\n let userToken = store.get(StoreKey.UserToken.name);\n if (userToken) {\n axios.defaults.headers.common['Authorization'] = 'Bearer ' + userToken;\n this.userToken = userToken;\n }\n }", "title": "" }, { "docid": "ca83ceee46a5dacb5c9f06d05b661fc7", "score": "0.5777331", "text": "function setJwt(token) {\n axios.defaults.headers.common['x-auth-token'] = token\n}", "title": "" }, { "docid": "7193476ec52067dccab34186f5e05100", "score": "0.5745722", "text": "_generateTokenOptions() { \r\n this._tokenOptions = {\r\n url: 'https://login.windows.net/common/oauth2/token', \r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n body: `resource=https%3A%2F%2Fgraph.microsoft.com%2F&grant_type=password&username=${this.username}&password=${this.password}&audience=https://someapi.com/api&scope=openid&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}`,\r\n json: true };\r\n }", "title": "" }, { "docid": "0f35ed89141404de29871feb1ef0859b", "score": "0.5686655", "text": "token() {\n return async (ctx, next) => {\n debug('Running token endpoint middleware');\n const request = new Request(ctx.request);\n const response = new Response(ctx.response);\n\n return this.server.token(request, response)\n .then(token => this.saveTokenMetadata(token, ctx.request))\n .then((token) => {\n ctx.state.oauth = { token };\n handleResponse(ctx, response);\n return next();\n })\n .catch((err) => { handleError(err, ctx); });\n };\n }", "title": "" }, { "docid": "7d7ba281795d2ef03a17f684ed79027a", "score": "0.5678369", "text": "function setJwt(jwt) {\n axios.defaults.headers.common[\"x-auth-token\"] = jwt;\n}", "title": "" }, { "docid": "35d06350e18ffa634b76bce0f7ffd8c1", "score": "0.56474346", "text": "constructor() {\n this.token = '<auth-token>';\n }", "title": "" }, { "docid": "3d9a1ce485f49cff9f996638d118d1d0", "score": "0.5642034", "text": "addToken(req, token) {\n return req.clone({\n setHeaders: {\n Authorization: 'Bearer ' + token\n }\n });\n }", "title": "" }, { "docid": "f9e091c8d7d6e27911bb0e23af9eee7b", "score": "0.5624035", "text": "constructor() {\n this.secret = SERVER.JWT_SECRET;\n }", "title": "" }, { "docid": "590fbb87b31a4c7ba06ace9b85ec3e56", "score": "0.56008714", "text": "receiveToken(req, res, next) {\n if (req.headers.authorization) {\n req.authToken = req.headers.authorization.replace(/^Bearer\\s/, '');\n }\n next();\n }", "title": "" }, { "docid": "c76ac09daec80ea65357980fd77bda16", "score": "0.5583904", "text": "createJWTToken(token) {\n return 'Bearer ' + token\n }", "title": "" }, { "docid": "e84b4085a5c6fb5dca14eb9e23043146", "score": "0.5578385", "text": "setAuthenticationToken (token) {\n this.CatalogueApi.ApiClient.instance.authentications.oauth2.accessToken = token\n }", "title": "" }, { "docid": "71c537c6cda40283754c7bf7b8b3d478", "score": "0.55135274", "text": "auth(token) {\n this.headers['Authorization'] = `Bearer ${token}`;\n return this;\n }", "title": "" }, { "docid": "20c225d70d38815a7fe19227e3db38c3", "score": "0.54880965", "text": "static async applyAuthToken(ctx, next) {\n if (ctx.request.method === 'OPTIONS' || ctx.request.url === '/login') {\n return next()\n }\n\n const userToken = (ctx.request.header.authorization || '').match(rxToken)\n ctx.req.sessionId = userToken[1]\n\n await next()\n }", "title": "" }, { "docid": "65abed8a0c6a66a51746195cd634b037", "score": "0.54593664", "text": "async configureJWTToken(state) {\n if (state === SIGNED_IN_STATE) {\n const sessionInfo = await Auth.currentSession();\n const { jwtToken } = sessionInfo.idToken;\n\n // eslint-disable-next-line dot-notation\n axios.default.defaults.headers.common['Authorization'] = `Bearer ${jwtToken}`;\n axios.default.defaults.timeout = 60000 * 2;\n }\n }", "title": "" }, { "docid": "e3d3f2926182234c83b2bd663569625b", "score": "0.543858", "text": "auth(token, secret) {\n this.authenticatedToken = token;\n this.authenticatedSecret = secret;\n return this;\n }", "title": "" }, { "docid": "c0df988363fba86450d88c91d77c4367", "score": "0.5436378", "text": "addAuth() {\n this.headers.Authorization = `Bearer ${this.store.getters.getToken}`;\n }", "title": "" }, { "docid": "5ca0b1fc1415c1e7295954138b0717b5", "score": "0.54306906", "text": "function getToken() {\r\n //Authentication\r\n var authorizationToken = `Basic ${key.secretchild}`;\r\n\r\n //Format the Post Request\r\n const url = {\r\n host: 'api.fitbit.com',\r\n path: `/oauth2/token?grant_type=authorization_code&redirect_uri=${key.callbackURL}&code=${key.authorizationCode}`,\r\n method: 'POST',\r\n headers: {\r\n 'Authorization': authorizationToken,\r\n 'Content-Type': 'application/x-www-form-urlencoded'\r\n }\r\n };\r\n\r\n //Send a Request to the token Authorization URL\r\n const req = https.request(url, res => {\r\n\r\n //When a Response is made by the Web API continue the process\r\n res.on('data', function (chunk) {\r\n //Grab the Authorization Token\r\n let json = JSON.parse(chunk);\r\n key.accessToken = json.access_token;\r\n\r\n //Grab the ID of the owner of the Resource\r\n key.owner = json.user_id;\r\n\r\n //Confirm the token has been retrieved to the client\r\n io.emit('token', { urltext: key.accessToken });\r\n updateJSON();\r\n //Confirm the overlay is working to the client\r\n io.emit('json');\r\n });\r\n });\r\n //Forget the Request\r\n req.end();\r\n}", "title": "" }, { "docid": "b3ce561970f1d274e6337b92fa649e5d", "score": "0.53914136", "text": "function setApiToken(token) {\n //console.warn(token)\n apiToken = token\n}", "title": "" }, { "docid": "f2e25a2f22a820381629217e48931bee", "score": "0.5387461", "text": "function attachToken(token) {\n //the attachToken function adds the token to EVERY ajax request\n $.ajaxSetup({\n headers: {\n Authorization: \"Bearer \" + token\n }\n });\n}", "title": "" }, { "docid": "0ab7be872cba64b1b593909c30fdc54c", "score": "0.53714806", "text": "_jwtTokenFired(e) {\n this.jwt = e.detail;\n store.jwt = this.jwt;\n if (store.cmsSiteEditor && store.cmsSiteEditor.instance) {\n store.cmsSiteEditor.instance.jwt = this.jwt;\n }\n }", "title": "" }, { "docid": "c65b6da866d6d4a2c9db9a6f39e600fe", "score": "0.536847", "text": "addBearerToken(req) {\n // Only add token if req host is relative or matches the oauth url host\n if(this.matchHost(req.url)) {\n // Validate the token before using it\n return this.validateToken().then(()=>{\n if(this.authorizationHeader) {\n return req.header('Authorization', this.authorizationHeader);\n }\n }).catch(err=>{\n // On validation errors just continue with the request\n return req;\n });\n }\n }", "title": "" }, { "docid": "88c9dfd27ee431c76cd0e0aa396efca0", "score": "0.53645456", "text": "authToken (state, token) {\n state.authToken = token\n }", "title": "" }, { "docid": "dc8f899e0d38c9b8c2549a7675c6cd8c", "score": "0.53492546", "text": "setLoginCred(state, payload) {\n state.token = payload.token;\n state.user = payload.user;\n state.isAuthenticated = true;\n axios.defaults.headers.common['Authorization'] = 'Bearer ' + payload.token\n }", "title": "" }, { "docid": "cf4a2dc99cc733880fa386ebd5cd578f", "score": "0.53452384", "text": "login(username = \"root\", password = \"\") {\n return this.request({\n method: \"POST\",\n path: \"/_open/auth\",\n body: { username, password },\n }, (res) => {\n this.useBearerAuth(res.body.jwt);\n return res.body.jwt;\n });\n }", "title": "" }, { "docid": "3f87dc3eaaf7490dfb02b26785ccef9e", "score": "0.53419775", "text": "function addToken(token, opts) {\n if (!token) throw new Error('API needs token');\n return _objectSpread(_objectSpread({}, opts), {}, {\n headers: _objectSpread(_objectSpread({}, opts.headers), {}, {\n Authorization: \"Bearer \".concat(token)\n })\n });\n} // common fetch response handling", "title": "" }, { "docid": "106a1de495fc99d72bb5384676d0a3e2", "score": "0.52935934", "text": "useBearerAuth(token) {\n this._connection.setBearerAuth({ token });\n return this;\n }", "title": "" }, { "docid": "21325ada1dae43aa84aee64744899ea8", "score": "0.52908427", "text": "authorizationHeader() {\n if (!this.props.keycloak) return {};\n return {\n headers: {\n \"Authorization\": \"Bearer \" + this.props.keycloak.token,\n }\n };\n }", "title": "" }, { "docid": "21325ada1dae43aa84aee64744899ea8", "score": "0.52908427", "text": "authorizationHeader() {\n if (!this.props.keycloak) return {};\n return {\n headers: {\n \"Authorization\": \"Bearer \" + this.props.keycloak.token,\n }\n };\n }", "title": "" }, { "docid": "2afa22f01f23588a15e8ac8d39e238f1", "score": "0.5289571", "text": "constructor({ token = null, apiKey = null }) {\n this.token = token;\n this.apiKey = apiKey;\n }", "title": "" }, { "docid": "c846b55d8152e60adb1b43ac189580d9", "score": "0.52866524", "text": "function swagger(done) {\r\n resolve('../rosaenlg-server-toolkit/src/swagger/openApiDocumentation.json').then(\r\n function (res) {\r\n const swag = res.resolved;\r\n // dynamically add version\r\n swag.info.version = version;\r\n // and change what is specific to lambda\r\n swag.info.description = 'API over the Natural Language Generation library RosaeNLG, on AWS lambda.';\r\n delete swag.paths['/templates/render'];\r\n delete swag.paths['/templates/{templateId}/reload'];\r\n delete swag.paths['/health'];\r\n // add language in the path\r\n const languageInpath = {\r\n name: 'language',\r\n in: 'path',\r\n schema: {\r\n type: 'string',\r\n enum: ['fr_FR', 'de_DE', 'it_IT', 'en_US', 'es_ES', 'OTHER'],\r\n },\r\n example: 'fr_FR',\r\n required: true,\r\n description: 'language',\r\n };\r\n // for render\r\n const render = swag.paths['/templates/{templateId}/{templateSha1}/render'];\r\n delete swag.paths['/templates/{templateId}/{templateSha1}/render'];\r\n swag.paths[`/templates/{language}/{templateId}/{templateSha1}`] = render;\r\n render.post.parameters.unshift(languageInpath);\r\n // for create\r\n const create = swag.paths['/templates'].put;\r\n delete swag.paths['/templates'].put;\r\n swag.paths['/templates/{language}'] = {\r\n put: create,\r\n };\r\n create.parameters.unshift(languageInpath);\r\n\r\n // add server info\r\n swag.servers = [\r\n {\r\n url: 'https://' + swaggerProps.dev.domainName,\r\n description: 'development version on AWS Lambda',\r\n },\r\n {\r\n url: 'https://' + swaggerProps.prod.domainName,\r\n description: 'prod version on AWS Lambda',\r\n },\r\n ];\r\n\r\n // oauth\r\n swag.components.securitySchemes = {\r\n auth0: {\r\n type: 'oauth2',\r\n description:\r\n \"oauth2 using auth0, machine to machine. \\n\\n Don't use *scope*, but add *audience* in the token request.\",\r\n flows: {\r\n clientCredentials: {\r\n tokenUrl: swaggerProps.misc.tokenUrl, // is same on dev and prod\r\n 'x-audience-dev': swaggerProps.dev.audience,\r\n 'x-audience-prod': swaggerProps.prod.audience,\r\n },\r\n },\r\n },\r\n rapidApi: {\r\n type: 'apiKey',\r\n description: 'using secret key RapidAPI-Proxy-Secret in header (when called by RapidAPI)',\r\n name: 'RapidAPI-Proxy-Secret',\r\n in: 'header',\r\n },\r\n };\r\n\r\n swag.security = [\r\n {\r\n auth0: [],\r\n rapidApi: [],\r\n },\r\n ];\r\n\r\n // espace non ASCII, as AWS doc does not like them raw?\r\n let swagAsString = JSON.stringify(swag);\r\n swagAsString = swagAsString.replace(/[\\u007F-\\uFFFF]/g, function (chr) {\r\n return '\\\\u' + ('0000' + chr.charCodeAt(0).toString(16)).substr(-4);\r\n });\r\n\r\n fs.writeFileSync('dist/openApiDocumentation_merged.json', swagAsString, 'utf8');\r\n },\r\n function (err) {\r\n console.log(err.stack);\r\n },\r\n );\r\n done();\r\n}", "title": "" }, { "docid": "4af41388184ae7c35f371b70428cf2af", "score": "0.52796173", "text": "setToken () {\n return this.sendRequest({\n get_token: 'get_token'\n }).then(res => {\n this._token = res.token\n this.tokenTimestamp = moment()\n })\n }", "title": "" }, { "docid": "759e219079436caf884e5741804c8dbc", "score": "0.52579165", "text": "function buildTokenRequest(reqPath, reqBody, callProperties, callback) {\n const origin = `${id}-connectorRest-buildTokenRequest`;\n log.trace(origin);\n\n try {\n let tokenSchema = null;\n\n try {\n // Get the token schema from the file system\n tokenSchema = propUtilInst.getEntitySchema('.system', 'getToken');\n log.debug(`${origin}: Using action and schema for token information`);\n } catch (ex) {\n // Token schema is not required (could be defined in\n // properties so ignore the exception!!!\n log.debug(`${origin}: Using adapter properties for token information`);\n }\n\n // prepare the additional headers we received\n let thisAHdata = null;\n\n if (tokenSchema) {\n thisAHdata = transUtilInst.mergeObjects(thisAHdata, tokenSchema.headers);\n }\n if (globalRequest) {\n thisAHdata = transUtilInst.mergeObjects(thisAHdata, globalRequest.addlHeaders);\n }\n\n // set up the right credentials - passed in overrides default\n let useUser = username;\n let usePass = password;\n\n if (callProperties && callProperties.authentication && callProperties.authentication.username) {\n useUser = callProperties.authentication.username;\n }\n if (callProperties && callProperties.authentication && callProperties.authentication.password) {\n usePass = callProperties.authentication.password;\n }\n\n // if no header data passed in create empty - will add data below\n if (!thisAHdata) {\n thisAHdata = {};\n } else {\n const hKeys = Object.keys(thisAHdata);\n\n for (let h = 0; h < hKeys.length; h += 1) {\n let tempStr = thisAHdata[hKeys[h]];\n\n // replace username variable\n if (tempStr.indexOf('{username}') >= 0) {\n tempStr = tempStr.replace('{username}', useUser);\n }\n // replace password variable\n if (tempStr.indexOf('{password}') >= 0) {\n tempStr = tempStr.replace('{password}', usePass);\n }\n thisAHdata[hKeys[h]] = tempStr;\n\n // handle any base64 encoding required on the authStr\n if (thisAHdata[hKeys[h]].indexOf('{b64}') >= 0) {\n // get the range to be encoded\n const sIndex = thisAHdata[hKeys[h]].indexOf('{b64}');\n const eIndex = thisAHdata[hKeys[h]].indexOf('{/b64}');\n\n // if start but no end - return an error\n if (sIndex >= 0 && eIndex < sIndex + 5) {\n const errorObj = transUtilInst.formatErrorObject(origin, 'Unable To Encode', [thisAHdata[hKeys[h]]], null, null, null);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n\n // get the string to be encoded\n const bufString = thisAHdata[hKeys[h]].substring(sIndex + 5, eIndex);\n\n // encode the string\n const encString = Buffer.from(bufString).toString('base64');\n let tempAuthStr = '';\n\n // build the new auth field with the encoded string\n if (sIndex > 0) {\n // add the start of the string that did not need encoding\n tempAuthStr = thisAHdata[hKeys[h]].substring(0, sIndex);\n }\n // add the encoded string\n tempAuthStr += encString;\n if (eIndex + 5 < thisAHdata[hKeys[h]].length) {\n // add the end of the string that did not need encoding\n tempAuthStr += thisAHdata[hKeys[h]].substring(eIndex + 6);\n }\n\n // put the temp string into the auth string we will add to the request\n thisAHdata[hKeys[h]] = tempAuthStr;\n }\n }\n }\n\n // set the Content Type headers based on the type of request data for the call\n if (thisAHdata['Content-Type'] === undefined || thisAHdata['Content-Type'] === null) {\n if (tokenSchema && tokenSchema.requestDatatype && tokenSchema.requestDatatype.toUpperCase() === 'PLAIN') {\n // add the Plain headers if they were not set already\n thisAHdata['Content-Type'] = 'text/plain';\n } else if (tokenSchema && tokenSchema.requestDatatype && tokenSchema.requestDatatype.toUpperCase() === 'XML') {\n // add the XML headers if they were not set already\n thisAHdata['Content-Type'] = 'application/xml';\n } else if (tokenSchema && tokenSchema.requestDatatype && tokenSchema.requestDatatype.toUpperCase() === 'URLENCODE') {\n // add the URLENCODE headers if they were not set already\n thisAHdata['Content-Type'] = 'application/x-www-form-urlencoded';\n } else {\n // add the JSON headers if they were not set already\n thisAHdata['Content-Type'] = 'application/json';\n }\n }\n // set the Accept headers based on the type of response data for the call\n if (thisAHdata.Accept === undefined || thisAHdata.Accept === null) {\n if (tokenSchema && tokenSchema.responseDatatype && tokenSchema.responseDatatype.toUpperCase() === 'PLAIN') {\n // add the Plain headers if they were not set already\n thisAHdata.Accept = 'text/plain';\n } else if (tokenSchema && tokenSchema.responseDatatype && tokenSchema.responseDatatype.toUpperCase() === 'XML') {\n // add the XML headers if they were not set already\n thisAHdata.Accept = 'application/xml';\n } else if (tokenSchema && tokenSchema.responseDatatype && tokenSchema.responseDatatype.toUpperCase() === 'URLENCODE') {\n // add the URLENCODE headers if they were not set already\n thisAHdata.Accept = 'application/x-www-form-urlencoded';\n } else {\n // add the JSON headers if they were not set already\n thisAHdata.Accept = 'application/json';\n }\n }\n\n if (thisAHdata.Accept === '') {\n delete thisAHdata.Accept;\n }\n if (thisAHdata['Content-Type'] === '') {\n delete thisAHdata['Content-Type'];\n }\n\n // set up the options for the call to get incidents - default is all\n const options = {\n hostname: host,\n port,\n path: tokenPath,\n method: 'POST',\n headers: thisAHdata\n };\n\n // passed in properties override defaults\n if (callProperties && callProperties.host) {\n options.hostname = callProperties.host;\n }\n if (callProperties && callProperties.port) {\n options.port = callProperties.port;\n }\n\n // specific token properties override everything (Single Sign On System)\n if (tokenSchema.sso && tokenSchema.sso.host) {\n options.hostname = tokenSchema.sso.host;\n }\n if (tokenSchema.sso && tokenSchema.sso.port) {\n options.port = tokenSchema.sso.port;\n }\n\n // If there is a token schema, need to take the data from there\n if (tokenSchema) {\n options.path = tokenSchema.entitypath;\n options.method = tokenSchema.method;\n }\n\n // if the path has a base path parameter in it, need to replace it\n let bpathStr = '{base_path}';\n if (options.path.indexOf(bpathStr) >= 0) {\n // be able to support this if the base path has a slash before it or not\n if (options.path.indexOf('/{base_path}') >= 0) {\n bpathStr = '/{base_path}';\n }\n\n // replace with base path if we have one, otherwise remove base path\n if (callProperties && callProperties.base_path) {\n // if no leading /, insert one\n if (callProperties.base_path.indexOf('/') !== 0) {\n options.path = options.path.replace(bpathStr, `/${callProperties.base_path}`);\n } else {\n options.path = options.path.replace(bpathStr, callProperties.base_path);\n }\n } else if (basepath) {\n // if no leading /, insert one\n if (basepath.indexOf('/') !== 0) {\n options.path = options.path.replace(bpathStr, `/${basepath}`);\n } else {\n options.path = options.path.replace(bpathStr, basepath);\n }\n } else {\n options.path = options.path.replace(bpathStr, '');\n }\n }\n\n // if the path has a version parameter in it, need to replace it\n let versStr = '{version}';\n if (options.path.indexOf(versStr) >= 0) {\n // be able to support this if the version has a slash before it or not\n if (options.path.indexOf('/{version}') >= 0) {\n versStr = '/{version}';\n }\n\n // replace with version if we have one, otherwise remove version\n if (callProperties && callProperties.version) {\n options.path = options.path.replace(versStr, `/${encodeURIComponent(callProperties.version)}`);\n } else if (version) {\n options.path = options.path.replace(versStr, `/${encodeURIComponent(version)}`);\n } else {\n options.path = options.path.replace(versStr, '');\n }\n }\n\n // if there are URI path variables that have been provided, need to add\n // them to the path\n if (reqBody && reqBody.uriPathVars && reqBody.uriPathVars.length > 0) {\n for (let p = 0; p < reqBody.uriPathVars.length; p += 1) {\n const vnum = p + 1;\n const holder = `pathv${vnum.toString()}`;\n const hindex = options.path.indexOf(holder);\n\n // if path variable is in the url, replace it!!!\n if (hindex >= 0 && reqBody.uriPathVars[p] !== null && reqBody.uriPathVars[p] !== '') {\n // with the provided id\n let idString = '';\n\n // check if the current URI path ends with a slash (may require\n // slash at end)\n if (options.path[hindex - 2] === '/' || options.path[hindex - 2] === ':') {\n // ends with a slash need to add slash to end\n idString = encodeURIComponent(reqBody.uriPathVars[p]);\n } else {\n // otherwise add / to start\n idString = '/';\n idString += encodeURIComponent(reqBody.uriPathVars[p]);\n }\n\n // replace the id in url with the id string\n options.path = options.path.replace(`{${holder}}`, idString);\n }\n }\n }\n\n // need to remove all of the remaining path holders from the URI\n while (options.path.indexOf('{pathv') >= 0) {\n let sIndex = options.path.indexOf('{pathv');\n const eIndex = options.path.indexOf('}', sIndex);\n\n // if there is a / before the {pathv} need to remove it\n if (options.path[sIndex - 1] === '/' || options.path[sIndex - 1] === ':') {\n sIndex -= 1;\n }\n\n if (sIndex > 0) {\n // add the start of the path\n let tempStr = options.path.substring(0, sIndex);\n\n if (eIndex < options.path.length) {\n // add the end of the path\n tempStr += options.path.substring(eIndex + 1);\n }\n\n options.path = tempStr;\n } else if (eIndex > 0 && eIndex < options.path.length) {\n // add the end of the path\n options.path = options.path.substring(eIndex + 1);\n } else {\n // should not get here - there is some issue in the uripath - missing\n // an end or the path is just {pathv#}\n // add the specific pieces of the error object\n const errorObj = this.transUtil.formatErrorObject(origin, 'Invalid Action File', ['missing entity path', '.system/getToken'], null, null, null);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n }\n\n // remove the path vars from the reqBody\n const actReqBody = Object.assign({}, reqBody);\n if (actReqBody && actReqBody.uriPathVars) {\n delete actReqBody.uriPathVars;\n }\n\n // if ssl enabled add the options for ssl\n if (callProperties && callProperties.ssl && Object.hasOwnProperty.call(callProperties.ssl, 'enabled')) {\n if (callProperties.ssl.enabled) {\n if (callProperties.ssl.accept_invalid_cert) {\n // if we are accepting invalid certificates (ok for lab not so much production)\n options.rejectUnauthorized = false;\n } else {\n // if we are not accepting invalid certs, need the ca file in the options\n try {\n options.rejectUnauthorized = true;\n options.ca = [fs.readFileSync(callProperties.ssl.ca_file)];\n } catch (e) {\n const errorObj = this.transUtil.formatErrorObject(origin, 'Missing File', [callProperties.ssl.ca_file], null, null, null);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n }\n\n if (callProperties.ssl.ciphers) {\n options.ciphers = callProperties.ssl.ciphers;\n }\n if (callProperties.ssl.secure_protocol) {\n options.secureProtocol = callProperties.ssl.secure_protocol;\n }\n\n log.info(`${origin}: Connector SSL connections enabled`);\n }\n } else if (sslEnabled) {\n if (sslAcceptInvalid) {\n // if we are accepting invalid certificates (ok for lab not so much production)\n options.rejectUnauthorized = false;\n } else {\n // if we are not accepting invalid certs, need the ca file in the options\n try {\n options.rejectUnauthorized = true;\n options.ca = [fs.readFileSync(sslCAFile)];\n } catch (e) {\n const errorObj = this.transUtil.formatErrorObject(origin, 'Missing File', [sslCAFile], null, null, null);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n // if there is a cert file, try to read in a cert file in the options\n if (sslCertFile) {\n try {\n options.cert = [fs.readFileSync(sslCertFile)];\n } catch (e) {\n const errorObj = this.transUtil.formatErrorObject(origin, 'Missing File', [sslCertFile], null, null, null);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n }\n // if there is a key file, try to read in a key file in the options\n if (sslKeyFile) {\n try {\n options.key = [fs.readFileSync(sslKeyFile)];\n } catch (e) {\n const errorObj = this.transUtil.formatErrorObject(origin, 'Missing File', [sslKeyFile], null, null, null);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n }\n }\n\n if (sslCiphers) {\n options.ciphers = sslCiphers;\n }\n if (secureProtocol) {\n options.secureProtocol = secureProtocol;\n }\n\n log.info(`${origin}: Connector SSL connections enabled`);\n }\n\n const reqData = {};\n let bodyString = null;\n\n // if we have been passed a schema and the Authorization is in a header\n if (tokenSchema && tokenSchema.headers && tokenSchema.headers.Authorization) {\n // request the token\n options.headers['Content-length'] = 0;\n return getToken(reqPath, options, tokenSchema, '', callProperties, callback);\n }\n if (tokenSchema) {\n // if this is a get, need to put the username on the url\n if (options.path.indexOf('/{username}') >= 0) {\n options.path = options.path.replace('/{username}', useUser);\n } else {\n options.path = options.path.replace('{username}', useUser);\n }\n\n // if this is a get, need to put the password on the url\n if (options.path.indexOf('/{password}') >= 0) {\n options.path = options.path.replace('/{password}', usePass);\n } else {\n options.path = options.path.replace('{password}', usePass);\n }\n\n // if this is not a get, need to add the info to the request\n if (options.method !== 'GET') {\n let creds = {\n username: useUser,\n password: usePass\n };\n\n // if there is body data to add to the token request body\n creds = transUtilInst.mergeObjects(actReqBody, creds);\n\n if (globalRequest) {\n creds = transUtilInst.mergeObjects(creds, globalRequest.authData);\n }\n\n // if there is body data to add to the token request body\n if (actReqBody) {\n const bodyKey = Object.keys(actReqBody);\n\n for (let k = 0; k < bodyKey.length; k += 1) {\n creds[bodyKey[k]] = actReqBody[bodyKey[k]];\n }\n }\n\n // map the data we received to an Entity - will get back the defaults\n const tokenEntity = transUtilInst.mapToOutboundEntity(creds, tokenSchema.requestSchema);\n bodyString = tokenEntity;\n\n // if it is JSON or URLENCODE need to put body into right format\n if (!tokenSchema.requestDatatype || tokenSchema.requestDatatype.toUpperCase() === 'JSON') {\n bodyString = JSON.stringify(tokenEntity);\n } else if (tokenSchema.requestDatatype && tokenSchema.requestDatatype.toUpperCase() === 'URLENCODE') {\n bodyString = querystring.stringify(tokenEntity);\n }\n\n // if there is a body, set the content length of the body and add it to\n // the header\n if (Object.keys(tokenEntity).length > 0) {\n options.headers['Content-length'] = Buffer.byteLength(bodyString);\n }\n\n // request the token\n return getToken(reqPath, options, tokenSchema, bodyString, callProperties, callback);\n }\n } else {\n // set the user and password for the token request\n reqData[tokenUserField] = useUser;\n reqData[tokenPwdField] = usePass;\n bodyString = reqData;\n\n // since not a get call, convert reqData to a string and add length\n bodyString = JSON.stringify(reqData);\n options.headers['Content-length'] = Buffer.byteLength(bodyString);\n }\n\n // request the token\n return getToken(reqPath, options, tokenSchema, bodyString, callProperties, callback);\n } catch (e) {\n // handle any exception\n const errorObj = transUtilInst.checkAndReturn(e, origin, 'Issue requesting token');\n return callback(null, errorObj);\n }\n}", "title": "" }, { "docid": "e1b310df31f8f1482d3bc4d264c04614", "score": "0.5238419", "text": "setJwt(data) {\n this.jwt = data;\n this.tokenService.setToken(data);\n }", "title": "" }, { "docid": "a3939e0b9232b56b213a359e8c918ccb", "score": "0.5217542", "text": "updateEchoHeaders()\n {\n this.echo.connector.options.auth.headers['Authorization'] = `Bearer ` +\n (new Token).getAccessToken();\n }", "title": "" }, { "docid": "4f663b03d54e6517e3e1345c306b237d", "score": "0.5215406", "text": "loadJWTStratergy(passport) {\n let opts = {};\n opts.jwtFromRequest = ExtractJwt.fromAuthHeader(); // Set with Authorization key\n opts.secretOrKey = \"nosecret\";\n passport.use(new JwtStrategy(opts, (jwtPayload, done) => {\n // If the token is valid then this call back will be invoked. We can just pass the user payload\n log.info(\"Authservice::Passed token is valid. User is \" + JSON.stringify(jwtPayload));\n return done(null, jwtPayload);\n }));\n }", "title": "" }, { "docid": "9c1b8ad87a1f4bc5c91cac0fd15a0b75", "score": "0.5208461", "text": "function authorize(token) {\n if (token) {\n api.defaults.headers.Authorization = `Bearer ${token}`\n localStorage.setItem(TOKEN_KEY, token)\n }\n}", "title": "" }, { "docid": "5c0ef7022af6cf26258158d7b03978fd", "score": "0.5195766", "text": "_requestToken () {\n const {\n baseUrl,\n clientId: client_id,\n clientSecret: client_secret\n } = this._config;\n\n return request ({\n method: 'POST',\n baseUrl,\n url: '/oauth2/token',\n json: true,\n body: {\n grant_type: 'client_credentials',\n client_id,\n client_secret\n }\n });\n }", "title": "" }, { "docid": "0cd8364ad9afecf89c61bde83b087b9d", "score": "0.5191246", "text": "createToken(req, res, next) {\n jwt.sign(\n {\n user: res.locals.newTokenData\n },\n process.env.SECRET,\n {\n expiresIn: \"1h\"\n },\n (err, jwt) => {\n if (err) console.error('Error in TokenService.createToken:', err);\n res.locals.token = jwt;\n next();\n }\n );\n }", "title": "" }, { "docid": "4d81a3d8a2df2c3b31896d52db53c5f4", "score": "0.5190777", "text": "setAuthHeader(config) {\n const { token } = this.store.state.auth;\n\n config.headers['Authorization'] = `Bearer ${token}`;\n }", "title": "" }, { "docid": "dca6a92c1b45debfcfd2cd52f5c42584", "score": "0.5176342", "text": "function setOAuthToken(token) {\n oauth_token = token\n}", "title": "" }, { "docid": "58471ca9a6edd09f042f9ad2a422e877", "score": "0.51613843", "text": "static registerConfiguration(endpoint, authToken) {\n buildEndpoint = endpoint;\n buildAuthToken = authToken;\n }", "title": "" }, { "docid": "0a451289962d7a97b665bd3bc1eb949a", "score": "0.5161262", "text": "authenticate() {\n return (ctx, next) => {\n const request = new Request(ctx.request);\n const response = new Response(ctx.response);\n\n return this.server.authenticate(request, response)\n .then((token) => {\n ctx.state.oauth = { token };\n return next();\n })\n .catch((err) => { handleError(err, ctx); });\n };\n }", "title": "" }, { "docid": "551abbccf2fce560f7eba47ec9d6f63b", "score": "0.5149292", "text": "handleJWT_() {\n // if token exists, login was successful\n if (this.token_) {\n const {photos, id} = JSON.parse(window.atob(this.token_.split(\".\")[1]));\n\n updateStore({\n action: actions.AUTHENTICATION,\n data: {signedIn: true, avatar: photos[0].value, id},\n });\n }\n }", "title": "" }, { "docid": "80721d1bd4d5f6d8e7f360334a4f7dda", "score": "0.51487124", "text": "static async authJWTRequest(token = \"\") {\n try {\n let result = null;\n if (AUTH_WITH_SERVER !== ACTIVE_KEY) {\n // Not auth with server\n const arrStr = token.split(\".\");\n if (arrStr.length !== 3) {\n throw { response: { status: HttpStatus.FORBIDDEN } };\n }\n result = arrStr[1].deBase64();\n result = JSON.parse(result);\n if (result.user && result.user.client_uuid) {\n result.client_uuid = result.user.client_uuid;\n }\n } else {\n const reqOpt = {\n method : \"get\",\n url: Configs.AUTH_SERVER + EndPoint.GET_INFO_USER,\n headers: {\n [HeaderFile.TOKEN_FEILD]: token\n }\n };\n const resAPi = await Utils.requestAPI(reqOpt);\n result = resAPi && resAPi.data && resAPi.data.data ? resAPi.data.data : {}\n }\n return result;\n } catch (ex) {\n throw ex;\n }\n }", "title": "" }, { "docid": "a4d0964cad344e8288e37b11db9787cf", "score": "0.51391745", "text": "saveToken(jwt){\n localStorage.setItem('conferoo_user_token', jwt);\n }", "title": "" }, { "docid": "78d70beea5b644a32781b8f95f5f36d2", "score": "0.5118728", "text": "function getHelloJWT(token, cb){\n //Prepare Request Setting Bearer Token\n var helloJWTOpts = {\n host: 'localhost',\n port: 8244,\n path: '/hellojwt/1.0',\n method: 'GET',\n headers: {\n 'Authorization' : 'Bearer ' + tokenObj.access_token\n }\n };\n \n https.get(helloJWTOpts, function(res){\n res.setEncoding('utf8');\n console.log('Response Status Code: ' + res.statusCode);\n //Cannot find/read header x-jwt-assertion from API manager\n storeJWT(res.headers['x-jwt']);\n console.log('Header x-jwt: ' + JSON.stringify(jwt, null, 4)); //can read the jwt set by the backend\n var content = '';\n res.on('data', function(chunk){\n content += chunk;\n }).on('end', function(){\n cb();\n });\n }).on('error', function(err){\n console.log('Received Error: ' + err.message);\n });\n}", "title": "" }, { "docid": "65a4980c6ef3aa21484cad5066807227", "score": "0.51159084", "text": "getAuthToken () {\n return this.accessToken\n }", "title": "" }, { "docid": "bb12ffcadd6c40a386be7e069fec79eb", "score": "0.51147616", "text": "pack(payload) {\n return jwt.encode(payload, JWT_SECRET);\n }", "title": "" }, { "docid": "93ed8fcac0dc51fb17c83cf49848e138", "score": "0.50925654", "text": "async generateToken(context) {\n let base64 = require(\"base-64\");\n const spotifyData = await fetch(\n \"https://accounts.spotify.com/api/token\",\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n Authorization: `Basic ${base64.encode(\n `${process.env.VUE_APP_SPOTIFYUSER}:${process.env.VUE_APP_SPOTIFYPASSWORD}`\n )}`\n },\n body: \"grant_type=client_credentials\"\n }\n );\n let tokenObject = await spotifyData.json();\n if (tokenObject.access_token) {\n context.commit(\"changeToken\", tokenObject.access_token);\n }\n }", "title": "" }, { "docid": "875667d516b0571e0c18e480666607cd", "score": "0.5092526", "text": "webUIJWTmiddleware() {\n return (req: $RequestExtend, res: $Response, _next: NextFunction) => {\n if (_.isNull(req.remote_user) === false && _.isNil(req.remote_user.name) === false) {\n return _next();\n }\n\n req.pause();\n const next = () => {\n req.resume();\n return _next();\n };\n\n const token = (req.headers.authorization || '').replace(`${TOKEN_BEARER} `, '');\n if (!token) {\n return next();\n }\n\n let decoded;\n try {\n decoded = this.decode_token(token);\n } catch (err) {\n // FIXME: intended behaviour, do we want it?\n }\n\n if (decoded) {\n req.remote_user = authenticatedUser(decoded.user, decoded.group);\n } else {\n req.remote_user = buildAnonymousUser();\n }\n\n next();\n };\n }", "title": "" }, { "docid": "cfaaccb0ad05415594b70b83e20c65f3", "score": "0.5086009", "text": "function restricted(req, res, next) {\n const token = req.headers.authorization;\n\n if(token) {\n jwt.verify(token, envSecret, (error, decodedToken) => {\n req.jwtPayload = decodedToken;\n console.log('decodedToken', decodedToken);\n\n if(error) {\n return res.status(401).json({ message: 'Please log in.' })\n }\n\n next();\n })\n } else {\n res.status(401).json({ message: 'Please log in.' })\n }\n}", "title": "" }, { "docid": "a1187e7bd3fdb8ea528f73f8386eae82", "score": "0.50812936", "text": "async function addAuthToRequest(jwtHandler, authentication, config) {\n if (!jwtHandler || authentication) return;\n\n const authRequestConfig = await jwtHandler.getAccessTokenForRequest();\n config.headers = Object.assign(config.headers || {}, authRequestConfig.headers);\n if (authRequestConfig.data) config.data = Object.assign(config.data || {}, authRequestConfig.data);\n}", "title": "" }, { "docid": "9196c4e5e3f469830277284cf6dea971", "score": "0.5076268", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }", "title": "" }, { "docid": "9196c4e5e3f469830277284cf6dea971", "score": "0.5076268", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }", "title": "" }, { "docid": "9196c4e5e3f469830277284cf6dea971", "score": "0.5076268", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }", "title": "" }, { "docid": "9196c4e5e3f469830277284cf6dea971", "score": "0.5076268", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }", "title": "" }, { "docid": "636324cdcadb7ef9fc6602ddbe24ea60", "score": "0.50659865", "text": "async getAuthToken() {\n const getTokenUrl = \"https://id.twitch.tv/oauth2/token\";\n\n try {\n const tokenResponse = await axios.post(getTokenUrl, null, { \n params: {\n client_id: this.clientId,\n client_secret: this.clientSecret,\n grant_type: \"client_credentials\"\n }\n\n });\n\n this.authToken = new AuthToken(tokenResponse.data.access_token, tokenResponse.data.expires_in);\n\n console.log('API Response:', tokenResponse.data);\n } \n\n catch(error) {\n console.log(error.response);\n }\n }", "title": "" }, { "docid": "0239c2ba5decd07649c7f5686a5086cf", "score": "0.50658804", "text": "function ensureToken(req, res, next) {\n const bearerHeader = req.headers['authorization'];\n console.log(bearerHeader);\n if (typeof bearerHeader !== 'undefined') {\n const bearer = bearerHeader.split(\" \");\n const bearerToken = bearer[1];\n req.token = bearerToken;\n next();\n } else {\n res.sendStatus(403)\n };\n}", "title": "" }, { "docid": "12683cf684a8ac65082c18a65f207331", "score": "0.5034754", "text": "authorize(refreshToken, accessToken) {\n this.tokens = { ...this.tokens, refreshToken, accessToken };\n }", "title": "" }, { "docid": "e6b124363762a460200c3ee3eee1d4c4", "score": "0.5032688", "text": "setHttpAccessToken(token){\n this.token = token;\n }", "title": "" }, { "docid": "5a14b90db4f39bd32ea150b5db0cb83b", "score": "0.50147384", "text": "async function authenticate(req, res, next) {\n try {\n const jwtPayload = decodeJwtToken(req);\n const user = await getUserPayload(jwtPayload);\n\n req.token = jwtPayload.token;\n req.user = user;\n\n next();\n } catch (e) {\n return error(res, { code: 401, message: e.message });\n }\n}", "title": "" }, { "docid": "b23bcaa782993f9c31418767077209bd", "score": "0.49980173", "text": "async generateNewToken(req, res, next) {\n const token = generateJwt(req.user.id, req.user.email, req.user.role)\n return res.json({token})\n }", "title": "" }, { "docid": "08411bb415bf4aacdac3d80bd54da8bc", "score": "0.4996013", "text": "function authJwt() {\n console.log(\"im in authRequired***********\");\n return expressJwt({\n secret,\n algorithms: ['HS256'],\n isRevoked: isRevoked\n }).unless({\n path: [\n {url: /\\/public\\/uploads(.*)/, methods: [\"GET\", \"OPTIONS\"]},\n {url: /\\/api\\/v1\\/products(.*)/, methods: [\"GET\", \"OPTIONS\"]},\n {url: /\\/api\\/v1\\/categories(.*)/, methods: [\"GET\", \"OPTIONS\"]},\n \"/api/v1/users/login\",\n \"/api/v1/users/register\"\n ]\n });\n}", "title": "" }, { "docid": "7c470d01147aa4259b753a594e99f962", "score": "0.49949816", "text": "get apiToken () {\n return this._apiToken\n }", "title": "" }, { "docid": "e2b1053410fe3d82bebc1144ca5f55d3", "score": "0.49908203", "text": "function getToken(req, res, next) {\n var results = {\n success: 1,\n token: \"\",\n description: \"Get token success.\"\n }\n\n var userName = req.swagger.params[\"payload\"].value.userName;\n var userPassword = req.swagger.params[\"payload\"].value.userPassword;\n console.log(userName);\n UserModel.findToken(userName, getMD5(userPassword), function (token) {\n console.log(token);\n if (token != -1) {\n results.token = token;\n res.json(results);\n } else {\n results.success = 0;\n results.description = \"Cannot get token.\";\n res.json(results);\n }\n });\n}", "title": "" }, { "docid": "db2aa38fa2e7388ebb3bc9ad58280caf", "score": "0.49892884", "text": "_createRequestHeaders(jwt) {\n const headers = Object.assign({}, this.headers);\n headers['Authorization'] = `Bearer ${jwt}`;\n return headers;\n }", "title": "" }, { "docid": "053fdb519e37f27fc60adb94c21d1947", "score": "0.4983372", "text": "getAuthHeader () {\n return {\n 'Authorization': 'JWT ' + localStorage.getItem('access_token')\n }\n }", "title": "" }, { "docid": "ec24b961f9d8d4fa48a83bdfbdfa8eeb", "score": "0.49812806", "text": "constructor() {\n this.cfg = config.get('jwtConfig');\n this.dbProperties = config.get('dbProperties');\n this.corsOpts = {\n origin: '*',\n methods: ['GET', 'POST', 'PUT', 'DELETE'],\n allowedHeaders: ['Authorization', 'Content-Type', 'Access-Control-Allow-Origin']\n };\n this.express = express();\n this.setEnvironment();\n this.database();\n this.middleware();\n this.routes();\n }", "title": "" }, { "docid": "1a192e9e91cb8239d752bc73d891291c", "score": "0.49695086", "text": "function updateToken() {\n authResponse = user.getAuthResponse(true);\n oauthToken = authResponse.access_token;\n}", "title": "" }, { "docid": "9ed1c7fc64305e716e4f9c99476176d1", "score": "0.49656272", "text": "function getToken(jws,c) {\n var basicData = c.clientid + ':' + c.secret;\n var authorization = \"Basic \" + JSRSA.utf8tob64(basicData);\n\n // request options set here\n var options = {\n uri: \"https://api.svfcloud.com/oauth2/token\",\n \t headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n\t 'Authorization': authorization\n\t },\n\t form: {\n\t grant_type:'urn:ietf:params:oauth:grant-type:jwt-bearer',\n\t assertion:jws\n }\n };\n\n // execute request\n request.post(options, function(error,response, body){\n if (!error) {\n\t token = body;\n\t } else {\n\t _this.error(error);\n\t }\n\t afterFunc(); //print phase\n });\n }", "title": "" }, { "docid": "c48dcaa7e8013ad24abbe75bcbe8754d", "score": "0.49614966", "text": "setHeader() {\n Vue.axios.defaults.headers.common[\n \"Authorization\"\n ] = `Bearer ${TokenService.getToken()}`;\n }", "title": "" }, { "docid": "24d1577de8d29837ce2f3d4f37886acf", "score": "0.49476844", "text": "function authenticationRequired(req, res, next) {\n const authHeader = req.headers.authorization || '';\n const match = authHeader.match(/Bearer (.+)/);\n\n if (!match) {\n return res.status(401).end();\n }\n\n const accessToken = match[1];\n const expectedAudience = '0oa13rvul8MFlTv6I357';\n return request.post({\n url: 'https://cpwnweqcs1.cepheid.pri:44316/sap/bc/sec/oauth2/authorize?response_type=code&client_id=TT-MPOWER&redirect_uri=http://localhost:3000/redirect&scope=ZQTC_EQUIPMENT_SRV_0001&state=anystate',\n json: true\n }, function (error, response, body) {\n console.log(response);\n next();\n });\n // return oktaJwtVerifier.verifyAccessToken(accessToken)\n // .then((jwt) => {\n // console.log(jwt)\n // req.jwt = jwt;\n // next();\n // })\n // .catch((err) => {\n // console.log(err);\n // res.status(401).send(\"un authorized\");\n // });\n}", "title": "" }, { "docid": "df7c48210aadadf41737d95369812c84", "score": "0.49448645", "text": "function getClientAuthToken() {\n const options = {\n url: \"https://id.twitch.tv/oauth2/token\",\n method: \"POST\",\n params: {\n client_id: process.env.TWITCH_CLIENT_ID,\n client_secret: process.env.TWITCH_CLIENT_SECRET,\n grant_type: \"client_credentials\",\n },\n };\n\n axios(options)\n .then(function (response) {\n // Save client Auth Token\n clientAuthToken = response.data.access_token;\n // TODO: This can be cached or better handled\n // instead of autheticating every load\n\n // Get channels subscribeds to have a list of\n // channels to broadcast\n getChannelsSubscribed();\n\n // Connect to chat to broadcast the commands\n connectChat();\n })\n .catch(logRequestError);\n}", "title": "" }, { "docid": "2a0e3b48d3f35874e3539a94ccd6b43f", "score": "0.49423614", "text": "performLogin(req, res, next) {\n const body = { expiresAt: dateConverter.addDays({ count: 1, format: 'X' }).split('.')[0], userId: req.user._id.toString() };\n validator.buildParams({ input: body, schema: this.jsonSchema.postSchema })\n .then(input => validator.validate({ input, schema: this.jsonSchema.postSchema }))\n .then(input => this.model.createAccessLog(input))\n .then(input => this.model.createJwtToken(input))\n .then((result) => {\n const userData = serializer.serialize(req.user, { type: 'user' });\n const loginData = serializer.serialize(result, { type: 'token' });\n loginData.includes = [userData];\n return res.send(loginData);\n })\n .catch(error => next(error));\n }", "title": "" }, { "docid": "df770273f20bf4f7d47272d9ab04c5b9", "score": "0.49322557", "text": "constructor() {\n this.middleware = () => {\n this.express.use(bodyParser.json());\n this.express.use(bodyParser.urlencoded({ extended: false }));\n this.express.use(methodOverride());\n };\n //rutas fuera del control del token\n this.routesOutOfTokenControl = () => {\n this.express.use('/api/authentication', AuthenticationRouter_1.default);\n };\n this.middlewareTokenControl = () => {\n var apiRoutes = express.Router();\n apiRoutes.use((req, res, next) => {\n // check header or url parameters or post parameters for token\n var token = req.body.token || req.query.token || req.headers['x-access-token'];\n // decode token\n if (token) {\n try {\n //shhhhh es el supersecret\n const decoded = jsonwebtoken_1.verify(token, process.env.jsonwebtoken_super_secret);\n //req.decoded = decoded; //¿¿??\n next();\n }\n catch (err) {\n if (err instanceof jsonwebtoken_1.TokenExpiredError) {\n return res.status(419).send({\n success: false,\n message: 'Failed to authenticate token.',\n desc: err.message\n });\n }\n else {\n return res.status(401).send({\n success: false,\n message: 'Failed to authenticate token.',\n desc: err.message\n });\n }\n }\n }\n else {\n // if there is no token\n // return an error\n return res.status(401).send({\n success: false,\n message: 'No token provided.'\n });\n }\n });\n this.express.use('/api', apiRoutes);\n };\n // Configure API endpoints.\n this.routes = () => {\n /* This is just to get up and running, and to make sure what we've got is\n * working so far. This function will change when we start to add more\n * API endpoints */\n // let router = express.Router();\n // // placeholder route handler\n // router.get('/', (req, res, next) => {\n // res.json({\n // message: 'Hello World!'\n // });\n // });\n // this.express.use('/', router);\n //aqui se va cargando cada router para el api\n //this.express.use('/api/heroes', HeroRouter);\n //this.express.use('/api', ApiRouter);\n };\n this.express = express();\n this.middleware();\n this.routesOutOfTokenControl();\n this.middlewareTokenControl();\n this.routes();\n }", "title": "" }, { "docid": "dc10c065f5a3929a7c0b651315641ca5", "score": "0.49297848", "text": "function setOauthToken(token) {\n localStorage.setItem(\"otr.oauth.token\", token);\n}", "title": "" }, { "docid": "af477db3311154005e8c05ffcc0dd2c8", "score": "0.49285194", "text": "returnToken(context, credentials) {\n return new Promise((resolve, reject) => {\n let fd = new FormData();\n fd.append(\"username\", credentials.username);\n fd.append(\"password\", credentials.password);\n Api()\n .post(\"/token\", fd)\n .then((response) => {\n const token = response.data.access_token;\n console.log(response);\n\n localStorage.setItem(\"access_token\", token);\n context.commit(\"RETURN_TOKEN\", token);\n resolve(response);\n })\n .catch((error) => {\n console.log(error.response);\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "735e6f34e64fc714c8bb447d1bef02e7", "score": "0.49278137", "text": "function makeHeaderWithToken (token) {\n return {\n Authorization: `Bearer ${token}`,\n 'content-type': 'application/json'\n }\n}", "title": "" }, { "docid": "a684c36a806f0a15b96503b6e98942e9", "score": "0.49258545", "text": "generateToken(req,res,next){\n jwt.sign(\n payload,\n secretKey,\n (err, token) => {\n if (err) {\n res.send(\"something went wrong\");\n } else {\n next(token);\n }\n }\n );\n }", "title": "" }, { "docid": "d4851c1acca2e5b64e3643ac01231359", "score": "0.49250335", "text": "constructor() { \n \n TokenizeResponseSchema.initialize(this);\n }", "title": "" }, { "docid": "9aa60afbdc300e7e7366cd2e43843d45", "score": "0.49172676", "text": "requestHandler(request) {\n if (this.isHandlerEnabled(request)) {\n // Modify request here\n let tok = this.getActiveToken();\n request.headers['Authorization'] = `Bearer ${tok}`;\n }\n return request\n }", "title": "" }, { "docid": "e53408dec478ec86a69f7d7b64129add", "score": "0.49171022", "text": "function auth() {\n const opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderWithScheme('jwt'),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwtPayload, callback) => {\n const { _id } = jwtPayload;\n Users.findById(_id, (err, results) => {\n if (err) {\n return callback(err, false);\n }\n if (results) {\n return callback(null, results);\n }\n return callback(null, false);\n });\n }),\n );\n}", "title": "" }, { "docid": "8033b5153134bff00aab905db47e9cd4", "score": "0.49137783", "text": "function sendTokenHandler(options) {\n return function(request, reply) {\n var reqAdapter = {\n body: request.payload, // the body of the request is accessible via the payload\n method: request.method.toUpperCase() // hapi uses lower case methods\n };\n\n var response = {\n code: undefined,\n headers: {}\n };\n\n // Hapi does not support promise based middleware, so must build the request information and finish it\n function finishRequest() {\n const statusCode = response.code || resAdapter.statusCode;\n\n if (statusCode) {\n const finalResponse = reply.response(); // only execute our request when \"next\" is called\n finalResponse.statusCode = statusCode;\n Object.keys(response.headers).forEach(function(header) {\n finalResponse.header(header, response.headers[header]);\n });\n } else if (options.sendTokenSuccessHandler) {\n request.passwordless = reqAdapter.passwordless;\n options.sendTokenSuccessHandler(request, reply);\n } else {\n reply.continue();\n }\n }\n\n var resAdapter = {\n end: finishRequest,\n status: function(val) {\n response.code = val;\n\n return {\n send: finishRequest\n };\n },\n setHeader: function(key, value) {\n response.headers[key] = value;\n }\n };\n\n // Does not support\n // * failureRedirect\n // * allowGet\n // * next with an error\n options.passwordless.requestToken(options.getUserId)(reqAdapter, resAdapter, finishRequest);\n }\n}", "title": "" }, { "docid": "b004e370475f2c0d914a103e857ca3d8", "score": "0.49129304", "text": "init({ state, dispatch }) {\n if (state.authToken !== null) {\n setDefaultAuthHeaders(state)\n // let authtoken = state.authToken.access_token\n // let exp = jwt.decode(authtoken).exp\n // if (Date.now() >= exp * 1000) {\n // console.log('token refreshed')\n // dispatch('refreshToken')\n // }\n }\n }", "title": "" }, { "docid": "56766eab7525823a39944e037d0ed507", "score": "0.49117664", "text": "constructor() {\n this.clientDetails = ctrlWeb.getUserToken();\n }", "title": "" }, { "docid": "cc071c7f132868b44f6af6dc58d8026a", "score": "0.4905842", "text": "function configureJwtAuth(config) {\n return ejwt({\n secret: config.jwtSecret,\n credentialsRequired: true,\n userProperty: 'jwtPayload',\n getToken\n }).unless({ path: ['/v1/signin', '/v1/signup'] }); // routes with no auth\n}", "title": "" }, { "docid": "749807f7786e86eb6e3744297eba2ae0", "score": "0.49042982", "text": "getAuthToken() {\n return `Bearer ${localStorage.getItem('token')}`;\n }", "title": "" }, { "docid": "663d8f2e2f2deb5c89d4448c8c686056", "score": "0.49031413", "text": "constructor(token = null) {\n this.baseUrlEndpoint = ApiRoutes.apiBaseUrlLive;\n this.login = '';\n this.password = '';\n this.userAccessToken = '';\n this.isLoggedIn = false;\n\n if (token == null) {\n this.setupNoTokenDefaultAxiosClient();\n } else {\n this.setupAxiosClient(token);\n }\n\n //check if token is not blank / expired, if it is get new token\n }", "title": "" }, { "docid": "60c36985c0a63af403e26cbf18bff086", "score": "0.48950168", "text": "function _onJwtStrategyAuth ( payload, next ) {\n const user = payload.user;\n return next( null, user, {} );\n}", "title": "" }, { "docid": "ac6b6025d87f61886c69899962d0ac34", "score": "0.48840514", "text": "function clientConfig() {\n client = new issuer.Client({\n client_id:process.env.CLIENT_ID,\n client_secret:process.env.CLIENT_SECRET,\n token_endpoint_auth_method:'client_secret_post'\n })\n}", "title": "" }, { "docid": "4aa9ef88a54be05243b66c988c30aaf9", "score": "0.4883102", "text": "function restricted(req, res, next) {\n const token = req.headers.authorization;\n if(token){\n jwt.verify(token, process.env.JWT_SECRET, (err, decodedToken) => {\n if (err) {\n res.status(401).json({ message: 'invalid token'});\n } else {\n req.decodedToken = decodedToken;\n next();\n }\n });\n } else {\n res.status(401).json({ message: 'no token provided' });\n }\n}", "title": "" }, { "docid": "71d6c8fd89353408e1fa5b80e9b59379", "score": "0.48821616", "text": "onAuthorize(client, { token }) {\n this.sessions.set(client.id, {\n playerId: token.playerId,\n deviceId: token.deviceId,\n });\n }", "title": "" }, { "docid": "530ba86b03da522b00398d02a0d7a643", "score": "0.4878207", "text": "async function makeTokenRequest() {\n data = {\n \"client_id\": auth.twitch.clientID,\n \"client_secret\": auth.twitch.secret,\n \"grant_type\": \"client_credentials\",\n \"scope\": \"channel:read:subscriptions user:read:email\"\n }\n return axios.post('https://id.twitch.tv/oauth2/token', qs.stringify(data)).then(response => {\n axios.defaults.headers.common = {\n \"Authorization\": \"Bearer \" + response.data.access_token\n }\n }).catch(error => {\n console.log(error)\n })\n}", "title": "" }, { "docid": "b3851a12c2b65ab50ed573bded54f65d", "score": "0.48780572", "text": "function authenticateToken(req, res, next) {\r\n // ! Getting the authorization header\r\n const authHeader = req.headers['authorization'];\r\n // ! spliting the authHeader to extract the main token\r\n const token = authHeader && authHeader.split(' ')[1]\r\n\r\n // ! Sending an error if the token was not found\r\n if (token == null) return res.sendStatus(401).json({message: \"Token Not Found\"});\r\n\r\n // ! Verifying the token and getting the data from the token\r\n jwt.verify(token, process.env.ACCESS_TOKEN_SECRETE, (err, user) => {\r\n if (err) return res.sendStatus(403);\r\n\r\n // ! returning the data through the req parameter\r\n req.user = user;\r\n next();\r\n })\r\n}", "title": "" }, { "docid": "fb878b11db63150b85df0cba602a24a7", "score": "0.48777592", "text": "async jwt(token, user, account, profile, isNewUser) {\n user && (token.user = user);\n return token;\n }", "title": "" }, { "docid": "0bff5dd733554350f4f9793efddbb0b5", "score": "0.48765385", "text": "function getToken() {\n var tokenURL = config.portal + '/sharing/rest/generateToken?';\n var parameters = {\n username: config.AGOLadminCredentials.username,\n password: config.AGOLadminCredentials.password,\n client: 'referer',\n referer: config.portal,\n expiration: config.AGOLadminCredentials.expiration,\n f: 'json',};\n var tokenFieldName = 'token';\n //Pass parameters via form attribute\n var requestPars = {method: 'post', url: tokenURL, form: parameters };\n\n return hr.callAGOL(requestPars)\n .then(function(body) {\n if (body.error) {\n console.error(body.error);\n throw(new Error('Error getting token: ' + body.error));\n }\n hr.saved.token = body[tokenFieldName];\n // Console.log(body);\n console.log(hr.saved.token);\n return hr.saved.token;\n });\n}", "title": "" }, { "docid": "62e29d4bd7656b913771d6967c4ee641", "score": "0.48748803", "text": "function request(config) {\n config.headers = config.headers || {};\n if ($storage.get('user_token')) {\n config.headers.Authorization = 'Bearer ' + $storage.get('user_token');\n }\n return config;\n }", "title": "" }, { "docid": "7351334b4eba923a7c180c24d9823842", "score": "0.48711678", "text": "appendJwtTokenParam(queryPart){\n let token = LocalStorageService.getToken();\n if (token) {\n const tokenParam = \"auth=\" + token;\n if (queryPart && queryPart.startsWith(\"?\")) {\n return queryPart + \"&\" + tokenParam\n } else {\n return \"?\" + tokenParam\n }\n }\n return queryPart\n }", "title": "" }, { "docid": "fe465e9e753022c04d2c5e9229586b53", "score": "0.48666558", "text": "authenticate(cb) {\n let opts = {\n headers: {\n 'Client-ID': this.clientId,\n 'Authorization': `Bearer ${this.clientSecret}`,\n },\n json: {\n client_id: this.clientId,\n client_secret: this.clientSecret,\n grant_type: 'client_credentials',\n scope:'',\n }\n };\n request.post(authUrl, opts, (error, resp, body) => {\n console.log('auth returned... storing access token')\n cb(body.access_token)\n })\n\n }", "title": "" } ]
030a41672b8cfe26c6be416e26e4219a
Tooltip Display Management Functions
[ { "docid": "ce48a624cd9d004240600b61c943dacf", "score": "0.0", "text": "function _resolveTooltipNode (_tooltipNode) {\n\t\t\t\treturn _Uize_Node.getById (Uize.isFunction (_tooltipNode) ? _tooltipNode () : _tooltipNode);\n\t\t\t}", "title": "" } ]
[ { "docid": "d86fa9e1d06052aa2c1a4412c0496027", "score": "0.763796", "text": "function tooltip() {\n link_title(\"a.tip\", \"tooltip\");\n}", "title": "" }, { "docid": "6c363f45dcdf5eef06141dcefc9cf998", "score": "0.74806535", "text": "function displayToolTip() {\n //trace(\"displayToolTip\");\n //console.log(\"displayToolTip\");\n if (currentTimeDisplay) {\n myToolTip.hideToolTip();\n var offset = minimumVal; //Number(Model.getSegStartFrame()/Model.getFps());\n var currentTimeDisplayPercent = Math.round(\n ($(sliderElement)\n .children('.ui-slider-handle')\n .position().left /\n $(sliderElement).width()) *\n 100\n );\n txt =\n formatTimeForTooltip(\n (currentTimeDisplayPercent * (mediaDuration - offset)) / 100\n ) +\n ' / ' +\n formatTimeForTooltip(mediaDuration - offset);\n // = display current time for animation only ==\n if (myToolTip) {\n myToolTip.showToolTip(\n $(sliderElement).offset().top - 5,\n $(sliderElement).offset().left +\n $(sliderElement)\n .children('.ui-slider-handle')\n .position().left -\n 5,\n $(sliderElement)\n .children('.ui-slider-handle')\n .width(),\n txt\n );\n }\n }\n }", "title": "" }, { "docid": "70a11f6f6e3cad1187d497d2b74b4d89", "score": "0.74524254", "text": "_showTooltip(){\n this._tooltipVisible = true;\n this._render();\n }", "title": "" }, { "docid": "e2765109c91fd210211a58e9498d8f95", "score": "0.7410167", "text": "showToolTip_(event) {\n this.updateToolTip_(event);\n }", "title": "" }, { "docid": "6d23752745dbbabbcdfe764ed3c129e0", "score": "0.73545814", "text": "function tooltip(e) {\n\t//TODO\n}", "title": "" }, { "docid": "2fe0fabb0247ca1e7879189fc9be920d", "score": "0.72996616", "text": "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n updatePosition(event);\n }", "title": "" }, { "docid": "0dc00f6f8041411bc3a30610bd6b54bc", "score": "0.726155", "text": "function tooltipTitleShow(){\n\tvar $that = $(this);\n\tvar $thisWidth = $that.width();\n\tvar $thisHeight = $that.outerHeight();\n\tvar $thisPosition = $that.offset();\n\tvar $thisMiddle = $thisWidth / 2;\n\n\t$(\"<div></div>\").prependTo(\"body\").addClass(\"tooltip tooltip-title\");\n\n\tvar $tooltip = $(\".tooltip-title\");\n\t$tooltip.text( $that.prop(\"title\") );\n\t\n\tvar $tooltipWidth = $tooltip.outerWidth();\n\tvar $tooltipMiddle = $tooltipWidth / 2;\n\n\tvar $tooltipLeft = $thisPosition.left + $thisMiddle - $tooltipMiddle;\n\tvar $tooltipTop = $thisPosition.top + $thisHeight + 11;\n\t\n\t$tooltip.css(\"left\", $tooltipLeft);\n\t$tooltip.css(\"top\", $tooltipTop);\n\n\t$tooltip.css(\"opacity\",\"0.8\");\n}", "title": "" }, { "docid": "ec88cba11af6a23a2510d3ea04ebb993", "score": "0.72201794", "text": "function toolTip(id, dino) {\n\n $(\"#\" + id).attr(\"title\", dino.healthPoints + \" HP, \" + dino.attackPower + \" AP, \" + dino.counterAttack + \" CP\" );\n\n }", "title": "" }, { "docid": "b13cc576ca5719e43d9dd25aeaafd2c6", "score": "0.7216109", "text": "function showTooltip(stat) {\n if (stat==false) {\n if (ttNS4)\n myTooltipContainer.visibility = \"hide\";\n else\n myTooltipContainer.style.visibility = \"hidden\";\n ttDisplay = 0;\n } else {\n if (ttNS4)\n myTooltipContainer.visibility = \"show\";\n else\n myTooltipContainer.style.visibility = \"visible\";\n ttDisplay = 1;\n }\n}", "title": "" }, { "docid": "fcca2d438c8542218c094aff72ef3fd4", "score": "0.7074793", "text": "function tooltext(type, tooltip){\n if (type == \"Business as usual\") {\n tooltip.html(\"If global emissions continue at the so-called business-as-usual level, they could reach 69 gigatons by 2030. In 2100, we will have to deal with fallout ranging from massive refugee crises and submerged cities to scorching heatwaves and drought, scientists say.\")\n return tooltip.style(\"visibility\", \"visible\");\n }\n if (type == \"Below 2°C\") {\n tooltip.html(\"When the world producing energy is 100% produced by renewables, the gas emissions will reduce to almost 0\")\n return tooltip.style(\"visibility\", \"visible\");\n }\n if (type == \"Paris pledges\") {\n tooltip.html(\"The goal of the Paris Agreement is to to limit global warming to less than 2ºC and countries have to submit updated carbon reduction plans every five years. Finally a yield of $100 billion per year by 2020 in climate-related financing meant to help poorer countries adapt.\")\n return tooltip.style(\"visibility\", \"visible\");\n }\n\tif (type == \"Withdraw\") {\n tooltip.html(\"In a worst case scenario, the US withdrawal could add 0.3ºC to global temperatures by the end of the century.\")\n return tooltip.style(\"visibility\", \"visible\");\n }\n if (type == \"United States\") {\n tooltip.html(\"<b>United States</b>:\"+ \"<br>\" + \"- Produces 22% of \"+ \"<span <br><img src='world_bol.png' width='20' height='20'></span>\" + \" emissions\" + \"<br>\" + \"- Has to reduce 2.96 gig CO₂ in 2030\")\n table_1(\"United States\");\n return tooltip.style(\"visibility\", \"visible\");\n }\n if (type == \"Europe\") {\n tooltip.html(\"<b>Europe</b>:\"+ \"<br>\" + \"- Produces 11% of \"+ \"<span <br><img src='world_bol.png' width='20' height='20'></span>\" + \" emissions\" + \"<br>\" + \"- Has to reduce 1.4 gig CO₂ in 2030\")\n table_1(\"Europe\");\n return tooltip.style(\"visibility\", \"visible\");\n }\n if (type == \"China\") {\n tooltip.html(\"<b>China</b>:\"+ \"<br>\" + \"- Produces 26% of \"+ \"<span <br><img src='world_bol.png' width='20' height='20'></span>\" + \" emissions\" + \"<br>\" + \"- Has to reduce 3.45 gig CO₂ in 2030\")\n table_1(\"China\");\n return tooltip.style(\"visibility\", \"visible\");\n }\n if (type == \"Developed countries\") {\n tooltip.html(\"<b>Developed countries</b>:\"+ \"<br>\" + \"- Producing 18% of \"+ \"<span <br><img src='world_bol.png' width='20' height='20'></span>\" + \" emissions\" + \"<br>\" + \"- Has to reduce 2.45 gig CO₂ in 2030\")\n table_1(\"Developed countries\");\n return tooltip.style(\"visibility\", \"visible\");\n }\n if (type == \"Developing countries\") {\n tooltip.html(\"<b>Developing countries</b>:\"+ \"<br>\" + \"- Producing 23% of \"+ \"<span <br><img src='world_bol.png' width='20' height='20'></span>\" + \" emissions\" + \"<br>\" + \"- Has to reduce 3.04 gig CO₂ in 2030\")\n table_1(\"Developing countries\");\n return tooltip.style(\"visibility\", \"visible\");\n }\n}", "title": "" }, { "docid": "f573e2f34230c14e60ce2a05fb1dae8e", "score": "0.70565796", "text": "function showTooltip() {\n\t\t\t\tvar tooltipPosition;\n\t\t\t\tvar xPixel = xScale.getPixel(this.data('metaInfo').x);\n\t\t\t\tvar yPixel = yScale.getPixel(this.data('metaInfo').y);\n\t\t\t\tvar arrowPosition;\n\t\t\t\tvar xOffset = Config.DOT_SIZE * Config.LARGE_DOT_FACTOR + Config.TOOLTIP_MARGIN;\n\t\t\t\tif (xPixel > startX + (width / 2)) {\n\t\t\t\t\ttooltipPosition = 'left';\n\t\t\t\t\txPixel -= xOffset;\n\t\t\t\t} else {\n\t\t\t\t\ttooltipPosition = 'right';\n\t\t\t\t\txPixel += xOffset;\n\t\t\t\t}\n\n\t\t\t\tvar tooltipObject = new Tooltip(paper, 'fm-scatter-tooltip', colorGroupMap[this.data('metaInfo').group]);\n\t\t\t\ttooltipObjects.push(tooltipObject);\n\t\t\t\t\n\t\t\t\tvar tooltip = tooltipObject.render(\n\t\t\t\t\tthis.data('metaInfo').title,\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: data.keys[1].title,\n\t\t\t\t\t\t\tvalue: appendValuePrefixAndSuffix(this.data('metaInfo').x, options.xPrefix, options.xSuffix)\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: data.keys[2].title,\n\t\t\t\t\t\t\tvalue: appendValuePrefixAndSuffix(this.data('metaInfo').y, options.yPrefix, options.ySuffix)\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\ttooltip.addClass('fm-scatter-tooltip');\n\n\t\t\t\ttooltipObject.setPosition(xPixel, yPixel, tooltipPosition);\n\t\t\t\ttooltipObject.show();\n\n\t\t\t\tscatterGraph.append(tooltip);\n\t\t\t}", "title": "" }, { "docid": "7083be36ce6aaaf9c82c023a9004085a", "score": "0.70411366", "text": "function displayTooltip() \r\n {\r\n\tcurrentTooltip.style.display = \"block\";\r\n // Check that tooltip is fully visible\r\n var tooltipWidth = currentTooltip.offsetWidth;\r\n var documentWidth = document.body.offsetWidth;\r\n var x = currentTooltip.offsetLeft;\r\n var xOverflow = x + 40 + tooltipWidth - documentWidth;\r\n if(xOverflow > 0) \r\n {\r\n x = x - xOverflow;\r\n currentTooltip.style.left = x + \"px\";\r\n }\r\n }", "title": "" }, { "docid": "5af60a9ba1822b241704b9d4a0ec89da", "score": "0.70326096", "text": "generateToolTip() {\n //Order the data array\n let data = formatArray.collectionToTop(this.data, config.tooltipOrder);\n data = formatArray.collectionToBottom(data, config.tooltipReverseOrder);\n\n if (!(data) || data.length === 0) {\n return generate.noDataWarning(this.name);\n }\n\n //Ensure name is not blank\n this.validateName();\n\n //Generate the expand field option\n const expandFunction = this.displayMore();\n\n if (!(this.data)) { this.data = []; }\n return h('div.tooltip-image', [\n h('div.tooltip-heading', this.name),\n h('div.tooltip-internal', h('div', (data).map(item => generate.parseMetadata(item, true, expandFunction)), this))\n ]);\n }", "title": "" }, { "docid": "caff5dba0661040dd16edd9f87a0c21d", "score": "0.6994587", "text": "function displayTips(){\n\t\thowToPlayImage.visible = true;\n\t\txButton.visible = true;\n\t}", "title": "" }, { "docid": "ec79e8bbdcdfc2b8565fad229bf3db53", "score": "0.69900864", "text": "function Tooltip(params) {\n var el = dom(params.target)[0];\n\n var tooltip = document.createElement('div');\n tooltip.classList.add('tooltip');\n tooltip.classList.add(params.type);\n tooltip.innerHTML = params.content;\n\n // Create tip\n\n if(typeof params.tip !== 'undefined' && params.tip != false) {\n var tip = document.createElement('div');\n tip.className = 'tip';\n\n switch(params.tipPosition) {\n case 'left':\n tip.style.left = '2%';\n break;\n case 'center':\n case 'middle':\n tip.style.left = '50%';\n break;\n case 'right':\n tip.style.left = '93%';\n break;\n default:\n tip.style.left = '50%';\n }\n\n tooltip.appendChild(tip);\n\n var tipHeight = tooltip.offsetHeight;\n }\n\n\n var show = function() {\n if(this.position == 'top') {\n var parentEl = this.el.parentNode;\n parentEl.insertBefore(tooltip, this.el);\n tooltip.style.top = '-2px';\n if(typeof tip !== 'undefined') {\n dom(tip).addClass('top');\n tip.style.top = tooltip.offsetHeight;\n }\n\n if(this.overlay) {\n // Calculating absolute position of the overlayed tooltip\n var offsetTop = this.el.offsetTop - this.tooltip.offsetHeight - 5;\n dom(this.tooltip).addClass('tooltip-overlay');\n dom(this.tooltip).css('top', offsetTop);\n }\n\n } else {\n tooltip.style.top = '2px';\n dom(tooltip).insertAfter(el);\n if(typeof tip !== 'undefined') {\n dom(tip).addClass('bottom');\n tip.style.top = '-10px';\n }\n\n if(this.overlay) {\n // Calculating absolute position of the overlayed tooltip\n var offsetTop = this.el.offsetTop + this.el.offsetHeight + 5;\n dom(this.tooltip).addClass('tooltip-overlay');\n dom(this.tooltip).css('top', offsetTop);\n }\n }\n\n dom(this.tooltip).addClass('tooltip-fadein');\n\n if(typeof params.timeout !== 'undefined') {\n window.setTimeout(hide, params.timeout);\n }\n }\n\n var hide = function() {\n dom(tooltip).addClass('tooltip-fadeout');\n dom(tooltip).removeClass('tooltip-fadein');\n window.setTimeout(function(){\n dom(tooltip).remove();\n }, 300);\n }\n\n var toggle = function() {\n dom(this.tooltip).hasClass('tooltip-fadein') ? this.hide() : this.show();\n }\n\n return {\n hide: hide,\n show: show,\n toggle: toggle,\n tooltip: tooltip,\n el: el,\n overlay: params.overlay,\n position: params.position,\n tip: tip,\n tipHeight: tipHeight\n };\n}", "title": "" }, { "docid": "c5d8f266cfc9588c33c7baa8a84f81c2", "score": "0.6985245", "text": "function uitooltipfn(){\n\tjQuery.widget.bridge('uitooltip', jQuery.ui.tooltip);\n\t//jQuery.widget.bridge(\"tlp\", jQuery.ui.tooltip);\n jQuery('.mk-member').uitooltip();\n}", "title": "" }, { "docid": "a9be0b70c110fe023060bda9f6912990", "score": "0.69827247", "text": "function displayTooltip(){\r\n if(tooltip){\r\n tooltip.fadeIn(fadeTime);\r\n }\r\n else{\r\n return;\r\n }\r\n}", "title": "" }, { "docid": "283713b45daf7ef047488e26478d4381", "score": "0.69799054", "text": "function tooltips ( ) {\n\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent('update', function(values, handleNumber, unencoded) {\n\n if ( !tips[handleNumber] ) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if ( options.tooltips[handleNumber] !== true ) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = '<span>' + formattedValue + '</span>';\n });\n }", "title": "" }, { "docid": "74e7f2a149381f6758b5ba4c9b00c5d7", "score": "0.6962342", "text": "function tooltip(v_msg,nolg)\n{\n if (typeof(nolg)!=\"undefined\") \n \treturn \"<a href='#' onclick='return false' onmouseover=\\\"parent.mouseBox('\"+v_msg+\"',event)\\\" onmouseout=\\\"parent.mouseBox('')\\\">\"+$p.img(\"ico_help_s.gif\",12,12,\"\",\"imgmid\")+\"</a>\";\n else\n return \"<a href='#' onclick='return false' onmouseover=\\\"mouseBox(lg('\"+v_msg+\"'),event)\\\" onmouseout=\\\"mouseBox('')\\\">\"+$p.img(\"ico_help_s.gif\",12,12,\"\",\"imgmid\")+\"</a>\";\n}", "title": "" }, { "docid": "34a24a8a271c42e6fb8040cddeafe1e9", "score": "0.69219667", "text": "updateTooltip()\n\t{\n\t\tlet string = this._tooltip;\n\n\t\tfor (let i = 0; i < this.warnings.length; i++)\n\t\t{\n\t\t\tif (i == 0)\n\t\t\t\tstring += '<br>';\n\n\t\t\tstring += '<br>* ' + this.warnings[i];\n\t\t}\n\n\t\tthis.element2.innerHTML = string;\n\t}", "title": "" }, { "docid": "34a24a8a271c42e6fb8040cddeafe1e9", "score": "0.69219667", "text": "updateTooltip()\n\t{\n\t\tlet string = this._tooltip;\n\n\t\tfor (let i = 0; i < this.warnings.length; i++)\n\t\t{\n\t\t\tif (i == 0)\n\t\t\t\tstring += '<br>';\n\n\t\t\tstring += '<br>* ' + this.warnings[i];\n\t\t}\n\n\t\tthis.element2.innerHTML = string;\n\t}", "title": "" }, { "docid": "7ec7880cd0ca01b4abf0a92440df74f5", "score": "0.68984115", "text": "function tooltips ( ) {\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\r\n\r\n\t\t\tif ( !tips[handleNumber] ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar formattedValue = values[handleNumber];\r\n\r\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\r\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\r\n\t\t\t}\r\n\r\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "e60d0ea09a10885457a115f69b1ca2ca", "score": "0.6885118", "text": "_updateTooltip (event, data) {\n let cedartip = document.getElementById(this._definition.tooltip.id);\n if (!data) {\n cedartip.style.display = 'none';\n return;\n }\n cedartip.style.top = `${event.pageY}px`;\n cedartip.style.left = `${event.pageX}px`;\n cedartip.style.display = 'block';\n\n let content = `<span class='title'>${this._definition.tooltip.title}</span><br />`;\n content += `<p class='content'>${this._definition.tooltip.content}</p>`;\n\n cedartip.innerHTML = content.replace(/\\{(\\w+)\\}/g, (match, $1) => {\n return data[$1];\n });\n }", "title": "" }, { "docid": "a530fdbb5c01f5ad665f6b4831c1ff04", "score": "0.68839777", "text": "function setToolTip() {\n\t$(\"[title]\").tooltip({ track: true });\n\t}", "title": "" }, { "docid": "6b6eec881f26ff8ea242d2839c44ac0b", "score": "0.6879671", "text": "function org_zmail_example_customtooltip_HandlerObject() {\r\n}", "title": "" }, { "docid": "4b02f526b8171f843b003ce619703b9c", "score": "0.6877035", "text": "function onHover(datum) {\n\tshowTooltip(datum);\n}", "title": "" }, { "docid": "d7edc60bef1dc9b93733cae6bf264d47", "score": "0.68710077", "text": "function showToolTip(){\n\tcreateTooltip();\n\tif(window.getSelection().toString().length>0)\n\t\t$(\"#tool\").show();\n}", "title": "" }, { "docid": "99166baa284555f7f3319eb6ef24b7fd", "score": "0.6865404", "text": "function displayTooltip() {\n if ($(window).width() < 768 && isMobile.any()) {\n $(mainGallery).tooltip({\n placement: 'top',\n title: 'Swipe to see more photos...',\n container: $(mainGallery)\n });\n\n $(mainGallery).tooltip('show');\n }\n }", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6850027", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6850027", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "4e920d7e61cc47c1bdb3caeb6d85a82a", "score": "0.68439895", "text": "function showTooltip(d) {\n moveTooltip();\n\n tooltip.style(\"display\",\"block\")\n .text(d.properties.DESA);\n}", "title": "" }, { "docid": "d6536a90a94807818b385ff5e5916341", "score": "0.68413043", "text": "function tooltips() {\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update\", function(values, handleNumber, unencoded) {\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "title": "" }, { "docid": "d6536a90a94807818b385ff5e5916341", "score": "0.68413043", "text": "function tooltips() {\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update\", function(values, handleNumber, unencoded) {\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "title": "" }, { "docid": "81a999feceac9e7f214e5c4765fedc65", "score": "0.6831727", "text": "function showTip(){\r\n var oTipLayer=gbi('sortHlp');\r\n if(oTipLayer.style.display=='block')\r\n oTipLayer.style.display='none'\r\n else{\r\n var oTip=gbi('quesSrt');\r\n var getLeft=getOffLeft(oTip);\r\n var getTop=getOffTop(oTip);\r\n oTipLayer.style.display='block'\r\n oTipLayer.style.top=getTop+'px';\r\n oTipLayer.style.left=getLeft-(oTipLayer.offsetWidth)+15+'px';\r\n }\r\n}", "title": "" }, { "docid": "be5ff53d7f02e39679588b6901bbf745", "score": "0.68302274", "text": "function doHoverTooltip(e, msg) \r\n{\r\n if ( typeof Tooltip == \"undefined\" || !Tooltip.ready ) \r\n \treturn;\r\n \t\r\n Tooltip.clearTimer();\r\n var tip = document.getElementById ? document.getElementById(Tooltip.tipID) : null;\r\n if ( tip && tip.onmouseout == null ) \r\n {\r\n tip.onmouseout = Tooltip.tipOutCheck;\r\n tip.onmouseover = Tooltip.clearTimer;\r\n }\r\n Tooltip.show(e, msg);\r\n}", "title": "" }, { "docid": "e6613c8b22cb4bfd648dd3d19e609d10", "score": "0.6827385", "text": "tooltip({ replace = false, position = null, size = null, spaced = null, text = '', fontName = '14pt Verdana', duration = null, event = new EventData(this.R.get.events_tooltipDismissed), background = null, fontColor = null }) {\n // Set the default\n spaced = spreadToObject(spaced, new BABYLON.Vector2(0, 0))\n if ((duration === null) || (duration.constructor !== Promise)) {\n if ((duration !== null) && (duration.constructor === Number)) {\n duration = delay(duration)\n } else {\n duration = (new Deferred()).promise\n }\n }\n\n const guiCanvas = this.get('GUI')\n guiCanvas.levelVisible = true\n\n const brownColor = [112 / 255, 102 / 255, 98 / 255, 0.95]\n\n let tooltips = this.get('tooltips', [])\n if (tooltips.constructor === Object) {\n tooltips = [tooltips]\n }\n const id = tooltips.length + 1\n\n let tooltip = null\n if (replace && tooltips.length) {\n tooltip = tooltips[tooltips.length - 1]\n } else if (tooltips.length) {\n for (const temptool of tooltips) {\n if (typeof temptool.box !== 'undefined') {\n temptool.box.zOrder = (id - temptool.id) * 0.01\n temptool.text.zOrder = ((id - temptool.id) * 0.01) - 0.001\n }\n if ((typeof temptool.disposed !== 'undefined') && (temptool.disposed)) {\n temptool.box.zOrder = 0.001\n temptool.text.zOrder = 0\n tooltip = temptool\n background = spreadToObject(background, new BABYLON.Color4(...brownColor))\n break\n }\n }\n }\n\n\n if (tooltip !== null) {\n tooltip.text.levelVisible = true\n tooltip.box.levelVisible = true\n\n tooltip.text.text = text\n\n const tempPosition = tooltip.box.position.add(sizeToVec(tooltip.box.size).scale(0.5))\n if (size === null) {\n tooltip.box.width = tooltip.text.size.width + 24\n tooltip.box.height = tooltip.text.size.height + 24\n } else {\n tooltip.box.width = size.width\n tooltip.box.height = size.height\n }\n\n if (background !== null) {\n background = spreadToObject(background, new BABYLON.Color4(...brownColor))\n const brush = BABYLON.Canvas2D.GetSolidColorBrush(background)\n tooltip.box.fill = brush\n }\n\n fontColor = spreadToObject(fontColor, new BABYLON.Color4(1, 1, 1, 1))\n\n tooltip.text.defaultFontColor = fontColor\n\n\n position = spreadToObject(position, tempPosition)\n const nextPos = position.subtract(sizeToVec(tooltip.box.size).scale(0.5).add(spaced))\n // TODO make a bounding function to make sure the tooltip is visible depending on the rendersize the position and size of the tooltip\n tooltip.box.position = nextPos\n tooltip.promise = duration\n tooltip.event = event\n tooltip.disposed = false\n } else {\n position = spreadToObject(position, new BABYLON.Vector2(0, 0))\n\n const sizeDefault = spreadToObject(size, new BABYLON.Size(300, 300))\n\n // const normalColor = [202 / 255, 64 / 255, 0, 0.95]\n\n // let fontSuperSample = true\n // let fontSignedDistanceField = false\n // if (background === null) {\n // fontSuperSample = false\n // fontSignedDistanceField = true\n // }\n\n const fontSuperSample = false\n const fontSignedDistanceField = true\n background = spreadToObject(background, new BABYLON.Color4(...brownColor))\n fontColor = spreadToObject(fontColor, new BABYLON.Color4(1, 1, 1, 1))\n\n const brush = BABYLON.Canvas2D.GetSolidColorBrush(background)\n\n const tooltipBox = new BABYLON.Rectangle2D({\n parent: guiCanvas,\n id: `tooltipBox${tooltips.length}`,\n // position: position.subtract(size.scale(0.5).add(spaced)),\n width: sizeDefault.width,\n height: sizeDefault.height,\n // border: brush,\n // borderThickness: 2,\n fill: brush,\n })\n\n const tooltipText = new BABYLON.Text2D(text, {\n parent: tooltipBox,\n id: `tooltipText${tooltips.length}`,\n marginAlignment: 'h: center, v:center',\n defaultFontColor: fontColor,\n fontSuperSample,\n fontSignedDistanceField,\n fontName,\n })\n\n if (size === null) {\n tooltipBox.width = tooltipText.size.width + 24\n tooltipBox.height = tooltipText.size.height + 24\n }\n\n tooltipBox.position = position.subtract(sizeToVec(tooltipBox.size).scale(0.5).add(spaced))\n\n\n tooltip = { box: tooltipBox, text: tooltipText, promise: duration, id, disposed: false, event }\n\n\n this.set('tooltips', tooltips.concat(tooltip))\n }\n\n duration.then(() => {\n if (tooltip.promise === duration) {\n this.hideTooltip(tooltip)\n }\n if (event.constructor === EventData) {\n event.happenedAt = this.timeInMs\n this.addEvent(event)\n }\n })\n\n return tooltip\n }", "title": "" }, { "docid": "46efc78ccdb6371d802ad4c3d61b233d", "score": "0.68249077", "text": "generateExtendedToolTip() {\n //Order the data array\n let data = formatArray.collectionToTop(this.data, config.tooltipOrder);\n data = formatArray.collectionToBottom(data, config.tooltipReverseOrder);\n if (!(data)) data = [];\n\n if (!(data) || data.length === 0) {\n return generate.noDataWarning(this.name);\n }\n\n //Ensure name is not blank\n this.validateName();\n\n //Generate expansion and collapse functions \n const expandFunction = this.displayMore();\n const collapseFunction = this.displayLess();\n\n const getExpansionFunction = item => !this.isExpanded(item[0]) ? expandFunction : collapseFunction;\n\n if (!(this.data)) { this.data = []; }\n return h('div.tooltip-image', [\n h('div.tooltip-heading', this.name),\n h('div.tooltip-internal', h('div', (data).map(item => generate.parseMetadata(item, !this.isExpanded(item[0]), getExpansionFunction(item)), this)))\n ]\n );\n }", "title": "" }, { "docid": "b650387fae7e4a070f2f0d18da5851bd", "score": "0.68185985", "text": "function getTooltipText(d) {\r\n var mainText = '<p><strong>Name: </strong>' + d.label + ' (' + d.abbrev\r\n + ')</p><p><strong>Description: </strong>' + d.description + '</p>';\r\n var classification = '<p><strong>Classification: </strong>'\r\n + d.classification + '</p';\r\n return d.type == \"out\" ? mainText : mainText + classification;\r\n }", "title": "" }, { "docid": "b8fd03b3f766bbe7d1a06f6fc676b264", "score": "0.68086314", "text": "function hideTooltip() {\n tt.style('opacity', 0.0);\n }", "title": "" }, { "docid": "b9bf823efa743acd231e91f307927a3c", "score": "0.67964053", "text": "function showTooltip(datum) {\n\tif (showTooltip.tooltip == undefined) {\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.className = \"tooltip hidden\";\n\t\tdocument.body.appendChild(div);\n\t\tshowTooltip.tooltip = div;\n\t}\n\t$(showTooltip.tooltip).html(datumToString(datum));\n}", "title": "" }, { "docid": "c5e8aab5623e819181a232d5b03a8d3f", "score": "0.67905164", "text": "function bindTooltip(){\n bindTooltipSkin(\".b-tooltip, .b-panel-icons-item a,.b-tool, .b-image-nav, .b-help, .b-title\",\"qtip-light\");\n }", "title": "" }, { "docid": "c5b93bd4d89df69dc09feefcd0765f55", "score": "0.67894083", "text": "function componentRec_getToolTipText()\n{\n\treturn this.toolTipText;\n}", "title": "" }, { "docid": "518106de75b28a4685d55fde16bdf22b", "score": "0.67849225", "text": "function showtip(current,e,tip) {\r\n if (document.layers) // Netscape 4.0+\r\n {\r\n theString=\"<DIV CLASS='ttip'>\"+tip+\"</DIV>\"\r\n document.tooltip.document.write(theString)\r\n document.tooltip.document.close()\r\n document.tooltip.left=e.pageX+14\r\n document.tooltip.top=e.pageY+2\r\n document.tooltip.visibility=\"show\"\r\n }\r\n else\r\n {\r\n if(document.all || document.getElementById) // Netscape 6.0+ and Internet Explorer 5.0+\r\n {\r\n var mouseX, mouseY, db=document.body;\r\n elm=document.getElementById(\"tooltip\")\r\n elm.innerHTML='<table width=\"250\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td><div align=\"left\">' + tip + '</div></td></tr></table>';\r\n\r\n if (document.getElementById && !document.all) {\r\n mouseX = e.pageX; mouseY = e.pageY;\r\n elm.style.left = ((mouseX + current.offsetWidth) > (window.innerWidth-20 + window.pageXOffset)) ? mouseX - current.offsetWidth -10 + 'px' : window.pageXOffset+mouseX + 'px';\r\n } else {\r\n mouseX = window.event.clientX + db.scrollLeft;\r\n mouseY = window.event.clientY + db.scrollTop;\r\n elm.style.left = ((e.x + current.clientWidth) > (db.clientWidth + db.scrollLeft)) ? (db.clientWidth + db.scrollLeft) - current.clientWidth-10 + 'px' : mouseX + 'px';\r\n }\r\n\r\n elm.style.top = mouseY + 20 + 'px';\r\n elm.style.visibility = \"visible\"\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7cc29dd96bad7f466d9dfe434be85ed8", "score": "0.6780044", "text": "function showTooltip(x, y, contents) {\n $('<div id=\"tooltip\">' + contents + '</div>').css( {\n position: 'absolute',\n display: 'none',\n top: y + 5,\n left: x + 5,\n border: '1px solid #16a61f',\n padding: '5px',\n 'font-size':'13pt',\n 'font-weight':'bold',\n 'background-color': '#dfebb0',\n opacity: 0.50\n }).appendTo(\"body\").fadeIn(200);\n }", "title": "" }, { "docid": "29275a43e1d47676c349b5157f88b458", "score": "0.6779796", "text": "function qToolTip() {\r\n document.getElementById('question-mark').onmouseover = function () {\r\n var toolTip = document.getElementById('qmarktip');\r\n toolTip.style.display = 'block';\r\n }\r\n document.getElementById('question-mark').onmouseout = function () {\r\n var toolTip = document.getElementById('qmarktip');\r\n toolTip.style.display = 'none';\r\n }\r\n}", "title": "" }, { "docid": "c7ad31ee7de5cb7c5bb6cb521c9e21c5", "score": "0.6777442", "text": "_showTips (type, timestamp, item) {\n const msg = locale.get(item, this._transformTime(timestamp))\n window[`show${type}Message`](msg)\n }", "title": "" }, { "docid": "a88e28ffaa5bd93d7b8c338e84fd1b69", "score": "0.6771544", "text": "function setupTooltip(number, letter) {\r\n eval(\"var tooltip_\"+letter+number+\" = new Tooltip('\"+letter+\"trigger_\"+number+\"', '\"+letter+\"tooltip_\"+number+\"')\");\r\n\t /*Event.observe(window,\"load\",function() {\r\n\t $$(\"*\").findAll(function(node){\r\n\t return node.getAttribute('title');\r\n\t }).each(function(node){\r\n\t new Tooltip(node,node.title);\r\n\t node.removeAttribute(\"title\");\r\n\t });\r\n\t });*/\r\n}", "title": "" }, { "docid": "d57588697c252d8215b81ce5d1dc62f6", "score": "0.67315495", "text": "function createTooltip() {\n var tooltip = document.createElement(\"div\");\n var style = tooltip.style;\n\n tooltip.setAttribute(\"role\", \"tooltip\");\n tooltip.classList.add(\"tooltip\");\n\n var textElement = document.createElement(\"div\");\n textElement.classList.add(\"esri-widget\");\n tooltip.appendChild(textElement);\n\n view.container.appendChild(tooltip);\n\n var x = 0;\n var y = 0;\n var targetX = 0;\n var targetY = 0;\n var visible = false;\n\n // move the tooltip progressively\n function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n } else {\n requestAnimationFrame(move);\n }\n\n style.transform = \"translate3d(\" + Math.round(x) + \"px,\" + Math.round(\n y) + \"px, 0)\";\n }\n\n return {\n show: function(point, text) {\n if (!visible) {\n x = point.x;\n y = point.y;\n }\n\n targetX = point.x;\n targetY = point.y;\n style.opacity = 1;\n visible = true;\n textElement.innerHTML = text;\n\n move();\n },\n\n hide: function() {\n style.opacity = 0;\n visible = false;\n }\n };\n }", "title": "" }, { "docid": "3f17be02affdbb9fb315398cda5d628f", "score": "0.6730164", "text": "function showTooltip(d) {\r\n const html = `\r\n <p class=\"head\"> </p>\r\n <p class=\"name\"> ${d.properties.name} <p>\r\n <p> Canopy Percentage: ${d.properties.canopyPercent} </p>\r\n `;\r\n tooltip.html(html);\r\n tooltip\r\n .style('visibility', 'visible')\r\n .style('top', `${d3.event.layerY + 12}px`)\r\n .style('left', `${d3.event.layerX - 70}px`);\r\n}", "title": "" }, { "docid": "7688cefe337aead888c86ad1a24e96eb", "score": "0.669605", "text": "function showTooltip(x, y, contents, z) {\n $('<div id=\"flot-tooltip\">' + contents + '</div>').css({\n top: y - 50,\n left: Math.max(x - 100, 70),\n 'border-color': z,\n }).appendTo(\"body\").fadeIn(200);\n }", "title": "" }, { "docid": "8d6f50bc89d3d7ba867cb07c99dd7618", "score": "0.66932726", "text": "displayLess() {\n let that = this;\n return (field) => that.expandToolTip(that, field, false);\n }", "title": "" }, { "docid": "2c255dbff704da4830ec58feab2465b4", "score": "0.6689701", "text": "function showTooltip(field) {\n hideTooltips();\n field.style.visibility = \"visible\";\n field.style.opacity = \"1\";\n}", "title": "" }, { "docid": "28b94ed74feff4aaa1d55b62516993c6", "score": "0.66894346", "text": "function hideTooltip() \r\n {\r\n if(currentTimer != null)\r\n {\r\n clearTimeout(currentTimer);\r\n currentTimer = null;\r\n }\r\n\tcurrentTooltip.style.display = \"none\";\r\n }", "title": "" }, { "docid": "1d46505b7c1994134f5558fc713a8e49", "score": "0.6688658", "text": "function showToolTip(obj, diagram, doc, vp) {\r\n if (obj !== null) {\r\n var node = obj.part;\r\n updateInfoBox(vp, node.data);\r\n }\r\n else {\r\n document.getElementById(\"infoBoxHolder\").innerHTML = \"\";\r\n }\r\n}", "title": "" }, { "docid": "dfdef2b4769deed695f1872f44128735", "score": "0.6685482", "text": "function showTooltip(d) {\n\n\t // info for tooltips\n label = d.properties.name;\n gdp = d.properties.gdp_md_est;\n income_grp = d.properties.income_grp;\n \n // define content of tooltips\n var mouse = d3.mouse(svg.node())\n .map( function(d) { return parseInt(d); } );\n \t tooltip.classed(\"hidden\", false)\n .attr(\"style\", \"left:\"+(mouse[0]+offsetL)+\"px;top:\"+(mouse[1]+offsetT)+\"px\")\n .html(label + \"</br>\" + income_grp)\n\t\t}", "title": "" }, { "docid": "9af8d5bf9b30d7cee3f237570ec8f18a", "score": "0.66852623", "text": "function showTooltip(x, y, contents) {\r\n\t\t\tjQuery('<div id=\"tooltip\" class=\"tooltipflot\">' + contents + '</div>').css( {\r\n\t\t\t\tposition: 'absolute',\r\n\t\t\t\tdisplay: 'none',\r\n\t\t\t\ttop: y + 5,\r\n\t\t\t\tleft: x + 5\r\n\t\t\t}).appendTo(\"body\").fadeIn(200);\r\n\t\t}", "title": "" }, { "docid": "9568bfc2730ad29db3b2705c3f58b9e2", "score": "0.667189", "text": "function show() {\n elem.after(tooltip);\n positionTooltip();\n bindTooltipEvents();\n tooltip.addClass(visibleClassName);\n }", "title": "" }, { "docid": "c65a527b4345779c117c7ff16d89a640", "score": "0.6665024", "text": "function createTooltipHelp(idOfElement, contentOfTooltip) {\n\tAUI().ready('aui-tooltip', 'aui-io-plugin', function(A) {\n\t\tnew A.Tooltip({\n\t\t\ttrigger : '#' + idOfElement,\n\t\t\tbodyContent : Liferay.Language.get(contentOfTooltip),\n\t\t}).render();\n\t});\n}", "title": "" }, { "docid": "00e8b0b651b405640b97be25b928b4f0", "score": "0.66546553", "text": "function showToggleClrToolTip() {\ndivText.style.display = \"block\";\n}", "title": "" }, { "docid": "772ae9fdee3d3d99e381510ac05e3f60", "score": "0.6653966", "text": "function initTooltips() {\n /// <summary>\n /// initialize tooltips for the datagrid\n /// </summary>\n popupManager.registerPopup(sectionNode, \"hoverIntent\",\n function () {\n if (this.target.attr(\"title\")) {\n if (this.target.isOverflowed()) {\n this.target.tooltipster({ theme: '.tooltipster-dark' }).tooltipster(\"show\");\n } else {\n this.target.removeAttr(\"title\");\n }\n }\n },\n {\n handleSelector: \".point-name, .category-name, .title-span\",\n useAria: false,\n timeout: 500\n }\n );\n }", "title": "" }, { "docid": "10cb948c7d2d4d2a7edecf56ff47b901", "score": "0.66468567", "text": "function tooltipTextConverter(info) {\n\t \tvar str = \"\";\n\t \tstr += \"Create Date: \" + info.createDate;\n\t \tstr += \"\\n \\n Program Elements: \" + info.programElements;\n\t \treturn str;\n\t }", "title": "" }, { "docid": "fa1c76cf3fca407ec08a2feee433e831", "score": "0.66390526", "text": "function ShowToolTipAtTop(ctrlID)\n{\n xstooltipatTop_show('divToolTips',ctrlID);\n return false;\n}", "title": "" }, { "docid": "686689c331e8bbf848b17bd92a44023d", "score": "0.6637185", "text": "function showTip(aEvent) {\r\n var tip = getAssociatedTipFromEvent(aEvent);\r\n \r\n if (tip) tip.show();\r\n }", "title": "" }, { "docid": "f0da90552b7ad6430579c90b02e44123", "score": "0.6634292", "text": "function showTooltip(event) {\n if (polyGetByClassName(containerCssClass).length > 0) hideTooltip();\n\n var triggerElement = event.target,\n tooltipType = triggerElement.getAttribute('data-tt-type'),\n frag = document.createDocumentFragment(),\n tooltipContainer = document.createElement('div'),\n tooltipPosX = event.pageX,\n tooltipPosY = event.pageY,\n tooltipContent;\n\n frag.appendChild(tooltipContainer);\n tooltipContainer.className = containerCssClass;\n tooltipContainer.style.cssText = 'left:'+tooltipPosX+'px;top:'+tooltipPosY+'px;';\n\n if (tooltipType === \"element\") {\n tooltipContent = triggerElement.parentNode.nextElementSibling.innerHTML;\n tooltipContainer.innerHTML = tooltipContent;\n } else {\n tooltipContent = triggerElement.getAttribute('title');\n tooltipContainer.innerHTML = tooltipContent;\n }\n\n if (config.hideOnMouseOut) {\n this.addEventListener('mouseout', hideTooltip);\n } else {\n var hideAnchor = document.createElement('a');\n hideAnchor.innerText = 'x';\n hideAnchor.className = 'hideTooltip';\n hideAnchor.addEventListener('click', hideTooltip);\n tooltipContainer.appendChild(hideAnchor);\n }\n\n bodyNode.appendChild(frag);\n triggerElement.setAttribute('data-status', 'active');\n }", "title": "" }, { "docid": "0c2abedaff46e748515c99539b3b3e53", "score": "0.6634126", "text": "function tooltipIcons(id) {\n\t\t\t\thoverTooltip(id, 'smileys');\n\t\t\t\thoverTooltip(id, 'colors');\n\t\t\t\thoverTooltip(id, 'save');\n\t\t\t\thoverTooltip(id, 'send');\n\t\t\t\thoverTooltip(id, 'webcam');\n\t\t\t\thoverTooltip(id, 'infos');\n\t\t\t}", "title": "" }, { "docid": "4569cf68f050a9712b0b33a3fb627b59", "score": "0.66335", "text": "function showTooltip(x, y, contents) { \n \t\t\tjQuery('<div id=\"tooltip\">' + contents + '</div>').css({ \t\n \t\t\ttop: y + 5,\n \t\t\tleft: x + 20 \t\t\t\n \t\t\t}).appendTo(\"body\").fadeIn(200);\n\t\t\t}", "title": "" }, { "docid": "eae09eea50295e290483af08978c6ec6", "score": "0.6628435", "text": "getTooltipText(nameOrEvent) \n\t{\n\t\tvar {casesData,casesDataLoaded} = this.state;\n\t\tconst LOCATION_NAME= (typeof nameOrEvent)===\"string\" ? nameOrEvent: getLocationName(nameOrEvent);\n\t\tlet CASES_DATA_RECORD={relative_danger_percentage:\"Loading\",cases_in_past_2_wks:\"Loading\"};\n\n\t\tif(casesDataLoaded)\n\t\t\tCASES_DATA_RECORD=this.getDataRecordForArea(LOCATION_NAME, casesData);\n\n\t\treturn <TooltipText location={LOCATION_NAME} dangerLevel={CASES_DATA_RECORD.relative_danger_percentage} casesInPastTwoWks={CASES_DATA_RECORD.cases_in_past_2_wks}/>;\n\t}", "title": "" }, { "docid": "0ea348751830b334f9afacd6f9c2f5c8", "score": "0.66258615", "text": "function showTooltip(x, y, contents) {\n $('<div id=\"tooltip\">' + contents + '</div>').css( {\n position: 'absolute',\n display: 'none',\n top: y - 30,\n left: x + 5,\n border: '1px solid black',\n padding: '2px',\n 'background-color': 'black',\n 'color': 'white',\n opacity: 0.80\n }).appendTo(\"body\").fadeIn(200);\n }", "title": "" }, { "docid": "5197f0ef7ab5da25e1c3ac26f45fbb1a", "score": "0.6625739", "text": "function MostrarTooltip(e){\n var nota = e.target;\n var key = nota.textContent - 1;\n tooltip.textContent = notas[0].children[key].textContent;\n tooltip.style.left = nota.getBoundingClientRect().left + window.pageXOffset + 'px';\n tooltip.style.top = nota.getBoundingClientRect().top + window.pageYOffset + 'px';\n tooltip.classList.remove(\"invisible\");\n tooltip.classList.add(\"visible\");\n}", "title": "" }, { "docid": "eebf3898a5627889e6fac8b00ceebb2b", "score": "0.6622449", "text": "function draw() {\n // + UPDATE TOOLTIP\n}", "title": "" }, { "docid": "829bb152581685d6ac897d2f38d72e2a", "score": "0.6621274", "text": "mouseoverHandler(d) {\n this.state.tooltip.transition().style('opacity', .9)\n this.state.tooltip.html('<p>' + d[\"name\"] + '</p>');\n }", "title": "" }, { "docid": "34f5ab0f5edd21bbf594150e4db6f18a", "score": "0.6620113", "text": "function showTooltip(x, y, contents) {\n\t$(\"<div id='chartTooltip'>\" + contents + \"</div>\").css({\n\t\tposition: \"absolute\",\n\t\tdisplay: \"none\",\n\t\ttop: y + 5,\n\t\tleft: x + 5,\n\t}).appendTo(\"body\").fadeIn(200);\n}", "title": "" }, { "docid": "e88cafcbb03283a6be8ca24cc1d536eb", "score": "0.6615627", "text": "function showTooltip(d) {\n tooltip.style('left', (d3.event.pageX + 10) + 'px')\n .style('top', (d3.event.pageY - 25) + 'px')\n .style('display', 'inline-block')\n .html(d.stat + \" : \" + d.value);\n }", "title": "" }, { "docid": "3c4c2e9d1d782d0a8e97d616ec2f99a4", "score": "0.6615467", "text": "function showTooltip(e)\n { // Get the content of the tooltip.\n var a_tag = tooltip.target,\n a_tag_name = a_tag.href.rpartition('#', 1),\n sym_tag = $(document.getElementsByName(a_tag_name)[0]);\n sym_tag = sym_tag.parent().clone();\n sym_tag.find(\".plink, .srclink\").remove();\n // Create the tooltip.\n var tt = tooltip.current = $(\"<div class='tooltip'/>\");\n tt.append(sym_tag[0].childNodes); // Contents of the tooltip.\n // Substract scrollTop because we need viewport coordinates.\n var top = e.pageY + tooltip.offset.y - $(window).scrollTop(),\n left = e.pageX + tooltip.offset.x;\n // First insert hidden to get a height.\n tt.css({visibility: \"hidden\", position: \"fixed\"})\n .appendTo(document.body);\n // Correct the position if the tooltip is not inside the viewport.\n var overflow = (top + tt[0].offsetHeight) - window.innerHeight;\n if (overflow > 0)\n top -= overflow;\n tt.css({display: \"none\", visibility: \"\", top: top, left: left})\n .fadeIn(tooltip.fadein);\n }", "title": "" }, { "docid": "6082199b682c40e0bb27dfca27c7af22", "score": "0.6607023", "text": "function updateHoverText(){\n\t\tinfo.update = function (props) {\n\t\t\tif(showHover){\n\t\t\t\tthis._div.innerHTML = (props ? props.Property_Address + \" \" + props.Property_Name\n\t\t\t\t\t\t: 'Hover over property to see name');\n\t\t\t}\n\t\t};\n\t\n\t\tinfo.addTo(hercMap);\n\t}", "title": "" }, { "docid": "cd83f5f5337cd6ba2e9f8f8ddf81dcdd", "score": "0.6605389", "text": "addTooltip(elem, data) {\n var title = '<div class=\"tooltip_content\"><div class=\"tooltip_section\"><b>'+data.anc + '</b> ('+data.cohortAncestry.split(sep)[0]+')</div>';\n title += '<div class=\"tooltip_section\">Score ID: <b>'+data.pgs+'</b></div>';\n title += '<div class=\"tooltip_section\">';\n if (data.et) {\n title += '<div>Upper 95: <b>' + data.et + '</b></div><div>Estimate: <b>' + data.y + '</b></div><div>Lower 95: <b>' + data.eb + '</b></div>';\n }\n else {\n title += '<div>Value: <b>' + data.y + '</b></div>';\n }\n title += '</div>';\n title += '<div class=\"tooltip_section\">';\n title += '<div>Sample number: <b>' + data.s_num + '</b>';\n if (data.s_cases) {\n var percent = '';\n if (data.s_cases_p) {\n percent = ' ('+data.s_cases_p+'%)';\n }\n title += '<div>Sample cases: <b>' + data.s_cases + '</b>'+percent;\n }\n if (data.s_ctrls) {\n title += '<div>Sample controls: <b>' + data.s_ctrls + '</b>';\n }\n title += '</div>';\n title += '</div>';\n elem.tooltip({\n 'title': title,\n 'placement': 'right',\n 'html': true\n });\n }", "title": "" }, { "docid": "1480a11fd04a2e8574cedf5dd339fa2f", "score": "0.6604332", "text": "function com_zimbra_example_customtooltip_HandlerObject() {\r\n}", "title": "" }, { "docid": "1b20b93cd7e2cbedd839548b003153ad", "score": "0.66008157", "text": "function displayBtnTooltip(btn) {\n\t\tif (btn == saveQuoteBtn) {\n\t\t\tdocument.querySelector(`#tooltipSaveBtn`).style.display = \"flex\"\n\t\t} else if (btn == createyoursBtn) {\n\t\t\tdocument.querySelector(`#tooltipMakeBtn`).style.display = \"flex\"\n\t\t}\n\t\telse if (btn == clearForm) {\n\t\t\tdocument.querySelector(`#tooltipClearForm`).style.display = \"flex\"\n\n\t\t} else if (btn == help) {\n\t\t\tdocument.querySelector(`#tooltipHelp`).style.display = \"flex\"\n\t\t}\n\t\telse {\n\t\t\tdocument.querySelector(`#tooltipGetBtn`).style.display = \"flex\"\n\t\t}\n\t\ttimerBtnTooltip(btn)\n\t}", "title": "" }, { "docid": "d01a5cbf2e788fd450b2ec0c8413d310", "score": "0.6599841", "text": "function show(element) {\r\n $toolTipIsShown = true;\r\n if (!hasClass(element, 'tooltip-show')) {\r\n element.className = element.className + ' tooltip-show';\r\n }\r\n }", "title": "" }, { "docid": "52fe755585c3255092bb86b33b8927e4", "score": "0.6599083", "text": "function Tooltip() {\n this.elem = document.querySelector('#tooltip');\n this.targets = [\n {\n elem: document.querySelector('#layout-alphabetic'),\n text: 'Order images alphabetically by filename',\n },\n {\n elem: document.querySelector('#layout-umap'),\n text: 'Cluster images via UMAP dimensionality reduction',\n },\n {\n elem: document.querySelector('#layout-grid'),\n text: 'Represent UMAP clusters on a grid',\n },\n {\n elem: document.querySelector('#layout-date'),\n text: 'Order images by date',\n },\n {\n elem: document.querySelector('#layout-categorical'),\n text: 'Arrange images into metadata groups',\n },\n {\n elem: document.querySelector('#layout-geographic'),\n text: 'Arrange images using lat/lng coordinates',\n },\n {\n elem: document.querySelector('#settings-icon'),\n text: 'Configure plot settings',\n },\n ];\n this.targets.forEach(function(i) {\n i.elem.addEventListener('mouseenter', function(e) {\n if (e.target.classList.contains('no-tooltip')) return;\n var offsets = i.elem.getBoundingClientRect();\n this.elem.textContent = i.text;\n this.elem.style.position = 'absolute';\n this.elem.style.left = (offsets.left + i.elem.clientWidth - this.elem.clientWidth + 9) + 'px';\n this.elem.style.top = (offsets.top + i.elem.clientHeight + 16) + 'px';\n }.bind(this));\n i.elem.addEventListener('mouseleave', this.hide.bind(this))\n }.bind(this));\n}", "title": "" }, { "docid": "c6783fd0c6ef002c842f8a7e04db2661", "score": "0.6593143", "text": "function sample2Tip (event){\n\tTip('Show the <b>Google Analytics Page</b> ');\n}", "title": "" }, { "docid": "c4b98c236eb014956c277f4d33c4ccc9", "score": "0.65921146", "text": "function doShow()\n {\n // This is required logic flow: show it, then make it hidden\n // so that the browser can calculate its dimensions. This\n // allows the chance to call onPlacement to adjust the XY\n // position. After the adjustment, make it visible.\n\n if (typeof cfg.showHow == \"string\") {\n $tip[ cfg.showHow || \"show\"](cfg.showSpeed);\n } else {\n $tip.show();\n }\n\n $tip.get(0).style.visibility=\"hidden\";\n try {\n var tipOffset = { x: cfg.offsetX, y: cfg.offsetY };\n cfg.onPlacement.apply(\n tag,\n [\n evt,\n $tip.get(0),\n cfg.viewPort?$(cfg.viewPort).get(0):window,\n tipOffset\n ]);\n } catch(e) {\n alert(e.message);\n }\n $tip.get(0).style.visibility=\"visible\";\n }", "title": "" }, { "docid": "f2041ab9bf17f5141b708d910b528b2a", "score": "0.6587686", "text": "function showTip()\n{\n\tif (m_oDivToolTip == null) return true;\n\tif (m_bShowingToolTip && window.event.srcElement == m_elementShowingTip) return true;\n\n\tif (_needToShowToolTip(window.event.srcElement) == false) return true;\n\n\tm_bShowingToolTip = true;\n\tm_elementShowingTip = window.event.srcElement;\n\tm_oDivToolTip.innerHTML = m_elementShowingTip.innerHTML;\n\t\n\tvar nX = nY = 0;\n\tfor (var p = m_elementShowingTip; p && p.tagName != \"BODY\"; p = p.offsetParent) \n\t{\n\t\tnX += (p.offsetLeft-p.scrollLeft);\n\t\tnY += (p.offsetTop-p.scrollTop);\n\t}\n\tm_oDivToolTip.style.left = nX;\n\tm_oDivToolTip.style.top = nY;\n\n\tvar oRectTD = window.event.srcElement.getBoundingClientRect();\n\tm_oDivToolTip.style.width = oRectTD.right - oRectTD.left;\n\tm_oDivToolTip.style.display = \"block\";\n}", "title": "" }, { "docid": "ddda4e7a47dfb3ed68c8d246f9d53d22", "score": "0.6584788", "text": "function switchToolTip() {\r\n document.getElementById('qmark').onmouseover = function() {\r\n var toolTip = document.getElementById('ttip');\r\n toolTip.style.display = 'block';\r\n }\r\n document.getElementById('qmark').onmouseout = function() {\r\n var toolTip = document.getElementById('ttip');\r\n toolTip.style.display = 'none';\r\n }\r\n}", "title": "" }, { "docid": "12a14f7291ac3a973bf7b65ef3f51337", "score": "0.6584185", "text": "function show() {\n\t cancelShow();\n\t cancelHide();\n\t\n\t // Don't show empty tooltips.\n\t if (!ttScope.content) {\n\t return angular.noop;\n\t }\n\t\n\t createTooltip();\n\t\n\t // And show the tooltip.\n\t ttScope.$evalAsync(function() {\n\t ttScope.isOpen = true;\n\t assignIsOpen(true);\n\t positionTooltip();\n\t });\n\t }", "title": "" }, { "docid": "280c9d5076d105ad64259806b829dfef", "score": "0.6567524", "text": "function getHelp() {\n\tvar msg = \"Choose a description for the error you are correcting. Please be as specific as possible while still accurately capturing the error you have identified.\";\n\t$(\"#help\" + num_corr).qtip({\n\t\tcontent : msg,\n\t\tshow : { when : 'mouseover', effect : { type : 'slide', length : '500' } },\n\t\thide : { when : 'mouseout', effect : { type : 'slide', length : '500' } },\n\t\tposition : { target : $(\"#orig\"), corner : { target : 'topMiddle', tooltip : 'topMiddle' } },\n\t\tstyle : { width : { max : 1000 }, name : 'blue' },\n\t\tapi : { beforeShow : function() { hasHelpQtip = true; }, beforeDestroy : function() { hasHelpQtip = false; } }\n\t});\n}", "title": "" }, { "docid": "0730a1dd7905c8fa2941d63522be68d3", "score": "0.65644515", "text": "function songToolTip(s) {\n return `<div class=\"d3-tip\">\n <div>${s.title} (${Math.floor(s.yearf)})</div>\n <div style=\"text-align: center;\">${comm.rscore_to_readable(s.rscore)} compressed</div>\n </div>`;\n}", "title": "" }, { "docid": "08bffe9f9aed36db4cc9877de338cf22", "score": "0.6561281", "text": "function hoverTooltip(id, type) {\n\t\t\t\t$(\"#\" + id + \" .tools-\" + type + \", #\" + id + \" .bubble-\" + type).hover(function() {\n\t\t\t\t\t$(\"#\" + id + \" .bubble-\" + type).show();\n\t\t\t\t}, function() {\n\t\t\t\t\t$(\"#\" + id + \" .bubble-\" + type).hide();\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "f261c5d81525316dcb6469cbca5e1590", "score": "0.6561146", "text": "function showTooltip(x, y, contents, z) {\n $('<div id=\"flot-tooltip\">' + contents + '</div>').css({\n top: y,\n left: x,\n \"border-color\": z,\n }).appendTo(\"body\").fadeIn(200);\n }", "title": "" }, { "docid": "fe373e8d698e67fe1cbc3b79fd5e1c02", "score": "0.6559025", "text": "function setupToolTip()\n{\n tooltip = d3.select(\"body\").append(\"div\").attr(\"class\", \"toolTip\");\n linetooltip = d3.select(\"body\").append(\"div\").attr(\"class\", \"toolTip\");\n}", "title": "" }, { "docid": "8ed58fe02a5b411de875d1a182f0454c", "score": "0.6556156", "text": "function updateTooltip(){\n tooltip.children[0].innerHTML = slider.value;\n}", "title": "" }, { "docid": "98d157e5985eb234329b1402acf978f5", "score": "0.655295", "text": "function showRef(event) {\n // show the tooltip when hovering over the little reflink\n var anchorx = event.target.getBoundingClientRect().left;\n var anchory = event.target.getBoundingClientRect().top;\n var anchorw = event.target.clientWidth;\n var tooltip = document.getElementsByClassName(\"tooltip\")[0];\n var text = document.getElementById(event.target.getAttribute(\"href\").substring(1)).getElementsByTagName(\"span\")[0].innerHTML;\n tooltip.innerHTML = text;\n // tooltip.removeChild(tooltip.getElementsByTagName(\"a\")[0]);\n tooltip.style.display = 'block';\n tooltip.style.top = anchory - tooltip.clientHeight - 9;\n tooltip.style.left = anchorx - 30;\n tooltip.style.opacity = 1;\n}", "title": "" }, { "docid": "802218b1a35380da548b0f3f74ce7c1c", "score": "0.6544973", "text": "function show(element) {\n $toolTipIsShown = true;\n if (!hasClass(element, 'tooltip-show')) {\n element.className = element.className + ' tooltip-show';\n }\n }", "title": "" }, { "docid": "73395decd321514ce41ee697ebcb37b1", "score": "0.65427834", "text": "function getTip(value){\t\r\n\tTip(\"<Table border=0> \"+ value +\" </table>\");\t\r\n}", "title": "" }, { "docid": "957b03b7dcf6cb585889b447247bf38a", "score": "0.65386355", "text": "function setMetaToolTips() {\n $scope.currentZpoint.metaData.metaData.forEach(function (metaField) {\n var tmpSrc = null,\n helpText = \"\";\n\n $scope.currentZpoint.metaData.srcProp.some(function (src) {\n if (metaField.srcProp === src.columnName) {\n tmpSrc = src;\n return true;\n }\n });\n if (mainSvc.checkUndefinedNull(tmpSrc) || mainSvc.checkUndefinedNull(tmpSrc.deviceMapping) || mainSvc.checkUndefinedNull(tmpSrc.deviceMappingInfo)) {\n\n return false;\n }\n metaField.haveToolTip = true;\n helpText += \"<b>Ячейка памяти прибора:</b> \" + tmpSrc.deviceMapping + \"<br><br>\";\n helpText += \"<b>Назначение:</b> <br> \" + tmpSrc.deviceMappingInfo;\n var targetElem = \"#srcHelpBtn\" + metaField.metaOrder + \"srcProp\";\n mainSvc.setToolTip(\"Описание поля источника\", helpText, targetElem, targetElem, 10, 500);\n });\n }", "title": "" }, { "docid": "2ef07fbe7b583d96702eb2982a38d56c", "score": "0.65306306", "text": "function showTooltip(item, contents) {\n $('<div id=\"tooltip\">' + contents + '</div>').css( {\n position: 'absolute',\n display: 'none',\n top: item.pageY + 5,\n left: item.pageX + 15,\n border: '1px solid #fff',\n padding: '8px',\n 'background-color': item.series.color,\n color : '#fff',\n opacity: 1,\n borderRadius: '5px'\n \n }).appendTo(\"body\").fadeIn(200);\n}", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.6527761", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.6527761", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.6527761", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.6527761", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.6527761", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" } ]
cd3096c1498b409d16ccf442fd9a8ae5
Section Write a function here... that takes an array as a parameter returns an array of products that have an incoming delivery
[ { "docid": "be92d463ba76235cbd08195f8389ce75", "score": "0.73564637", "text": "function filterProductsThatNeedToBeReceived(products) {\n const filteredProducts = [];\n for (let i = 0; i < products.length; i++) {\n const product = products[i];\n const incomingDelivery = product.stock.incomingDelivery;\n\n if (incomingDelivery) {\n filteredProducts.push(product);\n }\n }\n return filteredProducts;\n}", "title": "" } ]
[ { "docid": "79d7a9be688be801d03d518417c2b8df", "score": "0.6552152", "text": "function filterProductsThatNeedToBeOrdered(products) {\n const filteredProducts = [];\n\n for (let i = 0; i < products.length; i++) {\n const product = products[i];\n if (\n product.stock.quantity < 100 &&\n product.stock.incomingDelivery === false\n ) {\n filteredProducts.push(product);\n }\n }\n return filteredProducts;\n}", "title": "" }, { "docid": "282f62378ca434835f2ffa0a3ab14462", "score": "0.6012695", "text": "function newCheckProductArray(product){\n previousArray = previousArray.slice(-6, previousArray.length);\n while(previousArray.includes(product)){\n console.log('previous array contains ', product);\n product = Math.floor(Math.random() * allProducts.length);\n }\n return product;\n}", "title": "" }, { "docid": "e2fecd003a3a02876694e37e43676982", "score": "0.59901977", "text": "availableProducts (state, getters) {\n return state.products.filter(product => product.inventory > 0)\n }", "title": "" }, { "docid": "e2fecd003a3a02876694e37e43676982", "score": "0.59901977", "text": "availableProducts (state, getters) {\n return state.products.filter(product => product.inventory > 0)\n }", "title": "" }, { "docid": "fc7c835436ba53c73a499cdc295365f2", "score": "0.59804016", "text": "function testForAnna(products) {\n var array;\n for (var i = 0; i < products.length; i++) {\n var products = products[i];\n }\n\n return array;\n}", "title": "" }, { "docid": "65ab61b0dfca7eb9d2fc28431a4a6399", "score": "0.5896978", "text": "function delivery(order, shoppers) {\n const result = shoppers.map( shopper => {\n let time = ((order[0] + shopper[0]) / shopper[1]) + shopper[2];\n \n if (time < order[1]) return false;\n if (time > order[1] + order[2]) return false;\n \n return true;\n })\n \n \n return result;\n}", "title": "" }, { "docid": "4bab23b89124e38b6b40443b33385a2f", "score": "0.5803463", "text": "function getResponse(arr, prod, count) {\n // console.log(arr)\n for (let product of arr) {\n // console.log(product.name)\n // проверяем есть ли желаемый товар prod в массиве продуктов\n // ==================\n // if (product.name === prod) {\n // console.log(`${prod} есть на складе`)\n // if (product.quantity >= count) {\n // let cost = product.price * count\n // console.log(`${prod} можете купить за ${cost} монет`)\n // } else {\n // console.log(`${prod} нет в достаточном количестве`)\n // }\n // ==================\n const { name, quantity, price } = product\n // if (name === prod) {\n // // console.log(`${prod} есть на складе`)\n // return quantity >= count\n // ? console.log(`${prod} можете купить за ${price * count} монет`)\n // : console.log(`${prod} нет в достаточном количестве`)\n // }\n // ==================\n }\n console.log(`${prod} нет такого на складе`)\n}", "title": "" }, { "docid": "67a293423728fe9ec4e14888b27bfa7b", "score": "0.57621384", "text": "function successfullyReceivedProducts(data) {\n\t\t\t\treturn data;\n\t\t\t}", "title": "" }, { "docid": "fa1d7126ec4ea8ab0dee218f01b1a378", "score": "0.57464784", "text": "function getNotSoldWaybillProducts(waybillId) {\n \n // get the output1 sheet\n\tvar sheet = getOutputSheet(1)\n \n // get the first cell of the Output1 sheet\n var cell = getOutputFirstCell(1);\n \n // set the formula to get the asked information\n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, J, L, sum(I) where J='No Vendido' and A=\"+waybillId+\" group by G, F, H, J, L\\\")\");\n \n // find the inventory of each product\n sheet.getRange(2,7,sheet.getLastRow()-1,1).setFormula(\"=IFERROR(INDEX(Productos!K:K;MATCH(A2;Productos!A:A;0);0))\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow()-1, 7).getValues();\n \n if (products.length > 0) {\n \n products.reduce( \n\t\tfunction(p, c) { \n \n // if the inventory is greater than zero, add it to the list\n var inventory = c[5];\n \n if (inventory > 0) {\n \n\t\t\tp.push(c); \n }\n\t\t\treturn p; \n\t\t}, []); \n }\n \n \n return JSON.stringify(products);\n}", "title": "" }, { "docid": "8b27ba461ea2ae9a1924b5dcd0d9dc75", "score": "0.57402533", "text": "function findAll() {\n if (productosArray.length < 1) return false;\n return productosArray;\n}", "title": "" }, { "docid": "b535246c91c66644c7854934b557ae41", "score": "0.5736712", "text": "productsOnStock(state) { \n return state.products.filter(\n product => { return product.inventory > 0 }\n )\n }", "title": "" }, { "docid": "a2cb4beaeebb1fa9883a98367f5154c5", "score": "0.5698", "text": "function testForZombieSean(product1s) {\n var price;\n for (var i = 0; i < products.length; i++) {\n var products = products[i];\n \n }\n\n return price;\n}", "title": "" }, { "docid": "edf99a4594a486ed14d02f5fa60dbdda", "score": "0.5672781", "text": "async getActiveProducts() {\n let productsResponse = await this.getAllProducts();\n let products = productsResponse.data;\n\n var activeProducts = products.filter(p => p.active == 1);\n return activeProducts;\n }", "title": "" }, { "docid": "81e84ad74c7abcd361924d76c0ca609d", "score": "0.56365937", "text": "function getAvailable(){\n // Get the products available for purchase.\n inappbilling.getAvailableProducts(successHandler, errorHandler);\n\n }", "title": "" }, { "docid": "794fca889f11fefb53e6c2745c85ffc5", "score": "0.56188893", "text": "async findDeliveryByProduct(req, res) {\n const Op = Sequelize.Op;\n const filter = req.query.filter;\n let response = [];\n if (filter !== undefined) {\n response = await Deliveri.findAll({\n include: [\n {\n model: DeliveryManModel,\n as: \"deliveryman\",\n include: [\n {\n model: Files,\n as: \"avatarid\",\n },\n ],\n },\n {\n model: RecipientsModel,\n as: \"recipient\",\n },\n // ,\n // {\n // model: DeliveryProblems,\n // as: \"deliveryProblems\"\n // }\n ],\n where: {\n product: {\n [Op.like]: `%${filter}%`,\n },\n },\n });\n } else {\n response = await Deliveri.findAll();\n }\n\n return res.json(response);\n }", "title": "" }, { "docid": "1b30e3c3cb7ca47dbad5d31616a2a16d", "score": "0.5548448", "text": "function getTotalPrice(chosenProducts) {\n\tchosenWithoutPrice = [];\n\tvar prod;\n\tconsole.log(chosenProducts);\n\tfor(let i = 0; i<chosenProducts.length; i++){\n\t\tprod = chosenProducts[i].split(\" \")[0];\n\t\tchosenWithoutPrice.push(prod);\n\t}\n\tconsole.log(chosenWithoutPrice);\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenWithoutPrice.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "30cd94cbf7c96035107d2af7d7308d8f", "score": "0.5528173", "text": "function getOrderIdsFromDelivery(delivery_id){\n $.ajax({\n type: \"POST\",\n url:\"/Cluk/php/queries/getOrderInfoFromDelivery.php\",\n data: {delivery_id},\n dataType: \"json\",\n success: function(rows){\n $(\"#itemsDeliveryId\").html(`Delivery: ${delivery_id}`);\n var delivery = new Array();\n $.each(rows, function(key, row){\n var order = {order_id: row.order_id, destination: null, delivery_id: delivery_id};\n delivery.push(order);\n })\n $(\"#itemsContent\").html(\"\");\n getOrderIngredients(delivery[0].order_id, delivery[0].delivery_id, delivery, 0);\n },\n error: function(){\n alert(queryErrorText + \" (getOrderInfoFromDelivery)\");\n }\n });\n}", "title": "" }, { "docid": "3e8a208fb4ea72799fe1ac932a7dc438", "score": "0.55206895", "text": "function findIPhone12(products) {\n let foundProduct = null;\n\n for (let i = 0; i < products.length; i++) {\n const product = products[i];\n\n if (product.name === \"iPhone 12\") {\n foundProduct = product;\n }\n }\n return foundProduct;\n}", "title": "" }, { "docid": "683341e14ab66ef5ec3771f7bcf83a1a", "score": "0.5513866", "text": "function get_products() {\n return list\n }", "title": "" }, { "docid": "79b9dbc12037bd2e3502ac14c2e4ab0d", "score": "0.55093133", "text": "deliveries() {\n return store.deliveries.filter(delivery => {\n return delivery.neighborhoodId === this.id;\n });\n }", "title": "" }, { "docid": "fe624fd5a71203036e986f6c5909916a", "score": "0.54909873", "text": "function allItemsSold (sellerID) {\n var itemsSold = []\n for (let i in allItems) {\n if (allItems[i].isSold === true) {\n if (allItems[i].sellerID === sellerID) {\n itemsSold.push(allItems[i])\n }\n }\n // if (itemsSold === undefined) {\n // return null\n }\n console.log('these are the items sold', itemsSold)\n return itemsSold\n}", "title": "" }, { "docid": "b6a89f13aab727fe04ea70c1efb141da", "score": "0.54852325", "text": "function filterIngr(array) {\n return array.filter(ing=> ing.quantity > 0);\n}", "title": "" }, { "docid": "0d18e3cc4a0c8234e09ea20fec2e3229", "score": "0.548301", "text": "function availableFlights(price) {\n p = parseInt(price);\n var copyFlights = flights.filter(function(el) {\n if (el.cost <= price) {\n return true;\n } else {\n return false;\n }\n });\n return copyFlights;\n }", "title": "" }, { "docid": "25b2ec488c8e5491985772843eac05e2", "score": "0.547716", "text": "meals() {\n let meals = this.deliveries().map(delivery => delivery.meal());\n return meals.filter(function(meal, index, meals) {\n return meals.indexOf(meal) === index;\n });\n }", "title": "" }, { "docid": "8c3e4fcd01cf39b4381abeec12e1e90d", "score": "0.5465247", "text": "checkLease(array) {\n this.leasableProducts = [];\n this.leasableProducts = array.filter(item => item.leasable);\n if (\n this.checkoutData.deliveryOrderGroups &&\n this.checkoutData.deliveryOrderGroups[0] &&\n this.checkoutData.deliveryOrderGroups[0].entries &&\n this.checkoutData.deliveryOrderGroups[0].entries[0] &&\n this.checkoutData.deliveryOrderGroups[0].entries[0].splitEntries &&\n this.checkoutData.deliveryOrderGroups[0].entries[0].splitEntries[0]\n ) {\n this.leaseCountry = [];\n const leaseCountries = this.checkoutData.deliveryOrderGroups[0].entries;\n this.leasableQtyItems = [];\n this.leaseCountry = leaseCountries.map((item) => {\n if (item.splitEntries.length > 0) {\n return item.splitEntries.map((entry) => {\n const leasableQtyItem = {};\n if (item.leasable) {\n leasableQtyItem[\n entry.deliveryAddress.country.isocode\n ] = parseInt(entry.qty);\n this.leasableQtyItems.push(leasableQtyItem);\n }\n return entry.deliveryAddress.country;\n });\n }\n });\n const leaseFlatenCountry = _.flattenDeep(this.leaseCountry);\n this.leaseCountry = _.uniqBy(leaseFlatenCountry, 'isocode');\n }\n if (this.leasableProducts.length > 0) {\n const leaseableIndex = this.getSectionIndex('leaseAgreement');\n this.setVisible(leaseableIndex, true);\n }\n }", "title": "" }, { "docid": "9d067f3ad53b5b663f171bd54d68178c", "score": "0.54566365", "text": "deliveries() {\n return store.deliveries.filter(delivery => delivery.neighborhoodId === this.id);\n }", "title": "" }, { "docid": "c64b20b66f97c8664dd42d1c0ad7c9c4", "score": "0.5446021", "text": "function getallProducts(nonzeroInventory){\r\n\tconsole.table(nonzeroInventory);\r\n\r\n\tinquirer.prompt([{name:\"selectedIDs\",message:\"Choose ids of products that you'd like to buy.\",choices:itemIDs,type:\"checkbox\"}]).then(function(response){\r\n\t\tresponse.selectedIDs.length>0? setQuant(response.selectedIDs):getallProducts(nonzeroInventory);\r\n\t});\r\n}", "title": "" }, { "docid": "d57be85e92541f52a9b7301759d775b2", "score": "0.5432951", "text": "meals() {\n let thisNeighborhoodDeliveries = this.deliveries().map( delivery => delivery.meal() );\n\n console.log(thisNeighborhoodDeliveries);\n function onlyUnique(value, index, self) {\n //indexOf goes through the array(in order) looking for the value(object), when it hits that value(object) it stops and returns the index\n //for a repeated value, it stops at the first value, and never hits the second one, indexOf will always return the index of the first value of the repeated values\n //therefore if you a looping throuh the array with indexOf, and you are at an index past the first value, and you have a repeat value, the indexOf the value will not be the same as the actual index, therefore that value will not be added to the return array\n\n return self.indexOf(value) === index;\n }\n //A set is a collection of values which can be iterated upon in the order of insertion. A value in the set may only occur once; it is unique in the set’s collection.\n \n const uniqueValues = [...new Set(thisNeighborhoodDeliveries)];\n //return thisNeighborhoodDeliveries.filter(onlyUnique);\n return uniqueValues;\n\n }", "title": "" }, { "docid": "2a5b1baab936d89d8dbbff693c2c1939", "score": "0.54052126", "text": "function getProductsByPartyId(partyId) {\n\t\t\t\tvar httpPromise = http.get('Product/GetCollectionByPartyId/' + partyId);\n\t\t\t\tvar newPromise = httpPromise.then(successfullyReceivedProducts, failedToReceiveProducts);\n\n\t\t\t\treturn newPromise;\n\t\t\t}", "title": "" }, { "docid": "bb02f01a8b4139a331a634a3710b17fe", "score": "0.54034716", "text": "deliveries() {\n return store.deliveries.filter(delivery => {\n return delivery.customerId === this.id;\n });\n }", "title": "" }, { "docid": "4443b4151910f545b54dd95aa0f865ab", "score": "0.53903353", "text": "function getProductsArrayFromBill(b) {\n var products = b.products;\n return $.map(products, function (val, keyAmt) {\n if (keyAmt.substr(keyAmt.length - 3, keyAmt.length) == \"Amt\") {\n var sku = keyAmt.substr(0, keyAmt.length - 3);\n var price = products[sku + \"Price\"];\n return {name: sku, amount: val, price: price, subtotal: val * price || 0};\n }\n });\n}", "title": "" }, { "docid": "9359f833803339dcbf9dd48916ea8633", "score": "0.5381294", "text": "function availableProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n console.log(\"\\n \" + \"These are all available products at this time: \".cyan.bold + \" \\n\");\n for (let i = 0; i < res.length; i++) {\n if (res[i].stock_quantity > 0) {\n console.log(res[i].id + \" | \" + (\"Item: \" + res[i].product_name).magenta + \" | \" + (\"Department: \" + res[i].department_name).yellow + \" | \" + (\"Price: $\" + res[i].price).blue + \" | \" + (\"Quantity Available: \" + res[i].stock_quantity).cyan);\n console.log(\"-----------------------------------\".green + \" \\n\");\n }\n }\n })\n}", "title": "" }, { "docid": "1fa248a51c8acb224f94702d3f267413", "score": "0.53705174", "text": "static getProducts() {\n return new Promise((resolve, reject) => {\n if (products) {\n resolve(products);\n }\n else {\n reject();\n }\n });\n }", "title": "" }, { "docid": "686359c1a6840e1e883038fc823be88b", "score": "0.5368913", "text": "function getProductsArrayFromBill(b) {\n var products = b.products;\n return $.map(products, function (val, keyAmt) {\n if (keyAmt.substr(keyAmt.length - 3, keyAmt.length) == \"Amt\") {\n var sku = keyAmt.substr(0, keyAmt.length - 3);\n var price = products[sku + \"Price\"];\n return {name: sku, amount: val, price: price, subtotal: val * price};\n }\n });\n}", "title": "" }, { "docid": "5fde2469de06bb77290d7351d5f5f905", "score": "0.5359854", "text": "function filterByType(products, targetType) {\n const filteredProducts = [];\n\n for (let i = 0; i < products.length; i++) {\n const product = products[i];\n const type = product.type;\n\n if (type === targetType) {\n filteredProducts.push(product);\n }\n }\n return filteredProducts;\n}", "title": "" }, { "docid": "910fb3aabdf8402b4f3ec95ee022b0f7", "score": "0.53482985", "text": "function isAProductArray(array, callback) {\n if(!array.length>0){\n callback(false);\n return;\n }\n var ids=[array.length];\n for(i=0; i <array.length; i++) {\n if(!array[i] || !parseInt(array[i].id) || !parseInt(array[i].quantity)) {\n callback(false);\n return;\n }\n ids[i]=parseInt(array[i].id);\n array[i].id = parseInt(array[i].id);\n array[i].quantity = parseInt(array[i].quantity);\n }\n\n\n Product.getProductsById(ids, function(errorCode, products){\n\n if(products && array.length!=products.length){\n callback(false);\n return;\n }else{\n callback(true);\n return;\n }\n });\n}", "title": "" }, { "docid": "c1c3abf57793ab239e93572aada741bd", "score": "0.53378665", "text": "function search(array, input, type, isEmptyInput) {\n var found = [];\n var max = array.length;\n\n var keys = (type === 'products') ? ['title', 'actors', 'year', 'directors'] : ['orderNumber', 'status'];\n\n /**\n * Iterates over each product and checks if any user input matches a value in products using a key found in keys.\n */\n for (var i = 0; i < max; i++) {\n if (!isEmptyInput) {\n var words = \"\";\n\n /**\n * Converts the values returned by using an element in keys as the key to a string and concatenates\n * it to words in lowercase format.\n */\n for (var j = 0; j < keys.length; j++) {\n if (j + 1 < keys.length) {\n words += String(array[i][keys[j]]).trim().toLowerCase() + \" \";\n }\n else {\n words += String(array[i][keys[j]]).trim().toLowerCase();\n }\n }\n\n /**\n * If the words string contains the input string, the product is pushed to the found array.\n */\n if (words.includes(input)) {\n found.push(array[i]);\n }\n else {\n /**\n * The user input is split by whitespace and commas.\n */\n var inputArray = input.split(/[ ,]+/);\n\n /**\n * Iterates over inputArray and checks to see if an element in inputArray is contained in the\n * words string.\n */\n for (var k = 0; k < inputArray.length; k++) {\n if (inputArray[k].trim().length !== 0) {\n /**\n * If the current inputArray element isn't empty and is found within the words string,\n * the product is pushed to the found array provided that it isn't in the array already.\n */\n if (words.includes(inputArray[k].trim()) && !validator.isEmpty(inputArray[k].trim())) {\n isInArray(array[i], found) ? false : found.push(array[i]);\n }\n else if (type === 'orders') {\n /**\n * If the type is 'orders', the inputArray element is checked to see if it's\n * within the products shipping name/billing name.\n */\n var shippingName = array[i]['shipping']['firstName'].toLowerCase() + \" \" + array[i]['shipping']['lastName'].toLowerCase();\n var billingName = array[i]['billing']['firstName'].toLowerCase() + \" \" + array[i]['billing']['lastName'].toLowerCase();\n\n if (shippingName.includes(inputArray[k]) || billingName.includes(inputArray[k])) {\n isInArray(array[i], found) ? false : found.push(array[i]);\n }\n }\n }\n }\n }\n }\n else {\n /**\n * The product is pushed to the found array if the user input is an empty string.\n */\n found.push(array[i]);\n }\n }\n\n return found;\n}", "title": "" }, { "docid": "26be94ac49657e9a63a51e2b07d3270a", "score": "0.5317092", "text": "function findProductsInPriceRange( productObjs, rangeObj){\r\n let outProducts = [];\r\n for( i = 0; i < productObjs.length; i++) {\r\n if( productObjs[i].suggestedPrice < rangeObj.max ) {\r\n outProducts.push(productObjs[i]);\r\n }\r\n }\r\n return outProducts;\r\n}", "title": "" }, { "docid": "7acd51fa20ea2b8603af9ef9d6fd9297", "score": "0.5303321", "text": "deliveries() {\n return store.deliveries.filter(delivery => {\n return delivery.customerId === this.id;\n });\n }", "title": "" }, { "docid": "ca32af340eafc34b53dcaa112600721c", "score": "0.5301874", "text": "function checkDeliveries( item ) {\n Y.doccirrus.jsonrpc.api.stockdelivery.read( {\n query: {\n stocks: {$elemMatch: {references: item._id}},\n status: \"arrived\"\n }\n } )\n .done( function( result ) {\n if( result && result.data.length ) {\n orderNo = result.data.map(function(order){\n return order.orderNo;\n }).join(', ');\n\n Y.doccirrus.DCWindow.notice( {\n type: 'info',\n message: i18n( 'general.message.ARTICLE_DELIVERED', {data: {orderNo: orderNo}} ),\n window: {width: 'medium'}\n } );\n self.wareHouseTable.reload();\n self.displayDetails( false );\n self.isUpdating( false );\n return;\n } else {\n checkQuantity(item);\n }\n } )\n .fail( function( err ) {\n Y.Array.invoke( Y.doccirrus.errorTable.getErrorsFromResponse( err ), 'display' );\n self.isUpdating( false );\n } );\n }", "title": "" }, { "docid": "866b5708d15dd32a0fa6a5cf2fe1eb5b", "score": "0.5301758", "text": "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\t//let product_prices = [];\n\tfor (let i=0; i<prods.length; i++) {\n\n\t\tif ((restriction == \"Lactose Free\") && (prods[i].lactosefree == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\tproduct_names.push(prods[i].price);\n\t\t}\n\t\telse if ((restriction == \"Nut Free\") && (prods[i].nutfree == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\tproduct_names.push(prods[i].price);\n\t\t}\n\t\telse if ((restriction == \"Organic\") && (prods[i].organic == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\tproduct_names.push(prods[i].price);\n\t\t}\n\t\telse if ((restriction == \"Dog Food\") && (prods[i].dogfood == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\tproduct_names.push(prods[i].price);\n\t\t}\n\t\telse if ((restriction == \"Baby Food\") && (prods[i].babyfood == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\tproduct_names.push(prods[i].price);\n\t\t}\n\t\telse if (restriction == \"None\"){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\tproduct_names.push(prods[i].price);\n\t\t}\n\t\n\t}\n\treturn product_names;\n}", "title": "" }, { "docid": "a60be0d4e0dcfacb1e4b1f8698384231", "score": "0.5296418", "text": "function filterOutOfStockProducts(products) {\n const filteredProducts = [];\n\n for (let i = 0; i < products.length; i++) {\n const product = products[i];\n const quantity = product.stock.quantity;\n\n if (quantity === 0) {\n filteredProducts.push(product);\n }\n }\n return filteredProducts;\n}", "title": "" }, { "docid": "8f700f67d51f44f96769168b8c0ac4c2", "score": "0.52948713", "text": "@wire(getOrderProducts, {\n communityId: \"$communityId\",\n effectiveAccountId: \"$resolvedEffectiveAccountId\"\n })\n getOrderProducts({error, data}){\n if(data && data.orderProducts.length){\n this.orderProducts = data.orderProducts;\n this._webstoreId = data.webstoreId;\n this.showErrorMessage = false;\n }\n else if(!data){\n this.showErrorMessage = true;\n }\n else if(error){\n console.log('Error received: ' + JSON.stringify(error));\n }\n }", "title": "" }, { "docid": "9140921ca248ce699869460bed8fcdee", "score": "0.5292976", "text": "function getProductsObserved(data) {\n\tvar products_observed = data || [];\n\tproducts_observed.forEach((product_observed, i) => {\n\t\tproducts_observed[i] = getProductObserved(product_observed)\n\t})\n\tif (products_observed.length < 1) products_observed[0] = getProductObserved({})\n\treturn products_observed\n}", "title": "" }, { "docid": "8dc40213b31fc9851b071a86a6332d6a", "score": "0.52770096", "text": "function filterElements(_singleProductsArray, _inputUserMaxPrice) {\n\n let onlyFreeProductsArray = [];\n //Get Prices of Products\n for (let i = 0; i < _singleProductsArray.length; i++) {\n let itemPriceText = _singleProductsArray[i].getElementsByClassName('FeedItemV2__ActualPrice-vf3155-9')[0].innerText;\n\n let numb = itemPriceText.match(/\\d/g);\n if (isNaN(parseInt(numb))) { // else its NaN, not 0\n itemPriceText = 0;\n } else {\n numb = numb.join(\"\");\n itemPriceText = numb; // clean it up, cuts the \"€\" away\n }\n /* just checking if product free or not:\n // if item has no numbers in price text ( \"Kostenlos, Free\", ... ) --> add it:\n if (isNaN(parseInt(itemPriceText))) {\n onlyFreeProductsArray.push(_singleProductsArray[i]);\n } */\n\n // check if product is cheaper than max price set by the user in input:\n\n console.log(\"itemprice \" + itemPriceText);\n if (itemPriceText <= parseInt(Math.abs(_inputUserMaxPrice))) {\n onlyFreeProductsArray.push(_singleProductsArray[i]);\n }\n\n }\n return onlyFreeProductsArray;\n }", "title": "" }, { "docid": "0188d01a525ec43c69f0587c8ae81daa", "score": "0.52767426", "text": "function exists(products,productsToAdd){\n for(let i=0;i<products.length;i++){\n if(products[i][0]==productsToAdd[0]){\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "2ffa75bb3516d32f8fd17b845a8ebb9f", "score": "0.5276018", "text": "function deliveryCost(products) {\r\n if (typeof products == \"number\") {\r\n\r\n //delivery costs\r\n const firstHundredShippingCost = 100;\r\n const secondHundredShippingCost = 80;\r\n\r\n if (products <= 100) {\r\n const productsPrice = products * firstHundredShippingCost;\r\n return productsPrice;\r\n } else if (products <= 200) {\r\n const firstHundredProductPrice = 100 * firstHundredShippingCost;\r\n const leftProducts = products - 100;\r\n const secondHundredProductPrice = leftProducts * 80;\r\n return firstHundredProductPrice + secondHundredProductPrice;\r\n } else {\r\n const firstHundredProductPrice = 100 * firstHundredShippingCost;\r\n const secondHundredProductPrice = 100 * secondHundredShippingCost;\r\n const leftProducts = products - 200;\r\n const othersProductPrice = leftProducts * 50;\r\n return firstHundredProductPrice + secondHundredProductPrice + othersProductPrice;\r\n }\r\n\r\n } else {\r\n return \"Invalid!!Please give the product items as a number.!!\"\r\n }\r\n}", "title": "" }, { "docid": "e83723c5bd0451ac898033125c932614", "score": "0.52718437", "text": "meals(){\n let all = this.deliveries().map(delivery=> delivery.meal())\n let unique = [... new Set(all)]\n return unique\n }", "title": "" }, { "docid": "1f8608dfb4566a5a0f70d7ae6a7121af", "score": "0.5268078", "text": "function findRestocks(arr1, arr2, shallowArr1) {\n var restocks = [];\n //iterate through each item in newStock\n for (i in arr2) {\n //check if the items id matches an id from currentStock\n if (shallowArr1.includes(arr2[i].id)) {\n //set n equal to the index of the matching id in currentStock\n var n = shallowArr1.indexOf(arr2[i].id);\n //then iterate through each index in productInfo of current item\n for (j in arr2[i].productInfo) {\n //then iterate through each index in availableSkus and check if that sku was unavailable in currentStock\n //and available in newStock. If this is true, push an object with that items info to our restocks array\n //but first, check if the value is null for whatever reason (sort of a bug, needs fixing)\n if (arr1[n].productInfo[j] == null) {\n console.log('findRestocks cannot find product info in the new scan. Ignoring...');\n break;\n }\n for (k in arr2[i].productInfo[j].availableSkus) {\n if (arr1[n].productInfo[j].availableSkus[k].available === false && arr2[i].productInfo[j].availableSkus[k].available === true) {\n var launchid = \"nothing\";\n if (arr2[i].productInfo[j].hasOwnProperty('launchView')) {\n console.log(arr2[i].productInfo[j].launchView)\n launchid = arr2[i].productInfo[j].launchView.id;\n }\n var sizeVaraint = arr2[i].productInfo[j].skus[k].id;\n var link = th_launch_link + arr2[i].publishedContent.properties.seo.slug;\n restocks.push({\n \"thumbnail\": arr2[i].productInfo[j].imageUrls.productImageUrl,\n \"name\": arr2[i].productInfo[j].productContent.title,\n \"color\": arr2[i].productInfo[j].productContent.colorDescription,\n \"size\": arr2[i].productInfo[j].skus[k].nikeSize,\n \"price\": 'B' + arr2[i].productInfo[j].merchPrice.currentPrice,\n \"link\": link,\n \"launchId\": launchid,\n \"sizeVaraint\": sizeVaraint,\n \"checkout\": 'https://gs.nike.com/?checkoutId=467b1823-b354-4039-a3da-ad641289576b&launchId=' + launchid + '&skuId=' + sizeVaraint + '&country=TH&locale=th&appId=com.nike.commerce.snkrs.web&returnUrl='+link,\n });\n }\n }\n }\n } else {\n //this means the item was most likely removed from the snkrs page for whatever reason\n console.log('Item not found in previous scan. Ignoring...');\n }\n }\n return restocks;\n}", "title": "" }, { "docid": "3bf1e052483860d57f0a018d536e31f1", "score": "0.5267852", "text": "function getProducts() {\n if (productsNew.length === 0) {\n // console.log('products need to be loaded!');\n readCSVFile();\n } else {\n // console.log('products already loaded!');\n }\n return productsNew;\n}", "title": "" }, { "docid": "5bfea0e63781df36b53764883a6d63d7", "score": "0.5266232", "text": "async searchProducts(filters) {\n // let result = await getAllProducts().then(res => {\n // return res.data;\n // });\n let productsResponse = await this.getAllProducts();\n let products = productsResponse.data;\n\n var resultValues = [];\n if (Object.keys(filters).length != 0) {\n //to filter the values based on brandName\n resultValues = products.filter(p => !filters.hasOwnProperty(\"brandName\") || filters.brandName.length == 0 || filters.brandName.includes(p.brandName))\n // to filter the values based on ram\n resultValues = resultValues.filter(p => !filters.hasOwnProperty(\"ram\") || filters.ram.length == 0 || filters.ram.includes(p.ram));\n // to filter the values based on price\n resultValues = resultValues.filter(r => !filters.hasOwnProperty(\"price\") || filters.price.min <= r.price && filters.price.max >= r.price);\n //to sort the values based on price field\n resultValues.sort(this.sorting);\n // return the all condition matching array \n return resultValues;\n }\n else {\n return products;\n }\n }", "title": "" }, { "docid": "157935f8bab35d978cfd0bc64797ad63", "score": "0.5264597", "text": "filteredProducts(state, getters) {\n return (amount) => getters.orderedProducts.filter(p => p.price > amount);\n }", "title": "" }, { "docid": "26d4f5b83b547e62696580af85ff5c54", "score": "0.5263831", "text": "deliveries() {\n return store.deliveries.filter(delivery => delivery.customerId === this.id);\n }", "title": "" }, { "docid": "6ad03798f2398ee1c25777a7d62a7cee", "score": "0.5261594", "text": "deliveries(){\n return store.deliveries.filter(delivery => delivery.neighborhoodId === this.id);\n }", "title": "" }, { "docid": "5b4fd79a1429620374606222b42e5d1f", "score": "0.5257825", "text": "function getProductItems(product, conditions)\n{\n\tif (!conditions) conditions = {};\n\tvar selected = new Array;\n\t$(product).find(\"product-item\").each(function(i, x){\n\t\tif (isElementGoodFor(x, 'item-condition', conditions)) {\n\t\t\tselected.push(x);\n\t\t}\n\t});\n\treturn selected;\n}", "title": "" }, { "docid": "0d38b9a3d82bf79cc5cf2e82c731f990", "score": "0.5254572", "text": "function checkProductQuantity(productId, productCartArr){\r\n let endQuantity = 1;\r\n for(let i = 0; i < productCartArr.length; i++){\r\n if(productId === productCartArr[i].prodId){\r\n endQuantity += productCartArr[i].quantity;\r\n break;\r\n }\r\n }\r\n return endQuantity;\r\n}", "title": "" }, { "docid": "8dc6dd9ae46a19bc35df0fad7c9de854", "score": "0.5245171", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tconsole.log(chosenProducts[1]);\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tfor (let j=0; j<chosenProducts.length; j+=1){\n\t\t\tif (chosenProducts[j].includes(products[i].name)){\n\t\t\t\t\ttotalPrice += products[i].price;\n\t\t\t}\n\t\t}\n\t}\n\treturn Math.round((totalPrice + Number.EPSILON) * 100) / 100;\n}", "title": "" }, { "docid": "f61bf2182ebe9803c2babf6a0173fcb4", "score": "0.52441317", "text": "function generateProductArray(products) {\n let order_product_detail = [];\n for (let product of products.split(\";\")) {\n //create a new object\n let eachItem = {};\n //split each product into product_id and quantity\n let item = product.split(\",\");\n eachItem[\"product_id\"] = parseInt(item[0]);\n eachItem[\"quantity\"] = parseInt(item[1]);\n order_product_detail.push(eachItem);\n }\n return order_product_detail;\n}", "title": "" }, { "docid": "47bc185dc60fafb5e53821931190f13d", "score": "0.52373946", "text": "function arrayOfProducts(array) {\n\tlet productArr = [];\n\tfor (let i = 0; i < array.length; i++) {\n\t\tlet curProd = 1\n\t\tfor (let j = 0; j < array.length; j++) {\n\t\t\tif (j !== i) curProd *= array[j]\n\t\t}\n\t\tproductArr.push(curProd)\n\t}\n\treturn productArr\n}", "title": "" }, { "docid": "5b15eb472e43ed1d25d43c09562ab7fe", "score": "0.5233072", "text": "function buildUpdatedDBProducts(dbProducts, soldProducts){\n let updatedProducts = []\n for (let index = 0; index < dbProducts.length; index++){\n const product = dbProducts[index].toJSON();\n const { disponibles, countPurchases, _id } = product;\n\n const soldIndex = searchProductByID(soldProducts, _id)\n const { piezas } = soldProducts[soldIndex]\n\n const newProduct = {\n ...product,\n disponibles: disponibles - piezas,\n countPurchases: countPurchases ? countPurchases + piezas : piezas\n }\n updatedProducts = [...updatedProducts, newProduct]\n }\n return updatedProducts;\n }", "title": "" }, { "docid": "f5cbd897dd2ed595df913af5424c30f0", "score": "0.5228906", "text": "function mer_AddPurchasedProducts(){\n var mer_purchasedProducts = [];\n var productIds = '';\n var prodIds = document.getElementById('taggingBasketItems');\n\n if (prodIds){\n productIds = prodIds.value;\n }\n if (productIds != '') {\n productIds = productIds.replace(/;/g,\"\");\n var prodArray = productIds.split(',');\n //console.log('prodArray.length',prodArray.length,\" \",prodArray);\n\n for(var i = 0; i < prodArray.length; i++) {\n mer_purchasedProducts.push(\"http://\"+location.hostname+\"/jsp/search/productdetail.jsp?SKU=\"+ prodArray[i]);\n }\n }\n return mer_purchasedProducts;\n}", "title": "" }, { "docid": "fc8f1cebbf3176689c4aa1d489912198", "score": "0.52283573", "text": "function getDepartments(products) {\n var departments = [];\n for (var i = 0; i < products.length; i++) {\n if (departments.indexOf(products[i].department_name) === -1) {\n departments.push(products[i].department_name);\n }\n }\n return departments;\n}", "title": "" }, { "docid": "566399482ff3dcbc01e01f5ca74dec2e", "score": "0.5223747", "text": "function processProducts( productObjs, offeringObjs ) {}", "title": "" }, { "docid": "534bdab72c31c8b7535c8a991454ae37", "score": "0.52230215", "text": "function getTotalPrice(chosenProducts) {\r\n\ttotalPrice = 0;\r\n\tfor (let i=0; i<products.length; i+=1) {\r\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\r\n\t\t\ttotalPrice += products[i].price;\r\n\t\t}\r\n\t}\r\n\treturn totalPrice;\r\n}", "title": "" }, { "docid": "534bdab72c31c8b7535c8a991454ae37", "score": "0.52230215", "text": "function getTotalPrice(chosenProducts) {\r\n\ttotalPrice = 0;\r\n\tfor (let i=0; i<products.length; i+=1) {\r\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\r\n\t\t\ttotalPrice += products[i].price;\r\n\t\t}\r\n\t}\r\n\treturn totalPrice;\r\n}", "title": "" }, { "docid": "86675124762232cb984a209350672771", "score": "0.5217442", "text": "function getRecRecipes(recipes,products){\n ///Si no hay recetas o no hay productos se devuelve un array vacio\n if(!recipes.length || !products.length) return [];\n //Se recorre cada receta, almacenando qué ingredientes se tienen y cuáles no\n recipes.forEach(function(recipe){\n ////Array para almacenar los productos que se necesitan\n var neededProds=[];\n //Se recorren los ingredientes de la receta\n recipe.ingredients.forEach(function(ingredient){\n //Se comprueba si se tiene el ingrediente actual\n var prod=products.filter(function(product){\n return ingredient.foodId === product.foodId;\n });\n //Si no se tiene el ingrediente se añade al array de productos que se necesitan\n if (!prod.length) neededProds.push(ingredient.name);\n });\n //Contador de productos disponibles\n var availableProducts = recipe.ingredients.length - neededProds.length;\n //Se añade al objeto recipe el % de productos que se tienen\n recipe.cProds=Number(((availableProducts*100)/recipe.ingredients.length).toFixed(2));\n });\n //Se devuelven aquellas recetas para las que se tenga la mitad o más de ingredientes\n return recipes.filter(function(recipe){\n return recipe.cProds >= 50\n });\n }", "title": "" }, { "docid": "966ae31fb9d59d1fea405add8f6bebfa", "score": "0.52131957", "text": "filter(min,max){\n let msg = \"Available events: \";\n let counter = 1;\n for (let i =0; i<this.eventPrice.length; i++){\n if (this.availableTickets[i].ticketPrice >= min && this.availableTickets[i].ticketPrice<=max){\n msg += counter + \".\"+ \" \" + this.availableTickets[i].ticketType + \" \";\n counter++;\n }\n } \n if (counter === 1){\n msg = \"There are relevant events.\";\n }\n return msg;\n }", "title": "" }, { "docid": "64ef9c87a648a7c5ee64dec1978f9fe7", "score": "0.5208141", "text": "function sockMerchant(n, ar) {\n // Complete this function\n\n var colors = [];\n var pairs = 0;\n\n for (var i = 0; i < n; i++) {\n if (!colors.includes(ar[i])) {\n colors.push(ar[i]);\n //console.log(i);\n //console.log(\"added\");\n } else {\n //console.log(i);\n //console.log(\"removed\");\n pairs++;\n //console.log(colors);\n colors = colors.filter(function (el) {\n //console.log(ar[i]==el);\n //To remove from contain array: \n //!toRemoveArray.includes( el );\n return !(ar[i] == el);\n })\n //console.log(colors);\n }\n }\n return (pairs);\n\n /*\n var stockArray=[];\n ar = ar.sort();\n var count=1;\n var canSell = 0;\n //console.log(ar);\n for(var i=0;i<n-1;i++){\n \n if(ar[i] == ar[i+1]){\n count++;\n }\n else{\n canSell += Math.floor(count/2)\n count=1;\n }\n }\n */\n return pairs;\n}", "title": "" }, { "docid": "02d5203ec973a32f7efc4991d68adabd", "score": "0.52074784", "text": "function getTotalPrice(chosenProducts) {\n totalPrice = 0;\n for (let i = 0; i < products.length; i += 1) {\n if (chosenProducts.indexOf(products[i].name) > -1){\n totalPrice += products[i].price;\n }\n }\n return totalPrice;\n}", "title": "" }, { "docid": "8bb6375e7b3f88fca44d815c1ae0028a", "score": "0.5203814", "text": "function ownedProducts(){\n // Initialize the billing plugin\n inappbilling.getPurchases(successHandler, errorHandler);\n\n }", "title": "" }, { "docid": "db3deeffdf2d35f5bf5e1b2ae25b75d8", "score": "0.520276", "text": "function question2() {\n // Answer:\n var items = [];\n for (i = 0; i < data.length; i++) {\n if (data[i].price >= 14.00 && data[i].price <= 18.00) {\n items.push(data[i]);\n }\n }\n console.log(items);\n return items;\n}", "title": "" }, { "docid": "f602a8eb835d3d7fa35f69a1f7f2af88", "score": "0.52018267", "text": "deliveries() {\n return store.deliveries.filter(delivery => {\n return delivery.mealId === this.id;\n });\n }", "title": "" }, { "docid": "87d292a96893c4d677c31ddf571d0c70", "score": "0.5198884", "text": "function getPriceAndQtyArrays(){\n var productPrice = document.querySelectorAll('.product-price');\n var productQuantity = document.getElementsByTagName('input');\n \n var arrPrices = [];\n var arrQties = [];\n\n for(var i =0 ; i < productPrice.length; i++){\n var priceHolder = productPrice[i].innerHTML;\n priceHolder = Number(priceHolder.slice(1));\n arrPrices.push(priceHolder);\n }\n\n for(var j = 0; j < productQuantity.length; j++) {\n var qtyHolder = Number(productQuantity[j].value);\n arrQties.push(qtyHolder);\n }\n\n const arrayOfPricesAndQties = [];\n arrayOfPricesAndQties.push(arrPrices, arrQties);\n // console.log(arrPrices, arrQties);\n return arrayOfPricesAndQties;\n}", "title": "" }, { "docid": "18d8e59d1c189780cc70dadc8f587983", "score": "0.5188523", "text": "function returnProducts() {\n\n let query = searchInput.val();\n query = query.toString();\n query = query.trim();\n\n // need to add &search to search terms with phrases to pass to the BB API\n query = query.replace(\" \", \"&search=\");\n\n let queryURL = \"((search=\" + query + \")\";\n\n let priceFloor = \"&salePrice>=\" + spendLow.toString();\n\n let activeProducts = \"&sku=*\";\n\n let inStoreURL = \"&inStoreAvailability=true)?\";\n\n let pageSize = \"pageSize=100\"\n\n let cursorMark = \"&cursorMark=*\"\n\n let format = \"&format=json\";\n\n let productURL = baseURL + queryURL + priceFloor + activeProducts + inStoreURL + pageSize + cursorMark + BBAPIKey + format;\n\n let allMatchingProductsI = 0;\n\n console.log(productURL);\n\n $.ajax({\n\n // using this app as a quick fix to avoid CORS errors\n url: \"https://cors-anywhere.herokuapp.com/\" + productURL,\n method: \"GET\",\n\n })\n\n .then(function (productResponse) {\n\n let allReturnedProducts = productResponse.products;\n\n for (i = 0; i < allReturnedProducts.length - 1; i++) {\n\n let productName = allReturnedProducts[i].name;\n let productImageSrc = allReturnedProducts[i].thumbnailImage;\n let productSKU = allReturnedProducts[i].sku;\n let productPrice = allReturnedProducts[i].salePrice;\n\n // these remain as empty arrays even after this function runs; will be populated through populteStores function\n let productStores = [];\n let productStoreAddresses = [];\n\n let productURL = allReturnedProducts[i].url;\n\n if (productPrice > spendLow && productPrice < spendCap) {\n\n allMatchingProducts[allMatchingProductsI] = { \"name\": productName, \"imageSource\": productImageSrc, \"sku\": productSKU, \"price\": productPrice, \"stores\": productStores, \"storeAddresses\": productStoreAddresses, \"url\": productURL };\n\n allMatchingProductsI++;\n }\n\n }\n\n // sortProducts always run as soon as BB product results are pushed into allMatchingProducts. see sortProducts description below populateStores.\n sortProducts();\n })\n}", "title": "" }, { "docid": "92ed91cda5951a4f09278d5994f74407", "score": "0.51862276", "text": "getProductInstallments(data, sellerId = false) {\n const commertialOffer = this._getCommertialInfo(data, sellerId);\n\n if ( globalHelpers.isUndefined(commertialOffer) ) {\n return false;\n }\n\n // Get by min price value\n return commertialOffer.installments.reduce((prev, current) => (prev.value < current.value) ? prev : current, {});\n }", "title": "" }, { "docid": "86a9192634a68d88aca79d2c319994c8", "score": "0.51803225", "text": "function checkInventory(selection, inventory) {\n for (var i = 0; i < inventory.length; i++) {\n if (inventory[i].stock_quantity === selection) {\n return inventory[i]\n };\n }\n}", "title": "" }, { "docid": "78b1cf250579e635b41ce4f9d38b4765", "score": "0.5177299", "text": "function availableProducts() {\n console.log(\"\\nBike Shop Merchandise: \\n\");\n connection.query(\"SELECT id, productName, price FROM products\", function (err, results) {\n if (err) throw err;\n console.table(results);\n startShopping();\n });\n}", "title": "" }, { "docid": "acddd83a320cc7a7006a3d02e7e16c84", "score": "0.5176719", "text": "deliveries() {\n return store.deliveries.filter(delivery => delivery.mealId === this.id);\n }", "title": "" }, { "docid": "45f2c91cc2d037b3aec1dacd6a972f3e", "score": "0.5172136", "text": "function generatePartyList(arr, par) {\n\tvar arr2 = [];\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i].party === par) {\n\t\t\tarr2.push(arr[i]);\n\t\t}\n\t}\n\treturn arr2;\n}", "title": "" }, { "docid": "18814a6f0eab68fa751fa78ad3471185", "score": "0.5170537", "text": "function getCustOrder() {\n\tconnection.query(\"SELECT `ItemID`, `ProductName`, `DepartmentName`, `Price` FROM `products`\", function(err, rows, fields) {\n\t\tif (err) throw err;\n\n\t\t// Feels like a hacky way to make sure I don't keep pushing stuff to array\n\t\tif (product_array.length <= 0){\n\t\t\tfor (var i = 0; i < rows.length; i++) {\n\t\t\t\tvar itemInfo = {\n\t\t\t\t\tItemID : rows[i].ItemID,\n\t\t\t\t\tProductName : rows[i].ProductName,\n\t\t\t\t\tDepartmentName : rows[i].DepartmentName,\n\t\t\t\t\tPrice : rows[i].Price\n\t\t\t\t}\n\t\t\t\tproduct_array.push(itemInfo);\n\t\t\t}\n\t\t}\n\t\t// Display the products in the array you just built\n\t\tconsole.log(\"display products\");\n\t\tdisplayProducts(product_array);\t\n\t\t// Ask user for a product ID\n\t\tinquirer.prompt([\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'prodID',\n\t\t\tmessage: 'Choose a product by ID',\n\t\t\t// Make sure it is a valid ID\n\t\t\tvalidate: function(value) {\n\t\t\t\tvar found = product_array.some(function(el) {\n\t\t\t\t\treturn el.ItemID == value;\n\t\t\t\t});\n\t\t\t\tif (found) {\n\t\t\t\t\treturn true;\t\t\t\n\t\t\t\t}\n\t\t\t\treturn 'Please enter a valid product id';\n\t\t\t}\n\t\t}\n\t\t]).then(function(choice) {\n\t\t\t// Then find out how many of that item they want\n\t\t\tinquirer.prompt([\n\t\t\t{\n\t\t\t\ttype: 'input',\n\t\t\t\tname: 'quantity',\n\t\t\t\tmessage: 'How many would you like to purchase?',\n\t\t\t\tvalidate: function(value) {\n\t\t\t\t\t// Make sure it is a valid digit answer\n\t\t\t\t\tvar pass = value.match(/^\\d+$/);\n\t\t\t\t\tif (pass) {\n\t\t\t\t\t\treturn true;\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\treturn 'Please enter a valid quantity';\n\t\t\t\t}\n\t\t\t}\n\t\t\t]).then(function(answer) {\n\t\t\t\t// Get the stockquantity and price from the database. I could probably have put all of this \n\t\t\t\t// in the product_array and pulled it from there, but seemed like better practice to pull\n\t\t\t\t// the info from database\n\t\t\t\tconnection.query(\"SELECT `StockQuantity`, `Price` FROM `products` WHERE `ItemID` = ?\", [choice.prodID], function(err, rows, fields) {\n\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\tconsole.log(\"There are \" + rows[0].StockQuantity + \" available of that item.\");\t\t\t\t\t\n\t\t\t\t\tif(rows[0].StockQuantity < answer.quantity) {\n\t\t\t\t\t\tconsole.log(\"Insufficient quantity available\");\n\t\t\t\t\t\tinquirer.prompt([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\t\t\t\tname: 'continue',\n\t\t\t\t\t\t\t\tmessage: 'Would you like to place another order?'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]).then(function(again) {\n\t\t\t\t\t\t\t\tif(again.continue) {\n\t\t\t\t\t\t\t\t\t\tgetCustOrder();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tconsole.log(\"Come again soon!\");\n\t\t\t\t\t\t\t\t\t// End the mysql connection since we are done\n\t\t\t\t\t\t\t\t\tconnection.end();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"Let's place your order!\");\n\t\t\t\t\t\t// Display order details, product name, qty, and total price\n\t\t\t\t\t\tconsole.log(printReceipt(product_array, choice.prodID, answer.quantity));\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Variable to hold newQuantity for updating database, was less messy to read than putting this in the query line\n\t\t\t\t\t\tvar newQuantity = rows[0].StockQuantity - parseInt(answer.quantity);\n\t\t\t\t\t\t// Update quantity in database\n\t\t\t\t\t\tconnection.query(\"UPDATE `products` SET `StockQuantity` = ? WHERE `ItemID` = ?\", [newQuantity, choice.prodID], function(err, rows, fields) {\n\t\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t\t// Check if user wants something else\n\t\t\t\t\t\t\tinquirer.prompt([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\t\t\t\tname: 'continue',\n\t\t\t\t\t\t\t\tmessage: 'Would you like to place another order?'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]).then(function(again) {\n\t\t\t\t\t\t\t\t\tif(again.continue) {\n\t\t\t\t\t\t\t\t\t\tgetCustOrder();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"Come again soon!\");\n\t\t\t\t\t\t\t\t\t\t// End the mysql connection since we are done\n\t\t\t\t\t\t\t\t\t\tconnection.end();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t})\n\t\t});\t\t\n\t});\n}", "title": "" }, { "docid": "32695ab920402a5d4d7a85331fe42788", "score": "0.5153274", "text": "function getProducts() {\n return new Promise((resolve, reject) => {\n serviceFetch('/api/products')\n .then(checkStatus)\n .then(data => data.json())\n .then(products => resolve(products))\n .catch(e => reject(e));\n });\n}", "title": "" }, { "docid": "fb43b57465908a812f90573956676822", "score": "0.51501787", "text": "function restrictListProducts(prods, restrictionsList) {\n\n\tconsole.log(\"Enter restrictProducts :\");\n\n\tlet products = [];\n\n\t// V GF O\n\tif (restrictionsList.includes(\"Vegan\") && restrictionsList.includes(\"Gluten Free\") && restrictionsList.includes(\"Organic\")){\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tif(prods[i].vegetarian == true && prods[i].glutenFree == true && prods[i].organic == true){\n\t\t\t\tproducts.push(prods[i]);\n\t\t\t}\n\t\t}\n\t}\n\t// V GF\n\telse if (restrictionsList.includes(\"Vegan\") && restrictionsList.includes(\"Gluten Free\")){\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tif(prods[i].vegetarian == true && prods[i].glutenFree == true){\n\t\t\t\tproducts.push(prods[i]);\n\t\t\t}\n\t\t}\n\t}\n\t// V O\n\telse if (restrictionsList.includes(\"Vegan\") && restrictionsList.includes(\"Organic\")){\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tif(prods[i].vegetarian == true && prods[i].organic == true){\n\t\t\t\tproducts.push(prods[i]);\n\t\t\t}\n\t\t}\n\t}\n\t// GF O\n\telse if (restrictionsList.includes(\"Organic\") && restrictionsList.includes(\"Gluten Free\")){\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tif(prods[i].organic == true && prods[i].glutenFree == true){\n\t\t\t\tproducts.push(prods[i]);\n\t\t\t}\n\t\t}\n\t}\n\t// V\n\telse if (restrictionsList.includes(\"Vegan\")){\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tif(prods[i].vegetarian == true){\n\t\t\t\tproducts.push(prods[i]);\n\t\t\t}\n\t\t}\n\t}\n\t// GF\n\telse if (restrictionsList.includes(\"Gluten Free\")) {\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tif(prods[i].glutenFree == true){\n\t\t\t\tproducts.push(prods[i]);\n\t\t\t}\n\t\t}\n\t}\n\t// O\n\telse if (restrictionsList.includes(\"Organic\")){\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tif(prods[i].organic == true){\n\t\t\t\tproducts.push(prods[i]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor(i = 0; i < prods.length; i++){\n\t\t\tproducts.push(prods[i]);\n\t\t}\n\t}\n\n\treturn products;\n}", "title": "" }, { "docid": "8e845e0af0430b2aa3682cd579203592", "score": "0.51500297", "text": "function expensiveCake(array){\n let i = 0\n let resultArray = []\n while(i < array.length){\n if(array[i].price > 30){\n resultArray.push(array[i])\n console.log(resultArray)\n }\n i++\n }\n return resultArray\n}", "title": "" }, { "docid": "4311926ba3f46e40f71adf833c8dc57e", "score": "0.5134778", "text": "async getProducts(params = {}) {\n const {\n filters: { stock, range, availability, category } = {},\n sortBy,\n sortOrder\n } = params;\n let { products } = productsData;\n\n products = products.filter(product => {\n const inCategory = category ? product.sublevel_id === category : true;\n const inRange = range ? priceInRange(product.price, range) : true;\n const hasStock = stock ? product.quantity === getInt(stock) : true;\n const isAvailable =\n availability === 'all' ? true : availability === product.available;\n\n return inCategory && inRange && hasStock && isAvailable;\n });\n\n if (sortBy) {\n products.sort((a, b) => {\n return getInt(a[sortBy]) > getInt(b[sortBy])\n ? 1 * sortOrder\n : -1 * sortOrder;\n });\n }\n return products;\n }", "title": "" }, { "docid": "a3785fae640108ba9cb726d67c6cb6d8", "score": "0.5132719", "text": "function xValue(arg){\n\n var temp = [];\n\n for(var i = 0; i < arg.length; i++){\n temp.push(arg[i].Product);\n }\n return temp;\n}", "title": "" }, { "docid": "1bb68e7f9a4296f9f93d9356b6d17ca7", "score": "0.51317364", "text": "function restrictListProducts(prods, vegetarian, glutenFree, organicOnly) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif (organicOnly && !prods[i].organic){\n\t\t\tcontinue;\n\t\t}\n\n\t\tif(!vegetarian && !glutenFree){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price, prods[i].category, prods[i].image]);\n\t\t}\n\n\t\tlet veg = vegetarian && prods[i].vegetarian;\n\t\tlet glut = glutenFree && prods[i].glutenFree;\n\n\t\tif (vegetarian && glutenFree){\n\t\t\tif(prods[i].glutenFree && prods[i].vegetarian){\n\t\t\t\tproduct_names.push([prods[i].name, prods[i].price, prods[i].category, prods[i].image]);\n\t\t\t}\n\t\t}\n\t\telse if (veg){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price, prods[i].category, prods[i].image]);\n\t\t}\n\t\telse if (glut){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price, prods[i].category, prods[i].image]);\n\t\t}\n\t}\n\treturn product_names;\n}", "title": "" }, { "docid": "20f1d09eea589d413b2f051f4176df3d", "score": "0.5131509", "text": "function getProducts () {\n return products;\n }", "title": "" }, { "docid": "4d2216c667e09bbf171d601037d421f6", "score": "0.512907", "text": "function getProductsList(){\n // retorna os valores dos produtos\n return Object.values(products)\n}", "title": "" }, { "docid": "6ebb1b9c49c489b0a7d06a0fa3fd56db", "score": "0.5119979", "text": "function salesByProduct(products, lineItems) {\n\n var revenueByProduct = products.reduce(function(totalSold, item) {\n if (countProductsSold[item.id]) {\n totalSold[item.id] = item.price * countProductsSold[item.id]\n }\n return totalSold;\n }, {});\n\n return revenueByProduct;\n}", "title": "" }, { "docid": "2ed3f6545634ce863ef4985a250f414a", "score": "0.5115789", "text": "function restrictListProducts(prods, restriction1, restriction2) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction1 == \"NutFree\") && (prods[i].peanutFree == true)){\n\t\t\tif ((restriction2 == \"Yes\") && (prods[i].organic == true)){\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t} else if (restriction2 == \"No\") {\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t}\n\t\t}\n\t\telse if ((restriction1 == \"LactoseFree\") && (prods[i].lactoseFree == true)){\n\t\t\tif ((restriction2 == \"Yes\") && (prods[i].organic == true)){\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t} else if (restriction2 == \"No\") {\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t}\n\t\t}\n\t\telse if ((restriction1 == \"Both\") && (prods[i].lactoseFree == true) && (prods[i].peanutFree == true)){\n\t\t\tif ((restriction2 == \"Yes\") && (prods[i].organic == true)){\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t} else if (restriction2 == \"No\") {\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t}\n\t\t}\n\t\telse if (restriction1 == \"None\"){\n\t\t\tif ((restriction2 == \"Yes\") && (prods[i].organic == true)){\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t} else if (restriction2 == \"No\") {\n\t\t\t\tproduct_names.push([prods[i].name,prods[i].price]);\n\t\t\t}\n\t\t}\n\t}\n\treturn product_names;\n}", "title": "" }, { "docid": "63b280ecc967a61413164a7647dbc17d", "score": "0.5113715", "text": "getVoushersForProductID() {\n\n }", "title": "" }, { "docid": "13711da563cff6f5c92e8f50be795181", "score": "0.51057714", "text": "function question2 () {\n // Answer:\n\n let newArray = [];\n for (i= 0; i <data.length; i++) {\n if(data[i].price >= 14 && data[i].price <= 18){\n newArray.push(data[i]);\n }\n}\nreturn newArray\n}", "title": "" }, { "docid": "d47a0cce8ddd4f4d9a108579f920941b", "score": "0.51051205", "text": "async indexProvides(req, res){\n\n const product = await Product.findAll();\n const providesName = [] // array que armazena o nome de todas os fornecedores que existem na aplicação\n const provides = [] // array que armazena cada fornecedor que tem produtos faltando\n \n product.forEach((product)=>{\n if(product.amount ===0 && providesName.indexOf(product.provide.toLowerCase())===-1){\n providesName.push(product.provide.toLowerCase())\n }\n })\n\n for(let i in providesName){\n const temp = {\n provide: providesName[i],\n products: []\n }\n for(let j of product){\n if(providesName[i] === j.provide.toLowerCase() && j.amount===0){\n temp.products.push(j)\n }\n }\n provides.push(temp)\n }\n\n\n\n return res.json({\n provides: provides,\n })\n }", "title": "" }, { "docid": "1587ffccb9ceb787907f81e46dc3cd47", "score": "0.5097873", "text": "function getRecRecipes2(recipes,products){\n //Si no hay recetas o no hay productos se devuelve un array vacio\n if(!recipes.length || !products.length) return [];\n\n //Se recorre cada receta\n recipes.forEach(function(recipe){\n //Variable para almacenar el peso total de la receta y el de los productos disponibles\n var recipeWeight=0;\n var productsWeight=0;\n\n //Se recorren los ingredientes de la receta\n recipe.ingredients.forEach(function(ingredient){\n //Se suma el peso del ingrediente actual al peso de la receta\n recipeWeight+=ingredient.weight;\n //Se comprueba si se tiene el ingrediente actual\n var prod=products.filter(function(product){\n return ingredient.foodId === product.foodId;\n });\n //Si se tiene el ingrediente se suma su peso\n if (prod.length){\n productsWeight+=ingredient.weight;\n }\n });\n //La receta se recomienda si el peso de los ingredientes disponibles es la mitad o mas del peso total\n recipe.recommended = productsWeight>=(recipeWeight/2) ? true : false;\n });\n\n //Se devuelven aquellas recetas para las que se disponga de los ingredientes que suman la mitad o mas del peso de la receta\n return recipes.filter(function(recipe){\n return recipe.recommended;\n });\n }", "title": "" }, { "docid": "307b1b345d1249528cd57938eef7bd28", "score": "0.50917447", "text": "getProductosEnStock(state){\n return state.productos.filter(producto => {\n return producto.inventario > 0;\n })\n }", "title": "" }, { "docid": "7bd62b80b51b6987cd4bf525b41f4d91", "score": "0.50796163", "text": "function searchProducts() {\n var idArray = [];\n var currentId\n connection.query(\"SELECT * FROM products\", function (err, results) {\n for (var i = 0; i < results.length; i++) {\n idArray.push(results[i].item_id)\n }\n });\n inquirer\n .prompt([{\n name: \"action\",\n type: \"input\",\n message: \"What is the ID of the product you would like to buy from this list?\",\n validate: function (input) {\n if (idArray.indexOf(parseInt(input)) > -1) {\n currentId = input;\n return true\n } else {\n console.log(\"Not a valid product\");\n return false\n searchProducts();\n }\n },\n }, {\n name: \"action\",\n type: \"input\",\n message: \"How many units of this product would you like to buy?\"\n }])\n .then(function (selection) {\n determineQty(selection.action, currentId)\n\n });\n}", "title": "" }, { "docid": "cef5d627e792fe4824ac114f55faa13c", "score": "0.5074574", "text": "generateData(currentDeals) {\n const dataTemp = [];\n currentDeals.map((deal) => {\n let isFound = false; let xF = -1;\n for (let x = 0; x < dataTemp.length; x++) {\n if (dataTemp[x].prodID === deal.productID) {\n isFound = true; xF = x;\n }\n }\n if (isFound) {\n if (dataTemp[xF].lowPrice.price > deal.dealPrice) {\n dataTemp[xF].lowPrice.price = deal.dealPrice;\n }\n if (dataTemp[xF].highPrice.price < deal.dealPrice) {\n dataTemp[xF].highPrice.price = deal.dealPrice\n } \n } else {\n let prodName = 'unknown';\n let productsFromStore;\n try {\n productsFromStore = this.props.client.readQuery({\n query: QueryAllProducts\n });\n } catch(e) {\n console.log('prodReadQueryError-', e);\n productsFromStore = null;\n }\n\n if (productsFromStore && productsFromStore.listProducts && productsFromStore.listProducts.items) {\n productsFromStore.listProducts.items.map((prod) => {\n if (prod.id === deal.productID) prodName = prod.name + '-' + prod.modelNo;\n });\n const aDeal = {\n prodID: deal.productID,\n name: prodName,\n lowPrice: {\n price: deal.dealPrice,\n direction: 0\n },\n highPrice: {\n price: deal.dealPrice,\n direction: 0\n }\n };\n dataTemp.push(aDeal);\n }\n }\n });\n\n \n // determine whether price increased or decreased\n if (dataPrev) {\n for (let x = 0; x < dataTemp.length; x++) {\n let prevLow, prevHigh, prevDirLow, prevDirHigh;\n for (let y = 0; y < dataPrev.length; y++) {\n if (dataPrev[y].prodID === dataTemp[x].prodID) {\n prevLow = dataPrev[y].lowPrice.price;\n prevDirLow = dataPrev[y].lowPrice.direction;\n prevHigh = dataPrev[y].highPrice.price;\n prevDirHigh = dataPrev[y].highPrice.direction;\n if (dataTemp[x].lowPrice.price < prevLow) dataTemp[x].lowPrice.direction = -1;\n if (dataTemp[x].lowPrice.price > prevLow) dataTemp[x].lowPrice.direction = 1;\n if (dataTemp[x].lowPrice.price === prevLow) dataTemp[x].lowPrice.direction = prevDirLow;\n if (dataTemp[x].highPrice.price > prevHigh) dataTemp[x].highPrice.direction = 1;\n if (dataTemp[x].highPrice.price < prevHigh) dataTemp[x].highPrice.direction = -1;\n if (dataTemp[x].highPrice.price === prevHigh) dataTemp[x].highPrice.direction = prevDirHigh;\n break;\n }\n }\n }\n }\n\n dataPrev = dataTemp;\n return dataTemp;\n }", "title": "" }, { "docid": "95230fd3564966442e32533a6c9865d0", "score": "0.50740397", "text": "function inventory(arr1, arr2) {\n\tvar updated = updateExist(arr1, arr2);\n\tvar newItems = nonExistIn(arr1, arr2);\n\tnewItems.forEach(function(val) {\n\t\tupdated = addNew(updated, val);\n\t});\n\tfunction updateExist(oldInv, newInv) {\n\t\tvar updatedItems = oldInv.map(function(oldItem) {\n\t\t\tvar updateIdx = existsIn(newInv, oldItem);\n\t\t\tif (updateIdx >= 0) {\n\t\t\t\tvar stock = newInv[updateIdx][0] + oldItem[0];\n\t\t\t\treturn [stock, oldItem[1]];\n\t\t\t} else {\n\t\t\t return oldItem;\n\t\t\t}\t \n\t\t});\n\t\treturn updatedItems;\n\t}\n\tfunction nonExistIn(oldInv, newInv) {\n\t\tvar newList = [];\n\t\tnewInv.forEach(function(item) {\n\t\t\tif (existsIn(oldInv, item) === -1) {\n\t\t\t\tnewList.push(item);\n\t\t\t}\n\t\t});\n\t\treturn newList;\n\t}\n\tfunction existsIn(inv, item) {\n\t\tvar idx = 0;\n\t\tvar exists = inv.some(function(invItem, invIdx) {\n\t\t\tidx = invIdx;\n\t\t\treturn invItem[1] === item[1];\n\t\t});\n\t\tif (exists) {\n\t\t\treturn idx;\n\t\t}\n\t\treturn -1;\n\t}\n\tfunction addNew(oldInv, newItem) {\n\t\tvar returnArr = oldInv;\n\t\treturnArr.push(newItem);\n\t\tvar mapper = returnArr.map(function(val, idx) {\n\t\t\treturn {order: idx, value: val[1]};\n\t\t});\n\t\tvar sorted = mapper.sort(function(a, b) {\n\t\t\treturn a.value > b.value;\n\t\t});\n\t\treturn sorted.map(function(item) {\n\t\t\treturn returnArr[item.order];\n\t\t});\n\t}\n\treturn updated;\n}", "title": "" }, { "docid": "04675a2bcfb9d6a4060acca5c45cd734", "score": "0.5070421", "text": "filterRecipe(filterArray) {\n let arr = this.searchRecipes.filter(recipe => {\n if (filterArray.every(filter => {\n return recipe.filters.includes(filter)\n })) {\n return recipe;\n }\n })\n return arr;\n }", "title": "" }, { "docid": "65697a5637fe9c831bcd31023893b071", "score": "0.5069015", "text": "function listItemsForSale() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n var choiceArray = [];\n for (let i = 0; i < results.length; i++) {\n choiceArray.push(\n \"Item \" +\n results[i].item_id +\n \" \" +\n results[i].product_name +\n \" Price: \" +\n results[i].price +\n \" In Stock: \" +\n results[i].stock_quantity\n );\n }\n console.log(\"\\nGreat Here they are:\");\n console.log(\"\\nBamazon deals of the Day\\n\");\n console.log(choiceArray);\n purchaseItem();\n });\n}", "title": "" } ]
5730480ebfab5550cbbaddca1b17599e
Counter for the number of automatic translations that were done. / Function to retrieve the data from the uploaded files and segregate the data appropriately.
[ { "docid": "89bfbcc2815faf84979b8d2116af94d5", "score": "0.0", "text": "function retrieveFile(){\n var language = document.getElementById('languageSelected').value;\n var fileObj = document.getElementById('fileInstance').files[0];\n if(fileObj == null){\n showToast('Please click the \"Choose File\" button before importing.', \"R\");\n return;\n }\n\n if (fileObj) {\n var reader = new FileReader();\n reader.readAsText(fileObj, \"UTF-8\");\n reader.onload = function (data) {\n var langJSON = JSON.parse(data.target.result);\n\n // Store data and feedback to the user.\n switch(language) {\n case \"Identicals\":\n identicals = langJSON;\n changeStrokeGreen('identicalCheck-01');\n changeStrokeGreen('identicalCheck-02');\n break;\n case \"English\":\n english = langJSON;\n changeStrokeGreen('englishCheck-01');\n changeStrokeGreen('englishCheck-02');\n break;\n case \"German\":\n german = langJSON;\n changeStrokeGreen('germanCheck-01');\n changeStrokeGreen('germanCheck-02');\n break;\n case \"Italian\":\n italian = langJSON;\n changeStrokeGreen('italianCheck-01');\n changeStrokeGreen('italianCheck-02');\n break;\n case \"French\":\n french = langJSON;\n changeStrokeGreen('frenchCheck-01');\n changeStrokeGreen('frenchCheck-02');\n break;\n default:\n showToast(\"Something went wrong.\", \"R\");\n return;\n break;\n }\n // Display toast feedback to the user\n showToast(\"File Uploaded Successfully.\", \"G\");\n // Clear form\n document.getElementById(\"fileInstance\").value = \"\";\n // Cycle to the next option\n var uploadLang = document.getElementById(\"languageSelected\");\n (uploadLang.selectedIndex == (uploadLang.options.length - 1)) ? uploadLang.selectedIndex = 0 : uploadLang.selectedIndex = uploadLang.selectedIndex+1;\n }\n reader.onerror = function (data) {\n showToast(\"Error Reading File.\", \"G\");\n }\n }\n}", "title": "" } ]
[ { "docid": "2a1b75712bd4edefb503613c771e88aa", "score": "0.56482697", "text": "async normalizeFilesInfo() {\n let size = 0;\n let count = 0;\n await this.iterateFiles((fp, stat) => (count++, size += stat.size));\n await this.db.setData('filesTotalSize', size);\n await this.db.setData('filesCount', count);\n }", "title": "" }, { "docid": "c35cdd4e051e3ed3e49115bb96c007b1", "score": "0.5514881", "text": "function taskCounter()\n{\n\treturn JSON.parse(localStorage.getItem(\"tasks\")).length;\n}", "title": "" }, { "docid": "a2153387792b9790a33a2ecc8b1ea53f", "score": "0.5512908", "text": "function count(){\n\t\t\tcallCount++;\n\t\t\t$('#count').text(callCount);\n\t \t\tif(callCount == completionCount){\n\t \t\t\tconsole.log(\"all done\");\n\t \t\t\t$('#loading').remove();\n\n\t\t\t\tfor (var k=0; k<objectives.length; k++){\n\t\t\t\t\tcreateOrganizedDataDetails(objectives[k]);\n\t\t\t\t}\n\n\t\t\t\tif (FLAG=='list'){\n\t\t\t\t\tprintSpecificObjectives();\n\t\t\t\t}else{\n\t \t\t\t\tprintToScreen();\n\t \t\t\t}\n\t \t\t}\n\t\t}", "title": "" }, { "docid": "6bd6b78f3de81c331c6b6c32cf39e76a", "score": "0.5463128", "text": "function countAudioFiles() {\n\tloadPercentage += .7936;\n\t\n\t$(function() {\n \t$( \"#progressbar\" ).progressbar({\n \tvalue: loadPercentage\n \t});\n \t});\n\n\tif (loadPercentage > 99.9) {\n\t\tallFilesLoaded = true;\n\t\t$(\"#keyboard\").fadeIn(800);\n\t\t$(\"#legend\").fadeIn(800);\n\t\t$('#loadingMsg').html('<b>Done!</b>');\n\t};\n}", "title": "" }, { "docid": "c68a5e9c6ce8290502fb7d517b37bdb8", "score": "0.5388235", "text": "function contarRegistro(array){\n let total = JSON.parse(localStorage.getItem('biblioteca'))\n document.querySelector('#contadorManga').innerText = array.length + ' de ' + total.length\n \n}", "title": "" }, { "docid": "dad74fe4bf7bb5c999451825b71f518e", "score": "0.53749526", "text": "function count()\n {\n var count = 0;\n for(var t in templates){\n count += templates[t].count();\n }\n return count;\n }", "title": "" }, { "docid": "8d392dce5edc7481ccb4a4d4d0ae32dd", "score": "0.53735095", "text": "function counterCheck(){\n let total = 0;\n for (let i = 0; i < localStorage.length; i++) {\n if (localStorage.key(i) != \"Varukorgen\"){ // Kollar alla keys förutom Varukorgen\n total += parseInt(localStorage.getItem(localStorage.key(i))); // Lägger till rätt antal\n }\n }\n document.getElementById('counter').innerHTML = total; \n }", "title": "" }, { "docid": "0471217cdf125277005dd21275a66f99", "score": "0.5310687", "text": "function getProjectCount()\n\t{\n\t\t$('#spinLoad').show();\n\t\t$.ajax({\n\t\t\ttype: 'get',\n\t\t\turl: localUrl+'getProjectCount',\n\t\t\tcontentType: \"application/json; charset=utf-8\",\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(response){\n\t\t\t\tconsole.log('totalProjectCountText : '+response.message);\n\t\t\t\t$('#totalProjectCountText').html(response.message);\n\t\t\t\t$('#spinLoad').hide();\n\t\t\t},\n\t\t\terror: function(){console.log('#totalProjectCountText --> Gala re Pilaa');$('#spinLoad').hide();}\n\t\t});\n\t}", "title": "" }, { "docid": "04047a1e4901dca6ac64b707f6b0ac4f", "score": "0.52479774", "text": "function numberOfFiles(req, res) {\n // Retrieves the unit name\n const unit = req.query.unit;\n\n // Retrieves all the files from the unit's file table\n db.query('SELECT * FROM ' + unit + 'Files', (err, files) => {\n if (err) throw err;\n\n // Sends file row back as JSON object\n res.setHeader('Content-Type', 'application/json');\n res.send({\n \"files\": files\n });\n });\n}", "title": "" }, { "docid": "fa039567783abafaef5cfcf8876839ea", "score": "0.52300864", "text": "getReportCount() {\n return JSON.parse(localStorage.getItem(\"reportItems\")).length\n }", "title": "" }, { "docid": "e8027286ecbe2342d429139eba895131", "score": "0.5191675", "text": "function queueComplete(numFilesUploaded) {\n //var status = document.getElementById(\"divStatus\");\n //status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\n}", "title": "" }, { "docid": "d587e97f6b74d160c2c277fc8da0e368", "score": "0.51744634", "text": "function queueComplete(numFilesUploaded) {\r\n\tvar status = document.getElementById(\"divStatus\");\r\n\tstatus.innerHTML = \"Завантажено файлів:\" + numFilesUploaded ;\r\n}", "title": "" }, { "docid": "28ab6ea83e13d2cc6c1577af8c5b0ffa", "score": "0.51597047", "text": "function loadSuccess(index, data) {\n if (data && internal.countMode === COUNT_MODE.detect) {\n //Update if the page exists, countMode is detect and index is higher than count\n internal.count = Math.max(internal.count, index);\n }\n }", "title": "" }, { "docid": "22233241857078c806cbb51b02ad7312", "score": "0.5137538", "text": "function getUserCount() {\n console.log(\"In getUser\");\n \n $.get(\"/app.json\", function(data) {\n completionCount = data;\n console.log(\"This is # of completed tasks in user.js: \"+data);\n console.log(\"Running Count: \"+completionCount);\n\n }).done(getTodos);\n\n}", "title": "" }, { "docid": "b51d1fca88c14cc70b8cabab5eee6c63", "score": "0.5118326", "text": "function count() {\r\n return data.length;\r\n}", "title": "" }, { "docid": "9d231e06b28f92444115d1f64eec8b23", "score": "0.5106533", "text": "function handlePOObject(filename, po) {\n // Remove previous results\n $(\"#results\").empty();\n // Go through PO file and try to auto-translate untranslated strings.\n let newPO = handleTranslations(po);\n let autoTranslatedCount = newPO.translations[''].length;\n $(\"#progressMsg\").text(`Auto-translated ${autoTranslatedCount} strings`)\n // Export to new PO\n downloadFile(new POExporter(newPO).compile(),\n filename + \".translated.po\",\n 'text/x-gettext-translation')\n}", "title": "" }, { "docid": "000e9a984ffa52161a84f00ce130bb63", "score": "0.51052856", "text": "function countSubmissions(){\n\n\t\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: baseUrl + '/topics',\n\t\tsuccess: function(data){\n\t\t\tdisplaySubmissionscount(data.length)\n\t\t},\n\t\terror: function(data){\n\t\t\tconsole.log('Did not count submissions')\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "baaabe27e55b1b3e55380e7463487a59", "score": "0.51025426", "text": "function initProjectBtns() {\n /*\n * in order to keep track of what the last page was and not inturupt the hotspots\n * i need to get each page id - which has a number,\n * strip away all but that number and make the numOfPages equal that\n */\n numOfPages = 0;\n $(\".projectItem\").on('click', function () {\n projName = $(this).text();//get the title of the project & pass the project name to the holder var\n $.get(\"projects/\" + removeWhiteSpace(projName) + \"/\" + removeWhiteSpace(projName) + \"_raw.txt\", function (data) {\n bodyText = data.split(\",\");//load the raw file and push to the holder array\n }).success(function () {\n for (var i = 0; i < bodyText.length; i++) {\n appendPrevSlides(bodyText[i]);\n \n //console.log(numOfPages);\n }\n addThumbnailTitles();\n initHotSpots();\n $(\"#form\").hide().siblings().show();\n });\n });\n}", "title": "" }, { "docid": "03b4230610bae67575c13978f2b73b17", "score": "0.5091881", "text": "function fetchTotals(fields) {\n var tots = 0;\n var commands = \"\";\n var ctrl = true;\n for (var c = 0; c < fields.length; c++) {\n commands = commands + '&' + fields[c][0] + '=' + fields[c][1];\n }\n $.when(\n $.ajax({\n url:'http://safetrails.herokuapp.com/index.php/cases?count=true' + commands,\n dataType:'string',\n xhrFields: {\n withCredentials: false\n },\n type:'GET',\n success:function(data) {\n // Extract info\n tots = data;\n }\n })\n ).done( function (x) {\n ctrl = false;\n });\n while (ctrl) {\n // Do nothing\n }\n return tots;\n}", "title": "" }, { "docid": "f3bf86603b92bb04a3c44fbdcd5195eb", "score": "0.50899065", "text": "function queueComplete(numFilesUploaded) {\n\t//var status = document.getElementById(\"divStatus\");\n\t//status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\n}", "title": "" }, { "docid": "f3bf86603b92bb04a3c44fbdcd5195eb", "score": "0.50899065", "text": "function queueComplete(numFilesUploaded) {\n\t//var status = document.getElementById(\"divStatus\");\n\t//status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\n}", "title": "" }, { "docid": "fc4d661269d71886b513bce430c3e57f", "score": "0.50881", "text": "function ajaxCount() {\n if($('.ajax-filter-count').length) {\n var count = $('.ajax-filter-count').data('count')\n $(ajaxCountSelector).text(count)\n } else {\n $(ajaxCountSelector).text($(ajaxItemSelector).length)\n }\n }", "title": "" }, { "docid": "2ae7b80bd6bf8092b1b8f228729275c6", "score": "0.50800866", "text": "function showTotalUnreadMyMailCounts()\n{\n//\tconsole.log(\"getting counts\");\n\t $.ajaxQueue({\n url: \"/\" + PROJECT_NAME + \"mail/get-unread-mail-counts-inbox\",\n type: \"POST\",\n dataType: \"json\",\n data: {},\n timeout: 50000,\n success: function(jsonData) {\n //\tconsole.log(jsonData);\n \tif( jsonData == 0 )\n \t{\n \t\t$('div.mail_notifications_js').addClass('unread-mail-count-zero');\n \t\t$('div.notifi-count-outer-js div.notifi-count-hover, div.notifi-count-outer-js div.notifi-count').css('visibility','hidden'); \n \t}\t\n \telse if( jsonData !== undefined )\n \t{\n \t\t$(\"div#mail-notifi-count\").css('visibility','visible');\n\t \t$(\"div.mail_notifications span#uread_mail_count\").html(jsonData);\n\t \t$('div.mail_notifications_js').removeClass('unread-mail-count-zero');\n \t}\n \telse\n \t{\n \t}\n }\n\t});\n}", "title": "" }, { "docid": "ce77734451e711d41d161bf57b2483be", "score": "0.50797516", "text": "get uploadingMsg() {\n return `Bezig met het opladen van ${this.fileQueue.files.length} bestand(en). (${this.fileQueue.progress}%)`;\n }", "title": "" }, { "docid": "d2c48da19fb7b2ea0c79e67aa03dbd32", "score": "0.5072492", "text": "function reloadCounters() {\n $.ajax({\n url: '/dashboard/tramitacao/counters',\n type: \"GET\",\n success: function (data) {\n $('#setor').html(data.noSetor);\n $('#pendente').html(data.pendentes);\n $('#arquivado').html(data.arquivado);\n $('#enviado').html(data.enviados);\n }\n });\n }", "title": "" }, { "docid": "eeb9e2ea0e83ab055d8e13a917fd7486", "score": "0.50721675", "text": "function setCount(source) {\n\tlet xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(){ \n \tif((xhr.readyState == 4) && (xhr.status == 200)) {\n\t\t\tlet json = JSON.parse(xhr.responseText);\n\t\t\t\n\t\t\tif(json.count > 0) {\n\t\t\t\t$(`#${source}-count`).text(json.count);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(`#${source}-count`).text(\"\");\n\t\t\t}\n \t}\n }\n \n xhr.open(\"GET\", source + \".count\", true);\n xhr.send();\n}", "title": "" }, { "docid": "456f771663ca28a65e8696c897ebfcd5", "score": "0.5066441", "text": "function queueComplete(numFilesUploaded)\n{\n /*var status = document.getElementById(\"divStatus\");\n status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";*/\n}", "title": "" }, { "docid": "efb3ef61366a9d6e08e1f299e666ebcd", "score": "0.5056088", "text": "function count(callback){\n chrome.storage.sync.get(null,function(elem){\n i =0;\n for(let item of Object.values(elem)){\n i++;\n }\n callback(i);\n });\n}", "title": "" }, { "docid": "cdd2aebcdfd97fa8d5bda322ef1e1e0b", "score": "0.5051609", "text": "function countTasks(taskPage){\n\t\tvar done = 0 ;\n\t\t//Guarda o numero de tarefas completadas\n $(taskPage).find('tbody tr td.not').each(function(){\n\t\t\tif ($(this).text() == 'sim'){\n\t\t\t\tdone++;\n\t\t\t}\n });\n\t\t\n\t\t//guarda o numero de linhas da tabela\n\t\tvar tasksTotal = $(taskPage).find('#tblTasks tbody tr').length;\n\n\n\t\t//atualiza o numero de tarefas\n\t\t$('#taskCount').text(tasksTotal-done); \n\n\t}", "title": "" }, { "docid": "0128d5502ca88a04413ccb0778206612", "score": "0.504699", "text": "function onUploadComplete(e) {\n totalUploaded += document.getElementById('files').files[filesUploaded].size;\n filesUploaded++;\n debug('complete ' + filesUploaded + \" of \" + fileCount);\n debug('totalUploaded: ' + totalUploaded);\n if (filesUploaded < fileCount) {\n uploadNext();\n } else {\n var bar = document.getElementById('bar');\n bar.style.width = '100%';\n bar.innerHTML = '100% complete';\n }\n }", "title": "" }, { "docid": "c219eab13106e04d6e4682f712444a1f", "score": "0.503498", "text": "function updateCounter() {\n var charCount = tweetBody().length;\n $('#counter').html(140 - charCount);\n }", "title": "" }, { "docid": "5aee7fd47b4cc1b26e5ec2d0cddee5cb", "score": "0.50338", "text": "function showCount(){\n var count = JSON.parse(localStorage.getItem(\"storedTasks\")).length;\n if(count == 0){\n document.getElementById(\"countNum\").innerHTML = \"0\";\n }\n document.getElementById(\"countNum\").innerHTML = count.toString();\n}", "title": "" }, { "docid": "c73d789b8ac2fa8657040c85215583e6", "score": "0.5031818", "text": "function processTranslations(data){\n var translationsArray = [];\n\n for(var i = 0; i < data.length; i++ ){\n var translation = data[i].data.data.translations[0].translatedText;\n console.log(translation);\n translationsArray.push(translation);\n }\n\n $scope.translationJapanese = translationsArray[0];\n $scope.translationRussian = translationsArray[1];\n $scope.translationFrench = translationsArray[2];\n\n console.log(translationsArray);\n return translationsArray;\n }", "title": "" }, { "docid": "011fc532c0b0c6e99adf252670772efe", "score": "0.5030441", "text": "function queueComplete(numFilesUploaded) {\r\r\n\tvar status = document.getElementById(\"divStatus\");\r\r\n\tstatus.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\r\r\n}", "title": "" }, { "docid": "50bc0a35b3f414912cef098c0308daff", "score": "0.50232047", "text": "FilesToUpload() {\n console.debug(`ContaplusModel::FilesToUpload`)\n let folder = this.GetSelectedFolder()\n let years = this.GetSelectedYears()\n const files = [ \"Diario.dbf\", \"Subcta.dbf\" ]\n let stats = new Array()\n for (let item of years) {\n let company = item[0]\n let checked = item[1]\n if (checked) {\n console.debug(`ContaplusModel::FilesToUpload:added ${company}`)\n let emp = \"EMP\" + company.codes[0].toString()\n for (let fileName of files) {\n let localFile = path.join(folder, \"CONTABLD\", emp, fileName)\n stats.push((new FileStats(\n company.name, company.years[0].toString(),\n localFile, emp, fileName)).Stats())\n }\n }\n }\n if (stats.length > 0) {\n // Add the directory book\n let localFile = path.join(folder, \"CONTABLD\", \"EMP\", \"Empresa.dbf\")\n stats.push((new FileStats(\"-\", \"-\", localFile, \"EMP\", \"Empresa.dbf\")).Stats())\n }\n return Promise.all(stats)\n }", "title": "" }, { "docid": "5482e9c2b0e07966af5a8eeb18178d76", "score": "0.5019751", "text": "function calculateViewAmount(uploads){\n let viewCounter = 0;\n\n for(const checkUpload of uploads){\n // console.log(checkUpload);\n\n let stringToCheck;\n if(within == 'alltime'){\n stringToCheck = 'viewsAllTime';\n } else {\n stringToCheck = `viewsWithin${within}`;\n }\n const forThisUpload = checkUpload[stringToCheck];\n viewCounter = viewCounter + forThisUpload;\n }\n return viewCounter;\n }", "title": "" }, { "docid": "e302af71f0f6f03cb7251fbd8866dab6", "score": "0.50147206", "text": "getProxyTemplateTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllProxyTemplates()\n const count = entities.items.length\n\n commit('SET_TOTAL_PROXY_TEMPLATE_COUNT', count)\n }\n\n getItems()\n }", "title": "" }, { "docid": "48820f3d1dfaa809125e68d66fa718e8", "score": "0.50126386", "text": "function uploadedFile(id, textId){\n // get the files input and the text that indicates how many files did you upload\n let files = document.getElementById(id).files;\n let text = document.getElementById(textId);\n // it sets the text of textId as the number of files plus the string\n // if the files contain 0 or more than 1 object it says \"files\", if not it says \"file\"\n text.innerText = files.length>1||files.length==0 ? files.length+\" files selected\" : files.length+\" file selected\";\n}", "title": "" }, { "docid": "13575563c6f49f277071856d60f93e71", "score": "0.5012327", "text": "function setCounts() {\n pending.innerText = pendingJobs.length;\n completed.innerText = completedJobs.length;\n total.innerText = allJobs.length;\n}", "title": "" }, { "docid": "23bc5e36f383ba9e36ce16bb46e0df16", "score": "0.50087863", "text": "_extractUsersMessagesCount(messages, onlyMedia = null) {\n var users = [];\n\n // add an array entry for all user messages\n const allUsers = onlyMedia === null ? {allusers: true, totalMessages: 0, textMessages: 0, media: 0} : onlyMedia === false ? {allusers: true, textMessages: 1} : {allusers: true, media: 1}\n\n users.push(allUsers)\n\n // iterates through the messages, finds the user if it exists and adds a count variable to its object according to the specified requirements \n messages.map(m => { \n\n // if it's an user message and meets the media requirements specified\n if(m.isUserMessage && (onlyMedia !== false || !m.isMedia)){\n\n // adds count according to the specified requirements to the user through the index specified\n function countMessages(index){\n if(onlyMedia === null){\n users[index].totalMessages++\n }\n if(!onlyMedia && !m.isMedia){\n users[index].textMessages++\n }\n if(onlyMedia !== false && m.isMedia){\n users[index].media++\n }\n }\n\n // tries to find the user through the index, if it doesn't it returns -1\n var user_index = users.findIndex(u => u.user == m.user)\n\n // creates a new user object with the initial count if it doesn't exist already in the array, otherwise just adds to the count\n if(user_index == -1){\n const user = onlyMedia === null ? {user: m.user, totalMessages: 1, textMessages: !m.isMedia ? 1 : 0, media: m.isMedia ? 1 : 0} : onlyMedia === false ? {user: m.user, textMessages: 1} : {user: m.user, media: 1}\n users.push(user)\n } else {\n countMessages(user_index)\n }\n\n countMessages(0)\n\n }\n\n });\n\n // sorts by media, messages or totalMessages depending on the specified requests\n if(onlyMedia) {\n users = users.sort((a, b) => { return b.media - a.media; })\n } else if (onlyMedia == false) {\n users = users.sort((a, b) => { return b.textMessages - a.textMessages; })\n } else {\n users = users.sort((a, b) => { return b.totalMessages - a.totalMessages; })\n }\n\n return users;\n }", "title": "" }, { "docid": "db7fb82099d78940aafa8f86b110118e", "score": "0.500448", "text": "function countEvents() {\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n\t myObj = JSON.parse(this.responseText);\n\t counter = Object.keys(myObj.events).length;\n\t }\n\t};\n\txmlhttp.open(\"GET\", \"https://api.myjson.com/bins/9om0m\", true);\n\txmlhttp.send();\n}", "title": "" }, { "docid": "80eccc14357706dfbed40a36ecfcf7e7", "score": "0.50036275", "text": "async function getCount(){\n \t\t\tconst response = await fetch('getcount.php')\n\t\t\t\tconst conteo = await response.json()\n\t\t\t\treturn conteo;\n\t\t}", "title": "" }, { "docid": "9fb08903aa23459494e613df538a75eb", "score": "0.5002285", "text": "function countMDCompleteFiltered( rootId, request ) {\r\n//\tTolven.Util.log( rootId + \" \" + request.responseText );\r\n\t$(rootId+\"-foot\").innerHTML = \"\";\r\n\tvar lg = liveGrids[rootId];\r\n\tlg.setTotalRows( 1*request.responseText );\r\n\tlg.requestContentRefresh(0);\r\n}", "title": "" }, { "docid": "ae4d1544fafa216c09effbb7500e02e9", "score": "0.4999071", "text": "function renderCounter(selectedProject) {\n const incompleteTasks = selectedProject.tasks.filter(\n (task) => !task.complete\n ).length;\n const tasksLeft = incompleteTasks === 1 ? 'task' : 'tasks';\n counter.innerText = `${incompleteTasks} ${tasksLeft} to go!`;\n}", "title": "" }, { "docid": "ea22fb6409ce50d35fdc09bb32e08d60", "score": "0.49974957", "text": "function filesIncrement() {\n counter = counter + 1;\n\n roamingFolder.createFileAsync(filename, Windows.Storage.CreationCollisionOption.replaceExisting)\n .then(function (file) {\n return Windows.Storage.FileIO.writeTextAsync(file, counter);\n }).done(function () {\n filesDisplayOutput();\n });\n }", "title": "" }, { "docid": "771275aca841065a63fede49185518ff", "score": "0.49966273", "text": "function calculate_all(){\n\tlet counter = [ //how common the xss is so it can give a warning\n\t\t0, //external\n\t\t0, //obfuscated\n\t\t0, //handler\n\t\t0, //tag\n\t]\n\n\tfor(let i = 0;i < payload.length; i++){\n\t\tcounter[0]+= externa_scr(payload[i].toLowerCase())\n\t\tcounter[1]+= obfuscated(payload[i].toLowerCase())\n\t\tcounter[2]+= handler(payload[i].toLowerCase())\n\t\tcounter[3]+= tag(payload[i].toLowerCase())\n\t}\n\t\n\tfor(let i = 0;i < counter.length; i++){\n\t\tcounter[i] = counter[i]/payload.length\n\t}\n\n\tdocument.getElementById('scr_av').innerHTML = counter[0]\n\tdocument.getElementById('obf_av').innerHTML = counter[1]\n\tdocument.getElementById('hand_av').innerHTML = counter[2]\n\tdocument.getElementById('tag_av').innerHTML = counter[3]\n\n}", "title": "" }, { "docid": "baade4b02a935ca72379fe8f4b95b393", "score": "0.4996507", "text": "function readFiles() {\n\twordCounter = 0;\n\tfileCounter = 0;\n\tenglish = [];\n\tjapanese = [];\n\tvar reader = new FileReader();\n\t\n\treader.onload = function(e) {\n\t\tvar text = reader.result;\n\t\tvar strings = text.split(\"\\r\");\n\t\tfor (var i = 0; i < strings.length / 2; i++) {\n\t\t\tenglish[wordCounter] = strings[i * 2].trim();\n\t\t\tjapanese[wordCounter] = strings[(i * 2) + 1].trim();\n\t\t\tdone[wordCounter] = false;\n\t\t\twordCounter++;\n\t\t}\n\n\t\tfileCounter++;\n\n\t\tif (fileCounter !== files.length) {\n\t\t\treader.readAsText(files[fileCounter], \"UTF-8\");\n\t\t} else {\n\t\t\t// clone the word list\n\t\t\toriginalEnglish = english.slice(0);\n\t\t\toriginalJapanese = japanese.slice(0);\n\t\t\tremaining = english.length;\n\n\t\t\tdocument.getElementById(\"report\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"input\").value = \"\";\n\t\t\tstartCountdown();\n\t\t}\n\t};\n\n\treader.readAsText(files[fileCounter], \"UTF-8\");\n}", "title": "" }, { "docid": "c7397dac334b4d9c68a046ee4b38f30f", "score": "0.49950635", "text": "countTracked() {\n return(Object.keys(tTracked).length)\n }", "title": "" }, { "docid": "8e50298c55f0b6a484861941a4db2899", "score": "0.4994616", "text": "function getMessageNotificationCount() {\n sidebarDataLayer.getNotificationCount()\n .then(function (success) {\n vm.messageCount = success.data.msg_count;\n }, function (error) {\n notificationService.error(\"message notification count failed\");\n });\n }", "title": "" }, { "docid": "f47add260bbf10a9802f08cf78a86e0d", "score": "0.49916497", "text": "function getMessages(){\r\n let messageRequest = new XMLHttpRequest();\r\n messageRequest.open('GET', './data.json');\r\n messageRequest.onload = function() {\r\n let messageData = JSON.parse(messageRequest.responseText);\r\n\r\n\r\n //Gets and uses message information from JSON array:\r\n document.querySelector('#messageText').textContent = messageData.projectMessages[counter];\r\n counter = counter + 1;\r\n\r\n //Resets the counter if it's value exceeds the length of the message list:\r\n if (counter > (messageData.projectMessages.length - 1)){\r\n counter = 0;\r\n }\r\n }\r\n messageRequest.send();\r\n}", "title": "" }, { "docid": "755baa5f6924c089f981e4c7a6d3ed1b", "score": "0.4990213", "text": "function getGreetCounter() {\n return Object.keys(greetedUsers).length;//gets length of local storage object\n }", "title": "" }, { "docid": "8d3765ec84f4ec61edd3ba1c70660716", "score": "0.49762708", "text": "function cntupdate() {\n var cnt = 0;\n for (cnt; cnt < $('.list-elem').length; cnt++);\n $('.taskcount strong').text(cnt);\n var num = cnt;\n return ++num;\n }", "title": "" }, { "docid": "7e5ab434a40e70fc34c4331dea1e6dab", "score": "0.49749562", "text": "function loadComplete() {\n cnt--;\n if (!cnt) {\n execComplete();\n }\n }", "title": "" }, { "docid": "d18f60ccae3b6b86613ff357cb0d6225", "score": "0.49701086", "text": "totaluploadprogress () {\n }", "title": "" }, { "docid": "43bb0238eaa223d224ebdd62aa4360ab", "score": "0.49685213", "text": "function countMessages(index){\n if(mostActiveMonths[index].hasOwnProperty(months[month])){\n\n if(!m.isMedia){\n if(mostActiveMonths[index][months[month]].hasOwnProperty('textMessages')){\n mostActiveMonths[index][months[month]].textMessages++\n } else {\n mostActiveMonths[index][months[month]].textMessages = 1\n }\n }\n\n if(m.isMedia){\n if(mostActiveMonths[index][months[month]].hasOwnProperty('media')){\n mostActiveMonths[index][months[month]].media++\n } else {\n mostActiveMonths[index][months[month]].media = 1\n }\n }\n\n mostActiveMonths[index][months[month]].total_month++\n\n } else {\n mostActiveMonths[index][months[month]] = {total_month: 1, textMessages: m.isMedia ? 0 : 1, media: m.isMedia ? 1 : 0}\n }\n mostActiveMonths[index].all_months_total++\n }", "title": "" }, { "docid": "1db0e5d8ff20848c61c4a302341b02a5", "score": "0.49641433", "text": "function setup() {\n if (DEBUG)\n {\n console.log('Mosca server is up and running');\n console.log(`Publish rate: ${FREQ} Hz`)\n }\n\n countLinesInFile(dataFilename, (err, numLines) => {\n if (!err){\n numberOfLines = numLines\n }\n });\n}", "title": "" }, { "docid": "525a2dae8a0b375ba984dd657c8a3538", "score": "0.4954138", "text": "async function getWords(){\n var words = []\n await gun.get('wordbook-extension').get('unkonw-words').map(function(data){\n if(data.status != 'unknow')return;\n\n words.push({\n english:data.english,\n count:data.count + 1,\n url:data.url,\n time:data.time\n });\n })\n console.log(words.length);\n return words;\n}", "title": "" }, { "docid": "7689e3744f6f96060779491739d1d659", "score": "0.4952765", "text": "function countLoadedImagesAndLaunchIfReady() {\n\tpicsToLoad--;\n\tif(picsToLoad == 0) {\n\t\thandleComplete();\n\t}\n}", "title": "" }, { "docid": "d2c7341e4e92e6dd1f9c940e984f95fb", "score": "0.49435923", "text": "async size() {\n try {\n\n let values = await this.getValuesID();\n let exerciseApi = new ExerciseApi(values[0], values[1]);\n\n let retrieved = await exerciseApi.getAllExercises();\n\n return retrieved.totalCount;\n\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "4444cfac72a31dc1c10576376addca88", "score": "0.49414727", "text": "function getGemCount() {\n // Default to 0 in case errors\n\n // If user has a beta token in localstorage, use that. Else, get one.\n // This needs to be done right now because the CA-API does not currently support auth0 tokens only.\n var gemCount = 0;\n\n $.ajax({\n url: gemCountPath,\n cache: false,\n contentType: 'application/json',\n headers: {\n Authorization: accessToken()\n },\n success: function (data) {\n console.log(data)\n gemCount = data.gem_count;\n },\n error: function (error) {\n // console.log(error.responseJSON)\n },\n complete: function () {\n // Schedule the next request when the current one's complete\n $('#gemCount').text(gemCount);\n }\n });\n}", "title": "" }, { "docid": "da2b1ed3f0e6bb717de61c2a224bbefb", "score": "0.49401438", "text": "async uniqueFullNameCount () {\n const nameData = await this.trimData(this.inFile)\n const uniqueFullNames = nameData.filter(this.uniqueElement)\n console.log('1.) The unique count of full names is ', uniqueFullNames.length)\n const writeData = '1.) The unique count of full names is ' + uniqueFullNames.length + '\\n' + '\\n'\n this.appendSolution(this.outFile, writeData)\n }", "title": "" }, { "docid": "8041553da7ad2ac1d47a285be76a96e8", "score": "0.49382326", "text": "function getTxtCount(){\n return gTxtCount;\n}", "title": "" }, { "docid": "8b44e139526af3877a690d7010b1f674", "score": "0.49360138", "text": "function getYearlyCheckedMailCount() {\n $.get(serverURL + \"/mails/yearlyChecked\", function(data, status) {\n console.log(\"yearlyCheckedMailCount\");\n console.log(data.mailCount);\n document.getElementById(\"yearlyCheckedMailCountLabel\").innerText =\n data.mailCount;\n });\n}", "title": "" }, { "docid": "36daab1844c07cfd1c00b7af374f3119", "score": "0.493141", "text": "function queueComplete(numFilesUploaded) {\n\tvar status = document.getElementById(\"divStatus\");\n\tstatus.innerHTML = numFilesUploaded + \" 文件\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" 上传成功.\";\n}", "title": "" }, { "docid": "03ed817f7241da8c7a75f79b81035dc5", "score": "0.49289834", "text": "function queueComplete(numFilesUploaded) {\n\tvar status = document.getElementById(\"divStatus\");\n\tstatus.innerHTML = \"已上传 \"+numFilesUploaded + \" 文件\";\n}", "title": "" }, { "docid": "1b70fcb00ce14934030ec9b5a0032c4a", "score": "0.49286866", "text": "function getCount() {\n return count;\n}", "title": "" }, { "docid": "4b9dfd2372b8b162c042dfef261195b5", "score": "0.49268216", "text": "function keyCounter() {\r\n if(localStorage.getItem('entryCount') == null || localStorage.getItem('entryCount') == 0) {\r\n // Reset counter\r\n console.log(\"No LocalStorage data found, resetting counter...\");\r\n localStorage.setItem('entryCount', 0);\r\n }\r\n else {\r\n // Loop through localstorage and write saved data to page\r\n console.log(\"LocalStorage data found, attempting to load...\");\r\n\r\n for(i=1;i<=localStorage.getItem('entryCount');i++) {\r\n if(localStorage.getItem(`${i}date`) == null) {\r\n // Skip if current entry no longer exists\r\n continue;\r\n } else if( !(i + 1 == localStorage.getItem('entryCount')) ) {\r\n // Update page\r\n pageUpdate(i + 1, false);\r\n } else if(i + 1 == localStorage.getItem('entryCount')) {\r\n // Update page, is most recent item\r\n pageUpdate(i + 1, true);\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "e1553173f1eae41d4ff0b904db68a1f3", "score": "0.49142873", "text": "updateCounter () {\n\t\tthis.model.incrementUserMovements();\n\t\t$writeInnerHTML( this.view.$counter, this.model.userMovements );\n\t}", "title": "" }, { "docid": "a755cc183d87cc2bd486818e4230429b", "score": "0.49080035", "text": "function onUploadComplete(e) {\r\n\ttotalUploaded += document.getElementById('files').files[filesUploaded].size;\r\n\tfilesUploaded++;\r\n\t// debug('complete ' + filesUploaded + \" of \" + fileCount);\r\n\t// debug('totalUploaded: ' + totalUploaded);\r\n\tif (filesUploaded < fileCount) {\r\n\t\tuploadNext();\r\n\t} else {\r\n\t\tvar bar = document.getElementById('bar');\r\n\t\tbar.style.width = '100%';\r\n\t\tbar.innerHTML = '100% complete';\r\n\t\t//notification();\r\n\t}\r\n}", "title": "" }, { "docid": "71adab9f86e0c0f4f7885200d4da4996", "score": "0.4906095", "text": "stats() {\n return {\n words: Object.keys(this.words).length,\n plurals: Object.keys(this.irregulars.nouns).length,\n conjugations: Object.keys(this.irregulars.verbs).length,\n compounds: Object.keys(this.hasCompound).length,\n postProcessors: this.taggers.length,\n }\n }", "title": "" }, { "docid": "e368b746cb213ebbbbf8cc0e4b3ecb7f", "score": "0.49006304", "text": "function aumentarCantidad2() {\n etiquetaCantidad2.innerHTML++;\n}", "title": "" }, { "docid": "2666f79a7b473b32c48c1f08c68bcf86", "score": "0.48975766", "text": "async normalizeFilesCount() {\n let files = await fse.readdir(this.options.folder);\n\n if(!files.length) {\n return await this.addNewFile();\n }\n\n if(files.length <= this.options.filesCount) {\n return;\n }\n\n const diff = files.length - this.options.filesCount;\n const stats = [];\n \n for(let i = 0; i < files.length; i++) {\n const filePath = path.join(this.options.folder, files[i]);\n stats.push({ filePath, index: parseInt(path.basename(filePath)) });\n }\n \n const ordered = _.orderBy(stats, 'index', 'asc');\n const excess = ordered.slice(0, diff);\n const rest = ordered.slice(diff);\n\n for(let i = 0; i < excess.length; i++) {\n const file = excess[i];\n await fse.remove(file.filePath);\n }\n\n for(let i = 0; i < rest.length; i++) {\n const file = rest[i];\n await fse.rename(file.filePath, path.join(this.options.folder, `${ i + 1 }.log`));\n }\n }", "title": "" }, { "docid": "91893dcfa8c9b1557f7eeb96696a822a", "score": "0.48899913", "text": "function loadvariables(){ // this would be used if this was connected to a db \n checkFilesExist(); // make sure the local filesystem files exist, if not create them!\n c(); // spacer\n c(\"[File System]\",\"Loading previously saved letiables\",\"cyan\"); // warn console that you're loading them\n c(\"[File System]\",\"Loading Alpha Roles Given...\",\"cyan\"); // warn that you're going to load the alpha roles given count\n fs.readFile(AlphaCountFileName, 'utf8', function(err, data) {NewCount=parseInt(data);}); // read the file and load the letiable(s)\n c(); // spacer\n}", "title": "" }, { "docid": "ab0d60b54c467f0dff77b3518a48c51a", "score": "0.4889909", "text": "async getCount() {\n try {\n const countString = await AsyncStorage.getItem(eventCountKey);\n return parseInt(countString, 10);\n } catch (ex) {\n console.log('Couldn\\'t retrieve positive events count. Error:', ex);\n }\n }", "title": "" }, { "docid": "337877550c8ff16ea02b59e86fe768de", "score": "0.4888553", "text": "obtainNumberOfDataCodeWord() {\n let countOfDataCodeWord = 0;\n switch (this.mVersion) {\n case 1:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 19;\n break;\n case 15:\n countOfDataCodeWord = 16;\n break;\n case 25:\n countOfDataCodeWord = 13;\n break;\n case 30:\n countOfDataCodeWord = 9;\n break;\n }\n break;\n case 2:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 34;\n break;\n case 15:\n countOfDataCodeWord = 28;\n break;\n case 25:\n countOfDataCodeWord = 22;\n break;\n case 30:\n countOfDataCodeWord = 16;\n break;\n }\n break;\n case 3:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 55;\n break;\n case 15:\n countOfDataCodeWord = 44;\n break;\n case 25:\n countOfDataCodeWord = 34;\n break;\n case 30:\n countOfDataCodeWord = 26;\n break;\n }\n break;\n case 4:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 80;\n break;\n case 15:\n countOfDataCodeWord = 64;\n break;\n case 25:\n countOfDataCodeWord = 48;\n break;\n case 30:\n countOfDataCodeWord = 36;\n break;\n }\n break;\n case 5:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 108;\n break;\n case 15:\n countOfDataCodeWord = 86;\n break;\n case 25:\n countOfDataCodeWord = 62;\n break;\n case 30:\n countOfDataCodeWord = 46;\n break;\n }\n break;\n case 6:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 136;\n break;\n case 15:\n countOfDataCodeWord = 108;\n break;\n case 25:\n countOfDataCodeWord = 76;\n break;\n case 30:\n countOfDataCodeWord = 60;\n break;\n }\n break;\n case 7:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 156;\n break;\n case 15:\n countOfDataCodeWord = 124;\n break;\n case 25:\n countOfDataCodeWord = 88;\n break;\n case 30:\n countOfDataCodeWord = 66;\n break;\n }\n break;\n case 8:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 194;\n break;\n case 15:\n countOfDataCodeWord = 154;\n break;\n case 25:\n countOfDataCodeWord = 110;\n break;\n case 30:\n countOfDataCodeWord = 86;\n break;\n }\n break;\n case 9:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 232;\n break;\n case 15:\n countOfDataCodeWord = 182;\n break;\n case 25:\n countOfDataCodeWord = 132;\n break;\n case 30:\n countOfDataCodeWord = 100;\n break;\n }\n break;\n case 10:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 274;\n break;\n case 15:\n countOfDataCodeWord = 216;\n break;\n case 25:\n countOfDataCodeWord = 154;\n break;\n case 30:\n countOfDataCodeWord = 122;\n break;\n }\n break;\n case 11:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 324;\n break;\n case 15:\n countOfDataCodeWord = 254;\n break;\n case 25:\n countOfDataCodeWord = 180;\n break;\n case 30:\n countOfDataCodeWord = 140;\n break;\n }\n break;\n case 12:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 370;\n break;\n case 15:\n countOfDataCodeWord = 290;\n break;\n case 25:\n countOfDataCodeWord = 206;\n break;\n case 30:\n countOfDataCodeWord = 158;\n break;\n }\n break;\n case 13:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 428;\n break;\n case 15:\n countOfDataCodeWord = 334;\n break;\n case 25:\n countOfDataCodeWord = 244;\n break;\n case 30:\n countOfDataCodeWord = 180;\n break;\n }\n break;\n case 14:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 461;\n break;\n case 15:\n countOfDataCodeWord = 365;\n break;\n case 25:\n countOfDataCodeWord = 261;\n break;\n case 30:\n countOfDataCodeWord = 197;\n break;\n }\n break;\n case 15:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 523;\n break;\n case 15:\n countOfDataCodeWord = 415;\n break;\n case 25:\n countOfDataCodeWord = 295;\n break;\n case 30:\n countOfDataCodeWord = 223;\n break;\n }\n break;\n case 16:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 589;\n break;\n case 15:\n countOfDataCodeWord = 453;\n break;\n case 25:\n countOfDataCodeWord = 325;\n break;\n case 30:\n countOfDataCodeWord = 253;\n break;\n }\n break;\n case 17:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 647;\n break;\n case 15:\n countOfDataCodeWord = 507;\n break;\n case 25:\n countOfDataCodeWord = 367;\n break;\n case 30:\n countOfDataCodeWord = 283;\n break;\n }\n break;\n case 18:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 721;\n break;\n case 15:\n countOfDataCodeWord = 563;\n break;\n case 25:\n countOfDataCodeWord = 397;\n break;\n case 30:\n countOfDataCodeWord = 313;\n break;\n }\n break;\n case 19:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 795;\n break;\n case 15:\n countOfDataCodeWord = 627;\n break;\n case 25:\n countOfDataCodeWord = 445;\n break;\n case 30:\n countOfDataCodeWord = 341;\n break;\n }\n break;\n case 20:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 861;\n break;\n case 15:\n countOfDataCodeWord = 669;\n break;\n case 25:\n countOfDataCodeWord = 485;\n break;\n case 30:\n countOfDataCodeWord = 385;\n break;\n }\n break;\n case 21:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 932;\n break;\n case 15:\n countOfDataCodeWord = 714;\n break;\n case 25:\n countOfDataCodeWord = 512;\n break;\n case 30:\n countOfDataCodeWord = 406;\n break;\n }\n break;\n case 22:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1006;\n break;\n case 15:\n countOfDataCodeWord = 782;\n break;\n case 25:\n countOfDataCodeWord = 568;\n break;\n case 30:\n countOfDataCodeWord = 442;\n break;\n }\n break;\n case 23:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1094;\n break;\n case 15:\n countOfDataCodeWord = 860;\n break;\n case 25:\n countOfDataCodeWord = 614;\n break;\n case 30:\n countOfDataCodeWord = 464;\n break;\n }\n break;\n case 24:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1174;\n break;\n case 15:\n countOfDataCodeWord = 914;\n break;\n case 25:\n countOfDataCodeWord = 664;\n break;\n case 30:\n countOfDataCodeWord = 514;\n break;\n }\n break;\n case 25:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1276;\n break;\n case 15:\n countOfDataCodeWord = 1000;\n break;\n case 25:\n countOfDataCodeWord = 718;\n break;\n case 30:\n countOfDataCodeWord = 538;\n break;\n }\n break;\n case 26:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1370;\n break;\n case 15:\n countOfDataCodeWord = 1062;\n break;\n case 25:\n countOfDataCodeWord = 754;\n break;\n case 30:\n countOfDataCodeWord = 596;\n break;\n }\n break;\n case 27:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1468;\n break;\n case 15:\n countOfDataCodeWord = 1128;\n break;\n case 25:\n countOfDataCodeWord = 808;\n break;\n case 30:\n countOfDataCodeWord = 628;\n break;\n }\n break;\n case 28:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1531;\n break;\n case 15:\n countOfDataCodeWord = 1193;\n break;\n case 25:\n countOfDataCodeWord = 871;\n break;\n case 30:\n countOfDataCodeWord = 661;\n break;\n }\n break;\n case 29:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1631;\n break;\n case 15:\n countOfDataCodeWord = 1267;\n break;\n case 25:\n countOfDataCodeWord = 911;\n break;\n case 30:\n countOfDataCodeWord = 701;\n break;\n }\n break;\n case 30:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1735;\n break;\n case 15:\n countOfDataCodeWord = 1373;\n break;\n case 25:\n countOfDataCodeWord = 985;\n break;\n case 30:\n countOfDataCodeWord = 745;\n break;\n }\n break;\n case 31:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1843;\n break;\n case 15:\n countOfDataCodeWord = 1455;\n break;\n case 25:\n countOfDataCodeWord = 1033;\n break;\n case 30:\n countOfDataCodeWord = 793;\n break;\n }\n break;\n case 32:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 1955;\n break;\n case 15:\n countOfDataCodeWord = 1541;\n break;\n case 25:\n countOfDataCodeWord = 1115;\n break;\n case 30:\n countOfDataCodeWord = 845;\n break;\n }\n break;\n case 33:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2071;\n break;\n case 15:\n countOfDataCodeWord = 1631;\n break;\n case 25:\n countOfDataCodeWord = 1171;\n break;\n case 30:\n countOfDataCodeWord = 901;\n break;\n }\n break;\n case 34:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2191;\n break;\n case 15:\n countOfDataCodeWord = 1725;\n break;\n case 25:\n countOfDataCodeWord = 1231;\n break;\n case 30:\n countOfDataCodeWord = 961;\n break;\n }\n break;\n case 35:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2306;\n break;\n case 15:\n countOfDataCodeWord = 1812;\n break;\n case 25:\n countOfDataCodeWord = 1286;\n break;\n case 30:\n countOfDataCodeWord = 986;\n break;\n }\n break;\n case 36:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2434;\n break;\n case 15:\n countOfDataCodeWord = 1914;\n break;\n case 25:\n countOfDataCodeWord = 1354;\n break;\n case 30:\n countOfDataCodeWord = 1054;\n break;\n }\n break;\n case 37:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2566;\n break;\n case 15:\n countOfDataCodeWord = 1992;\n break;\n case 25:\n countOfDataCodeWord = 1426;\n break;\n case 30:\n countOfDataCodeWord = 1096;\n break;\n }\n break;\n case 38:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2702;\n break;\n case 15:\n countOfDataCodeWord = 2102;\n break;\n case 25:\n countOfDataCodeWord = 1502;\n break;\n case 30:\n countOfDataCodeWord = 1142;\n break;\n }\n break;\n case 39:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2812;\n break;\n case 15:\n countOfDataCodeWord = 2216;\n break;\n case 25:\n countOfDataCodeWord = 1582;\n break;\n case 30:\n countOfDataCodeWord = 1222;\n break;\n }\n break;\n case 40:\n switch (this.mErrorCorrectionLevel) {\n case 7:\n countOfDataCodeWord = 2956;\n break;\n case 15:\n countOfDataCodeWord = 2334;\n break;\n case 25:\n countOfDataCodeWord = 1666;\n break;\n case 30:\n countOfDataCodeWord = 1276;\n break;\n }\n break;\n }\n return countOfDataCodeWord;\n }", "title": "" }, { "docid": "42af8c0ddd6997250b268681de668493", "score": "0.48873797", "text": "function updateCounts() {\n const counts = classifier.getClassExampleCount();\n\n select('#exampleRock').html(counts['Rock'] || 0);\n select('#examplePaper').html(counts['Paper'] || 0);\n select('#exampleScissor').html(counts['Scissor'] || 0);\n}", "title": "" }, { "docid": "c80ac312f6258d9f612a00045a19a342", "score": "0.4880346", "text": "function updateCounter() {\n $('#cart-counter').first().text($('.cart-item').length);\n }", "title": "" }, { "docid": "17575bad0ea5b7b4fd9ff0a5503b43e6", "score": "0.48798692", "text": "function processAutoUploadMessages() {\n var threads = autoUploadLabel.getThreads();\n for (var i = 0; i < threads.length; i++) {\n if (hasThreadBeenProcessed(threads[i])) {\n Logger.log('Message thread %s already processed.', threads[i].getId());\n continue;\n }\n var uploadFolder = getUploadPathFromLabel(threads[i]);\n var messages = threads[i].getMessages();\n for (var j = 0; j < messages.length; j++) {\n Logger.log('Processing message %s.', messages[j].getId());\n processMessageAttachments(messages[j], uploadFolder);\n }\n }\n}", "title": "" }, { "docid": "5702ccf989aa99aab12b5d23631874d5", "score": "0.48779437", "text": "async function setCounter() {\n\t\t\ttry {\n\t\t\t\t//Getting items from cart associated with that user\n\t\t\t\tconst cartItems = await axios.post(\n\t\t\t\t\t\"/cart/display\",\n\t\t\t\t\t{ username: userContext.userInfo.username },\n\t\t\t\t\t{\n\t\t\t\t\t\theaders: { \"auth-token\": localStorage.getItem(\"auth-token\") },\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t//Looping through the array and adding the value to a counter\n\t\t\t\tlet counter = 0;\n\t\t\t\tcartItems.data.data.forEach((product) => {\n\t\t\t\t\tcounter += product.quantity;\n\t\t\t\t});\n\n\t\t\t\t//Setting the cart items to the context (this updates the number beside the cart)\n\t\t\t\tif (mounted) {\n\t\t\t\t\tuserContext.setCartItems(counter);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error.message);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5acfea792afb11a5dcc4ef887541eb77", "score": "0.48778224", "text": "function aumentarCantidad1() {\n etiquetaCantidad1.innerHTML++;\n}", "title": "" }, { "docid": "3a60ff707e85d95b24b6743be97f111a", "score": "0.48761734", "text": "countItems() {\n this.elementsCounted = {};\n \t for(let name of this.items) {\n \t\tthis.elementsCounted[name] = this.elementsCounted[name] ? this.elementsCounted[name] + 1 : 1;\n }\n }", "title": "" }, { "docid": "8e7a4363881f9e2b409558a9bf94de4e", "score": "0.4874924", "text": "function taskCount() {\n var incompleteTasks = $(\"#slot3 .workitem-frame\").length;\n var inProgressTasks = $(\"#slot2 .workitem-frame\").length;\n var completeTasks = $(\"#slot1 .workitem-frame\").length;\n\n document.getElementById(\"numIncomplete\").innerHTML = \"(\" + incompleteTasks + \")\";\n document.getElementById(\"numInProgress\").innerHTML = \"(\" + inProgressTasks + \")\";\n document.getElementById(\"numComplete\").innerHTML = \"(\" + completeTasks + \")\";\n}", "title": "" }, { "docid": "7bd49057a4bf44065964255688791e7c", "score": "0.4871912", "text": "function updateCounter() {\n const counter = document.getElementById('itemCount');\n counter.textContent = `(${cart.items.length})`;\n}", "title": "" }, { "docid": "30d95da7fa452e4277f19fe7108223d6", "score": "0.4870879", "text": "function countMessages(index){\n if(onlyMedia === null){\n users[index].totalMessages++\n }\n if(!onlyMedia && !m.isMedia){\n users[index].textMessages++\n }\n if(onlyMedia !== false && m.isMedia){\n users[index].media++\n }\n }", "title": "" }, { "docid": "cb118b7e3c932f7ec449cc83619479db", "score": "0.48706284", "text": "function count_images() {\r\n if (++num_loaded_images == imageSum) {\r\n\t\t show_speed();\r\n\t\t $('#load').remove();\r\n animate();\r\n } else {\r\n\t\t $('#load').css({\r\n\t\t\t\tbackgroundImage: 'url(./assets/images/stars.gif)',\r\n\t\t\t\tbackgroundPosition: 'top left',\r\n\t\t\t\tbackgroundRepeat: 'repeat'\r\n\t\t });\r\n $('.label #playlabel').html('Loading: ');\r\n\t\t $('.label #playstatus').html(num_loaded_images+\" of \"+imageSum);\r\n }\r\n }", "title": "" }, { "docid": "d8276fb61079988aac3180895baca608", "score": "0.48698437", "text": "function onFileLoaded(result){ //result is an array of strings; each string is 1 sentence\n var str = \"\";\n for(var i = 0; i < result.length; i++){\n str += result[i]; //put entire file into 1 string\n }\n console.log(str);\n\n n2digit = numberOfMatches(str, reg2digit);\n n3digit = numberOfMatches(str, reg3digit);\n n4digit = numberOfMatches(str, reg4digit);\n\n\n var matches = str.match(regItalics); //get chunks of italicized text\n console.log(matches);\n for(var i =0; i < matches.length; i++){ //go through each chunk of italics, count # words\n nItalics += numberOfMatches(matches[i], regWords);\n }\n\n console.log(\"n italicized: \" + nItalics);\n console.log(\"n 2 digits: \" + n2digit);\n console.log(\"n 3 digits: \" + n3digit);\n console.log(\"n 4 digits: \" + n4digit);\n}", "title": "" }, { "docid": "d16d61b3d1cb196c04cd946eebe31776", "score": "0.48692364", "text": "function count() {\n\t\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"http://junting6.arts244.courses.bengrosser.com/admin/count.php\", //同目录下的php文件\n\t\tdata: \"info=\" + \"1\", // 等号前后不要加空格\n\t\tsuccess: function(msg) { //请求成功后的回调函数\n\n\t\t\t$(\"#count\").html(\"total visits:\" + msg);\n\n\t\t}\n\t})\n}", "title": "" }, { "docid": "a135cba09cd802e06b3613527f116536", "score": "0.48644334", "text": "async function loadData() {\n // Get the health of the connection\n let health = await connection.checkConnection();\n\n // Check the status of the connection\n if (health.statusCode === 200) {\n // Delete index\n await connection.deleteIndex().catch((err) => {\n console.log(err);\n });\n // Create Index\n await connection.createIndex().catch((err) => {\n console.log(err);\n });\n // If index exists\n if (await connection.indexExists()) {\n const parents = await rest.getRequest(rest.FlaskUrl + \"/N\");\n // If parents has the property containing the files\n if (parents.hasOwnProperty(\"data\")) {\n //Retrieve the parent list\n let parrentArray = parents.data;\n\n // Get amount of parents\n NumberOfParents = parrentArray.length;\n console.log(\"Number of parents to upload: \" + NumberOfParents);\n // Each function call to upload a JSON object to the index\n // delayed by 50ms\n parrentArray.forEach(delayedFunctionLoop(uploadParentToES, 50));\n }\n }\n } else {\n console.log(\"The connection failed\");\n }\n}", "title": "" }, { "docid": "4ebab338e1366b62fe4d17b23f16b947", "score": "0.48584494", "text": "function getVaultLength(url, token) {\n return new Promise((resolve, reject) => {\n var options = {\n url: url,\n headers: {\n authorization: `bearer ${token}`,\n \"user-agent\": \"Gig-Academy ([email protected])\"\n }\n };\n let length = 0;\n function callback(error, response, body) {\n if (!error) {\n data = JSON.parse(body);\n for (let i = 0; i < data.length; i++) {\n console.log(`documents_count ${data[i].documents_count}`);\n console.log(`uploads_count ${data[i].uploads_count}`);\n console.log(`vaults_count ${data[i].vaults_count}`);\n length +=\n parseInt(data[i].documents_count) +\n parseInt(data[i].uploads_count) +\n parseInt(data[i].vaults_count);\n }\n if (response.headers.link === undefined) {\n //no more pages so send the data\n resolve(length);\n } else {\n //get the next page and compile it\n let str = response.headers.link;\n str = str.split(\"<\");\n str = str[1].split(\">\");\n str = str[0];\n options.url = str;\n //call the Request function again\n Request(options, callback);\n }\n } else {\n reject(\"there was an error getting the length of the vaults file\");\n }\n }\n Request(options, callback);\n });\n}", "title": "" }, { "docid": "3c9aa21a7bdc5dcce6a2bd5cd4ca4fc2", "score": "0.48566553", "text": "function cartcounter(){\n let current=JSON.parse(localStorage.getItem(\"orders\"));\n let total=0;\n var order;\n for (order of current){\n total+= parseInt(order.orderQuantity);\n }\n return total;\n}", "title": "" }, { "docid": "b32fab7f9d8b2520e4f116e46860d5bb", "score": "0.4856068", "text": "function onUploadFinished(e) {\n\ttotFileUploaded += document.getElementById('files').files[uploadedFiles].size;\n\tuploadedFiles++;\n\tdebug('complete ' + uploadedFiles + \" of \" + totFileCount);\n\tdebug('totalFileUploaded: ' + totFileUploaded);\n\tif (uploadedFiles < totFileCount) {\n\t\tuploadNextFile();\n\t} else {\n\t\tvar bar = document.getElementById('bar');\n\t\tbar.style.width = '100%';\n\t\tbar.innerHTML = '100 % completed';\n\t\tbootbox.alert('File uploading Finished');\n\t}\n\n}", "title": "" }, { "docid": "fda8da6e6309c75207aa02f71e1ae5ee", "score": "0.48520264", "text": "function getTotalCount() {\n\t// go through all pCount in data array. then return total quantity.\n\tvar totalCount = 0; //default value 0\n\tvar jsonStr = cookieObj.get(\"datas\");\n\tvar listObj = JSON.parse(jsonStr);\n\tfor(var i = 0; i < listObj.length; i++) {\n\t\ttotalCount = listObj[i].pCount + totalCount;\n\t}\n\treturn totalCount;\n}", "title": "" }, { "docid": "ff519a3ec67279ae161b7afc025fec3f", "score": "0.48518637", "text": "submitFiles() {\n // To check whether user puts 2 datas\n if (this.files[0].length == 0 || this.files[1].length == 0){\n alert(\"You need to submit two files then click it again.\");\n } else {\n var order = 0;\n for (let file of this.files){\n const reader = new FileReader();\n reader.onload = e => {\n let ct = e.target.result.split('\\r\\n').map(x => parseFloat(x));\n this.numbers[order] = ct;\n order++;\n }\n reader.readAsText(file);\n }\n this.submitStatus = true;\n }\n }", "title": "" }, { "docid": "8ac453e499c26ec85615a05d44742342", "score": "0.4851225", "text": "incrementLoadedAssets () {\n this._loadedAssets += 1;\n }", "title": "" }, { "docid": "18dc6ff2e8a8aa610a3e3af0414f2487", "score": "0.48510584", "text": "function refreshCounter(){\r\n \t$(\" #card-counter \").text(deck.length + \" remaining\");\r\n }", "title": "" }, { "docid": "2ec8a303863d6a16df581dd49a71a536", "score": "0.48463497", "text": "function add_download_count_first_page(download) {\n let all_releases = document.querySelectorAll('.release-entry')\n let releases = []\n\n for (k = 0; k < all_releases.length; k++){\n if ( all_releases[k].className.localeCompare('release-entry') == 0 ){\n releases.push(all_releases[k])\n }\n }\n for (i = 0; i < releases.length; i++) {\n assets = releases[i]\n .getElementsByClassName('d-flex flex-justify-between py-1 \\\n py-md-2 Box-body px-2')\n\n for (j = 0, len = assets.length; j < len; j++) {\n asset_size = assets[j]\n .getElementsByClassName('text-gray flex-shrink-0')\n .item(1).innerText\n assets[j].getElementsByClassName('text-gray flex-shrink-0')\n .item(1).innerText = asset_size +\n \" (\" + download.shift() + \" \" +\n download_icon + \")\"\n }\n }\n}", "title": "" }, { "docid": "64817c4f45da9ba1dec1e8cebe593279", "score": "0.48458147", "text": "function completeHandler(data){\n\t\tclearMessages(); \n\t\tvar mess = [];\n\t\tvar mess =data.split(\"|\");\n\n\t\tswitch(mess[0]) {\n\t\t\tcase 'fileUpload':\n\t\t\t\t_(\"artStatus\").innerHTML = mess[1];\n\t\t\t\t_(\"status\").innerHTML = mess[2];\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fileRemove':\n\t\t\t\t_(\"artStatus\").innerHTML = 'removed';\n\t\t\t\t_(\"status\").innerHTML = mess[1];\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'uploadError':\n\t\t\t\t_(\"loaded_n_total\").innerHTML = '';\n\t\t\t\t\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// failed\n\t\t\t\t_(\"loaded_n_total\").innerHTML = 'System Error <br />';\n\t\t\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "5f2e6de82b34cb18d5469d2c39ac4fee", "score": "0.48449704", "text": "function countLoadedImagesAndLaunchIfReady(){\n picsToLoad--;\n //console.log(picsToLoad);\n \n if(picsToLoad == 0){\n imageLoadingDoneStartGame();\n }\n}", "title": "" }, { "docid": "7df57bb4a721e578a9ca3130eb0ae4e0", "score": "0.48423445", "text": "function getCounts() {\n kwordArr.sort();\n let currentWord = null;\n let cnt = 0;\n for (var i = 0; i < kwordArr.length; i++) {\n if (kwordArr[i] !== currentWord) {\n if (cnt > 0) {\n let word = {\n \"value\": currentWord,\n \"count\": cnt,\n }\n dataArray.push(word);\n }\n currentWord = kwordArr[i];\n cnt = 1;\n } else {\n cnt++;\n }\n }\n if (cnt > 0) {\n let word = {\n \"value\": currentWord,\n \"count\": cnt,\n }\n dataArray.push(word);\n }\n }", "title": "" }, { "docid": "5e0f7b7b0550290712c0de2ee682ba69", "score": "0.484164", "text": "function update_count()\n {\n let tmp_count = count_active_tasks(curr_list.todos);\n document.getElementById(\"count\").innerHTML = tmp_count + \" tasks left\";\n }", "title": "" }, { "docid": "d28064bf87c72a1a77ad16fd1041311e", "score": "0.48396218", "text": "function countLoadedSoundsAndLaunchIfReady() {\n assetsToLoad--;\n if (assetsToLoad == 0) {\n\n launchGame();\n\n } else {\n // TODO render a progress bar\n }\n //console.log(assetsToLoad);\n}", "title": "" } ]
3df693ccae1531706f121d92008eb02e
Wrapper around phpToken that helps maintain parser state (whether we are inside of a multiline comment)
[ { "docid": "d06f37d90f4d65f436306461925a64b1", "score": "0.6456021", "text": "function phpTokenState(inside) {\n return function(source, setState) {\n var newInside = inside;\n var type = phpToken(inside, source, function(c) {newInside = c;});\n if (newInside != inside)\n setState(phpTokenState(newInside));\n return type;\n };\n }", "title": "" } ]
[ { "docid": "94a1eba81b49c9d30309e9f6cadf52ba", "score": "0.69897664", "text": "function phpToken(inside, source, setInside) {\n function readHexNumber(){\n source.next(); // skip the 'x'\n source.nextWhileMatches(isHexDigit);\n return {type: \"number\", style: \"php-atom\"};\n }\n\n function readNumber() {\n source.nextWhileMatches(/[0-9]/);\n if (source.equals(\".\")){\n source.next();\n source.nextWhileMatches(/[0-9]/);\n }\n if (source.equals(\"e\") || source.equals(\"E\")){\n source.next();\n if (source.equals(\"-\"))\n source.next();\n source.nextWhileMatches(/[0-9]/);\n }\n return {type: \"number\", style: \"php-atom\"};\n }\n // Read a word and look it up in the keywords array. If found, it's a\n // keyword of that type; otherwise it's a PHP T_STRING.\n function readWord() {\n source.nextWhileMatches(isWordChar);\n var word = source.get();\n var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];\n // since we called get(), tokenize::take won't get() anything. Thus, we must set token.content\n return known ? {type: known.type, style: known.style, content: word} :\n {type: \"t_string\", style: \"php-t_string\", content: word};\n }\n function readVariable() {\n source.nextWhileMatches(isWordChar);\n var word = source.get();\n // in PHP, '$this' is a reserved word, but 'this' isn't. You can have function this() {...}\n if (word == \"$this\")\n return {type: \"variable\", style: \"php-keyword\", content: word};\n else\n return {type: \"variable\", style: \"php-variable\", content: word};\n }\n\n // Advance the stream until the given character (not preceded by a\n // backslash) is encountered, or the end of the line is reached.\n function nextUntilUnescaped(source, end) {\n var escaped = false;\n while(!source.endOfLine()){\n var next = source.next();\n if (next == end && !escaped)\n return false;\n escaped = next == \"\\\\\" && !escaped;\n }\n return escaped;\n }\n\n function readSingleLineComment() {\n // read until the end of the line or until ?>, which terminates single-line comments\n // `<?php echo 1; // comment ?> foo` will display \"1 foo\"\n while(!source.lookAhead(\"?>\") && !source.endOfLine())\n source.next();\n return {type: \"comment\", style: \"php-comment\"};\n }\n /* For multi-line comments, we want to return a comment token for\n every line of the comment, but we also want to return the newlines\n in them as regular newline tokens. We therefore need to save a\n state variable (\"inside\") to indicate whether we are inside a\n multi-line comment.\n */\n\n function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"php-comment\"};\n }\n\n // similar to readMultilineComment and nextUntilUnescaped\n // unlike comments, strings are not stopped by ?>\n function readMultilineString(start){\n var newInside = start;\n var escaped = false;\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == start && !escaped){\n newInside = null; // we're outside of the string now\n break;\n }\n escaped = (next == \"\\\\\" && !escaped);\n }\n setInside(newInside);\n return {\n type: newInside == null? \"string\" : \"string_not_terminated\",\n style: (start == \"'\"? \"php-string-single-quoted\" : \"php-string-double-quoted\")\n };\n }\n\n // http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc\n // See also 'nowdoc' on the page. Heredocs are not interrupted by the '?>' token.\n function readHeredoc(identifier){\n var token = {};\n if (identifier == \"<<<\") {\n // on our first invocation after reading the <<<, we must determine the closing identifier\n if (source.equals(\"'\")) {\n // nowdoc\n source.nextWhileMatches(isWordChar);\n identifier = \"'\" + source.get() + \"'\";\n source.next(); // consume the closing \"'\"\n } else if (source.matches(/[A-Za-z_]/)) {\n // heredoc\n source.nextWhileMatches(isWordChar);\n identifier = source.get();\n } else {\n // syntax error\n setInside(null);\n return { type: \"error\", style: \"syntax-error\" };\n }\n setInside(identifier);\n token.type = \"string_not_terminated\";\n token.style = identifier.charAt(0) == \"'\"? \"php-string-single-quoted\" : \"php-string-double-quoted\";\n token.content = identifier;\n } else {\n token.style = identifier.charAt(0) == \"'\"? \"php-string-single-quoted\" : \"php-string-double-quoted\";\n // consume a line of heredoc and check if it equals the closing identifier plus an optional semicolon\n if (source.lookAhead(identifier, true) && (source.lookAhead(\";\\n\") || source.endOfLine())) {\n // the closing identifier can only appear at the beginning of the line\n // note that even whitespace after the \";\" is forbidden by the PHP heredoc syntax\n token.type = \"string\";\n token.content = source.get(); // don't get the \";\" if there is one\n setInside(null);\n } else {\n token.type = \"string_not_terminated\";\n source.nextWhileMatches(/[^\\n]/);\n token.content = source.get();\n }\n }\n return token;\n }\n\n function readOperator() {\n source.nextWhileMatches(isOperatorChar);\n return {type: \"operator\", style: \"php-operator\"};\n }\n function readStringSingleQuoted() {\n var endBackSlash = nextUntilUnescaped(source, \"'\", false);\n setInside(endBackSlash ? \"'\" : null);\n return {type: \"string\", style: \"php-string-single-quoted\"};\n }\n function readStringDoubleQuoted() {\n var endBackSlash = nextUntilUnescaped(source, \"\\\"\", false);\n setInside(endBackSlash ? \"\\\"\": null);\n return {type: \"string\", style: \"php-string-double-quoted\"};\n }\n\n // Fetch the next token. Dispatches on first character in the\n // stream, or first two characters when the first is a slash.\n switch (inside) {\n case null:\n case false: break;\n case \"'\":\n case \"\\\"\": return readMultilineString(inside);\n case \"/*\": return readMultilineComment(source.next());\n default: return readHeredoc(inside);\n }\n var ch = source.next();\n if (ch == \"'\" || ch == \"\\\"\")\n return readMultilineString(ch);\n else if (ch == \"#\")\n return readSingleLineComment();\n else if (ch == \"$\")\n return readVariable();\n else if (ch == \":\" && source.equals(\":\")) {\n source.next();\n // the T_DOUBLE_COLON can only follow a T_STRING (class name)\n return {type: \"t_double_colon\", style: \"php-operator\"}\n }\n // with punctuation, the type of the token is the symbol itself\n else if (/[\\[\\]{}\\(\\),;:]/.test(ch)) {\n return {type: ch, style: \"php-punctuation\"};\n }\n else if (ch == \"0\" && (source.equals(\"x\") || source.equals(\"X\")))\n return readHexNumber();\n else if (/[0-9]/.test(ch))\n return readNumber();\n else if (ch == \"/\") {\n if (source.equals(\"*\"))\n { source.next(); return readMultilineComment(ch); }\n else if (source.equals(\"/\"))\n return readSingleLineComment();\n else\n return readOperator();\n }\n else if (ch == \"<\") {\n if (source.lookAhead(\"<<\", true)) {\n setInside(\"<<<\");\n return {type: \"<<<\", style: \"php-punctuation\"};\n }\n else\n return readOperator();\n }\n else if (isOperatorChar.test(ch))\n return readOperator();\n else\n return readWord();\n }", "title": "" }, { "docid": "9524c36e1ad68db08875c6f29457b187", "score": "0.6539873", "text": "function commentToken(label, body, opt) {\n var special = [\"jshint\", \"jslint\", \"members\", \"member\", \"globals\", \"global\", \"exported\"];\n var isSpecial = false;\n var value = label + body;\n var commentType = \"plain\";\n opt = opt || {};\n\n if (opt.isMultiline) {\n value += \"*/\";\n }\n\n body = body.replace(/\\n/g, \" \");\n\n if (label === \"/*\" && reg.fallsThrough.test(body)) {\n isSpecial = true;\n commentType = \"falls through\";\n }\n\n special.forEach(function(str) {\n if (isSpecial) {\n return;\n }\n\n // Don't recognize any special comments other than jshint for single-line\n // comments. This introduced many problems with legit comments.\n if (label === \"//\" && str !== \"jshint\") {\n return;\n }\n\n if (body.charAt(str.length) === \" \" && body.substr(0, str.length) === str) {\n isSpecial = true;\n label = label + str;\n body = body.substr(str.length);\n }\n\n if (!isSpecial && body.charAt(0) === \" \" && body.charAt(str.length + 1) === \" \" &&\n body.substr(1, str.length) === str) {\n isSpecial = true;\n label = label + \" \" + str;\n body = body.substr(str.length + 1);\n }\n\n if (!isSpecial) {\n return;\n }\n\n switch (str) {\n case \"member\":\n commentType = \"members\";\n break;\n case \"global\":\n commentType = \"globals\";\n break;\n default:\n var options = body.split(\":\").map(function(v) {\n return v.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\");\n });\n\n if (options.length === 2) {\n switch (options[0]) {\n case \"ignore\":\n switch (options[1]) {\n case \"start\":\n self.ignoringLinterErrors = true;\n isSpecial = false;\n break;\n case \"end\":\n self.ignoringLinterErrors = false;\n isSpecial = false;\n break;\n }\n }\n }\n\n commentType = str;\n }\n });\n\n return {\n type: Token.Comment,\n commentType: commentType,\n value: value,\n body: body,\n isSpecial: isSpecial,\n isMultiline: opt.isMultiline || false,\n isMalformed: opt.isMalformed || false\n };\n }", "title": "" }, { "docid": "ebbf2a4832b051039ef62ade9dcdaf51", "score": "0.6487462", "text": "function jsToken(inside, regexp, source, setInside) {\n function readHexNumber() {\n source.next(); // skip the 'x'\n source.nextWhileMatches(isHexDigit);\n return { type: \"number\", style: \"cm-atom\" };\n }\n\n function readNumber() {\n source.nextWhileMatches(/[0-9]/);\n if (source.equals(\".\")) {\n source.next();\n source.nextWhileMatches(/[0-9]/);\n }\n if (source.equals(\"e\") || source.equals(\"E\")) {\n source.next();\n if (source.equals(\"-\")) source.next();\n source.nextWhileMatches(/[0-9]/);\n }\n return { type: \"number\", style: \"cm-atom\" };\n }\n // Read a word, look it up in keywords. If not found, it is a\n // variable, otherwise it is a keyword of the type found.\n function readWord() {\n source.nextWhileMatches(isWordChar);\n var word = source.get();\n var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];\n return known ? { type: known.type, style: known.style, content: word } : { type: \"variable\", style: \"cm-variable\", content: word };\n }\n function readRegexp() {\n nextUntilUnescaped(source, \"/\");\n source.nextWhileMatches(/[gimy]/); // 'y' is \"sticky\" option in Mozilla\n return { type: \"regexp\", style: \"cm-string\" };\n }\n // Mutli-line comments are tricky. We want to return the newlines\n // embedded in them as regular newline tokens, and then continue\n // returning a comment token for every line of the comment. So\n // some state has to be saved (inside) to indicate whether we are\n // inside a /* */ sequence.\n function readMultilineComment(start) {\n var newInside = \"/*\";\n var maybeEnd = start == \"*\";\n while (true) {\n if (source.endOfLine()) break;\n var next = source.next();\n if (next == \"/\" && maybeEnd) {\n newInside = null;\n break;\n }\n maybeEnd = next == \"*\";\n }\n setInside(newInside);\n return { type: \"comment\", style: \"cm-comment\" };\n }\n function readOperator() {\n source.nextWhileMatches(isOperatorChar);\n return { type: \"operator\", style: \"cm-operator\" };\n }\n function readString(quote) {\n var endBackSlash = nextUntilUnescaped(source, quote);\n setInside(endBackSlash ? quote : null);\n return { type: \"string\", style: \"cm-string\" };\n }\n\n // Fetch the next token. Dispatches on first character in the\n // stream, or first two characters when the first is a slash.\n if (inside == \"\\\"\" || inside == \"'\") return readString(inside);\n var ch = source.next();\n if (inside == \"/*\") return readMultilineComment(ch);else if (ch == \"\\\"\" || ch == \"'\") return readString(ch);\n // with punctuation, the type of the token is the symbol itself\n else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) return { type: ch, style: \"cm-punctuation\" };else if (ch == \"0\" && (source.equals(\"x\") || source.equals(\"X\"))) return readHexNumber();else if (/[0-9]/.test(ch)) return readNumber();else if (ch == \"/\") {\n if (source.equals(\"*\")) {\n source.next();return readMultilineComment(ch);\n } else if (source.equals(\"/\")) {\n nextUntilUnescaped(source, null);return { type: \"comment\", style: \"cm-comment\" };\n } else if (regexp) return readRegexp();else return readOperator();\n } else if (isOperatorChar.test(ch)) return readOperator();else return readWord();\n }", "title": "" }, { "docid": "2f95af29e09cd3102c0c5f5968f16533", "score": "0.646567", "text": "function jsToken(inside, regexp, source, setInside) {\n function readHexNumber(){\n source.next(); // skip the 'x'\n source.nextWhileMatches(isHexDigit);\n return {type: \"number\", style: \"js-atom\"};\n }\n\n function readNumber() {\n source.nextWhileMatches(/[0-9]/);\n if (source.equals(\".\")){\n source.next();\n source.nextWhileMatches(/[0-9]/);\n }\n if (source.equals(\"e\") || source.equals(\"E\")){\n source.next();\n if (source.equals(\"-\"))\n source.next();\n source.nextWhileMatches(/[0-9]/);\n }\n return {type: \"number\", style: \"js-atom\"};\n }\n // Read a word, look it up in keywords. If not found, it is a\n // variable, otherwise it is a keyword of the type found.\n function readWord() {\n source.nextWhileMatches(isWordChar);\n var word = source.get();\n var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];\n return known ? {type: known.type, style: known.style, content: word} :\n {type: \"variable\", style: \"js-variable\", content: word};\n }\n function readRegexp() {\n nextUntilUnescaped(source, \"/\");\n source.nextWhileMatches(/[gi]/);\n return {type: \"regexp\", style: \"js-string\"};\n }\n // Mutli-line comments are tricky. We want to return the newlines\n // embedded in them as regular newline tokens, and then continue\n // returning a comment token for every line of the comment. So\n // some state has to be saved (inside) to indicate whether we are\n // inside a /* */ sequence.\n function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"js-comment\"};\n }\n function readOperator() {\n source.nextWhileMatches(isOperatorChar);\n return {type: \"operator\", style: \"js-operator\"};\n }\n function readString(quote) {\n var endBackSlash = nextUntilUnescaped(source, quote);\n setInside(endBackSlash ? quote : null);\n return {type: \"string\", style: \"js-string\"};\n }\n\n // Fetch the next token. Dispatches on first character in the\n // stream, or first two characters when the first is a slash.\n if (inside == \"\\\"\" || inside == \"'\")\n return readString(inside);\n var ch = source.next();\n if (inside == \"/*\")\n return readMultilineComment(ch);\n else if (ch == \"\\\"\" || ch == \"'\")\n return readString(ch);\n // with punctuation, the type of the token is the symbol itself\n else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch))\n return {type: ch, style: \"js-punctuation\"};\n else if (ch == \"0\" && (source.equals(\"x\") || source.equals(\"X\")))\n return readHexNumber();\n else if (/[0-9]/.test(ch))\n return readNumber();\n else if (ch == \"/\"){\n if (source.equals(\"*\"))\n { source.next(); return readMultilineComment(ch); }\n else if (source.equals(\"/\"))\n { nextUntilUnescaped(source, null); return {type: \"comment\", style: \"js-comment\"};}\n else if (regexp)\n return readRegexp();\n else\n return readOperator();\n }\n else if (isOperatorChar.test(ch))\n return readOperator();\n else\n return readWord();\n }", "title": "" }, { "docid": "1c2712a47ee5de2705c74b8b0e31495e", "score": "0.63873416", "text": "function Token(type, text, newlines, whitespace_before, parent) {\n\t this.type = type;\n\t this.text = text;\n\n\t // comments_before are\n\t // comments that have a new line before them\n\t // and may or may not have a newline after\n\t // this is a set of comments before\n\t this.comments_before = /* inline comment*/ [];\n\n\n\t this.comments_after = []; // no new line before and newline after\n\t this.newlines = newlines || 0;\n\t this.wanted_newline = newlines > 0;\n\t this.whitespace_before = whitespace_before || '';\n\t this.parent = parent || null;\n\t this.opened = null;\n\t this.directives = null;\n\t}", "title": "" }, { "docid": "e5a3fe038db1dafa83e92e2f36815904", "score": "0.6383301", "text": "function commentToken(label, body, opt) {\n var special = [\"jshint\", \"jslint\", \"members\", \"member\", \"globals\", \"global\", \"exported\"];\n var isSpecial = false;\n var value = label + body;\n var commentType = \"plain\";\n opt = opt || {};\n\n if (opt.isMultiline) {\n value += \"*/\";\n }\n\n body = body.replace(/\\n/g, \" \");\n\n if (label === \"/*\" && reg.fallsThrough.test(body)) {\n isSpecial = true;\n commentType = \"falls through\";\n }\n\n special.forEach(function(str) {\n if (isSpecial) {\n return;\n }\n\n // Don't recognize any special comments other than jshint for single-line\n // comments. This introduced many problems with legit comments.\n if (label === \"//\" && str !== \"jshint\") {\n return;\n }\n\n if (body.charAt(str.length) === \" \" && body.substr(0, str.length) === str) {\n isSpecial = true;\n label = label + str;\n body = body.substr(str.length);\n }\n\n if (!isSpecial && body.charAt(0) === \" \" && body.charAt(str.length + 1) === \" \" &&\n body.substr(1, str.length) === str) {\n isSpecial = true;\n label = label + \" \" + str;\n body = body.substr(str.length + 1);\n }\n\n // To handle rarer case when special word is separated from label by\n // multiple spaces or tabs\n var strIndex = body.indexOf(str);\n if (!isSpecial && strIndex >= 0 && body.charAt(strIndex + str.length) === \" \") {\n var isAllWhitespace = body.substr(0, strIndex).trim().length === 0;\n if (isAllWhitespace) {\n isSpecial = true;\n body = body.substr(str.length + strIndex);\n }\n }\n\n if (!isSpecial) {\n return;\n }\n\n switch (str) {\n case \"member\":\n commentType = \"members\";\n break;\n case \"global\":\n commentType = \"globals\";\n break;\n default:\n var options = body.split(\":\").map(function(v) {\n return v.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\");\n });\n\n if (options.length === 2) {\n switch (options[0]) {\n case \"ignore\":\n switch (options[1]) {\n case \"start\":\n self.ignoringLinterErrors = true;\n isSpecial = false;\n break;\n case \"end\":\n self.ignoringLinterErrors = false;\n isSpecial = false;\n break;\n }\n }\n }\n\n commentType = str;\n }\n });\n\n return {\n type: Token.Comment,\n commentType: commentType,\n value: value,\n body: body,\n isSpecial: isSpecial,\n isMalformed: opt.isMalformed || false\n };\n }", "title": "" }, { "docid": "4346f86d180742fa82e13b8ae2a063df", "score": "0.62742835", "text": "function commentToken(label, body, opt) {\n var special = [\n \"jshint\", \"jshint.unstable\", \"jslint\", \"members\", \"member\", \"globals\",\n \"global\", \"exported\"\n ];\n var isSpecial = false;\n var value = label + body;\n var commentType = \"plain\";\n opt = opt || {};\n\n if (opt.isMultiline) {\n value += \"*/\";\n }\n\n body = body.replace(/\\n/g, \" \");\n\n if (label === \"/*\" && reg.fallsThrough.test(body)) {\n isSpecial = true;\n commentType = \"falls through\";\n }\n\n special.forEach(function(str) {\n if (isSpecial) {\n return;\n }\n\n // Don't recognize any special comments other than jshint for single-line\n // comments. This introduced many problems with legit comments.\n if (label === \"//\" && str !== \"jshint\" && str !== \"jshint.unstable\") {\n return;\n }\n\n if (body.charAt(str.length) === \" \" && body.substr(0, str.length) === str) {\n isSpecial = true;\n label = label + str;\n body = body.substr(str.length);\n }\n\n if (!isSpecial && body.charAt(0) === \" \" && body.charAt(str.length + 1) === \" \" &&\n body.substr(1, str.length) === str) {\n isSpecial = true;\n label = label + \" \" + str;\n body = body.substr(str.length + 1);\n }\n\n // To handle rarer case when special word is separated from label by\n // multiple spaces or tabs\n var strIndex = body.indexOf(str);\n if (!isSpecial && strIndex >= 0 && body.charAt(strIndex + str.length) === \" \") {\n var isAllWhitespace = body.substr(0, strIndex).trim().length === 0;\n if (isAllWhitespace) {\n isSpecial = true;\n body = body.substr(str.length + strIndex);\n }\n }\n\n if (!isSpecial) {\n return;\n }\n\n switch (str) {\n case \"member\":\n commentType = \"members\";\n break;\n case \"global\":\n commentType = \"globals\";\n break;\n default:\n var options = body.split(\":\").map(function(v) {\n return v.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\");\n });\n\n if (options.length === 2) {\n switch (options[0]) {\n case \"ignore\":\n switch (options[1]) {\n case \"start\":\n self.ignoringLinterErrors = true;\n isSpecial = false;\n break;\n case \"end\":\n self.ignoringLinterErrors = false;\n isSpecial = false;\n break;\n }\n }\n }\n\n commentType = str;\n }\n });\n\n return {\n type: Token.Comment,\n commentType: commentType,\n value: value,\n body: body,\n isSpecial: isSpecial,\n isMalformed: opt.isMalformed || false\n };\n }", "title": "" }, { "docid": "25940e8502bd790678bcae069e2c0438", "score": "0.61639875", "text": "function Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}", "title": "" }, { "docid": "25940e8502bd790678bcae069e2c0438", "score": "0.61639875", "text": "function Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}", "title": "" }, { "docid": "25940e8502bd790678bcae069e2c0438", "score": "0.61639875", "text": "function Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}", "title": "" }, { "docid": "25940e8502bd790678bcae069e2c0438", "score": "0.61639875", "text": "function Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}", "title": "" }, { "docid": "25940e8502bd790678bcae069e2c0438", "score": "0.61639875", "text": "function Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}", "title": "" }, { "docid": "25940e8502bd790678bcae069e2c0438", "score": "0.61639875", "text": "function Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}", "title": "" }, { "docid": "25940e8502bd790678bcae069e2c0438", "score": "0.61639875", "text": "function Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}", "title": "" }, { "docid": "617fe241fc6c53b182be647c5bc15ecc", "score": "0.60522896", "text": "function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"php-comment\"};\n }", "title": "" }, { "docid": "235cb70e1bd8d7918ff2b069cb472b80", "score": "0.5987282", "text": "getNextToken() {\n let token;\n\n // need to fix it somehow?\n this.skipWhitespaces_();\n this.skipLineBreak_();\n this.skipWhitespaces_();\n this.skipLineBreak_();\n\n if (this.currentChar === '{') {\n token = new Token(TOKEN_TYPES.LCURLY);\n } else if (this.currentChar === '}') {\n token = new Token(TOKEN_TYPES.RCURLY);\n } else if (this.currentChar === '\\'') {\n this.readNextChar_();\n\n token = new Token(TOKEN_TYPES.STRING, this.getString_());\n } else if (this.currentChar === '\"') {\n this.readNextChar_();\n\n token = new Token(TOKEN_TYPES.STRING, this.getString_(true));\n } else if (this.currentChar === '.') {\n token = new Token(TOKEN_TYPES.DOT);\n } else if (this.currentChar === '@') {\n token = new Token(TOKEN_TYPES.ADDRESS);\n } else if (this.currentChar === '?') {\n token = new Token(TOKEN_TYPES.QUESTION_MARK);\n } else if (this.currentChar === '=') {\n token = new Token(TOKEN_TYPES.EQUAL);\n } else if (this.currentChar === '$') {\n token = new Token(TOKEN_TYPES.DOLLAR);\n } else if (this.currentChar === ':') {\n token = new Token(TOKEN_TYPES.COLON);\n } else if (this.currentChar === '/') {\n token = new Token(TOKEN_TYPES.SLASH);\n } else if (this.isAlpha_(this.currentChar)) {\n return this.id_();\n } else if (this.isInteger_(this.currentChar)) {\n token = new Token(TOKEN_TYPES.INTEGER,\n Number(this.getMultiIntegerChar_()));\n } else if (this.currentChar === '') {\n token = new Token(TOKEN_TYPES.EOF);\n } else {\n throw new Error(\n `Invalid character \"${ this.currentChar }\" at position ${ this.pos }`);\n }\n\n this.readNextChar_();\n\n return token;\n }", "title": "" }, { "docid": "7bb53150e15df75499c2ac38afac72e6", "score": "0.5897455", "text": "comment() {\n const data = this.takeUntilStartsWith('-->');\n if (this.eof()) {\n this.throwError('Missing comment end symbol `-->`');\n }\n this.seek(3);\n return { type: interfaces_1.TokenType.Comment, data: data };\n }", "title": "" }, { "docid": "db1805a11dfb891497bc343385333849", "score": "0.58674526", "text": "function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"js-comment\"};\n }", "title": "" }, { "docid": "0cb59f5d2cf68c9e04225b4fd49fbdf7", "score": "0.58602583", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // check for binary, octal, or hex\n\n var _c = currentString(state, 2);\n\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state); // get the digits after the radix\n\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state); // get the word size\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n return;\n } // get number, can have a single dot\n\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if ((0,_utils_object_js__WEBPACK_IMPORTED_MODULE_3__.hasOwnProperty)(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "d6409737cae8d8d61d3e72c653616b3c", "score": "0.5855219", "text": "lookahead() {\n let token = this.token;\n\n if (token.kind !== _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing.\n\n token.next = nextToken; // @ts-expect-error prev is only mutable during parsing.\n\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].COMMENT);\n }\n\n return token;\n }", "title": "" }, { "docid": "ad09fac23f95689332500abbf47f6994", "score": "0.5834908", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (parse.isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "67e29ebac9621169c432c7ca00597470", "score": "0.5826306", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c === '#') {\n while (c !== '\\n' && c !== '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c === '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c === '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length === 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c === '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c === 'E' || c === 'e') {\n if (parse.isDigit(c2) || c2 === '-' || c2 === '+') {\n token += c;\n next();\n\n if (c === '+' || c === '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 === '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c !== '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "67e29ebac9621169c432c7ca00597470", "score": "0.5826306", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (parse.isWhitespace(c, nesting_level)) {\n next();\n }\n\n // skip comment\n if (c === '#') {\n while (c !== '\\n' && c !== '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c === '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c === '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length === 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c === '.') {\n token += c;\n next();\n\n if (!parse.isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n if (parse.isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c === 'E' || c === 'e') {\n if (parse.isDigit(c2) || c2 === '-' || c2 === '+') {\n token += c;\n next();\n\n if (c === '+' || c === '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (parse.isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 === '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(c, prevPreview(), nextPreview())) {\n while (parse.isAlpha(c, prevPreview(), nextPreview()) || parse.isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c !== '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "6ae8962db3a8271afaa540f094749172", "score": "0.57985246", "text": "isPeekNextLineComment(level = -1) {\n if (!this.currentPeekIs(\"\\n\")) {\n return false;\n }\n\n let i = 0;\n\n while (i <= level || (level === -1 && i < 3)) {\n this.peek();\n if (!this.currentPeekIs(\"#\")) {\n if (i !== level && level !== -1) {\n this.resetPeek();\n return false;\n }\n break;\n }\n i++;\n }\n\n this.peek();\n if ([\" \", \"\\n\"].includes(this.currentPeek())) {\n this.resetPeek();\n return true;\n }\n\n this.resetPeek();\n return false;\n }", "title": "" }, { "docid": "5130dbe4f7dcaabce6569e180dd38453", "score": "0.5797039", "text": "inlineComment() {\n const context = new Parsing.Context(new Parsing.Data.Node('test'), `// Comment test, inline with end-of-line\\r\\n`);\n this.isTrue(Language.Comment.inline.consume(context));\n this.areSame(context.offset, context.length);\n }", "title": "" }, { "docid": "344c52392cb0d61be6d901c81db9eb1e", "score": "0.5763958", "text": "function specialHandlerComment(tokenStr, tokenDescriptionComponent) {\n let grn = { color: 'green', fontWeight: 'bold' }\n const comment = tokenDescriptionComponent.props.comment\n // we need AST (tern server) to be READY for this to work.. first queries may fail to locate comment\n if (!comment)\n return (\n <div>\n <p>Javascript comment</p>\n </div>\n )\n\n const str = comment.text.trim()\n if (str.startsWith(SpecialGlobals.editCode.mgbMentorPrefix))\n return (\n <div>\n <p>{str.substring(SpecialGlobals.editCode.mgbMentorPrefix.length).trim()}</p>\n </div>\n )\n\n // explain single line\n if (comment.block === false)\n return (\n <div>\n <p>\n Javascript <em>single line comments</em> start with <code style={grn}>//</code> and continue until\n the end of the current line\n </p>\n </div>\n )\n\n if (comment.block && str.startsWith('*'))\n return (\n <div>\n <p>\n Comments starting with <code style={grn}>/**</code> and ending with <code style={grn}>*/</code> are\n special JavaScript comments - called JSDoc.\n <br />\n JSDoc is a markup language used to annotate JavaScript source code files. Using comments containing\n JSDoc, programmers can add documentation describing the application programming interface of the\n code they're creating.\n </p>\n\n <p>\n There may be line breaks and any other characters between the <code style={grn}>/**</code> and{' '}\n <code style={grn}>*/</code>. This is example of JSDoc comment:\n </p>\n <pre style={grn}>{`/**\n * Create a point.\n * @param {number} x - The x value\n * @param {number} y - The y value\n * */\n `}</pre>\n <p>\n See{' '}\n <a href={xlinks.jsDoc} target=\"_blank\">\n jsdoc.org\n </a>{' '}\n for more details\n </p>\n </div>\n )\n\n return (\n <div>\n <p>\n Javascript <em>multi line comments</em> start with <code style={grn}>/*</code> and end with{' '}\n <code style={grn}>*/</code>\n </p>\n <small>\n <p>\n There may be line breaks and any other characters between the <code style={grn}>/*</code> and{' '}\n <code style={grn}>*/</code>\n </p>\n <pre style={grn}>\n /* This is an<br /> example multiline comment */\n </pre>\n <p>\n You may also see/use a special variant of multiline javascript comments with{' '}\n <code style={grn}>@something</code> strings like <code style={grn}>@param</code>. Developers use\n these to document their code so that automatic help text and api documentation can be extracted from\n the source code. See{' '}\n <a href={xlinks.jsDoc} target=\"_blank\">\n jsdoc.org\n </a>{' '}\n for details\n </p>\n </small>\n </div>\n )\n}", "title": "" }, { "docid": "607f9265cf55d86e67436f2e44b7d03c", "score": "0.5740467", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n comment = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (isWhitespace(c)) {\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n comment += c;\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!isDigit(c)) {\n // this is no number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.DELIMITER;\n }\n }\n else {\n while (isDigit(c)) {\n token += c;\n next();\n }\n if (isDecimalMark(c, nextPreview())) {\n token += c;\n next();\n }\n }\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n if (isDecimalMark(c, nextPreview())) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (currentIsAlpha()) {\n while (currentIsAlpha() || isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "b1220fa820e474e194868f16ec5e242d", "score": "0.57381487", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "b1220fa820e474e194868f16ec5e242d", "score": "0.57381487", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "28d506cdd88f03f35b1f6409ec1ba894", "score": "0.5734622", "text": "function commentator(cm) {\n \"use strict\";\n var\n start = cm.getCursor('start'),\n end = cm.getCursor('end'),\n curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(start).state).mode,\n name = curMode.name,\n commentLine = curMode.commentLine,\n commentStart = curMode.commentStart,\n commentEnd = curMode.commentEnd,\n jsDocstring = false,\n startText, trimText, cStart,\n currentLine,\n args = {\n oneLine: true,\n block: false,\n empty: true,\n notEmpty: false\n };\n\n function commentSingleLine(line, oneLine) {\n var\n delimiter = commentLine,\n text = cm.getLine(line),\n wsBefore = '';\n if (oneLine) {\n wsBefore = /^\\s*/.exec(text);\n text = text.replace(/^\\s*/, '');\n }\n if (text.indexOf(delimiter, 0) === 0) {\n text = text.substring(delimiter.length);\n } else {\n text = delimiter + text;\n }\n cm.setLine(line, wsBefore + text);\n }\n\n function commentSelection(empty) {\n var\n delStart = commentStart,\n delEnd = commentEnd,\n text = cm.getSelection();\n // If not jsDocstring, revert to single line comment for empty lines\n if (empty && (name === 'javascript') && !jsDocstring) {\n delStart = commentLine;\n delEnd = '';\n }\n if (text.indexOf(delStart, 0) === 0) {\n if (text.indexOf(delEnd, text.length - delEnd.length) !== -1) {\n text = text.substring(delStart.length, text.length - delEnd.length);\n }\n } else {\n text = delStart + text + delEnd;\n }\n cm.replaceSelection(text);\n if (empty) {\n cm.setSelection({line: start.line, ch: start.ch + delStart.length});\n }\n }\n\n // console.log('start ' + JSON.stringify(start));\n // console.log('end ' + JSON.stringify(end));\n // console.log(curMode);\n console.log('commentator: ' + name);\n\n // If mode is commentable\n if (commentLine || commentStart) {\n // Ignore javascript JSON mode\n if ((name === 'javascript') && curMode.jsonMode) {\n console.log('commentator: ignoring JSON mode');\n return;\n }\n\n if (start.line === end.line && start.ch === end.ch) {\n\n // If no selection\n startText = cm.getLine(start.line);\n trimText = startText.trim();\n\n if ((trimText.length === 0) && commentStart) {\n // If line is empty and multi-line comments available, leave cursor in\n // comment (useful for py docstring, maybe for javascript)\n commentSelection(args.empty);\n } else if (commentStart &&\n (trimText.indexOf(commentStart, 0) === 0) &&\n (trimText.indexOf(commentEnd, trimText.length - commentEnd.length !== -1))) {\n // If line is just a multi-line comment, select and uncomment it\n cStart = startText.indexOf(commentStart, 0);\n cm.setSelection({line: start.line, ch: cStart},\n {line: start.line, ch: cStart + trimText.length});\n commentSelection(args.notEmpty);\n } else if (commentLine) {\n // Comment/uncomment single line even if indented\n commentSingleLine(start.line, args.oneLine && (start.ch !== 0));\n } else {\n // Turn into to a selection\n cm.setSelection({line: start.line, ch: 0}, {line: start.line, ch: null});\n commentSelection(args.notEmpty);\n }\n\n } else {\n\n // There is a selection\n if ((commentLine && (start.ch === 0)) || !commentStart) {\n // Single-line comments are preferred for selections from start of line\n if (start.line === end.line &&\n ((name === 'python') || ((name === 'javascript') && jsDocstring))) {\n // If python or jsDocstring, make single line selection an exception\n commentSelection(args.notEmpty);\n } else {\n // Extend selection to whole lines\n if (end.ch !== 0) {\n end.line += 1;\n end.ch = 0;\n }\n // Iterate over selected lines\n currentLine = start.line;\n while (currentLine < end.line) {\n commentSingleLine(currentLine, args.block);\n currentLine += 1;\n }\n cm.setSelection(start, end);\n }\n } else {\n // multi-line comment\n commentSelection(args.notEmpty);\n }\n\n }\n }\n}", "title": "" }, { "docid": "9b6648444f0a49068e8ac1783dd84a62", "score": "0.5726695", "text": "function comment () {\n // comments\n if (char === '/' && nextChar() === '/') {\n // move past the two slashes\n next(); next()\n\n // if there is a space, move past that\n if (char.match(/\\s/)) next()\n\n // grab the comment body\n const comment = collectUntil('\\n')\n\n addToken('comment', comment)\n }\n }", "title": "" }, { "docid": "d91f505516c1454ee8f116ffa9d4142c", "score": "0.5712369", "text": "function commentator(cm) {\n var\n start = cm.getCursor('start'),\n end = cm.getCursor('end'),\n curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(start).state).mode,\n name = curMode.name,\n commentLine = curMode.commentLine,\n commentStart = curMode.commentStart,\n commentEnd = curMode.commentEnd,\n jsDocstring = false,\n startText, trimText, cStart,\n currentLine,\n args = {\n oneLine: true,\n block: false,\n empty: true,\n notEmpty: false\n };\n\n function commentSingleLine(line, oneLine) {\n var\n delimiter = commentLine,\n text = cm.getLine(line),\n wsBefore = '';\n if (oneLine) {\n wsBefore = /^\\s*/.exec(text);\n text = text.replace(/^\\s*/, '');\n }\n if (text.indexOf(delimiter, 0) === 0) {\n text = text.substring(delimiter.length);\n } else {\n text = delimiter + text;\n }\n cm.setLine(line, wsBefore + text);\n }\n\n function commentSelection(empty) {\n var\n delStart = commentStart,\n delEnd = commentEnd,\n text = cm.getSelection();\n // If not jsDocstring, revert to single line comment for empty lines\n if (empty && (name === 'javascript') && !jsDocstring) {\n delStart = commentLine;\n delEnd = '';\n }\n if (text.indexOf(delStart, 0) === 0) {\n if (text.indexOf(delEnd, text.length - delEnd.length) !== -1) {\n text = text.substring(delStart.length, text.length - delEnd.length);\n }\n } else {\n text = delStart + text + delEnd;\n }\n cm.replaceSelection(text);\n if (empty) {\n cm.setSelection({line: start.line, ch: start.ch + delStart.length});\n }\n }\n\n // console.log('start ' + JSON.stringify(start));\n // console.log('end ' + JSON.stringify(end));\n // console.log(curMode);\n console.log('commentator: ' + name);\n\n // If mode is commentable\n if (commentLine || commentStart) {\n // Ignore javascript JSON mode\n if ((name === 'javascript') && curMode.jsonMode) {\n console.log('commentator: ignoring JSON mode');\n return;\n }\n\n if (start.line === end.line && start.ch === end.ch) {\n\n // If no selection\n startText = cm.getLine(start.line);\n trimText = startText.trim();\n\n if ((trimText.length === 0) && commentStart) {\n // If line is empty and multi-line comments available, leave cursor in\n // comment (useful for py docstring, maybe for javascript)\n commentSelection(args.empty);\n } else if (commentStart &&\n (trimText.indexOf(commentStart, 0) === 0) &&\n (trimText.indexOf(commentEnd, trimText.length - commentEnd.length !== -1))) {\n // If line is just a multi-line comment, select and uncomment it\n cStart = startText.indexOf(commentStart, 0);\n cm.setSelection({line: start.line, ch: cStart},\n {line: start.line, ch: cStart + trimText.length});\n commentSelection(args.notEmpty);\n } else if (commentLine) {\n // Comment/uncomment single line even if indented\n commentSingleLine(start.line, args.oneLine && (start.ch !== 0));\n } else {\n // Turn into to a selection\n cm.setSelection({line: start.line, ch: 0}, {line: start.line, ch: null});\n commentSelection(args.notEmpty);\n }\n\n } else {\n\n // There is a selection\n if ((commentLine && (start.ch === 0)) || !commentStart) {\n // Single-line comments are preferred for selections from start of line\n if (start.line === end.line &&\n ((name === 'python') || ((name === 'javascript') && jsDocstring))) {\n // If python or jsDocstring, make single line selection an exception\n commentSelection(args.notEmpty);\n } else {\n // Extend selection to whole lines\n if (end.ch !== 0) {\n end.line += 1;\n end.ch = 0;\n }\n // Iterate over selected lines\n currentLine = start.line;\n while (currentLine < end.line) {\n commentSingleLine(currentLine, args.block);\n currentLine += 1;\n }\n cm.setSelection(start, end);\n }\n } else {\n // multi-line comment\n commentSelection(args.notEmpty);\n }\n\n }\n }\n}", "title": "" }, { "docid": "1aa2b38f7aab62cbe887955e00010bbc", "score": "0.5708784", "text": "function jsTokenState(inside, regexp) {\n return function(source, setState) {\n var newInside = inside;\n var type = jsToken(inside, regexp, source, function(c) {newInside = c;});\n var newRegexp = type.type == \"operator\" || type.type == \"keyword c\" || type.type.match(/^[\\[{}\\(,;:]$/);\n if (newRegexp != regexp || newInside != inside)\n setState(jsTokenState(newInside, newRegexp));\n return type;\n };\n }", "title": "" }, { "docid": "f41f684e65dc1f1cef37426bb91ccf16", "score": "0.570299", "text": "function readMultilineComment(start) {\n var newInside = \"/*\";\n var maybeEnd = start == \"*\";\n while (true) {\n if (source.endOfLine()) break;\n var next = source.next();\n if (next == \"/\" && maybeEnd) {\n newInside = null;\n break;\n }\n maybeEnd = next == \"*\";\n }\n setInside(newInside);\n return { type: \"comment\", style: \"cm-comment\" };\n }", "title": "" }, { "docid": "e642b54d87b39c0fda3b6e74b2e67703", "score": "0.56995094", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError__WEBPACK_IMPORTED_MODULE_1__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "e642b54d87b39c0fda3b6e74b2e67703", "score": "0.56995094", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError__WEBPACK_IMPORTED_MODULE_1__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "e642b54d87b39c0fda3b6e74b2e67703", "score": "0.56995094", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError__WEBPACK_IMPORTED_MODULE_1__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "e642b54d87b39c0fda3b6e74b2e67703", "score": "0.56995094", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError__WEBPACK_IMPORTED_MODULE_1__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "91c608a70bbdb44ab43e9b1af9b33def", "score": "0.56972945", "text": "function jsTokenState(inside, regexp) {\n return function (source, setState) {\n var newInside = inside;\n var type = jsToken(inside, regexp, source, function (c) {\n newInside = c;\n });\n var newRegexp = type.type == \"operator\" || type.type == \"keyword c\" || type.type.match(/^[\\[{}\\(,;:]$/);\n if (newRegexp != regexp || newInside != inside) setState(jsTokenState(newInside, newRegexp));\n return type;\n };\n }", "title": "" }, { "docid": "89a9159b8a46fa00e9654764415a59a0", "score": "0.5679859", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "89a9159b8a46fa00e9654764415a59a0", "score": "0.5679859", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "4327ac32b692d77c7c991bb0c0badef7", "score": "0.5659673", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // get number, can have a single dot\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (Object(_utils_object__WEBPACK_IMPORTED_MODULE_3__[\"hasOwnProperty\"])(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "c60f458dc890e32da54020ef3694dee3", "score": "0.5659673", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // get number, can have a single dot\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "e56f89148cfff759c16a37b08c872476", "score": "0.5659673", "text": "function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = ''; // skip over whitespaces\n // space, tab, and newline when inside parameters\n\n while (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } // skip comment\n\n\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n } // check for end of expression\n\n\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n } // check for new line character\n\n\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 2 characters\n\n\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n } // check for delimiters consisting of 1 character\n\n\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n } // check for a number\n\n\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER; // get number, can have a single dot\n\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n } // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n\n\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n } // Scientific notation MUST be followed by an exponent\n\n\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n\n return;\n } // check for variables, functions, named operators\n\n\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n\n if (Object(utils_object[\"f\" /* hasOwnProperty */])(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n\n return;\n } // something unknown is found, wrong characters -> a syntax error\n\n\n state.tokenType = TOKENTYPE.UNKNOWN;\n\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }", "title": "" }, { "docid": "85ac702762a97ca19a007ad44b97ed27", "score": "0.5658988", "text": "function isInComment(sourceFile,position,tokenAtPosition){return ts.formatting.getRangeOfEnclosingComment(sourceFile,position,/*precedingToken*/undefined,tokenAtPosition);}", "title": "" }, { "docid": "52d7af64182a24107fa54903aadc8de8", "score": "0.5657969", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "52d7af64182a24107fa54903aadc8de8", "score": "0.5657969", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "52d7af64182a24107fa54903aadc8de8", "score": "0.5657969", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "52d7af64182a24107fa54903aadc8de8", "score": "0.5657969", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "dbd4e2697cd544aa476ef2dd47b4690a", "score": "0.5657136", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Token(TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Token(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Token(TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Token(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Token(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Token(TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Token(TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Token(TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Token(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Token(TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Token(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }", "title": "" }, { "docid": "335dc987f6d640aab5268752b5b9c3f9", "score": "0.56455886", "text": "blockComment() {\n const context = new Parsing.Context(new Parsing.Data.Node('test'), `/*\\r\\n\\tComment test.\\r\\n\\tBlock with end-of-block.\\r\\n*/`);\n this.isTrue(Language.Comment.block.consume(context));\n this.areSame(context.offset, context.length);\n }", "title": "" }, { "docid": "b7b45997752ace755d03bcd1f2adb8b3", "score": "0.5643265", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(_tokenKind.TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(_tokenKind.TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(_tokenKind.TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(_tokenKind.TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(_tokenKind.TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(_tokenKind.TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(_tokenKind.TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(_tokenKind.TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(_tokenKind.TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(_tokenKind.TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(_tokenKind.TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(_tokenKind.TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(_tokenKind.TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(_tokenKind.TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(_tokenKind.TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "b7b45997752ace755d03bcd1f2adb8b3", "score": "0.5643265", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(_tokenKind.TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(_tokenKind.TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(_tokenKind.TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(_tokenKind.TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(_tokenKind.TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(_tokenKind.TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(_tokenKind.TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(_tokenKind.TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(_tokenKind.TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(_tokenKind.TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(_tokenKind.TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(_tokenKind.TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(_tokenKind.TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(_tokenKind.TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(_tokenKind.TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "8e77947420395af8ed530def044c1931", "score": "0.5606286", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "aa305ae71da63378c7ff819e63abfd23", "score": "0.55945206", "text": "function cpp(hljs) {\n // added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does\n // not include such support nor can we be sure all the grammars depending\n // on it would desire this behavior\n const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {\n contains: [\n {\n begin: /\\\\\\n/\n }\n ]\n });\n const DECLTYPE_AUTO_RE = 'decltype\\\\(auto\\\\)';\n const NAMESPACE_RE = '[a-zA-Z_]\\\\w*::';\n const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';\n const FUNCTION_TYPE_RE = '(' +\n DECLTYPE_AUTO_RE + '|' +\n optional(NAMESPACE_RE) +\n '[a-zA-Z_]\\\\w*' + optional(TEMPLATE_ARGUMENT_RE) +\n ')';\n const CPP_PRIMITIVE_TYPES = {\n className: 'keyword',\n begin: '\\\\b[a-z\\\\d_]*_t\\\\b'\n };\n\n // https://en.cppreference.com/w/cpp/language/escape\n // \\\\ \\x \\xFF \\u2837 \\u00323747 \\374\n const CHARACTER_ESCAPES = '\\\\\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\\\S)';\n const STRINGS = {\n className: 'string',\n variants: [\n {\n begin: '(u8?|U|L)?\"',\n end: '\"',\n illegal: '\\\\n',\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '(u8?|U|L)?\\'(' + CHARACTER_ESCAPES + \"|.)\",\n end: '\\'',\n illegal: '.'\n },\n hljs.END_SAME_AS_BEGIN({\n begin: /(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\(/,\n end: /\\)([^()\\\\ ]{0,16})\"/\n })\n ]\n };\n\n const NUMBERS = {\n className: 'number',\n variants: [\n {\n begin: '\\\\b(0b[01\\']+)'\n },\n {\n begin: '(-?)\\\\b([\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)'\n },\n {\n begin: '(-?)(\\\\b0[xX][a-fA-F0-9\\']+|(\\\\b[\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)([eE][-+]?[\\\\d\\']+)?)'\n }\n ],\n relevance: 0\n };\n\n const PREPROCESSOR = {\n className: 'meta',\n begin: /#\\s*[a-z]+\\b/,\n end: /$/,\n keywords: {\n 'meta-keyword':\n 'if else elif endif define undef warning error line ' +\n 'pragma _Pragma ifdef ifndef include'\n },\n contains: [\n {\n begin: /\\\\\\n/,\n relevance: 0\n },\n hljs.inherit(STRINGS, {\n className: 'meta-string'\n }),\n {\n className: 'meta-string',\n begin: /<.*?>/,\n end: /$/,\n illegal: '\\\\n'\n },\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE\n ]\n };\n\n const TITLE_MODE = {\n className: 'title',\n begin: optional(NAMESPACE_RE) + hljs.IDENT_RE,\n relevance: 0\n };\n\n const FUNCTION_TITLE = optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\\\s*\\\\(';\n\n const CPP_KEYWORDS = {\n keyword: 'int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof ' +\n 'dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace ' +\n 'unsigned long volatile static protected bool template mutable if public friend ' +\n 'do goto auto void enum else break extern using asm case typeid wchar_t ' +\n 'short reinterpret_cast|10 default double register explicit signed typename try this ' +\n 'switch continue inline delete alignas alignof constexpr consteval constinit decltype ' +\n 'concept co_await co_return co_yield requires ' +\n 'noexcept static_assert thread_local restrict final override ' +\n 'atomic_bool atomic_char atomic_schar ' +\n 'atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong ' +\n 'atomic_ullong new throw return ' +\n 'and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq',\n built_in: 'std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream ' +\n 'auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set ' +\n 'unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos ' +\n 'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' +\n 'fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' +\n 'isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow ' +\n 'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' +\n 'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' +\n 'vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary',\n literal: 'true false nullptr NULL'\n };\n\n const EXPRESSION_CONTAINS = [\n PREPROCESSOR,\n CPP_PRIMITIVE_TYPES,\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n NUMBERS,\n STRINGS\n ];\n\n const EXPRESSION_CONTEXT = {\n // This mode covers expression context where we can't expect a function\n // definition and shouldn't highlight anything that looks like one:\n // `return some()`, `else if()`, `(x*sum(1, 2))`\n variants: [\n {\n begin: /=/,\n end: /;/\n },\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n beginKeywords: 'new throw return else',\n end: /;/\n }\n ],\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat([\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat([ 'self' ]),\n relevance: 0\n }\n ]),\n relevance: 0\n };\n\n const FUNCTION_DECLARATION = {\n className: 'function',\n begin: '(' + FUNCTION_TYPE_RE + '[\\\\*&\\\\s]+)+' + FUNCTION_TITLE,\n returnBegin: true,\n end: /[{;=]/,\n excludeEnd: true,\n keywords: CPP_KEYWORDS,\n illegal: /[^\\w\\s\\*&:<>.]/,\n contains: [\n { // to prevent it from being confused as the function title\n begin: DECLTYPE_AUTO_RE,\n keywords: CPP_KEYWORDS,\n relevance: 0\n },\n {\n begin: FUNCTION_TITLE,\n returnBegin: true,\n contains: [ TITLE_MODE ],\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: [\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRINGS,\n NUMBERS,\n CPP_PRIMITIVE_TYPES,\n // Count matching parentheses.\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: [\n 'self',\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRINGS,\n NUMBERS,\n CPP_PRIMITIVE_TYPES\n ]\n }\n ]\n },\n CPP_PRIMITIVE_TYPES,\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n PREPROCESSOR\n ]\n };\n\n return {\n name: 'C++',\n aliases: [\n 'cc',\n 'c++',\n 'h++',\n 'hpp',\n 'hh',\n 'hxx',\n 'cxx'\n ],\n keywords: CPP_KEYWORDS,\n illegal: '</',\n contains: [].concat(\n EXPRESSION_CONTEXT,\n FUNCTION_DECLARATION,\n EXPRESSION_CONTAINS,\n [\n PREPROCESSOR,\n { // containers: ie, `vector <int> rooms (9);`\n begin: '\\\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\\\s*<',\n end: '>',\n keywords: CPP_KEYWORDS,\n contains: [\n 'self',\n CPP_PRIMITIVE_TYPES\n ]\n },\n {\n begin: hljs.IDENT_RE + '::',\n keywords: CPP_KEYWORDS\n },\n {\n className: 'class',\n beginKeywords: 'enum class struct union',\n end: /[{;:<>=]/,\n contains: [\n {\n beginKeywords: \"final class struct\"\n },\n hljs.TITLE_MODE\n ]\n }\n ]),\n exports: {\n preprocessor: PREPROCESSOR,\n strings: STRINGS,\n keywords: CPP_KEYWORDS\n }\n };\n}", "title": "" }, { "docid": "6550f88a7a804ee88d83dbee3a8fc8ae", "score": "0.55838674", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[/* TokenKind */ \"a\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError__WEBPACK_IMPORTED_MODULE_1__[/* syntaxError */ \"a\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "46e429176451eb7e84175a1a001b4b79", "score": "0.5573734", "text": "_tokenizeToEnd(callback, inputFinished) {\n // Continue parsing as far as possible; the loop will return eventually\n var input = this._input,\n outputComments = this._comments;\n\n while (true) {\n // Count and skip whitespace lines\n var whiteSpaceMatch, comment;\n\n while (whiteSpaceMatch = this._newline.exec(input)) {\n // Try to find a comment\n if (outputComments && (comment = this._comment.exec(whiteSpaceMatch[0]))) callback(null, {\n line: this._line,\n type: 'comment',\n value: comment[1],\n prefix: ''\n }); // Advance the input\n\n input = input.substr(whiteSpaceMatch[0].length, input.length);\n this._line++;\n } // Skip whitespace on current line\n\n\n if (whiteSpaceMatch = this._whitespace.exec(input)) input = input.substr(whiteSpaceMatch[0].length, input.length); // Stop for now if we're at the end\n\n if (this._endOfFile.test(input)) {\n // If the input is finished, emit EOF\n if (inputFinished) {\n // Try to find a final comment\n if (outputComments && (comment = this._comment.exec(input))) callback(null, {\n line: this._line,\n type: 'comment',\n value: comment[1],\n prefix: ''\n });\n callback(input = null, {\n line: this._line,\n type: 'eof',\n value: '',\n prefix: ''\n });\n }\n\n return this._input = input;\n } // Look for specific token types based on the first character\n\n\n var line = this._line,\n type = '',\n value = '',\n prefix = '',\n firstChar = input[0],\n match = null,\n matchLength = 0,\n inconclusive = false;\n\n switch (firstChar) {\n case '^':\n // We need at least 3 tokens lookahead to distinguish ^^<IRI> and ^^pre:fixed\n if (input.length < 3) break; // Try to match a type\n else if (input[1] === '^') {\n this._previousMarker = '^^'; // Move to type IRI or prefixed name\n\n input = input.substr(2);\n\n if (input[0] !== '<') {\n inconclusive = true;\n break;\n }\n } // If no type, it must be a path expression\n else {\n if (this._n3Mode) {\n matchLength = 1;\n type = '^';\n }\n\n break;\n }\n // Fall through in case the type is an IRI\n\n case '<':\n // Try to find a full IRI without escape sequences\n if (match = this._unescapedIri.exec(input)) type = 'IRI', value = match[1]; // Try to find a full IRI with escape sequences\n else if (match = this._iri.exec(input)) {\n value = this._unescape(match[1]);\n if (value === null || illegalIriChars.test(value)) return reportSyntaxError(this);\n type = 'IRI';\n } // Try to find a backwards implication arrow\n else if (this._n3Mode && input.length > 1 && input[1] === '=') type = 'inverse', matchLength = 2, value = '>';\n break;\n\n case '_':\n // Try to find a blank node. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a blank node.\n // Therefore, try inserting a space if we're at the end of the input.\n if ((match = this._blank.exec(input)) || inputFinished && (match = this._blank.exec(input + ' '))) type = 'blank', prefix = '_', value = match[1];\n break;\n\n case '\"':\n // Try to find a literal without escape sequences\n if (match = this._unescapedQuote.exec(input)) value = match[1]; // Before attempting more complex string patterns, try to detect a closing quote\n else if (input.indexOf('\"', 1) > 0) {\n // Try to find any other literal wrapped in a pair of quotes\n if (match = this._singleQuote.exec(input)) value = this._unescape(match[1]); // Try to find a literal wrapped in three pairs of quotes\n else if (match = this._tripleQuote.exec(input)) {\n value = match[1]; // Advance line counter\n\n this._line += value.split(/\\r\\n|\\r|\\n/).length - 1;\n value = this._unescape(value);\n }\n if (value === null) return reportSyntaxError(this);\n }\n if (match !== null) type = 'literal';\n break;\n\n case \"'\":\n // Try to find a literal without escape sequences\n if (match = this._unescapedApos.exec(input)) value = match[1]; // Before attempting more complex string patterns, try to detect a closing apostrophe\n else if (input.indexOf(\"'\", 1) > 0) {\n // Try to find any other literal wrapped in a pair of apostrophes\n if (match = this._singleApos.exec(input)) value = this._unescape(match[1]); // Try to find a literal wrapped in three pairs of apostrophes\n else if (match = this._tripleApos.exec(input)) {\n value = match[1]; // Advance line counter\n\n this._line += value.split(/\\r\\n|\\r|\\n/).length - 1;\n value = this._unescape(value);\n }\n if (value === null) return reportSyntaxError(this);\n }\n if (match !== null) type = 'literal';\n break;\n\n case '?':\n // Try to find a variable\n if (this._n3Mode && (match = this._variable.exec(input))) type = 'var', value = match[0];\n break;\n\n case '@':\n // Try to find a language code\n if (this._previousMarker === 'literal' && (match = this._langcode.exec(input))) type = 'langcode', value = match[1]; // Try to find a keyword\n else if (match = this._keyword.exec(input)) type = match[0];\n break;\n\n case '.':\n // Try to find a dot as punctuation\n if (input.length === 1 ? inputFinished : input[1] < '0' || input[1] > '9') {\n type = '.';\n matchLength = 1;\n break;\n }\n\n // Fall through to numerical case (could be a decimal dot)\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n case '+':\n case '-':\n // Try to find a number. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a number.\n // Therefore, try inserting a space if we're at the end of the input.\n if (match = this._number.exec(input) || inputFinished && (match = this._number.exec(input + ' '))) {\n type = 'literal', value = match[0];\n prefix = match[1] ? xsd$1.double : /^[+\\-]?\\d+$/.test(match[0]) ? xsd$1.integer : xsd$1.decimal;\n }\n\n break;\n\n case 'B':\n case 'b':\n case 'p':\n case 'P':\n case 'G':\n case 'g':\n // Try to find a SPARQL-style keyword\n if (match = this._sparqlKeyword.exec(input)) type = match[0].toUpperCase();else inconclusive = true;\n break;\n\n case 'f':\n case 't':\n // Try to match a boolean\n if (match = this._boolean.exec(input)) type = 'literal', value = match[0], prefix = xsd$1.boolean;else inconclusive = true;\n break;\n\n case 'a':\n // Try to find an abbreviated predicate\n if (match = this._shortPredicates.exec(input)) type = 'abbreviation', value = 'a';else inconclusive = true;\n break;\n\n case '=':\n // Try to find an implication arrow or equals sign\n if (this._n3Mode && input.length > 1) {\n type = 'abbreviation';\n if (input[1] !== '>') matchLength = 1, value = '=';else matchLength = 2, value = '>';\n }\n\n break;\n\n case '!':\n if (!this._n3Mode) break;\n\n case ',':\n case ';':\n case '[':\n case ']':\n case '(':\n case ')':\n case '{':\n case '}':\n if (!this._lineMode) {\n matchLength = 1;\n type = firstChar;\n }\n\n break;\n\n default:\n inconclusive = true;\n } // Some first characters do not allow an immediate decision, so inspect more\n\n\n if (inconclusive) {\n // Try to find a prefix\n if ((this._previousMarker === '@prefix' || this._previousMarker === 'PREFIX') && (match = this._prefix.exec(input))) type = 'prefix', value = match[1] || ''; // Try to find a prefixed name. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a prefixed name.\n // Therefore, try inserting a space if we're at the end of the input.\n else if ((match = this._prefixed.exec(input)) || inputFinished && (match = this._prefixed.exec(input + ' '))) type = 'prefixed', prefix = match[1] || '', value = this._unescape(match[2]);\n } // A type token is special: it can only be emitted after an IRI or prefixed name is read\n\n\n if (this._previousMarker === '^^') {\n switch (type) {\n case 'prefixed':\n type = 'type';\n break;\n\n case 'IRI':\n type = 'typeIRI';\n break;\n\n default:\n type = '';\n }\n } // What if nothing of the above was found?\n\n\n if (!type) {\n // We could be in streaming mode, and then we just wait for more input to arrive.\n // Otherwise, a syntax error has occurred in the input.\n // One exception: error on an unaccounted linebreak (= not inside a triple-quoted literal).\n if (inputFinished || !/^'''|^\"\"\"/.test(input) && /\\n|\\r/.test(input)) return reportSyntaxError(this);else return this._input = input;\n } // Emit the parsed token\n\n\n var token = {\n line: line,\n type: type,\n value: value,\n prefix: prefix\n };\n callback(null, token);\n this.previousToken = token;\n this._previousMarker = type; // Advance to next part to tokenize\n\n input = input.substr(matchLength || match[0].length, input.length);\n } // Signals the syntax error through the callback\n\n\n function reportSyntaxError(self) {\n callback(self._syntaxError(/^\\S*/.exec(input)[0]));\n }\n }", "title": "" }, { "docid": "bfbb6e23358754b330425e92dc60c688", "score": "0.5565604", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }", "title": "" }, { "docid": "b4f7e71b10bc93f0ee9ee4fecc3c613c", "score": "0.55648077", "text": "function cpp(hljs) {\n // added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does\n // not include such support nor can we be sure all the grammars depending\n // on it would desire this behavior\n const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {\n contains: [{\n begin: /\\\\\\n/\n }]\n });\n const DECLTYPE_AUTO_RE = 'decltype\\\\(auto\\\\)';\n const NAMESPACE_RE = '[a-zA-Z_]\\\\w*::';\n const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';\n const FUNCTION_TYPE_RE = '(?!struct)(' + DECLTYPE_AUTO_RE + '|' + optional(NAMESPACE_RE) + '[a-zA-Z_]\\\\w*' + optional(TEMPLATE_ARGUMENT_RE) + ')';\n const CPP_PRIMITIVE_TYPES = {\n className: 'type',\n begin: '\\\\b[a-z\\\\d_]*_t\\\\b'\n }; // https://en.cppreference.com/w/cpp/language/escape\n // \\\\ \\x \\xFF \\u2837 \\u00323747 \\374\n\n const CHARACTER_ESCAPES = '\\\\\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\\\S)';\n const STRINGS = {\n className: 'string',\n variants: [{\n begin: '(u8?|U|L)?\"',\n end: '\"',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE]\n }, {\n begin: '(u8?|U|L)?\\'(' + CHARACTER_ESCAPES + '|.)',\n end: '\\'',\n illegal: '.'\n }, hljs.END_SAME_AS_BEGIN({\n begin: /(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\(/,\n end: /\\)([^()\\\\ ]{0,16})\"/\n })]\n };\n const NUMBERS = {\n className: 'number',\n variants: [{\n begin: '\\\\b(0b[01\\']+)'\n }, {\n begin: '(-?)\\\\b([\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)'\n }, {\n begin: '(-?)(\\\\b0[xX][a-fA-F0-9\\']+|(\\\\b[\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)([eE][-+]?[\\\\d\\']+)?)'\n }],\n relevance: 0\n };\n const PREPROCESSOR = {\n className: 'meta',\n begin: /#\\s*[a-z]+\\b/,\n end: /$/,\n keywords: {\n keyword: 'if else elif endif define undef warning error line ' + 'pragma _Pragma ifdef ifndef include'\n },\n contains: [{\n begin: /\\\\\\n/,\n relevance: 0\n }, hljs.inherit(STRINGS, {\n className: 'string'\n }), {\n className: 'string',\n begin: /<.*?>/\n }, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE]\n };\n const TITLE_MODE = {\n className: 'title',\n begin: optional(NAMESPACE_RE) + hljs.IDENT_RE,\n relevance: 0\n };\n const FUNCTION_TITLE = optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\\\s*\\\\('; // https://en.cppreference.com/w/cpp/keyword\n\n const RESERVED_KEYWORDS = ['alignas', 'alignof', 'and', 'and_eq', 'asm', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'co_await', 'co_return', 'co_yield', 'compl', 'concept', 'const', 'const_cast|10', 'consteval', 'constexpr', 'constinit', 'continue', 'decltype', 'default', 'delete', 'do', 'dynamic_cast|10', 'else', 'enum', 'explicit', 'export', 'extern', 'false', 'final', 'for', 'friend', 'goto', 'if', 'import', 'inline', 'module', 'mutable', 'namespace', 'new', 'noexcept', 'not', 'not_eq', 'nullptr', 'operator', 'or', 'or_eq', 'override', 'private', 'protected', 'public', 'reflexpr', 'register', 'reinterpret_cast|10', 'requires', 'return', 'signed', 'sizeof', 'static', 'static_assert', 'static_cast|10', 'struct', 'switch', 'synchronized', 'template', 'this', 'thread_local', 'throw', 'transaction_safe', 'transaction_safe_dynamic', 'true', 'try', 'typedef', 'typeid', 'typename', 'union', 'unsigned', 'using', 'virtual', 'volatile', 'while', 'xor', 'xor_eq,']; // https://en.cppreference.com/w/cpp/keyword\n\n const RESERVED_TYPES = ['bool', 'char', 'char16_t', 'char32_t', 'char8_t', 'double', 'float', 'int', 'long', 'short', 'void', 'wchar_t'];\n const TYPE_HINTS = ['any', 'auto_ptr', 'barrier', 'binary_semaphore', 'bitset', 'complex', 'condition_variable', 'condition_variable_any', 'counting_semaphore', 'deque', 'false_type', 'future', 'imaginary', 'initializer_list', 'istringstream', 'jthread', 'latch', 'lock_guard', 'multimap', 'multiset', 'mutex', 'optional', 'ostringstream', 'packaged_task', 'pair', 'promise', 'priority_queue', 'queue', 'recursive_mutex', 'recursive_timed_mutex', 'scoped_lock', 'set', 'shared_future', 'shared_lock', 'shared_mutex', 'shared_timed_mutex', 'shared_ptr', 'stack', 'string_view', 'stringstream', 'timed_mutex', 'thread', 'true_type', 'tuple', 'unique_lock', 'unique_ptr', 'unordered_map', 'unordered_multimap', 'unordered_multiset', 'unordered_set', 'variant', 'vector', 'weak_ptr', 'wstring', 'wstring_view'];\n const FUNCTION_HINTS = ['abort', 'abs', 'acos', 'apply', 'as_const', 'asin', 'atan', 'atan2', 'calloc', 'ceil', 'cerr', 'cin', 'clog', 'cos', 'cosh', 'cout', 'declval', 'endl', 'exchange', 'exit', 'exp', 'fabs', 'floor', 'fmod', 'forward', 'fprintf', 'fputs', 'free', 'frexp', 'fscanf', 'future', 'invoke', 'isalnum', 'isalpha', 'iscntrl', 'isdigit', 'isgraph', 'islower', 'isprint', 'ispunct', 'isspace', 'isupper', 'isxdigit', 'labs', 'launder', 'ldexp', 'log', 'log10', 'make_pair', 'make_shared', 'make_shared_for_overwrite', 'make_tuple', 'make_unique', 'malloc', 'memchr', 'memcmp', 'memcpy', 'memset', 'modf', 'move', 'pow', 'printf', 'putchar', 'puts', 'realloc', 'scanf', 'sin', 'sinh', 'snprintf', 'sprintf', 'sqrt', 'sscanf', 'std', 'stderr', 'stdin', 'stdout', 'strcat', 'strchr', 'strcmp', 'strcpy', 'strcspn', 'strlen', 'strncat', 'strncmp', 'strncpy', 'strpbrk', 'strrchr', 'strspn', 'strstr', 'swap', 'tan', 'tanh', 'terminate', 'to_underlying', 'tolower', 'toupper', 'vfprintf', 'visit', 'vprintf', 'vsprintf'];\n const LITERALS = ['NULL', 'false', 'nullopt', 'nullptr', 'true']; // https://en.cppreference.com/w/cpp/keyword\n\n const BUILT_IN = ['_Pragma'];\n const CPP_KEYWORDS = {\n type: RESERVED_TYPES,\n keyword: RESERVED_KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_IN,\n _type_hints: TYPE_HINTS\n };\n const FUNCTION_DISPATCH = {\n className: 'function.dispatch',\n relevance: 0,\n keywords: {\n // Only for relevance, not highlighting.\n _hint: FUNCTION_HINTS\n },\n begin: concat(/\\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!while)/, hljs.IDENT_RE, lookahead(/(<[^<>]+>|)\\s*\\(/))\n };\n const EXPRESSION_CONTAINS = [FUNCTION_DISPATCH, PREPROCESSOR, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, NUMBERS, STRINGS];\n const EXPRESSION_CONTEXT = {\n // This mode covers expression context where we can't expect a function\n // definition and shouldn't highlight anything that looks like one:\n // `return some()`, `else if()`, `(x*sum(1, 2))`\n variants: [{\n begin: /=/,\n end: /;/\n }, {\n begin: /\\(/,\n end: /\\)/\n }, {\n beginKeywords: 'new throw return else',\n end: /;/\n }],\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat([{\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat(['self']),\n relevance: 0\n }]),\n relevance: 0\n };\n const FUNCTION_DECLARATION = {\n className: 'function',\n begin: '(' + FUNCTION_TYPE_RE + '[\\\\*&\\\\s]+)+' + FUNCTION_TITLE,\n returnBegin: true,\n end: /[{;=]/,\n excludeEnd: true,\n keywords: CPP_KEYWORDS,\n illegal: /[^\\w\\s\\*&:<>.]/,\n contains: [{\n // to prevent it from being confused as the function title\n begin: DECLTYPE_AUTO_RE,\n keywords: CPP_KEYWORDS,\n relevance: 0\n }, {\n begin: FUNCTION_TITLE,\n returnBegin: true,\n contains: [TITLE_MODE],\n relevance: 0\n }, // needed because we do not have look-behind on the below rule\n // to prevent it from grabbing the final : in a :: pair\n {\n begin: /::/,\n relevance: 0\n }, // initializers\n {\n begin: /:/,\n endsWithParent: true,\n contains: [STRINGS, NUMBERS]\n }, // allow for multiple declarations, e.g.:\n // extern void f(int), g(char);\n {\n relevance: 0,\n match: /,/\n }, {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: [C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES, // Count matching parentheses.\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: ['self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES]\n }]\n }, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, PREPROCESSOR]\n };\n return {\n name: 'C++',\n aliases: ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],\n keywords: CPP_KEYWORDS,\n illegal: '</',\n classNameAliases: {\n 'function.dispatch': 'built_in'\n },\n contains: [].concat(EXPRESSION_CONTEXT, FUNCTION_DECLARATION, FUNCTION_DISPATCH, EXPRESSION_CONTAINS, [PREPROCESSOR, {\n // containers: ie, `vector <int> rooms (9);`\n begin: '\\\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\\\s*<',\n end: '>',\n keywords: CPP_KEYWORDS,\n contains: ['self', CPP_PRIMITIVE_TYPES]\n }, {\n begin: hljs.IDENT_RE + '::',\n keywords: CPP_KEYWORDS\n }, {\n match: [// extra complexity to deal with `enum class` and `enum struct`\n /\\b(?:enum(?:\\s+(?:class|struct))?|class|struct|union)/, /\\s+/, /\\w+/],\n className: {\n 1: 'keyword',\n 3: 'title.class'\n }\n }])\n };\n}", "title": "" }, { "docid": "f5af5b2f49a5344de8a0d72112f0d4e7", "score": "0.55576825", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // <BOM>\n\n case 9: // \\t\n\n case 32: // <space>\n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new _ast.Token(_tokenKind.TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new _ast.Token(_tokenKind.TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new _ast.Token(_tokenKind.TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new _ast.Token(_tokenKind.TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new _ast.Token(_tokenKind.TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new _ast.Token(_tokenKind.TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new _ast.Token(_tokenKind.TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new _ast.Token(_tokenKind.TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new _ast.Token(_tokenKind.TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new _ast.Token(_tokenKind.TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new _ast.Token(_tokenKind.TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new _ast.Token(_tokenKind.TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new _ast.Token(_tokenKind.TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new _ast.Token(_tokenKind.TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new _ast.Token(_tokenKind.TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}", "title": "" }, { "docid": "062c5f07c70b9ee3efcabce264138b0b", "score": "0.5556062", "text": "_skipComments() {\n while (this.haveToken()) {\n let token = this.nextToken();\n if (!token.isKind(cred.tokenKind.comment)) {\n this.backUpToken();\n break;\n }\n }\n }", "title": "" }, { "docid": "8fb3954be5844ff4b48af60558ac7780", "score": "0.5548026", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (c == ' ' || c == '\\t' || (c == '\\n' && nesting_level)) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n token_type = TOKENTYPE.UNKNOWN;\n }\n }\n else {\n while (isDigit(c)) {\n token += c;\n next();\n }\n if (c == '.') {\n token += c;\n next();\n }\n }\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if ((c == 'E' || c == 'e') && (isDigit(c2) || c2 == '-' || c2 == '+')) {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!isDigit(c)) {\n // this is no legal number, exponent is missing.\n token_type = TOKENTYPE.UNKNOWN;\n }\n\n while (isDigit(c)) {\n token += c;\n next();\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (currentIsAlpha()) {\n while (currentIsAlpha() || isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS[token]) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "762919de6483a53328c835d711eee076", "score": "0.55468816", "text": "function getToken() {\n token_type = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n // space, tab, and newline when inside parameters\n while (c == ' ' || c == '\\t' || (c == '\\n' && nesting_level)) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n next();\n }\n\n // skip comment\n if (c == '#') {\n while (c != '\\n' && c != '') {\n next();\n }\n }\n\n // check for end of expression\n if (c == '') {\n // token is still empty\n token_type = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (c == '\\n' && !nesting_level) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for delimiters consisting of 3 characters\n var c2 = c + nextPreview();\n var c3 = c2 + nextNextPreview();\n if (c3.length == 3 && DELIMITERS[c3]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c3;\n next();\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length == 2 && DELIMITERS[c2]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n token_type = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for a number\n if (isDigitDot(c)) {\n token_type = TOKENTYPE.NUMBER;\n\n // get number, can have a single dot\n if (c == '.') {\n token += c;\n next();\n\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot (can be dot notation)\n token_type = TOKENTYPE.UNKNOWN;\n }\n }\n else {\n while (isDigit(c)) {\n token += c;\n next();\n }\n if (c == '.') {\n token += c;\n next();\n }\n }\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n c2 = nextPreview();\n if (c == 'E' || c == 'e') {\n if (isDigit(c2) || c2 == '-' || c2 == '+') {\n token += c;\n next();\n\n if (c == '+' || c == '-') {\n token += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent\n if (!isDigit(c)) {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n\n while (isDigit(c)) {\n token += c;\n next();\n }\n\n if (c == '.') {\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n else if (c2 == '.') {\n next();\n throw createSyntaxError('Digit expected, got \"' + c + '\"');\n }\n }\n\n return;\n }\n\n // check for variables, functions, named operators\n if (currentIsAlpha()) {\n while (currentIsAlpha() || isDigit(c)) {\n token += c;\n next();\n }\n\n if (NAMED_DELIMITERS.hasOwnProperty(token)) {\n token_type = TOKENTYPE.DELIMITER;\n }\n else {\n token_type = TOKENTYPE.SYMBOL;\n }\n\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n token_type = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw createSyntaxError('Syntax error in part \"' + token + '\"');\n }", "title": "" }, { "docid": "22ad7f844586a4d86ffacd79bc7d1b9e", "score": "0.55445015", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // <BOM>\n\n case 9: // \\t\n\n case 32: // <space>\n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}", "title": "" }, { "docid": "aa0ffa9ce093d1edd21504844d913a06", "score": "0.5535636", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n }", "title": "" }, { "docid": "aa0ffa9ce093d1edd21504844d913a06", "score": "0.5535636", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n }", "title": "" }, { "docid": "e50bd8e9071c7370c17dfca17df28f2f", "score": "0.5517816", "text": "identifier() {\n while ((0, Characters_1.isAlphaNumeric)(this.peek())) {\n this.advance();\n }\n let text = this.source.slice(this.start, this.current);\n let lowerText = text.toLowerCase();\n // some identifiers can be split into two words, so check the \"next\" word and see what we get\n if ((lowerText === 'end' || lowerText === 'exit' || lowerText === 'for') &&\n (this.peek() === ' ' || this.peek() === '\\t')) {\n let savedCurrent = this.current;\n let savedColumnEnd = this.columnEnd;\n // skip past any whitespace\n let whitespace = '';\n while (this.peek() === ' ' || this.peek() === '\\t') {\n //keep the whitespace so we can replace it later\n whitespace += this.peek();\n this.advance();\n }\n while ((0, Characters_1.isAlphaNumeric)(this.peek())) {\n this.advance();\n } // read the next word\n let twoWords = this.source.slice(this.start, this.current);\n // replace all of the whitespace with a single space character so we can properly match keyword token types\n twoWords = twoWords.replace(whitespace, ' ');\n let maybeTokenType = TokenKind_1.Keywords[twoWords.toLowerCase()];\n if (maybeTokenType) {\n this.addToken(maybeTokenType);\n return;\n }\n else {\n // reset if the last word and the current word didn't form a multi-word TokenKind\n this.current = savedCurrent;\n this.columnEnd = savedColumnEnd;\n }\n }\n // split `elseif` into `else` and `if` tokens\n if (lowerText === 'elseif' && !this.checkPreviousToken(TokenKind_1.TokenKind.Dot)) {\n let savedCurrent = this.current;\n let savedColumnEnd = this.columnEnd;\n this.current -= 2;\n this.columnEnd -= 2;\n this.addToken(TokenKind_1.TokenKind.Else);\n this.start = savedCurrent - 2;\n this.current = savedCurrent;\n this.columnBegin = savedColumnEnd - 2;\n this.columnEnd = savedColumnEnd;\n this.addToken(TokenKind_1.TokenKind.If);\n return;\n }\n // look for a type designator character ($ % ! # &). vars may have them, but functions\n // may not. Let the parser figure that part out.\n let nextChar = this.peek();\n if (['$', '%', '!', '#', '&'].includes(nextChar)) {\n lowerText += nextChar;\n this.advance();\n }\n let tokenType = TokenKind_1.Keywords[lowerText] || TokenKind_1.TokenKind.Identifier;\n if (tokenType === TokenKind_1.Keywords.rem) {\n //the rem keyword can be used as an identifier on objects,\n //so do a quick look-behind to see if there's a preceeding dot\n if (this.checkPreviousToken(TokenKind_1.TokenKind.Dot)) {\n this.addToken(TokenKind_1.TokenKind.Identifier);\n }\n else {\n this.comment();\n }\n }\n else {\n this.addToken(tokenType);\n }\n }", "title": "" }, { "docid": "be999de5429921f61adeca02ee9c19c9", "score": "0.55175817", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // <BOM>\n\n case 9: // \\t\n\n case 32: // <space>\n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }", "title": "" }, { "docid": "1314530e0155a52ddd6a2cc2c67523c5", "score": "0.5514308", "text": "function initTokenState(pos) {\n\t if (pos) {\n\t tokPos = pos;\n\t tokLineStart = Math.max(0, input.lastIndexOf(\"\\n\", pos));\n\t tokCurLine = input.slice(0, tokLineStart).split(newline).length;\n\t } else {\n\t tokCurLine = 1;\n\t tokPos = tokLineStart = 0;\n\t }\n\t tokType = _eof;\n\t tokContext = [b_stat];\n\t tokExprAllowed = true;\n\t strict = false;\n\t if (tokPos === 0 && options.allowHashBang && input.slice(0, 2) === '#!') {\n\t skipLineComment(2);\n\t }\n\t }", "title": "" }, { "docid": "4550103d6f921614672e2080ce32f1b3", "score": "0.55016047", "text": "function testCppCommentMinification() {\n\tvar options = {\n\t\t\twithMath : false,\n\t\t\thash2DContext : false,\n\t\t\thashWebGLContext : false,\n\t\t\thashAudioContext : false,\n\t\t\tcontextVariableName : \"c\",\n\t\t\tcontextType : parseInt(0),\n\t\t\treassignVars : false,\n\t\t\tvarsNotReassigned : ['a', 'b', 'c'],\n\t\t\tcrushGainFactor : parseFloat(1),\n\t\t\tcrushLengthFactor : parseFloat(0),\n\t\t\tcrushCopiesFactor : parseFloat(0),\n\t\t\tcrushTiebreakerFactor : parseInt(1),\n\t\t\twrapInSetInterval : false,\n\t\t\ttimeVariableName : \"\"\n\t\t};\n var inputWithSingleLineComment = `var t=0;\nt=2; // change displayed value\nalert(t)`;\n\tvar result = RegPack.packer.runPacker(inputWithSingleLineComment, options);\n\t// Expected result : the comment is gone, but the remainder of the line is still there\n\tassert.equal(result[0].contents, \"var t=0;t=2;alert(t)\");\n}", "title": "" }, { "docid": "0f95b504dde66cb879fd6327826ec326", "score": "0.5491756", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (charCodeAt.call(body, pos + 1) === 46 && charCodeAt.call(body, pos + 2) === 46) {\n return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (charCodeAt.call(body, pos + 1) === 34 && charCodeAt.call(body, pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error__WEBPACK_IMPORTED_MODULE_1__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "8e05a81b4ff5354be8449f2722b46b4d", "score": "0.5491756", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (charCodeAt.call(body, pos + 1) === 46 && charCodeAt.call(body, pos + 2) === 46) {\n return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (charCodeAt.call(body, pos + 1) === 34 && charCodeAt.call(body, pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error__WEBPACK_IMPORTED_MODULE_0__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "d4178381bbd7417e400b0e8af646f4f5", "score": "0.5491756", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (charCodeAt.call(body, pos + 1) === 46 && charCodeAt.call(body, pos + 2) === 46) {\n return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (charCodeAt.call(body, pos + 1) === 34 && charCodeAt.call(body, pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw (0, _error.syntaxError)(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "b86b72eceae782bdaf9767190c4780fd", "score": "0.5489086", "text": "function eat_multiline_comments() {\n do {\n if (c === '/' && move_next() && c === '*') {\n multilineCommentDepth++;\n continue;\n }\n\n if (c === '*' && move_next() && c === '/') {\n multilineCommentDepth--;\n continue;\n }\n\n // We have hit the end of the outermost multiline comment\n if (multilineCommentDepth === -1) {\n multilineCommentDepth = 0; // Reset for next time!\n break;\n }\n } while(move_next());\n }", "title": "" }, { "docid": "4949514b4b3067b1ab8212b38e553a79", "score": "0.54791063", "text": "function advanceLexer() {\n var token = this.lastToken = this.token;\n if (token.kind !== EOF) {\n do {\n token = token.next = readToken(this, token);\n } while (token.kind === COMMENT);\n this.token = token;\n }\n return token;\n}", "title": "" }, { "docid": "4949514b4b3067b1ab8212b38e553a79", "score": "0.54791063", "text": "function advanceLexer() {\n var token = this.lastToken = this.token;\n if (token.kind !== EOF) {\n do {\n token = token.next = readToken(this, token);\n } while (token.kind === COMMENT);\n this.token = token;\n }\n return token;\n}", "title": "" }, { "docid": "4949514b4b3067b1ab8212b38e553a79", "score": "0.54791063", "text": "function advanceLexer() {\n var token = this.lastToken = this.token;\n if (token.kind !== EOF) {\n do {\n token = token.next = readToken(this, token);\n } while (token.kind === COMMENT);\n this.token = token;\n }\n return token;\n}", "title": "" }, { "docid": "4949514b4b3067b1ab8212b38e553a79", "score": "0.54791063", "text": "function advanceLexer() {\n var token = this.lastToken = this.token;\n if (token.kind !== EOF) {\n do {\n token = token.next = readToken(this, token);\n } while (token.kind === COMMENT);\n this.token = token;\n }\n return token;\n}", "title": "" }, { "docid": "4949514b4b3067b1ab8212b38e553a79", "score": "0.54791063", "text": "function advanceLexer() {\n var token = this.lastToken = this.token;\n if (token.kind !== EOF) {\n do {\n token = token.next = readToken(this, token);\n } while (token.kind === COMMENT);\n this.token = token;\n }\n return token;\n}", "title": "" }, { "docid": "8f02da982dd8c96835ae3821d98c3716", "score": "0.54690886", "text": "function getToken() {\r\n tokenType = TOKENTYPE.NULL;\r\n token = '';\r\n\r\n // skip over whitespaces\r\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\r\n // space, tab, enter\r\n next();\r\n }\r\n\r\n do {\r\n var isComment = false;\r\n\r\n // skip comment\r\n if (c === '#') {\r\n // find the previous non-space character\r\n var i = index - 1;\r\n while (dot.charAt(i) === ' ' || dot.charAt(i) === '\\t') {\r\n i--;\r\n }\r\n if (dot.charAt(i) === '\\n' || dot.charAt(i) === '') {\r\n // the # is at the start of a line, this is indeed a line comment\r\n while (c != '' && c != '\\n') {\r\n next();\r\n }\r\n isComment = true;\r\n }\r\n }\r\n if (c === '/' && nextPreview() === '/') {\r\n // skip line comment\r\n while (c != '' && c != '\\n') {\r\n next();\r\n }\r\n isComment = true;\r\n }\r\n if (c === '/' && nextPreview() === '*') {\r\n // skip block comment\r\n while (c != '') {\r\n if (c === '*' && nextPreview() === '/') {\r\n // end of block comment found. skip these last two characters\r\n next();\r\n next();\r\n break;\r\n } else {\r\n next();\r\n }\r\n }\r\n isComment = true;\r\n }\r\n\r\n // skip over whitespaces\r\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\r\n // space, tab, enter\r\n next();\r\n }\r\n } while (isComment);\r\n\r\n // check for end of dot file\r\n if (c === '') {\r\n // token is still empty\r\n tokenType = TOKENTYPE.DELIMITER;\r\n return;\r\n }\r\n\r\n // check for delimiters consisting of 2 characters\r\n var c2 = c + nextPreview();\r\n if (DELIMITERS[c2]) {\r\n tokenType = TOKENTYPE.DELIMITER;\r\n token = c2;\r\n next();\r\n next();\r\n return;\r\n }\r\n\r\n // check for delimiters consisting of 1 character\r\n if (DELIMITERS[c]) {\r\n tokenType = TOKENTYPE.DELIMITER;\r\n token = c;\r\n next();\r\n return;\r\n }\r\n\r\n // check for an identifier (number or string)\r\n // TODO: more precise parsing of numbers/strings (and the port separator ':')\r\n if (isAlphaNumeric(c) || c === '-') {\r\n token += c;\r\n next();\r\n\r\n while (isAlphaNumeric(c)) {\r\n token += c;\r\n next();\r\n }\r\n if (token === 'false') {\r\n token = false; // convert to boolean\r\n } else if (token === 'true') {\r\n token = true; // convert to boolean\r\n } else if (!isNaN(Number(token))) {\r\n token = Number(token); // convert to number\r\n }\r\n tokenType = TOKENTYPE.IDENTIFIER;\r\n return;\r\n }\r\n\r\n // check for a string enclosed by double quotes\r\n if (c === '\"') {\r\n next();\r\n while (c != '' && (c != '\"' || c === '\"' && nextPreview() === '\"')) {\r\n token += c;\r\n if (c === '\"') {\r\n // skip the escape character\r\n next();\r\n }\r\n next();\r\n }\r\n if (c != '\"') {\r\n throw newSyntaxError('End of string \" expected');\r\n }\r\n next();\r\n tokenType = TOKENTYPE.IDENTIFIER;\r\n return;\r\n }\r\n\r\n // something unknown is found, wrong characters, a syntax error\r\n tokenType = TOKENTYPE.UNKNOWN;\r\n while (c != '') {\r\n token += c;\r\n next();\r\n }\r\n throw new SyntaxError('Syntax error in part \"' + chop(token, 30) + '\"');\r\n }", "title": "" }, { "docid": "860a4c8e75687a0acf0a3a591565236a", "score": "0.5463974", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n\n var position = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + position - lexer.lineStart;\n\n if (position >= bodyLength) {\n return new Tok(EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, position);\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw Object(__WEBPACK_IMPORTED_MODULE_0__error__[\"e\" /* syntaxError */])(source, position, 'Cannot contain the invalid character ' + printCharCode(code) + '.');\n }\n\n switch (code) {\n // !\n case 33:\n return new Tok(BANG, position, position + 1, line, col, prev);\n // #\n case 35:\n return readComment(source, position, line, col, prev);\n // $\n case 36:\n return new Tok(DOLLAR, position, position + 1, line, col, prev);\n // (\n case 40:\n return new Tok(PAREN_L, position, position + 1, line, col, prev);\n // )\n case 41:\n return new Tok(PAREN_R, position, position + 1, line, col, prev);\n // .\n case 46:\n if (charCodeAt.call(body, position + 1) === 46 && charCodeAt.call(body, position + 2) === 46) {\n return new Tok(SPREAD, position, position + 3, line, col, prev);\n }\n break;\n // :\n case 58:\n return new Tok(COLON, position, position + 1, line, col, prev);\n // =\n case 61:\n return new Tok(EQUALS, position, position + 1, line, col, prev);\n // @\n case 64:\n return new Tok(AT, position, position + 1, line, col, prev);\n // [\n case 91:\n return new Tok(BRACKET_L, position, position + 1, line, col, prev);\n // ]\n case 93:\n return new Tok(BRACKET_R, position, position + 1, line, col, prev);\n // {\n case 123:\n return new Tok(BRACE_L, position, position + 1, line, col, prev);\n // |\n case 124:\n return new Tok(PIPE, position, position + 1, line, col, prev);\n // }\n case 125:\n return new Tok(BRACE_R, position, position + 1, line, col, prev);\n // A-Z _ a-z\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, position, line, col, prev);\n // - 0-9\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, position, code, line, col, prev);\n // \"\n case 34:\n if (charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n return readBlockString(source, position, line, col, prev);\n }\n return readString(source, position, line, col, prev);\n }\n\n throw Object(__WEBPACK_IMPORTED_MODULE_0__error__[\"e\" /* syntaxError */])(source, position, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "aa28a710529151c00163f244beb86190", "score": "0.54624796", "text": "function readComment(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}", "title": "" }, { "docid": "7c006730b4ffebf6ec1927b47e822c14", "score": "0.54523444", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, pos);\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw Object(__WEBPACK_IMPORTED_MODULE_0__error__[\"e\" /* syntaxError */])(source, pos, 'Cannot contain the invalid character ' + printCharCode(code) + '.');\n }\n\n switch (code) {\n // !\n case 33:\n return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n case 36:\n return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n case 38:\n return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n case 40:\n return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n case 41:\n return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n case 46:\n if (charCodeAt.call(body, pos + 1) === 46 && charCodeAt.call(body, pos + 2) === 46) {\n return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n break;\n // :\n case 58:\n return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n case 61:\n return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n case 64:\n return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n case 91:\n return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n case 93:\n return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n case 123:\n return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n case 124:\n return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n case 125:\n return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n case 34:\n if (charCodeAt.call(body, pos + 1) === 34 && charCodeAt.call(body, pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev);\n }\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(__WEBPACK_IMPORTED_MODULE_0__error__[\"e\" /* syntaxError */])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "7db4235359d8af6f4ade62cbd5fd8566", "score": "0.5447568", "text": "function advanceLexer() {\n var token = this.lastToken = this.token;\n if (token.kind !== EOF) {\n do {\n token = token.next = readToken(this, token);\n } while (token.kind === COMMENT);\n this.token = token;\n }\n return token;\n }", "title": "" }, { "docid": "13ccc68a1dc4e90846a73fca2710e838", "score": "0.54465544", "text": "function processCommentOrSpace(node, ctx) {\n if (node.type === \"space\" || node.type === \"newline\") {\n return true;\n }\n /* istanbul ignore if */\n if (node.type === \"flow-error-end\" || node.type === \"error\") {\n throw ctx.throwUnexpectedTokenError(node);\n }\n if (node.type === \"comment\") {\n const comment = Object.assign({ type: \"Block\", value: node.source.slice(1) }, ctx.getConvertLocation(...toRange(node)));\n ctx.addComment(comment);\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "36a0f7ab2a2c71a16b7bb0074e0032da", "score": "0.5433225", "text": "function nextTokenIsLinebreak(cm, lineNumber, charNumber) {\n\tif (charNumber == undefined)\n\t\tcharNumber = 1;\n\tvar token = cm.getTokenAt({\n\t\tline : lineNumber,\n\t\tch : charNumber\n\t});\n\tif (token.end < charNumber) {\n\t\t//hmm, can't find a new token on this line: we've reached the line break\n\t\treturn true;\n\t}\n\tif (token == null || token == undefined || token.end < charNumber || token.type != \"sp-ws\") {\n\t\treturn false;\n\t} else {\n\t\tif (/\\r?\\n|\\r/.test(token.string)) {\n\t\t\t//line break!\n\t\t\treturn true;\n\t\t} else {\n\t\t\t//just a space. get next token\n\t\t\treturn nextTokenIsLinebreak(cm, lineNumber, token.end + 1);\n\t\t}\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "c46ef157aca1900a9118b03fce452dc6", "score": "0.5431241", "text": "function tokenizer(input) {\n\n\tvar S = {\n\t\n\t\ttext: input.replace(/\\r\\n?|[\\n\\u2028\\u2029]/g, \"\\n\").replace(/^\\uFEFF/, ''),\n\t\tpos: 0,\n\t\ttokenPos: 0,\n\t\tline: 0,\n\t\ttokenLine: 0,\n\t\tcol: 0,\n\t\ttokenCol: 0,\n\t\tnewlineBefore: false,\n\t\tregexAllowed: false,\n\t\tcommentsBefore: []\n\t};\n\t\n\treturn {\n\t\n\t\tnextToken: nextToken,\n\t\tgetContext: function() { return S; },\n\t\tsetContext: function(c) { S = c; }\n\t};\n\n\tfunction peek() {\n\t\n\t\treturn S.text.charAt(S.pos);\n\t}\n\n\tfunction next(throwEOF) {\n\t\n\t\tvar ch = S.text.charAt(S.pos++);\n\t\t\n\t\tif (throwEOF && !ch)\n\t\t\tthrow ERROR_EOF;\n\t\t\n\t\tif (ch == \"\\n\") {\n\t\t\n\t\t\tS.newlineBefore = true;\n\t\t\t++S.line;\n\t\t\tS.col = 0;\n\t\t\n\t\t} else {\n\t\t\n\t\t\t++S.col;\n\t\t}\n\t\t\n\t\treturn ch;\n\t}\n\n\t/*\n\t[NOT USED]\n\tfunction eof() {\n\t\n\t\treturn !S.peek();\n\t}\n\t*/\n\t\n\tfunction find(str, throwEOF) {\n\t\n\t\tvar pos = S.text.indexOf(str, S.pos);\n\t\n\t\tif (throwEOF && pos == -1) \n\t\t\tthrow ERROR_EOF;\n\t\t\n\t\treturn pos;\n\t}\n\t\n\tfunction startToken() {\n\t\n\t\tS.tokenLine = S.line;\n\t\tS.tokenCol = S.col;\n\t\tS.tokenPos = S.pos;\n\t}\n\n\tfunction token(type, value, isComment) {\n\t\n\t\tS.regexAllowed = ((type == \"operator\" && !hasKey(UNARY_POSTFIX, value)) ||\n\t\t\t(type == \"keyword\" && hasKey(KEYWORDS_BEFORE_EXPRESSION, value)) ||\n\t\t\t(type == \"punc\" && hasKey(PUNC_BEFORE_EXPRESSION, value)));\n\t\n\t\tvar ret = {\n\t\t\n\t\t\ttype: type,\n\t\t\tvalue: value,\n\t\t\tline: S.tokenLine,\n\t\t\tcol: S.tokenCol,\n\t\t\tpos: S.tokenPos,\n\t\t\tnewlineBefore: S.newlineBefore\n\t\t};\n\t\t\n\t\tif (!isComment) {\n\t\t\n\t\t\tret.commentsBefore = S.commentsBefore;\n\t\t\tS.commentsBefore = [];\n\t\t}\n\t\t\n\t\tS.newlineBefore = false;\n\t\treturn ret;\n\t}\n\n\tfunction skipWhitespace() {\n\t\n\t\twhile (hasKey(WHITESPACE_CHARS, peek()))\n\t\t\tnext();\n\t}\n\t\n\tfunction readWhile(f) {\n\t\n\t\tvar ret = \"\", ch = peek(), i = 0;\n\t\n\t\twhile (ch && f(ch, i++)) {\n\t\t\n\t\t\tret += next();\n\t\t\tch = peek();\n\t\t}\n\t\t\n\t\treturn ret;\n\t}\n\n\tfunction readNumber(prefix) {\n\t\n\t\tvar hasE = false, \n\t\t\tafterE = false, \n\t\t\thasX = false, \n\t\t\thasDot = (prefix == \".\");\n\t\t\t\n\t\tvar num = readWhile(function(ch, i) {\n\t\t\n\t\t\tif (ch == \"x\" || ch == \"X\") {\n\t\t\t\n\t\t\t\tif (hasX) return false;\n\t\t\t\telse return hasX = true;\n\t\t\t}\n\t\t\t\n\t\t\tif (!hasX && (ch == \"E\" || ch == \"e\")) {\n\t\t\t\n\t\t\t\tif (hasE) return false;\n\t\t\t\telse return hasE = afterE = true;\n\t\t\t}\n\t\t\t\n\t\t\tif (ch == \"-\") {\n\t\t\t\n\t\t\t\tif (afterE || (i == 0 && !prefix)) return true;\n\t\t\t\telse return false;\n\t\t\t}\n\t\t\t\n\t\t\tif (ch == \"+\") \n\t\t\t\treturn afterE;\n\t\t\t\n\t\t\tafterE = false;\n\t\t\t\n\t\t\tif (ch == \".\") {\n\t\t\t\n\t\t\t\tif (!hasDot && !hasX) return hasDot = true;\n\t\t\t\telse return false;\n\t\t\t}\n\t\t\t\n\t\t\treturn isAlphaNumeric(ch);\n\t\t});\n\t\t\n\t\tif (prefix)\n\t\t\tnum = prefix + num;\n\t\t\n\t\tvar valid = parseNumber(num);\n\t\t\n\t\tif (!isNaN(valid)) \n\t\t\treturn token(\"num\", valid);\n\t\t\n\t\tthrow new ParseError(\"Invalid syntax: \" + num);\n\t}\n\n\tfunction readEscapedChar() {\n\t\n\t\tvar ch = next(true);\n\t\t\n\t\tswitch (ch) {\n\t\t\n\t\t\tcase \"n\": return \"\\n\";\n\t\t\tcase \"r\": return \"\\r\";\n\t\t\tcase \"t\": return \"\\t\";\n\t\t\tcase \"b\": return \"\\b\";\n\t\t\tcase \"v\": return \"\\v\";\n\t\t\tcase \"f\": return \"\\f\";\n\t\t\tcase \"0\": return \"\\0\";\n\t\t\tcase \"x\": return String.fromCharCode(hexBytes(2));\n\t\t\tcase \"u\": return String.fromCharCode(hexBytes(4));\n\t\t\tcase \"\\n\": return \"\";\n\t\t\tdefault: return ch;\n\t\t}\n\t}\n\n\tfunction hexBytes(n) {\n\t\n\t\tvar num = 0, digit;\n\t\t\n\t\tfor (; n > 0; --n) {\n\t\t\n\t\t\tdigit = parseInt(next(true), 16);\n\t\t\n\t\t\tif (isNaN(digit))\n\t\t\t\tthrow new ParseError(\"Invalid hex-character pattern in string\");\n\t\t\t\n\t\t\tnum = (num << 4) | digit;\n\t\t}\n\t\t\n\t\treturn num;\n\t}\n\n\tfunction readString() {\n\t\n\t\treturn noEOF(\"Unterminated string constant\", function() {\n\t\t\n\t\t\tvar quote = next(), ret = \"\";\n\t\t\t\n\t\t\tfor (;;) {\n\t\t\t\t\n\t\t\t\tvar ch = next(true);\n\t\t\t\t\n\t\t\t\tif (ch == \"\\\\\") {\n\t\t\t\t\n\t\t\t\t\t// read OctalEscapeSequence (TODO: deprecated if \"strict mode\")\n\t\t\t\t\t// https://github.com/mishoo/UglifyJS/issues/178\n\t\t\t\t\tvar octalLen = 0, first = null;\n\t\t\t\t\t\n\t\t\t\t\tch = readWhile(function(ch) {\n\t\t\t\t\t\n\t\t\t\t\t\tif (ch >= \"0\" && ch <= \"7\") {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!first) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfirst = ch;\n\t\t\t\t\t\t\t\treturn ++octalLen;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else if (first <= \"3\" && octalLen <= 2) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn ++octalLen;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else if (first >= \"4\" && octalLen <= 1) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn ++octalLen;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tif (octalLen > 0) ch = String.fromCharCode(parseInt(ch, 8));\n\t\t\t\t\telse ch = readEscapedChar();\n\t\t\t\t\n\t\t\t\t} else if (ch == quote) {\n\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tret += ch;\n\t\t\t}\n\t\t\t\n\t\t\treturn token(\"string\", ret);\n\t\t});\n\t}\n\n\tfunction readLineComment() {\n\t\n\t\tnext();\n\t\t\n\t\tvar i = find(\"\\n\"), ret;\n\t\t\n\t\tif (i == -1) {\n\t\t\n\t\t\tret = S.text.substr(S.pos);\n\t\t\tS.pos = S.text.length;\n\t\t\n\t\t} else {\n\t\t\n\t\t\tret = S.text.substring(S.pos, i);\n\t\t\tS.pos = i;\n\t\t}\n\t\n\t\treturn token(\"comment1\", ret, true);\n\t}\n\n\tfunction readMultilineComment() {\n\t\n\t\tnext();\n\t\t\n\t\treturn noEOF(\"Unterminated multiline comment\", function() {\n\t\t\n\t\t\tvar i = find(\"*/\", true),\n\t\t\t\ttext = S.text.substring(S.pos, i),\n\t\t\t\ttok = token(\"comment2\", text, true);\n\t\t\t\n\t\t\tS.pos = i + 2;\n\t\t\tS.line += text.split(\"\\n\").length - 1;\n\t\t\tS.newlineBefore = text.indexOf(\"\\n\") >= 0;\n\t\t\t\n\t\t\treturn tok;\n\t\t});\n\t}\n\n\tfunction readName() {\n\t\n\t\tvar backslash = false, name = \"\", ch;\n\t\t\n\t\twhile ((ch = peek()) != null) {\n\t\t\n\t\t\tif (!backslash) {\n\t\t\t\n\t\t\t\tif (ch == \"\\\\\") backslash = true, next();\n\t\t\t\telse if (isIdentifierChar(ch)) name += next();\n\t\t\t\telse break;\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\tif (ch != \"u\") \n\t\t\t\t\tthrow new ParseError(\"Expecting UnicodeEscapeSequence -- uXXXX\");\n\t\t\n\t\t\t\tch = readEscapedChar();\n\t\t\n\t\t\t\tif (!isIdentifierChar(ch)) \n\t\t\t\t\tthrow new ParseError(\"Unicode char: \" + ch.charCodeAt(0) + \" is not valid in identifier\");\n\t\t\n\t\t\t\tname += ch;\n\t\t\t\tbackslash = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn name;\n\t}\n\n\tfunction readRegexp() {\n\t\n\t\treturn noEOF(\"Unterminated regular expression\", function() {\n\t\t\n\t\t\tvar prevBackslash = false, \n\t\t\t\tregexp = \"\", ch, \n\t\t\t\tinClass = false;\n\t\t\t\n\t\t\twhile ((ch = next(true))) {\n\t\t\t\n\t\t\t\tif (prevBackslash) {\n\t\t\t\t\n\t\t\t\t\tregexp += \"\\\\\" + ch;\n\t\t\t\t\tprevBackslash = false;\n\t\t\t\t\n\t\t\t\t} else if (ch == \"[\") {\n\t\t\t\t\n\t\t\t\t\tinClass = true;\n\t\t\t\t\tregexp += ch;\n\t\t\t\t\n\t\t\t\t} else if (ch == \"]\" && inClass) {\n\t\t\t\t\n\t\t\t\t\tinClass = false;\n\t\t\t\t\tregexp += ch;\n\t\t\t\t\n\t\t\t\t} else if (ch == \"/\" && !inClass) {\n\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t} else if (ch == \"\\\\\") {\n\t\t\t\t\n\t\t\t\t\tprevBackslash = true;\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\tregexp += ch;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tvar mods = readName();\n\t\t\treturn token(\"regexp\", [ regexp, mods ]);\n\t\t});\n\t}\n\n\tfunction readOperator(prefix) {\n\t\n\t\tfunction grow(op) {\n\t\t\n\t\t\tif (!peek()) \n\t\t\t\treturn op;\n\t\t\t\n\t\t\tvar bigger = op + peek();\n\t\t\t\n\t\t\tif (hasKey(OPERATORS, bigger)) {\n\t\t\t\n\t\t\t\tnext();\n\t\t\t\treturn grow(bigger);\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\treturn op;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn token(\"operator\", grow(prefix || next()));\n\t}\n\n\tfunction handleSlash() {\n\t\n\t\tnext();\n\t\n\t\tvar regexAllowed = S.regexAllowed;\n\t\n\t\tswitch (peek()) {\n\t\t\n\t\t\tcase \"/\":\n\t\t\t\tS.commentsBefore.push(readLineComment());\n\t\t\t\tS.regexAllowed = regexAllowed;\n\t\t\t\treturn nextToken();\n\t\n\t\t\tcase \"*\":\n\t\t\t\tS.commentsBefore.push(readMultilineComment());\n\t\t\t\tS.regexAllowed = regexAllowed;\n\t\t\t\treturn nextToken();\n\t\t}\n\t\n\t\treturn S.regexAllowed ? readRegexp() : readOperator(\"/\");\n\t}\n\n\tfunction handleDot() {\n\t\n\t\tnext();\n\t\treturn isDigit(peek()) ? readNumber(\".\") : token(\"punc\", \".\");\n\t}\n\n\tfunction readWord() {\n\t\n\t\tvar word = readName();\n\t\t\n\t\treturn !hasKey(KEYWORDS, word) ? token(\"name\", word) :\n\t\t\thasKey(OPERATORS, word) ? token(\"operator\", word) :\n\t\t\thasKey(KEYWORDS_ATOM, word) ? token(\"atom\", word) :\n\t\t\ttoken(\"keyword\", word);\n\t}\n\n\tfunction noEOF(msg, cont) {\n\t\n\t\ttry {\n\t\t\n\t\t\treturn cont();\n\t\t\n\t\t} catch(ex) {\n\t\t\n\t\t\tif (ex === ERROR_EOF) throw new ParseError(msg);\n\t\t\telse throw ex;\n\t\t}\n\t}\n\n\t// Return the next token from the input stream\n\tfunction nextToken(forceRegexp) {\n\t\n\t\tif (forceRegexp)\n\t\t\treturn readRegexp();\n\t\t\t\n\t\tskipWhitespace();\n\t\tstartToken();\n\t\t\n\t\tvar ch = peek();\n\t\t\n\t\tif (!ch) return token(\"eof\");\n\t\tif (isDigit(ch)) return readNumber();\n\t\tif (ch === '\"' || ch == \"'\") return readString();\n\t\tif (hasKey(PUNC_CHARS, ch)) return token(\"punc\", next());\n\t\tif (ch === \".\") return handleDot();\n\t\tif (ch === \"/\") return handleSlash();\n\t\tif (hasKey(OPERATOR_CHARS, ch)) return readOperator();\n\t\tif (ch === \"\\\\\" || isIdentifierStart(ch)) return readWord();\n\t\t\n\t\tthrow new ParseError(\"Unexpected character '\" + ch + \"'\");\n\t}\n\n\t/*\n\t[NOT USED]\n\t// Get or set the current context\n\tfunction context(ctx) {\n\t\n\t\tif (ctx) S = ctx;\n\t\treturn S;\n\t}\n\t*/\n\t\n}", "title": "" }, { "docid": "327450702f0752ac425af7661a2b89c2", "score": "0.5429869", "text": "[COMMENT_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.EXCLAMATION_MARK) {\n this.currentToken.data += '!';\n this.state = COMMENT_LESS_THAN_SIGN_BANG_STATE;\n } else if (cp === $.LESS_THAN_SIGN) {\n this.currentToken.data += '!';\n } else {\n this._reconsumeInState(COMMENT_STATE);\n }\n }", "title": "" }, { "docid": "b5dfc565b7c1f3bd70c1596a01e2fe3a", "score": "0.5424165", "text": "[MARKUP_DECLARATION_OPEN_STATE](cp) {\n if (this._consumeSequenceIfMatch($$.DASH_DASH_STRING, cp, true)) {\n this._createCommentToken();\n\n this.state = COMMENT_START_STATE;\n } else if (this._consumeSequenceIfMatch($$.DOCTYPE_STRING, cp, false)) {\n this.state = DOCTYPE_STATE;\n } else if (this._consumeSequenceIfMatch($$.CDATA_START_STRING, cp, true)) {\n if (this.allowCDATA) {\n this.state = CDATA_SECTION_STATE;\n } else {\n this._err(ERR.cdataInHtmlContent);\n\n this._createCommentToken();\n\n this.currentToken.data = '[CDATA[';\n this.state = BOGUS_COMMENT_STATE;\n }\n } //NOTE: sequence lookup can be abrupted by hibernation. In that case lookup\n //results are no longer valid and we will need to start over.\n else if (!this._ensureHibernation()) {\n this._err(ERR.incorrectlyOpenedComment);\n\n this._createCommentToken();\n\n this._reconsumeInState(BOGUS_COMMENT_STATE);\n }\n }", "title": "" }, { "docid": "f939f1211e0d4484236d0792521a40dc", "score": "0.5420183", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code = void 0;\n var position = start;\n\n do {\n code = charCodeAt.call(body, ++position);\n } while (code !== null && (\n // SourceCharacter but not LineTerminator\n code > 0x001F || code === 0x0009));\n\n return new Tok(COMMENT, start, position, line, col, prev, slice.call(body, start + 1, position));\n }", "title": "" }, { "docid": "d3a56be74c3a871ca5021f20f0a07175", "score": "0.5417207", "text": "preProcessedConditional() {\n this.advance(); // advance past the leading #\n while ((0, Characters_1.isAlphaNumeric)(this.peek())) {\n this.advance();\n }\n let text = this.source.slice(this.start, this.current).toLowerCase();\n // some identifiers can be split into two words, so check the \"next\" word and see what we get\n if ((text === '#end' || text === '#else') && this.check(' ', '\\t')) {\n let endOfFirstWord = this.current;\n //skip past whitespace\n while (this.check(' ', '\\t')) {\n this.advance();\n }\n while ((0, Characters_1.isAlphaNumeric)(this.peek())) {\n this.advance();\n } // read the next word\n let twoWords = this.source.slice(this.start, this.current).toLowerCase();\n switch (twoWords.replace(/[\\s\\t]+/g, ' ')) {\n case '#else if':\n this.addToken(TokenKind_1.TokenKind.HashElseIf);\n return;\n case '#end if':\n this.addToken(TokenKind_1.TokenKind.HashEndIf);\n return;\n }\n // reset if the last word and the current word didn't form a multi-word TokenKind\n this.current = endOfFirstWord;\n }\n switch (text) {\n case '#if':\n this.addToken(TokenKind_1.TokenKind.HashIf);\n return;\n case '#else':\n this.addToken(TokenKind_1.TokenKind.HashElse);\n return;\n case '#elseif':\n this.addToken(TokenKind_1.TokenKind.HashElseIf);\n return;\n case '#endif':\n this.addToken(TokenKind_1.TokenKind.HashEndIf);\n return;\n case '#const':\n this.addToken(TokenKind_1.TokenKind.HashConst);\n return;\n case '#error':\n this.addToken(TokenKind_1.TokenKind.HashError);\n this.start = this.current;\n //create a token from whitespace after the #error token\n if (this.check(' ', '\\t')) {\n this.whitespace();\n }\n while (!this.isAtEnd() && !this.check('\\n')) {\n this.advance();\n }\n // grab all text since we found #error as one token\n this.addToken(TokenKind_1.TokenKind.HashErrorMessage);\n this.start = this.current;\n return;\n default:\n this.diagnostics.push(Object.assign(Object.assign({}, DiagnosticMessages_1.DiagnosticMessages.unexpectedConditionalCompilationString()), { range: this.rangeOf() }));\n }\n }", "title": "" }, { "docid": "220af56fc82096e03b510c7623c01e2a", "score": "0.5415835", "text": "function initTokenState() {\r\n tokCurLine = 1;\r\n tokPos = tokLineStart = 0;\r\n tokRegexpAllowed = true;\r\n inXJSChild = inXJSTag = false;\r\n skipSpace();\r\n }", "title": "" }, { "docid": "4f4875c1a4de6c2dac97502bacf11bb6", "score": "0.5412816", "text": "_tokenizeToEnd(callback, inputFinished) {\n // Continue parsing as far as possible; the loop will return eventually\n let input = this._input;\n let currentLineLength = input.length;\n while (true) {\n // Count and skip whitespace lines\n let whiteSpaceMatch, comment;\n while (whiteSpaceMatch = this._newline.exec(input)) {\n // Try to find a comment\n if (this._comments && (comment = this._comment.exec(whiteSpaceMatch[0])))\n emitToken('comment', comment[1], '', this._line, whiteSpaceMatch[0].length);\n // Advance the input\n input = input.substr(whiteSpaceMatch[0].length, input.length);\n currentLineLength = input.length;\n this._line++;\n }\n // Skip whitespace on current line\n if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input)))\n input = input.substr(whiteSpaceMatch[0].length, input.length);\n\n // Stop for now if we're at the end\n if (this._endOfFile.test(input)) {\n // If the input is finished, emit EOF\n if (inputFinished) {\n // Try to find a final comment\n if (this._comments && (comment = this._comment.exec(input)))\n emitToken('comment', comment[1], '', this._line, input.length);\n input = null;\n emitToken('eof', '', '', this._line, 0);\n }\n return this._input = input;\n }\n\n // Look for specific token types based on the first character\n const line = this._line, firstChar = input[0];\n let type = '', value = '', prefix = '',\n match = null, matchLength = 0, inconclusive = false;\n switch (firstChar) {\n case '^':\n // We need at least 3 tokens lookahead to distinguish ^^<IRI> and ^^pre:fixed\n if (input.length < 3)\n break;\n // Try to match a type\n else if (input[1] === '^') {\n this._previousMarker = '^^';\n // Move to type IRI or prefixed name\n input = input.substr(2);\n if (input[0] !== '<') {\n inconclusive = true;\n break;\n }\n }\n // If no type, it must be a path expression\n else {\n if (this._n3Mode) {\n matchLength = 1;\n type = '^';\n }\n break;\n }\n // Fall through in case the type is an IRI\n case '<':\n // Try to find a full IRI without escape sequences\n if (match = this._unescapedIri.exec(input))\n type = 'IRI', value = match[1];\n // Try to find a full IRI with escape sequences\n else if (match = this._iri.exec(input)) {\n value = this._unescape(match[1]);\n if (value === null || illegalIriChars.test(value))\n return reportSyntaxError(this);\n type = 'IRI';\n }\n // Try to find a nested triple\n else if (input.length > 1 && input[1] === '<')\n type = '<<', matchLength = 2;\n // Try to find a backwards implication arrow\n else if (this._n3Mode && input.length > 1 && input[1] === '=')\n type = 'inverse', matchLength = 2, value = '>';\n break;\n\n case '>':\n if (input.length > 1 && input[1] === '>')\n type = '>>', matchLength = 2;\n break;\n\n case '_':\n // Try to find a blank node. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a blank node.\n // Therefore, try inserting a space if we're at the end of the input.\n if ((match = this._blank.exec(input)) ||\n inputFinished && (match = this._blank.exec(`${input} `)))\n type = 'blank', prefix = '_', value = match[1];\n break;\n\n case '\"':\n // Try to find a literal without escape sequences\n if (match = this._simpleQuotedString.exec(input))\n value = match[1];\n // Try to find a literal wrapped in three pairs of quotes\n else {\n ({ value, matchLength } = this._parseLiteral(input));\n if (value === null)\n return reportSyntaxError(this);\n }\n if (match !== null || matchLength !== 0) {\n type = 'literal';\n this._literalClosingPos = 0;\n }\n break;\n\n case \"'\":\n if (!this._lineMode) {\n // Try to find a literal without escape sequences\n if (match = this._simpleApostropheString.exec(input))\n value = match[1];\n // Try to find a literal wrapped in three pairs of quotes\n else {\n ({ value, matchLength } = this._parseLiteral(input));\n if (value === null)\n return reportSyntaxError(this);\n }\n if (match !== null || matchLength !== 0) {\n type = 'literal';\n this._literalClosingPos = 0;\n }\n }\n break;\n\n case '?':\n // Try to find a variable\n if (this._n3Mode && (match = this._variable.exec(input)))\n type = 'var', value = match[0];\n break;\n\n case '@':\n // Try to find a language code\n if (this._previousMarker === 'literal' && (match = this._langcode.exec(input)))\n type = 'langcode', value = match[1];\n // Try to find a keyword\n else if (match = this._keyword.exec(input))\n type = match[0];\n break;\n\n case '.':\n // Try to find a dot as punctuation\n if (input.length === 1 ? inputFinished : (input[1] < '0' || input[1] > '9')) {\n type = '.';\n matchLength = 1;\n break;\n }\n // Fall through to numerical case (could be a decimal dot)\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n case '+':\n case '-':\n // Try to find a number. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a number.\n // Therefore, try inserting a space if we're at the end of the input.\n if (match = this._number.exec(input) ||\n inputFinished && (match = this._number.exec(`${input} `))) {\n type = 'literal', value = match[0];\n prefix = (typeof match[1] === 'string' ? xsd.double :\n (typeof match[2] === 'string' ? xsd.decimal : xsd.integer));\n }\n break;\n\n case 'B':\n case 'b':\n case 'p':\n case 'P':\n case 'G':\n case 'g':\n // Try to find a SPARQL-style keyword\n if (match = this._sparqlKeyword.exec(input))\n type = match[0].toUpperCase();\n else\n inconclusive = true;\n break;\n\n case 'f':\n case 't':\n // Try to match a boolean\n if (match = this._boolean.exec(input))\n type = 'literal', value = match[0], prefix = xsd.boolean;\n else\n inconclusive = true;\n break;\n\n case 'a':\n // Try to find an abbreviated predicate\n if (match = this._shortPredicates.exec(input))\n type = 'abbreviation', value = 'a';\n else\n inconclusive = true;\n break;\n\n case '=':\n // Try to find an implication arrow or equals sign\n if (this._n3Mode && input.length > 1) {\n type = 'abbreviation';\n if (input[1] !== '>')\n matchLength = 1, value = '=';\n else\n matchLength = 2, value = '>';\n }\n break;\n\n case '!':\n if (!this._n3Mode)\n break;\n case ',':\n case ';':\n case '[':\n case ']':\n case '(':\n case ')':\n case '{':\n case '}':\n if (!this._lineMode) {\n matchLength = 1;\n type = firstChar;\n }\n break;\n\n default:\n inconclusive = true;\n }\n\n // Some first characters do not allow an immediate decision, so inspect more\n if (inconclusive) {\n // Try to find a prefix\n if ((this._previousMarker === '@prefix' || this._previousMarker === 'PREFIX') &&\n (match = this._prefix.exec(input)))\n type = 'prefix', value = match[1] || '';\n // Try to find a prefixed name. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a prefixed name.\n // Therefore, try inserting a space if we're at the end of the input.\n else if ((match = this._prefixed.exec(input)) ||\n inputFinished && (match = this._prefixed.exec(`${input} `)))\n type = 'prefixed', prefix = match[1] || '', value = this._unescape(match[2]);\n }\n\n // A type token is special: it can only be emitted after an IRI or prefixed name is read\n if (this._previousMarker === '^^') {\n switch (type) {\n case 'prefixed': type = 'type'; break;\n case 'IRI': type = 'typeIRI'; break;\n default: type = '';\n }\n }\n\n // What if nothing of the above was found?\n if (!type) {\n // We could be in streaming mode, and then we just wait for more input to arrive.\n // Otherwise, a syntax error has occurred in the input.\n // One exception: error on an unaccounted linebreak (= not inside a triple-quoted literal).\n if (inputFinished || (!/^'''|^\"\"\"/.test(input) && /\\n|\\r/.test(input)))\n return reportSyntaxError(this);\n else\n return this._input = input;\n }\n\n // Emit the parsed token\n const length = matchLength || match[0].length;\n const token = emitToken(type, value, prefix, line, length);\n this.previousToken = token;\n this._previousMarker = type;\n\n // Advance to next part to tokenize\n input = input.substr(length, input.length);\n }\n\n // Emits the token through the callback\n function emitToken(type, value, prefix, line, length) {\n const start = input ? currentLineLength - input.length : currentLineLength;\n const end = start + length;\n const token = { type, value, prefix, line, start, end };\n callback(null, token);\n return token;\n }\n // Signals the syntax error through the callback\n function reportSyntaxError(self) { callback(self._syntaxError(/^\\S*/.exec(input)[0])); }\n }", "title": "" }, { "docid": "4f4875c1a4de6c2dac97502bacf11bb6", "score": "0.5412816", "text": "_tokenizeToEnd(callback, inputFinished) {\n // Continue parsing as far as possible; the loop will return eventually\n let input = this._input;\n let currentLineLength = input.length;\n while (true) {\n // Count and skip whitespace lines\n let whiteSpaceMatch, comment;\n while (whiteSpaceMatch = this._newline.exec(input)) {\n // Try to find a comment\n if (this._comments && (comment = this._comment.exec(whiteSpaceMatch[0])))\n emitToken('comment', comment[1], '', this._line, whiteSpaceMatch[0].length);\n // Advance the input\n input = input.substr(whiteSpaceMatch[0].length, input.length);\n currentLineLength = input.length;\n this._line++;\n }\n // Skip whitespace on current line\n if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input)))\n input = input.substr(whiteSpaceMatch[0].length, input.length);\n\n // Stop for now if we're at the end\n if (this._endOfFile.test(input)) {\n // If the input is finished, emit EOF\n if (inputFinished) {\n // Try to find a final comment\n if (this._comments && (comment = this._comment.exec(input)))\n emitToken('comment', comment[1], '', this._line, input.length);\n input = null;\n emitToken('eof', '', '', this._line, 0);\n }\n return this._input = input;\n }\n\n // Look for specific token types based on the first character\n const line = this._line, firstChar = input[0];\n let type = '', value = '', prefix = '',\n match = null, matchLength = 0, inconclusive = false;\n switch (firstChar) {\n case '^':\n // We need at least 3 tokens lookahead to distinguish ^^<IRI> and ^^pre:fixed\n if (input.length < 3)\n break;\n // Try to match a type\n else if (input[1] === '^') {\n this._previousMarker = '^^';\n // Move to type IRI or prefixed name\n input = input.substr(2);\n if (input[0] !== '<') {\n inconclusive = true;\n break;\n }\n }\n // If no type, it must be a path expression\n else {\n if (this._n3Mode) {\n matchLength = 1;\n type = '^';\n }\n break;\n }\n // Fall through in case the type is an IRI\n case '<':\n // Try to find a full IRI without escape sequences\n if (match = this._unescapedIri.exec(input))\n type = 'IRI', value = match[1];\n // Try to find a full IRI with escape sequences\n else if (match = this._iri.exec(input)) {\n value = this._unescape(match[1]);\n if (value === null || illegalIriChars.test(value))\n return reportSyntaxError(this);\n type = 'IRI';\n }\n // Try to find a nested triple\n else if (input.length > 1 && input[1] === '<')\n type = '<<', matchLength = 2;\n // Try to find a backwards implication arrow\n else if (this._n3Mode && input.length > 1 && input[1] === '=')\n type = 'inverse', matchLength = 2, value = '>';\n break;\n\n case '>':\n if (input.length > 1 && input[1] === '>')\n type = '>>', matchLength = 2;\n break;\n\n case '_':\n // Try to find a blank node. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a blank node.\n // Therefore, try inserting a space if we're at the end of the input.\n if ((match = this._blank.exec(input)) ||\n inputFinished && (match = this._blank.exec(`${input} `)))\n type = 'blank', prefix = '_', value = match[1];\n break;\n\n case '\"':\n // Try to find a literal without escape sequences\n if (match = this._simpleQuotedString.exec(input))\n value = match[1];\n // Try to find a literal wrapped in three pairs of quotes\n else {\n ({ value, matchLength } = this._parseLiteral(input));\n if (value === null)\n return reportSyntaxError(this);\n }\n if (match !== null || matchLength !== 0) {\n type = 'literal';\n this._literalClosingPos = 0;\n }\n break;\n\n case \"'\":\n if (!this._lineMode) {\n // Try to find a literal without escape sequences\n if (match = this._simpleApostropheString.exec(input))\n value = match[1];\n // Try to find a literal wrapped in three pairs of quotes\n else {\n ({ value, matchLength } = this._parseLiteral(input));\n if (value === null)\n return reportSyntaxError(this);\n }\n if (match !== null || matchLength !== 0) {\n type = 'literal';\n this._literalClosingPos = 0;\n }\n }\n break;\n\n case '?':\n // Try to find a variable\n if (this._n3Mode && (match = this._variable.exec(input)))\n type = 'var', value = match[0];\n break;\n\n case '@':\n // Try to find a language code\n if (this._previousMarker === 'literal' && (match = this._langcode.exec(input)))\n type = 'langcode', value = match[1];\n // Try to find a keyword\n else if (match = this._keyword.exec(input))\n type = match[0];\n break;\n\n case '.':\n // Try to find a dot as punctuation\n if (input.length === 1 ? inputFinished : (input[1] < '0' || input[1] > '9')) {\n type = '.';\n matchLength = 1;\n break;\n }\n // Fall through to numerical case (could be a decimal dot)\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n case '+':\n case '-':\n // Try to find a number. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a number.\n // Therefore, try inserting a space if we're at the end of the input.\n if (match = this._number.exec(input) ||\n inputFinished && (match = this._number.exec(`${input} `))) {\n type = 'literal', value = match[0];\n prefix = (typeof match[1] === 'string' ? xsd.double :\n (typeof match[2] === 'string' ? xsd.decimal : xsd.integer));\n }\n break;\n\n case 'B':\n case 'b':\n case 'p':\n case 'P':\n case 'G':\n case 'g':\n // Try to find a SPARQL-style keyword\n if (match = this._sparqlKeyword.exec(input))\n type = match[0].toUpperCase();\n else\n inconclusive = true;\n break;\n\n case 'f':\n case 't':\n // Try to match a boolean\n if (match = this._boolean.exec(input))\n type = 'literal', value = match[0], prefix = xsd.boolean;\n else\n inconclusive = true;\n break;\n\n case 'a':\n // Try to find an abbreviated predicate\n if (match = this._shortPredicates.exec(input))\n type = 'abbreviation', value = 'a';\n else\n inconclusive = true;\n break;\n\n case '=':\n // Try to find an implication arrow or equals sign\n if (this._n3Mode && input.length > 1) {\n type = 'abbreviation';\n if (input[1] !== '>')\n matchLength = 1, value = '=';\n else\n matchLength = 2, value = '>';\n }\n break;\n\n case '!':\n if (!this._n3Mode)\n break;\n case ',':\n case ';':\n case '[':\n case ']':\n case '(':\n case ')':\n case '{':\n case '}':\n if (!this._lineMode) {\n matchLength = 1;\n type = firstChar;\n }\n break;\n\n default:\n inconclusive = true;\n }\n\n // Some first characters do not allow an immediate decision, so inspect more\n if (inconclusive) {\n // Try to find a prefix\n if ((this._previousMarker === '@prefix' || this._previousMarker === 'PREFIX') &&\n (match = this._prefix.exec(input)))\n type = 'prefix', value = match[1] || '';\n // Try to find a prefixed name. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a prefixed name.\n // Therefore, try inserting a space if we're at the end of the input.\n else if ((match = this._prefixed.exec(input)) ||\n inputFinished && (match = this._prefixed.exec(`${input} `)))\n type = 'prefixed', prefix = match[1] || '', value = this._unescape(match[2]);\n }\n\n // A type token is special: it can only be emitted after an IRI or prefixed name is read\n if (this._previousMarker === '^^') {\n switch (type) {\n case 'prefixed': type = 'type'; break;\n case 'IRI': type = 'typeIRI'; break;\n default: type = '';\n }\n }\n\n // What if nothing of the above was found?\n if (!type) {\n // We could be in streaming mode, and then we just wait for more input to arrive.\n // Otherwise, a syntax error has occurred in the input.\n // One exception: error on an unaccounted linebreak (= not inside a triple-quoted literal).\n if (inputFinished || (!/^'''|^\"\"\"/.test(input) && /\\n|\\r/.test(input)))\n return reportSyntaxError(this);\n else\n return this._input = input;\n }\n\n // Emit the parsed token\n const length = matchLength || match[0].length;\n const token = emitToken(type, value, prefix, line, length);\n this.previousToken = token;\n this._previousMarker = type;\n\n // Advance to next part to tokenize\n input = input.substr(length, input.length);\n }\n\n // Emits the token through the callback\n function emitToken(type, value, prefix, line, length) {\n const start = input ? currentLineLength - input.length : currentLineLength;\n const end = start + length;\n const token = { type, value, prefix, line, start, end };\n callback(null, token);\n return token;\n }\n // Signals the syntax error through the callback\n function reportSyntaxError(self) { callback(self._syntaxError(/^\\S*/.exec(input)[0])); }\n }", "title": "" }, { "docid": "f4266c7ce765f5185e92acb7974bd3a0", "score": "0.53958094", "text": "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "title": "" }, { "docid": "7b41edd56b44920b2693a74f8adf8229", "score": "0.5391457", "text": "inlineEndOfContentComment() {\n const context = new Parsing.Context(new Parsing.Data.Node('test'), `// Comment test, inline with end-of-content`);\n this.isTrue(Language.Comment.inline.consume(context));\n this.areSame(context.offset, context.length);\n }", "title": "" }, { "docid": "289877fdb9235ff1fc8ae221e770dabd", "score": "0.53885823", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token === '\\n');\n }", "title": "" }, { "docid": "289877fdb9235ff1fc8ae221e770dabd", "score": "0.53885823", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token === '\\n');\n }", "title": "" }, { "docid": "dfbdc9133466503bba1eb8189aeaa37a", "score": "0.5388156", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token == '\\n');\n }", "title": "" }, { "docid": "dfbdc9133466503bba1eb8189aeaa37a", "score": "0.5388156", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token == '\\n');\n }", "title": "" } ]
53d78a6171125753dbb4fa6f9bb23643
The function whose prototype chain sequence wrappers inherit from.
[ { "docid": "60b30758ec0905a9c7b4f2306c8a97b3", "score": "0.0", "text": "function baseLodash() {\n // No operation performed.\n }", "title": "" } ]
[ { "docid": "1a618bf7e4de2e02b92a589805b91a65", "score": "0.59690493", "text": "function base() {}", "title": "" }, { "docid": "4444756a6cde42d5cdd4cc876f25a236", "score": "0.59504837", "text": "function F(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "5600953e08620e0c61627119dc943d2c", "score": "0.5911006", "text": "function BaseSequence() {\n return this;\n}", "title": "" }, { "docid": "6364c06a4906a91831e9ee3cca48f657", "score": "0.58796644", "text": "function c(t,e){f(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){f(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){f(t,e,n)}))}", "title": "" }, { "docid": "871212b29952f8513c9aea693eea4885", "score": "0.5781984", "text": "function s(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "46a56ed0cdf450c1c70bd0af62987a5b", "score": "0.5780153", "text": "function c(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(r){a(t.prototype,e.prototype,r)}),Object.getOwnPropertyNames(e).forEach(function(r){a(t,e,r)})}", "title": "" }, { "docid": "fce5d7ffff2d7622bee17d82af4450d6", "score": "0.57297397", "text": "function superFn(slot, args__, self, klass){\n\tvar __klass= arguments[arguments.length-1],\n\t __self= arguments[arguments.length-2],\n\t super_= __klass.super_\n\tif(!super_){\n\t\treturn\n\t}\n\tvar fn= super_.prototype[slot]\n\tif(fn){\n\t\tvar args= _slice.call(arguments, 1, arguments.length - 2)\n\t\treturn fn.apply(__self, args)\n\t}else{\n\t\targuments[arguments.length-1]= super_\n\t\treturn proto.apply(null, arguments)\n\t}\n}", "title": "" }, { "docid": "e247e304c3ed6606f96549d26221260e", "score": "0.5729398", "text": "function i(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "title": "" }, { "docid": "c1cbd0b0eff239fc465ee2301b25588b", "score": "0.5715005", "text": "function i(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "c76deffe71604bbd0cf9226808664cb6", "score": "0.5710145", "text": "function newFun() {\n\tvar fun = [].shift.call(arguments);\n\tvar obj = Object.create(fun.prototype);\n\tvar result = fun.apply(obj, arguments);\n\tconsole.log(obj,result)\n\treturn typeof result !== 'object' ? fun : result;\n}", "title": "" }, { "docid": "5d1d00a95a70bdb88dbf82f17315ab5b", "score": "0.56871474", "text": "function i(t,e){c(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){c(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){c(t,e,n)})}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "231c8231ae3dd99ed2f12e9800d53ba6", "score": "0.56635344", "text": "function getFunctionParent() {\n\t\t return this.findParent(function (path) {\n\t\t return path.isFunction() || path.isProgram();\n\t\t });\n\t\t}", "title": "" }, { "docid": "963d38b1eaafcb7fe1cfd6a7c677ec03", "score": "0.5647314", "text": "function getFunctionParent() {\n\t return this.findParent(function (path) /*istanbul ignore next*/{\n\t return path.isFunction() || path.isProgram();\n\t });\n\t}", "title": "" }, { "docid": "f951b6675075fbde6df5d76c38e467f1", "score": "0.5636636", "text": "function P() {}", "title": "" }, { "docid": "1a73117cea4ef34c9460c1482878c686", "score": "0.5627642", "text": "function r(t,e){s(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(i){s(t.prototype,e.prototype,i)}),Object.getOwnPropertyNames(e).forEach(function(i){s(t,e,i)})}", "title": "" }, { "docid": "5d1951bd05497cc6b066d1772afb32a1", "score": "0.561883", "text": "function getFunctionParent() {\n\t\t return this.findParent(function (path) /*istanbul ignore next*/{\n\t\t return path.isFunction() || path.isProgram();\n\t\t });\n\t\t}", "title": "" }, { "docid": "34e777aa662ba2bc49e3937592abc693", "score": "0.56082064", "text": "function r(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "34e777aa662ba2bc49e3937592abc693", "score": "0.56082064", "text": "function r(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "a6c6e6191a748534bca45f479a25c8f6", "score": "0.5577671", "text": "getPrototypeOf( target ) {}", "title": "" }, { "docid": "d593bc1f653d2ce812540dbae96cf736", "score": "0.5550421", "text": "function getSuperCallInConstructor(constructor){var links=getNodeLinks(constructor);// Only trying to find super-call if we haven't yet tried to find one. Once we try, we will record the result\nif(links.hasSuperCall===undefined){links.superCall=findFirstSuperCall(constructor.body);links.hasSuperCall=links.superCall?true:false;}return links.superCall;}", "title": "" }, { "docid": "d2ca4e5da69db26b30653533b1b3d644", "score": "0.55445945", "text": "function i(e,t){o(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(n){o(e.prototype,t.prototype,n)})),Object.getOwnPropertyNames(t).forEach((function(n){o(e,t,n)}))}", "title": "" }, { "docid": "db1a816a2d3fea7d7aa53876db09f123", "score": "0.554212", "text": "getPrototypeOf() {\n return null;\n }", "title": "" }, { "docid": "14e3d656bfe4056514b3d19e3cf2477f", "score": "0.5538609", "text": "function a(t,e){o(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){o(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){o(t,e,n)})}", "title": "" }, { "docid": "2aeffc454480bc107b5170a2021004ee", "score": "0.5534026", "text": "function a(e,t){o(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(n){o(e.prototype,t.prototype,n)})),Object.getOwnPropertyNames(t).forEach((function(n){o(e,t,n)}))}", "title": "" }, { "docid": "be5aa733bea098284ed76ff07505d175", "score": "0.55217654", "text": "function E() {}", "title": "" }, { "docid": "4138d266eb5c71171eb558a081cf6c1c", "score": "0.5511748", "text": "function rP(e,t){if(typeof t!=\"function\"&&t!==null)throw new TypeError(\"Class extends value \"+String(t)+\" is not a constructor or null\");function n(){this.constructor=e}z4(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "fdc14440f404af51e6b8d76b73a8685f", "score": "0.55020976", "text": "function Extends() {\n\tvar i, len;\n\tlen = arguments.length;\n\tif (typeof arguments[0] === \"function\") {// affects all arguments\n\t\tfor (i = len - 1; i >= 1; i--) {\n\t\t\tExtends.prototype.inheritFunction(arguments[i-1], arguments[i]);\n\t\t}\n\t} else {\n\t\tfor (i = 1; i < len; i++) {// affects only the first argument\n\t\t\targuments[0] = Extends.prototype.inheritObject(arguments[0], arguments[i]);\n\t\t}\n\t}\n\treturn arguments[0];\n}", "title": "" }, { "docid": "d7319f53c21f81debeff7d37d4d2266b", "score": "0.54935974", "text": "function I(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "af628243c5016bd113f7283cb9d57f1f", "score": "0.54769415", "text": "function i(n,e){function t(){this.constructor=n}o(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}", "title": "" }, { "docid": "17003d9500fbe6d31579773a95a8ac74", "score": "0.5470058", "text": "function SP(e,t){function n(){this.constructor=e}bP(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "eb38c915051536b656dc76d729530684", "score": "0.5460861", "text": "function x() {}", "title": "" }, { "docid": "eb38c915051536b656dc76d729530684", "score": "0.5460861", "text": "function x() {}", "title": "" }, { "docid": "eb38c915051536b656dc76d729530684", "score": "0.5460861", "text": "function x() {}", "title": "" }, { "docid": "1c569132eed7c2c014b5449ae1f577e2", "score": "0.5450458", "text": "function b(e,t){function n(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "870f4a5e5ebfed1fdfc5fce1cb2c4788", "score": "0.5447913", "text": "function Function$prototype$chain(f) {\n var chain = this;\n return function(x) { return f(chain(x))(x); };\n }", "title": "" }, { "docid": "ff707ef502e91fb3567a1858d7e59099", "score": "0.5443466", "text": "function R(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "351cca712c73952a91dc846dfe1c40f1", "score": "0.54398596", "text": "function i(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "ec4b2bf7bd831526cbdf022348e0d938", "score": "0.54347014", "text": "function v(t,e){function n(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "485ca154781cf4e4beea1c02b6543ffb", "score": "0.5428694", "text": "function getPrototypeChain(){\n var protoChain = [];\n var proto = this.__proto__;\n do {\n protoChain.push(proto);\n proto = proto.__proto__;\n }\n while (proto != Object.prototype)\n return protoChain;\n}", "title": "" }, { "docid": "3559ff953d9d00658e5c7228ae705d82", "score": "0.5414466", "text": "function B() {}", "title": "" }, { "docid": "3559ff953d9d00658e5c7228ae705d82", "score": "0.5414466", "text": "function B() {}", "title": "" }, { "docid": "3559ff953d9d00658e5c7228ae705d82", "score": "0.5414466", "text": "function B() {}", "title": "" }, { "docid": "750d48bb875de06bc3e02ec6d135ebaf", "score": "0.5413922", "text": "function i(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}", "title": "" }, { "docid": "c4509afdbd202dd7da4b83cb8f468939", "score": "0.5394057", "text": "function F() {} // here is created a property F.prototype (that also is an object)", "title": "" }, { "docid": "7136ee1c3f92a605421efc875c4d0095", "score": "0.5387299", "text": "function r(e){return\"function\"===typeof e}", "title": "" }, { "docid": "7136ee1c3f92a605421efc875c4d0095", "score": "0.5387299", "text": "function r(e){return\"function\"===typeof e}", "title": "" }, { "docid": "79d5448dae78c2c6e6944f76e8dda930", "score": "0.5375673", "text": "function e(e,t){function r(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "32ca554848a797e5e189c2e857d7c342", "score": "0.53749686", "text": "function r(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}", "title": "" }, { "docid": "1afa122b443150da8ed5655e8fe4d3f3", "score": "0.5373841", "text": "function C() {}", "title": "" }, { "docid": "441b8e35acba12d90d4d6df51c665f13", "score": "0.5372636", "text": "function n(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "title": "" }, { "docid": "8b6ec2df056233fe185d47d25eeb2176", "score": "0.53725433", "text": "function F(){}", "title": "" }, { "docid": "0bb19b28caf5368bbc565f9e7d443517", "score": "0.53647894", "text": "function functionName(fn){if(Function.prototype.name===undefined){var funcNameRegex=/function\\s([^(]{1,})\\(/;var results=funcNameRegex.exec(fn.toString());return results&&results.length>1?results[1].trim():\"\";}else if(fn.prototype===undefined){return fn.constructor.name;}else{return fn.prototype.constructor.name;}}", "title": "" }, { "docid": "fe2b983e0530c7a881c1cbc264879349", "score": "0.53613734", "text": "function tracePrototypeChainOf(object) {\r\n var proto = object.constructor.prototype;\r\n var result = object.constructor.name;\r\n while (proto) {\r\n result += ' -> ' + proto.constructor.name;\r\n proto = Object.getPrototypeOf(proto)\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "801d1cda8c70cd0252a99ebfc844db14", "score": "0.5358044", "text": "function r(t,n){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!n||\"object\"!=typeof n&&\"function\"!=typeof n?t:n}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5356992", "text": "function Parent() {}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5356992", "text": "function Parent() {}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5356992", "text": "function Parent() {}", "title": "" }, { "docid": "372968742bf76cdbdd22756641368d36", "score": "0.5350564", "text": "function L(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "dcf6013543d02d137a99db3034b42056", "score": "0.5337687", "text": "function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "dcf6013543d02d137a99db3034b42056", "score": "0.5337687", "text": "function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "51a6bab7ae1b300f20236012562156b8", "score": "0.5337507", "text": "function TestGeneratorFunctionPrototype() {\n // Sanity check.\n Object.getPrototypeOf(f);\n Function.prototype;\n GeneratorFunctionPrototype === Function.prototype;\n Function.prototype;\n Object.getPrototypeOf(GeneratorFunctionPrototype);\n GeneratorFunctionPrototype;\n Object.getPrototypeOf(function* () {\n ;\n });\n \"object\";\n typeof GeneratorFunctionPrototype;\n var constructor_desc = Object.getOwnPropertyDescriptor(GeneratorFunctionPrototype, \"constructor\");\n constructor_desc !== undefined;\n GeneratorFunction;\n constructor_desc.value;\n constructor_desc.writable;\n constructor_desc.enumerable;\n constructor_desc.configurable;\n var prototype_desc = Object.getOwnPropertyDescriptor(GeneratorFunctionPrototype, \"prototype\");\n prototype_desc !== undefined;\n GeneratorObjectPrototype;\n prototype_desc.value;\n prototype_desc.writable;\n prototype_desc.enumerable;\n prototype_desc.configurable;\n}", "title": "" }, { "docid": "b437f4ad81b392a89cc6200bcd95c1dd", "score": "0.5333669", "text": "function getPrototypeChain(x) {\n var res = [];\n var protos = [\n { ref: Object.prototype, name: 'Object.prototype' },\n { ref: Array.prototype, name: 'Array.prototype' },\n\n { ref: Buffer.prototype, name: 'Buffer.prototype' },\n\n { ref: ArrayBuffer.prototype, name: 'ArrayBuffer.prototype' },\n { ref: DataView.prototype, name: 'DataView.prototype' },\n { ref: Int8Array.prototype, name: 'Int8Array.prototype' },\n { ref: Uint8Array.prototype, name: 'Uint8Array.prototype' },\n { ref: Uint8ClampedArray.prototype, name: 'Uint8ClampedArray.prototype' },\n { ref: Int16Array.prototype, name: 'Int16Array.prototype' },\n { ref: Uint16Array.prototype, name: 'Uint16Array.prototype' },\n { ref: Int32Array.prototype, name: 'Int32Array.prototype' },\n { ref: Uint32Array.prototype, name: 'Uint32Array.prototype' },\n { ref: Float32Array.prototype, name: 'Float32Array.prototype' },\n { ref: Float64Array.prototype, name: 'Float64Array.prototype' },\n\n // Duktape specific prototype which provides e.g. .subarray() for all views\n { ref: Object.getPrototypeOf(Uint8Array.prototype), name: 'TypedArray.prototype' },\n true // end marker\n ];\n var i;\n\n for (;;) {\n x = Object.getPrototypeOf(x);\n if (!x) { break; }\n for (i = 0; i < protos.length; i++) {\n if (protos[i] === true) { res.push('???'); break; }\n if (!protos[i].ref) { continue; }\n if (protos[i].ref === x) { res.push(protos[i].name); break; }\n }\n }\n\n return res;\n}", "title": "" }, { "docid": "e6f4fb50a860c849ae768b8fbf3b8b34", "score": "0.5333584", "text": "function R(e,t){function r(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "fae260711e8f57412fcd6cadcecc96b8", "score": "0.5329224", "text": "function se(t,e){function r(){this.constructor=t}ae(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}", "title": "" }, { "docid": "16a838a6153df12aa94af480393b68ba", "score": "0.5327287", "text": "function o(e,t){s(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(i){s(e.prototype,t.prototype,i)})),Object.getOwnPropertyNames(t).forEach((function(i){s(e,t,i)}))}", "title": "" }, { "docid": "f6f68bdfeee024a187495f15443fa582", "score": "0.5325254", "text": "function n(e){return\"undefined\"!==typeof Function&&e instanceof Function||\"[object Function]\"===Object.prototype.toString.call(e)}", "title": "" }, { "docid": "fb089abb7f406ca856c18468815b8872", "score": "0.53205293", "text": "function nt(e,t){return\"function\"==typeof e?e.apply(null,t):e}", "title": "" }, { "docid": "660b870639eac9e820ad94238988855b", "score": "0.5313495", "text": "function g(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "006d8ba1f584c7d227636b1b9f2a744e", "score": "0.5310741", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "title": "" }, { "docid": "af22b3bf6ddc09ee67c2cdb827d50810", "score": "0.5308643", "text": "function m(e,t){function r(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "c7e5d07acef0935b821fa80a70f54f36", "score": "0.5306218", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "c7e5d07acef0935b821fa80a70f54f36", "score": "0.5306218", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "c7e5d07acef0935b821fa80a70f54f36", "score": "0.5306218", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "c7e5d07acef0935b821fa80a70f54f36", "score": "0.5306218", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "44301dd1251fea333a5c7b2819f1ef87", "score": "0.5305058", "text": "function A() {\n}", "title": "" }, { "docid": "9661ce9c829f2fbf13dcafeddab3d9c0", "score": "0.5299441", "text": "static isPrototype(value) { console.log(Object.getPrototypeOf(value) === prototype1); }", "title": "" }, { "docid": "9661ce9c829f2fbf13dcafeddab3d9c0", "score": "0.5299441", "text": "static isPrototype(value) { console.log(Object.getPrototypeOf(value) === prototype1); }", "title": "" }, { "docid": "70b90c06989a49f175ec9ce75dcba3cf", "score": "0.529858", "text": "function i(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "584d8dc28465a45de5e4d58408010375", "score": "0.52921456", "text": "function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "584d8dc28465a45de5e4d58408010375", "score": "0.52921456", "text": "function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "584d8dc28465a45de5e4d58408010375", "score": "0.52921456", "text": "function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "515ec1815b0e29edde771ed5ff628b00", "score": "0.52913815", "text": "function me(t,e){function i(){this.constructor=t}fe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}", "title": "" }, { "docid": "8eefe7de44b104a0cf5d7f2a3496c538", "score": "0.52891594", "text": "function Ml(e){return\"function\"==typeof e}", "title": "" }, { "docid": "2eb293ccf72b3411ef8ae3c7d8207f2d", "score": "0.52864087", "text": "function s(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "96243b2bd7de1ee6db44cc26522af327", "score": "0.52812517", "text": "function v(){f.call(this)}", "title": "" }, { "docid": "a7012e8f6bc2cbfb027338d05b80e647", "score": "0.52688104", "text": "function y(){f.call(this)}", "title": "" }, { "docid": "a7012e8f6bc2cbfb027338d05b80e647", "score": "0.52688104", "text": "function y(){f.call(this)}", "title": "" }, { "docid": "6bbb346a2999c1ff3595d7efaf3680fe", "score": "0.52686256", "text": "function tt(e,t){if(typeof t!=\"function\"&&t!==null)throw new TypeError(\"Class extends value \"+String(t)+\" is not a constructor or null\");function n(){this.constructor=e}l4(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "520ce945b79b4834e488edd6b126bcd0", "score": "0.52662987", "text": "function bla () {}", "title": "" }, { "docid": "ec72766066f5dddc0f8cf72145600568", "score": "0.52641535", "text": "function eo(t,e){no(t,e),Object.getOwnPropertyNames(e.prototype).forEach((n) => {no(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach((n) => {no(t,e,n)})}", "title": "" } ]
0feab3e4edd9a8f31c08c16793a68206
show Post in DOM
[ { "docid": "13d8858319ad4d6ad06d3a9e0002d8b1", "score": "0.70666", "text": "async function showPosts() {\n const posts = await getPosts();\n\n posts.forEach((post) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = ` <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">\n ${post.body}\n </p>\n </div>`;\n\n postsContainer.appendChild(postEl);\n });\n}", "title": "" } ]
[ { "docid": "fb777a3cdf37d0b926d71a0256f98064", "score": "0.7566944", "text": "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"post/post.html\");\n let css = await fetch(\"post/post.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._app.setPageTitle(\"Neuen Post\", {isSubPage: true});\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n\n let submitBtn = document.getElementById(\"button-submit\");\n submitBtn.addEventListener(\"click\", function (){save();});\n\n db=this._app;\n // Fertig bearbeitetes HTML-Element zurückgeben\n return pageDom;\n }", "title": "" }, { "docid": "6869e68722bbb3e0148c935393de719a", "score": "0.75520885", "text": "function showNewPost(post) {\n\n\t}", "title": "" }, { "docid": "aeb3480b1899f27f5ca39b8cf2a5caaa", "score": "0.752679", "text": "async function showPost() {\n const posts = await getPosts();\n posts.forEach(post => {\n const postElement = document.createElement('div');\n postElement.classList.add('post');\n postElement.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">\n ${post.title}\n </h2>\n <p class=\"post-body\">\n ${post.body}\n </p>\n </div>\n `;\n postsContainer.appendChild(postElement)\n })\n}", "title": "" }, { "docid": "d14e4588d7b945fc75713bde9d5af18c", "score": "0.728404", "text": "async function showPosts() {\n\tconst posts = await getPosts();\n\n\tposts.forEach(post => {\n\t\tconst postEl = document.createElement('div');\n\t\tpostEl.classList.add('post');\n\t\tpostEl.innerHTML = `\n\t\t<div class=\"number\">${post.id}</div>\n\t\t<div class=\"post-info\">\n\t\t\t<h2 class=\"post-title\">${post.title}</h2>\n\t\t\t<p class=\"post-body\">${post.body}</p>\n\t\t</div>`;\n\n\t\tpostsContainer.appendChild(postEl);\n\t});\n}", "title": "" }, { "docid": "88a2969f685ce79fdc7a8d78aac5c514", "score": "0.70851004", "text": "async function showPosts() {\n let posts = await getPosts();\n\n posts.forEach(post => {\n const postEl = document.createElement('div');\n postEl.classList.add('post');\n postEl.innerHTML = `\n <div class=\"post-number\" id=\"post-number\">${post.id}</div>\n <div class=\"post-info\">\n <h3 class=\"post-title\">${post.title}</h3>\n <p class=\"post-body\">${post.body}</p>\n </div>\n `;\n\n postsContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "71c8434d6bb93e4340341efe78829e34", "score": "0.7076859", "text": "async function showPosts() {\n const posts = await getPosts();\n // console.log(posts);\n\n posts.forEach(post => {\n const postElement = document.createElement('div');\n postElement.classList.add('post');\n postElement.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <hr>\n <p class=\"post-body\">\n ${post.body} \n </p>\n </div>\n `;\n // make data visible on DOM\n postContainer.appendChild(postElement);\n\n });\n}", "title": "" }, { "docid": "8b24ba56a27231b4fd280b073edb5a06", "score": "0.7030541", "text": "function renderOnePost(post) {\n\n const mainContainer = document.querySelector('.js-to-hide');\n mainContainer.style.display = \"none\";\n\n\n const postContainer = document.querySelector('.js-one-post');\n postContainer.style.display = \"block\";\n\n postContainer.innerHTML = '';\n \n const div = document.createElement('div');\n postContainer.innerHTML = `\n <a href=\"../index.html\">Back to home</a>\n <header>\n <img class=\"image fit\"src=\"images/${post.data.image}\" alt=\"\" />\n <h2>${post.data.title}</h2>\n <p>${post.data.post}</p>\n </header>\n <section>\n <hr />\n <header>\n <p></p>\n </header>\n </section>\n <div id=\"disqus_thread\"></div>\n\n `;\n postContainer.appendChild(div);\n // };\n }", "title": "" }, { "docid": "b373ed16a95aa71ed825c05e16e3322b", "score": "0.70002764", "text": "function post_post(post) {\n let p = document.createElement('p');\n p.innerHTML = `${post.name} (${post.time}): ${post.content}`;\n p.setAttribute('class', 'post_content');\n document.querySelector('#postbox').append(p);\n return;\n}", "title": "" }, { "docid": "ace235e1d49b80edbf4bd7e24f4a18a0", "score": "0.6954716", "text": "function showPost(id){\n\t$(\"#status-body-full\"+id).show();\n\t$(\"#status-body-less\"+id).hide();\n\t$(\"#read-more\"+id).hide();\n}", "title": "" }, { "docid": "a796272097f87a98fec6b03d03fe78d0", "score": "0.69204336", "text": "async function showPosts() {\n const posts = await getPosts();\n\n // we take each post item in the array and loop through with the forEach and create the html and content\n posts.forEach(post => {\n const postEl = document.createElement('div');\n postEl.classList.add('post');\n postEl.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">${post.body}</p>\n </div>\n `;\n\n // we then append the item to the page\n postContainer.appendChild(postEl);\n })\n}", "title": "" }, { "docid": "895c2d98c311af7dc4ab3906fa9904d8", "score": "0.6861604", "text": "function displaySelectedPost(index)\r\n{\r\n\tconsole.log(\"displaySelectedPost\");\r\n\t\r\n\t// call DisplayPostByIndex to display \r\n\t// the requested Post and render it.\r\n\tDisplayPostByIndex(index);\r\n\trenderAgain();\t\r\n}", "title": "" }, { "docid": "4e005a2ae794ae74454e0a3b47195dd3", "score": "0.6851322", "text": "function renderPost(post) {\n return $(`\n <div class=\"post-card\">\n <header>\n <h3>${post.title} </h3>\n <h4>~ By ${post.user.username}</h4>\n </header>\n <p>${post.body}</p>\n <footer>\n <div class=\"comment-list\"></div>\n <a href=\"#\" class=\"toggle-comments\">(<span class=\"verb\">show</span> comments)</a>\n </footer>\n </div>\n `).data('post', post);\n}", "title": "" }, { "docid": "c941ef50a05107dbe629842125a6ddfd", "score": "0.6844944", "text": "function openPost(post){\n\tvar parentDiv = post.parentNode.parentNode;\n\tconst postId = parentDiv.getAttribute(\"id\") \n\tsetPostDetails(postId);\n\twindow.location=\"../html/post.html?postId=\" + postId;\n}", "title": "" }, { "docid": "8081debcee6714b53d4c4ecbfc00ee36", "score": "0.68227506", "text": "showPosts(posts){\n let html = '';\n\n posts.forEach(function(post){\n html += `\n <div class=\"card mb-3\">\n <div class=\"card-body\">\n <h4 class=\"card-title\">${post.title}</h4>\n <p class=\"card-text\">${post.body}</p>\n <a href=\"#\" class=\"edit card-link\" data-id=\"${post.id}\">\n <i href=\"#\" class=\"fa fa-edit\"></i>\n </a>\n <a href=\"#\" class=\"delete card-link\" data-id=\"${post.id}\">\n <i href=\"#\" class=\"fa fa-times\"></i>\n </a>\n </div>\n </div>\n `;\n })\n\n this.posts.innerHTML = html;\n }", "title": "" }, { "docid": "a5b736fc3e223850277ca2c32cdb7a4d", "score": "0.6815198", "text": "async function showPosts() {\n const posts = await getPosts();\n console.log(posts);\n\n posts.forEach((p) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = `\n <div class=\"number\">${p.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${p.title}</h2>\n <p class=\"post-body\">${p.body}</p>\n </div>\n`;\n postsContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "9c50eefbbaa93175bed74a3fbc59ae34", "score": "0.67921615", "text": "async function showPosts(){\n // async wait for AJAX call to get posts\n const posts = await getPosts();\n\n // for every post in our AJAX call we create a DOM element and insert\n // the post data to our created DOM element (DOM element = post)\n posts.forEach(post => {\n const postEl = document.createElement('div');\n postEl.classList.add('post');\n \n postEl.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">${post.body}</p>\n </div>`\n ;\n\n postsContainer.appendChild(postEl);\n })\n}", "title": "" }, { "docid": "ec12c2ca07ec3bad7daabf70f0906523", "score": "0.6732168", "text": "function displayPagePost() {\n $(pagePostSelector).css('width', $(canvasSelector).width() - $(blockSelector).first().outerWidth());\n $(pagePostSelector).css('left', $(blockSelector).first().outerWidth());\n $(pagePostSelector).css('display', 'block');\n}", "title": "" }, { "docid": "e2fe64099e6c38815e02b7dc1ba11ec8", "score": "0.6714053", "text": "function showPostById(id) {\n\t\tconsole.log(\"loading id: \", id)\n\t\tdb.get(id).then(function(doc) {\n\t\t\tshowSinglePost(doc.title, doc.content, doc.author, doc._id)\n\t\t}).catch(function(err) {\n\t\t\tconsole.log(\"error showing post\")\n\t\t})\n\t}", "title": "" }, { "docid": "7f7af7ea9adde6a24216ff91e1eeab98", "score": "0.66865975", "text": "function showPosts() {\n body.innerHTML = ''\n //========postsDiv creation\n const postsDiv = document.createElement('div')\n postsDiv.setAttribute('id', 'posts')\n //========logoutBtn creation\n const logoutBtn = document.createElement('button')\n logoutBtn.innerHTML = 'Logout'\n logoutBtn.setAttribute('id', 'logout')\n logoutBtn.setAttribute('class', 'button')\n //======= appending body to child\n body.append(logoutBtn)\n body.append(postsDiv)\n\n fetchPosts();\n}", "title": "" }, { "docid": "93891e508d03aa17442344f7b98bc665", "score": "0.66797465", "text": "function display_posts() {\n \tpost_array.forEach(function(item){\n \t\tinsertpost = \"<div id='user-post'>\" +\n\t\t\t\t\t\t\t\"<a id='post-user'>\" + item.author + \"</a>\" +\n\t\t\t\t\t\t\t\"<a id= 'delete'> x </a>\" +\n\t\t\t\t\t\t\t\"<div id='content'>\" + item.content + \"</div>\" +\n\t\t\t\t\t\t\t\"<div id= 'date'>\" + item.date + \"</div>\" +\n\t\t\t\t\t\t \"</div>\"\n\t\t$(\"#posts\").append(insertpost);\n \t});\n }", "title": "" }, { "docid": "e50b70343b2da9934aa699574d355893", "score": "0.6647103", "text": "function eachfor(post) {\n\t\tvar littlePost = \"\"\n\n\t\tlittlePost = $(post.doc.content).text().slice(0, 300)\n\n\t\t$('#postArea').append(\" <div class='row'><div class='col-md-8 col-md-offset-2' >\" +\n\t\t\t\" <div class='col-md-4' >\" +\n\t\t\t\"<a href='#' class='thumbnail'> \" +\n\t\t\t\"<img src='\" + post.doc.mainimg + \"' alt=''>\" +\n\t\t\t\" </a> \" +\n\t\t\t\"</div>\" +\n\t\t\t\" <div class='col-md-8'>\" +\n\t\t\t\" <h3>\" + post.doc.title + \"</h3>\" +\n\t\t\t\"</div>\" +\n\t\t\t\"<div class='col-md-8 col-md-offset-0'>\" +\n\t\t\t\" <p>\" + littlePost + \"</p><a href='#'><h5 class='text-right' id='showPostButton_\" + post.doc._id + \"'>Read more...</h5></a> \" +\n\t\t\t\"</div>\" +\n\t\t\t\"</div>\" +\n\t\t\t\"</div>\")\n\t\tvar singlePost = post.doc\n\n\t\t$('#showPostButton_' + post.doc._id).on('click', function(e) {\n\t\t\t//svinei to periexomeno prwta\n\t\t\t$('#postArea').html('');\n\t\t\tshowSinglePost(singlePost.title, singlePost.content, singlePost.author, singlePost._id)\n\t\t\t// db.get(post.doc._id).then(function (singlePost) {\n\n\t\t\t// showSinglePost(singlePost.title, singlePost.content, singlePost.author, singlePost._id)\n\n\t\t\t// })\n\n\t\t})\n\t}", "title": "" }, { "docid": "a0676b32c12e0e5a60862254136b776b", "score": "0.6638684", "text": "function showSinglePost(title, cont, author, id) {\n\t\tlocation.hash = id\n\t\t//apends html elements that shoes a post\n\t\t$('#postArea').append(\"<div class='row'><div class='col-md-12'><h3>\" + title +\n\t\t\t\"</h3><p>\" + cont + \"</p><span class='badge'>Author</span><small>\" + author +\n\t\t\t\"</small></div></div>\" +\n\t\t\t\"<br><div class='row'><div class='col-md-4'>\" +\n\t\t\t\"<textarea class='form-control' id='textComArea' rows='3' placeholder='Write your Comment!' ></textarea><h6>Comments</h6>\" +\n\t\t\t\"<br><ul id=ul_com_\" + id + \"></ul></div></div>\")\n\n\t\t//a a jquery function that triggers when a comment is adeed\n\t\t$(\"#textComArea\").on('keypress', function(e) {\n\t\t\tif (e.keyCode == 13) {\n\t\t\t\tvar com = $(this).val()\n\t\t\t\tvar replaced = escapeSelector(id)\n\t\t\t\t$(\"#ul_com_\" + replaced).append(\"<li>\" + com + \"</li>\")\n\t\t\t\tconsole.log('its ok')\n\t\t\t\taddComm(com, id)\n\t\t\t\t$(this).val('')\n\t\t\t}\n\t\t})\n\t\tshowComment(id)\n\t\tconsole.log('dsd')\n\t}", "title": "" }, { "docid": "5ed97372323cd706718a79a2a07086e6", "score": "0.66178167", "text": "async function showPosts() {\n const posts = await getPosts();\n posts.forEach(post => {\n const postEl = document.createElement('article');\n postEl.classList.add('article');\n postEl.innerHTML = `\n <article class=\"article article_style_profile\" id=\"article_style_profile\">\n <img src='https://picsum.photos/490/490' width=490 height=490 class=\"article__picture\">\n <div class=\"article__content\">\n <h3 class=\"article__title\">${post.title}</h3>\n <p class=\"article__text\">${post.body}</p>\n <a href=\"/${post.id}\" class=\"article__link\">download profile</a>\n </div>\n </article>\n `;\n articleContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "75710a407fda157633fbd85b5a3d88c7", "score": "0.6591229", "text": "function showPosts() {\n fetch(\"https://shrouded-temple-45259.herokuapp.com/show-posts/\", {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then((res) => res.json())\n .then((data) => {\n console.log(data);\n posts = data.data;\n console.log(posts);\n let postNo = 0;\n posts.forEach((post) => {\n console.log(post);\n document.querySelector(\n \".post-container\"\n ).innerHTML += `<div class=\"post\" id=\"${post[0]}\" >\n <div class=\"post-image\"><img class=\"image\" src=\"${post[1]}\" alt=\"${post[2]}\" /></div>\n <div class=\"right\">\n <h2 class=\"title\">${post[2]}</h2>\n <h3 class=\"author\">Written by ${post[6]}</h3>\n <h4 class=\"dateCreated\">${post[7]}</h4>\n <button class=\"viewPost\">View Post</button>\n </div> \n </div>`\n postNo += 1\n document.querySelectorAll('.viewPost').forEach((button) => {\n button.addEventListener('click', (e) => {\n viewPost(e.currentTarget.parentElement.parentElement.id)\n let post = document.querySelector('.postModalContainer')\n post.classList.toggle('hide');\n post.classList.toggle('closePost')\n document.body.classList.toggle('disable');\n window.location.href = '#top'\n })\n })\n });\n });\n}", "title": "" }, { "docid": "b9f684eb15b2aae2a02b2adf8e6f744a", "score": "0.65833545", "text": "function show(data) {\n createContent(data, \"#entry-template\", '#content');\n save(data);\n }", "title": "" }, { "docid": "7952db1a6f3bb43ed665d93f6efd7ac5", "score": "0.6536489", "text": "async function showPosts() {\r\n try {\r\n toggleLoading(\"add\")\r\n const posts = await getPosts()\r\n toggleLoading(\"remove\")\r\n posts.forEach((post) => {\r\n postEl = document.createElement(\"div\")\r\n postEl.classList.add(\"post\")\r\n postEl.innerHTML = `\r\n <div class=\"number\">${post.id}</div>\r\n <div class=\"post-info\">\r\n <h2 class=\"post-title\">${post.title}</h2>\r\n <p class=\"post-body\">${post.body}</p></div>`\r\n\r\n postsContainer.appendChild(postEl)\r\n })\r\n } catch (error) {\r\n console.log(error)\r\n }\r\n}", "title": "" }, { "docid": "8a705448fe14870499675c3d7141467c", "score": "0.65228593", "text": "showMyPost() {\n\n KinveyRequester.findAllPosts()\n .then(loadPostsSuccess.bind(this));\n\n function loadPostsSuccess(posts) {\n this.showInfo(\"Post loaded.\");\n\n let myPosts = posts.filter(post => (post._acl.creator === sessionStorage.getItem('userId')));\n this.showView(\n <MyPostsView\n posts={myPosts}\n userId={this.state.userId}\n editPostClicked={this.preparePostForEdit.bind(this)}\n deletePostClicked={this.confirmPostDelete.bind(this)}\n viewDetailsClicked={this.showViewDetails.bind(this)}\n />\n )\n\n }\n }", "title": "" }, { "docid": "2bc7ffdf417837b355021133162f926d", "score": "0.6519103", "text": "function renderPosts(posts) {\n\n // Get the DOM element that will contain the posts.\n var postsDiv = document.getElementById(\"posts\");\n\n posts.forEach(function (post) {\n\n // Create the DOM elements.\n var postDiv = document.createElement(\"div\"),\n postNameDiv = document.createElement(\"a\"),\n postContentDiv = document.createElement(\"div\");\n\n // Set the content of each element.\n postNameDiv.innerHTML = post.name;\n postNameDiv.setAttribute('href', \"#post\" + post.id);\n postContentDiv.innerHTML = post.content;\n\n // Set CSS classes on each div so they can be styled.\n postDiv.setAttribute(\"class\", \"post\");\n postNameDiv.setAttribute(\"class\", \"post-name\");\n postContentDiv.setAttribute(\"class\", \"post-content\");\n\n // Assemble the post div.\n postDiv.appendChild(postNameDiv);\n postDiv.appendChild(postContentDiv);\n\n // Add the post div to the container for posts.\n postsDiv.appendChild(postDiv);\n });\n }", "title": "" }, { "docid": "19483387a33954e9d105f1f738a9a376", "score": "0.6517762", "text": "function render(posts) {\n\n const container = document.querySelector('.js-blogPosts');\n container.innerHTML = '';\n const postsReverse = posts.reverse();\n for (const post of postsReverse) {\n\n const div = document.createElement('div');\n div.innerHTML = `\n <article class=\"container box style1 right postinput blogBox\">\n <img class=\"image fit\"src=\"images/${post.data.image}\" alt=\"\" />\n <div class=\"inner\">\n <header>\n <h2><a href=\"#/post/${post.id}\">${post.data.title}</a></h2>\n </header>\n <p class=\"previewText\">${post.data.post}</p>\n <span><a href=\"#/post/${post.id}\">-Read more</a></span>\n </div>\n </article>\n `;\n container.appendChild(div);\n };\n }", "title": "" }, { "docid": "0788085aad91912d2804f480f96b77a3", "score": "0.64808786", "text": "function createPost () {\n list.html(null);\n $.post( URL + '/posts', { \n title: 'Kobe is the best player',\n body: 'and this is why...'}, \n function(response){\n var li = $('<li> Post Title: ' + response.title + '<br>Post Body: ' + response.body + '<br>Post ID: ' + response.id + '</li>')\n list.append(li);\n });\n content.html(list);\n }", "title": "" }, { "docid": "2d7cdf09172c41ec80d094a5b09fc6d9", "score": "0.6476794", "text": "showNewPosts(){const newPosts=this.newPosts;this.newPosts={};this.newPostsButton.hide();const postKeys=Object.keys(newPosts);for(let i=0;i<postKeys.length;i++){this.noPostsMessage.hide();const post=newPosts[postKeys[i]];const postElement=new friendlyPix.Post;this.posts.push(postElement);this.feedImageContainer.prepend(postElement.fillPostData(postKeys[i],post.thumb_url||post.url,post.text,post.author,post.timestamp,null,null,post.full_url))}}", "title": "" }, { "docid": "50dfc9061cac2ead86ffa5eb8cb8a436", "score": "0.64696544", "text": "function post() {\n $.post('php/post.php', {}, function(data, status) {\n $('#main_content').html(data)\n show_post()\n })\n}", "title": "" }, { "docid": "46c65ebd9392e4c03185721b6c547c72", "score": "0.643286", "text": "function renderPosts(data) {\n post1.innerHTML = null;\n const cardBox = document.createElement(\"h3\");\n cardBox.textContent = \"POSTS\";\n post1.appendChild(cardBox);\n\n data.forEach((element) => {\n const postUser = userTrid.cloneNode(true);\n const postTitle = postUser.querySelector(\".title-turn\");\n postTitle.textContent = element.title;\n postTitle.dataset.post_id = element.id;\n postUser.querySelector(\".desk\").textContent = element.body;\n post1.appendChild(postUser);\n });\n}", "title": "" }, { "docid": "f9f3d3b3595e3a0ff0df525e1ed3358f", "score": "0.64031696", "text": "function displayPosts(data) {\n console.log(data);\n postsSection.textContent = \"\";\n data.forEach((post) => {\n const postDiv = document.createElement(\"div\");\n const header = document.createElement(\"p\");\n const body = document.createElement(\"p\");\n header.textContent = `\"${post.title}\" from ${post.pseudonym} posted on ${post.date}`;\n body.textContent = post.body;\n postDiv.append(header);\n postDiv.append(body);\n postsSection.append(postDiv);\n });\n}", "title": "" }, { "docid": "690f530a7c78292389372b78778d0726", "score": "0.64003897", "text": "function getContent(e){\n\t\te.preventDefault();\n\n\t\tpostBox.innerHTML = preloaderCreator();\n\t\tlet page = data.page || 0;\n\t\tdata = getFormData(form);\n\t\tdata.page = page;\n\t\tdata.show = +data.show || 0;\n\t\tsetParamsToURL(data);\n\n\t\tgetPosts(data);\n\t}", "title": "" }, { "docid": "828f6671a29afd3b52e69d3b57fc88a3", "score": "0.63701963", "text": "function showPosts( postsObject ) {\n\t\tvar columnWrapper;\n\n\t\t// Create columns element if new request.\n\t\tif ( postsObject.add == false ) {\n\t\t\tcolumnWrapper = columnBuilderObject.buildColumns();\n\t\t\t\n\t\t\t// Title.\n\t\t\t//jQuery( '<h1>' + postsObject.heading + '</h1>' ).appendTo( '#post-wrapper' );\n\t\t\t\n\t\t\tcolumnWrapper.getWrapper().appendTo( '#post-wrapper' );\n\t\t\t\n\t\t\t// Add posts to DOM\n\t\t\tjQuery.each( postsObject.postArray, function( index, post ) {\n\t\t\t\tcolumnWrapper.addPost( post );\n\t\t\t});\n\t\t} else {\n\t\t\tcolumnWrapper = jQuery( '#column-wrapper' );\n\t\t\t\n\t\t\tcolumns = jQuery( '.column' );\n\t\n\t\t\tjQuery.each( postsObject.postArray, function( index, post ) {\n\t\t\t\t// Find Smallest columns and add post to it.\n\t\t\t\tsmallest = jQuery( '.column-one' );\n\n\t\t\t\tjQuery.each( columns, function() {\n\t\t\t\t\tif( jQuery(this).height() < smallest.height() ) {\n\t\t\t\t\t\tsmallest = jQuery(this);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\n\t\t\t\tpost.appendTo( smallest );\n\t\t\t});\n\t\t}\n\t\t\n\t\t// Fade posts in one by one.\n\t\tfadePostsIn( postsObject.postArray );\n\t\t\n\t\t// Adjust load more link. By removing the link (if present) then\n\t\t// re-attaching it (if needed) avoids having to adjust it.\n\t\tjQuery('#load-more').remove();\n\t\tif ( postsObject.hasOwnProperty( 'next' ) ){\n\t\t\tvar more = jQuery( '<div id=\"load-more\"><a href=\"\" data-next=\"' + postsObject.next + '\">LOAD MORE...</a></div>' );\n\t\t\tmore.appendTo( '#post-wrapper' );\n\t\t\teventHandlers.loadMoreHandler( postsObject );\n\t\t}\n\t}", "title": "" }, { "docid": "9656ec14ed9b3e483d5dbecd5dabe5c6", "score": "0.6342373", "text": "function showNotes() {\n // Clear the current HTML list of posts using the jQuery [empty](http://api.jquery.com/empty/) function \n $(\"#postings\").empty();\n // Set the new HTML list of posted notes\n // - get the HTML template 'post-template' in SCRIPT element on the page\n var template = $(\"#post-template\").html();\n // - render into HTML \n var html = Mustache.render(template, model);\n // - insert the HTML into the HTML element 'postings'\n $(\"#postings\").html(html);\n\n }", "title": "" }, { "docid": "8c399aecb5f22de4a63f771cc0e0790f", "score": "0.63156605", "text": "function DisplayPostByIndex(index)\r\n{\r\n\tconsole.log(\" -- DisplayPostByIndex -- \");\r\n\t\r\n\t// error checks\r\n\tif ((index > (m_postList.length-1)) || (index < 0))\r\n\t{\r\n\t\talert(\"Invalid index requested.\");\r\n\t}\r\n\t\r\n\t// callBack function to update DOM with response data.\r\n\tvar cbDisplayCallBack = function(){\r\n\t\tconsole.log(\" -- cbDisplayCallBack -- \");\r\n\t\tvar postElement = document.getElementById(\"blogContent\");\r\n\t\tpostElement.innerHTML = m_LatestXMLHTTPRequestData;\r\n\t\t// render Again\r\n\t\trenderAgain();\r\n\t\t// update navigation controls.\r\n\t\tupdateNavgControls();\r\n\t}\r\n\t\r\n\tvar url = m_rootBlogDir + m_postList[index].path + m_postList[index].page;\r\n\tconsole.log(\"url:\" + url);\t\r\n\tGetFileFromServer(url,cbDisplayCallBack,false);\r\n\t\r\n\t// Render the Newer post.\r\n\tconsole.log(\"New Post displayed. renderAgain will be called\");\r\n\trenderAgain();\r\n\t\r\n\t/* Update m_currDisplayedPostIndex\r\n\t\tto reflect that this page is requested.\r\n\t\tThis, shall be used later on to update controls.\r\n\t*/\r\n\tm_currDisplayedPostIndex = index;\r\n}", "title": "" }, { "docid": "268f7018e08e6e9485a5a88d602c2895", "score": "0.6266211", "text": "function showPosts(posts, more){\n var title=\"LIVE FEED\";\n var subtitle=\"Join our live feed to share your #outoftheordinary moments.\";\n var feed = \"\";\n var group = container; \n i=-1;\n j=0;\n if(posts.length > 0){\n if(more){\n group = group + createContainer(posts[j],i);\n j=1;\n }else{\n group = group + createItemDiv(i) + createFirstImageText(title,subtitle)+\"</div>\";\n }\n i++;\n while(j<posts.length){\n if(i==4 || i==10){\n group = group + createItemDiv(i)+ createBanner()+\"</div>\"\n i++;\n }\n if (i == 15){\n group = group;\n i=0;\n }else{\n group = group + createContainer(posts[j],i);\n i++;\n }\n j++;\n }\n }\n feed = more?feed+group:feed+group+\"</div>\";\n $(\"#posts\").append(feed);\n packery();\n revealOnScroll();\n}", "title": "" }, { "docid": "a4ce2bcecc0cb6fe0b86fe6e973ace56", "score": "0.62582403", "text": "function commandBtnShow(){\n show(document.getElementById(\"Postit\"));\n writeInPostIt(\"Merci d'afficher le Post It.\" , document.getElementById(\"Postit\"));;\n }", "title": "" }, { "docid": "fcad71d0f17f0c7d7ec8d3296a22788f", "score": "0.62546647", "text": "function viewPost() {\n let selectedPostId = $('#posts').val();\n if(!selectedPostId){\n return; // If there is no selected option we shouldn't do anything\n }\n\n let loadPostPromise = request('/posts/' + selectedPostId);\n let loadPostCommentsPromise = request('/comments/' + `?query={\"post_id\":\"${selectedPostId}\"}`);\n\n // The execution is syncronous (the promises are executed from first to last)\n Promise.all([loadPostPromise, loadPostCommentsPromise])\n .then(displayPostAndComments)\n .catch(handleError);\n }", "title": "" }, { "docid": "46ba37e7caa317af5703512932a66bf6", "score": "0.62352496", "text": "function viewPost(id) {\n var owner= document.getElementById(`postowner-${id}`).textContent;\n var title = document.getElementById(`posttitle-${id}`).textContent;\n var info = document.getElementById(`postbody-${id}`).textContent;\n var postdetails = {\n \"owner\": owner,\n \"title\": title,\n \"info\": info\n };\n sessionStorage.setItem(\"postdetails\", JSON.stringify(postdetails));\n window.location.href = \"post.html\";\n}", "title": "" }, { "docid": "3185bb6c76bfb082e9969a868bab4612", "score": "0.6218896", "text": "function renderBlog(posts) {\n const postContainer = $('<ul></ul>');\n posts.fetch({\n success: () => {\n posts.forEach((post, i, arr) => {\n //should have used .get for these\n let singlePost = (`\n <li>\n <h1>${post.attributes.title}</h1>\n <p>${post.attributes.body}</p>\n </li`);\n console.log('*');\n postContainer.append(singlePost);\n });\n }\n });\n return postContainer;\n}", "title": "" }, { "docid": "ad705f9d17cf63f11d4446c1fff42251", "score": "0.6214824", "text": "async function viewPost() {\n const postId = postsData.value;\n\n let postTilteElement = document.getElementById('post-title');\n let postBodyElement = document.getElementById('post-body');\n let postCommentsList = document.getElementById('post-comments');\n\n await fetch(`${baseUrl}.json`)\n .then(parseData())\n .then(data => {\n for (const key in data) {\n if(key === postId){\n let [postBody, postId, title] = Object.values(data[key]);\n for (const secondKey in data[key]) {\n let [body, id, title] = Object.values(data[key][secondKey]);\n const option = document.createElement(\"option\");\n option.value = key;\n option.id = key;\n option.innerHTML = title;\n postsData.appendChild(option);\n }\n }\n }\n })\n .catch(printError());\n }", "title": "" }, { "docid": "eb534d8d0268d8ebc5bbf1e9e90b0469", "score": "0.6213097", "text": "function postAppender( post ){\n\t$(\"<div id=status-id_\"+post.post_id+\" class='box status'><div id='Status_head'><img alt='S.writer' src='user-pics/\"+ post.user_profile_picture +\"'><div><a href='profile.php?id=\"+ post.user_id +\"'>\"+ post.user_firstname + \" \" + post.user_lastname +\"</a><br><a href='post.php?post-id=\"+post.post_id+\"'><span class='postSince'>\"+ post.post_time_ago +\"</span></a></div></div><div id='status_content'><p>\"+ post.post_content +\"</p></div><div id='status_footer'>\" +\n\t\t\t\"<div class='comments-head'><span id='like' data-id='\"+post.post_id+\"' class='like'>Like</span>-<span>Comments</span><div id='the-likes'></div></div>\" +\n\t\t\t\"<div id='comments'></div><div id='comment-area'><img alt='me' class='profile-photo'><textarea placeholder='Leave a comment...' data-stid='\"+post.post_id+\"'></textarea></div></div></div>\").appendTo(\"#posts\").hide().fadeIn();\n}", "title": "" }, { "docid": "a6f5923ab83fa16e136d709f267da815", "score": "0.6210288", "text": "showNewPosts() {\n const newPosts = this.newPosts;\n this.newPosts = {};\n this.newPostsButton.hide();\n const postKeys = Object.keys(newPosts);\n\n for (let i = 0; i < postKeys.length; i++) {\n this.noPostsMessage.hide();\n const post = newPosts[postKeys[i]];\n const postElement = new Post(this.firebaseHelper, postKeys[i]);\n this.posts.push(postElement);\n this.feedImageContainer.prepend(postElement.postElement);\n postElement.fillPostData(postKeys[i], post.thumb_url ||\n post.url, post.text, post.author, post.timestamp, null, null, post.full_url);\n }\n }", "title": "" }, { "docid": "9aff350804a0c40e2ea674ba728d71c9", "score": "0.6176599", "text": "function get_full_post(id, title, body){\n document.getElementById(\"full_post_col\").style.display = \"block\";\n var full_Post = document.getElementById(\"full_post\");\n full_Post.innerHTML = \"\";\n\n var post_List = document.getElementById(\"read_blog\");\n post_List.className = \"col-lg-6 col-md-6 col-sm-12 col-xs-12\";\n\n var post_Content = document.createElement(\"div\");\n var post_Title = document.createElement(\"h4\");\n post_Title.innerHTML = title;\n post_Content.appendChild(post_Title);\n \n var post_Body = document.createElement(\"p\");\n post_Body.innerHTML = body;\n post_Content.appendChild(post_Body);\n\n var post_Comment = document.createElement(\"div\");\n full_Post.appendChild(post_Content);\n\n show_comments(id);\n}", "title": "" }, { "docid": "2648e8c248b01178524f3a6e7d28347a", "score": "0.6167585", "text": "function getPosts(){\n\tvar query = new Parse.Query(Post);\n\tquery.include(\"User\");\n\tquery.find({\n\t\tsuccess: function(results){\n\n\t\t\tvar output = \"\";\n\t\t\tfor (var i in results) {\n\t\t\t\tvar title \t\t= results[i].get(\"title\");\n\t\t\t\tvar content \t= results[i].get(\"content\");\n\t\t\t\tvar author_name = results[i].get(\"user\");\n\t\t\t\tvar author \t\t= author_name.get(\"username\");\n\t\t\t\tvar id \t\t\t= results[i].id;\n\n\t\t\t\t// console.log(results[i].get(\"file\"));\n\t\t\t\tvar image = \"\";\n\t\t\t\tif (results[i].get(\"file\")) {\n\t\t\t\t\tvar file = results[i].get(\"file\");\n\t\t\t\t\tvar url = file.url();\n\t\t\t\t\t// console.log(url);\n\t\t\t\t\tvar image = \"<image class = 'image-preview' src = '\" + url + \"'>\"; \n\t\t\t\t}\n\n\t\t\t\toutput += \"<li> <hr class = 'fancy-hr' />\";\n\t\t\t\toutput += \"<h4> <a id = 'showPost-link' href = '\" + id + \"'>\" + title + \"</a></h4>\";\n\t\t\t\t// output += \"<small>\" + \" Author: &nbsp;\" + author + \"</small>\";\n\t\t\t\t// output += image;\n\t\t\t\t// output += \"<p>\" + content + \"</p>\";\n\t\t\t\toutput += \"</li>\";\n\t\t\t}\n\t\t\t$(\"#list\").html(output);\n\t\t},\n\t\terror: function(error){\n\t\t\tconsole.log('Query error...' + error.message);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d386ced4b8f1dabe5738e2d56f2ddca5", "score": "0.61564934", "text": "async showPost(req, res, next) {\n\t\tlet display = await Display.findById(req.params.id);\n\t\tres.render('displays/show', { display });\n\t}", "title": "" }, { "docid": "da7422dc475dc7dd322520a51a7a0fa4", "score": "0.6155295", "text": "function makePost(e) {\n e.preventDefault();\n setPost();\n console.log(titleRef.current.value);\n console.log(contentRef.current.value);\n }", "title": "" }, { "docid": "e72435a31b8921157028650343da5660", "score": "0.6147127", "text": "openNewPost() {\n this.queryAndClick(`a[href*='/ghost/editor/']`, 'New Post');\n }", "title": "" }, { "docid": "6d8d3b95e05d52ea366f2f07a61f437a", "score": "0.6146104", "text": "function postPost() {\n addPost($(\"#post-name\").val(), id);\n renderPosts();\n\n console.log(posts);\n $('#post-name').val('');\n id+=1;\n}", "title": "" }, { "docid": "8ee5be740d8f01b6b4bd00fdd0fb7f2e", "score": "0.61445403", "text": "function makePostsVisibleOnScreen(array) {\n let output = '';\n let wrap = document.querySelector('.wrap-blog');\n let actual_result = JSON.parse(array);\n //console.log(actual_result);\n\n actual_result.forEach((x) => {\n console.log(x);\n output += `\n <div class=\"card mt-2\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${x.blog_title}</h5>\n <p class=\"card-text\">${x.blog_post_date}</p>\n ${window.location.pathname.indexOf('/blog.php') > 0 ? `<a href=\"./post.php?id=${x.id}\"><button class=\"btn btn-dark mr-2\">Read</button></a>` : ''}\n ${window.location.pathname.indexOf('/view_posts.php') > 0 ? `<a href=\"./edit_post.php?id=${x.id}\"><button class=\"btn btn-primary mr-2\">Edit</button></a><a href=\"./view_posts.php?id=${x.id}\"><button class=\"btn btn-danger mr-2\">Remove</button></a>` : ''}\n </div>\n </div>\n `;\n });\n\n wrap.innerHTML = output;\n }", "title": "" }, { "docid": "a04b6359ed7a610862bdec39fb22dadc", "score": "0.6136847", "text": "function displayPosts(output){\n postSection.innerHTML = `\n <div id=\"page-header\" class=\"container bg-light border-top border-bottom\">\n <h1 class=\"my-1\"><span data-gettext>Posts</span></h1>\n </div>\n <section id=\"posts\" class=\"container mt-5\">${output}</section>\n `;\n }", "title": "" }, { "docid": "2fdada1b580943f8f9607c7bd3a7d990", "score": "0.6129911", "text": "function addPostContainer(post) {\n console.log(\"adding post\");\n console.log(post);\n}", "title": "" }, { "docid": "218b03ac1154560d79ca3c9b67ea24c8", "score": "0.6115718", "text": "function viewPost(post_id) {\n fetch(`https://shrouded-temple-45259.herokuapp.com/view-post/${post_id}/`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then((res) => res.json())\n .then((data) => {\n console.log(data);\n post = data.data;\n console.log(post);\n document.querySelector(\n \".postModal\"\n ).id = post[0]\n document.querySelector(\n \".postModal\"\n ).innerHTML = \"\";\n document.querySelector(\n \".postModal\"\n ).innerHTML += `<div class=\"blogPost\" id=\"${post[0]}\">\n <h2 class=\"closePost\" onclick=\"openPost()\">Close</h2>\n <div class=\"postImage\"><img class=\"image\" src=\"${post[1]}\" alt=\"${post[2]}\" /></div>\n <h2 class=\"title\">${post[2]}</h2>\n <h3 class=\"dateCreated\">${post[7]}</h3>\n <div class=\"content\">\n <h3 class=\"intro\">${post[3]}</h3>\n <h3 class=\"body\">${post[4]}</h3>\n <h3 class=\"conclusion\">${post[5]}</h3>\n </div>\n <h3 class=\"author\">Written by ${post[6]}</h3>\n <div class=\"likes\">\n </div>\n <div class=\"interact\">\n <button class=\"like\" onclick=\"if (this.classList.contains('active')) {\n unlike(this)\n } else {\n likePost(this)\n }\"><i class=\"fas fa-heart\"></i></button>\n <button class=\"comment\" onclick=\"comment()\">Comment</button>\n </div>\n </div>`\n displayLikes(post[0])\n displayComments(post[0]);\n \n });\n\n}", "title": "" }, { "docid": "415abe2fb1be7e0fff13faeb7b8443c8", "score": "0.61146164", "text": "async function showPosts() {\n //await returns promise, promise is a function in JS.\n const posts = await getPost();\n // console.log(posts);\n\n posts.forEach( post => {\n //We are creating an element in HTML dynamically.\n const postEl = document.createElement('div');\n postEl.classList.add('post');\n //Adding contents into HTML dynamically using a variable.\n postEl.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">${post.body}</p>\n </div> \n `;\n //This will append Post to every element\n postContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "0a40b4b0e5a46e32a5369ebec5a577de", "score": "0.6091522", "text": "function makePost(post) {\n\tlet article = document.createElement('article');\n\tlet output = `<h6>${post.date}</h6>`;\n\toutput += `<h3>${post.title}</h3>`;\n\toutput += `<p>${post.body}</p>`;\n\toutput += `<p class=\"read-more\"><a href=\" ${post.url} \" target=\"_blank\" id=\"link2\">Read More...</a></p>`;\n\tarticle.innerHTML = output;\n\tblogOutput.appendChild(article);\n}", "title": "" }, { "docid": "b4a9cfe42df1462399f78e94e5e4ef7d", "score": "0.6088078", "text": "function showPosts() {\n\t\t//$(\"#postArea\").empty()\n\t\t$(\"#postArea\").html(\"\")\n\t\tdb.allDocs({\n\t\t\tinclude_docs: true,\n\t\t\tlive: true,\n\t\t\tlimit: 3,\n\t\t\tdescending: true\n\t\t}).then(function(doc) {\n\t\t\tvar posts = doc.rows;\n\t\t\tif(!firstdoc && posts.length==0){\n\t\t\t\tfirstdoc=0\n\t\t\t}else{\n\t\t\t\tfirstdoc=parseInt(posts[0].doc._id)\t\n\t\t\t}\n\t\t\t\n\t\t\tvar count = 1\n\n\t\t\t//for each post calls the function that creates the dom \n\t\t\t//and if the number of post is bigger then calls paging function\n\t\t\tposts.forEach(function(post) {\n\t\t\t\tif (count < 3) {\n\t\t\t\t\teachfor(post, count);\n\t\t\t\t\tconsole.log(count)\n\t\t\t\t\tcount++\n\t\t\t\t} else {\n\t\t\t\t\tpaging(post.doc._id, 1, false, \"\")\n\t\t\t\t\tconsole.log(\"paging\" + (post.doc.title))\n\t\t\t\t}\n\t\t\t})\n\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "d118309b3f9bb2d307812cc2ce4801d9", "score": "0.6082751", "text": "async function renderPosts() {\n\n let posts = await getPosts();\n posts = posts.posts;\n let postsElements = \"\";\n let selectedPostId;\n\n posts.forEach(post => {\n\n postsElements += `\n\n <div class=\"row preview-posts-container\" id=\"${post.id}\">\n <div class=\"row preview-posts\">\n <div class=\"col-md\">\n <p class=\"creation-date\">Created at: ${post.created_at}</p>\n </div>\n <div class=\"col-md\">\n <p class=\"update-date\"> Modified at: ${post.updated_at}</p>\n </div>\n </div>\n <div class=\"row preview-posts\">\n <h3 id=\"field-id\" style=\"display:none\">${post.id}</h3>\n <h3 class=\"field-title\">${post.title}</h3>\n </div>\n <div class=\"row preview-posts\">\n <img class=\"field-image\" width=\"200\" src=\"${post.image}\">\n <input class=\"input-image\" type=\"url\" value=\"${post.image}\" style=\"display:none\">\n </div>\n <div class=\"row preview-posts\">\n <p class=\"field-body\">${post.body}</p>\n </div>\n <div class=\"row preview-posts\">\n <div class=\"col-sm\">\n <button class=\"modify-button fa fa-edit fa-2x\" value=\"${post.id}\"></button>\n <button class=\"confirm-button\" value=\"${post.id}\" style=\"display:none\">confirm</button>\n </div>\n <div class=\"col-sm\"> \n <button class=\"delete-button fa fa-close fa-2x\" value=\"${post.id}\"></button> \n <button class=\"cancel-button\" value=\"${post.id}\" style=\"display:none\">cancel</button> \n </div>\n </div>\n <div class=\"row preview-posts\">\n <button class=\"comment-button\" value=\"${post.id}\">Check comments</button>\n </div>\n <div class=\"row preview-posts comment-container\" style=\"display:none\">\n <div class=\"row preview-comments\">\n <form autocomplete=\"off\" class=\"comment-form\">\n <div class=\"row\">\n <input\n type=\"text\"\n name=\"title\"\n class=\"title\"\n placeholder=\"type the title here*\"\n required\n />\n </div>\n <div class=\"row\">\n <textarea\n name=\"body\"\n class=\"body\"\n cols=\"30\"\n rows=\"5\"\n placeholder=\"type the body here*\"\n ></textarea>\n </div>\n <div class=\"row\">\n <input type=\"submit\" value=\"Publish\" class=\"comment-submit-button\"/>\n </div>\n </form>\n </div>\n </div>\n </div><hr>`;\n\n // append the posts to the div\n container.innerHTML = postsElements;\n\n // click listner to each button, and call respected function for each\n $(\".delete-button.fa.fa-close\").click(function (e) {\n selectedPostId = e.target.value;\n deletePost(selectedPostId);\n })\n\n $(\".modify-button.fa.fa-edit\").click(function (e) {\n selectedPostId = e.target.value;\n modifyPost(selectedPostId);\n })\n\n $(\".confirm-button\").click(function (e) {\n selectedPostId = e.target.value;\n confirmUpdate(selectedPostId);\n })\n\n $(\".cancel-button\").click(function (e) {\n selectedPostId = e.target.value;\n cancelUpdate(selectedPostId);\n })\n\n $(\".comment-button\").click(function (e) {\n selectedPostId = e.target.value;\n showComments(selectedPostId);\n })\n });\n }", "title": "" }, { "docid": "b2099c2a3338d6f706e05ac516d41653", "score": "0.60742915", "text": "function displayPosts(posts) {\n\t $(\"#userPost\").empty();\n\t \n\t\t// All posts of user\n\t\t// using div for each post\n\t\t$.each(posts, function(i, post) {\n\t\t\t// create dev posts of user\n\t var divPost = $(\"<div>\");\n\n\t // creat title, body post and hidden input\n\t var title = $(\"<p>\").text(post.title);\n\t var body= $(\"<p>\").text(post.body);\n\t var hiddenPostId = $(\"<input>\").prop(\"type\", \"hidden\").val(post.postId);\n\n\t if ($(\"#username\").val() == post.userName) {\n\t\t var btnDel = $(\"<input>\").prop(\"value\", \"Delete\")\n\t\t\t\t\t.prop(\"type\", \"button\");\n\t\t\t btnDel.on( \"click\", function(evt) {\n\t\t\t\t\t\tvar postId = $(this).siblings(\":hidden\").val();\n\t\t\t\t\t$.get(POSTDEL_URL + postId)\n\t\t\t\t\t\t.done(function(comments){\n\t\t\t\t\t\t\tdeleteComment(divPost, comments);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.fail(ajaxFailure);\n\t\t\t\t\tevt.stopImmediatePropagation();\n\t\t\t\t});\n\t }\n\t\t\n\t // create comment button\n\t\t\tvar btnComments = $(\"<input>\").prop(\"value\", \"Comments\")\n\t\t\t\t.prop(\"type\", \"button\");\n\t\t\tbtnComments.on( \"click\", function(evt) {\n\t\t\t\t\tvar postId = $(this).siblings(\":hidden\").val();\n\t\t\t\t$.get(USERCOMM_URL + postId)\n\t\t\t\t\t.done(function(comments){\n\t\t\t\t\t\tdisplayComments(divPost, comments, postId);\n\t\t\t\t\t})\n\t\t\t\t\t.fail(ajaxFailure);\n\t\t\t\tevt.stopImmediatePropagation();\n\t\t\t});\n\t\t\t\n\n\t // setup css\n\t divPost.addClass(\"divPost\");\n\t title.addClass(\"pTitle\");\n\t body.addClass(\"pBody\");\n\t if ($(\"#username\").val() == post.userName) \n\t \tbtnDel.addClass(\"btnComments\");\n\t btnComments.addClass(\"btnComments\");\n\t \n\t\t\t\n\t\t\t// append them to DIV element\n\t\t\ttitle.appendTo(divPost);\n\t\t\tbody.appendTo(divPost);\n\t\t\tif ($(\"#username\").val() == post.userName) \n\t\t\t\t btnDel.appendTo(divPost);\n\t\t\tbtnComments.appendTo(divPost);\t\t\t\n\t\t\thiddenPostId.appendTo(divPost);\n\t\t\tdivPost.appendTo($(\"#userPost\"));\n\t\t});\n\t \n\t $(\"#userPost\").prop(\"class\", \"userPost\");\n\t}", "title": "" }, { "docid": "6ecc4dc2c88fad60c0f5faf067beebbf", "score": "0.606306", "text": "function postComponent(state) {\n return '\\\n <div class=\"partner-feed-post\"> \\\n <a href=\"'+ state.url +'\" target=\"blank\"> \\\n <img src=\"'+ state.image +'\"> \\\n <div class=\"title\">'+ state.title +'</div> \\\n </a> \\\n </div> \\\n ';\n }", "title": "" }, { "docid": "6812dcaa0d97eb75956570ef04e3920e", "score": "0.6043572", "text": "function createPost(el) {\n \n let flag = 'show';\n let hr = document.createElement('hr');\n let post = document.createElement('div');\n post.className = 'content'\n let allCommentsDiv = document.createElement('div');\n let author = document.createElement('span');\n let title = document.createElement('h5');\n let description = document.createElement('p');\n const showComments = document.createElement(\"a\");\n showComments.innerText = \"Show comments\";\n showComments.style = `\n font-size: 12px;\n `\n showComments.className =\"btn btn-outline-success my-2 my-sm-0\"\n showComments.addEventListener('click', () => {\n onCommentsClick(el.id, allCommentsDiv, post, flag);\n if (flag === 'show') {\n showComments.innerText = 'Hide Comments';\n flag = 'hide';\n } else {\n showComments.innerText = 'Show Comments';\n flag = 'show';\n }\n });\n author.innerHTML = `Created by <b>${el.user.username.charAt(0).toUpperCase() + el.user.username.slice(1)}</b>`;\n author.style = `\n color: #787C7E;\n font-family: 'monospace';\n `;\n title.innerText = el.title.charAt(0).toUpperCase() + el.title.slice(1);\n description.innerText = el.description.charAt(0).toUpperCase() + el.description.slice(1);\n post.appendChild(author);\n post.appendChild(hr)\n post.appendChild(title);\n post.appendChild(description);\n post.appendChild(showComments);\n post.appendChild(allCommentsDiv)\n \n document.querySelector('#posts').prepend(post)\n}", "title": "" }, { "docid": "8d11a4f070120512b7f6bc925e41de69", "score": "0.6036599", "text": "function show(req, res) {\n Thread.findOne({title: req.params.title}, function(error, thread) {\n var posts = Post.find({thread: thread._id}, function(error, posts) {\n res.send([{thread: thread, posts: posts}]);\n });\n })\n}", "title": "" }, { "docid": "cf96564f103d560e83dafeb30910fa86", "score": "0.6008142", "text": "function getPost() {\n var path = window.location.pathname;\n var domain = window.location.hostname;\n var port = window.location.port;\n\n $.get(path + '/getPost', function (data) {\n var date = new Date(data.date_created); //Date the post was created\n var files = \"\";\n\n if (data.post_file) {\n $('#post-files-cont').removeClass('hide'); //Shows the container that contains any attached files if there is any\n\n for (var i = 0; i < data.post_file.length; i++) {\n var fileName = data.post_file[i].substr(data.post_file[i].indexOf(' ') + 1);;\n\n files += \"<a href='//\" + domain + \":\" + port + \"/\" + data.post_file[i] +\n \"' class='list-group-item' download>\" + fileName + \"</a>\";\n }\n\n $('#post-files').html(files);\n }\n $('#post-title').html(data.post_title);\n $('#post-Title').html(data.post_title);\n //Shows the post\n $('#post-content').html('<p>' + data.post_content + '</p>');\n $('#post-footer').html(\"<footer class='text-info'> - Posted by \" + data.user_name + \" on \" + date.toDateString() + \"</footer>\");\n });\n }", "title": "" }, { "docid": "76466113c09a18cf7daba8aa9e3198b9", "score": "0.6001138", "text": "function get(){\n\t\t$.post(url+\"/posts/get\",{'post_id':'','ajax':'false'},function(data){\n\t\t\tif(data.result>0){\n\t\t\t\t $('body').data('last_id', data.last_id);\t\n\t\t\t\t $(\"#post_area\").prepend(data.view);\n\t\t\t\t initOpenClose();\n\t\t\t\t set_comments();\n\t\t\t\t spam();\n\t\t\t\t time_update();\n\t\t\t\t //ajax();\n\t\t\t}\n\t\t\tajax();\n\t\t},\"json\");\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "adddc0b6e0c14b833abe426f303cbc6e", "score": "0.60000974", "text": "function displayPostList(data){\n $('#posts').html(\"\");\n for(let i = data.posts.length - 1; i >= 0; i--){\n $('#posts').append(`\n <li>\n <p><b>Title:</b> ${data.posts[i].title}</p>\n <p><b>Author:</b> ${data.posts[i].author}</p>\n <p><b>Content:</b> ${data.posts[i].content}</p>\n <p><b>Publish Date:</b> ${data.posts[i].publishDate}</p>\n <p><b>Id:</b> ${data.posts[i]._id}</p>\n </li>\n `)\n }\n}", "title": "" }, { "docid": "ab6e2a383d9e0a2177695ab22722f825", "score": "0.5980098", "text": "function load_posts_view(view) {\n // Show posts view and hide other views\n document.querySelector('#posts-view').style.display = 'block';\n document.querySelector('#profile-view').style.display = 'none';\n\n if (view === 'following') {\n document.querySelector('#new-post').style.display = 'none';\n } else { // All posts view\n // document.querySelector('#content-post').value = '';\n if (document.getElementById('compose-post')) {\n document.querySelector('#compose-post').onsubmit = () => {\n new_post();\n };\n }\n }\n fetch(`/allposts/${view}`)\n .then(response => response.json())\n .then(posts => {\n console.log(posts);\n\n posts.forEach(post => {\n\n const element = document.createElement('div');\n element.className = \"post-div\";\n\n document.querySelector('#posts-view').append(element);\n element.innerHTML = `<a class=\"user-profile\" href=\"#\">${post[\"user\"]}</a> says: <pre> ${post[\"content\"]} <br><br> ${post[\"post_date\"]} <br> LIKES`;\n })\n document.body.addEventListener('click', function (e) {\n if (e.target.className === 'user-profile') {\n load_profile_view();\n }\n });\n });\n}", "title": "" }, { "docid": "852fae6bc4bea2b8968897d212d2e914", "score": "0.5971977", "text": "function openPost (e) {\n let post = document.querySelector('.postModalContainer')\n post.classList.toggle('hide');\n post_id = document.querySelector('.post').id;\n document.body.classList.toggle('disable');\n}", "title": "" }, { "docid": "47c44bed5c00027da4022983d32ebc4e", "score": "0.59617394", "text": "async function getPost(){\n let postTitle = window.location.href.split('?id=');\n if(postTitle.length===2){\n postTitle = postTitle[1];\n }else{\n //window.location.replace('adminPanel.php','_self');\n }\n let resp = await fetch('app/routes/postData.php?id='+postTitle);\n let data = await resp.json();\n\n //set title \n postId = data.postInfo.id;\n title.textContent = data.postInfo.title;\n mainImgUrl.textContent = data.postInfo.mainImage;\n tagHandler.selectedTags.push(data.mainCategory);\n tagHandler.addSelectedHTMLtag(data.mainCategory);\n tagHandler.mainTag = data.mainCategory;\n data.categories = data.categories.filter(cat=>cat!==data.mainCategory);\n data.categories = data.categories.map((cat)=>cat.name);\n tagHandler.selectedTags.push(...data.categories);\n data.categories.forEach(category=>{\n tagHandler.addSelectedHTMLtag(category);\n });\n let postContents = data.postContents.sort((a,b)=>a.position-b.position);\n postContents.forEach(section=>{\n let a = new Box(section.type);\n if(section.type==='resources'){\n let tmpContainer = document.createElement('div');\n tmpContainer.innerHTML = section.content;\n let strContent = \"\";\n Array.from(tmpContainer.children).forEach((child)=>{\n let name = child.textContent;\n let link = child.href;\n strContent +=`<div><input type=\"text\" placeholder=\"Name\" value=\"${name}\"><input type=\"text\" placeholder=\"Link\" value=\"${link}\"></div>`\n });\n section.content = strContent;\n a.boxContentElement.insertAdjacentHTML('afterbegin',strContent);\n }else{\n a.boxContentElement.innerHTML = section.content;\n }\n })\n\n \n\n if(data.postInfo.STATUS==='published'){\n //hide publish button\n publishBtn.classList.add('hidden');\n //show withdraw btn\n }else{\n withdrawBtn.classList.add('hidden');\n }\n console.log(data);\n}", "title": "" }, { "docid": "b94f0ef399a385c53a35e56183fce70c", "score": "0.5959361", "text": "function div_show1() {\n document.getElementById('read_the_post1').style.display = \"block\";\n}", "title": "" }, { "docid": "5d460d37b22db0f35c203de1163b07c7", "score": "0.5958564", "text": "function showQuery(qry) {\n var qf = document.getElementById('post_file');\n qf.innerHTML = '<p><strong>Ready for POST-ing :</strong></p>' +\n '<pre id=\"postout\">' +\n\t\t qry.replace(/</g, '&lt;').replace(/>/g, '&gt;') +\n\t\t '</pre>';\n}", "title": "" }, { "docid": "65e4ef519ce63ecc805c990c334a4775", "score": "0.59562564", "text": "function navMakePost(evt){\n console.debug(\"navMakePost\", evt);\n //hidePageComponents();\n\n postNewStory(evt);\n $navPoster.show();//nav-post, shows submit btn w/id nav-post\n}", "title": "" }, { "docid": "1b7a210d0c225c748d76a6acf626cc56", "score": "0.5953591", "text": "function printSavedPosts(data) {\n // Creating Post HTML and Appending it to page for every object in the parameter Object\n for (let i = 0; i < data.length; i++) {\n // This functiont takes in a single JSON object for an article/headline\n // It constructs a jQuery element containing all of the formatted HTML for the\n // article panel\n let panel = $(\n [\n \"<div class='panel panel-default'>\",\n \"<div class='panel-heading'>\",\n \"<h3>\",\n \"<a class='article-link' target='_blank' href='\" + data[i].link + \"'>\",\n data[i].title,\n \"</a>\",\n \"<span class='delete'>\",\n \"<a class='btn btn-danger'>\",\n \"Delete From Saved\",\n \"</a>\",\n \"</span>\",\n \"<span class='notes'>\",\n \"<a class='btn btn-info btnNotes notes'>Article Notes</a>\",\n \"</span>\",\n \"</h3>\",\n \"</div>\",\n \"<div class='panel-body'>\",\n data[i].title,\n \"</div>\",\n \"</div>\"\n ].join(\"\")\n );\n // We attach the article's id to the jQuery element\n // We will use this when trying to figure out which article the user wants to remove or open notes for \n panel.data(\"_id\", data[i]._id);\n // We return the constructed panel jQuery element\n $('.main-articles').append(panel);\n\n\n }\n // Active DOM For elements just created;\n // activateDOM();\n deleteBtnDom();\n notesBtnDom();\n}", "title": "" }, { "docid": "eb648ac53b206419a0a994942c1afe5e", "score": "0.5952097", "text": "render() {\n return (\n <div>\n <div>POST INFO HERE</div>\n </div>\n );\n }", "title": "" }, { "docid": "550bb9f7e1228a0766048b3704f42d41", "score": "0.59520483", "text": "function displayPost(ClassID, callback){\n\tconsole.log(\"CLassid\" + ClassID);\n\tconnection.query('SELECT *, DATE_FORMAT(created, \"%b %d %Y %h:%i %p\") as created FROM Post WHERE classId = ?' , ClassID, function(err, results){\n\t\tif (err) throw err;\n\t\tconsole.log(\"orm check:\" + results);\n\t\tcallback(results)\n\t\t});\n\t\t\n}", "title": "" }, { "docid": "cb3ba88c8fbc0fb58110f60afc2cb7de", "score": "0.5936571", "text": "function show_post(score, title, data) {\n \"use strict\";\n // console.log(\"Selected post '\" + title);\n\n cond_hide_tutorial();\n\n var contents = data.split(';-;'),\n author = contents[1],\n permalink = contents[2],\n url = contents[3],\n body = contents[4],\n domain,\n short_ending,\n long_ending,\n webmsource,\n mp4source;\n\n // Show appropriate containers\n $(\"#overview\").slideUp(function () {\n $(\".comment_content\").fadeOut(function () {\n $(\".post_content\").fadeIn();\n });\n });\n $(\".img_content\").hide();\n $(\".movie_content\").hide();\n $(\".imgur\").hide();\n\n if (url !== \"\") {\n // Extract domain from URL\n domain = \"\";\n if (url.indexOf(\"://\") > -1) {\n domain = url.split('/')[2];\n } else {\n domain = url.split('/')[0];\n }\n\n // Show appropriate containers\n $(\".post_content .text_post\").hide();\n $(\".post_content .link_post\").show();\n $(\".post_content .content\").hide();\n\n // Setup link for URL\n $(\".post_content .source\").attr('href', url);\n $(\".post_content .domain\").html(domain);\n\n // Conditional show image\n short_ending = url.substr(-3).toLowerCase();\n long_ending = url.substr(-4).toLowerCase();\n\n if ($.inArray(short_ending, [\"jpg\", \"png\", \"gif\"]) >= 0 || long_ending === \"jpeg\") {\n $(\".img_content\").show();\n $(\".img_content\").attr(\"src\", url);\n } else if (long_ending === \"gifv\") {\n webmsource = url.slice(0, -4) + \"webm\";\n mp4source = url.slice(0, -4) + \"mp4\";\n $(\".movie_content\").html(\"<video class='img-responsive' autoplay='' loop='' muted='' preload=''><source src='\" + webmsource + \"' type='video/webm'><source src='\" + mp4source + \"' type='video/mp4'></video>\");\n $(\".movie_content\").show();\n } else if (domain.indexOf(\"imgur\") > -1) {\n show_imgur(url);\n }\n\n } else {\n // Text post appropriate containers\n $(\".post_content .text_post\").show();\n $(\".post_content .link_post\").hide();\n\n // Show text content if available\n if (body !== \"\") {\n $(\".post_content .content\").show();\n $(\".post_content .content\").html(\"\");\n $(\".post_content .content\").append(\n weird_double_parser(body)\n );\n } else {\n $(\".post_content .content\").hide();\n }\n }\n\n // Show title and metadata for link\n $(\".post_content .title\").html(title);\n $(\".post_content .score\").html(score);\n $(\".post_content .permalink\").attr('href', permalink);\n $(\".post_content .author\").html(author);\n}", "title": "" }, { "docid": "e3ce9acbd1e1b1ae89abe2649a0dd436", "score": "0.59298515", "text": "function refreshPost($post) {\n const post_id = $post.data('id')\n\n $.get(`/api/posts/${post_id}`, ({data}) => {\n // $post.html('')\n $post.replaceWith(createPostHTML(data))\n $post.children('.post-comments-upload').hide()\n })\n }", "title": "" }, { "docid": "448c5b934ce0f0fcb68da885f6c2c0ee", "score": "0.59274536", "text": "function render () {\n // empty existing posts from view\n $showsList.empty();\n\n // pass `allShows` into the template function\n var showsHtml = template({ shows: allShows });\n\n // append html to the view\n $showsList.append(showsHtml);\n}", "title": "" }, { "docid": "b4c4a3e13c4898384579172dae09d037", "score": "0.59252495", "text": "function show(response) {\n\tlet output = '';\n\n\tresponse.forEach(walpaper => {\n\t\t// * Avoiding Any unnecessary posts without image\n\t\tif (walpaper.data.thumbnail === 'self') {\n\t\t\treturn;\n\t\t}\n\n\t\t// * checking if the link is from reddit...\n\t\t// * Sometimes the links are from other sites which can cause problems\n\t\tif (walpaper.data.url.includes('i.redd.it')) {\n\t\t\toutput += `\n\t\t\t<div class=\"img-container col s12 m12 l6\">\n\t\t\t\t<img src=\"${walpaper.data.url}\" alt=\"\" class=\"image responsive-img hoverable\">\n\t\t\t\t<a class=\"waves-effect waves-light btn btn-small\" href=\"https://www.reddit.com${walpaper.data.permalink}\" target=\"_blank\">go to post</a>\n\t\t\t\t<a class=\"btn waves-effect btn-small\" href=\"${walpaper.data.url}\" download><i class=\"material-icons small\">file_download</i></a>\n\t\t\t</div>\n\t\t\t`;\n\t\t\t//* OverWriting the HTML whenever a new walpaper loades\n\t\t\twalpaper_section.innerHTML = output;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ab25067c17fedc72954cd74b3ac5be25", "score": "0.5914403", "text": "function getPosts() {\n\tsetTimeout(()=>{\n\t\tlet output = \"\";\n\t\tposts.forEach((post,index) => {\n\t\t\toutput += `<li>${post.title}</li>`\n\t\t});\n\t\tdocument.body.innerHTML = output;\n\t},1000);\n}", "title": "" }, { "docid": "7d390ac52ef3176379ea9b5466596405", "score": "0.59063417", "text": "function showMoreEditorial(postId) {\n var queryString = {postId:postId};\n ajaxRequest(\"/news/geteditorial\", queryString, function(data){showMoreEditorialHandler(data)});\n}", "title": "" }, { "docid": "162cb193b8151052c7645d3bad9278b8", "score": "0.5904761", "text": "function getPosts() {\n http\n .get(\"http://localhost:3000/posts\")\n .then(data => ui.showPosts(data))\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "8bc322647b01a7651f94c4a309e63cb9", "score": "0.58719635", "text": "function displayPostSummaryView (containingTab, post) {\n\t\tvar row = createPostView(post), success = false;\n\t\t\n\t\t//Ti.API.info('display post summary: create and populate a row from current post ');\n\t\tsuccess = populatePostView(containingTab, row, false);\n\t\tif (success) {\n\t\t\tsetPostViewEventHandlers (row);\t\t\t\t\t\n\t\t}\n\t\telse {\n\t\t\trow = null;\n\t\t}\n\t\treturn row;\n\t}", "title": "" }, { "docid": "e947cfee6b96ec70a8e53aa1907245c7", "score": "0.5870205", "text": "function show(req, res) {\n\tconst id = req.params.id; // this is the way to save a URL parameter\n\n\tmodels.Post.findByPk(id)\n\t\t.then(result => {\n\t\t\tif (result) {\n\t\t\t\tres.status(200).json(result);\n\t\t\t} else {\n\t\t\t\tres.status(404).json({\n\t\t\t\t\tmessage: \"post not found!\",\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t\t.catch(error => {\n\t\t\tres.status(500).json({\n\t\t\t\tmessage: \"Something went wrong\",\n\t\t\t});\n\t\t});\n}", "title": "" }, { "docid": "f63ffd7ff24e6bb0ead8814101c15e38", "score": "0.58681655", "text": "function ssuDisplayLoadedPosts( posts, shownPosts ){\n\t/*\n\t\tRemoves the end class from all of the columns\n\t*/\n\tjQuery('.columns').removeClass('end');\n\n\t/*\n\t\tIterates over all of the posts loaded, appending the posts to the page.\n\t*/\n\tjQuery.each( posts, function( index, value ){\n\t\t/*\n\t\t\tBuilds the post display.\n\t\t*/\n\t\tvar postText = '';\n\n\t\tpostText += '<div class=\"large-4 medium-6 small-12 columns\">';\n\t\t\tpostText += '<div class=\"article\">';\n\t\t\t\tpostText += '<a href=\"'+value.permalink+'\"><img src=\"'+value.image+'\" class=\"article-header\"/></a>';\n\t\t\t\tpostText += '<div class=\"article-content\">';\n\t\t\t\t\tpostText += '<a href=\"'+value.permalink+'\"><div class=\"article-title\">'+value.title+'</div></a>';\n\t\t\t\t\tpostText += '<div class=\"article-excerpt\"><p>'+value.excerpt+'</p></div>';\n\t\t\t\tpostText += '</div>';\n\t\t\t\tpostText += '<div class=\"article-footer\">';\n\t\t\t\t\tpostText += '<img src=\"'+value.author.image+'\" class=\"author-image\"/>';\n\t\t\t\t\tpostText += '<div class=\"author-meta\">';\n\t\t\t\t\t\tpostText += '<span class=\"author-name\">'+value.author.name+'</span>';\n\t\t\t\t\t\tpostText += '<span class=\"author-time\">'+ssuDisplayTimeAgo( value.date )+' ago</span><span class=\"author-dot\">&#183;</span>';\n\t\t\t\t\t\tpostText += '<span class=\"author-tag\">';\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\tIterates over all of the categories\n\t\t\t\t\t\t\t\tappending them to the post display. Makes\n\t\t\t\t\t\t\t\tsure we don't add any of the categories like\n\t\t\t\t\t\t\t\tFeatured Posts or Uncategorized.\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tjQuery.each( value.category, function( catIndex, catValue ){\n\t\t\t\t\t\t\t\tif( !( catValue == 'Featured Posts'\n\t\t\t\t\t\t\t\t\t|| catValue == 'Uncategorized' ) ){\n\t\t\t\t\t\t\t\t\t\tpostText += '<a href=\"/'+catValue.toLowerCase()+'/\">'+catValue+'</a>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tpostText += '</span>';\n\t\t\t\t\tpostText += '</div>';\n\t\t\t\tpostText += '</div>';\n\t\t\tpostText += '</div>';\n\t\tpostText += '</div>';\n\n\t\t/*\n\t\t\tAdds the post to the page before the load more container so the\n\t\t\tcontainer is always at the end.\n\t\t*/\n\t\tjQuery('#load-more-container').before( postText );\n\n\t});\n\n\t/*\n\t\tShows the text and hides the loader\n\t*/\n\tjQuery('#load-more-text').show();\n\tjQuery('#load-more-loading').hide();\n\n\t/*\n\t\tIf the shown posts matches the total post count, then we hide\n\t\tthe load more button, otherwise we add the 'end' class to the\n\t\tload more container.\n\t*/\n\tif( shownPosts == totalPostCount ){\n\t\tjQuery('#load-more').hide();\n\t}else{\n\t\tjQuery('#load-more-container').addClass('end');\n\t}\n\n\t/*\n\t\tSets the current post count to the shown posts on the screen.\n\t*/\n\tcurrentPostCount = shownPosts;\n\n\t/*\n\t\tFlag the loading post method as complete.\n\t*/\n\tssuLoadingPosts = false;\n}", "title": "" }, { "docid": "053847a9469ff3ae34ae59511df2ced7", "score": "0.5867414", "text": "function searchPosts(e) {\n let postTitle = e.target.value;\n // e.target.preventDefault();\n\n // reset the container\n container.innerHTML = \"\";\n url = constantUrl + \"search/\" + encodeURI(postTitle);\n\n fetch(url)\n .then(response => {\n return response.json()\n })\n .then(posts => {\n\n posts = posts.posts;\n let postsElements = \"\"\n posts.forEach(post => {\n\n postsElements += `\n <div class=\"row preview-posts-container\" id=\"${post.id}\">\n <div class=\"row preview-posts\">\n <h3 class=\"field-id\" style=\"display:none\">${post.id}</h3>\n <h3 class=\"field-title\">${post.title}</h3>\n </div>\n <div class=\"row preview-posts\">\n <p class=\"field-body\">${post.body}</p>\n </div>\n <div class=\"row preview-posts\">\n <img class=\"field-image\" width=\"200\" src=\"${post.image}\">\n <input class=\"input-image\" type=\"url\" value=\"${post.image}\" style=\"display:none\">\n </div>\n <div class=\"row preview-posts\">\n <p class=\"creation date\">Created at: ${post.created_at}</p>\n <p class=\"update date\"> Modified at: ${post.updated_at}</p>\n </div>\n <div class=\"row preview-posts \">\n <div class=\"col-sm\">\n <button class=\"modify-button\">modify</button>\n <button class=\"confirm-button\" style=\"display:none\">confirm</button>\n </div>\n <div class=\"col-sm\"> \n <button class=\"delete-button\">delete</button> \n <button class=\"cancel-button\" style=\"display:none\">cancel</button> \n </div>\n </div>\n </div><hr>`;\n });\n // append data to the div with id \"container\"\n container.innerHTML += postsElements;\n })\n .catch(err => {\n console.log(\"Could not find the post you requested!\")\n })\n }", "title": "" }, { "docid": "4ba9f6c0c7d05e2f14b4c581ebb49286", "score": "0.58624107", "text": "function getPosts() {\n http\n .get('http://localhost:3000/Posts')\n .then(data => {\n ui.showPosts(data);\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "5fad0a9778721d2469a95212fceaed5c", "score": "0.5859838", "text": "function displayPostDetailsView (containingTab, post) {\n\t\tTi.API.info('handle post detail post notification');\n\t\t// display in new details window\n\t\tvar DetailWindow = require('ui/common/DetailWindow'),\n\t\t\tdetailWindow = DetailWindow.createDetailWindow(containingTab),\n\t\t\tApplicationTabGroup = require('ui/common/ApplicationTabGroup'),\n\t\t\tCommentsView = require('ui/common/CommentsView'),\n\t\t\trow = displayPostSummaryView(containingTab, post),\n\t\t\ttableView = Ti.UI.createTableView({});\n\t\ttableView.appendRow(row);\n\t\tdetailWindow.add(tableView);\n\t\tdetailWindow.table = tableView; \n\t\tif (containingTab && detailWindow) {\n\t\t\t//CommentsView.displayCommentsInPostView(containingTab, row);\n\t\t\tcontainingTab.open(detailWindow);\n\t\t}\n\t\telse {\n\t\t\tTi.API.error(\"displayPostDetailsView: containingTab or detailWindow is null\");\n\t\t}\t\t\t\n\t}", "title": "" }, { "docid": "9b1eef4c6c6836e3f1e936c12d1fb03b", "score": "0.58487034", "text": "function displayNews(arrayOfNewsObject) {\n if (postContainer) {\n postContainer.innerHTML = '';\n }\n arrayOfNewsObject.forEach((post) => {\n postContainer.innerHTML += `<article class=\"one-post\">\n <h3 class=\"post-title\">${post.title}</h3>\n <img class=\"post-img\" src=${post.img} alt=${arrayOfNewsObject[0].title}>\n <h5 class=\"post-date\">${post.date}</h4>\n <p class=\"post-body\">${post.description}</p>\n <label class=\"post-more\" for=\"post-link\"><a id=\"post-link\" class=\"post-link\" href=${post.url}>READ MORE</a></label>\n </article>`;\n });\n body.appendChild(postContainer);\n}", "title": "" }, { "docid": "66a2ab26ab1305aef228fe2eb17b07f8", "score": "0.5843091", "text": "function getPosts() {\n http.get('http://localhost:3000/posts')\n .then(data => ui.showPosts(data))\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "c3e94e702a5fa1b84f93cd128e129d5c", "score": "0.5825724", "text": "function setPostToHidden() {\n post1.style.display = 'none';\n post2.style.display = 'none';\n post3.style.display = 'none';\n container.style.backgroundColor = 'white';\n }", "title": "" }, { "docid": "f0a6706452cc37f41bd7d172680cb87f", "score": "0.582505", "text": "function make_post(data, settings, via, hide) {\n var base = $(settings.base),\n class_char = settings.class_char;\n\n settings.total = data.count;\n\n var post = $('<div>').attr('class', 'stream-post clearfix');\n if (hide)\n post.css('display', 'none');\n post.attr('id', data.id);\n var post_content = $('<div>').attr('class', 'stream-post-content');\n\n var post_meta = $('<p>').attr('class', 'post-content-meta ' + class_char)\n var post_body = $('<p>').attr('class', 'post-content-body ' + class_char);\n\n if (!data.category) {\n var meta = '<a target=\"_blank\" class=\"username\" href=\"http://twitter.com/' + data.user + '\">@' + data.user + '</a>'\n + ' Via ' + via + ' &middot; '\n + '<time>' + moment(data.time).startOf('minute').fromNow() + '</time>';\n post_meta.html(meta);\n var text = format_tweet(data.text);\n post_body.html(text);\n } else {\n post_body = undefined;\n var cat = data.category.toLowerCase();\n var meta = '<a target=\"_blank\" href=\"http://badgerherald.com/' + cat + '\">' + data.category + ' </a>'\n + '<time>' + moment(data.time).startOf('minute').fromNow() + '</time>'\n + '<br/>' + '<a target=\"_blank\" class=\"title\" href=\"' + data.url + '\">' + data.title + '</a>';\n post_meta.html(meta);\n }\n\n var post_avatar = $('<div>').attr('class', 'stream-post-avatar');\n\n var avi = undefined;\n var img = undefined;\n\n async.series([function(callback) {\n if (!data.avi) {\n callback();\n } else {\n avi = $('<img/>').attr('src', data.avi);\n avi.on('load', function() {\n callback();\n });\n }\n }, function(callback) {\n if (!data.img) {\n callback();\n } else {\n img = $('<img/>').attr('src', data.img).css('width', '100%');\n img.on('load', function() {\n callback();\n });\n }\n }, function(callback) {\n $(post_body).find('a.testable_link').each(function(i, a) {\n IsValidImageUrl($(a), callback);\n });\n callback();\n }], function(err) {\n if (err)\n console.log('ERROR making post ' + data.id + '!');\n if (img)\n post_body.append(img);\n post_avatar.append(avi);\n post.append(post_avatar);\n post_content.append(post_meta);\n post_content.append(post_body);\n post.append(post_content);\n post.find('time').data('time', data.time);\n base.prepend(post);\n\n // Trim DOM. Basically the worst way to do this. Oh well.\n if (base.children().length > MAX_LENGTH) {\n base.children().last().remove();\n }\n\n // Keep scroll locked if not at top.\n var stream;\n if (post.is(':visible')) {\n if ($(window).width() > 768) {\n stream = base.parent();\n } else {\n stream = $(document);\n }\n if (stream.scrollTop() > 0) {\n var post_height = post.outerHeight();\n var new_top = stream.scrollTop() + post_height + parseInt(post.css('marginBottom'));\n stream.scrollTop(new_top);\n }\n }\n\n update_top_bar();\n\n });\n\n // Try to reload images after a small delay\n\n if (img) {\n img.on('error', {'img': this, 'data': data}, function() {\n setTimeout(function() {\n img.attr('src', data.img);\n }, 500);\n });\n }\n\n if (avi) {\n avi.on('error', {'img': this, 'data': data}, function() {\n setTimeout(function() {\n avi.attr('src', data.avi);\n }, 500);\n });\n }\n }", "title": "" }, { "docid": "0a5d0034719b551fac9e6c272550aba0", "score": "0.58164734", "text": "function ShowPostPreview(id) {\n\tvar sid = 'quest' + id;\n\tvar content = CKEDITOR.instances[sid].getData();\n\n\t$(\"#dialog\").html(content);\n\t$(\"#dialog\").dialog({\n\t\twidth : 500\n\t});\n\t$(\"#dialog\").dialog({\n\t\theight : 300\n\t});\n\t$(\"#dialog\").dialog(\"open\");\n}", "title": "" }, { "docid": "039efa4e60bdfa1bdafcf78d29567423", "score": "0.5815379", "text": "postView () {}", "title": "" }, { "docid": "0759f2908bf2e86c977534c2d8f57be0", "score": "0.5811068", "text": "function displayPosts(Posts, subView, type){\n\n if(subView === 'all'){\n toggleFocus(document.getElementById('menu-sub'));\n }\n else{\n toggleFocus(document.getElementById(subView), true);\n }\n\n var title = formatTitle(subView); \n\n /* \n * Posts are looped through and formatted one at a time and then dumped\n * into the subreddit's view (div) when finished.\n */\n var postHtmlString = '<div style=\"clear:both\"></div>';\n var i = 0;\n while(Posts[i] instanceof Object){\n\n if(type === 'all' || type === Posts[i].postType){\n\n var thumbnail = '';\n if(Posts[i].postType === 'link'){\n postHtmlString += '<div class=\"image-container\">' + Posts[i].thumbnail + '</div>'; \n }\n\n postHtmlString += '<div class=\"post\">' + anchorFormat(Posts[i].title) + ' by ' \n + '<a class=\"user\" onclick=\"openInNewTab(\\'http://reddit.com/u/' + Posts[i].author + '\\');\">'\n + Posts[i].author + '</a> in <a class=\"sub\" onclick=\"openInNewTab(\\'http://reddit.com/r/' + Posts[i].sub + '\\');\">'\n + Posts[i].sub + '</a><p class=\"post-info\"><a class=\"user\" onclick=\"openInNewTab(\\'http://reddit.com/u/' \n + User.name + '\\');\">' + User.name + '</a> ' + Posts[i].karma + ' points '\n + Posts[i].time.substr(0, 10) + '</p>';\n\n if(Posts[i].postType === 'comment'){\n postHtmlString += '<p class=\"post-comment\">' + Posts[i].comment + '</p>'; \n }\n \n postHtmlString += '<p class=\"full-comments\">' + anchorFormat(Posts[i].fullComments) + '</p>'\n + '</div><div style=\"clear:both\"></div>';\n }\n\n i++; \n }\n\n document.getElementById('subreddits-page').innerHTML = title + postHtmlString;\n}", "title": "" }, { "docid": "1b34d0bb1b6f1be83302c303eb7ba13a", "score": "0.58040994", "text": "function getPosts(){\n setTimeout(() => {\n let output = '';\n const UL_EL = document.getElementById('posts');\n\n posts.forEach((post) => {\n output += `\n <li>${post.title}</li>\n `;\n });\n UL_EL.innerHTML = output;\n }, 1000);\n}", "title": "" }, { "docid": "fe732cc8720d4a17e40014189b2fa08a", "score": "0.5796493", "text": "function getPost(){\n\n var text =localStorage.getItem(\"testJSON\");\n var info = JSON.parse(text);\n var output = '';\n var update = document.getElementById('blogbody');\n\n if(info.blogPost.length === 0){\n update.innerHTML = '<h3>No Blog post yet, click on <a href=\"formpage.html\">create</a> to publish your first post.......</h3>';\n }else{\n for(var i = info.blogPost.length-1; i>=0; i--){ \n output += '<div id=\"articles\">'+\n '<div>'+\n '<article>'+\n '<details>'+\n '<summary><h3>' + info.blogPost[i][\"title\"] + '</h3></summary>'+\n '<h>' + info.blogPost[i][\"name\"] + '</h><br>' + \n info.blogPost[i][\"time\"] + \n '<p>' + info.blogPost[i][\"post\"] + '</p>'+\n '</details>'+\n '</article>'+\n '</div>'+\n '<div id=\"icon\">'+\n '<i class=\"fa fa-trash\" onclick=\"deletePost('+ i + ')\"></i>'+\n '</div>'+\n '<div id=\"icon\">'+\n '<i class=\"fa fa-edit\" onclick=\"editPost('+ i + ')\"></i>'+\n '</div>'+\n '</div>';\n }\n update.innerHTML = output\n } \n}", "title": "" }, { "docid": "3a7170e33275084f101fb9abf99f95a6", "score": "0.5794003", "text": "showPosts(req, res) {\n res.render('posts', {\n posts: res.locals.posts,\n });\n }", "title": "" }, { "docid": "96ca6304e051cc30a78e00c6b7896746", "score": "0.57917243", "text": "function displayPosts() {\n let output = '';\n\n setTimeout(function() {\n posts.forEach(function(post) {\n output += `\n <ul>\n <li><h5>${post.title}</h5></li>\n <li><p>${post.content}</p></li>\n </ul>\n <br><br>\n `;\n });\n document.querySelector('.container').innerHTML = output;\n }, 1000);\n \n}", "title": "" } ]
148016177df02bafeca0541f5756b7a3
function to show the tooltip when the mouse is over a state in the map. Shows information about state and number of fires. Tip code from:
[ { "docid": "0693365f3bc88b2e3edba03ee680155e", "score": "0.7030709", "text": "function handleMouseOver(d) {\n let format = d3.format(\",\");\n let label = \"State: \" + d.properties.codarea + \"<br>\" + \"Forest Fires: \"\n + format(firesPerState.get(d.properties.codarea));\n tip.transition()\n .duration(200)\n .style(\"opacity\", 1);\n tip.html(label)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n d3.select(this).attr(\"stroke\", \"black\");\n d3.select(this).attr(\"stroke-width\", 3);\n }", "title": "" } ]
[ { "docid": "634237f31618d3314c0354d4af024f0f", "score": "0.72375864", "text": "function showToolTip(d) {\n d3.select(\".tooltip\")\n .style(\"opacity\", 1)\n .style(\"top\", (d3.event.y - 5) + \"px\")\n .style(\"left\", (d3.event.x + 10)+ \"px\")\n .html(`${d.state}: ${d.total}`);\n}", "title": "" }, { "docid": "f36e78c7ca7ca6bef59b9fe9878bc181", "score": "0.69449925", "text": "function showTooltip2(mouse_position, datum, index) {\n let tooltip_width = 120;\n let x_offset = -tooltip_width/2;\n let y_offset = 30;\n tooltip_state2.display = \"block\";\n tooltip_state2.left = mouse_position[0] + x_offset + 60;\n tooltip_state2.top = mouse_position[1] + y_offset + 185;\n tooltip_state2.name = datum.pl_name;\n // tooltip_state.group = datum.group;\n tooltip_state2.discovery = datum.pl_discmethod;\n tooltip_state2.distance = datum.st_dist;\n tooltip_state2.radius = datum.pl_radj;\n tooltip_state2.temp = datum.st_teff;\n tooltip_state2.inclination = datum.pl_orbincl;\n tooltip_state2.ra = datum.ra;\n tooltip_state2.dec = datum.dec;\n updateTooltip2();\n}", "title": "" }, { "docid": "df22c84d1b7d9297b5108b7746761a23", "score": "0.6893549", "text": "function showTooltip(d) {\n moveTooltip();\n\n tooltip.style(\"display\",\"block\")\n\n d3.select('.StateName').text(function(){return d.properties.NAME})\n d3.select('.incidents').text(function(){return d.properties.incidents})\n d3.select('.killed').text(function(){return d.properties.killed})\n d3.select('.injured').text(function(){return d.properties.injured})\n d3.select('.col-total').text(function(){return d.properties.Total})\n\n}", "title": "" }, { "docid": "ca519e994cfa5fe8a664140a57f55284", "score": "0.67590344", "text": "function mouseover(d) {\n d3.select(this)\n .attr('opacity', 0.5)\n document.getElementById('tip').innerHTML = \"<strong>Country: </strong> \\\n <span class='tiptext'>\" + d.properties.name + '<br></span> \\\n ' + \"<strong>HPI: </strong><span class='tiptext'>\" + countryHpi[d.properties.name] +\n '</span>'\n var xPos = parseFloat(d3.event.pageX) + 10;\n var yPos = parseFloat(d3.event.pageY) - 10;\n d3.select('#tip')\n .style('left', xPos + 'px')\n .style('top', yPos + 'px')\n d3.select('#tip').classed('hidden', false)\n }", "title": "" }, { "docid": "21995ea9cfe54c4b1a44592fe96d79dc", "score": "0.6753341", "text": "function mouseoverHandler (d) {\n tooltip.transition().style('opacity', 0.75)\n tooltip.html('<p>' + d[\"Province Name\"] + \"<br>\" + \"GDP per capital \" + d[\"aGDP\"] + \"RMB\" \n + \"<br>\" + d[\"Population(万人)\"] + \"万人\" \n + \"<br>\" + d[\"Size(万平方千米)\"] + \"万平方千米\" + '</p>' );\n }", "title": "" }, { "docid": "19204ecb28f9c3349103090636070c1c", "score": "0.6681936", "text": "onMouseEnter(evt) {\n\t\tconst coordinates = evt.target.getBoundingClientRect();\n\t\tthis.setState({\n\t\t\ttoolTip: {\n\t\t\t\tdisplay: 'block',\n\t\t\t\tleft: (parseInt(coordinates.left)+parseInt(coordinates.right))/2-20,\n\t\t\t\ttop: parseInt(coordinates.top) + 20,\n\t\t\t},\n\t\t});\n\t}", "title": "" }, { "docid": "cfc0acfd3eceba9e0a1e2f4784b2df81", "score": "0.6644573", "text": "function showTooltip(mouse_position, datum, index) {\n if(selectedDatums_tt.length > 2){\n let avgDist = null;\n let avgRad = null;\n let avgTemp = null;\n let avgInclination = null;\n let avgRA = null;\n let avgDec = null;\n\n for(var i = 0; i < selectedDatums_tt.length; i++){\n avgDist += selectedDatums_tt[i].st_dist\n avgRad += selectedDatums_tt[i].pl_radj;\n avgTemp += selectedDatums_tt[i].st_teff;\n avgInclination += selectedDatums_tt[i].pl_orbincl;\n avgRA += selectedDatums_tt[i].ra;\n avgDec += selectedDatums_tt[i].dec;\n }\n avgDist = avgDist/selectedDatums_tt.length;\n avgRad = avgRad/selectedDatums_tt.length;\n avgTemp = avgTemp/selectedDatums_tt.length;\n avgInclination = avgInclination/selectedDatums_tt.length;\n avgRA = avgRA/selectedDatums_tt.length;\n avgDec = avgDec/selectedDatums_tt.length;\n \n tooltip_state.name = datum.pl_name;\n tooltip_state.discovery = datum.pl_discmethod;\n tooltip_state.distance = avgDist\n tooltip_state.radius = avgRad\n tooltip_state.temp = avgTemp\n tooltip_state.inclination = avgInclination\n tooltip_state.ra = avgRA\n tooltip_state.dec = avgDec\n }\n else{\n tooltip_state.name = datum.pl_name;\n tooltip_state.discovery = datum.pl_discmethod;\n tooltip_state.distance = datum.st_dist;\n tooltip_state.radius = datum.pl_radj;\n tooltip_state.temp = datum.st_teff;\n tooltip_state.inclination = datum.pl_orbincl;\n tooltip_state.ra = datum.ra;\n tooltip_state.dec = datum.dec;\n // tooltip_state.cart = cartesianCoords[index];\n }\n\n let tooltip_width = 120;\n let x_offset = -tooltip_width/2;\n let y_offset = 30;\n\n tooltip_state.display = \"block\";\n tooltip_state.left = mouse_position[0] + x_offset + 60;\n tooltip_state.top = mouse_position[1] + y_offset - 32;\n \n \n updateTooltip();\n}", "title": "" }, { "docid": "af192fcc4e352a5b991be73626493977", "score": "0.66290694", "text": "function showToolTip(properties, coords) {\n //event screen coordinates\n var x = coords[0];\n var y = coords[1];\n //parse the date\n var date = new Date(properties.time).toString();\n date = date.split('GMT')\n date = date[0] + \"UTC\"\n //style the tooltip and add nested html content \n d3.select(\"#tooltip\")\n .style(\"display\", \"block\")\n .style(\"top\", y + 'px')\n .style(\"left\", x + 'px')\n .html(`<h3>${properties.name}</h3>` +\n `<b>GDP: </b>${properties.gdp_md_est}</br>` +\n `<b>Population: </b>${properties.pop_est}`)\n\n}", "title": "" }, { "docid": "2019afc621d21c8c895abae4d73d1076", "score": "0.65874594", "text": "function hoverTooltip(info) {\n\t//console.log(\"hovering: \" + info);\n}", "title": "" }, { "docid": "bcdd9ce5f900a6ab2ddaf150a51693c5", "score": "0.65433246", "text": "function hookTooltip()\r\n {\r\n var svg = d3.select(\".states\").selectAll(\"path\")\r\n \r\n .on(\"mouseover\", function(d){\r\n var tip = d3.select(\"div.myTip\");\r\n var k;\r\n var nAthletes = rateById.get(d.properties.ID_1);\r\n/*\r\n * English name - French name (or only name if VARNAME_1 == \"\") and #of Athletes\r\n */\r\n k = d.properties.NAME_1+(d.properties.VARNAME_1 != \"\" ? \"<br>\" + d.properties.VARNAME_1 : \"\") +\r\n (nAthletes > 0 ? \"<br>Athletes/Athètes: \"+ rateById.get(d.properties.ID_1).toLocaleString() : \"\");\r\n tip.html(k);\r\n/*\r\n * Hightlight provice borders\r\n */\r\n d3.selectAll(\"path\").filter(function(dd) {\r\n return dd.properties.ID_1 == d.properties.ID_1;\r\n }).style(\"stroke-width\", BorderStrong);\r\n/*\r\n * Makes sure that tooltip is visible\r\n */\r\n return tooltip.style(\"visibility\", \"visible\");})\r\n \r\n .on(\"mousemove\", function(){\r\n/*\r\n * Hovers the tooltip ~20px higher and 25px left of the mouse.\r\n */\r\n return tooltip.style(\"top\", (d3.event.pageY-20)+\"px\")\r\n .style(\"left\",(d3.event.pageX+25)+\"px\");})\r\n \r\n .on(\"mouseout\", function(d){\r\n/*\r\n * Provice borders back to normal\r\n */\r\n d3.selectAll(\"path\").filter(function(dd) {\r\n return dd.properties.ID_1 == d.properties.ID_1;\r\n }).style(\"stroke-width\", BorderNormal);\r\n/*\r\n * and hides the tooltip\r\n */\r\n return tooltip.style(\"visibility\", \"hidden\");}) // Hides the tooltip when finished\r\n/*\r\n * Nothing to do on click at this moment\r\n */\r\n .on(\"click\", function(d){\r\n return;\r\n });\r\n }", "title": "" }, { "docid": "9f282c1d640debb9e4c2371fa59bcb5c", "score": "0.6503706", "text": "function onMouseOver(e){\n e.target.setOpacity(1.);\n var size = 40;\n var point = map.latLngToContainerPoint(e.latlng);\n var tooltip = d3.select(map.getContainer())\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style({ left: point.x - 19 + \"px\", top: point.y - 20 - 60 + \"px\" })\n .node();\n displayExpo(tooltip, e.target.options, size);\n\n var tooltip2 = d3.select(map.getContainer())\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style({ left: point.x - 19 - 40+ \"px\", top: point.y - 30 + \"px\" })\n .node();\n\n displayDead(tooltip2, e.target.options, size);\n\n var tooltip3 = d3.select(map.getContainer())\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style({ left: point.x - 19 + 40+ \"px\", top: point.y - 30 + \"px\" })\n .node();\n\n displayInclination(tooltip3, e.target.options, size);\n}", "title": "" }, { "docid": "9918c9dce97da4ec479b54b6b0b42f92", "score": "0.6463541", "text": "function tipMouseover(d) {\n this.setAttribute(\"class\", \"circle-hover\"); // add hover class to emphasize\n\n var color = colorScale(d.route_type);\n var text_to_write = \"<span style='color:\" + color + \";'>\" + d.station_name + \"</span><br/>\" +\n \"Count: \" + d.number_of_transport;\n const coords = projection4([d.longitude, d.latitude])\n tooltip4.html(text_to_write);\n tooltip4.attr(\"text-anchor\", \"middle\")\n .style(\"left\", (coords[0] + 20) + \"px\")\n .style(\"top\", (coords[1] -50) + \"px\");\n tooltip4.transition()\n .duration(500) // ms\n .style(\"opacity\", .9)\n }", "title": "" }, { "docid": "125aa365fa2db8422db0c9bb633e64b3", "score": "0.6462285", "text": "tooltipMouseoverEnter(e) {\n\t\tthis.setState({\n\t\t\tmouseOverTooltip: true,\n\t\t\tmouseOverPrayer: e.target.attributes.name.value\n\t\t});\n\t}", "title": "" }, { "docid": "f50944367f1f22f81bd73fe267a21e4d", "score": "0.6423783", "text": "function tipMouseOver(feature, layer) {\n\n /* Clicked: Display full panel info */\n layer.on(\"click\", function (e) {\n tipMouseOut();\n const point = map.latLngToContainerPoint(e.latlng);\n\n popup.transition()\n .duration(200)\n .style('opacity', .9);\n\n /* GeoJSON Properties Panel */\n let popupContent = '<b> Properties </b> <br> ';\n\n $.each(e.sourceTarget.feature.properties, function( key, value ) {\n popupContent += '<b>' + key + '</b>' + ':' + JSON.stringify(value) + '<br>';\n });\n\n popupContent += '<b> Geometry: </b>' + JSON.stringify(e.sourceTarget.feature.geometry);\n popup.html(popupContent)\n .style('left', (point.x) + 'px')\n .style('top', (point.y) + 'px');\n });\n\n /* Hover: Display name */\n layer.on('mouseover', function(e) {\n\n const point = map.latLngToContainerPoint(e.latlng);\n let tipContents;\n if (popup._groups[0][0].style.opacity == 0 && e.target.feature.properties.name) {\n tipContents = e.target.feature.properties.name\n } else {\n return;\n }\n\n tip.transition()\n .duration(200)\n .style('opacity', .9);\n\n tip.html('<b>Location: </b> ' + tipContents)\n .style('left', (point.x) + 'px')\n .style('top', (point.y - 28) + 'px');\n });\n}", "title": "" }, { "docid": "7ca39e971f4c6786de316ac113a63776", "score": "0.63571334", "text": "function mouseOver_genre(d) {\n d3.select(this).style(\"opacity\", 1)\n d3.select(\"#tooltip\")\n .attr(\"class\", \"toolTip\")\n .transition().duration(300)\n .style(\"opacity\", 0.8)\n .style(\"left\", (d3.event.pageX - 345) + \"px\")\n .style(\"top\", (d3.event.pageY - 120) + \"px\");\n\n if (d.properties.value) {\n d3.select(\"#tooltip\").html(\n \"<h4 class='state-head'>\" + d.properties.name + \" (\" + d.properties.abbr + \")</h4>\" +\n \"<table><tr><th>Rank:</th><td>\" + (d.properties.value) + \" out of \"+ max + \"</td></tr>\" +\n \"<th>Number of upcoming \" + GENRES[genre].label + \" shows</th><td>\" + d.properties.num + \"</td></table>\" +\n \"<small>(click to zoom)</small>\")\n } else {\n d3.select(\"#tooltip\").html(\n \"<h4>\" + d.properties.name + \" (\" + d.properties.abbr + \")\" + \"</h4>\" +\n \"<table><tr><td> No upcoming shows </td></tr></table>\");\n }\n }", "title": "" }, { "docid": "a1046d3040661e1e1dc1fa8f99a22821", "score": "0.6314962", "text": "function onMouseOverMap() {\n var myTooltip;\n var layersButton = $('.olControlLayerSwitcher .maximizeDiv.olButton');\n var btnRect = layersButton[0].getBoundingClientRect();\n var tooltipRect;\n var leftPos;\n var topPos;\n $('body').append('<div class=\"ui-tip below-left\" id=\"tip-layers-button\"><p>Click the blue + button to show layers</p></div>');\n myTooltip = $('#tip-layers-button');\n // Position the tip.\n if (myTooltip.width() > 300) {\n myTooltip.css({ width: '300px' });\n }\n tooltipRect = myTooltip[0].getBoundingClientRect();\n leftPos = Math.min(btnRect.left, $(window).width() - tooltipRect.width - 10);\n topPos = btnRect.bottom + 8;\n if (topPos + tooltipRect.height > $(window).height()) {\n topPos = btnRect.top - (tooltipRect.height + 4);\n }\n topPos += $(window).scrollTop();\n // Fade the tip in and out.\n myTooltip.css({\n display: 'none',\n left: leftPos,\n top: topPos\n }).fadeIn(400, function () {\n $(this).delay(2000).fadeOut('slow');\n });\n // Only do this once.\n indiciaData.mapdiv.map.events.unregister('mouseover', indiciaData.mapdiv.map, onMouseOverMap);\n }", "title": "" }, { "docid": "11807861a32633be6a6b7066e2eb828d", "score": "0.6287944", "text": "function updateToolTips(stateLabels, activeAxisX, activeAxisY) {\n var xlabel, ylabel;\n\n switch (activeAxisX) {\n case \"poverty\":\n xlabel = \"Poverty %\";\n break;\n case \"age\":\n xlabel = \"Median Age\";\n break;\n case \"income\":\n xlabel = \"Median Household Income\";\n break;\n };\n \n switch (activeAxisY) {\n case \"obesity\":\n ylabel = \"Obesity %\";\n break;\n case \"smoking\":\n ylabel = \"Smoking %\";\n break;\n case \"healthcare\":\n ylabel = \"Healthcare %\";\n break;\n };\n\n // Create tooltips\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([110,70])\n .html(d => `State: ${d.state}<hr>${xlabel}: ${d[activeAxisX]}<br>${ylabel}: ${d[activeAxisY]}`);\n\n stateLabels.call(toolTip);\n stateLabels\n .on(\"mouseover\", d => toolTip.show(d))\n .on(\"mouseout\", d => toolTip.hide(d));\n \n return stateLabels;\n\n}", "title": "" }, { "docid": "d8c812cbc3db80fc14de66627960bc29", "score": "0.6271349", "text": "function draw() {\n if (state.hover) {\n tooltip\n .html(\n `\n <div>Name: ${state.hover.name}</div>\n <div>Value: ${state.hover.value}</div>\n <div>Hierarchy Path: ${state.hover.title}</div>\n `\n )\n .transition()\n .duration(500)\n .style(\n \"transform\",\n `translate(${state.hover.translate[0]}px,${state.hover.translate[1]}px)`\n );\n }\n}", "title": "" }, { "docid": "9b2d99c6083fbf4225ec4bd333f838e9", "score": "0.62634623", "text": "get tooltip() {}", "title": "" }, { "docid": "896cbd8cdd669369295de3e337677b53", "score": "0.6260108", "text": "function draw() {\n // + UPDATE TOOLTIP //working on getting the hover to work\n if (state.hover) {\n tooltip\n .html(\n `\n <div>Name: ${state.hover.name}</div>\n <div>Value: ${state.hover.value}</div>\n `\n )\n .style(\"font-size\",\"12px\")\n .transition()\n .duration(200)\n .style(\"transform\", `translate(${state.hover.position[0]}px,${state.hover.position[1]}px)`)\n }\n tooltip.classed(\"visible\", state.hover)\n}", "title": "" }, { "docid": "2aaea902fdfcc63df596b5ee089db00a", "score": "0.6236525", "text": "function SPmouseOver(d){\n console.log(d);\n d3.selectAll(\".sp_dot\")\n .transition()\n .duration(500)\n .style(\"opacity\",0.2);\n\n d3.select(this)\n .transition()\n .duration(500)\n .style('opacity', 1)\n .style('r',10);\n\n SPtooltip\n .style('display', null)\n .html( '<p>Country: '+ d.Country\n + '<br>Share of Employment in Services: ' + formatAsPercentage(d.Share)\n + '<br>GDP per Capita: ' + Math.round(d.GDP_per_Capita,-2) + '</p>');\n }", "title": "" }, { "docid": "3201eaa820d739572a6841acfaea5f17", "score": "0.6231687", "text": "function handleMouseOverMap(d){\n let tooltip = MapG.append('g').attr('id', \"tooltip\");\n \n let mouseX = d3.mouse(this)[0];\n let mouseY = d3.mouse(this)[1]\n \n tooltip.append('rect')\n .attr('x', mouseX)\n .attr('y', mouseY)\n .attr('width', '200px')\n .attr('height', '50px')\n .attr('rx', '10px')\n .attr('ry', '10px')\n .attr('fill', '#292825')\n \n tooltip.append('text')\n .attr('x', mouseX + 20)\n .attr('y', mouseY + 20)\n .attr('fill', 'oldlace')\n .attr('font-size', \"20px\")\n .text(`Country: ${d.properties.name}`);\n \n tooltip.append('text')\n .attr('x', mouseX + 20)\n .attr('y', mouseY + 40)\n .attr('fill', 'oldlace')\n .attr('font-size', \"20px\")\n .text(`Number of Wines: ${d.properties.amount}`)\n}", "title": "" }, { "docid": "d8fdb492225b0fbf042108edab5e5b99", "score": "0.61808485", "text": "function showTooltip(event) {\n // Place tooltip near where the hover occurred\n setTooltipY(event.clientY + 5);\n setTooltipX(event.clientX + 5);\n const [vehicleId, bookingId] = event.target.id.split(\",\"); // vehicleId, bookingId are sent, comma delimited, on event.\n const vehicle = vehicles.find(v => v.id === parseInt(vehicleId));\n setTooltipVehicle(vehicle);\n setTooltipBooking(vehicle.bookings.find(b => b.id === parseInt(bookingId)));\n }", "title": "" }, { "docid": "12c472f797d028c528370718bab2b423", "score": "0.61560667", "text": "set tooltip(value) {}", "title": "" }, { "docid": "2554fe7d08449550dd65ed3395ea3a7b", "score": "0.61322975", "text": "function mouseover(d) {\n let desc = \"\";\n if (d.data.hasOwnProperty(\"description\")) {\n desc = \": \" + d.data.description;\n }\n tooltip.text((d.data.name + desc)).style(\"visibility\", \"visible\");\n }", "title": "" }, { "docid": "abd7761d8a1245d2a8f66234982b2eb3", "score": "0.6119404", "text": "tooltipShow(event, d, vis) {\n // create and show tooltip\n d3.select('#barchart-tooltip')\n .style('display', 'block')\n .style('left', () => {\n if (event.pageX > 1650)\n return event.pageX - vis.tooltipWidth - vis.config.tooltipPadding + 'px';\n return event.pageX + vis.config.tooltipPadding + 'px';\n })\n .style('top', (event.pageY + vis.config.tooltipPadding) + 'px')\n .html(`\n <div class='tooltip-title'>${this.countryIndex.get(d.key)}</div>\n <div class='tooltip-subtitle'>${numberWithDecimals(d.value)} tonnes of carbon dioxide per capita </div>\n `);\n }", "title": "" }, { "docid": "bc0a8653884ad6c58f4174ef95af9f75", "score": "0.61047447", "text": "function zipCodeMouseover(d) {\n tooltip.transition().duration(200).style(\"opacity\", 0.9);\n tooltip.html(makeTooltipHTML(d)) \n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) - 30 + \"px\")\n .style(\"color\",\"white\")\n .style(\"background-color\", \"rgba(0, 0, 0, 0.5)\");\n \n \n \n if (connections[d.properties.NAME]) {\n for (var connectedRes of connections[d.properties.NAME]) {\n var el = document.getElementById(connectedRes);\n el.classList.add('highlightedRes');\n el.style.r = 10;\n }\n }\n \n}", "title": "" }, { "docid": "52eadeebb267983f627717b540b6e2eb", "score": "0.61028856", "text": "function mouseoverHandler(d) {\n console.log(d)\n tooltip.transition().style('opacity', .9)\n tooltip.html('<p>' + d[\"name\"] + '</p>');\n}", "title": "" }, { "docid": "2ae5dcca5107bfed8ca63076d3ecdc54", "score": "0.609722", "text": "function onMouseOver(d, i) {\n d3.select(this).attr('class', 'highlight')\n return tooltip\n .style('visibility', 'visible')\n .text(d.key + ' = ' + d.value + ' boeken')\n}", "title": "" }, { "docid": "c3ef36f865237cdcaafb6924a53c1a66", "score": "0.6092386", "text": "function PrayerPlansTooltipShown()\r\n{\r\n strHelpTopic = \"prayer_plans\";\r\n}", "title": "" }, { "docid": "5703bad5bb5213598595279c90b7613c", "score": "0.6076101", "text": "function hoverInfo(feature){\n\thtml = '<h5>Dataset: '+feature.getId()+'</h5><p>';\n\tlayers=feature.get('layergroups');\n\thtml = html.concat('<b>Span: </b>'+feature.get('startdate')+' - '+ feature.get('enddate'))\n\thtml = html.concat(' <b>Available Layers: </b><span class=\"upper\">')\n\tfor (l in layers){ // display layertypes\n \t\thtml=html.concat(layers[l].layertype + ' | ')\n \t}\n \thtml=html.slice(0,-2); // remove last ' | ' character\n \thtml = html.concat('</span></p>')\n\treturn html;\n}", "title": "" }, { "docid": "f2563816f87864ec3a73c437d7e0ba01", "score": "0.6073939", "text": "function mouseover(d) {\n\t\t \ttooltip.style(\"visibility\", \"visible\");\n\t\t}", "title": "" }, { "docid": "ccb9c98e3f9aa95763424f9c1cb45739", "score": "0.6061819", "text": "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "e749131970e883186b7dd19bcec5f48c", "score": "0.6016069", "text": "function updateTooltip2() {\n $tooltip2.style.display = tooltip_state2.display;\n $tooltip2.style.left = tooltip_state2.left + 'px';\n $tooltip2.style.top = tooltip_state2.top + 'px';\n $name_tip2.innerText = \"Exoplanet 2 Name: \" + tooltip_state2.name;\n // $name_tip.style.background = color_array[tooltip_state.group];\n $discovery_tip2.innerText = \"Discovery Method: \" + tooltip_state2.discovery;\n $distance_tip2.innerText = \"Distance (Parsecs): \" + tooltip_state2.distance;\n $radius_tip2.innerText = \"Jupiter Radius: \" + tooltip_state2.radius;\n $temp_tip2.innerText = \"Effective Temperature: \" + tooltip_state2.temp;\n $inclination_tip2.innerText = \"Inclination (Degrees): \" + tooltip_state2.inclination;\n $RA_tip2.innerText = \"Right Ascension (Degrees): \" + tooltip_state2.ra;\n $dec_tip2.innerText = \"Declination (Degrees): \" + tooltip_state2.dec;\n // $cart_tip2.innerText = \"X: \" + tooltip_state.cart[0] + \", Y: \" + tooltip_state.cart[1] + \", Z: \" + tooltip_state.cart[2];\n}", "title": "" }, { "docid": "1f84bc36a3c326a3ad44fdb646cb998e", "score": "0.59935194", "text": "function showToolTip(d, i) {\n tooltip.style({\n height: \"150px\",\n width: \"200px\",\n opacity: 0.9\n });\n var circle = d3.event.target;\n var tippadding = 5,\n tipsize = {\n dx: parseInt(tooltip.style(\"width\")),\n dy: parseInt(tooltip.style(\"height\"))\n };\n\n tooltip\n .style({\n top: d3.event.pageY - tipsize.dy - 5 + \"px\",\n left: d3.event.pageX - tipsize.dx - 5 + \"px\"\n })\n .html(\n \"<span><b>\" +\n d.Name +\n \": \" +\n d.Nationality +\n \"<br/>\" +\n \"Place: \" +\n d.Place +\n \" | Time: \" +\n d.Time +\n \"<br/>\" +\n \"Year: \" +\n d.Year +\n \"<br/><br/>\" +\n \"Doping: \" +\n d.Doping +\n \"</b></span>\"\n );\n }", "title": "" }, { "docid": "a5efc250f9cb4e9dc9c51245afa227a6", "score": "0.5990055", "text": "function ToolTip() {\n $(\"#qmark\").mouseover(function() {\n $(\"#qmarktip\").show();\n }).mouseout(function() {\n $(\"#qmarktip\").hide();\n });\n}", "title": "" }, { "docid": "b6f0ddd879e8b1c92684cb8bc49af03f", "score": "0.59890115", "text": "function mapOnHoverEnter(object) {\n\td3.select(object).attr('fill', 'yellow');\n\tstate = stateData[object.id];\n\t\n\tvar histIdFun = \"#hist\" + object.id;\n\td3.select(histIdFun)\n\t\t.attr(\"fill\", \"#008000\");\n\td3.select(histIdFun+\"name\")\n\t\t.attr(\"y\",height+25)\n\t\t.attr(\"font-size\", \"16px\")\n\t\t.attr(\"font-weight\", \"bold\")\n\t\t.text(abbrToName[histIdFun.substring(histIdFun.length-2,histIdFun.length)]);\n\t\t\n\tvar scatterIdFun = \"#scatter\" + object.id;\n\td3.select(scatterIdFun)\n\t\t.attr(\"fill\", \"#00FFFF\");\n\td3.select(scatterIdFun+\"name\")\n\t\t.attr(\"y\",height+30)\n\t\t.attr(\"font-size\", \"16px\")\n\t\t.attr(\"font-weight\", \"bold\")\n\t\t.text(abbrToName[scatterIdFun.substring(scatterIdFun.length-2,scatterIdFun.length)]);\n}", "title": "" }, { "docid": "6061c2799336e14a6381c4066c3f564d", "score": "0.5984475", "text": "function showTooltip(d) {\n moveTooltip();\n\n tooltip.style(\"display\",\"block\")\n .text(d.properties.name);\n }", "title": "" }, { "docid": "6513adaa968e93e596b6cd2a31f8fc1c", "score": "0.59785485", "text": "function showTooltip(content, event) {\n tt.style('opacity', 0.8)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "88fd26890c5d8379140e1ffca4cad61e", "score": "0.59745806", "text": "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "f4ef6794cc845025e45a65595999c4bd", "score": "0.597294", "text": "function mapHover(event)\n{\n //Get mouse coordinates within the map display\n var x = event.offsetX; var y = event.offsetY;\n\n var countryCode = getCountryCodeAtCoord(x, y);\n\n var hoverText = document.getElementById(\"hover_indicator\");\n\n if (countryCode != null)\n {\n var canvasID = \"layer_\" + countryCode;\n var countryName = document.getElementById(canvasID).getAttribute('name');\n hoverText.innerHTML = \"Explore: \" + countryName;\n document.body.style.cursor = 'pointer';\n }\n else\n {\n hoverText.innerHTML = \"Explore: ...\";\n document.body.style.cursor = 'default';\n }\n}", "title": "" }, { "docid": "e20116415bcc98cc560f34740b4817e9", "score": "0.5971515", "text": "function display_map() {\n var activity_data = new Datamap({\n scope: 'usa',\n element: document.getElementById('map_severity'),\n geographyConfig: {\n popupTemplate: function(geography, data) {\n return '<div class=\"hoverinfo\">' + geography.properties.name + '<br>'+\n 'current state : ' + data.hoverData;\n },\n highlightBorderWidth: 3\n },\n\n /*\n Colors for different activity levels\n */\n fills: {\n 'Local Activity': '#CC6633',\n 'Regional': '#FF0033',\n 'Sporadic': '#FFFF00',\n 'No Activity': '#347C2C',\n 'No Report': '#660033',\n defaultFill: '#EDDC4E'\n },\n data: populateStateData()\n });\n activity_data.labels();\n}", "title": "" }, { "docid": "a7cd804f233842f9d11557860a4f6d68", "score": "0.5970999", "text": "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "a7cd804f233842f9d11557860a4f6d68", "score": "0.5970999", "text": "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "0cf8181306ffddc16701108069ca0281", "score": "0.59636295", "text": "function mouseOverHandler(d) {\n\td3.select('#map_text').text(d.properties.NAME_1);\n\td3.select(this).attr('fill', '#9aeae6');\n}", "title": "" }, { "docid": "008f16ae6d2aa055747792ba0e3144c0", "score": "0.5962609", "text": "function updateToolTip(chosenYAxis,chosenXAxis, StatecirclesGroup, StateTextGroup) {\nvar toolTip = d3.tip()\n .attr('class','d3-tip')\n // .offset([80, -60])\n .html( d => {\n \tif(chosenXAxis === \"poverty\")\n\t return (`${d.state}<br>${chosenYAxis}:${d[chosenYAxis]}% \n\t \t\t<br>${chosenXAxis}:${d[chosenXAxis]}%`)\n \telse if (chosenXAxis === \"income\")\n\t return (`${d.state}<br>${chosenYAxis}:${d[chosenYAxis]}% \n\t \t\t<br>${chosenXAxis}:$${d[chosenXAxis]}`)\n\t else\n\t \treturn (`${d.state}<br>${chosenYAxis}:${d[chosenYAxis]}% \n\t \t\t<br>${chosenXAxis}:${d[chosenXAxis]}`)\n\t });\n\n \n\tStatecirclesGroup.call(toolTip);\n\tStatecirclesGroup.on('mouseover', toolTip.show).on('mouseout', toolTip.hide);\n\n\td3.selectAll('.StateTextGroup').call(toolTip);\n\td3.selectAll('.StateTextGroup').on('mouseover', toolTip.show).on('mouseout', toolTip.hide);\n\n\treturn StatecirclesGroup;\n\treturn StateTextGroup;\n}", "title": "" }, { "docid": "062efadaea6fbd5c8a6a0ca28b846af0", "score": "0.59617025", "text": "function mapMouseEnter(event) {\n map.getCanvas().style.cursor = 'pointer';\n map.getCanvas().title = event.lngLat.lat + ', ' + event.lngLat.lng;\n }", "title": "" }, { "docid": "bb4a0c88bcae41e9ff16a9e5e766f986", "score": "0.59609175", "text": "function displayGraphTooltip() { \n\tvar _div_factor; /** Variable to store the dividing value for finding x position */\n bacterial_growth_stage.on(\"stagemousemove\", function(event) { \n if ( mouse_over_graph ) { /** If the mouse is over the grid */\n\t\t\tgraph_tooltip_text.alpha = 1;\n\t\t\tbacterial_growth_stage.addChild(graph_tooltip_text); /** Adding tooltip component to the stage*/\n /** Finding the x and y values of graph and display it on the text area */\n\t\t\tswitch ( selected_index ) {\n\t\t\t\t/** To display the tool tip x,y values if the selected item is Staphylococcus aureus */\n\t\t\t\tcase \"0\": _div_factor = 2;\n\t\t\t\t\t\t /** Differences = Highest Y value in each division / Distance between the selected point and the base point */\n\t\t\t\t\t\t calculateFn(DIFFERENCE1,DIFFERENCE2,DIFFERENCE3,DIFFERENCE4,event.stageX,event.stageY,_div_factor)\n\t\t\t\t\t\t break;\t\n\t\t\t\t/** To display the tool tip x,y values if the selected item is Escherichia coli */\n\t\t\t\tcase \"1\": _div_factor = 3;\n\t\t\t\t\t\t /** Differences = Highest Y value in each division / Distance between the selected point and the base point */\n\t\t\t\t\t\t calculateFn(DIFFERENCE1/10,DIFFERENCE2/10,DIFFERENCE3/10,DIFFERENCE4/10,event.stageX,event.stageY,_div_factor)\n\t\t\t\t\t break;\n\t\t\t} \n\t\t\tgraph_tooltip_text.x = event.stageX + 3 ;\n\t\t\tgraph_tooltip_text.y = event.stageY - 25;\n\t } else { /** Else its out of the grid */\n\t\t\tgraph_tooltip_text.alpha = 0; /** To hide the tooltip box */\n }\n\t\tbacterial_growth_stage.update(); /** Updating the stage */\t\t\n });\n}", "title": "" }, { "docid": "b1aba3d20def7074601ae7d4f886b90c", "score": "0.5960855", "text": "function mouseOver (response, data, color, tooltip) {\r\n var countries = d3.select('.countries')\r\n .selectAll('path')\r\n .data(response[0].features)\r\n .style('fill', function (d) {\r\n var foundColor = '';\r\n data.forEach(function (t) {\r\n if (t.country === d.properties.name) {\r\n foundColor = color(t.success);\r\n }\r\n\r\n });\r\n return foundColor;\r\n });\r\n\r\n countries.on('mouseover', function (d) {\r\n tooltip.transition()\r\n .duration(10)\r\n .style('opacity', 1)\r\n .style('stroke', 'black')\r\n .style('stroke-width', 5);\r\n\r\n // get the country the user is hovering over\r\n var selectedCountry = getSelectedCountry(d, data, 'country', 'properties', 'name');\r\n subBoxMap(selectedCountry);\r\n if (selectedCountry === '') {\r\n tooltip.html('<div id=\"thumbnail\"><span> No Data')\r\n .style('left', (d3.event.pageX) + 'px')\r\n .style('top', (d3.event.pageY) + 'px');\r\n } else {\r\n d3.select('.subBoxMap')\r\n .selectAll('*')\r\n .style('visibility', 'visible');\r\n\r\n tooltip.html('<div id=\"thumbnail\"><span> Country: ' +\r\n selectedCountry.country + '<br> Terrorist attacks: ' +\r\n Math.round(selectedCountry.success))\r\n .style('left', (d3.event.pageX) + 'px')\r\n .style('top', (d3.event.pageY) + 'px');\r\n }\r\n\r\n d3.select(this)\r\n .style('opacity', 1)\r\n .style('stroke', 'white')\r\n .style('stroke-width', 3);\r\n })\r\n .on('mouseout', function (d) {\r\n d3.select('.subBoxMap')\r\n .selectAll('*')\r\n .style('visibility', 'hidden');\r\n\r\n tooltip.transition()\r\n .duration(500)\r\n .style('stroke', 'white')\r\n .style('opacity', 0);\r\n\r\n d3.select(this)\r\n .style('opacity', 0.8)\r\n .style('stroke', 'white')\r\n .style('stroke-width', 0.3);\r\n });\r\n}", "title": "" }, { "docid": "dd1c98de37071a2b40fd284532a672c9", "score": "0.59529364", "text": "function handleMouseOver(d) { // Add interactivity\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n tooltip.html(\"(\" + d.x + \", \" + d.y + \")\")\n .style(\"left\", (d3.event.pageX + 5) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n }", "title": "" }, { "docid": "747f396fe7f66045cbeeb50fca3cb2b8", "score": "0.5951225", "text": "function Tooltip(){}", "title": "" }, { "docid": "bef822ea94cd40f26d505c05f930d8f4", "score": "0.59489995", "text": "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div').attr('id', 'tooltip').html('<b>' + d.properties.name + '</b>' + '<b><br/> Percentage of population under Forced Labor</b>: ' + d.properties.slavery / 100 + '%').style('opacity', 0.8).style('top', yPosition + 'px').style('left', xPosition + 'px');\n\n d3.select(this).style('fill', '#ffffff');\n }", "title": "" }, { "docid": "a76289cb9fee87cba61c6fd6715369f0", "score": "0.5943017", "text": "onMouseLeave(evt) {\n\t\tthis.setState({\n\t\t\ttoolTip: {\n\t\t\t\tdisplay: 'none',\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "898377835e44f1f2333634b154122400", "score": "0.59391505", "text": "function DisplayToolt() {\n\t// Create the span element and set the class name\n\tvar spanTooltip = document.createElement(\"span\");\n\tspanTooltip.className = \"tooltip\";\n\t\n\t// Add the mousemove event listener to the tab element that called the function\n\tthis.addEventListener(\"mousemove\", ChangeTooltipPosition);\n\t\n\t// Determine the text displayed in the tooltip\n\tvar headerTabInfoId = 0;\n\tif (this.id == \"home\") headerTabInfoId = 0;\n\telse if (this.id == \"profile\") headerTabInfoId = 1;\n\telse if (this.id == \"learn\") headerTabInfoId = 2;\n\telse if (this.id == \"games\") headerTabInfoId = 3;\n\t\n\t// Set the text of the tooltip to the determined string\n\tspanTooltip.innerHTML = headerTabInfo[headerTabInfoId];\n\tthis.appendChild(spanTooltip);\n}", "title": "" }, { "docid": "18a9e4c87699a7e28f9dfbf209eb43af", "score": "0.5933092", "text": "function handleMouseOver(d) {\n var xPosition = d3.mouse(this)[0];\n var yPosition = d3.mouse(this)[1] + 20;\n\n d3.select('body').append('div').attr('id', 'tooltip').html('<b>' + d.properties.name + '</b><br/><u> U.S. Military Bases </u><br/>Unconfirmed: ' + d.properties.unconfirmed + '<br/>Confirmed: ' + d.properties.total + '<br/>Others: ' + d.properties.lily).style('opacity', 0.8).style('top', yPosition + 'px').style('left', xPosition + 'px');\n d3.select(this);\n }", "title": "" }, { "docid": "d4473585333b57caaabdb32eccf66f53", "score": "0.5910343", "text": "function show_tooltip(svg, node, xmin, xmax, d) {\n var tooltip = tooltipTemplate(d);\n\n window.tooltip\n .transition()\n .style('opacity', .9);\n window.tooltip\n .html(tooltip)\n .style(\"left\", (d3.event.pageX + 20) + \"px\") \n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n}", "title": "" }, { "docid": "e421b31f2f11916af4f21fb1edb1a7b0", "score": "0.59020925", "text": "function histOnHoverEnter(object)\n{\n\td3.select(object)\n\t\t.attr(\"fill\", \"#008000\");\n\td3.select(\"#\"+object.id+\"name\")\n\t\t.attr(\"y\",height+25)\n\t\t.attr(\"font-size\", \"16px\")\n\t\t.attr(\"font-weight\", \"bold\")\n\t\t.text(abbrToName[object.id.substring(object.id.length-2,object.id.length)]);\n\t\n\tvar idFun = object.id.substring(4,6);\n\td3.select(\"#\" + idFun).attr('fill', 'yellow');\n\tstate = stateData[idFun];\n}", "title": "" }, { "docid": "8d2d7815a66165d3bbcac7322607143d", "score": "0.5897887", "text": "function showTooltip() {\n\t var divElement = $(\"#tooltip\");\n\n\n\t if (divElement && latestMouseProjection) {\n\t divElement.css({\n\t display: \"block\",\n\t opacity: 0.0\n\t });\n\n\t var canvasHalfWidth = renderer.domElement.offsetWidth / 2;\n\t var canvasHalfHeight = renderer.domElement.offsetHeight / 2;\n\n\t var tooltipPosition = latestMouseProjection.clone().project(camera);\n\t tooltipPosition.x = (tooltipPosition.x * canvasHalfWidth) + canvasHalfWidth + renderer.domElement.offsetLeft;\n\t tooltipPosition.y = -(tooltipPosition.y * canvasHalfHeight) + canvasHalfHeight + renderer.domElement.offsetTop;\n\n\t var tootipWidth = divElement[0].offsetWidth;\n\t var tootipHeight = divElement[0].offsetHeight;\n\n\t divElement.css({\n\t left: `${tooltipPosition.x - tootipWidth/2}px`,\n\t top: `${tooltipPosition.y - tootipHeight - 5}px`\n\t });\n\n\t // var position = new THREE.Vector3();\n\t // var quaternion = new THREE.Quaternion();\n\t // var scale = new THREE.Vector3();\n\t // hoveredObj.matrix.decompose(position, quaternion, scale);\n\t divElement.text(hoveredObj.name);\n\t console.log(hoveredObj.name);\n\n\t setTimeout(function() {\n\t divElement.css({\n\t opacity: 1.0\n\t });\n\t }, 5);\n\t }\n\t}", "title": "" }, { "docid": "b866abbeffe257b63ffa9e05c72f17d7", "score": "0.5893651", "text": "function mouseOver (response, data, color, tooltip) {\n var countries = d3.select('.countries')\n .selectAll('path')\n .data(response[0].features)\n .style('fill', function (d) {\n var foundColor = '';\n data.forEach(function (t) {\n if (t.country === d.properties.name) {\n foundColor = color(t.suicides_per_10000); }\n });\n return foundColor;\n });\n\n countries.on('mouseover', function (d) {\n tooltip.transition()\n .duration(10)\n .style('opacity', 1)\n .style('stroke', 'black')\n .style('stroke-width', 5);\n\n // get the country the user is hovering over\n var selectedCountry = getSelectedCountry(d, data, 'country', 'properties', 'name');\n subBoxMap(selectedCountry);\n if (selectedCountry === '') {\n tooltip.html('<div id=\"thumbnail\"><span> No Data')\n .style('left', (d3.event.pageX) + 'px')\n .style('top', (d3.event.pageY) + 'px');\n } else {\n d3.select('.subBoxMap')\n .selectAll('*')\n .style('visibility', 'visible');\n\n tooltip.html('<div id=\"thumbnail\"><span> Country: ' +\n selectedCountry.country + '<br> Suicides per 10000: ' +\n Math.round(selectedCountry.suicides_per_10000))\n .style('left', (d3.event.pageX) + 'px')\n .style('top', (d3.event.pageY) + 'px');\n }\n\n d3.select(this)\n .style('opacity', 1)\n .style('stroke', 'white')\n .style('stroke-width', 3);\n })\n .on('mouseout', function (d) {\n d3.select('.subBoxMap')\n .selectAll('*')\n .style('visibility', 'hidden');\n\n tooltip.transition()\n .duration(500)\n .style('stroke', 'white')\n .style('opacity', 0);\n\n d3.select(this)\n .style('opacity', 0.8)\n .style('stroke', 'white')\n .style('stroke-width', 0.3);\n });\n}", "title": "" }, { "docid": "59e9b5cc0de82e8acc142f7efa949ba3", "score": "0.5887766", "text": "function PrayerPlanEntryTooltipShown()\r\n{\r\n strHelpTopic = \"edit_prayerplan_entry\";\r\n}", "title": "" }, { "docid": "0f3b740d880c646b5baf75ef1654ec2c", "score": "0.58805513", "text": "function mouseOver_topgenre(d) {\n d3.select(\"#tooltip\")\n .attr(\"class\", \"toolTip\")\n .transition().duration(300)\n .style(\"opacity\", 0.8)\n .style(\"left\", (d3.event.pageX - 345) + \"px\")\n .style(\"top\", (d3.event.pageY - 120) + \"px\");\n\n var top_genre = \"\"\n if (d.properties.value) {\n d3.select(this).style(\"opacity\", 1)\n top_genre = GENRES[d.properties.value][\"label\"];\n\n d3.select(\"#tooltip\").html(\n \"<h4>\" + d.properties.name + \" (\" + d.properties.abbr + \")\" + \"</h4>\" +\n \"<table><tr><td> Top Genre:</td><td class='titleCase'>\" + top_genre + \"</td></tr>\" +\n \"<tr><th class='center'>Genre</th><th class='center'>No. of shows</th></tr>\" +\n \"<tr><td class='left'><div class='legend-color pop'></div>Pop</td><td>\" + d.properties.num.pop + \"</td></tr>\" +\n \"<tr><td class='left'><div class='legend-color rock'></div>Rock</td><td>\" + d.properties.num.rock + \"</td></tr>\" +\n \"<tr><td class='left'><div class='legend-color hip-hop'></div>Hip Hop</td><td>\" + d.properties.num.hip_hop + \"</td></tr>\" +\n \"<tr><td class='left'><div class='legend-color rnb'></div>R&B</td><td>\" + d.properties.num.rnb + \"</td></tr>\" +\n \"<tr><td class='left'><div class='legend-color classical_jazz'></div>Classical & Jazz</td><td>\" + d.properties.num.classical_and_jazz + \"</td></tr>\" +\n \"<tr><td class='left'><div class='legend-color electronic'></div>Electronic</td><td>\" + d.properties.num.electronic + \"</td></tr>\" +\n \"<tr><td class='left'><div class='legend-color country_folk'></div>Country & Folk</td><td>\" + d.properties.num.country_and_folk + \"</td></tr>\" +\n \"</table>\" +\n \"<small>(click to zoom)</small>\")\n\n } else {\n d3.select(\"#tooltip\").html(\n \"<h4>\" + d.properties.name + \" (\" + d.properties.abbr + \")\" + \"</h4>\" +\n \"<table><tr><td> No upcoming shows </td></tr></table>\");\n }\n }", "title": "" }, { "docid": "0176a35bd3ee73b8a7fce238c8efb831", "score": "0.5879934", "text": "function showDetail(d) {\n\n\n var content = '<span class=\"name\">'+d.value+' </span><span class=\"value\"> Hours</span><br/>';\n\n tooltip.showTooltip(content, d3.event);\n }", "title": "" }, { "docid": "d0d0bdfcdcebaface3b26c0816e701a0", "score": "0.5879773", "text": "function Over (event, n) {\r\n var ok = tok[n];\r\n\r\n if (ok === false || !GetChecked ('intip')) {\t// Suppress tips on suppressed elements\r\n\treturn;\t\t\t\t// or if tool tips are globally disabled\r\n }\t\t\t\t\t// (But ok === undefined is ALLOWED)\r\n\r\n n = 'tip' + n;\r\n\r\n if (tipname !== n) {\t\t// If changed tips, cancel previous one\r\n\tOut ();\r\n }\r\n\r\n tipname = n;\r\n\r\n if (!tipshown && !tiptimer) {\t// Start timer to eventually draw tip\r\n\tvar xy = MouseAbs (event);\r\n\tSetLeft ('tooltip', xy[0]);\r\n\tSetTop ('tooltip', xy[1]);\r\n\tTimerOn ();\t\t\t// Start tip-timer\r\n }\r\n}", "title": "" }, { "docid": "bd8927c0bf6bc64569d19ef3357da2c8", "score": "0.5876823", "text": "function stateMouseover(d) {\n bringStateToTop(d);\n d3.select(this)\n .style('stroke-width', '2')\n .style('stroke', '#08306b');\n\n focus\n .select('rect')\n .remove();\n\n focus\n .selectAll('text')\n .remove();\n\n focusDrawBar(d);\n focusAddStateName(d);\n drawAverageStateGrowth();\n focusAddPercentage(d);\n}", "title": "" }, { "docid": "873123665ad09811c4c8b3a5fd3db2bc", "score": "0.5873742", "text": "onMouseOver(e){\n if(!this.isDragging){\n var pos = e.data.getLocalPosition(this.parent);\n this.tooltip.x = pos.x - this.x + this.data.tooltip.offset.x;\n this.tooltip.y = pos.y - this.y + this.data.tooltip.offset.y;\n this.tooltip.visible = true;\n }\n }", "title": "" }, { "docid": "8a23b718853cd45717d2195925e871f7", "score": "0.5860868", "text": "function showTooltipCountry(d) {\r\n // filter only points in the country\r\n var mouse = d3.mouse(svg.node()).map(function (d) {\r\n return parseInt(d);\r\n });\r\n\r\n tooltip.classed('hidden', false)\r\n .html(d.country)\r\n .attr('style', 'left:' + (mouse[0] + 15) + 'px; top:' + (mouse[1] - 35) + 'px')\r\n }", "title": "" }, { "docid": "0e302eead9064c5b57d9d143c759af2a", "score": "0.58373713", "text": "function tooltip_in(d){\n //show the tooltip\n div.transition()\t\t\n .duration(200)\t\t\n .style(\"opacity\", .9);\t\t\n div.html(d)\t\n .style(\"left\", (d3.event.pageX + 20) + \"px\")\t\t\n .style(\"top\", (d3.event.pageY - 50) + \"px\");\n}", "title": "" }, { "docid": "fbe17bb33acd475d372dd0fb2e32e7f2", "score": "0.5829189", "text": "_showTooltip() {\n this._tooltipVisible = true;\n this._render(); \n }", "title": "" }, { "docid": "d67123de4c3f6f384cc0f22c17cc27f9", "score": "0.5824326", "text": "function onMouseOver(d, i) {\n tooltip\n .transition()\n .duration(300)\n .style('opacity', 0.9)\n .style('left', d3.event.pageX + 'px')\n .style('top', d3.event.pageY + 'px');\n tooltip\n .html(function(d) {\n return (\n 'Year:' +\n monthlyData[i].year +\n '<br/>' +\n 'Month: ' +\n arrMonths[monthlyData[i].month - 1] +\n '<br/>' +\n 'Temperature: ' +\n (parseFloat(monthlyData[i].variance) + parseFloat(data.baseTemperature)).toFixed(2)\n );\n })\n .attr('data-year', function(d) {\n return monthlyData[i].year;\n });\n }", "title": "" }, { "docid": "4ba1842a033d75642c2c13784082e762", "score": "0.5817864", "text": "function TooltipIn(evt) {\n document.getElementById(evt.target.value + 'Tooltip').style.display = 'block';\n}", "title": "" }, { "docid": "ed38a221315c2c9a0cf29662012e1d20", "score": "0.58177394", "text": "function tooltip_info(province, male, female, black_african, white, indian_asian, coloured, total) {\r\n d3.select(\"#tt_province\")\r\n .text(province);\r\n d3.select(\"#tt_male\")\r\n .text(male);\r\n d3.select(\"#tt_female\")\r\n .text(female);\r\n d3.select(\"#tt_black_african\")\r\n .text(black_african);\r\n d3.select(\"#tt_white\")\r\n .text(white);\r\n d3.select(\"#tt_indian_asian\")\r\n .text(indian_asian);\r\n d3.select(\"#tt_coloured\")\r\n .text(coloured);\r\n d3.select(\"#tt_total\")\r\n .text(total);\r\n}", "title": "" }, { "docid": "c208a41573addba0dfa05b8b4e938abe", "score": "0.5816605", "text": "updateTooltip () {\n // Make sure that the tooltip has been initialized and that it has a valid country connected to it\n if (typeof this.tooltip !== 'undefined' && typeof this.tooltipCurrentID !== 'undefined') {\n var data = this.ctrl.data[this.tooltipCurrentID.toLowerCase()];\n var html;\n\n // Make sure that the country has data\n if (typeof data !== 'undefined') {\n var curr = data.cur;\n var commonMinMax;\n\n // If a timelapse is in progress, get the value from that instead\n if (this.ctrl.timelapseHandler.isAnimating) {\n curr = data.all[this.ctrl.timelapseHandler.getCurrent()];\n }\n\n // If the option individualMaxValue is false, find a common min and max value\n if (!this.ctrl.panel.individualMaxValue) {\n commonMinMax = this.findCommonMinMaxValue();\n }\n\n html = '<div class = \\'d3tooltip-title\\'>' + this.tooltipCurrentNAME + '</div>';\n html += '<div class = \\'d3tooltip-info\\'><div class = \\'d3tooltip-left\\'>Percent: </div><div class = \\'d3tooltip-right\\'>' + Math.floor(this.getCountryPercentage(this.tooltipCurrentID, commonMinMax)) + '%</div><div class = \\'d3tooltip-clear\\'></div></div>';\n html += '<div class = \\'d3tooltip-info\\'><div class = \\'d3tooltip-left\\'>Current: </div><div class = \\'d3tooltip-right\\'>' + curr + '</div><div class = \\'d3tooltip-clear\\'></div></div>';\n\n if (this.ctrl.panel.individualMaxValue) {\n html += '<div class = \\'d3tooltip-info\\'><div class = \\'d3tooltip-left\\'>Min: </div><div class = \\'d3tooltip-right\\'>' + data.min + '</div><div class = \\'d3tooltip-clear\\'></div></div>';\n html += '<div class = \\'d3tooltip-info\\'><div class = \\'d3tooltip-left\\'>Max: </div><div class = \\'d3tooltip-right\\'>' + data.max + '</div><div class = \\'d3tooltip-clear\\'></div></div>';\n html += '<div class = \\'d3tooltip-info\\'><div class = \\'d3tooltip-left\\'>Trend: </div><div class = \\'d3tooltip-right\\'>' + data.trend + '%</div><div class = \\'d3tooltip-clear\\'></div></div>';\n } else {\n html += '<div class = \\'d3tooltip-info\\'><div class = \\'d3tooltip-left\\'>Common min: </div><div class = \\'d3tooltip-right\\'>' + commonMinMax.min + '</div><div class = \\'d3tooltip-clear\\'></div></div>';\n html += '<div class = \\'d3tooltip-info\\'><div class = \\'d3tooltip-left\\'>Common max: </div><div class = \\'d3tooltip-right\\'>' + commonMinMax.max + '</div><div class = \\'d3tooltip-clear\\'></div></div>';\n }\n\n } else {\n html = '<div class = \\'d3tooltip-title\\'>' + this.tooltipCurrentNAME + '</div>';\n html += '<div class = \\'d3tooltip-undefined\\'>No available data</div>';\n }\n\n this.tooltip.html(html);\n }\n }", "title": "" }, { "docid": "d56b7f6038dd4dad23c1d77bc770be54", "score": "0.58146924", "text": "function interact(state, i) {\n if (state == 'over') {\n highlightBubble(i);\n showTooltip(i);\n }\n else {\n unhighlightBubble(i);\n hideTooltip(i);\n }\n return true;\n }", "title": "" }, { "docid": "95f13129f66e9dfbe74014ac4b80b9b6", "score": "0.5812258", "text": "function showDetail(d) {\n // change outline to indicate hover state.\n d3.select(this).attr('stroke', 'black');\n\n var content = '<span class=\"name\">Name: </span> <span class=\"value\">' +\n d.name +\n '</span><br/>' +\n '<span class=\"name\">Frequency: </span><span class=\"value\">' +\n d.value +\n '</span><br/>' +\n '<span class=\"name\">Type: </span><span class=\"value\">' +\n d.year +\n '</span>';\n tooltip.showTooltip(content, d3.event);\n }", "title": "" }, { "docid": "c854adc688f9a8b3b97c2dc616293dd8", "score": "0.58106947", "text": "onMouseOverEventHandler(context, self, game, tooltip) {\r\n if (!d3.select(context).classed(\"selected\")) {\r\n // Make the circle swell when the mouse is on it\r\n d3.select(context)\r\n .transition()\r\n .duration(500)\r\n .attr(\"r\", 2 * self.radius)\r\n .style(\"cursor\", \"pointer\");\r\n\r\n // Set tooltip transition\r\n tooltip.transition()\r\n .duration(400)\r\n .style(\"opacity\", 0.8)\r\n .style(\"width\", \"100px\");\r\n\r\n // Set tooltip's text\r\n tooltip.html(game.Name);\r\n self.setTooltipPosition(self, tooltip);\r\n }\r\n }", "title": "" }, { "docid": "0c31afd694715d32c2f9722eec88929d", "score": "0.5809593", "text": "function BeginTooltip() {\n bind.BeginTooltip();\n}", "title": "" }, { "docid": "0cc553d21fa2e5d7b2f3c07568ed108a", "score": "0.58038896", "text": "function WP_GEO_show_tooltip(x,y,z,d,type)\n{\t\t\n\tWP_GEO_remove_tooltip();\n\tvar contents;\n\tif(type === \"\")\n\t{\n\t\tcontents =\"<table>\"\n +\"<tr><th style='font-weight:bold;text-align:right;width=50px'> Distance : </th>\"\n\t\t+\"<td style='text-align:right;width=50px'> &nbsp; \"+d+\" km </td> </tr>\"\n\t\t+\"<tr><th style='font-weight:bold;text-align:right;width=50px'> Altitude : </th>\"\n\t\t+\"<td style='text-align:right;width=50px'> &nbsp; \"+z+\" m </td></tr>\"\n\t\t+\"</table>\";\n\t} else\n\t{\n\t\tcontents =\"<table>\"\n +\"<tr><th style='font-weight:bold;text-align:right;width=50px'> Distance : </th>\"\n +\"<td style='text-align:right;width=50px'> &nbsp; \"+d+\" km </td> </tr>\"\n +\"<tr><th style='font-weight:bold;text-align:right;width=50px'> Vitesse : </th>\"\n +\"<td style='text-align:right;width=50px'> &nbsp; \"+z+\" km/h </td></tr>\"\n +\"</table>\";\n\t}\n\t\t\n\tjQuery('<div id=\"tooltip\">' + contents + '</div>').css( {\n position: 'absolute',\n\t\tdisplay: 'none',\n\t\t'z-index': 10000,\n\t\ttop: y + 5,\n\t\tleft: x + 5,\n\t\tborder: '1px solid #fdd',\n\t\tpadding: '2px',\n\t\t'background-color': '#fee',\n\t\topacity: 0.80\n\t}).appendTo(\"body\").fadeIn(200);\n\t// jQuery(\"#tooltip\").css('z-index')=1000;\n}", "title": "" }, { "docid": "5253c145fe2e5ab7110ee63bd4a70ef9", "score": "0.580201", "text": "function displayTooltip(evt,infoShape){\n\n\tif (infoShape && infoShape.nodeType == 1 ){\n\t\t// read tooltip from shape\n\t\tvar szText = (infoShape.getAttributeNS(szMapNs,\"tooltip\") || \"\");\n\t\t// add parents tooltips until 'g' element\n\t\twhile ( (infoShape = infoShape.parentNode) != null ){\n\t\t\tif ( (infoShape.nodeName != 'g') ){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar szXText = infoShape.getAttributeNS(szMapNs,\"tooltip\");\n\t\t\tif ( szXText && szXText.length ){\n\t\t\t\tszText = szXText;\n\t\t\t\t//szText += (szText.length?String.fromCharCode(32,160):\"\") + szXText;\n\t\t\t}\n\t\t}\n\t\tif (szText && szText.length ){\n\t\t\ttry{\n\t\t\t\tszText = map.User.onTooltipDisplay(null,szText,infoShape);\n\t\t\t\t}\n\t\t\tcatch (e){\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tszText = HTMLWindow.ixmaps.htmlgui_onTooltipDisplay(evt,szText);\n\t\t\t\t}\n\t\t\tcatch (e){\n\t\t\t}\n\t\t\tif (idTooltipTimeout){\n\t\t\t\tclearTimeout(idTooltipTimeout);\n\t\t\t}\n\t\t\tif (szText && szText.length ){\n\t\t\t\tvar position = map.Scale.getClientMousePosition(evt,SVGPopupGroup);\n\t\t\t\tkillTooltip();\n\t\t\t\tidTooltipTimeout = setTimeout(\"doDisplayTooltip(\\\"\"+__stripQuotes(szText)+\"\\\",\"+position.x+\",\"+position.y+\")\",nTooltipTimeout);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "4a5e3663778287c687b0a7bc3738bcef", "score": "0.58017814", "text": "function makeTooltipHTML(d) {\n var name = d.properties.NAME + \" County\";\n var html = \"<p><strong>\" + name + \"</strong></p>\"\n return html;\n}", "title": "" }, { "docid": "154ed6dd74623d2d36cb943be032568e", "score": "0.57965016", "text": "toolTip(event) {\n let nodeCand = parseInt(event.target.id.replace(\"svgnodenodeGraph\", \"\"));\n\n if (nodeCand != undefined && !isNaN(nodeCand)) {\n let highlight = this.state.highlight[nodeCand];\n if (highlight != undefined) {\n let targets = highlight[0].nodes.map(item => { return item.target });\n let overall = [...highlight[0].nodes.map(item => { return item.source }), ...targets];\n\n let unique = new Set(overall);\n\n this.setState({viewingTooltip: true, toolTipText: \"Looks like the best results for this iteration used: \" + [...unique].join(' ') + \" as the indicators for its prediction.\"});\n }\n \n } else if (event.target.id === \"svgbubblebubbleGraph\") {\n\n let actual = this.state.predictions[0].predictions[0].comparable.value;\n let size = this.state.chart.data.length;\n let belowActual = this.state.chart.data.filter(item => { return item.value < actual }).length;\n \n // A buy indicator\n if (belowActual > size / 2) {\n this.setState({viewingTooltip: true, toolTipText: \"We are looking at a potential potential BUY indicator as \" + belowActual + \" predictions were found below the last actual price.\"});\n } else { // sell indicator\n this.setState({viewingTooltip: true, toolTipText: \"We are looking at a potential potential SELL indicator as \" + (size - belowActual) + \" predictions were found below the last actual price.\"});\n }\n } else {\n this.setState({viewingTooltip: false, toolTipText: \"\"});\n }\n }", "title": "" }, { "docid": "307108058b7b4ffb74a4b468f56aaa80", "score": "0.578515", "text": "function tipMouseOut() {\n tooltip\n .transition()\n .duration(500) // ms\n .style(\"opacity\", 0); // don't care about position!\n //d3.select(this).attr(\"r\", 5);\n }", "title": "" }, { "docid": "d7103ef1d13e6ceb391a273bea7ff089", "score": "0.5781891", "text": "function man_tooltip_track(e){\n\n\n if (man_isTooltipVisible() && man_tooltip_staticFlag){\n return;\n }\n if (!e){\n e = window.event;\n }\n\n var xyScrollOffset =man_getScrollXY();\n\n // Update global position of the mouse\n\n man_tooltip_xM = e.clientX + xyScrollOffset[0];\n man_tooltip_yM = e.clientY + xyScrollOffset[1];\n\n // update position of tooltip.\n var tp= document.getElementById(tooltipID);\n tp.style.top=(man_tooltip_yM + man_tooltip_yoffset) + \"px\";\n tp.style.left=(man_tooltip_xM + man_tooltip_xoffset) + \"px\";\n if (debug){\n window.status = man_tooltip_xM + \",\" +man_tooltip_yM + \",\" +\n man_tooltip_xoffset + \",\" + man_tooltip_yoffset;\n }\n }", "title": "" }, { "docid": "ce84894c9b55272117b10004819cb529", "score": "0.5776546", "text": "function toolTip() {\n var tooltip = document.getElementById(\"ttip\");\n document.getElementById(\"qMark\").onmouseover = function () {\n tooltip.setAttribute(\"class\", \"tooltip\");\n };\n document.getElementById(\"qMark\").onmouseout = function () {\n tooltip.setAttribute(\"class\", \"hidden\");\n };\n}", "title": "" }, { "docid": "4aa05d689460111d2c2f477bd640af42", "score": "0.5768472", "text": "function countryHover(d) {\n\t//Change the numbers to reflect the hovered over city\n\td3.select(\"#callOutCountry\").html(d.State);\n\t//Make the callOut visible again\n\td3.select(\"#callOutCountryWrapper\")\n\t\t.style(\"visibility\",\"visible\")\n\t\t//.transition().duration(500)\n\t\t.style(\"opacity\", 1);\n}//countryHover", "title": "" }, { "docid": "9dd07b5fd98a04dfa77b38be4cd872b4", "score": "0.5766051", "text": "function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.State, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }", "title": "" }, { "docid": "c3f75318e8fe1ceead1deaa03ca93714", "score": "0.57596236", "text": "function updateTooltip() {\n $tooltip.style.display = tooltip_state.display;\n $tooltip.style.left = tooltip_state.left + 'px';\n $tooltip.style.top = tooltip_state.top + 'px';\n \n if(selectedDatums_tt.length == 2){\n $name_tip.innerText = \"Exoplanet 1 Name: \" + tooltip_state.name;\n }\n else if(selectedDatums_tt.length > 2){\n $name_tip.innerText = \"Averages of Selected Exoplanets' Data\";\n }\n else{\n $name_tip.innerText = \"Exoplanet Name: \" + tooltip_state.name;\n }\n \n if(selectedDatums_tt.length == 2){\n $discovery_tip.innerText = \"Discovery Method: \" + tooltip_state.discovery;\n }\n else if(selectedDatums_tt.length > 2){\n $discovery_tip.innerText = \"\";\n }\n else{\n $discovery_tip.innerText = \"Discovery Method: \" + tooltip_state.discovery;\n }\n\n\n if(selectedDatums_tt.length > 2){\n $distance_tip.innerText = \"Avg Distance (Parsecs): \" + tooltip_state.distance;\n }\n else{\n $distance_tip.innerText = \"Distance (Parsecs): \" + tooltip_state.distance;\n }\n\n if(selectedDatums_tt.length > 2){\n $radius_tip.innerText = \"Avg Jupiter Radius: \" + tooltip_state.radius;\n }\n else{\n $radius_tip.innerText = \"Jupiter Radius: \" + tooltip_state.radius;\n }\n\n if(selectedDatums_tt.length > 2){\n $temp_tip.innerText = \"Avg Effective Temp (K): \" + tooltip_state.temp;\n }\n else{\n $temp_tip.innerText = \"Effective Temperature (K): \" + tooltip_state.temp;\n }\n\n if(selectedDatums_tt.length > 2){\n $inclination_tip.innerText = \"Avg Inclination (Degrees): \" + tooltip_state.inclination;\n }\n else{\n $inclination_tip.innerText = \"Inclination (Degrees): \" + tooltip_state.inclination;\n }\n\n if(selectedDatums_tt.length > 2){\n $RA_tip.innerText = \"Avg Right Ascension (Degrees): \" + tooltip_state.ra;\n }\n else{\n $RA_tip.innerText = \"Right Ascension (Degrees): \" + tooltip_state.ra;\n }\n\n if(selectedDatums_tt.length > 2){\n $dec_tip.innerText = \"Avg Declination (Degrees): \" + tooltip_state.dec;\n }\n else{\n $dec_tip.innerText = \"Declination (Degrees): \" + tooltip_state.dec;\n }\n\n // if(selectedDatums_tt.length > 2){\n // $cart_tip.innerText = \"\";\n // }\n // else{\n // $cart_tip.innerText = \"X: \" + tooltip_state.cart[0] + \", Y: \" + tooltip_state.cart[1] + \", Z: \" + tooltip_state.cart[2];\n // }\n\n // $discovery_tip.innerText = \"Discovery Method: \" + tooltip_state.discovery;\n // $distance_tip.innerText = \"Distance (Parsecs): \" + tooltip_state.distance;\n // $radius_tip.innerText = \"Jupiter Radius: \" + tooltip_state.radius;\n // $temp_tip.innerText = \"Effective Temperature: \" + tooltip_state.temp;\n // $inclination_tip.innerText = \"Inclination (Degrees): \" + tooltip_state.inclination;\n // $RA_tip.innerText = \"Right Ascension (Degrees): \" + tooltip_state.ra;\n // $dec_tip.innerText = \"Declination (Degrees): \" + tooltip_state.dec;\n}", "title": "" }, { "docid": "46dfec082326c7ed8f6d044e7ccc5723", "score": "0.5756082", "text": "function showTooltip(d, coords) {\t\n\t\n\tvar xpos = coords.x;\n\tvar ypos = coords.y;\n\n\td3.select(\"#tooltip\")\n\t\t.style('top',ypos+\"px\")\n\t\t.style('left',xpos+\"px\")\n\t\t.transition().duration(500)\n\t\t.style('opacity',1);\n\t\t\n\t//Keep the tooltip moving with the planet, until stopTooltip \n\t//returns true (when the user clicks)\n\td3.timer(function(elapsed) {\n\t //Breaks from the timer function when stopTooltip is changed to true\n\t //by another function\n\t if (stopTooltip == true) { \n\t\t//Hide tooltip\n\t\td3.select(\"#tooltip\").transition().duration(25)\n\t\t\t.style('opacity',0)\n\t\t}\n\t});\n\n\tvar display_name;\n\n\tif (d.kepler_name==\"--\"){\n\t\tdisplay_name = d.kepoi_name;\n\t\tdisplay_name = display_name.split(\".\", 1); //get just the star name, not the planet name\n\t}\n\telse {\n\t\tdisplay_name = d.kepler_name;\n\t\tdisplay_name = display_name.split(\" \", 1); //get just the star name, not the planet name\n\t}\n\n\t//Change the texts inside the tooltip\n\td3.select(\"#tooltip .tooltip-planet\").text(display_name);\n\td3.select(\"#tooltip-temperature\")\t.html(\"Temperature of star: \" + d.koi_steff + \" K\");\n\td3.select(\"#tooltip-radius\")\t\t.html(\"Radius of star: \" + formatSI(d.koi_srad) + \" Solar radii\");\n\td3.select(\"#tooltip-mass\")\t\t\t.html(\"Mass of star: \" + formatSI(d.koi_smass) + \" Solar mass\");\n\td3.select(\"#tooltip-count\")\t\t\t.html(\"Number of planets: \" + d.nkoi);\n\t//d3.select(\"#tooltip-depth\")\t\t\t.html(\"Transit depth: \" + formatSI(d.koi_depth) + \" ppm\");\n\t//d3.select(\"#tooltip-duration\")\t\t.html(\"Transit duration: \" + formatSI(d.koi_duration) + \" hours\");\n\t//d3.select(\"#tooltip-ratio\")\t\t\t.html(\"Planet-Star Radius Ratio: \" + formatSI(d.koi_ror));\n\td3.select(\"#tooltip-depth\")\t\t\t.html(\"\");\n\td3.select(\"#tooltip-duration\")\t\t.html(\"\");\n\td3.select(\"#tooltip-ratio\")\t\t\t.html(\"\");\n\td3.select(\"#tooltip-button\")\t\t.html(\"<button onclick=planetView(\"+d.kepid+\")>Planet View</button>\");\n\n\t//Change the texts inside the pullout tab\n\td3.select(\"#pullout .pullout-planet\").html(\"<br />\" + display_name);\n\td3.select(\"#pullout-temperature\")\t.html(\"Temperature of star: \" + d.koi_steff + \" K\");\n\td3.select(\"#pullout-radius\")\t\t.html(\"Radius of star: \" + formatSI(d.koi_srad) + \" Solar radii\");\n\td3.select(\"#pullout-mass\")\t\t\t.html(\"Mass of star: \" + formatSI(d.koi_smass) + \" Solar masses\");\n\td3.select(\"#pullout-count\")\t\t\t.html(\"Number of planets: \" + d.nkoi);\n\t//d3.select(\"#pullout-depth\")\t\t\t.html(\"Transit depth: \" + formatSI(d.koi_depth) + \" ppm\");\n\t//d3.select(\"#pullout-duration\")\t\t.html(\"Transit duration: \" + formatSI(d.koi_duration) + \" hours\");\n\t//d3.select(\"#pullout-ratio\")\t\t\t.html(\"Planet-Star Radius Ratio: \" + formatSI(d.koi_ror));\n\td3.select(\"#pullout-depth\")\t\t\t.html(\"\");\n\td3.select(\"#pullout-duration\")\t\t.html(\"\");\n\td3.select(\"#pullout-ratio\")\t\t\t.html(\"\");\n\td3.select(\"#pullout-button\")\t\t.html(\"\");\n\n}//showTooltip\t", "title": "" }, { "docid": "dc3385e415fa9fc5c044023b7353d1dc", "score": "0.57428277", "text": "function handleMouseover(index, event) {\n if (index != null) {\n pcoord.setHighlightedPaths([index]);\n if (currentView == viewType.SCATTERPLOT || currentView == viewType.TABLE)\n view.setHighlightedPoints([index]);\n }\n else {\n pcoord.setHighlightedPaths([]);\n if (currentView == viewType.SCATTERPLOT || currentView == viewType.TABLE)\n view.setHighlightedPoints([]);\n}\n if (currentView != viewType.TABLE)\n updateInfoPane(index,event);\n}", "title": "" }, { "docid": "4cccfdc491a7ef2fd634ff753d434213", "score": "0.5740251", "text": "function onMouseMove(e)\n{\n var barNo = getMouseMoveObject(e);\n if (barNo == -1)\n {\n // Not on a bar, so don't display (last frame's) tooltip\n currentTooltipDisplay = false;\n }\n else\n {\n // Get mouse coordinates for showing the tooltip\n var mousePos = getMousePos(e);\n var posX = mousePos[0];\n var posY = mousePos[1];\n\n showTooltip(barNo, mousePos[0], mousePos[1]);\n }\n}", "title": "" }, { "docid": "99034fc208aecd3ca8a4c25a4bbfb549", "score": "0.57401437", "text": "function mouseEntered(e) {\n var target = e.target;\n if (target.nodeName == \"path\") {\n target.style.opacity = 0.6;\n var details = e.target.attributes;\n\n // Follow cursor\n toolTip.style.transform = `translate(${e.offsetX}px, ${e.offsetY}px)`;\n\n // Tooltip data\n toolTip.innerHTML = `\n <ul>\n <li><b>Province: ${details.name.value}</b></li>\n <li>Local name: ${details.gn_name.value}</li>\n <li>Country: ${details.admin.value}</li>\n <li>Postal: ${details.postal.value}</li>\n </ul>`;\n }\n }", "title": "" }, { "docid": "40513dd22af9d4715a61a173c853eb96", "score": "0.5737168", "text": "onMouseEnter() {\n if (this.tooltip.current !== null)\n this.tooltip.current.showTooltip();\n }", "title": "" }, { "docid": "4cc25ca4def35e33f9be5f4a0e40d09d", "score": "0.57220405", "text": "renderTooltip() {\n\t\tvar prayerlist = require(`./gear/prayers.json`); // Load the prayers from our file.\n\t\tvar prayer = prayerlist[this.state.mouseOverPrayer]; // Give us a variable with just the prayer that's being mouseovered. \n\t\tvar iconstyle = {\n\t\t\tbackgroundImage: `url(${prayer.url})`,\n\t\t\twidth: 6 * prayer.width + \"vmin\",\n\t\t\theight: 6 * prayer.height + \"vmin\"\n\t\t};\n\t\t// This is the prayer icon's gray background\n\t\tvar backgroundstyle = {\n\t\t\tbackgroundImage: `url(${tooltipiconback})`\n\t\t};\n\n\t\t// This will convert the mouseover prayer out of the hyphen separated form in the json file. \n\t\tvar wordarray = this.state.mouseOverPrayer.split(\"-\");\n\t\tvar title = wordarray.map(function (element) {\n\t\t\treturn element.slice(0, 1).toUpperCase() + element.slice(1) + \" \";\n\t\t});\n\t\t// This still needs to be played with, but the title will get smaller with longer lengths. \n\t\tvar fontsize = {\n\t\t\tfontSize: 0.65 - (title.length - 5) * 0.3 + \"vmin\"\n\t\t};\n\t\tif (this.state.mouseOverPrayer == \"superhuman-strength\") { // Superhuman Strength was too smol, so we manually set this one. \n\t\t\tfontsize = {\n\t\t\t\tfontSize: \"1.25vmin\"\n\t\t\t};\n\t\t}\n\t\treturn (\n\t\t\t<div className='GearBoxBack'>\n\t\t\t\t<div className='GearBoxPopupStyleTooltipBack' style={backgroundstyle}>\n\t\t\t\t\t<div className='GearBoxPopupPrayerIcon' style={iconstyle}></div>\n\t\t\t\t</div>\n\t\t\t\t<div className='GearBoxPopupStyleTooltipSect'>\n\t\t\t\t\t<div className='GearBoxPopupStyleTooltipSectTitle' style={fontsize}>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='GearBoxPopupStyleTooltipSectText' style={fontsize}>\n\t\t\t\t\t\t{this.renderTooltipText(prayerlist[this.state.mouseOverPrayer])}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='GearBoxPopupPrayerTooltipDrain'>\n\t\t\t\t\t\tDrain: {prayerlist[this.state.mouseOverPrayer].drainrate}/min\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "347be98d1c535bf8bbd15d8cb9576580", "score": "0.5721242", "text": "e_mouseOver(e)\n\t{\n\n\t}", "title": "" }, { "docid": "35f9b3ae60b1d5f4fe9bf75c150a6167", "score": "0.57124645", "text": "function showArticleCallout(tile, articles) {\n $(tile).qtip({\n content: {\n text: function () {\n return createMetadata(articles);\n }\n },\n position: {\n my: 'left center',\n at: 'right center'\n },\n style: {\n classes: 'qtip-light qtip-shadow popupContainer'\n },\n show: {\n event: 'click',\n ready: true\n },\n hide: {\n event: 'unfocus'\n }\n });\n}", "title": "" }, { "docid": "2f811c470149f13289d83e437d6f6dae", "score": "0.57092994", "text": "function showTooltip() {\n var divElement = $(\"#tooltip\");\n\n if (divElement && latestMouseProjection) {\n divElement.css({\n display: \"block\",\n opacity: 0.0\n });\n\n var canvasHalfWidth = renderer.domElement.offsetWidth / 2;\n var canvasHalfHeight = renderer.domElement.offsetHeight / 2;\n\n var tooltipPosition = latestMouseProjection.clone().project(camera);\n tooltipPosition.x = (tooltipPosition.x * canvasHalfWidth) + canvasHalfWidth + renderer.domElement.offsetLeft;\n tooltipPosition.y = -(tooltipPosition.y * canvasHalfHeight) + canvasHalfHeight + renderer.domElement.offsetTop;\n\n var tooltipWidth = divElement[0].offsetWidth;\n var tooltipHeight = divElement[0].offsetHeight;\n\n divElement.css({\n left: `${tooltipPosition.x - tooltipWidth/2}px`,\n top: `${tooltipPosition.y - tooltipHeight - 5}px`\n });\n\n // var position = new THREE.Vector3();\n // var quaternion = new THREE.Quaternion();\n // var scale = new THREE.Vector3();\n // hoveredObj.matrix.decompose(position, quaternion, scale);\n divElement.text(hoveredObj.userData.tooltipText);\n\n setTimeout(function() {\n divElement.css({\n opacity: 1.0\n });\n }, 25);\n }\n }", "title": "" }, { "docid": "bf0b513df931f22aba00440a36b3cfff", "score": "0.57057285", "text": "function showTip(selection,config,yScale,xScale,d,i){var element=selection.selectAll('.tip-' + d.idx);var args={};var lineLabel;element.classed('active',true);if(config.graphType == 'line'){lineLabel = selection.datum()[+d.idx.split('-')[0]].label;var circle=selection.select('.nc-tip-rollover-circle-wrapper').append('circle').classed('tip-rollover-circle',true).attr({'cx':xScale(config.xAccessor(d)),'cy':yScale(config.yAccessor(d)),'r':config.tip.rolloverCircleR?config.tip.rolloverCircleR:6});}if(utils.isObject(d)){ //FIXME: angular customizations!!!\nargs = utils.extend(d.toJSON?d.toJSON():d,{lineLabel:lineLabel,element:element});}else {args.x = config.xAccessor(d);args.y = config.yAccessor(d);args.lineLabel = lineLabel;args.element = element;}dispatch.rolloverShow(args);} //Hide the tooltip when the mouse moves away", "title": "" }, { "docid": "fd7dd2cb5ee37fd901f44eca147bcb71", "score": "0.5704298", "text": "function mouseover(d) {\n\t\t\t// call the update function of histogram with new data.\n\t\t\thG.update(fData.map(function(v) {\n\t\t\t\treturn [v.State, v.freq[d.data.type]];\n\t\t\t}), segColor(d.data.type));\n\t\t}", "title": "" }, { "docid": "7717fb547c2fa636670ec912c3e8f17d", "score": "0.56981397", "text": "function showTooltip(d) {\r\n var mouse = d3.mouse(svg.node()).map(function (d) {\r\n return parseInt(d);\r\n });\r\n if (tooltip_point.classed(\"hidden\")) {\r\n tooltip.classed('hidden', false)\r\n .html(\"<span id='close' onclick='hideTooltipPoint()'>x</span>\" +\r\n \"<div class='inner_tooltip'>\" +\r\n \"<p>\" + d.university_name + \"</p>\" +\r\n \"</div><div>\" + \"</div>\")\r\n .attr('style', 'left:' + (mouse[0] + 15) + 'px; top:' + (mouse[1] - 25) + 'px')\r\n };\r\n }", "title": "" }, { "docid": "5d86632f1401c20480cf705034e0718b", "score": "0.5695786", "text": "function setTooltipState(d) {\n const tooltip = {\n visibility: 'visible',\n location: {\n x: d3.event.pageX,\n y: d3.event.pageY,\n },\n data: {\n name: d.data.name,\n category: d.data.category,\n color: colorScale(d.data.category),\n value: d.data.value,\n },\n };\n reactComponent.setState({ tooltip });\n }", "title": "" }, { "docid": "33d1cf415540aaebff9b96abcd1d78bd", "score": "0.568662", "text": "function showTooltip(d) {\n moveTooltip();\n\n tooltip.style(\"display\",\"block\")\n .text(d.properties.province_name, d.properties.children);\n}", "title": "" } ]
c06e0047be829d2eaebf0ce7520dd4d2
Effettua il salvataggio su db dei dati di modello, presenti nella sessione utente, per l'istanza corrente.
[ { "docid": "c23e346ce60c35b0fb8c528516983db0", "score": "0.0", "text": "function save() {\n\tfacade.save(instance, values, attachments);\n}", "title": "" } ]
[ { "docid": "ae246069c09095dd143b129cf1fde784", "score": "0.6335206", "text": "function ripristinaDbImpl() {\n\tvar db = getDbConnection();\n\n\t// DROP tabelle\n\t// Sistema\n\tdb.transaction(function(t) {t.executeSql('DROP TABLE IF EXISTS sistema;');});\n\t// Impostazioni\n\tdb.transaction(function(t) {t.executeSql('DROP TABLE IF EXISTS impostazioni;');});\n\t\n\t// Init\n\tdbInit();\n}", "title": "" }, { "docid": "a453be3653212d4865509349e0d1f61b", "score": "0.6011587", "text": "function tout_db() {\n\n log(\"Affichage du contenu du catalogue\");\n\n // Nouvelle transaction\n var transaction = db.transaction([\"geo\"]);\n var objStore = transaction.objectStore(\"geo\");\n\n // Ouverture d'un curseur\n var requeteCur = objStore.openCursor();\n requeteCur.onsuccess = function(e) {\n var cursor = e.target.result;\n if(cursor) {\n affiche(cursor.value);\n // Continue jusqu'à l'enregistrement suivant\n cursor.continue();\n }\n };\n\n requeteCur.onfailure = db.onerror;\n\n}", "title": "" }, { "docid": "f074e679c16f5be88d4c3be83669c22a", "score": "0.600265", "text": "function vide_db() {\n log(\"Suppression du contenu...\");\n var transaction = db.transaction([\"geo\"],IDBTransaction.READ_WRITE);\n transaction.objectStore(\"geo\").clear();\n}", "title": "" }, { "docid": "439ae13dc6f39eb53152e92455106758", "score": "0.59741193", "text": "function save()\n{\n console.log(\"Saving Data\");\n var data = db.export();\n var buffer = new Buffer(data);\n fs.writeFileSync(\"./database/database.sqlite\",buffer);\n closeDatabase();\n loadDatabase();\n}", "title": "" }, { "docid": "c4430fc11c307ee80c50fca6fdef2847", "score": "0.5877046", "text": "guardarEnLaBaseDeDatos() {\n //Creamos el path donde se va a guardar la data\n const dbPath = path.join(__dirname, '../db/data.json');\n\n //Guradamos la data en el json, como viene como string lo convertimos a json\n fs.writeFileSync(dbPath, JSON.stringify(this.toJson));\n }", "title": "" }, { "docid": "c801d93244ac72f369f7eb3232beff02", "score": "0.5863035", "text": "darDeBaja () {\n try {\n presupuestoModel.update({ eliminado: 1}, { where: { id_presupuesto: this.id_presupuesto } })\n } catch (err) {\n throw new Error(err);\n }\n }", "title": "" }, { "docid": "e1cbc896572f47a2fe453654da1a3d3a", "score": "0.5840945", "text": "saveDB() {\n const dbPath = path.join(__dirname, '../db/data.json');\n fs.writeFileSync(dbPath, JSON.stringify(this.toJSON));\n }", "title": "" }, { "docid": "bb1406fb5deb374377c54623cc80bee6", "score": "0.5817526", "text": "function save(){\n \n }", "title": "" }, { "docid": "fcdbe0291ae982ca1cbf51697caf5ba3", "score": "0.5734223", "text": "save() {\n return db.query(`INSERT INTO controlePCsNovos.basesPCs (usuario, nrUniversal, nomeComputador, retirado, \n novos2019, novos2020 , antigos , registeredBy )\n VALUES (${this.usuario===null ? 'NULL' : `'${this.usuario}'`},?,?,?,?,?,?,?);\n INSERT INTO controlePCsNovos.SYSTEM_log (action_id,nrUniversal_fk,usuario)\n VALUES (6,?,?);`, [`${this.nrUniversal}`,`${this.nomeMaquina}`,`${this.retirado}`,\n `${this.novos2019}`,`${this.novos2020}`,`${this.antigos}`,`${this.registeredBy}`,\n `${this.nrUniversal}`,`${this.registeredBy}`])\n }", "title": "" }, { "docid": "2f4fc4eed9a7a49a1f84a46f866333e6", "score": "0.5723231", "text": "function barras_view(){\n db.transaction(barras_view_db, errorDB, successDB);\n }", "title": "" }, { "docid": "ce4289e2ea5ad9fd5c50d5c6928e38b6", "score": "0.5720032", "text": "static save() {\n console.log('save');\n\n const transaction = this.db.transaction(_LOG_STORE, 'readonly');\n const objectStore = transaction.objectStore((_LOG_STORE));\n const csv = new CsvLog();\n\n Idb.readAll(objectStore, (cursor) => {\n csv.add(cursor.value);\n }).then(() => {\n this.writeToFile(csv);\n }).catch((event) => console.log('error in log db', event));\n }", "title": "" }, { "docid": "c4f7bdadf13d4d84b9fe4eedc2b07a18", "score": "0.56931", "text": "async persist () {\n\t\tawait this.data.persist();\n\t}", "title": "" }, { "docid": "51a13d75f670b17f0eed8bb711da37e0", "score": "0.566489", "text": "function cargarPedidos(){\n\tdb.transaction(queryDBPedido, errorOI);\n}", "title": "" }, { "docid": "2caf991c4bb62e7f8df234afb9e18017", "score": "0.5659486", "text": "cleanDB () {\n Models.Step.destroyObject();\n Models.Form.destroyObject();\n Models.Data.destroyObject();\n }", "title": "" }, { "docid": "b673f91f32f032fef6dfc703425f4096", "score": "0.5644732", "text": "function guardarAutoDB(autoObj){\n const transaction = DB.transaction([\"crm\"], \"readwrite\");\n const store = transaction.objectStore(\"crm\");\n\n store.add(autoObj);\n\n transaction.onerror = function(){\n console.log(\"Hubo un error en la carga del vehiculo\");\n }\n\n transaction.oncomplete = function(){\n console.log(\"Auto agregado a la BD\");\n }\n}", "title": "" }, { "docid": "0de7556c6fa0aab0ae529857a0aeaca7", "score": "0.562375", "text": "function saveDB(model, mac, data) {\n data.mac = mac;\n data._timestamp = new Date().getTime();\n new model(data).save();\n}", "title": "" }, { "docid": "57f7a22b9f103b1539a9a4b1618400a9", "score": "0.561637", "text": "function SAVE() {\n\t\tLOG( 'AUTO_FARM->SAVE()' );\n\t\t\n\t\tlocalStorage[ 'TWA AUTO_FARM MODELS' ] = JSON.stringify( models );\n\t}", "title": "" }, { "docid": "0adf55694735bdc0fc0e082d8d16cb7f", "score": "0.55941075", "text": "function linhas_view(){\n db.transaction(linhas_view_db, errorDB, successDB);\n }", "title": "" }, { "docid": "3361e2a603aeff01d5105be8784a5717", "score": "0.55927175", "text": "function refreshDataInModelSuasanPham() {\n}", "title": "" }, { "docid": "c75e0f91474f22ad8d15664936e38270", "score": "0.55879873", "text": "save() {\n try {\n this._toggleSaveThrobber();\n\n this.dao.age = document.getElementById('age').value;\n this.dao.captivity = document.getElementById('captivity').value;\n this.dao.ott_id = document.getElementById('vernacular_selector').value;\n this.dao.sex = document.getElementById('sex_selector').value;\n this.dao.liberty = document.getElementById('liberty_selector').value;\n this.dao.lifestage = document.getElementById('lifestage_selector').value;\n this.dao.individual_name = document.getElementById('individual_name').value;\n\n this.dao.save();\n \n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.expId;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "title": "" }, { "docid": "5bdc439cd499d45d829ba8fb751ce9a6", "score": "0.55713373", "text": "function F_sauv() {\n // connexion is needed\n var sLogin = F_getCookie(\"username\");\n if (sLogin == \"\") {\n // this allow to save after connexion\n F_setCookie(\"save_data\", \"save_data\", 1);\n F_openModal();\n // @TODO wrong place\n document.getElementById('lastChanges').style.display = 'block';\n document.getElementById('lastChanges').innerHTML = \"il faut être connecté pour sauvegarder ses données\" ;\n return;\n }\n \n // get user values\n \n valueTab = F_getUserValues();\n \n // send results to DB\n var sData = JSON.stringify(Array(valueTab['valeurSaisie'], valueTab['bdd-id'], valueTab['resultat']));\n F_sendResult(sData);\n \n \n F_setCookie(\"save_data\", \"save_data\", -1); // cookie to yesterday --> deleted\n}", "title": "" }, { "docid": "915b7a4c1e1f1a290f11f6ca1857d45a", "score": "0.55555487", "text": "function buscarobjeto(){ \n var transaction = db.transaction([\"gente\"],\"readonly\"); \n var objectStore = transaction.objectStore(\"gente\"); \n var ob = objectStore.get(numero); \n bd.onsuccess = function(e) { }\n}", "title": "" }, { "docid": "6e2d928c2276e5ae10b07606d03867f2", "score": "0.5552469", "text": "function save(value){\n const transaction = db.transaction(['list'],\n 'readwrite') //hacer un llamado a una nueva transaccion de la base de datos enviandole el nombre y el que tipo de accion a utilizar en este caso de lectura y escritura\n const objetStore = transaction.objectStore('list')\n if(count == 0){// si la variable global count es igual a significa que no hay ningun valor almancenado\n const request = objetStore.add(\n {\n descrip: value,\n next: null\n });//agrear un nuevo campo a la base de datos con el descrip = value y el next = null porque es el primer valor almacenado\n idfirst = 1;// variable global del primer valor de la lista = 1 \n lastid = 1;\n alert(\"Valor almacenado con exito\")// Mensaje de notificacion que se ha guarado con exito el valor\n document.getElementById(\"ipvalue\").value = \"\";// Limpiar el input del formulario\n return\n }else{ // En el caso que el count sea mayor que cero significa que ya hay valores almacenados en la base de datos\n nextid = lastid; // Se toma el ultimo id almacenado en al base de datos\n lastid = lastid + 1; // Con el ultimo id almacenado se le suma un valor para hacer referencia al siguiente valor porque es auto incremental\n const request = objetStore.add(\n {\n descrip: value,\n next: null\n }); // agregar el nuevo valor a ala base de datos\n getData(nextid, lastid);// llamar a la funcion getData con los valores de nextid y lastid\n document.getElementById(\"ipvalue\").value = \"\"; // Limpiar el input\n alert(\"Valor almacenado con exito\");// lanzar mensaje de notificacio que se ha almacenado con exito el nuevo valor \n \n }\n }", "title": "" }, { "docid": "ed03861da7458869139cbf84db093a85", "score": "0.55514705", "text": "function commit() {\n\t\tlocalStorage[db_id] = JSON.stringify(db);\n\t}", "title": "" }, { "docid": "ed03861da7458869139cbf84db093a85", "score": "0.55514705", "text": "function commit() {\n\t\tlocalStorage[db_id] = JSON.stringify(db);\n\t}", "title": "" }, { "docid": "b14a54dbaa32f0fe85cad4cabcfd4c12", "score": "0.555003", "text": "actualizarRecord(puntaje){ }", "title": "" }, { "docid": "50e7694a816d7aac9e98307b5b21a486", "score": "0.55432576", "text": "function DeleteValueFromDB(id_serie) {\n db = window.openDatabase(shortName, version, displayName, maxSize);\n db.transaction(function(tx) {\n tx.executeSql('DELETE FROM series WHERE series.id_serie=?', [id_serie], nullHandler(\"borrar serie\"), errorHandler);\n });\n db.transaction(function(tx) {\n tx.executeSql('DELETE FROM series_se WHERE series_se.id_serie=?', [id_serie], nullHandler(\"borrar series_se\"), errorHandler);\n });\n db.transaction(function(tx) {\n tx.executeSql('DELETE FROM usuario_se WHERE usuario_se.id_serie=?', [id_serie], nullHandler(\"borrar usuario_se\"), errorHandler);\n });\n}", "title": "" }, { "docid": "111018a1a7c3233468bd1af7519c0d45", "score": "0.55140007", "text": "async _save() {\n try {\n this.data.currentState = this.stateMachine.state;\n const res = await this._cache.set(`bulkTransferModel_${this.data.bulkTransferId}`, this.data);\n this._logger.push({ res }).log('Persisted bulk transfer model in cache');\n }\n catch(err) {\n this._logger.push({ err }).log('Error saving bulk transfer model');\n throw err;\n }\n }", "title": "" }, { "docid": "aa198b1f9fbf6a8dbd60cb025f463d72", "score": "0.5505258", "text": "leerDB() {\n \n if( !fs.existsSync( this.dbPath ) ) return;\n \n const info = fs.readFileSync( this.dbPath, { encoding: 'utf-8' });\n const data = JSON.parse( info );\n \n this.agregarHistorial.historial = data.historial;\n \n \n }", "title": "" }, { "docid": "257f53266c813793b2501297fa5a7903", "score": "0.55011266", "text": "async save(session) {\n let stringOfProperties = '';\n\n Object.keys(this._mainObj).forEach((prop) => {\n stringOfProperties += (prop + \": \" +\n \"'\" + this._mainObj[prop] + \"',\"\n );\n });\n\n stringOfProperties = stringOfProperties.slice(0, stringOfProperties.length - 1);\n\n await session.run(`\n CREATE (n:${nameOfLabel} {\n ${stringOfProperties}\n })\n RETURN n\n `)\n .then(() => {\n session.close();\n })\n .catch(function(error) {\n console.log(error);\n });\n\n return this._mainObj;\n }", "title": "" }, { "docid": "3915cf5281f36f5269d79288afa86bc8", "score": "0.5489114", "text": "function ripristinaDb() {\n\tvar scelta = confirm('Procedendo verranno ripristinati i dati iniziali.\\nVuoi continuare?');\n\t\n\tif (scelta == true) {\n\t\tripristinaDbImpl();\n\t}\n\t\n\treturn scelta;\n}", "title": "" }, { "docid": "745c7a2cfd469199858e7fd8a321b9e2", "score": "0.54849786", "text": "function saveSatff() {\n retrieveValues();\n saveToServer();\n}", "title": "" }, { "docid": "c8933692ffcb383dda66d01eed559b69", "score": "0.548493", "text": "salvarGerente() {\r\n sessionStorage.setItem('GE_Nome_', this.nome)\r\n sessionStorage.setItem('GE_Agencia_', this.agencia)\r\n sessionStorage.setItem('GE_TipoUsuario_', this.tipoDeUsuario)\r\n sessionStorage.setItem('GE_Senha_', this.senha)\r\n sessionStorage.setItem('GE_Login_', this.login)\r\n }", "title": "" }, { "docid": "5f6d6fc36fd88a7959d80c058b9271f9", "score": "0.5463433", "text": "saveEquipament () {\n\n\t\treturn this.save();\n\t}", "title": "" }, { "docid": "d60b93e8a12510cde9b63eea2eddc06f", "score": "0.5447692", "text": "function finishOLM()\n{\n\toScorm.save();\n\toScorm.quit();\n}", "title": "" }, { "docid": "73e7a190e0dc390d9dbdef1ba264e547", "score": "0.54193544", "text": "save() {\n return null;\n }", "title": "" }, { "docid": "73e7a190e0dc390d9dbdef1ba264e547", "score": "0.54193544", "text": "save() {\n return null;\n }", "title": "" }, { "docid": "9fe716cef72505b8a47a1dee4c357f95", "score": "0.54143083", "text": "restartWithPrestige()\r\n {\r\n this.clear();\r\n this.prestigeLevel++;\r\n \r\n let saveData = {};\r\n \r\n saveData.lastSaveTime = Date.now();\r\n saveData.currency = designConfig.initialCurrency;\r\n saveData.prestigeLevel = this.prestigeLevel;\r\n \r\n localStorage.setItem(\"saveData\", JSON.stringify(saveData)); \r\n }", "title": "" }, { "docid": "199b4fedb4cc2cab6eaf4f102c1e2839", "score": "0.5396321", "text": "function saveCurrentDataInDB() {\n var curentdateTime = getDate();\n var signalDbm = getSignalDbm();\n var batterieLevel = getBatterieLevel();\n var batterieEnChargeInt = isBatteriePluggedInteger();\n var hashkey = \"\" + curentdateTime + signalDbm + batterieLevel + batterieEnChargeInt;\n\n //Update DB (insert value on DB)\n doInsertOnDB(curentdateTime, signalDbm, batterieLevel, batterieEnChargeInt, hashkey);\n}", "title": "" }, { "docid": "d5b4faeff2542587fec491f8d23151b2", "score": "0.53879523", "text": "saveDatabase(datas) {\n console.log('saveDatabase');\n this.database = datas;\n }", "title": "" }, { "docid": "ad8ea5d0987b5f4dedc73ad62d8cac90", "score": "0.53461736", "text": "function saveData()\r\n{\r\n localStorage.setItem('savedTableData', JSON.stringify(tableData));\r\n console.log('[INFO] Save OK');\r\n}", "title": "" }, { "docid": "c663482a495eb17b813de11da69ca72e", "score": "0.534574", "text": "function save_sale_rec(){\n pg.connect(conString, function(err, client, done){ //conectar a la base de datos\n if(err){\n return console.error('error conexion save_sale', err);\n }else{\n vol_tabla = volumenrec;\n client.query(\"SELECT MAX(id) FROM venta;\", function(err,result){ //consulto maximo id de venta\n done();\n if(err){ \n return console.error('error toma MAX save_sale', err);\n }else{\n console.log(result.rows[0].max);\n var last_id = result.rows[0].max; //Cargo el maximo id de venta\n if(codigoError == '0' || codigoError == '2002' || codigoError =='2001'){ //Cargar dato de si fue enviada o no la venta\n if(error_local == 0){\n b_enviada = 'TRUE';\n }else{\n b_enviada = 'FALSE'; \n }\n }else{\n b_enviada = 'FALSE';\n }\n if(autorizacion == null){\n b_enviada = 'TRUE';\n }\n console.log(\"Save sale>>\"+id_ventarec);\n client.query(sprintf(\"UPDATE venta SET (id_venta, id_estacion, serial, cara, producto, precio, dinero, volumen, fecha, enviada) = ('%1$s','%2$s', '%3$s', '%4$s', '%5$s', '%6$s', '%7$s', '%8$s', '%9$s','%10$s') WHERE id='%11$s'\", id_ventarec, idestacionrec, serialrec, cararec, idproductorec, preciorec, dinerorec, vol_tabla, fecha, b_enviada,last_id), function(err,result){\n done();\n if(err){ \n print_ventarec(); //Imprime venta sin insertar en la DB\n return console.error('error actualizacion save_sale', err); \n }else{\n imprec = 0;\n print_ventarec(); //Imprime venta sin insertar en la DB\n }\n });\n } \n }); \n }\n }); \n}", "title": "" }, { "docid": "b208c2d10cf85a3aaa89e3c2f4481a3c", "score": "0.53393877", "text": "function updateDB(){\n connection.sync().then(function (){\n Cryptos.create({\n Bitcoin: BTC,\n Ripple: RIP,\n Stellar: STEL\n });\n });\n}", "title": "" }, { "docid": "fabf830a825cb8edd795cae6876c898d", "score": "0.5338406", "text": "async save() {\n return;\n }", "title": "" }, { "docid": "d9d717fd222d50692c88d8e3668b51c5", "score": "0.53289056", "text": "function modificar(data){\n var transaction = db.transaction([\"list\"], 'readwrite');\n var objectStore = transaction.objectStore(\"list\");\n var requestUpdate = objectStore.put(data);\n requestUpdate.onerror = function(event) {\n alert('ERROR')\n };\n requestUpdate.onsuccess = function(event) {\n };\n }", "title": "" }, { "docid": "72baa1d426c7db94e3a8497dd836c62c", "score": "0.5319422", "text": "function savingDB(){\n productsAll.forEach((pro) => {//the individual product\n pro.save();//save into database\n\n //db.mDB.insert({\"name\" : \"some string\"})\n });\n}", "title": "" }, { "docid": "1d2b28d585ca8d0e25f05662437a2136", "score": "0.5318808", "text": "function dbcrud(){}", "title": "" }, { "docid": "9223c22ae059e2a9603e83b3fe9d0196", "score": "0.53187877", "text": "actualizarUsuario() {\n\n this.enEdicion = false;\n let posicion = this.lista_usuarios.findIndex(\n usuario => usuario.id == this.usuario.id\n );\n let user = this.usuario;\n let aux = ((user.peso * 100) / (user.estatura * user.estatura)) * 100\n user.IMC = aux.toFixed(2)\n this.lista_usuarios.splice(posicion, 1, user);\n this.usuario = {\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n acciones: true\n };\n localStorage.setItem('users-vue', JSON.stringify(this.lista_usuarios));\n }", "title": "" }, { "docid": "71cd8cd4fc8f9c03ecbc30f3f4b8070a", "score": "0.53162915", "text": "function guardarSS(){\n let userOMDB={\n user:\"\",\n pass:\"\"\n };\n \n userOMDB.user=user.value;\n userOMDB.pass=pass.value;\n \n // Crea nueva tarea en SesionStorage\n sessionStorage.setItem('UserOMDB',JSON.stringify(userOMDB));\n}", "title": "" }, { "docid": "8c5b8063beeaca4e9a38baceaf5d919e", "score": "0.53098655", "text": "save() {\n return db.execute(\n 'INSERT INTO products (ProductID, ProductName, Discontinued) VALUES (?, ?, ?)',\n [this.id, this.name, this.discontinued]\n );\n }", "title": "" }, { "docid": "d005396c9427f7c7ff4ce9bc043dd617", "score": "0.5306058", "text": "function administrador() {\n var usuarioModelo = Usuario(); \n usuarioModelo.nombre= \"Administrador\"\n usuarioModelo.rol=\"ROL_ADMIN\"\n\n\n Usuario.find({ \n nombre: \"Administrador\"\n\n }).exec((err, adminoEncontrado )=>{\n if(err) return console.log({mensaje: \"Error al crear Administrador\"});\n\n if(adminoEncontrado.length >= 1){\n return console.log(\"Administrador listo!\");\n\n }else{bcrypt.hash(\"123456\", null, null, (err, passwordEncriptada)=>{\n usuarioModelo.password = passwordEncriptada;\n\n usuarioModelo.save((err, usuarioguardado)=>{\n if(err) return console.log({mensaje : \"Error en la peticion\"});\n\n if(usuarioguardado){console.log(\"Administrador preparado\");\n\n }else{\n console.log({mensaje:\"Error en la petición\"});\n } \n }) \n })\n }\n })\n}", "title": "" }, { "docid": "61c99565bf08bc7218fcce542637c2d1", "score": "0.5302023", "text": "function save_sale_ef(){\n pg.connect(conString, function(err, client, done){ //conectar a la base de datos\n if(err){\n return console.error('error conexion save_sale', err);\n }else{\n volumen[3]=46;\n vol_tabla = parseFloat(volumen);\n console.log(\"Insertado: \"+ insertado);\n client.query(sprintf(\"INSERT INTO venta (id_venta, idestacion, serial, cara, producto, precio, dinero, volumen, fecha, enviada,autorizacion,km) VALUES ('%1$s','%2$s', '%3$s', '%4$s', '%5$s', '%6$s', '%7$s', '%8$s', '%9$s','%10$s','%11$s','%12$s')\", id_ventaoff, idestacion, serial, cara, idproducto, precio, dinero, vol_tabla, fecha,b_enviada,'00000000-0000-0000-0000-000000000000',0), function(err,result){\n done();\n if(err){ \n if(cara == '1'){\n imp = 0;\n print_venta(); //Imprime venta sin insertar en la DB\n }\n if(cara == '2'){\n imp2 = 0;\n print_ventaSeg(); //Imprime venta sin insertar en la DB\n }\n return console.error('error actualizacion save_sale', err); \n }else{\n if(codigoError == '0' || codigoError == '2002' || codigoError =='2001'){ //Cargar dato de si fue enviada o no la venta\n if(error_local == 0){\n b_enviada = 'TRUE';\n }else{\n b_enviada = 'FALSE'; \n }\n }else{\n b_enviada = 'FALSE';\n }\n console.log(\"Save sale efectivo>>\"+id_venta); \n if(cara == '1'){\n imp = 0;\n print_venta(); //Imprime venta sin insertar en la DB\n }\n if(cara == '2'){\n imp2 = 0;\n print_ventaSeg(); //Imprime venta sin insertar en la DB\n } \n pg.end();\n }\n });\n }\n }); \n}", "title": "" }, { "docid": "50de0f6c9ccbc7b921e51c44c8bdd46f", "score": "0.52972585", "text": "function salidaUsuarios() {\n //check to ensure the mydb object has been created\n if (mydb) {\n //Get all the cars from the database with a select statement, set outputCarList as the callback function for the executeSql command\n mydb.transaction(function (t) {\n t.executeSql(\"SELECT * FROM usuarios\", [], actualizarUsuario);\n });\n } else {\n // alert(\"¡Tú navegador web/browser no soporta WebSQL!\");\n }\n}", "title": "" }, { "docid": "bf3bc6cab4f326c82b14adf98b052f1b", "score": "0.529567", "text": "function save(){\r\n\t\tvar s = Storage.getDefault();\r\n\t\tvar ud = that.exportUserData();\r\n\t\ts.saveUserData(ud);\r\n\t}", "title": "" }, { "docid": "c10275253a5c46c28071b5c74024532d", "score": "0.52938473", "text": "function db_save() {\n if(\"localStorage\" in window) {\n try {\n localStorage.setItem(\"db\", JSON.stringify(db));\n console.info(\"database saved to persistent storage\");\n } catch(error) {\n console.error(error);\n }\n }\n}", "title": "" }, { "docid": "cc3741ddcc26d6d4e139fbf45f74d46b", "score": "0.52890855", "text": "function saveDatabase(){\n localStorage.setItem('database', tempDatabse);\n}", "title": "" }, { "docid": "017b8d57a628386c70906dd09f3ad899", "score": "0.52693313", "text": "function modificarPersona(tabla,clave,nombre,apellido1,apellido2,fechaNacimiento,imagen){\n var respuesta = indexedDB.open(DB_NAME);\n\n respuesta.onsuccess = function(evento){\n var db = evento.target.result;\n var almacen = db.transaction([tabla],\"readwrite\").objectStore(tabla);\n\n var objeto = almacen.get(clave);\n\n almacen.delete(clave);\n\n objeto.onsuccess = function(evento){\n var datos = objeto.result;\n\n datos.Nombre = nombre;\n datos.Apellido1 = apellido1;\n datos.Apellido2 = apellido2;\n datos.Nacimiento = fechaNacimiento;\n datos.Imagen = imagen;\n\n almacen.add(datos);\n };\n };\n}", "title": "" }, { "docid": "9f0f46a4287b9d4206e7416b2e74fe55", "score": "0.5267744", "text": "vaciarModeloFertilizanteStore(state) {\n state.modeloFertilizanteStore = new Fertilizante('', '', '', '', '', '', '', '', '', '', '', '', '')\n }", "title": "" }, { "docid": "fa4e311f05f04a01344953dabd606fc3", "score": "0.5261139", "text": "function sqlSave(recipe){\n // RecipeIngredientsModel.sync({force:true}).then(function(){\n // // console.log(recipe.recipeIngredients[x]);\n // RecipeIngredientsModel.create(recipe.recipeIngredients[x]);\n // });\n\n //recipeListModel\n // RecipeListModel.sync({force:true}).then(function(){\n RecipeListModel.create(recipe.recipeBrowse);\n // });\n\n //recipeTags\n for (var x = 0; x < recipe.recipeTags.length; x++){\n // RecipeTagsModel.sync({force:true}).then(function(){\n RecipeTagsModel.create(recipe.recipeTags[x]);\n // });\n }\n\n //recipeIngredients\n for (var x = 0; x < recipe.recipeIngredients.length; x++){\n // RecipeIngredientsModel.sync({force:true}).then(function(){\n RecipeIngredientsModel.create(recipe.recipeIngredients[x]);\n // })\n }\n\n //recipeInstructions\n for (var x = 0; x < recipe.recipeInstructions.length; x++){\n // RecipeInstructionsModel.sync({force:true}).then(function(){\n RecipeInstructionsModel.create(recipe.recipeInstructions[x]);\n // })\n }\n\n //recipeNutrition\n // RecipeTotalNutritionModel.sync({force:true}).then(function(){\n var obj = {};\n obj.title = recipe.recipeNutrition.title;\n RecipeTotalNutritionModel.create(obj).then(function(){\n\n RecipeTotalNutritionModel.find({\n where: {\n title: {\n $like: '%'+recipe.recipeNutrition.title+'%'\n }\n }\n })\n .then(function(data){\n for (var key in data.dataValues){\n // console.log(key);\n if (recipe.recipeNutrition[key]){\n data[key] = recipe.recipeNutrition[key];\n }\n }\n data.save().then(function(){\n // console.log('save success');\n })\n })\n });\n // })\n\n}", "title": "" }, { "docid": "b74243691838f75d9162c3d34e512c5c", "score": "0.52546895", "text": "function save(monitor_line_data){\n var monitor_ob = {\n \tdate: monitor_line_data[0],\n registerUser: monitor_line_data[1],\n repeateLoanUser: monitor_line_data[2],\n firstLoanUser: monitor_line_data[3],\n lentUser: monitor_line_data[4],\n loanAmount: monitor_line_data[5],\n repayment: monitor_line_data[6]\n }\n \n \n var entity = new monitorPerHour({\n \tdate: monitor_ob.date,\n \tregisterUser: monitor_ob.registerUser,\n repeateLoanUser: monitor_ob.repeateLoanUser,\n firstLoanUser: monitor_ob.firstLoanUser,\n lentUser: monitor_ob.lentUser,\n loanAmount: monitor_ob.loanAmount,\n repayment: monitor_ob.repayment\n });\n \n findOne(monitorPerHour, monitor_ob.date, entity);\n \n // monitorPerHour.create(entity, function(error, doc){\n // \tif (error) {\n // \t\tconsole.log(error);\n // \t} else {\n // \t\tconsole.log('save ok');\n // \t\tconsole.log(doc);\n // \t}\n // \t// db.close();\n // // setTimeout(function() {\n // // db.close();\n // // }, timeout_ms);\n\n // });\n}", "title": "" }, { "docid": "986ed45fac301a5eaccdabcb849f00a1", "score": "0.5252576", "text": "function save_sale(){\n pg.connect(conString, function(err, client, done){ //conectar a la base de datos\n if(err){\n return console.error('error conexion save_sale', err);\n }else{\n volumen[3]=46;\n vol_tabla = parseFloat(volumen);\n client.query(\"SELECT MAX(id) FROM venta;\", function(err,result){ //consulto maximo id de venta\n done();\n if(err){ \n return console.error('error toma MAX save_sale', err);\n }else{\n console.log(result.rows[0].max);\n var last_id = result.rows[0].max; //Cargo el maximo id de venta\n if(codigoError == '0' || codigoError == '2002' || codigoError =='2001'){ //Cargar dato de si fue enviada o no la venta\n if(error_local == 0){\n b_enviada = 'TRUE';\n }else{\n b_enviada = 'FALSE'; \n }\n }else{\n b_enviada = 'FALSE';\n }\n console.log(\"Save sale>>\"+id_ventaoff);\n client.query(sprintf(\"UPDATE venta SET (id_venta, id_estacion, serial, cara, producto, precio, dinero, volumen, fecha, enviada) = ('%1$s','%2$s', '%3$s', '%4$s', '%5$s', '%6$s', '%7$s', '%8$s', '%9$s','%10$s') WHERE id= (SELECT MAX(id) FROM venta WHERE cara = '%4$s');\",id_ventaoff, idestacion, serial, cara, idproducto, precio, dinero, vol_tabla, fecha, b_enviada,last_id), function(err,result){\n done();\n if(err){ \n printrec = 0; \n\t\t\t\t\t\t\timp = 0;\n\t\t\t\t\t\t\tprint_venta(); //Imprime venta sin insertar en la DB \n return console.error('error actualizacion save_sale', err); \n }else{\n printrec = 0; \n\t\t\t\t\t\t\timp = 0;\n\t\t\t\t\t\t\tprint_venta(); //Imprime venta sin insertar en la DB \n\t\t\t\t\t\t\tpg.end();\n }\n });\n } \n }); \n }\n }); \n}", "title": "" }, { "docid": "602499d8503182c21fe191a79b4a8551", "score": "0.5248423", "text": "function saveTerm(){\n\n if(vm.termino == null)\n {\n FlashService.Error('No has introducido ningún término');\n }else{\n vm.termino.idProject = idProjectFK;\n\n GlosaryService.Create(vm.termino)\n .then(function(){\n FlashService.Success('Término insertado correctamente');\n })\n .catch(function(error){\n FlashService.Error(error);\n });\n \n }\n\n }", "title": "" }, { "docid": "ad55e66f15d2aa5c54a574210cbc3603", "score": "0.5246352", "text": "function stateSaveCallback(settings, data) {\n var stado = $('#CRfondosProgramaGet').DataTable().state();\n localStorage.setItem('CRfondosProgramaGet' + window.location.pathname, JSON.stringify(stado))\n }", "title": "" }, { "docid": "3709bf50e65b1a1b11144eb64b6b132c", "score": "0.5240667", "text": "actualizar(proyecto) {\n try {\n presupuestoModel.update({ proyecto }, { where: { id_presupuesto: this.id_presupuesto } })\n } catch (err) {\n throw new Error(err);\n }\n }", "title": "" }, { "docid": "bd71f42ae839548fbc391603188ff9da", "score": "0.5219899", "text": "function cargarBD(){\n\tdb.transaction(cargaRegistro, errorDB);\n}", "title": "" }, { "docid": "73c1832f9f33afa680ccb4f5bfb7b728", "score": "0.52165484", "text": "async save( args ) { \n\n\t\tconst sql = args['sql'];\n\t\tconst binds = args['binds'] || [];\n\t\tconst config = args['config'] || default_config;\n\t\tconst db_name = args['db_name'];\n\n\t\tconst Trace = global.objects.Trace.obj;\n\t\tconst tpre = `${classname} save`;\n\n\t\tif ( sql ) {\n\n\t\t\t// Passed db.\n\t\t\tif ( db_name ) { \n\t\t\t\tconfig.database = db_name;\n\t\t\t}\n\n\t\t\t// Async.\n\t\t\treturn new Promise( res => {\n\t\t\t\tconst connection = mysql.createConnection( config );\n\t\t\t\tconnection.connect();\n\n\t\t\t\tconnection.query( { sql: sql, values: binds, timeout: 20000 }, async ( error, results, fields ) => {\n\t\t\t\t\tif ( !error ) { \n\t\t\t\t\t\tres( { success: { insert_id: results.insertId } } );\n\t\t\t\t\t} else { \n\t\t\t\t\t\tconsole.trace( error );\n\t\t\t\t\t\tawait Trace.WriteTrace( { level: 'ERROR', text: `${tpre} ${error}`, stack: new Error().stack } );\n\t\t\t\t\t\tres( { error: error } );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tconnection.end();\n\t\t\t} );\n\n\t\t} else {\n\t\t\treturn { error: 'missing sql' };\n\t\t}\n\t}", "title": "" }, { "docid": "32d93da4e834dcca5c9873029bc411bf", "score": "0.52162224", "text": "function borrarDato(tabla,clave){\n var respuesta = indexedDB.open(DB_NAME);\n\n respuesta.onsuccess = function(evento){\n var db = evento.target.result;\n db.transaction([tabla],\"readwrite\").objectStore(tabla).delete(clave);\n };\n}", "title": "" }, { "docid": "0060ef2c8b733eac13084ffebb183db5", "score": "0.5215197", "text": "save() {\n try {\n this.logging && console.log('save', this.name, { ...this.data }, JSON.stringify(this.data));\n const data = JSON.stringify(this.data);\n this.backend.setItem(this.name, data);\n } catch (error) {\n console.warn(error);\n }\n }", "title": "" }, { "docid": "5c031e47526cc42f948522f77589431d", "score": "0.5214932", "text": "function Prod_add_data(obj)\n{\nconsole.log(obj); \n\n\ndatabase.transaction(function(tx) {\n tx.executeSql('INSERT INTO products(code,desc,unit,price) VALUES (?,?,?,?)', [obj.code,obj.desc,obj.unit,obj.price]);\n }, function(error) {\n console.log('Transaction ERROR: ' + error.message);\n }, function() {\n console.log('Data added');\n\tredirect('product');\n });\n \n \n \n}", "title": "" }, { "docid": "d2ad29faec44305df62fe3530680f272", "score": "0.52139705", "text": "_dbFlush () {\n Promise.resolve().then(() => (\n this._dbCreate()\n ));\n }", "title": "" }, { "docid": "ebf44d2f1403434b96f1f86f9d2e4cb9", "score": "0.5209776", "text": "function save(session, database, entity) {\n var result;\n if (entity.uid) {\n //try to find\n var array = database.queryByUids('SensingData', [entity.uid]);\n if (array && array.length > 0) {\n //Copy revision\n entity.rev = array[0].rev;\n } else {\n result = database.insert(entity);\n }\n } else {\n result = database.insert(entity);\n }\n //The inserted object is internally associated with the device where the data origins.\n session.log(TAG, 'The object@uid:' + result.uid + 'has been saved to the database.');\n}", "title": "" }, { "docid": "194a70224a25b78b4d6f1fe725481527", "score": "0.5209286", "text": "isSaved() {\n return this[this.#_primaryKey] != null;\n }", "title": "" }, { "docid": "58062f6260527831cdf050fd1b99202a", "score": "0.5207091", "text": "equipEquipament () {\n\t\t\n\t\treturn this.save();\n\t}", "title": "" }, { "docid": "6b86fef31c23e7dbf3dece0a63cbb00a", "score": "0.5205792", "text": "async commit({ save = false, regenerate = false } = {}) {\n const session = this.session;\n const opts = this.opts;\n const ctx = this.ctx;\n\n // not accessed\n if (undefined === session) return;\n\n // removed\n if (session === false) {\n await this.remove();\n return;\n }\n if (regenerate) {\n await this.remove();\n if (this.store) this.externalKey = opts.genid && opts.genid(ctx);\n }\n\n // force save session when `session._requireSave` set\n const reason = save || regenerate || session._requireSave ? 'force' : this._shouldSaveSession();\n debug('should save session: %s', reason);\n if (!reason) return;\n\n if (typeof opts.beforeSave === 'function') {\n debug('before save');\n opts.beforeSave(ctx, session);\n }\n const changed = reason === 'changed';\n await this.save(changed);\n }", "title": "" }, { "docid": "b9853dc66e9f93f47ae7b8162d60e548", "score": "0.5205454", "text": "function putInMyCaddy() {\n let transaction = db.transaction(\"choices\", \"readwrite\");\n transaction.oncomplete = function () {\n console.log(\"Transaction terminée\");\n };\n let choices = transaction.objectStore(\"choices\");\n\n let choice = {\n id: idOfMyArticle, // Base indexée sur l'id et un seul identifiant par article quelque soit l'option\n option: myOptionChoice,\n imageUrl: details[objectNumberOfDetails].imageUrl,\n name: details[objectNumberOfDetails].name,\n description: details[objectNumberOfDetails].description,\n price: details[objectNumberOfDetails].price,\n quantity: 1,\n commande: new Date()\n };\n let write = choices.add(choice);\n write.onsuccess = function () {\n console.log(\"choix ajouté \" + write.result);\n };\n alert(\"Enregistré au panier !\")\n backToTheList();\n}", "title": "" }, { "docid": "525f59909c3612d9a0aaf25a5466a839", "score": "0.52042085", "text": "flushdb() {\n return this.sendCommand('FLUSHDB', 'ok');\n }", "title": "" }, { "docid": "47a8b73d5dd0696bfa4112ef2153156f", "score": "0.5203151", "text": "function save_saleSeg(){\n pg.connect(conString, function(err, client, done){ //conectar a la base de datos\n if(err){\n return console.error('error conexion save_sale', err);\n }else{\n volumen[3]=46;\n vol_tabla = parseFloat(volumen);\n client.query(\"SELECT MAX(id) FROM venta;\", function(err,result){ //consulto maximo id de venta\n done();\n if(err){ \n return console.error('error toma MAX save_sale', err);\n }else{\n console.log(result.rows[0].max);\n var last_id = result.rows[0].max; //Cargo el maximo id de venta\n if(codigoError == '0' || codigoError == '2002' || codigoError =='2001'){ //Cargar dato de si fue enviada o no la venta\n if(error_local == 0){\n b_enviada = 'TRUE';\n }else{\n b_enviada = 'FALSE'; \n }\n }else{\n b_enviada = 'FALSE';\n }\n console.log(\"Save sale>>\"+id_ventaoff);\n client.query(sprintf(\"UPDATE venta SET (id_venta, id_estacion, serial, cara, producto, precio, dinero, volumen, fecha, enviada) = ('%1$s','%2$s', '%3$s', '%4$s', '%5$s', '%6$s', '%7$s', '%8$s', '%9$s','%10$s') WHERE id= (SELECT MAX(id) FROM venta WHERE cara = '%4$s');\",id_ventaSeg, idestacion, serialSeg, cara, idproductoSeg, precioSeg, dineroSeg, vol_tabla, fecha, b_enviada,last_id), function(err,result){\n done();\n if(err){ \n printrec = 0; \n\t\t\t\t\t\t\timp = 0;\n\t\t\t\t\t\t\tprint_ventaSeg(); //Imprime venta sin insertar en la DB \n return console.error('error actualizacion save_sale', err); \n }else{\n printrec = 0; \n\t\t\t\t\t\t\timp = 0;\n\t\t\t\t\t\t\tprint_ventaSeg(); //Imprime venta sin insertar en la DB \n\t\t\t\t\t\t\tpg.end();\n }\n });\n } \n }); \n }\n }); \n}", "title": "" }, { "docid": "b1bb070478335cc65491323d36c67095", "score": "0.52009547", "text": "function resetDB() {\n return sequelize.sync({ force: true });\n}", "title": "" }, { "docid": "3c3e93b2af16a44a9017130023e15c0c", "score": "0.51941544", "text": "function doSave(force) {\n dirty = false;\n }", "title": "" }, { "docid": "0852c929ebee225ef743f1a2f0f71bd9", "score": "0.51909184", "text": "function insertarCliente(newCliente){\n //Crear una transaccion\n let transaction = dataBase.transaction('CRM', 'readwrite');\n //Crear el almacen\n let objectStore = transaction.objectStore('CRM');\n //Cargar el nuevo cliente\n objectStore.add(newCliente);\n //Alertas success y error\n transaction.onerror = function(){\n ui.showAlert('red', 'El cliente ya esta registrado');\n }\n transaction.oncomplete = function(){\n ui.listenAudio(newCliente.nombre)\n ui.showAlert('green', 'Nuevo cliente cargado');\n //me dispara hacia el html despues de dos segundos\n setTimeout(()=>{\n window.location.href = 'index.html'\n },300)\n\n }\n}", "title": "" }, { "docid": "1095aefbab941fd279458038e8c928fd", "score": "0.51893175", "text": "async function save() {\n if (!gister.hasCredentials()) {\n return;\n }\n ui.status.info(\"Saving...\");\n ui.result.clear();\n const savedDatabase = await sqlite.save(database, ui.editor.value);\n if (!savedDatabase) {\n ui.status.error(\"Failed to save database\");\n return;\n }\n database = savedDatabase;\n showDatabase(database);\n}", "title": "" }, { "docid": "abd35e34d1232d2fd1b6f8451f5e8d13", "score": "0.51875615", "text": "function mostrarTablaIdeas(){\n sessionStorage.idTable = 'TableId';\n cargarDatos();\n }", "title": "" }, { "docid": "4a633f31978faa8bf5d3886c313b508c", "score": "0.5186608", "text": "function clearDB() {\n M.toast({ html: `Clearing out unsaved...` });\n\n axios({\n method: 'delete',\n url: `/delete/`\n }).then(function (response) {\n location.reload();\n }).catch(function (err) {\n if (err) throw err;\n });\n }", "title": "" }, { "docid": "f25f3ff89ababe63aa64c2ea1532631f", "score": "0.5185203", "text": "async addToDb() {\n console.log(\"tu sam\");\n const sql = `INSERT INTO sudionik (idosobe, nazivgrupa) VALUES('${this.id}', '${this.nazivGrupa}');`;\n await SQLutil.query(sql);\n }", "title": "" }, { "docid": "06d9e51a79bdaa133b8117d438cc119c", "score": "0.5183115", "text": "function populateDB(tx) {\n tx.executeSql('Create Table IF NOT EXISTS categorias_ingreso(id_categoria_ingreso integer primary key, nombre_categoria_ingreso text )');\n tx.executeSql('Create Table IF NOT EXISTS categorias_egreso(id_categoria_egreso integer primary key, nombre_categoria_egreso text )');\n tx.executeSql('Create Table IF NOT EXISTS subcategorias_egreso(id_subcategoria_egreso integer primary key, nombre_subcategoria_egreso, id_categoria_egreso integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_ingreso(id_saldo_ingreso integer primary key, fecha_ingreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_ingresado real, id_categoria_ingreso integer, id_cuenta_in integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_egreso(id_saldo_egreso integer primary key, fecha_egreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_egresado real, id_subcategoria_egreso integer, id_cuenta_in integer)');\n }", "title": "" }, { "docid": "c99d8d08c4d0d95db4b8aef1551193b3", "score": "0.5182459", "text": "async save(user) {\n const sql = 'INSERT INTO FAVORITES SET ?;';\n return await this.connection.query(sql, user);\n }", "title": "" }, { "docid": "55a4354617e9fd849001b62d58b5b029", "score": "0.517842", "text": "save(){\n localStorage.setItem(CYCLING_LS, JSON.stringify(this.allUserData))\n }", "title": "" }, { "docid": "277fac43bdb3889a85ad299fd9821a24", "score": "0.51773006", "text": "function saveDispositivo(req, res) {\r\n let dispositivo = new Dispositivo();\r\n\r\n dispositivo.NOMBRE_DISPOSITIVO = os.hostname();\r\n dispositivo.USUARIO = req.body.USUARIO;\r\n dispositivo.DIRECCION_IP = ip.address();\r\n var fecha = new Date(Date.now());\r\n\r\n function pad(n) { return n < 10 ? \"0\" + n : n; }\r\n fecha = pad(fecha.getFullYear()) + \"-\" + pad(fecha.getMonth() + 1) + \"-\" + pad(fecha.getDate()) + \" \" + pad(fecha.getHours()) + \":\" + pad(fecha.getMinutes());\r\n\r\n dispositivo.FECHA_CONEXION = fecha;\r\n\r\n dispositivo.save((err, dispositivoStored) => {\r\n\r\n if (err) res.status(500).send({ \"OK\": 0, \"Mensaje\": \"No fue posible guardar en la BD. Intente nuevamente o consulte al admimnistrador.\" });\r\n return res.send({ \"OK\": 1, \"Mensaje\": \"Guardado con éxito\" });\r\n\r\n });\r\n}", "title": "" }, { "docid": "c549d8a14a267770a870aca0241f875c", "score": "0.516469", "text": "function save() {\n fs.writeFile('./data/usersDb.json', JSON.stringify(dbUsers))\n}", "title": "" }, { "docid": "276bb6d5fbf6f2aad33251013210167d", "score": "0.51615906", "text": "function Actualizar(){\n //capturando valores\n var cod = txtCod.value;\n var nom = txtNom.value;\n var ape = txtApe.value;\n var cor = txtCor.value;\n //seleecionamos la tabla que vamos actuazlizar con su codigo\n var db = database.ref(\"registro/\"+cod);\n //le pasamos los datos que vamos a actualizar\n db.update({\n nombre: nom,\n apellido: ape,\n correo: cor,\n });\n alert(\"Se actualizo el dato\");\n //llamamos al procedimiento limpiar \n Limpiar();\n //llamaos al procedimiento mostrar\n Mostrar();\n}", "title": "" }, { "docid": "0ac45f75a6f3b6d958396afdc9b74a42", "score": "0.5161561", "text": "function CrearBaseDatos(){\n //Comprobamos si el navegador tiene indexDB\n if(!window.indexedDB){\n window.alert(\"El navegador no soporta el IndexedDB.\")\n }\n\n var db = indexedDB.open(DB_NAME,1);\n\n db.onupgradeneeded = function (evento){\n var dataBase = db.result;\n\n //Creamos las tablas de los objetos de VideoSystem\n dataBase.createObjectStore(\"Categorias\", {keyPath: 'Nombre'});\n dataBase.createObjectStore(\"Producciones\", {keyPath: 'Titulo'});\n dataBase.createObjectStore(\"Actores\", {keyPath: 'Apellido1'});\n dataBase.createObjectStore(\"Directores\", {keyPath: 'Apellido1'});\n dataBase.createObjectStore(\"Usuarios\", {keyPath: 'Usuario'});\n dataBase.createObjectStore(\"AsignarCategorias\", {keyPath: 'Categoria'});\n dataBase.createObjectStore(\"AsignarActores\", {keyPath: 'Actor'});\n dataBase.createObjectStore(\"AsignarDirectores\", {keyPath: 'Director'});\n };\n}", "title": "" }, { "docid": "82d6bba3ef2d317c49b65c39ca7f8630", "score": "0.5151736", "text": "function saveRecord(record) {\n //open a new transaction with the database with read and write permissions\n const transaction = db.transaction(['new_pizza'], 'readwrite');\n\n //access object store for new_pizza\n const pizzaObjectStore = transaction.objectStore('new_pizza');\n\n //add record to your store with add method\n pizzaObjectStore.add(record);\n}", "title": "" }, { "docid": "5fea07bec527a380fbe203940e26b485", "score": "0.514938", "text": "function dbinit(name,com){\n localStorage.removeItem(name);\n localStorage.setItem(name, JSON.stringify(com));\n }", "title": "" }, { "docid": "ebdc1f804ccab4edd47d9876a7c04ccd", "score": "0.51476836", "text": "gravar(d){\r\n\t\tlet id = this.getProximoId()\r\n\t\tlocalStorage.setItem(id, JSON.stringify(d))\r\n\r\n\t\tlocalStorage.setItem('id', id)\r\n\t}", "title": "" }, { "docid": "0f76d2c3c4b20ebe0dd606179c4ebc1e", "score": "0.5143929", "text": "function resetDb(){\n Languages.remove({})\n Corpora.remove({})\n Authors.remove({})\n Works.remove({})\n Texts.remove({})\n\n}", "title": "" }, { "docid": "cd18772ddb48210007408f8f96708ffe", "score": "0.5143465", "text": "salvarAcionista() {\r\n sessionStorage.setItem(('AC_Nome_' + this.conta.numeroDaConta), this.nome)\r\n sessionStorage.setItem(('AC_Agencia_' + this.conta.numeroDaConta), this.agencia)\r\n sessionStorage.setItem(('AC_TipoDeUsuario_' + this.conta.numeroDaConta), this.tipoDeUsuario)\r\n sessionStorage.setItem(('AC_Senha_' + this.conta.numeroDaConta), this.senha)\r\n sessionStorage.setItem(('AC_NumeroDaConta_' + this.conta.numeroDaConta), this.conta.numeroDaConta)\r\n sessionStorage.setItem(('AC_SaldoConta_' + this.conta.numeroDaConta), this.conta.saldoDaConta)\r\n }", "title": "" }, { "docid": "13a247497bbbff2ae65d6b54b7d2e5dd", "score": "0.51429", "text": "function saveToDatabase(data){\n\t// init database\n\tconst db = openDatabase();\n\t\n\t// on success add user\n\tdb.onsuccess = (event) => {\n\n\t\t// console.log('database has been openned !');\n\t\tconst query = event.target.result;\n\n\t \t// check if already exist symbol\n\t\tconst currency = query.transaction(\"currencies\").objectStore(\"currencies\").get(data.symbol);\n\n\t\t// wait for users to arrive\n\t \tcurrency.onsuccess = (event) => {\n\t \t\tconst dbData = event.target.result;\n\t \t\tconst store = query.transaction(\"currencies\", \"readwrite\").objectStore(\"currencies\");\n\n\t \t\tif(!dbData){ \n\t \t\t\t// save data into currency object\n\t\t\t\tstore.add(data, data.symbol);\n\t \t\t}else{\n\t \t\t\t// update data existing currency object\n\t\t\t\tstore.put(data, data.symbol);\n\t \t\t};\n\t \t}\n\t}\n}", "title": "" }, { "docid": "30b34852f159a2cfa812fd76fe0bf974", "score": "0.5134017", "text": "save() {\n //db.result - gives you the number of rows affected\n return db.result(`UPDATE users SET \n \n email ='${this.email}',\n password = '${this.password}'\n where id = ${this.id}`);\n }", "title": "" }, { "docid": "975b06eeb0c02ca618f33193e3ea61bb", "score": "0.5133715", "text": "function Actualizar(){\n //capturando valores\n var cod = txtCod.value;\n var nom=txtNom.value;\n var ape=txtApe.value;\n var dni=txtDni.value;\n var fec=txtFec.value;\n var dir=txtDir.value;\n var dis=cboDistrito.options[cboDistrito.selectedIndex].text;\n var tel=txtTel.value;\n var cel=txtCel.value;\n var cor=txtCor.value;\n var sexo=\"\";\n if(rbMas.checked==true){\n sexo=\"Masculino\";\n }else if(rbFem.checked==true){\n sexo=\"Femenino\";\n }else if(rbOtr.checked==true){\n sexo=\"Otros\";\n }else{\n sexo=\"\";\n }\n var est= \"\";\n if(chkEst.checked == true){\n est = \"Habilitado\";\n }else{\n est = \"Deshabilitado\";\n }\n //seleccionamos la tabla que queremos actualizar con el codigo del registro\n var db=database.ref(\"alumno/\"+cod);\n //le asignamos los valores que se van actualizar\n db.update({\n nombre: nom,\n apellido: ape,\n dni: dni,\n fecha: fec,\n direccion: dir,\n distrito: dis,\n telefono: tel,\n celular: cel,\n correo: cor,\n sexo: sexo,\n estado: est,\n });\n alert(\"Se actualizo el dato\");\n //llamamos al procedimiento Limpiar\n Mostrar();\n}", "title": "" }, { "docid": "2099b17fd471aa75836e1b006dcebdc3", "score": "0.5128575", "text": "function insertar_SE(id_serie,temporada,capitulo) {\n db = window.openDatabase(shortName, version, displayName, maxSize);\n db.transaction(function(tx) {\n tx.executeSql('INSERT INTO series_se (id_serie, temporada,capitulo) VALUES (?,?,?)', [id_serie,temporada,capitulo], nullHandler(\"insert series_se\"), errorHandler);\n });\n}", "title": "" }, { "docid": "d09b84fabf36c48489de42bae5dd1d6f", "score": "0.5125938", "text": "save() {\n throw new Error('Implement .save()');\n }", "title": "" } ]
7f6cc45dc62bee0d9b519d1c2c029afe
On visiting object, check for its dependencies and visit them recursively
[ { "docid": "44c8b7a5f646acc78a1203d965dd2d66", "score": "0.0", "text": "function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }", "title": "" } ]
[ { "docid": "8f3b9d5f7d7343baad58ab9fe375bbef", "score": "0.70806235", "text": "function _checkCircularDependencies(obj, visited){\n if (obj.circularCheck){\n return;\n }\n var fn = obj.fullName();\n if (visited.includes(fn)){\n throw new Error(\"Encountered circular dependency in test '\"+fn+\"'\");\n }\n\n visited = visited.slice(0);\n visited.push(fn);\n var i, ln;\n\n if (obj.children !== undefined){\n var keys = Object.keys(obj.children);\n ln = keys.length;\n for(i=0 ; i<ln ; i++){\n _checkCircularDependencies(obj.children[keys[i]], visited);\n }\n if (obj.test != undefined){\n _checkCircularDependencies(obj.test, visited);\n }\n } else {\n var dep;\n ln = obj.dependencyNames.length;\n for(i=0 ; i<ln ; i++){\n dep = nameMap[obj.dependencyNames[i]];\n if (dep === undefined){\n throw new Error(\"Undefined dependency '\"+obj.dependencyNames[i]+\"' in test '\"+fn+\"'\");\n }\n _checkCircularDependencies(dep, visited);\n }\n }\n obj.circularCheck = true;\n }", "title": "" }, { "docid": "7a7429ffbc1b2ee2079d9e609b4e2f79", "score": "0.65348357", "text": "function traverseWithCancel(object, visitor)\n{\n var key, child;\n\n if( visitor.call(null, object) )\n {\n\t for (key in object) {\n\t if (object.hasOwnProperty(key)) {\n\t child = object[key];\n\t if (typeof child === 'object' && child !== null) {\n\t traverseWithCancel(child, visitor);\n\t }\n\t }\n\t }\n \t }\n}", "title": "" }, { "docid": "7a7429ffbc1b2ee2079d9e609b4e2f79", "score": "0.65348357", "text": "function traverseWithCancel(object, visitor)\n{\n var key, child;\n\n if( visitor.call(null, object) )\n {\n\t for (key in object) {\n\t if (object.hasOwnProperty(key)) {\n\t child = object[key];\n\t if (typeof child === 'object' && child !== null) {\n\t traverseWithCancel(child, visitor);\n\t }\n\t }\n\t }\n \t }\n}", "title": "" }, { "docid": "2f7b36ba061a05513c3924e5b1a3cef0", "score": "0.6504718", "text": "function detectCycleRecursive(inputObj) {\n if (visitedTypes[inputObj.name]) {\n return;\n }\n\n visitedTypes[inputObj.name] = true;\n fieldPathIndexByTypeName[inputObj.name] = fieldPath.length;\n var fields = objectValues(inputObj.getFields());\n\n for (var _i28 = 0; _i28 < fields.length; _i28++) {\n var field = fields[_i28];\n\n if (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) {\n var fieldType = field.type.ofType;\n var cycleIndex = fieldPathIndexByTypeName[fieldType.name];\n fieldPath.push(field);\n\n if (cycleIndex === undefined) {\n detectCycleRecursive(fieldType);\n } else {\n var cyclePath = fieldPath.slice(cycleIndex);\n var pathStr = cyclePath.map(function (fieldObj) {\n return fieldObj.name;\n }).join('.');\n context.reportError(\"Cannot reference Input Object \\\"\".concat(fieldType.name, \"\\\" within itself through a series of non-null fields: \\\"\").concat(pathStr, \"\\\".\"), cyclePath.map(function (fieldObj) {\n return fieldObj.astNode;\n }));\n }\n\n fieldPath.pop();\n }\n }\n\n fieldPathIndexByTypeName[inputObj.name] = undefined;\n }", "title": "" }, { "docid": "98f0e450c95ff1713d4a2de61e123c46", "score": "0.65007347", "text": "function detectCycleRecursive(inputObj) {\n if (visitedTypes[inputObj.name]) {\n return;\n }\n\n visitedTypes[inputObj.name] = true;\n fieldPathIndexByTypeName[inputObj.name] = fieldPath.length;\n var fields = (0, _objectValues3.default)(inputObj.getFields());\n\n for (var _i28 = 0; _i28 < fields.length; _i28++) {\n var field = fields[_i28];\n\n if ((0, _definition.isNonNullType)(field.type) && (0, _definition.isInputObjectType)(field.type.ofType)) {\n var fieldType = field.type.ofType;\n var cycleIndex = fieldPathIndexByTypeName[fieldType.name];\n fieldPath.push(field);\n\n if (cycleIndex === undefined) {\n detectCycleRecursive(fieldType);\n } else {\n var cyclePath = fieldPath.slice(cycleIndex);\n var pathStr = cyclePath.map(function (fieldObj) {\n return fieldObj.name;\n }).join('.');\n context.reportError(\"Cannot reference Input Object \\\"\".concat(fieldType.name, \"\\\" within itself through a series of non-null fields: \\\"\").concat(pathStr, \"\\\".\"), cyclePath.map(function (fieldObj) {\n return fieldObj.astNode;\n }));\n }\n\n fieldPath.pop();\n }\n }\n\n fieldPathIndexByTypeName[inputObj.name] = undefined;\n }", "title": "" }, { "docid": "0842aa33caaae8797a4cb00aa3a84805", "score": "0.6474099", "text": "function detectCycleRecursive(inputObj) {\n if (visitedTypes[inputObj.name]) {\n return;\n }\n\n visitedTypes[inputObj.name] = true;\n fieldPathIndexByTypeName[inputObj.name] = fieldPath.length;\n var fields = (0, _objectValues5.default)(inputObj.getFields());\n\n for (var _i30 = 0; _i30 < fields.length; _i30++) {\n var field = fields[_i30];\n\n if ((0, _definition.isNonNullType)(field.type) && (0, _definition.isInputObjectType)(field.type.ofType)) {\n var fieldType = field.type.ofType;\n var cycleIndex = fieldPathIndexByTypeName[fieldType.name];\n fieldPath.push(field);\n\n if (cycleIndex === undefined) {\n detectCycleRecursive(fieldType);\n } else {\n var cyclePath = fieldPath.slice(cycleIndex);\n var pathStr = cyclePath.map(function (fieldObj) {\n return fieldObj.name;\n }).join('.');\n context.reportError(\"Cannot reference Input Object \\\"\".concat(fieldType.name, \"\\\" within itself through a series of non-null fields: \\\"\").concat(pathStr, \"\\\".\"), cyclePath.map(function (fieldObj) {\n return fieldObj.astNode;\n }));\n }\n\n fieldPath.pop();\n }\n }\n\n fieldPathIndexByTypeName[inputObj.name] = undefined;\n }", "title": "" }, { "docid": "5681512f2d451cc04a7f840e5958e97c", "score": "0.6432591", "text": "traverse(current, node, visited = new Set()) {\n // Mark this node as visited\n visited.add(current);\n // Recursively call this method on dependents of the argument node\n let dependents = this.getDependents(current, true);\n for (let d of dependents) {\n // Check if this dependency causes a circular dependency\n if (d == node) {\n throw new Error(\"circular dependency\");\n }\n // Continue traversing un-explored nodes\n if (!visited.has(d)) {\n this.traverse(d, node, visited);\n }\n }\n }", "title": "" }, { "docid": "32ccf46de5355c656269937f69869d88", "score": "0.6403484", "text": "function traverse(object, visitor) \n{\n var key, child;\n visitor.call(null, object);\n\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n traverse(child, visitor);\n }\n }\n }\n}", "title": "" }, { "docid": "c47d8f51a7bceccbbe367716c67be10c", "score": "0.6379429", "text": "function traverse(object, visitor) {\n var key, child;\n\n if (visitor.call(null, object) === false) {\n return;\n }\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n traverse(child, visitor)\n }\n }\n }\n}", "title": "" }, { "docid": "7cab050a3196ab17da59b7d457692a91", "score": "0.6360627", "text": "function traverse(object, visitor) \n{\n var key, child;\n\n visitor.call(null, object);\n\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n traverse(child, visitor);\n }\n }\n }\n}", "title": "" }, { "docid": "37ca943e1b152a5ff7fdec6b224fbf77", "score": "0.6341773", "text": "function traverse(object, visitor, master) {\n var key, child, parent, path;\n\n parent = (typeof master === 'undefined') ? [] : master;\n\n if (visitor.call(null, object, parent) === false) {\n return;\n }\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n path = [ object ];\n path.push(parent);\n if (typeof child === 'object' && child !== null) {\n traverse(child, visitor, path);\n }\n }\n }\n }", "title": "" }, { "docid": "21d34c8662c0cc40bf8ca6a24f28c751", "score": "0.6338236", "text": "async function walk (oid) {\n visited.add(oid);\n let { type, object } = await readObject({ fs, gitdir, oid });\n // Recursively resolve annotated tags\n if (type === 'tag') {\n let tag = GitAnnotatedTag.from(object);\n let commit = tag.headers().object;\n return walk(commit)\n }\n if (type !== 'commit') {\n throw new GitError(E.ObjectTypeAssertionFail, {\n oid,\n type,\n expected: 'commit'\n })\n }\n let commit = GitCommit.from(object);\n let parents = commit.headers().parent;\n for (oid of parents) {\n if (!finishingSet.has(oid) && !visited.has(oid)) {\n await walk(oid);\n }\n }\n }", "title": "" }, { "docid": "1bcc9acbeaf0ee38e507bc65fad44f4f", "score": "0.6293846", "text": "function traverse(object, visitor) {\n let key;\n let child;\n\n visitor.call(null, object);\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n traverse(child, visitor);\n }\n }\n }\n}", "title": "" }, { "docid": "0263c5321bab3ad512c1f7b7a2175eb2", "score": "0.62458766", "text": "function recurse(obj) {\n // this should get a dependencies object\n var keys = Object.keys(obj);\n // condition said no for/while loops but you have to for dependencies\n keys.forEach(function(key) {\n // on each key you need to recurse\n array.push(key+\"@\"+obj[key].version);\n if(obj[key].hasOwnProperty('dependencies')) {\n recurse(obj[key].dependencies);\n } else {\n return;\n }\n });\n}", "title": "" }, { "docid": "e66d55c295321e36c1169437444f6065", "score": "0.62387407", "text": "function findObjectPropertyPath(containerName, container, obj, visited)\n{\n if (!container || !obj || !visited)\n return false;\n\n var referents = [];\n visited.push(container);\n for (var p in container)\n {\n if (container.hasOwnProperty(p))\n {\n var candidate = null;\n try\n {\n candidate = container[p];\n }\n catch(exc)\n {\n // eg sessionStorage\n }\n\n if (candidate === obj) // then we found a property pointing to our obj\n {\n referents.push(new Referent(containerName, container, p, obj));\n }\n else // recurse\n {\n var candidateType = typeof (candidate);\n if (candidateType === 'object' || candidateType === 'function')\n {\n if (visited.indexOf(candidate) === -1)\n {\n var refsInChildren = findObjectPropertyPath(p, candidate, obj, visited);\n if (refsInChildren.length)\n {\n // As we unwind the recursion we tack on layers of the path.\n for (var i = 0; i < refsInChildren.length; i++)\n {\n var refInChildren = refsInChildren[i];\n refInChildren.prependPath(containerName, container);\n referents.push(refInChildren);\n\n FBTrace.sysout(\" Did prependPath with p \"+p+\" gave \"+\n referents[referents.length - 1].getObjectPathExpression(),\n referents[referents.length - 1]);\n }\n }\n }\n //else we already looked at that object.\n } // else the object has no properties\n }\n }\n }\n\n FBTrace.sysout(\" Returning \"+referents.length+ \" referents\", referents);\n\n return referents;\n}", "title": "" }, { "docid": "c94d581b6cd806c30cbd5b2e09bc1f69", "score": "0.6183049", "text": "function traverseWithParents(object, visitor)\n{\n\tvar key, child;\n\n\tvisitor.call(null, object);\n\n\tfor (key in object) {\n\t\tif (object.hasOwnProperty(key)) {\n\t\t\tchild = object[key];\n\t\t\tif (typeof child === 'object' && child !== null && key != 'parent') \n\t\t\t{\n\t\t\t\tchild.parent = object;\n\t\t\t\t\ttraverseWithParents(child, visitor);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "924440faa176290fd25648ad0542a607", "score": "0.617263", "text": "function circularReferenceCheck(shadows) {\r\n // if any of the current objects to process exist in the queue\r\n // then throw an error.\r\n shadows.forEach(function (item) {\r\n if (item instanceof Object && visited.indexOf(item) > -1) {\r\n throw new Error('Circular reference error');\r\n }\r\n });\r\n // if none of the current objects were in the queue\r\n // then add references to the queue.\r\n visited = visited.concat(shadows);\r\n }", "title": "" }, { "docid": "da04664e06e08aab014b4eb52f01fd16", "score": "0.61394626", "text": "function traverseWithParents(object, visitor)\n{\n var key, child;\n\n visitor.call(null, object);\n\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null && key != 'parent') \n {\n \tchild.parent = object;\n\t\t\t\t\ttraverseWithParents(child, visitor);\n }\n }\n }\n}", "title": "" }, { "docid": "da04664e06e08aab014b4eb52f01fd16", "score": "0.61394626", "text": "function traverseWithParents(object, visitor)\n{\n var key, child;\n\n visitor.call(null, object);\n\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null && key != 'parent') \n {\n \tchild.parent = object;\n\t\t\t\t\ttraverseWithParents(child, visitor);\n }\n }\n }\n}", "title": "" }, { "docid": "9862bb9f397912540e07b7765f6eb0c8", "score": "0.6119423", "text": "function traverseWithParents(object, visitor)\n{\n var key, child;\n\n visitor.call(null, object);\n\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null && key != 'parent') \n {\n \tchild.parent = object;\n\t\t\t\ttraverseWithParents(child, visitor);\n }\n }\n }\n}", "title": "" }, { "docid": "2d9817001f0f810fc73b1c9fc1452ebe", "score": "0.6019683", "text": "function visit(obj) {\n\t\tif (obj === null || typeof obj !== 'object') {\n\t\t\treturn obj;\n\t\t}\n\n\t\tif (seen.indexOf(obj) !== -1) {\n\t\t\treturn '[Circular]';\n\t\t}\n\t\tseen.push(obj);\n\n\t\tif (typeof obj.toJSON === 'function') {\n\t\t\ttry {\n\t\t\t\treturn visit(obj.toJSON());\n\t\t\t} catch(err) {\n\t\t\t\treturn throwsMessage(err);\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(obj)) {\n\t\t\treturn obj.map(visit);\n\t\t}\n\n\t\treturn Object.keys(obj).reduce(function(result, prop) {\n\t\t\t// prevent faulty defined getter properties\n\t\t\tresult[prop] = visit(safeGetValueFromPropertyOnObject(obj, prop));\n\t\t\treturn result;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "7e3bdc0108dcbfc637583bd5b6f92aa1", "score": "0.5931205", "text": "recurseObjectTree(objectTree, list, isRootPkg = false) {\n if (objectTree.extraneous && !this.devDependencies) {\n return;\n }\n if (!isRootPkg) {\n if (this.maybePushNewCoordinate(objectTree, list)) {\n // NO OP\n }\n else {\n return;\n }\n }\n if (objectTree.dependencies) {\n Object.keys(objectTree.dependencies)\n .map((x) => objectTree.dependencies[x])\n .filter((x) => typeof x !== 'string')\n .map((dep) => {\n if (this.toPurlObjTree(dep) == '' ||\n list.find((x) => {\n return x.toPurl() == this.toPurlObjTree(dep);\n })) {\n return;\n }\n this.recurseObjectTree(dep, list, false);\n });\n }\n return;\n }", "title": "" }, { "docid": "eae1834e77687beb34c9612fd67e8cf1", "score": "0.589705", "text": "function traverseTree(object, path){\n\t// check current object\n\tif(object.type != undefined){\n\t\t// make node object with null tag and value properties\n\t\tif (typeof eval(path) != \"object\"){\n\t\t\teval(path + \"={tag: null, value: null,};\");\n\t\t}\n\t\telse {\n\t\t\teval(path + \".tag = null; \" + path + \".value = null;\");\n\t\t}\n\t\t// get node tag and value\n\t\tnodeInfo = processNode(object);\n\t\t// set node tag and value\n\t\tif (nodeInfo.tag != null){\n\t \t\teval(path + \".tag = \\\"\" + String(nodeInfo.tag) + \"\\\";\");\n\t\t}\n\t\tif (nodeInfo.value != null){\n\t\t\teval(path + \".value = \\\"\" + String(nodeInfo.value) + \"\\\";\");\n\t\t}\n\n\t\t// handle complex data nodes, return nonnested object\n\t\tif (node.needsNonNested){\n\t\t\tmakeNonNestedObject(object, path, 0);\n\t\t\t// do not traverse any more\n\t\t\tgAST.count++;\n\t\t\treturn\n\t\t}\n\n\t\t// increment node id\n\t\tgAST.count++;\n\t\t//console.log(\"node count: \" + gAST.count);\n\t\t//console.log(object.type);\n\t}\n\n\n\t// traverse all, do something for only objects and arrays\n\tfor(var key in object) {\n if((object.hasOwnProperty(key)) && (object[key] != null) && (typeof object[key] == \"object\")) {\n\t\t// node\n\t\tif(object[key].type != undefined){\n\t\t\t//console.log(\"node\");\n\t\t\ttraverseTree(object[key], path + \".node\" + gAST.count);\n\t\t}\n\t\t// array\n\t\telse if (object[key].length > 1){\n\t\t\t//console.log(\"array\");\n\t\t\ttraverseTree(object[key], path);\n\t\t}\n\t\t// nonnode object\n\t\telse { \n\t\t\t//console.log(\"nonnode object\");\n\t\t\ttraverseTree(object[key], path);\n\t\t}\n }\n\t}\n}", "title": "" }, { "docid": "ac13875b05a82d40c37710ddda096344", "score": "0.5873183", "text": "function traverse(o) {\n for (var i in o) {\n if(i == 'id' || i == 'parent_id' || i == 'dtype'){\n delete o[i];\n }else if(i == 'groups' && o[i].length == 0){\n delete o[i];\n }\n if (o[i] !== null && typeof(o[i])==\"object\") {\n //going on step down in the object tree!!\n traverse(o[i]);\n }\n }\n }", "title": "" }, { "docid": "cddfee79c465e4a25a72446f4250788f", "score": "0.5870895", "text": "function _traverse(o,func) {\n for (var i in o) {\n o[i] = func.apply(this,[i,o[i]]);\n if (o[i] !== null && typeof(o[i])==\"object\") {\n //going on step down in the object tree!!\n _traverse(o[i],func);\n }\n }\n}", "title": "" }, { "docid": "e1787a5b2122a0bb04e55bee50a706d0", "score": "0.58493847", "text": "function traverse(obj, encountered, shouldThrow, allowDeepUnsaved) {\n if (obj instanceof _ParseObject2.default) {\n if (!obj.id && shouldThrow) {\n throw new Error('Cannot create a pointer to an unsaved Object.');\n }\n var identifier = obj.className + ':' + obj._getId();\n if (!encountered.objects[identifier]) {\n encountered.objects[identifier] = obj.dirty() ? obj : true;\n var attributes = obj.attributes;\n for (var attr in attributes) {\n if ((0, _typeof3.default)(attributes[attr]) === 'object') {\n traverse(attributes[attr], encountered, !allowDeepUnsaved, allowDeepUnsaved);\n }\n }\n }\n return;\n }\n if (obj instanceof _ParseFile2.default) {\n if (!obj.url() && encountered.files.indexOf(obj) < 0) {\n encountered.files.push(obj);\n }\n return;\n }\n if (obj instanceof _ParseRelation2.default) {\n return;\n }\n if (Array.isArray(obj)) {\n obj.forEach(function (el) {\n if ((typeof el === 'undefined' ? 'undefined' : (0, _typeof3.default)(el)) === 'object') {\n traverse(el, encountered, shouldThrow, allowDeepUnsaved);\n }\n });\n }\n for (var k in obj) {\n if ((0, _typeof3.default)(obj[k]) === 'object') {\n traverse(obj[k], encountered, shouldThrow, allowDeepUnsaved);\n }\n }\n}", "title": "" }, { "docid": "aedfca1697008bcb24143f1169e65456", "score": "0.58383036", "text": "findNextObjects(object, operationsContainer) {\n\t\t// If this object was run findNextObjects before then do nothing\n\t\tif (object.child) return\n\t\t\n\t\tlet arrEdges = _.filter(this.storeConnect.edge, edge => {\n\t\t\treturn edge.source.svgId == this.operationsSvgId && edge.target.svgId == this.operationsSvgId\n\t\t})\n\n\t\tarrEdges.sort((a,b) => {\n\t\t\treturn a.source.y - b.source.y\n\t\t})\n\n\t\tobject.child = []\n\t\tarrEdges.forEach(e => {\n\t\t\tif (this.isNodeConnectToObject(object, e.source)) {\n\t\t\t\tlet tmpObj = null\n\n\t\t\t\tif (e.target.vertexId[0] == 'V') {\n\t\t\t\t\ttmpObj = _.find(operationsContainer.vertex, {'id': e.target.vertexId})\n\t\t\t\t} else {\n\t\t\t\t\ttmpObj = _.find(operationsContainer.boundary, {'id': e.target.vertexId})\n\t\t\t\t}\n\n\t\t\t\tif (tmpObj) {\n\t\t\t\t\tif (tmpObj.parent) {\n\t\t\t\t\t\ttmpObj = _.find(operationsContainer.boundary, {'id':tmpObj.parent})\n\t\t\t\t\t\ttmpObj = tmpObj.findAncestorOfMemberInNestedBoundary()\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.notIn(object.child, tmpObj.id)) {\n\t\t\t\t\t\tobject.child.push(tmpObj)\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t})\n\n\t\tfor(let i = 0; i < object.child.length; i++) {\n\t\t\tthis.findNextObjects(object.child[i], operationsContainer)\n\t\t}\n\t}", "title": "" }, { "docid": "df899521975c22d82142a3c1cb36f55c", "score": "0.5836336", "text": "async function walk (oid) {\n visited.add(oid);\n let { type, object } = await readObject({ fs, gitdir, oid });\n if (type === 'tag') {\n let tag = GitAnnotatedTag.from(object);\n let obj = tag.headers().object;\n await walk(obj);\n } else if (type === 'commit') {\n let commit = GitCommit.from(object);\n let tree = commit.headers().tree;\n await walk(tree);\n } else if (type === 'tree') {\n let tree = GitTree.from(object);\n for (let entry of tree) {\n // only add blobs and trees to the set,\n // skipping over submodules whose type is 'commit'\n if (entry.type === 'blob' || entry.type === 'tree') {\n visited.add(entry.oid);\n }\n // only recurse for trees\n if (entry.type === 'tree') {\n await walk(entry.oid);\n }\n }\n }\n }", "title": "" }, { "docid": "2637a096c2d5ae0cd2bb037a57802752", "score": "0.583475", "text": "function getDependencies(tree) {\n // cannont convert undefined or null to object\n if(tree && tree.hasOwnProperty('dependencies')) {\n // start recursion\n var array = [];\n recurse(tree.dependencies);\n } else { \n return [];\n }\n\n //console.log(array);\n // return an array each step\n function recurse(obj) {\n // this should get a dependencies object\n var keys = Object.keys(obj);\n // condition said no for/while loops but you have to for dependencies\n keys.forEach(function(key) {\n // on each key you need to recurse\n array.push(key+\"@\"+obj[key].version);\n if(obj[key].hasOwnProperty('dependencies')) {\n recurse(obj[key].dependencies);\n } else {\n return;\n }\n });\n}\n // sort \n array.sort();\n\n var unique = array.filter(function(dependency, index, array) {\n // indexOf returns first instance. so duplicate will not return current index\n return array.indexOf(dependency) === index;\n });\n return unique;\n}", "title": "" }, { "docid": "ee851a421ff0b2b6acee3d9663ac7c17", "score": "0.5810041", "text": "_doChildren (node, accumulator) {\n this.stack.push(node)\n for (const key in node) {\n if (Array.isArray(node[key])) {\n node[key].forEach(child => {\n this._walk(child, accumulator)\n })\n } else if (typeof node[key] === 'object') {\n this._walk(node[key], accumulator)\n }\n }\n this.stack.pop(node)\n }", "title": "" }, { "docid": "16da41fcaed46b1fb061640a77c756ba", "score": "0.5783064", "text": "function traverse(object, iterator, parent, parentProperty) {\n var key, child;\n if (iterator(object, parent, parentProperty) === false)\n return;\n for (key in object) {\n if (!object.hasOwnProperty(key))\n continue;\n if (key == 'location' || key == 'type')\n continue;\n child = object[key];\n if (typeof child == 'object' && child !== null)\n traverse(child, iterator, object, key);\n }\n }", "title": "" }, { "docid": "40637d24b62dd32b138df29c38964612", "score": "0.5760117", "text": "function organizeDependencies() {\n selectedObjects.forEach(function(object){\n if(objectsToCreate.indexOf(object) == -1){\n if(object.dependencies.length != 0) {\n object.dependencies.forEach(function(dependency){\n var currentDependency = findObjectFromDependency(dependency);\n if(objectsToCreate.indexOf(currentDependency) == -1){\n objectsToCreate.push(currentDependency);\n }\n });\n objectsToCreate.push(object);\n }else{\n objectsToCreate.push(object);\n }\n }\n });\n }", "title": "" }, { "docid": "20d30e09468c097bb0da6a08d269ecd8", "score": "0.5756984", "text": "function graph(obj) {\n const sorted = []; //sorted list of items with no duplicates\n const iterated = {}; //items already looped over\n const keys = Object.keys(obj);\n\n //Sort packages\n keys.forEach(function recurse(key, ancestors) {\n\n //create ancestors array if it doesn't yet exist\n if (!Array.isArray(ancestors)) {\n ancestors = [];\n }\n //push key (with value) to the ancestors array in order to later check for cycles\n ancestors.push(key);\n //set value of key to true in order to keep track of visted items\n iterated[key] = true;\n\n //check for cycle\n obj[key].forEach(function(dependency){\n //if the key/dependency is in ancestors already then a cycle exists\n if (ancestors.includes(dependency)) {\n throw new Error(\"Yikes a cycle exists!\")\n }\n //checking for visited items: if it is already visited then the loop stops\n if (iterated[dependency]){\n return\n }\n //recursive call\n recurse(dependency, ancestors.slice(0));\n });\n //add items to array if it is not already there\n if (!sorted.includes(key)) {\n sorted.push(key);\n }\n });\n //print data\n const sortedString = sorted.toString();\n console.log(sortedString); // prints to console a comma separated string of package names in the order of install,\n return sortedString;\n}", "title": "" }, { "docid": "49eadae221bffd17df6792661e506550", "score": "0.5675105", "text": "partitionCycles() {\n const cyclePaths = new Set();\n const cycleNodes = new Set();\n\n this.forEach((currentNode, currentName) => {\n // console.error(\"START %s\\n%O\", currentName, currentNode);\n const seen = new Set();\n\n if (currentNode.localDependencies.has(currentName)) {\n // utterly ridiculous self -> self\n seen.add(currentNode);\n cyclePaths.add([currentName, currentName]);\n }\n\n const visits = walk => (dependentNode, dependentName, siblingDependents) => {\n const step = walk.concat(dependentName);\n // console.warn(\"VISITS %O\", step);\n\n if (seen.has(dependentNode)) {\n // console.info(\"SEEN:: %O\", [currentName, dependentName]);\n return;\n }\n\n seen.add(dependentNode);\n\n if (dependentNode === currentNode) {\n // a direct cycle\n cycleNodes.add(currentNode);\n cyclePaths.add(step);\n // console.error(\"DIRECT\", step);\n\n return;\n }\n\n if (siblingDependents.has(currentName)) {\n // a transitive cycle\n const cycleDependentName = Array.from(dependentNode.localDependencies).find(([key]) =>\n currentNode.localDependents.has(key)\n );\n const pathToCycle = step\n .slice()\n .reverse()\n .concat(cycleDependentName);\n\n // console.error(\"TRANSITIVE\", pathToCycle);\n cycleNodes.add(dependentNode);\n cyclePaths.add(pathToCycle);\n }\n\n dependentNode.localDependents.forEach(visits(step));\n // console.warn(\"EXITED %O\", step);\n };\n\n // currentNode.localDependents.forEach((topLevelNode, topLevelName, sibs) => {\n // console.log(\"TOPLVL %O\\n%O\", [currentName, topLevelName], topLevelNode);\n // visits([currentName])(topLevelNode, topLevelName, sibs);\n // });\n currentNode.localDependents.forEach(visits([currentName]));\n });\n\n if (cycleNodes.size) {\n this.prune(...cycleNodes);\n }\n\n return [cyclePaths, cycleNodes];\n }", "title": "" }, { "docid": "73b476734144145cc5ea2c345c8f4af6", "score": "0.5667981", "text": "get deepDependencies() {\n const deps = new Set();\n const collect = module => {\n for (const dependency of module.dependencies) {\n if (!deps.has(dependency)) {\n deps.add(dependency);\n collect(dependency);\n }\n }\n };\n collect(this);\n return deps;\n }", "title": "" }, { "docid": "96501b28816c02748a21a08103faa097", "score": "0.56645936", "text": "function iterDeps(method, obj, depKey, seen, meta) {\n\n var guid = guidFor(obj);\n if (!seen[guid]) seen[guid] = {};\n if (seen[guid][depKey]) return;\n seen[guid][depKey] = true;\n\n var deps = meta.deps;\n deps = deps && deps[depKey];\n if (deps) {\n for(var key in deps) {\n if (DEP_SKIP[key]) continue;\n method(obj, key);\n }\n }\n}", "title": "" }, { "docid": "f3072a32b3bf0df40d5cda86c7ddae7e", "score": "0.5633197", "text": "function traverseAstTree(node, visitor, fullFilename){\n\n\t//visitor checks for patterns\n visitor(node, fullFilename);\n\t\n\t// if(typeof node === 'object') {\n\t\n for(var item in node) {\n\t\t\n\t\t\tif(typeof node[item] === 'object' && node[item] !== null && node[item] != 0) {\n\t\t\t\n\t\t\t\ttraverseAstTree(node[item], visitor, fullFilename);\n\t\t\t}\n\t\t}\n\t// }\n}", "title": "" }, { "docid": "a9daa7b0202f3ccc9b4a7702a75aab3a", "score": "0.5621324", "text": "traverse(fn) {\n fn(this)\n\n const children = Private(this).__children\n for (let i = 0, l = children.length; i < l; i++) {\n children[i].traverse(fn)\n }\n }", "title": "" }, { "docid": "7c826cdc207246aebfb31e548a838e69", "score": "0.56109697", "text": "function traverse(val){_traverse(val,seenObjects);seenObjects.clear();}", "title": "" }, { "docid": "5898b304b1366f7b2c0bde91301dc270", "score": "0.5605423", "text": "async function traverse ({ resolve, graph, entry }, iterate) {\n const visited = new Set()\n await (async function visit (parent, path) {\n const module = await resolve(parent, path)\n const dependencies = new Map()\n\n for (const { w: imported } of graph.outEdges(path)) {\n if (visited.has(imported)) {\n continue\n }\n visited.add(imported)\n await visit(module, imported)\n }\n\n await iterate({ parent, module, dependencies })\n })(null, entry)\n}", "title": "" }, { "docid": "27e7fa2acba12f406111eacf81d20d02", "score": "0.55988383", "text": "function traverse(val) { _traverse(val, seenObjects); seenObjects.clear(); }", "title": "" }, { "docid": "9278ad6612aa2ce6859971987e691780", "score": "0.55954635", "text": "_walk (node, accumulator) {\n if (node && (typeof node === 'object') && ('type' in node)) {\n this._doNode(node, accumulator)\n this._doChildren(node, accumulator)\n }\n }", "title": "" }, { "docid": "9a9c36f1a02ed0106bd48e307ccc38f3", "score": "0.5577333", "text": "function worker(obj, parentStatObj) {\n let keys = Object.keys(obj);\n for (let key of keys) {\n let value = obj[key];\n if (typeof value === 'object' && value !== null) {\n let o = {\n prop: key,\n depth: parentStatObj.depth + 1,\n children: []\n };\n parentStatObj.children.push(o);\n worker(value, o);\n } else {\n parentStatObj.children.push({\n prop: key,\n depth: parentStatObj.depth + 1\n });\n if (parentStatObj.depth + 1 > root.maxDepth) {\n root.maxDepth = parentStatObj.depth + 1;\n }\n }\n }\n }", "title": "" }, { "docid": "af136b00ee6ef2f7a6f60d7670193ecb", "score": "0.55525494", "text": "function recur( obj ){\n\t\t\tif(obj.hasOwnProperty(key)){\n\t\t\t\tvar val = obj[key]\n\t\t\t\tif(next && val != me) return ret = val\n\t\t\t\tif(val == me) next = 1\n\t\t\t}\n\t\t\tif(obj.hasOwnProperty( '__overloads__')){\n\t\t\t\tvar stack = obj.__overloads__[key]\n\t\t\t\tif(stack) for(var i = stack.length - 1; i >= 0; i--){\n\t\t\t\t\tvar item = stack[ i ]\n\t\t\t\t\tif(next){\n\t\t\t\t\t var val = item instanceof StackValue ? item.v : item[key]\n\t\t\t\t\t if(val != me) return ret = val\n\t\t\t\t\t}\n\t\t\t\t\tif(item instanceof StackValue){\n\t\t\t\t\t\tif(item.v == me) next = 1\n\t\t\t\t\t} else if(recur(item)) return ret\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d943bf79b31e65fa6745104b7ba1c7ec", "score": "0.549649", "text": "function classDepends(cls, options, visited) {\n options = options || {};\n var firstCall = false;\n if (visited === undefined) {\n firstCall = true;\n visited = {};\n }\n\n if (cache.hasOwnProperty(cls.name)) {\n return cache[cls.name];\n }\n if (visited.hasOwnProperty(cls.name)) {\n return [];\n }\n visited[cls.name] = true;\n\n if (!cls.declarations) {\n if(cls.declType === 'enum' || cls.declType === 'typedef')\n return [];\n return memberDepends(cls);\n }\n\n var res = cls.declarations\n .filter((mem) => !options.constructorsOnly || mem.declType === 'constructor')\n .map(mem => memberDepends(mem, options.source))\n .reduce((a, b) => a.concat(b), [])\n .filter(unique)\n .filter((name) => name && name !== 'void');\n\n if (options.recursive) {\n res = res.concat(\n res.map((name) => mods.get(name))\n .filter((c) => c !== null)\n .map((c) => classDepends(c, options, visited))\n .reduce((a, b) => a.concat(b), [])\n ).filter(unique);\n }\n\n // dont include this class in dependency list\n if (firstCall) {\n var qualifiedName = cls.name;\n var separator = options.source ? '_' : '.';\n if (cls.parent)\n // TODO: source occ class names are qualified by default\n qualifiedName = cls.parent + separator + cls.name;\n res = res.filter(name => name !== qualifiedName);\n }\n var handles = res.map(name => 'Handle_' + name)\n .filter(name => headers.get(name));\n res = res.concat(handles);\n // cache result\n cache[cls.name] = res;\n\n return res;\n }", "title": "" }, { "docid": "a8ee193b05e913e76c704488b5e3f6c7", "score": "0.54567266", "text": "static traverseObjectForReferenceWithArray(obj, pathArray) {\n if (pathArray.length == 0 || !DataUtil.isObject(obj)) {\n return null;\n }\n if (pathArray.length == 1) {\n return obj;\n }\n let curNode = pathArray[0];\n if (!(curNode in obj) || !DataUtil.isObject(obj[curNode])) {\n obj[curNode] = {};\n }\n return DataUtil.traverseObjectForReferenceWithArray(obj[curNode], pathArray.slice(1));\n }", "title": "" }, { "docid": "b6fe09614ce1ffae00fa6706c7125b3a", "score": "0.54470325", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "d1bde0982b583c5d5857845f2cf5fcdc", "score": "0.54424363", "text": "function walkJsonTree(json, currPath, visitor) {\n if (!json || typeof json !== 'object') {\n return;\n }\n Object.keys(json).forEach((key) => {\n const path = currPath.concat([key]);\n const shouldContinue = visitor(path, json[key]);\n if (shouldContinue) {\n walkJsonTree(json[key], path, visitor);\n }\n });\n}", "title": "" }, { "docid": "b3c85fcfab872b57d0f53c93374ba5ae", "score": "0.5434066", "text": "function traverse(o, name) {\n // if found -> return\n if (o.name == name) {\n return o;\n } else {\n // traverse all children\n var ret = null;\n for (var i in o.children) {\n var r = traverse(o.children[i], name);\n if (r) {\n ret = r;\n }\n }\n return ret;\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.54282916", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.54282916", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.54282916", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.54282916", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.54282916", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.54282916", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "bef91fa0c93e975875985ce987ae2521", "score": "0.5428005", "text": "function hook (obj = {}) {\n if (obj.children instanceof Array) processChildren(obj.children);\n }", "title": "" }, { "docid": "2911c3f0e27e72bb2b700830f95cf73a", "score": "0.5425612", "text": "function printObjectMembers(obj, path) {\n\n if(obj === undefined) {\n console.log(\"Undefined object encountered!\");\n return;\n }\n\n for(var x in obj) {\n\n var dataType = typeof obj[x];\n\n if(dataType === 'function') {\n var exception = \"these are data objects, functions not allowed in data objects\";\n console.log(exception);\n throw exception;\n }\n\n if(dataType === 'object') {\n console.log(\"Object type encountered!!\");\n\n path.push(x);\n printObjectMembers(obj[x], path); //recursive function call for nested objects\n\n //pop last path element from array if there are no embedded objects\n var hasEmbeddedObject = false;\n for(var t in obj) {\n if(typeof t === 'object') {\n hasEmbeddedObject = true;\n return hasEmbeddedObject;\n }\n }\n\n if(!hasEmbeddedObject) {\n path.pop();\n }\n\n }\n\n var fullyQualifiedName;\n\n var tempObj = {}; //temporary object to store key-value object key value pairs for pushing it to final array\n\n //create qualified names from elements stored in path array\n if(path.length > 0) {\n var objectPath = path[0];\n for(var p = 1; p < path.length; p++) {\n objectPath += '.' + path[p];\n }\n\n if(obj[x] !== 'object') {\n fullyQualifiedName = objectPath + '.' + x;\n console.log(\"Fully Qualified Path of element is: \" + fullyQualifiedName);\n tempObj.key = fullyQualifiedName;\n }\n }\n\n //print the element if it's not an object\n if(typeof obj[x] !== 'object') {\n console.log(x + \" => \" + obj[x]);\n tempObj.value = obj[x];\n\n if(tempObj.key === undefined) {\n tempObj.key = x;\n }\n\n objectMap.push(tempObj); //push tempObj to array for final response\n\n }\n\n }\n\n}", "title": "" }, { "docid": "a4bc333ea9114e81dff13ad54b17f794", "score": "0.54182506", "text": "if (typeof obj[i] == \"object\") { \n if (parent) { dumpProps(obj[i], parent + \".\" + i); } else { dumpProps(obj[i], i); }\n }", "title": "" }, { "docid": "5252aab796dfdb0528fbaed1cb579f72", "score": "0.5414207", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "5501e05d12c8a575bfa6d777cd5c0a08", "score": "0.54120445", "text": "getTopologicalDependents(node, visited = new Set(), list = new LinkedList()) {\n // Mark this node as visited\n visited.add(node);\n // Recursively call this method on dependents of the argument node\n let dependents = this.getDependents(node, true);\n for (let d of dependents) {\n if (!visited.has(d)) {\n this.getTopologicalDependents(d, visited, list);\n }\n }\n // Insert node to the front of iterator to retain Topological ordering\n list.insert(node);\n return list;\n }", "title": "" }, { "docid": "1709c9e796fcd898c8fc8f3661cc9a90", "score": "0.5409852", "text": "function dereference(o,definitions,options) {\n if (!options) options = {};\n if (!options.cache) options.cache = {};\n if (!options.state) options.state = {};\n options.state.identityDetection = true;\n // options.depth allows us to limit cloning to the first invocation\n options.depth = (options.depth ? options.depth+1 : 1);\n let obj = (options.depth > 1 ? o : clone(o));\n let container = { data: obj };\n let defs = (options.depth > 1 ? definitions : clone(definitions));\n // options.master is the top level object, regardless of depth\n if (!options.master) options.master = obj;\n\n let logger = getLogger(options);\n\n let changes = 1;\n while (changes > 0) {\n changes = 0;\n recurse(container,options.state,function(obj,key,state){\n if (isRef(obj,key)) {\n let $ref = obj[key]; // immutable\n changes++;\n if (!options.cache[$ref]) {\n let entry = {};\n entry.path = state.path.split('/$ref')[0];\n entry.key = $ref;\n logger.warn('Dereffing %s at %s',$ref,entry.path);\n entry.source = defs;\n entry.data = jptr(entry.source,entry.key);\n if (entry.data === false) {\n entry.data = jptr(options.master,entry.key);\n entry.source = options.master;\n }\n if (entry.data === false) {\n logger.warn('Missing $ref target',entry.key);\n }\n options.cache[$ref] = entry;\n entry.data = state.parent[state.pkey] = dereference(jptr(entry.source,entry.key),entry.source,options);\n if (options.$ref && (typeof state.parent[state.pkey] === 'object') && (state.parent[state.pkey] !== null)) state.parent[state.pkey][options.$ref] = $ref;\n entry.resolved = true;\n }\n else {\n let entry = options.cache[$ref];\n if (entry.resolved) {\n // we have already seen and resolved this reference\n logger.warn('Patching %s for %s',$ref,entry.path);\n state.parent[state.pkey] = entry.data;\n if (options.$ref && (typeof state.parent[state.pkey] === 'object') && (state.parent[state.pkey] !== null)) state.parent[state.pkey][options.$ref] = $ref;\n }\n else if ($ref === entry.path) {\n // reference to itself, throw\n throw new Error(`Tight circle at ${entry.path}`);\n }\n else {\n // we're dealing with a circular reference here\n logger.warn('Unresolved ref');\n state.parent[state.pkey] = jptr(entry.source,entry.path);\n if (state.parent[state.pkey] === false) {\n state.parent[state.pkey] = jptr(entry.source,entry.key);\n }\n if (options.$ref && (typeof state.parent[state.pkey] === 'object') && (state.parent[state.pkey] !== null)) state.parent[options.$ref] = $ref;\n }\n }\n }\n });\n }\n return container.data;\n}", "title": "" }, { "docid": "519508916f48804c0b409df08e01cd2a", "score": "0.5397774", "text": "function traverse( entry ) {\n\n\t\t\t\tif ( entry.param ) {\n\n\t\t\t\t\tgrants.push( entry.param );\n\n\t\t\t\t\t// Save the reference even from bone data for efficiently\n\t\t\t\t\t// simulating PMX animation system\n\t\t\t\t\tbones[ entry.param.index ].grant = entry.param;\n\n\t\t\t\t}\n\n\t\t\t\tentry.visited = true;\n\n\t\t\t\tfor ( let i = 0, il = entry.children.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst child = entry.children[ i ];\n\n\t\t\t\t\t// Cut off a loop if exists. (Is a grant loop invalid?)\n\t\t\t\t\tif ( ! child.visited ) traverse( child );\n\n\t\t\t\t}\n\n\t\t\t}", "title": "" }, { "docid": "949f55c9d41dfce2be44bf0ea9097489", "score": "0.5394824", "text": "function traverse(jsonObj) {\n if (!jsonObj || typeof jsonObj != 'object') {\n return;\n }\n Object.entries(jsonObj).forEach(([key, value]) => {\n // key is either an array index or object key\n if(!['init','update'].includes(key)) {\n if (value && validTypes.includes(value.type)) {\n resultArray.push(value);\n }\n traverse(value);\n }\n });\n}", "title": "" }, { "docid": "65cb9de65dfd54d13558df8e7fdd10f4", "score": "0.53837526", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "65cb9de65dfd54d13558df8e7fdd10f4", "score": "0.53837526", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "4afd5dec7fb712086b759b9c3629eb58", "score": "0.53710955", "text": "function objectCrawler () {}", "title": "" }, { "docid": "ad5845dc5695ae0cdbf42b1efc784389", "score": "0.53640026", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr3 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n var toName = _arr3[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "0ed9de3c9c867bd8ebc51357b94318d2", "score": "0.5354974", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "0ed9de3c9c867bd8ebc51357b94318d2", "score": "0.5354974", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "0ed9de3c9c867bd8ebc51357b94318d2", "score": "0.5354974", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "0ed9de3c9c867bd8ebc51357b94318d2", "score": "0.5354974", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "0ed9de3c9c867bd8ebc51357b94318d2", "score": "0.5354974", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "33b1a6558017e2a4ddeafd4d75bd785e", "score": "0.53485084", "text": "visitCheck(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1d2838198131fe8f22e3b49fc1b482a4", "score": "0.53432024", "text": "registerDependent(_object) {\r\n this.dependents.push(_object);\r\n }", "title": "" }, { "docid": "4d364e0600bf9ad37ba279525644b953", "score": "0.5342796", "text": "function traverse(val) {\n _traverse(val, seenObjects);\n\n seenObjects.clear();\n }", "title": "" }, { "docid": "a7ac431a83ff6823e941805d6800a04c", "score": "0.53409874", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "c0a6d2f05b17c2083e3900469d86a32d", "score": "0.5340218", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n }", "title": "" }, { "docid": "f1dcb85bfd0de1cc11d600010338845c", "score": "0.53395915", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr2 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var toName = _arr2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "f1dcb85bfd0de1cc11d600010338845c", "score": "0.53395915", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr2 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var toName = _arr2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "f1dcb85bfd0de1cc11d600010338845c", "score": "0.53395915", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr2 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var toName = _arr2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "f1dcb85bfd0de1cc11d600010338845c", "score": "0.53395915", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr2 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var toName = _arr2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "beb15d400d7515f895556a0d39066e0a", "score": "0.53341174", "text": "function navigateTree(object,name)\n{\n if(object!=null)\n \t{\n \t\tif(object.name == name)\n \t\t{\n \t\treturn 1;\n \t\t}\n \t\tfor (var i = 0; i<numofchildren(object); i++)\n \t\t{\n \t\t\tnavigateTree(object.children[i],name);\n \t\t}\n \t}\n}", "title": "" }, { "docid": "ddec8165bfa42921ef37cec2c47bea4d", "score": "0.5332873", "text": "function traverse (val) {\r\n _traverse(val, seenObjects);\r\n seenObjects.clear();\r\n}", "title": "" }, { "docid": "57a9679364005496ac8c10b250c6c034", "score": "0.5330678", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n for (var _i6 = 0, _Object$keys4 = Object.keys(immediateDeps); _i6 < _Object$keys4.length; _i6++) {\n var toName = _Object$keys4[_i6];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "bf804f17a2bb626be14189e5d0d1b472", "score": "0.5321444", "text": "hasDependents(node) {\n return this.contains(node) && this.relationships.get(node).size != 0;\n }", "title": "" }, { "docid": "eeb155cee5ecab63d49e3c76ef61b182", "score": "0.53205854", "text": "function dep_resolve(node, arr, visited) {\n visited.add(node.name)\n for (let edge of node.edges) {\n if (!arr.includes(edge)) {\n if (visited.has(edge)) {\n throw new Error(`Circular dependency found: ${node.name} references ${edge}`);\n }\n dep_resolve(graph.get(edge), arr, visited);\n }\n }\n arr.push(node.name);\n }", "title": "" }, { "docid": "8ad743671b589490de607a0b77fd959b", "score": "0.531553", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n for (var _i4 = 0, _Object$keys2 = Object.keys(immediateDeps); _i4 < _Object$keys2.length; _i4++) {\n var toName = _Object$keys2[_i4];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "7b807243be6df8787efaec5333795996", "score": "0.53129613", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "7b807243be6df8787efaec5333795996", "score": "0.53129613", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "7b807243be6df8787efaec5333795996", "score": "0.53129613", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" }, { "docid": "7b807243be6df8787efaec5333795996", "score": "0.53129613", "text": "function traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}", "title": "" } ]
d2d044cb90ae3a543bb5006e9b0cb3e9
to be able to optimize each path individually by branching early. This needs a compiler or we can do it manually. Helpers that don't need this branching live outside of this function.
[ { "docid": "c37cb4ef922668fa35ab155a6be12d05", "score": "0.0", "text": "function ChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return;\n } // Deletions are added in reversed order so we add it to the front.\n // At this point, the return fiber's effect list is empty except for\n // deletions, so we can just append the deletion to the list. The remaining\n // effects aren't added until the complete phase. Once we implement\n // resuming, this may not be true.\n\n\n var last = returnFiber.lastEffect;\n\n if (last !== null) {\n last.nextEffect = childToDelete;\n returnFiber.lastEffect = childToDelete;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n }\n\n childToDelete.nextEffect = null;\n childToDelete.effectTag = Deletion;\n }\n\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return null;\n } // TODO: For the shouldClone case, this could be micro-optimized a bit by\n // assuming that after the first child we've already added everything.\n\n\n var childToDelete = currentFirstChild;\n\n while (childToDelete !== null) {\n deleteChild(returnFiber, childToDelete);\n childToDelete = childToDelete.sibling;\n }\n\n return null;\n }\n\n function mapRemainingChildren(returnFiber, currentFirstChild) {\n // Add the remaining children to a temporary map so that we can find them by\n // keys quickly. Implicit (null) keys get added to this set with their index\n var existingChildren = new Map();\n var existingChild = currentFirstChild;\n\n while (existingChild !== null) {\n if (existingChild.key !== null) {\n existingChildren.set(existingChild.key, existingChild);\n } else {\n existingChildren.set(existingChild.index, existingChild);\n }\n\n existingChild = existingChild.sibling;\n }\n\n return existingChildren;\n }\n\n function useFiber(fiber, pendingProps, expirationTime) {\n // We currently set sibling to null and index to 0 here because it is easy\n // to forget to do before returning it. E.g. for the single child case.\n var clone = createWorkInProgress(fiber, pendingProps, expirationTime);\n clone.index = 0;\n clone.sibling = null;\n return clone;\n }\n\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n newFiber.index = newIndex;\n\n if (!shouldTrackSideEffects) {\n // Noop.\n return lastPlacedIndex;\n }\n\n var current$$1 = newFiber.alternate;\n\n if (current$$1 !== null) {\n var oldIndex = current$$1.index;\n\n if (oldIndex < lastPlacedIndex) {\n // This is a move.\n newFiber.effectTag = Placement;\n return lastPlacedIndex;\n } else {\n // This item can stay in place.\n return oldIndex;\n }\n } else {\n // This is an insertion.\n newFiber.effectTag = Placement;\n return lastPlacedIndex;\n }\n }\n\n function placeSingleChild(newFiber) {\n // This is simpler for the single child case. We only need to do a\n // placement for inserting new children.\n if (shouldTrackSideEffects && newFiber.alternate === null) {\n newFiber.effectTag = Placement;\n }\n\n return newFiber;\n }\n\n function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {\n if (current$$1 === null || current$$1.tag !== HostText) {\n // Insert\n var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current$$1, textContent, expirationTime);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateElement(returnFiber, current$$1, element, expirationTime) {\n if (current$$1 !== null && (current$$1.elementType === element.type || // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(current$$1, element))) {\n // Move based on index\n var existing = useFiber(current$$1, element.props, expirationTime);\n existing.ref = coerceRef(returnFiber, current$$1, element);\n existing.return = returnFiber;\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n return existing;\n } else {\n // Insert\n var created = createFiberFromElement(element, returnFiber.mode, expirationTime);\n created.ref = coerceRef(returnFiber, current$$1, element);\n created.return = returnFiber;\n return created;\n }\n }\n\n function updatePortal(returnFiber, current$$1, portal, expirationTime) {\n if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {\n // Insert\n var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current$$1, portal.children || [], expirationTime);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) {\n if (current$$1 === null || current$$1.tag !== Fragment) {\n // Insert\n var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current$$1, fragment, expirationTime);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function createChild(returnFiber, newChild, expirationTime) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);\n\n _created.ref = coerceRef(returnFiber, null, newChild);\n _created.return = returnFiber;\n return _created;\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);\n\n _created2.return = returnFiber;\n return _created2;\n }\n }\n\n if (isArray(newChild) || getIteratorFn(newChild)) {\n var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);\n\n _created3.return = returnFiber;\n return _created3;\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n return null;\n }\n\n function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n // Update the fiber if the keys match, otherwise return null.\n var key = oldFiber !== null ? oldFiber.key : null;\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n if (key !== null) {\n return null;\n }\n\n return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n if (newChild.key === key) {\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);\n }\n\n return updateElement(returnFiber, oldFiber, newChild, expirationTime);\n } else {\n return null;\n }\n }\n\n case REACT_PORTAL_TYPE:\n {\n if (newChild.key === key) {\n return updatePortal(returnFiber, oldFiber, newChild, expirationTime);\n } else {\n return null;\n }\n }\n }\n\n if (isArray(newChild) || getIteratorFn(newChild)) {\n if (key !== null) {\n return null;\n }\n\n return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n return null;\n }\n\n function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n // Text nodes don't have keys, so we neither have to check the old nor\n // new node for the key. If both are text nodes, they match.\n var matchedFiber = existingChildren.get(newIdx) || null;\n return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);\n }\n\n return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);\n }\n }\n\n if (isArray(newChild) || getIteratorFn(newChild)) {\n var _matchedFiber3 = existingChildren.get(newIdx) || null;\n\n return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n return null;\n }\n /**\n * Warns if there is a duplicate or missing key\n */\n\n\n function warnOnInvalidKey(child, knownKeys) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n break;\n\n default:\n break;\n }\n }\n return knownKeys;\n }\n\n function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {\n // This algorithm can't optimize by searching from both ends since we\n // don't have backpointers on fibers. I'm trying to see how far we can get\n // with that model. If it ends up not being worth the tradeoffs, we can\n // add it later.\n // Even with a two ended optimization, we'd want to optimize for the case\n // where there are few changes and brute force the comparison instead of\n // going for the Map. It'd like to explore hitting that path first in\n // forward-only mode and only go for the Map once we notice that we need\n // lots of look ahead. This doesn't handle reversal as well as two ended\n // search but that's unusual. Besides, for the two ended optimization to\n // work on Iterables, we'd need to copy the whole set.\n // In this first iteration, we'll just live with hitting the bad case\n // (adding everything to a Map) in for every insert/move.\n // If you change this code, also update reconcileChildrenIterator() which\n // uses the same algorithm.\n {\n // First, validate keys.\n var knownKeys = null;\n\n for (var i = 0; i < newChildren.length; i++) {\n var child = newChildren[i];\n knownKeys = warnOnInvalidKey(child, knownKeys);\n }\n }\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n\n for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (newIdx === newChildren.length) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);\n\n if (_newFiber === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber;\n } else {\n previousNewFiber.sibling = _newFiber;\n }\n\n previousNewFiber = _newFiber;\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);\n\n if (_newFiber2 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber2.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber2;\n } else {\n previousNewFiber.sibling = _newFiber2;\n }\n\n previousNewFiber = _newFiber2;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {\n // This is the same implementation as reconcileChildrenArray(),\n // but using the iterator instead.\n var iteratorFn = getIteratorFn(newChildrenIterable);\n\n (function () {\n if (!(typeof iteratorFn === 'function')) {\n {\n throw ReactError(Error('An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.'));\n }\n }\n })();\n\n {\n // We don't support rendering Generators because it's a mutation.\n // See https://github.com/facebook/react/issues/12995\n if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag\n newChildrenIterable[Symbol.toStringTag] === 'Generator') {\n !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0;\n didWarnAboutGenerators = true;\n } // Warn about using Maps as children\n\n\n if (newChildrenIterable.entries === iteratorFn) {\n !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;\n didWarnAboutMaps = true;\n } // First, validate keys.\n // We'll get a different iterator later for the main pass.\n\n\n var _newChildren = iteratorFn.call(newChildrenIterable);\n\n if (_newChildren) {\n var knownKeys = null;\n\n var _step = _newChildren.next();\n\n for (; !_step.done; _step = _newChildren.next()) {\n var child = _step.value;\n knownKeys = warnOnInvalidKey(child, knownKeys);\n }\n }\n }\n var newChildren = iteratorFn.call(newChildrenIterable);\n\n (function () {\n if (!(newChildren != null)) {\n {\n throw ReactError(Error('An iterable object provided no iterator.'));\n }\n }\n })();\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n var step = newChildren.next();\n\n for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (step.done) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber3 = createChild(returnFiber, step.value, expirationTime);\n\n if (_newFiber3 === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber3;\n } else {\n previousNewFiber.sibling = _newFiber3;\n }\n\n previousNewFiber = _newFiber3;\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);\n\n if (_newFiber4 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber4.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber4;\n } else {\n previousNewFiber.sibling = _newFiber4;\n }\n\n previousNewFiber = _newFiber4;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {\n // There's no need to check for keys on text nodes since we don't have a\n // way to define them.\n if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n // We already have an existing node so let's just update it and delete\n // the rest.\n deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n var existing = useFiber(currentFirstChild, textContent, expirationTime);\n existing.return = returnFiber;\n return existing;\n } // The existing first child is not a text node so we need to create one\n // and delete the existing ones.\n\n\n deleteRemainingChildren(returnFiber, currentFirstChild);\n var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n }\n\n function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {\n var key = element.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type || // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(child, element)) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);\n existing.ref = coerceRef(returnFiber, child, element);\n existing.return = returnFiber;\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n return existing;\n } else {\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n if (element.type === REACT_FRAGMENT_TYPE) {\n var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);\n created.return = returnFiber;\n return created;\n } else {\n var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);\n\n _created4.ref = coerceRef(returnFiber, currentFirstChild, element);\n _created4.return = returnFiber;\n return _created4;\n }\n }\n\n function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {\n var key = portal.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, portal.children || [], expirationTime);\n existing.return = returnFiber;\n return existing;\n } else {\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n created.return = returnFiber;\n return created;\n } // This API will tag the children with the side-effect of the reconciliation\n // itself. They will be added to the side-effect list as we pass through the\n // children and the parent.\n\n\n function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n (function () {\n {\n {\n throw ReactError(Error((Component.displayName || Component.name || 'Component') + '(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.'));\n }\n }\n })();\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n\n return reconcileChildFibers;\n }", "title": "" } ]
[ { "docid": "a8b0a40c38fca5fcdbba6d58bb733acc", "score": "0.6005882", "text": "function optimizePathSet(cache, cacheRoot, pathSet,\n depth, out, optimizedPath, maxRefFollow) {\n\n // at missing, report optimized path.\n if (cache === undefined) {\n out[out.length] = catAndSlice(optimizedPath, pathSet, depth);\n return;\n }\n\n // all other sentinels are short circuited.\n // Or we found a primitive (which includes null)\n if (cache === null || (cache.$type && cache.$type !== $ref) ||\n (typeof cache !== 'object')) {\n return;\n }\n\n // If the reference is the last item in the path then do not\n // continue to search it.\n if (cache.$type === $ref && depth === pathSet.length) {\n return;\n }\n\n var keySet = pathSet[depth];\n var nextDepth = depth + 1;\n var iteratorNote = {};\n var key, next, nextOptimized;\n\n key = iterateKeySet(keySet, iteratorNote);\n do {\n next = cache[key];\n var optimizedPathLength = optimizedPath.length;\n if (key !== null) {\n optimizedPath[optimizedPathLength] = key;\n }\n\n if (next && next.$type === $ref && nextDepth < pathSet.length) {\n var refResults =\n followReference(cacheRoot, next.value, maxRefFollow);\n next = refResults[0];\n\n // must clone to avoid the mutation from above destroying the cache.\n nextOptimized = cloneArray(refResults[1]);\n } else {\n nextOptimized = optimizedPath;\n }\n\n optimizePathSet(next, cacheRoot, pathSet, nextDepth,\n out, nextOptimized, maxRefFollow);\n optimizedPath.length = optimizedPathLength;\n\n if (!iteratorNote.done) {\n key = iterateKeySet(keySet, iteratorNote);\n }\n } while (!iteratorNote.done);\n}", "title": "" }, { "docid": "ffd39779da3b5b7a03882d2b54d5c47b", "score": "0.5965246", "text": "function optimizePathSet(cache, cacheRoot, pathSet,\n depth, out, optimizedPath, maxRefFollow) {\n\n // at missing, report optimized path.\n if (cache === undefined) {\n out[out.length] = catAndSlice(optimizedPath, pathSet, depth);\n return;\n }\n\n // all other sentinels are short circuited.\n // Or we found a primitive (which includes null)\n if (cache === null || (cache.$type && cache.$type !== \"ref\") ||\n (typeof cache !== 'object')) {\n return;\n }\n\n // If the reference is the last item in the path then do not\n // continue to search it.\n if (cache.$type === \"ref\" && depth === pathSet.length) {\n return;\n }\n\n var keySet = pathSet[depth];\n var isKeySet = typeof keySet === 'object' && keySet !== null;\n var nextDepth = depth + 1;\n var iteratorNote = false;\n var key = keySet;\n if (isKeySet) {\n iteratorNote = {};\n key = iterateKeySet(keySet, iteratorNote);\n }\n var next, nextOptimized;\n do {\n next = cache[key];\n var optimizedPathLength = optimizedPath.length;\n optimizedPath[optimizedPathLength] = key;\n\n if (next && next.$type === \"ref\" && nextDepth < pathSet.length) {\n var refResults =\n followReference(cacheRoot, next.value, maxRefFollow);\n if (refResults.error) {\n return refResults.error;\n }\n next = refResults.node;\n // must clone to avoid the mutation from above destroying the cache.\n nextOptimized = cloneArray(refResults.refPath);\n } else {\n nextOptimized = optimizedPath;\n }\n\n var error = optimizePathSet(next, cacheRoot, pathSet, nextDepth,\n out, nextOptimized, maxRefFollow);\n if (error) {\n return error;\n }\n optimizedPath.length = optimizedPathLength;\n\n if (iteratorNote && !iteratorNote.done) {\n key = iterateKeySet(keySet, iteratorNote);\n }\n } while (iteratorNote && !iteratorNote.done);\n}", "title": "" }, { "docid": "50008f6ee4f3c41e5cee3da9fa162f3c", "score": "0.59620863", "text": "function optimizePathSet(cache, cacheRoot, pathSet,\n depth, out, optimizedPath, maxRefFollow) {\n\n // at missing, report optimized path.\n if (cache === undefined) {\n out[out.length] = catAndSlice(optimizedPath, pathSet, depth);\n return;\n }\n\n // all other sentinels are short circuited.\n // Or we found a primitive (which includes null)\n if (cache === null || (cache.$type && cache.$type !== $ref) ||\n (typeof cache !== 'object')) {\n return;\n }\n\n // If the reference is the last item in the path then do not\n // continue to search it.\n if (cache.$type === $ref && depth === pathSet.length) {\n return;\n }\n\n var keySet = pathSet[depth];\n var isKeySet = typeof keySet === 'object';\n var nextDepth = depth + 1;\n var iteratorNote = false;\n var key = keySet;\n if (isKeySet) {\n iteratorNote = {};\n key = iterateKeySet(keySet, iteratorNote);\n }\n var next, nextOptimized;\n do {\n next = cache[key];\n var optimizedPathLength = optimizedPath.length;\n if (key !== null) {\n optimizedPath[optimizedPathLength] = key;\n }\n\n if (next && next.$type === $ref && nextDepth < pathSet.length) {\n var refResults =\n followReference(cacheRoot, next.value, maxRefFollow);\n next = refResults[0];\n\n // must clone to avoid the mutation from above destroying the cache.\n nextOptimized = cloneArray(refResults[1]);\n } else {\n nextOptimized = optimizedPath;\n }\n\n optimizePathSet(next, cacheRoot, pathSet, nextDepth,\n out, nextOptimized, maxRefFollow);\n optimizedPath.length = optimizedPathLength;\n\n if (iteratorNote && !iteratorNote.done) {\n key = iterateKeySet(keySet, iteratorNote);\n }\n } while (iteratorNote && !iteratorNote.done);\n}", "title": "" }, { "docid": "17aa80881509775c7fdd12376e97b2f5", "score": "0.5717257", "text": "findOptimalPaths() {\r\n let pathCombination = undefined;\r\n let uniqueNodes = undefined;\r\n let maxUnique = 0;\r\n let uniqueCount = 0;\r\n this.pathsList.forEach(function (firstPath) {\r\n this.pathsList.forEach(function (secondPath) {\r\n pathCombination = firstPath.concat(secondPath);\r\n uniqueNodes = Array.from(new Set(pathCombination));\r\n uniqueCount = uniqueNodes.length;\r\n if (maxUnique < uniqueCount) {\r\n maxUnique = uniqueCount;\r\n this.bestPaths.length = 0;\r\n this.bestPaths.push(firstPath);\r\n this.bestPaths.push(secondPath);\r\n }\r\n }, this);\r\n }, this);\r\n }", "title": "" }, { "docid": "ed3ba3431356e62987c6e83f2152e5d2", "score": "0.5655478", "text": "function compressAllPaths() { \n loadGraphWithLinks( graphDataStore.linkStore.compressAll());}//fn", "title": "" }, { "docid": "e7b04dcea39ab988453f644548afcdb8", "score": "0.5645511", "text": "processPath(path, allPaths) {\n let processedPath = [];\n for (let edge of path) {\n if (edge.component === constants.EPSILON) {\n continue;\n }\n processedPath.push(JSON.parse(JSON.stringify(edge)));\n }\n if (!processedPath.length) {\n return;\n }\n allPaths.push(processedPath);\n }", "title": "" }, { "docid": "9f0442fde73b8c97c614d953bfe56ca7", "score": "0.5578695", "text": "function optimizePath(path, start_point, end_point) {\n\t\t\t// add agent start and end points\n\t\t\t$.extend(start_point, {\n\t\t\t\tindex: 'start',\n\t\t\t\tvisibility: ObserverCore.utils.object([path[0].point.index], true)\n\t\t\t});\n\t\t\tpath.unshift({\n\t\t\t\tpoint: start_point\n\t\t\t});\n\n\t\t\t$.extend(end_point, {\n\t\t\t\tindex: 'end',\n\t\t\t\tvisibility: ObserverCore.utils.object([path[path.length - 1].point.index], true)\n\t\t\t});\n\t\t\tpath.push({\n\t\t\t\tpoint: end_point\n\t\t\t});\n\n\t\t\t// start path optimization\n\t\t\tvar path_len = path.length,\n\t\t\t\tstart_point = path[path_len - 1].point,\n\t\t\t\tend_point = path[0].point,\n\t\t\t\tg = 0,\n\t\t\t\th = getDistance(end_point, start_point),\n\t\t\t\tresult = {\n\t\t\t\t\tclosed: {},\n\t\t\t\t\topen: {}\n\t\t\t\t},\n\t\t\t\t_i = 0,\n\t\t\t\tcurrent = null;\n\n\t\t\t// add start node to open list\n\t\t\tresult.open[start_point.index] = {\n\t\t\t\tpoint: start_point,\n\t\t\t\tparent: null,\n\t\t\t\tdistances: {\n\t\t\t\t\tg: g,\n\t\t\t\t\th: h,\n\t\t\t\t\tf: g + h\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfunction getBestNode() {\n\t\t\t\tvar closest_dist = Infinity,\n\t\t\t\t\tbest_node = null;\n\n\t\t\t\t$.each(result.open, function(i, open) {\n\t\t\t\t\tvar f = open.distances.f;\n\n\t\t\t\t\tif (f >= closest_dist) return;\n\n\t\t\t\t\tclosest_dist = f;\n\t\t\t\t\tbest_node = open;\n\t\t\t\t});\n\n\t\t\t\treturn best_node;\n\t\t\t}\n\n\t\t\tfunction reconstructPath(node) {\n\t\t\t\tvar path = [node];\n\n\t\t\t\twhile (node.parent) {\n\t\t\t\t\tnode = node.parent;\n\t\t\t\t\tpath.push(node);\n\t\t\t\t}\n\n\t\t\t\treturn path;\n\t\t\t}\n\n\t\t\tfunction getVisiblesOf(point) {\n\t\t\t\treturn $.grep(path, function(node) {\n\t\t\t\t\tvar visible = (point.visibility && point.visibility[node.point.index]) || (node.point.visibility && node.point.visibility[point.index]);\n\t\t\t\t\tif (visible !== undefined) {\n\t\t\t\t\t\treturn visible;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn isVisible(point, node.point);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\twhile (_i++ <= 100) {\n\n\t\t\t\tcurrent = getBestNode();\n\t\t\t\tif (!current) break;\n\n\t\t\t\t// check if current node is the last\n\t\t\t\tif (current.point === end_point) {\n\t\t\t\t\t//console.log('goal found', current);\n\t\t\t\t\treturn reconstructPath(current);\n\t\t\t\t}\n\n\t\t\t\t//console.group();\n\t\t\t\t//console.log('best node', current);\n\n\t\t\t\t// remove current from open list\n\t\t\t\tdelete result.open[current.point.index];\n\n\t\t\t\t// add current to closed list\n\t\t\t\tresult.closed[current.point.index] = current;\n\n\t\t\t\t// process VISIBLE nodes - not adjacent (it was used in the findPath method)\n\t\t\t\t$.each(getVisiblesOf(current.point), function(i, visible) {\n\t\t\t\t\tvisible = visible.point;\n\t\t\t\t\tvar in_closed_list = result.closed[visible.index],\n\t\t\t\t\t\tin_open_list = result.open[visible.index],\n\t\t\t\t\t\tg,\n\t\t\t\t\t\th;\n\n\t\t\t\t\tif (in_closed_list) return;\n\n\t\t\t\t\tg = ((visible.distance && visible.distance[current.point.index]) || getDistance(visible, current.point)) + current.distances.g;\n\t\t\t\t\tif (in_open_list) {\n\t\t\t\t\t\t//console.log('visible already on open list');\n\t\t\t\t\t\tif (g < in_open_list.distances.g) {\n\t\t\t\t\t\t\tin_open_list.distances.g = g;\n\t\t\t\t\t\t\tin_open_list.parent = current;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\th = (visible.distance && visible.distance[end_point.index]) || getDistance(visible, end_point);\n\t\t\t\t\t\t// add visible to open list\n\t\t\t\t\t\tresult.open[visible.index] = {\n\t\t\t\t\t\t\tpoint: visible,\n\t\t\t\t\t\t\tparent: current,\n\t\t\t\t\t\t\tdistances: {\n\t\t\t\t\t\t\t\tg: g,\n\t\t\t\t\t\t\t\th: h,\n\t\t\t\t\t\t\t\tf: g + h\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\t\t//console.groupEnd();\n\t\t\t}\nconsole.log('FODEOOOOOOOO', _i);\n\t\t\treturn path;\n\t\t}", "title": "" }, { "docid": "50d575c8143080d4880377be8b7a61ad", "score": "0.55685353", "text": "buildObjects(srcPaths, outputDir) {\n var obj = {\n dest: outputDir + '/_OPTIMIZED',\n src: srcPaths\n }\n\n this.optimizeConfig.push(obj);\n }", "title": "" }, { "docid": "8beddfc38f497662f9cf5b82e8e05510", "score": "0.54882485", "text": "nextLoop() {\n let { openSet, closedSet, grid, endingPoint } = this;\n let current = this.findSmallestFInOpenSet();\n let neighbors = current.neighbors;\n\n this.setCurrentPath(current);\n if (current == endingPoint) {\n console.log('Path Found');\n this.found = true;\n return;\n }\n current.type = 'inClosed';\n this.removeFromArray(openSet, current);\n closedSet.push(current);\n for (var i = 0; i < neighbors.length; i++) {\n let neighbor = neighbors[i];\n // If already in closed set then there must have been a shorter path to get to that point\n if (!closedSet.includes(neighbor) && neighbor.type != 'wall') {\n // distance between currentG and its neightbors is just 1, \n // could be larger for something more complex system \n let tmpG = current.g + 1;\n let newPath = false;\n if (openSet.includes(neighbor)) {\n // If this has been evaluated before, is this newG better?\n if (tmpG > neighbor.g) {\n neighbor.g = tmpG;\n newPath = true;\n }\n } else { // not in openSet\n neighbor.g = tmpG;\n openSet.push(neighbor);\n neighbor.type = 'inOpen';\n newPath = true;\n }\n if (newPath) {\n neighbor.h = this.calcluateHeuristicDistance(neighbor);\n neighbor.f = neighbor.g + neighbor.h;\n neighbor.previous = current;\n }\n }\n\n }\n }", "title": "" }, { "docid": "165ee2729761f0259db26286c1dca2b0", "score": "0.54678863", "text": "findPath() {\n // Obtém o nó mais barato\n let node = this.getCheapestNode()\n\n while (node !== null) {\n // O custo do nó atual\n const cost = this.costs[node]\n\n // Filhos do nó atual\n const childrens = this.graph[node]\n\n for (let i = 0; i < childrens.length; ++i) {\n // O custo para ir até o filho\n const childrenCost = childrens[i]\n\n // O novo custo calculado\n const newCost = cost + childrenCost\n\n /**\n * Caso o custo para esse nó ainda não tenha sido calculado\n * adiciona-o\n */\n const oldCost = this.costs[i]\n\n /**\n * Caso o custo do novo nó seja menor, o substitui\n * no registro de custos\n */\n if (newCost < oldCost) {\n this.costs[i] = newCost\n this.parents[i] = node\n }\n }\n\n // Adiciona o nó na lista dos nós já processados\n this.processed.push(node)\n\n // Repete o processo com o próximo nó mais barato\n node = this.getCheapestNode()\n }\n }", "title": "" }, { "docid": "2ae05e5a618375f4d17394bfead8ff74", "score": "0.54438287", "text": "preprocess(globParts) {\n if (this.options.noglobstar) {\n for (let i = 0; i < globParts.length; i++) {\n for (let j = 0; j < globParts[i].length; j++) {\n if (globParts[i][j] === \"**\") {\n globParts[i][j] = \"*\";\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n } else if (optimizationLevel >= 1) {\n globParts = this.levelOneOptimize(globParts);\n } else {\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }", "title": "" }, { "docid": "b8f31bac2e72453f547e0d1a1bb58d15", "score": "0.54273826", "text": "levelOneOptimize(globParts) {\n return globParts.map((parts) => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === \"**\" && prev === \"**\") {\n return set;\n }\n if (part === \"..\") {\n if (prev && prev !== \"..\" && prev !== \".\" && prev !== \"**\") {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [\"\"] : parts;\n });\n }", "title": "" }, { "docid": "73025a696d42413ced90e3838e1473c0", "score": "0.53857976", "text": "function CalculateLeveL80CraftingPaths(crafterId)//previously this was an int, should be the 3-letter abbreviation here\n{\n let possibleCraftAfterFirstCraft = [ true, true, true, true, true, true, true, true ];\n let possibleCraftAfterSecondCraft = [ true, true, true, true, true, true, true, true ];\n\n let firstCrafterRow = _lvl80CrafterMatrix[crafterId];\n\n //identify which materials are affectec by the first craft\n let usedMaterials = GetMaterialsUsedByLevel80Craft(firstCrafterRow);\n\n let postFirstCraftTable = [];\n postFirstCraftTable = DeepCopyAnArray(_lvl80CrafterMatrix);\n\n RemoveInvalidCrafts(postFirstCraftTable, usedMaterials, possibleCraftAfterFirstCraft);\n\n //with invalid crafts removed, we need to store possible second crafts to be put into the path\n let secondCraftRowList = [];\n for(let i = 0; i < possibleCraftAfterFirstCraft.length; i++)\n {\n\n if(possibleCraftAfterFirstCraft[i])\n {\n secondCraftRowList.push(_lvl80CrafterMatrix[i]);\n }\n }\n\n //with the second crafts identified, we now need to check each branch of those possible paths to see if a third is available\n let craftsRemain = true;\n let postSecondCraftTable = [];\n let numberOfPaths = 0;\n for(let i = 0; i < secondCraftRowList.length; i++)\n {\n usedMaterials = [];\n //identify which materials are being used by the second craft\n usedMaterials = GetMaterialsUsedByLevel80Craft(secondCraftRowList[i]);\n\n postSecondCraftTable = [];\n postSecondCraftTable = DeepCopyAnArray(postFirstCraftTable);\n possibleCraftAfterSecondCraft = DeepCopyAnArray(possibleCraftAfterFirstCraft);\n\n //even though this post-second craft table variable isn't being used later, we don't want to touch the post-first craft table because\n //we need to use it for more than 1 craft and the following method will modify the passed-in table.\n //there are other solutions, yes. i chose this one over adding a bunch of code to save minimal space in memory in a time when people have GBs of it\n craftsRemain = RemoveInvalidCrafts(postSecondCraftTable, usedMaterials, possibleCraftAfterSecondCraft);\n\n //with invalid crafts removed, we need to store possible final crafts to be put into the path\n if(craftsRemain)\n {\n //since this is only for level 80 crafts, there's a max of 3 possible crafters before the pool is exhausted\n //so if a craft is still possible at this point, there's only one it could be\n for (let j = 0; j < possibleCraftAfterSecondCraft.length; j++)\n {\n if (possibleCraftAfterSecondCraft[j])//if this is true, the craft is still doable, so add it\n {\n _lvl80CraftingPathDictionary.push({\n \"StartingCrafter\" : firstCrafterRow.Crafter,\n \"CraftingPath\" : new Level80CraftingPath(firstCrafterRow.Crafter, secondCraftRowList[i].Crafter, _lvl80CrafterMatrix[j].Crafter)\n });\n numberOfPaths++;\n }\n }\n }\n else\n {\n _lvl80CraftingPathDictionary.push({\n \"StartingCrafter\" : firstCrafterRow.Crafter,\n \"CraftingPath\" : new Level80CraftingPath(firstCrafterRow.Crafter, secondCraftRowList[i].Crafter, \"\")\n });\n numberOfPaths++;\n }\n }\n\n //store the priority (number of paths) of the crafter that paths are being calculated for\n _lvl80CrafterPriorityDictionary.push(\n {\n \"Crafter\": firstCrafterRow.Crafter,\n \"Priority\": numberOfPaths\n }\n );\n}", "title": "" }, { "docid": "e5923c13fb21238bb98db95051168068", "score": "0.53772926", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n var dad = new Array(pl), q = new Array(pl);\n for (; i < pl; ++i) {\n dad[i] = q[i] = i;\n FP[i] = Paths[i];\n }\n for (; j < q.length; ++j) {\n i = q[j];\n L = FI[i].L;\n R = FI[i].R;\n C = FI[i].C;\n if (dad[i] === i) {\n if (L !== -1 && dad[L] !== L)\n dad[i] = dad[L];\n if (R !== -1 && dad[R] !== R)\n dad[i] = dad[R];\n }\n if (C !== -1)\n dad[C] = i;\n if (L !== -1) {\n dad[L] = dad[i];\n q.push(L);\n }\n if (R !== -1) {\n dad[R] = dad[i];\n q.push(R);\n }\n }\n for (i = 1; i !== pl; ++i)\n if (dad[i] === i) {\n if (R !== -1 && dad[R] !== R)\n dad[i] = dad[R];\n else if (L !== -1 && dad[L] !== L)\n dad[i] = dad[L];\n }\n for (i = 1; i < pl; ++i) {\n if (FI[i].type === 0)\n continue;\n j = dad[i];\n if (j === 0)\n FP[i] = FP[0] + '/' + FP[i];\n else\n while (j !== 0) {\n FP[i] = FP[j] + '/' + FP[i];\n j = dad[j];\n }\n dad[i] = 0;\n }\n FP[0] += '/';\n for (i = 1; i < pl; ++i) {\n if (FI[i].type !== 2)\n FP[i] += '/';\n FPD[FP[i]] = FI[i];\n }\n }", "title": "" }, { "docid": "e5923c13fb21238bb98db95051168068", "score": "0.53772926", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n var dad = new Array(pl), q = new Array(pl);\n for (; i < pl; ++i) {\n dad[i] = q[i] = i;\n FP[i] = Paths[i];\n }\n for (; j < q.length; ++j) {\n i = q[j];\n L = FI[i].L;\n R = FI[i].R;\n C = FI[i].C;\n if (dad[i] === i) {\n if (L !== -1 && dad[L] !== L)\n dad[i] = dad[L];\n if (R !== -1 && dad[R] !== R)\n dad[i] = dad[R];\n }\n if (C !== -1)\n dad[C] = i;\n if (L !== -1) {\n dad[L] = dad[i];\n q.push(L);\n }\n if (R !== -1) {\n dad[R] = dad[i];\n q.push(R);\n }\n }\n for (i = 1; i !== pl; ++i)\n if (dad[i] === i) {\n if (R !== -1 && dad[R] !== R)\n dad[i] = dad[R];\n else if (L !== -1 && dad[L] !== L)\n dad[i] = dad[L];\n }\n for (i = 1; i < pl; ++i) {\n if (FI[i].type === 0)\n continue;\n j = dad[i];\n if (j === 0)\n FP[i] = FP[0] + '/' + FP[i];\n else\n while (j !== 0) {\n FP[i] = FP[j] + '/' + FP[i];\n j = dad[j];\n }\n dad[i] = 0;\n }\n FP[0] += '/';\n for (i = 1; i < pl; ++i) {\n if (FI[i].type !== 2)\n FP[i] += '/';\n FPD[FP[i]] = FI[i];\n }\n }", "title": "" }, { "docid": "e6e6e1b5a2dee23c3282c0e9a21dd36b", "score": "0.53538096", "text": "findAllPaths(start, end) {\r\n let currentPathList = [];\r\n currentPathList.push(start);\r\n // Call recursive function\r\n this.findAllPathsRecur(start, end, currentPathList, this.graph);\r\n this.findOptimalPaths;\r\n }", "title": "" }, { "docid": "637120d81325aa7226b13e6fcfbc1d37", "score": "0.5290805", "text": "iterate() {\n this.prunePaths();\n this.buildTree();\n\n if (this.paths != undefined && this.paths instanceof Array && this.paths.length > 0 && !this.paused) {\n for (let path of this.paths) {\n path.iterate(this.tree);\n }\n }\n }", "title": "" }, { "docid": "d7f09f1784936d95501bae51ab5bf53f", "score": "0.5288154", "text": "function acceleration_case(startPoints, objectBag, profile, path_length, jumps) {\n let path_dat = [];\n let profile_index = [];\n let dir_index = [];\n let status = [];\n let objectUpdate = [];\n let tmp_profile_index;\n let tmp_dir_index;\n let tmp_path_dat = [];\n for (let i = 0; i < jumps; i++) {\n if (i == 0) {\n profile_index = checkPos(objectBag, startPoints);\n status = checkStatus(profile_index);\n dir_index = RandDir_Pos(profile_index, status[i]);\n path_dat = object_path(profile, profile_index, dir_index);\n } else {\n if (i == 1 && !checkInside(i, before_critical_index)) {\n objectUpdate = newStartPoints(profile, profile_index, dir_index, path_length);\n objectBag = combineArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = combineArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = RandDir_Pos(tmp_profile_index, status[i]);\n dir_index = combineArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else if (i == 1 && checkInside(i, before_critical_index)) {\n objectUpdate = newStartPoints(profile, profile_index, dir_index, path_length);\n objectBag = combineArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = combineArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = transferNei(tmp_profile_index, status[i]);\n dir_index = combineArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else if (checkInside(i, before_critical_index) && !checkInside(i, critical_idx)) {\n objectUpdate = newStartPoints(profile, tmp_profile_index, tmp_dir_index, path_length);\n objectBag = addArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints);\n profile_index = addArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = transferNei(tmp_profile_index, status[i]);\n dir_index = addArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else if (checkInside(i, critical_idx)) {\n objectUpdate = newStartPoints(profile, tmp_profile_index, tmp_dir_index, path_length);\n objectBag = addArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = addArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = acc_crit(tmp_profile_index);\n dir_index = addArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else {\n objectUpdate = newStartPoints(profile, tmp_profile_index, tmp_dir_index, path_length);\n objectBag = addArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = addArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = RandDir_Pos(tmp_profile_index, status[i]);\n dir_index = addArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n }\n }\n }\n console.log(profile_index)\n console.log(objectBag)\n\n return {\n objectBag: objectBag,\n profile_index: profile_index,\n status: status,\n dir_index: dir_index,\n path_coordinates: path_dat\n };\n}", "title": "" }, { "docid": "89862a304bc2b8ae736cf8feaabb6118", "score": "0.5251028", "text": "function solve() {\n\n xLoc = xQueue.shift();\n yLoc = yQueue.shift();\n\n // Check if finished\n\n if (xLoc > 0) {\n if (tiles[xLoc - 1][yLoc].state == 'f') {\n pathFound = true;\n }\n }\n if (xLoc < tileColumnCount - 1) {\n if (tiles[xLoc + 1][yLoc].state == 'f') {\n pathFound = true;\n }\n }\n if (yLoc > 0) {\n if (tiles[xLoc][yLoc - 1].state == 'f') {\n pathFound = true;\n }\n }\n if (yLoc < tileRowCount - 1) {\n if (tiles[xLoc][yLoc + 1].state == 'f') {\n pathFound = true;\n }\n }\n\n // Check empty neighbors\n\n if (xLoc > 0) {\n if (tiles[xLoc - 1][yLoc].state == 'e') {\n xQueue.push(xLoc - 1);\n yQueue.push(yLoc);\n tiles[xLoc - 1][yLoc].state = tiles[xLoc][yLoc].state + 'l';\n }\n }\n if (xLoc < tileColumnCount - 1) {\n if (tiles[xLoc + 1][yLoc].state == 'e') {\n xQueue.push(xLoc + 1);\n yQueue.push(yLoc);\n tiles[xLoc + 1][yLoc].state = tiles[xLoc][yLoc].state + 'r';\n }\n }\n if (yLoc > 0) {\n if (tiles[xLoc][yLoc - 1].state == 'e') {\n xQueue.push(xLoc);\n yQueue.push(yLoc - 1);\n tiles[xLoc][yLoc - 1].state = tiles[xLoc][yLoc].state + 'u';\n }\n }\n if (yLoc < tileRowCount - 1) {\n if (tiles[xLoc][yLoc + 1].state == 'e') {\n xQueue.push(xLoc);\n yQueue.push(yLoc + 1);\n tiles[xLoc][yLoc + 1].state = tiles[xLoc][yLoc].state + 'd';\n }\n }\n \n\n // Output the path\n if (xQueue.length <= 0 || pathFound) {\n clearInterval(solveInterval);\n finalOutput();\n }\n \n}", "title": "" }, { "docid": "a701a9cdc9a6d397dbefd182cbe2396f", "score": "0.5242861", "text": "repairPaths(query) {\n const { linkKey1, linkKey2, eeMap1, eeMap2, direction } = query\n\n const eeMapTotal1 = this.getDiffByPoint(eeMap1)\n const eeMapTotal2 = this.getDiffByPoint(eeMap2)\n\n const svgPath1 = gridLinksBuilderService.svgPaths[linkKey1][0]\n const svgPath2 = gridLinksBuilderService.svgPaths[linkKey2][0]\n\n const svgPathMap1 = Utils.deepclone(SvgPathUtils.getPathMap(svgPath1.svgD)).slice(0, 4)\n const svgPathMap2 = Utils.deepclone(SvgPathUtils.getPathMap(svgPath2.svgD)).slice(0, 4)\n\n const compareDiffPoint = this.getDiffByPoint(2)\n\n svgPathMap1[3].distance = Math.sign(svgPathMap1[3].distance) === -1 ? -compareDiffPoint : compareDiffPoint\n svgPathMap2[3].distance = Math.sign(svgPathMap2[3].distance) === -1 ? -compareDiffPoint : compareDiffPoint\n\n const svgM1 = SvgPathUtils.getM(SvgPathUtils.generateSvgD(svgPathMap1))\n const svgM2 = SvgPathUtils.getM(SvgPathUtils.generateSvgD(svgPathMap2))\n\n const isUpOrDown = LinkHelper.isUpOrDown(direction)\n const hasUpDownCondition = Math.sign(eeMapTotal1 - eeMapTotal2) === Math.sign(svgM1.svgLeft - svgM2.svgLeft)\n\n const isLeftOrRight = LinkHelper.isLeftOrRight(direction)\n const hasLeftRigthCondition = Math.sign(eeMapTotal1 - eeMapTotal2) === Math.sign(svgM1.svgTop - svgM2.svgTop)\n \n if (isUpOrDown && hasUpDownCondition)\n handlePathSwitch('h', 0, -1)\n\n else if (isLeftOrRight && hasLeftRigthCondition)\n handlePathSwitch('v', 1, -1)\n\n function handlePathSwitch(hv, dirIndex, compareInteger) {\n const svgPathMap1 = SvgPathUtils.getPathMap(svgPath1.svgD)\n const svgPathMap2 = SvgPathUtils.getPathMap(svgPath2.svgD)\n\n let temp = svgPathMap1[0]\n svgPathMap1[0] = svgPathMap2[0]\n svgPathMap2[0] = temp\n\n temp = svgPathMap1[1]\n svgPathMap1[1] = svgPathMap2[1]\n svgPathMap2[1] = temp\n\n const diff = Math.abs(svgPathMap1[dirIndex] - svgPathMap2[dirIndex])\n const svgItem1 = svgPathMap1.find(item => !!item.direction && item.direction === hv)\n const svgItem2 = svgPathMap2.find(item => !!item.direction && item.direction === hv)\n \n if (Math.sign(svgPathMap1[dirIndex] - svgPathMap2[dirIndex]) === compareInteger)\n svgItem1.distance += diff\n else svgItem1.distance -= diff\n\n if (Math.sign(svgPathMap2[dirIndex] - svgPathMap1[dirIndex]) === compareInteger)\n svgItem2.distance += diff\n else svgItem2.distance -= diff\n\n svgPath1.svgD = SvgPathUtils.generateSvgD(svgPathMap1)\n svgPath2.svgD = SvgPathUtils.generateSvgD(svgPathMap2)\n }\n }", "title": "" }, { "docid": "edbc4ead28de70074c6410546743f281", "score": "0.5237117", "text": "function minPathSum(grid) {\n\n}", "title": "" }, { "docid": "75590e7beca3d34b6ebc2cfa4f42857e", "score": "0.5232361", "text": "backtrack(current, destination, cost, seen, //we need this for encountering cycles\n path, results) {\n if (current === destination) {\n results.push({ cost, path });\n return;\n }\n let paths = this.edges.get(current);\n paths === null || paths === void 0 ? void 0 : paths.forEach((details, key) => {\n if (!seen.has(key)) {\n let newCost = Number((cost + (details.mileage * 15) + (details.duration * 30)).toFixed(2));\n let newPath = [...path, key];\n seen.add(key);\n this.backtrack(key, destination, newCost, seen, newPath, results);\n seen.delete(key);\n }\n });\n }", "title": "" }, { "docid": "281a1ed200b89ae0f0727d78100070cc", "score": "0.52237815", "text": "function exploreAll(compiledMaze, mazeWidth, currentPos, lastPos, explorepath, all_paths) {\n\n // Lets see if have already explored this positions\n var found = explorepath.findIndex(function(position) {\n return position == currentPos\n })\n\n // Are we in loop?? Is it possible??\n if(found != -1)\n return true\n\n // Let the explorations begin\n explorepath.push(currentPos)\n \n // explore north\n if ((compiledMaze[currentPos] & NORTH) && lastPos != (currentPos-mazeWidth))\n exploreAll(compiledMaze, mazeWidth, currentPos-mazeWidth, currentPos, explorepath, all_paths)\n\n // explore south\n if ((compiledMaze[currentPos] & SOUTH) && lastPos != (currentPos+mazeWidth))\n exploreAll(compiledMaze, mazeWidth, currentPos+mazeWidth, currentPos, explorepath, all_paths)\n \n // explore east\n if ((compiledMaze[currentPos] & EAST) && lastPos != (currentPos+1))\n exploreAll(compiledMaze, mazeWidth, currentPos+1, currentPos, explorepath, all_paths)\n\n // explore west\n if ((compiledMaze[currentPos] & WEST) && lastPos != (currentPos-1))\n exploreAll(compiledMaze, mazeWidth, currentPos-1, currentPos, explorepath, all_paths)\n\n // lets capture all the paths\n all_paths.push(explorepath.map(function(value) {\n return value\n }))\n // we hit the deadend\n explorepath.pop(currentPos)\n return false\n \n}", "title": "" }, { "docid": "990ea80fcbce660064ff14fcf5845cc5", "score": "0.52099067", "text": "function Pathfinder3() {\n this.pathFrom_To_ = function (start, target, isPassableFunction) {\n const frontier = [];\n frontier.push(start);\n const cameFrom = {};\n cameFrom[ start ] = \"S\";\n\n while (frontier.length > 0) {\n const current = frontier.shift();\n const neighbors = neighborsForIndex(current, isPassableFunction);\n\n for (let i = 0; i < neighbors.length; i++) {\n const next = neighbors[ i ];\n if (cameFrom[ next ] == undefined) {\n frontier.push(next);\n cameFrom[ next ] = current;\n }\n\n if (next == target) {\n break;\n }\n }\n }\n\n const path = [];\n\n let current = target;\n\n while (current != start) {\n path.splice(0, 0, current);\n current = cameFrom[ current ];\n if (current == undefined) {\n return null;\n }\n }\n\n path.splice(0, 0, start);\n\n /* let string = \"\";\n for(let j = 0; j < levelList[levelNow].length; j++) {\n let distString = cameFrom[j];\n\n if(distString == undefined) {distString = \"B\";}\n\n distString = distString.toString();\n if(distString.length < 2) {\n distString = (\"00\" + distString);\n } else if(distString.length < 3) {\n distString = (\"0\" + distString);\n }\n\n distString += \", \"\n string += distString;\n if((j + 1) % ROOM_COLS == 0) {\n string += \"\\n\";\n }\n }\n\n // console.log(string); */\n\n return path;\n };\n\n const neighborsForIndex = function (index, isPassable) {\n const result = [];\n\n let above = indexAboveIndex(index);\n if (above != null) {\n if (isPassable(levelList[ levelNow ][ above ])) {\n result.push(above);\n }\n }\n\n let below = indexBelowIndex(index);\n if (below != null) {\n if (isPassable(levelList[ levelNow ][ below ])) {\n result.push(below);\n }\n }\n\n let left = indexLeftofIndex(index);\n if (left != null) {\n if (isPassable(levelList[ levelNow ][ left ])) {\n result.push(left);\n }\n }\n\n let right = indexRightOfIndex(index);\n if (right != null) {\n if (isPassable(levelList[ levelNow ][ right ])) {\n result.push(right);\n }\n }\n\n return result;\n };\n\n const indexAboveIndex = function (index) {\n const result = index - ROOM_COLS;\n if (result < 0) {\n return null;\n } else {\n return result;\n }\n };\n\n const indexBelowIndex = function (index) {\n const result = index + ROOM_COLS;\n if (result >= levelList[ levelNow ].length) {\n return null;\n } else {\n return result;\n }\n };\n\n const indexLeftofIndex = function (index) {\n const result = index - 1;\n if ((result < 0) || (result % ROOM_COLS == (ROOM_COLS - 1))) {\n return null;\n } else {\n return result;\n }\n };\n\n const indexRightOfIndex = function (index) {\n const result = index + 1;\n if ((result >= levelList[ levelNow ].length) || (result % ROOM_COLS == 0)) {\n return null;\n } else {\n return result;\n }\n }\n}", "title": "" }, { "docid": "25941cb96f5829a63af73c5b421842b3", "score": "0.52033263", "text": "function build_full_paths(FI, FP, Paths) {\n var i = 0,\n L = 0,\n R = 0,\n C = 0,\n j = 0,\n pl = Paths.length;\n var dad = [],\n q = [];\n\n for (; i < pl; ++i) {\n dad[i] = q[i] = i;\n FP[i] = Paths[i];\n }\n\n for (; j < q.length; ++j) {\n i = q[j];\n L = FI[i].L;\n R = FI[i].R;\n C = FI[i].C;\n\n if (dad[i] === i) {\n if (L !== -1\n /*NOSTREAM*/\n && dad[L] !== L) dad[i] = dad[L];\n if (R !== -1 && dad[R] !== R) dad[i] = dad[R];\n }\n\n if (C !== -1\n /*NOSTREAM*/\n ) dad[C] = i;\n\n if (L !== -1 && i != dad[i]) {\n dad[L] = dad[i];\n if (q.lastIndexOf(L) < j) q.push(L);\n }\n\n if (R !== -1 && i != dad[i]) {\n dad[R] = dad[i];\n if (q.lastIndexOf(R) < j) q.push(R);\n }\n }\n\n for (i = 1; i < pl; ++i) {\n if (dad[i] === i) {\n if (R !== -1\n /*NOSTREAM*/\n && dad[R] !== R) dad[i] = dad[R];else if (L !== -1 && dad[L] !== L) dad[i] = dad[L];\n }\n }\n\n for (i = 1; i < pl; ++i) {\n if (FI[i].type === 0\n /* unknown */\n ) continue;\n j = i;\n if (j != dad[j]) do {\n j = dad[j];\n FP[i] = FP[j] + \"/\" + FP[i];\n } while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n dad[i] = -1;\n }\n\n FP[0] += \"/\";\n\n for (i = 1; i < pl; ++i) {\n if (FI[i].type !== 2\n /* stream */\n ) FP[i] += \"/\";\n }\n }", "title": "" }, { "docid": "73c44a4a3ab72a93f834646bd068f2c2", "score": "0.5181611", "text": "function iteratePath() {\n\n var node = Graph.instance.nodes.get(state.next_path_node);\n state.path.push(node.state.predecessor);\n state.augmentation = Math.min(node.state.predecessor[\"residual-capacity\"], state.augmentation);\n state.next_path_node = node.state.predecessor[\"node\"];\n\n logger.log(\"Added edge \"+node.state.predecessor.edge+\"to path\");\n\n if(state.next_path_node != state.sourceId)\n {\n iteratePath();\n //state.current_step = STEP_ITERATEPATH;\n }\n else\n {\n state.next_path_node = null;\n\n state.current_step = STEP_APPLYPATH;\n }\n }", "title": "" }, { "docid": "d5e9be75e6d11a44acd9628723d461cc", "score": "0.51716167", "text": "function initPathGathering() {\n\n state.next_node_to_search = null;\n state.next_path_node = state.targetId;\n state.path = [];\n state.augmentation = Number.MAX_SAFE_INTEGER;\n\n logger.log(\"Init path\");\n\n iteratePath();\n //state.current_step = STEP_ITERATEPATH;\n }", "title": "" }, { "docid": "1f3e5d3fec2fca2fe454dfa8120a1a2a", "score": "0.51706916", "text": "function calculatePath(terrain,startSpace,goalSpace,returnAllSolutions,raider) { \n\t//if startSpace meets the desired property, return it without doing any further calculations\n\tif (startSpace == goalSpace || (goalSpace == null && raider.canPerformTask(startSpace))) {\n\t\tif (!returnAllSolutions) {\n\t\t\treturn [startSpace];\n\t\t}\n\t\treturn [[startSpace]];\n\t}\n\t\n\t//initialize starting variables\n\tif (goalSpace != null) {\n\t\tgoalSpace.parents = [];\t\n\t}\n\t\n\tstartSpace.startDistance = 0;\n\tstartSpace.parents = [];\n\tvar closedSet = [];\n\tvar solutions = [];\n\tvar finalPathDistance = -1;\n\tvar openSet = [startSpace];\n\t//main iteration: keep popping spaces from the back until we have found a solution (or all equal solutions if returnAllSolutions is True) \n\t//or openSet is empty (in which case there is no solution)\n\twhile (openSet.length > 0) {\t\n\t\tvar currentSpace = openSet.shift();\n\t\tclosedSet.push(currentSpace);\n\t\tvar adjacentSpaces = [];\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"up\"));\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"down\"));\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"left\"));\n\t\tadjacentSpaces.push(adjacentSpace(terrain,currentSpace.listX,currentSpace.listY,\"right\"));\n\t\t\n\t\t//main inner iteration: check each space in adjacentSpaces for validity\n\t\tfor (var k = 0; k < adjacentSpaces.length; k++) {\n\t\t\t//if returnAllSolutions is True and we have surpassed finalPathDistance, exit immediately\n\t\t\tif ((finalPathDistance != -1) && (currentSpace.startDistance + 1 > finalPathDistance)) {\n\t\t\t\treturn solutions;\n\t\t\t}\n\t\t\t\n\t\t\tvar newSpace = adjacentSpaces[k];\n\t\t\t//check this here so that the algorithm is a little bit faster, but also so that paths to non-walkable terrain pieces (such as for drilling) will work\n\t\t\t//if the newSpace is a goal, find a path back to startSpace (or all equal paths if returnAllSolutions is True)\n\t\t\tif (newSpace == goalSpace || (goalSpace == null && raider.canPerformTask(newSpace))) {\n\t\t\t\tgoalSpace = newSpace;\n\t\t\t\tnewSpace.parents = [currentSpace]; //start the path with currentSpace and work our way back\n\t\t\t\tpathsFound = [[newSpace]];\n\t\t\t\t\n\t\t\t\t//grow out the list of paths back in pathsFound until all valid paths have been exhausted\n\t\t\t\twhile (pathsFound.length > 0) {\n\t\t\t\t\tif (pathsFound[0][pathsFound[0].length-1].parents[0] == startSpace) { //we've reached the start space, thus completing this path\n\t\t\t\t\t\tif (!returnAllSolutions) {\n\t\t\t\t\t\t\treturn pathsFound[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinalPathDistance = pathsFound[0].length;\n\t\t\t\t\t\tsolutions.push(pathsFound.shift());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//branch additional paths for each parent of the current path's current space\n\t\t\t\t\tfor (var i = 0; i < pathsFound[0][pathsFound[0].length-1].parents.length; i++) {\n\t\t\t\t\t\tif (i == pathsFound[0][pathsFound[0].length-1].parents.length - 1) {\n\t\t\t\t\t\t\tpathsFound[0].push(pathsFound[0][pathsFound[0].length-1].parents[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tpathsFound.push(pathsFound[0].slice());\n\t\t\t\t\t\t\tpathsFound[pathsFound.length-1].push(pathsFound[0][pathsFound[0].length-1].parents[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//attempt to keep branching from newSpace as long as it is a walkable type\n\t\t\tif ((newSpace != null) && (newSpace.walkable == true)) {\t\t\t\t\t\n\t\t\t\tvar newStartDistance = currentSpace.startDistance + 1;\n\t\t\t\tvar notInOpenSet = openSet.indexOf(newSpace) == -1;\n\t\t\t\t\n\t\t\t\t//don't bother with newSpace if it has already been visited unless our new distance from the start space is smaller than its existing startDistance\n\t\t\t\tif ((closedSet.indexOf(newSpace) != -1) && (newSpace.startDistance < newStartDistance)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//accept newSpace if newSpace has not yet been visited or its new distance from the start space is equal to its existing startDistance\n\t\t\t\tif (notInOpenSet || newSpace.startDistance == newStartDistance) { \n\t\t\t\t\t//only reset parent list if this is the first time we are visiting newSpace\n\t\t\t\t\tif (notInOpenSet) {\n\t\t\t\t\t\tnewSpace.parents = [];\n\t\t\t\t\t}\n\t\t\t\t\tnewSpace.parents.push(currentSpace);\n\t\t\t\t\tnewSpace.startDistance = newStartDistance;\n\t\t\t\t\t//if newSpace does not yet exist in the open set, insert it into the appropriate position using a binary search\n\t\t\t\t\tif (notInOpenSet) {\n\t\t\t\t\t\topenSet.splice(binarySearch(openSet,newSpace,\"startDistance\",true),0,newSpace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//if solutions is null then that means that no path was found\n\tif (solutions.length == 0) {\n\t\treturn null;\n\t}\n\treturn solutions; \n}", "title": "" }, { "docid": "fcb35c14a63e74155d079d2bb604fd5b", "score": "0.51559144", "text": "function evalOpenPaths() {\n\t\tconst x = $scope.maze.compass[0];\n\t\tconst y = $scope.maze.compass[1];\n\t\tconst potentialPathsCoords = [\n\t\t\t[x, y+1],\n\t\t\t[x, y-1],\n\t\t\t[x+1, y],\n\t\t\t[x-1, y],\n\t\t];\n\t\tlet count = 0;\n\t\tpotentialPathsCoords.forEach((coords) => {\n\t\t\tif (coords[0] >= 0 && coords[0] < $scope.maze.matrix[0].length\n\t\t\t\t&& coords[1] >= 0 && coords[1] < $scope.maze.matrix.length) {\n\t\t\t\t\tif ($scope.maze.matrix[coords[0]][coords[1]] === 0) {\n\t\t\t\t\t\t$scope.maze.matrix[coords[0]][coords[1]] = 5;\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t})\n\t\treturn count;\n\t}", "title": "" }, { "docid": "7e8f32be755c49fe3e530e1d6b5c5710", "score": "0.51447505", "text": "function tracePath() {\r\n\r\n let initial = resultantPuzzle;\r\n let finalResult = [];\r\n let i = 0;\r\n while (i < 1000) {\r\n\r\n for (let obj in parentChildRelationObject) {\r\n if (JSON.stringify(parentChildRelationObject[obj].value) == JSON.stringify(initial)) {\r\n finalResult.push(parentChildRelationObject[obj].value);\r\n initial = parentChildRelationObject[obj].parent;\r\n }\r\n }\r\n i = i + 1;\r\n }\r\n return finalResult;\r\n}", "title": "" }, { "docid": "dde61ebff6d309edf252cc7583480ec8", "score": "0.5142016", "text": "drawClippedImagery(canvas, boundary, paths, nwPoint) {\n const ctx = canvas.getContext('2d')\n\n ctx.save()\n ctx.translate(-nwPoint.x, -nwPoint.y)\n\n let url = null\n let currentPaths = []\n const pathsByUrl = []\n\n paths.forEach((path) => {\n if (path.url !== url) {\n // Draw everything in current\n if (currentPaths.length > 0) {\n pathsByUrl.push({ url, urlPaths: currentPaths })\n }\n ({ url } = path)\n currentPaths = [path]\n } else {\n currentPaths.push(path)\n }\n })\n\n if (currentPaths.length > 0) {\n pathsByUrl.push({ url, urlPaths: currentPaths })\n }\n\n const queue = []\n let index = 0\n\n const size = canvas.width\n const self = this\n for (let i = 0; i < pathsByUrl.length; i += 1) {\n const {\n url,\n urlPaths\n } = pathsByUrl[i]\n\n // eslint-disable-next-line no-loop-func\n self.loadImage(url, (image) => {\n queue[i] = () => {\n const paths = []\n const deemphisizedPaths = []\n\n urlPaths.forEach((path) => {\n if (path.deemphisized !== undefined && path.deemphisized) {\n deemphisizedPaths.push(path)\n } else {\n paths.push(path)\n }\n })\n\n // TODO: Figure out a way that we can prevent this from redrawing twice, every time a granule is loaded in.\n this.drawClippedImageDeemphisized(ctx, boundary, deemphisizedPaths, nwPoint, image, size)\n this.drawClippedImage(ctx, boundary, paths, nwPoint, image, size)\n }\n\n while (queue[index] != null) {\n queue[index]()\n queue[index] = null // Allow GC of image data\n index += 1\n }\n if (index === pathsByUrl.length) {\n return ctx.restore()\n }\n return null\n })\n }\n return null\n }", "title": "" }, { "docid": "22b81a9c0598314c7f4bb93efe5a1c7b", "score": "0.51307935", "text": "function paths(arr){\n\tvar m = arr.length -1,\n\t\t\ty = arr[0].length -1;\n\n\tif(arr && arr[0] && arr[0][0] === 1){\n\t\treturn sols(arr, 1, 0, m, y) + sols(arr, 0, 1, m, y);\t\n\t} else {\n\t\treturn 0;\n\t}\n}", "title": "" }, { "docid": "c44057f0298fc449b6bbec2ebe771f64", "score": "0.5128882", "text": "function pathReaches(src, path, trg){\n if(src.id === trg.id)\n return true;\n switch(src.category){\n case sk.NODE_SHEET:\n case sk.NODE_JOINT: \n case sk.NODE_CUSTOM: {\n let other = path == 'top' ? 'bottom' : 'top';\n let itf = src[other];\n if(itf.isConnected()){\n let otherSide = itf.otherSide(src);\n return pathReaches(otherSide.node, otherSide.path, trg);\n }\n } break;\n\n case sk.NODE_SPLIT:\n if(path == 'base'){\n // reaches if any branches does\n return src.branches.some(itf => {\n if(itf.isConnected()){\n let otherSide = itf.otherSide(src);\n return pathReaches(otherSide.node, otherSide.path, trg);\n } else\n return false;\n });\n } else {\n // reaches if the base does\n if(src.base.isConnected()){\n let otherSide = src.base.otherSide(src);\n return pathReaches(otherSide.node, otherSide.path, trg);\n } else \n return false;\n }\n break;\n default:\n break;\n }\n return false;\n}", "title": "" }, { "docid": "096ebfe265f9c24723c5c26080fd1f6b", "score": "0.51185054", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "096ebfe265f9c24723c5c26080fd1f6b", "score": "0.51185054", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "096ebfe265f9c24723c5c26080fd1f6b", "score": "0.51185054", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "096ebfe265f9c24723c5c26080fd1f6b", "score": "0.51185054", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "096ebfe265f9c24723c5c26080fd1f6b", "score": "0.51185054", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "096ebfe265f9c24723c5c26080fd1f6b", "score": "0.51185054", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "096ebfe265f9c24723c5c26080fd1f6b", "score": "0.51185054", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "3033344ab55989fecaf391bb14dd22ab", "score": "0.5117599", "text": "preparePaths()\n {\n let n,node;\n\n // and build a list of key and\n // spawn nodes\n \n this.keyNodes=[];\n this.spawnNodes=[];\n \n for (n=0;n!==this.nodes.length;n++) {\n node=this.nodes[n];\n if (node.key!==null) this.keyNodes.push(n);\n if (node.spawn) this.spawnNodes.push(n);\n }\n }", "title": "" }, { "docid": "94e98255731edb72e5e98ee3e4a5c233", "score": "0.51165247", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0 && j !== dad[j]) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "d21a82f466544a2375bc968808e82584", "score": "0.5112418", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n\t\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\t\tvar dad = new Array(pl), q = new Array(pl);\n\n\t\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\t\tfor(; j < q.length; ++j) {\n\t\t\ti = q[j];\n\t\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\t\tif(dad[i] === i) {\n\t\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t\t}\n\t\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t\t}\n\t\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t\t}\n\n\t\tfor(i=1; i < pl; ++i) {\n\t\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\t\tj = dad[i];\n\t\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\t\telse while(j !== 0) {\n\t\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\t\tj = dad[j];\n\t\t\t}\n\t\t\tdad[i] = 0;\n\t\t}\n\n\t\tFP[0] += \"/\";\n\t\tfor(i=1; i < pl; ++i) {\n\t\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\t\tFPD[FP[i]] = FI[i];\n\t\t}\n\t}", "title": "" }, { "docid": "a8fa5e4caa39493f4ed6c6f06103561e", "score": "0.5109581", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = new Array(pl), q = new Array(pl);\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\tFPD[FP[i]] = FI[i];\n\t}\n}", "title": "" }, { "docid": "a8fa5e4caa39493f4ed6c6f06103561e", "score": "0.5109581", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = new Array(pl), q = new Array(pl);\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\tFPD[FP[i]] = FI[i];\n\t}\n}", "title": "" }, { "docid": "a8fa5e4caa39493f4ed6c6f06103561e", "score": "0.5109581", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = new Array(pl), q = new Array(pl);\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\tFPD[FP[i]] = FI[i];\n\t}\n}", "title": "" }, { "docid": "a8fa5e4caa39493f4ed6c6f06103561e", "score": "0.5109581", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = new Array(pl), q = new Array(pl);\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\tFPD[FP[i]] = FI[i];\n\t}\n}", "title": "" }, { "docid": "a8fa5e4caa39493f4ed6c6f06103561e", "score": "0.5109581", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = new Array(pl), q = new Array(pl);\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\tFPD[FP[i]] = FI[i];\n\t}\n}", "title": "" }, { "docid": "c3a58dee08c76b00f298a08ae3d0ba9f", "score": "0.50902826", "text": "function continuePath(blockSize, offSet, aStarPath, breadthPath, depthPath, greedyPath) {\n if (aStarPath.completed != true) {\n if (aStarPath.pathFound != true) {\n aStarPath.update(blockSize, offSet);\n } else {\n aStarPath.complete(blockSize, offSet);\n }\n }\n\n if (breadthPath.completed != true) {\n if (breadthPath.pathFound != true) {\n breadthPath.update(blockSize, offSet);\n } else {\n breadthPath.complete(blockSize, offSet);\n }\n }\n\n if (depthPath.completed != true) {\n if (depthPath.pathFound != true) {\n depthPath.update(blockSize, offSet);\n } else {\n depthPath.complete(blockSize, offSet);\n }\n }\n\n if (greedyPath.completed != true) {\n if (greedyPath.pathFound != true) {\n greedyPath.update(blockSize, offSet);\n } else {\n greedyPath.complete(blockSize, offSet);\n }\n }\n\n if ((aStarPath.completed != true || breadthPath.completed != true ||\n depthPath.completed != true || greedyPath.completed != true) && !pause) {\n setTimeout(continuePath, delay, blockSize, offSet, aStarPath, breadthPath, depthPath, greedyPath);\n return;\n }\n}", "title": "" }, { "docid": "a45bcdab10ebd9ec6fedb39559564016", "score": "0.50843364", "text": "function mazeSolveAll(maze, current, path){\n let mapCopy = maze.map(x => [...x])\n let x = current[0]\n let y = current[1]\n if (x < 0 || y < 0 || x >= mapCopy[0].length || y >= mapCopy.length || maze[y][x] === '*'){\n return false\n }\n if (maze[y][x] === 'e'){\n console.log(path)\n return true\n }\n if (maze[y][x] === ' ') {\n mapCopy[y][x] = '*' \n \n mazeSolveAll(mapCopy, [x, y-1], path + 'U')\n mazeSolveAll(mapCopy, [x+1, y], path + 'R')\n mazeSolveAll(mapCopy, [x, y+1], path + 'D')\n mazeSolveAll(mapCopy, [x-1, y], path + 'L') \n }\n}", "title": "" }, { "docid": "1cf0c0ff2f399e064917203678b26597", "score": "0.5083711", "text": "function build_full_paths(FI, FPD, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0 && j !== dad[j]) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\tFPD[FP[i]] = FI[i];\n\t}\n}", "title": "" }, { "docid": "3bdf2d5187f451fa6fc276f029c89459", "score": "0.5069631", "text": "function build_full_paths(FI, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = [], q = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0 && j !== dad[j]) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}", "title": "" }, { "docid": "b235d68d607201151c38e75252d084b7", "score": "0.5067462", "text": "branchFromCurrentPath(){\n\n }", "title": "" }, { "docid": "2991c3e9c40e123ff9fe60a6d3d02bd5", "score": "0.5065964", "text": "function ProcessPaths(opr, pointList, currTransMtx, pageIndex) {\n var point_index, opr_index, x1, y1, pagePoint, w, h, x2, y2, x3, y3, x4, y4, pagePoint1, pagePoint2, pagePoint3, pagePoint4;\n\n return regeneratorRuntime.wrap(function ProcessPaths$(context$3$0) {\n while (1) switch (context$3$0.prev = context$3$0.next) {\n case 0:\n point_index = 0;\n if(opr.length > 4000){\n console.log(\"Processing \"+opr.length+\" points. This will take significant time.\");\n } else if (opr.length > 500) {\n console.log(\"Processing \"+opr.length+\" points. This may take some time.\");\n }\n opr_index = 0;\n case 3:\n if (!(opr_index < opr.length)) {\n context$3$0.next = 78;\n break;\n }\n\n context$3$0.t0 = opr[opr_index];\n context$3$0.next = (context$3$0.t0 === PDFNet.Element.PathSegmentType.e_moveto ? 7 : (context$3$0.t0 === PDFNet.Element.PathSegmentType.e_lineto ? 16 : (context$3$0.t0 === PDFNet.Element.PathSegmentType.e_cubicto ? 25 : (context$3$0.t0 === PDFNet.Element.PathSegmentType.e_rect ? 42 : (context$3$0.t0 === PDFNet.Element.PathSegmentType.e_closepath ? 73 : 74)))));\n break;\n case 7:\n x1 = pointList[point_index];\n ++point_index;\n y1 = pointList[point_index];\n ++point_index;\n context$3$0.next = 13;\n return currTransMtx.mult(x1, y1);\n case 13:\n pagePoint = context$3$0.sent;\n return context$3$0.delegateYield(DrawPointAnnot(pageIndex, pagePoint.x, pagePoint.y), \"t1\", 15);\n case 15:\n return context$3$0.abrupt(\"break\", 75);\n case 16:\n x1 = pointList[point_index];\n ++point_index;\n y1 = pointList[point_index];\n ++point_index;\n context$3$0.next = 22;\n return currTransMtx.mult(x1, y1);\n case 22:\n pagePoint = context$3$0.sent;\n return context$3$0.delegateYield(DrawPointAnnot(pageIndex, pagePoint.x, pagePoint.y), \"t2\", 24);\n case 24:\n return context$3$0.abrupt(\"break\", 75);\n case 25:\n // code to handle cubic segments\n x1 = pointList[point_index];++point_index;\n y1 = pointList[point_index];++point_index;\n x2 = pointList[point_index];++point_index;\n y2 = pointList[point_index];++point_index;\n x3 = pointList[point_index];++point_index;\n y3 = pointList[point_index];++point_index;\n context$3$0.next = 39;\n return currTransMtx.mult(x3, y3);\n case 39:\n pagePoint = context$3$0.sent;\n return context$3$0.delegateYield(DrawPointAnnot(pageIndex, pagePoint.x, pagePoint.y), \"t3\", 41);\n case 41:\n return context$3$0.abrupt(\"break\", 75);\n case 42:\n // code to handle rect segments\n x1 = pointList[point_index];++point_index;\n y1 = pointList[point_index];++point_index;\n w = pointList[point_index];\n ++point_index;\n h = pointList[point_index];\n ++point_index;\n x2 = x1 + w;\n y2 = y1;\n x3 = x2;\n y3 = y1 + h;\n x4 = x1;\n y4 = y3;\n context$3$0.next = 58;\n return currTransMtx.mult(x1, y1);\n case 58:\n pagePoint1 = context$3$0.sent;\n context$3$0.next = 61;\n return currTransMtx.mult(x2, y2);\n case 61:\n pagePoint2 = context$3$0.sent;\n context$3$0.next = 64;\n return currTransMtx.mult(x3, y3);\n case 64:\n pagePoint3 = context$3$0.sent;\n context$3$0.next = 67;\n return currTransMtx.mult(x4, y4);\n case 67:\n pagePoint4 = context$3$0.sent;\n return context$3$0.delegateYield(DrawPointAnnot(pageIndex, pagePoint1.x, pagePoint1.y), \"t4\", 69);\n case 69:\n return context$3$0.delegateYield(DrawPointAnnot(pageIndex, pagePoint2.x, pagePoint2.y), \"t5\", 70);\n case 70:\n return context$3$0.delegateYield(DrawPointAnnot(pageIndex, pagePoint3.x, pagePoint3.y), \"t6\", 71);\n case 71:\n return context$3$0.delegateYield(DrawPointAnnot(pageIndex, pagePoint4.x, pagePoint4.y), \"t7\", 72);\n case 72:\n return context$3$0.abrupt(\"break\", 75);\n case 73:\n return context$3$0.abrupt(\"break\", 75);\n case 74:\n return context$3$0.abrupt(\"break\", 75);\n case 75:\n ++opr_index;\n context$3$0.next = 3;\n break;\n case 78:\n case \"end\":\n return context$3$0.stop();\n }\n }, marked2$0[4], this);\n }", "title": "" }, { "docid": "368d47e920ac273481475b772da84cc1", "score": "0.5056355", "text": "* iteratorPath() {\n let startItem = yield* this.iteratorStartSearch();\n if (startItem == null) return;\n yield `Starting from vertex ${startItem.value}`;\n\n startItem.mark = true;\n startItem.isInTree = true;\n yield `Added vertex ${startItem.value} to tree`;\n\n this.markedConnections = this.connections.map(() => new Array(this.connections.length).fill(this.graph.getNoConnectionValue()));\n\n const shortestPath = this.connections[startItem.index].map((weight, index) => {\n return new Edge({src: startItem, dest: this.items[index], weight});\n });\n this.setStats(shortestPath);\n yield `Copied row ${startItem.value} from adjacency matrix to shortest path array`;\n\n let counter = 1;\n while(counter < this.items.length) {\n counter++;\n\n const minPathEdge = shortestPath.reduce((min, cur) => {\n return (min && min.weight < cur.weight || cur.dest.isInTree) ? min : cur;\n });\n\n if (!minPathEdge || minPathEdge.weight === Infinity) {\n yield 'One or more vertices are UNREACHABLE';\n break;\n }\n\n yield `Minimum distance from ${startItem.value} is ${minPathEdge.weight}, to vertex ${minPathEdge.dest.value}`;\n\n minPathEdge.dest.mark = true;\n minPathEdge.dest.isInTree = true;\n this.markedConnections[minPathEdge.src.index][minPathEdge.dest.index] = this.connections[minPathEdge.src.index][minPathEdge.dest.index];\n this.setStats(shortestPath);\n yield `Added vertex ${minPathEdge.dest.value} to tree`;\n\n yield 'Will adjust values in shortest-path array';\n yield* this.adjustShortestPath(shortestPath, startItem, minPathEdge);\n\n }\n yield `All shortest paths from ${startItem.value} found. Distances in array`;\n yield 'Press again to reset paths';\n this.items.forEach(item => {\n delete item.isInTree;\n item.mark = false;\n });\n this.markedConnections = [];\n this.statConsole.setMessage();\n }", "title": "" }, { "docid": "d47f4687f1d3622fa83408a3d7b5d589", "score": "0.5046971", "text": "onCodePathEnd(codePath, codePathNode) {\n const reactHooksMap = codePathReactHooksMapStack.pop();\n\n if (reactHooksMap.size === 0) {\n return;\n } // All of the segments which are cyclic are recorded in this set.\n\n\n const cyclic = new Set();\n /**\n * Count the number of code paths from the start of the function to this\n * segment. For example:\n *\n * ```js\n * function MyComponent() {\n * if (condition) {\n * // Segment 1\n * } else {\n * // Segment 2\n * }\n * // Segment 3\n * }\n * ```\n *\n * Segments 1 and 2 have one path to the beginning of `MyComponent` and\n * segment 3 has two paths to the beginning of `MyComponent` since we\n * could have either taken the path of segment 1 or segment 2.\n *\n * Populates `cyclic` with cyclic segments.\n */\n\n function countPathsFromStart(segment, pathHistory) {\n const {\n cache\n } = countPathsFromStart;\n let paths = cache.get(segment.id);\n const pathList = new Set(pathHistory); // If `pathList` includes the current segment then we've found a cycle!\n // We need to fill `cyclic` with all segments inside cycle\n\n if (pathList.has(segment.id)) {\n const pathArray = [...pathList];\n const cyclicSegments = pathArray.slice(pathArray.indexOf(segment.id) + 1);\n\n for (const cyclicSegment of cyclicSegments) {\n cyclic.add(cyclicSegment);\n }\n\n return 0;\n } // add the current segment to pathList\n\n\n pathList.add(segment.id); // We have a cached `paths`. Return it.\n\n if (paths !== undefined) {\n return paths;\n }\n\n if (codePath.thrownSegments.includes(segment)) {\n paths = 0;\n } else if (segment.prevSegments.length === 0) {\n paths = 1;\n } else {\n paths = 0;\n\n for (const prevSegment of segment.prevSegments) {\n paths += countPathsFromStart(prevSegment, pathList);\n }\n } // If our segment is reachable then there should be at least one path\n // to it from the start of our code path.\n\n\n if (segment.reachable && paths === 0) {\n cache.delete(segment.id);\n } else {\n cache.set(segment.id, paths);\n }\n\n return paths;\n }\n /**\n * Count the number of code paths from this segment to the end of the\n * function. For example:\n *\n * ```js\n * function MyComponent() {\n * // Segment 1\n * if (condition) {\n * // Segment 2\n * } else {\n * // Segment 3\n * }\n * }\n * ```\n *\n * Segments 2 and 3 have one path to the end of `MyComponent` and\n * segment 1 has two paths to the end of `MyComponent` since we could\n * either take the path of segment 1 or segment 2.\n *\n * Populates `cyclic` with cyclic segments.\n */\n\n\n function countPathsToEnd(segment, pathHistory) {\n const {\n cache\n } = countPathsToEnd;\n let paths = cache.get(segment.id);\n let pathList = new Set(pathHistory); // If `pathList` includes the current segment then we've found a cycle!\n // We need to fill `cyclic` with all segments inside cycle\n\n if (pathList.has(segment.id)) {\n const pathArray = Array.from(pathList);\n const cyclicSegments = pathArray.slice(pathArray.indexOf(segment.id) + 1);\n\n for (const cyclicSegment of cyclicSegments) {\n cyclic.add(cyclicSegment);\n }\n\n return 0;\n } // add the current segment to pathList\n\n\n pathList.add(segment.id); // We have a cached `paths`. Return it.\n\n if (paths !== undefined) {\n return paths;\n }\n\n if (codePath.thrownSegments.includes(segment)) {\n paths = 0;\n } else if (segment.nextSegments.length === 0) {\n paths = 1;\n } else {\n paths = 0;\n\n for (const nextSegment of segment.nextSegments) {\n paths += countPathsToEnd(nextSegment, pathList);\n }\n }\n\n cache.set(segment.id, paths);\n return paths;\n }\n /**\n * Gets the shortest path length to the start of a code path.\n * For example:\n *\n * ```js\n * function MyComponent() {\n * if (condition) {\n * // Segment 1\n * }\n * // Segment 2\n * }\n * ```\n *\n * There is only one path from segment 1 to the code path start. Its\n * length is one so that is the shortest path.\n *\n * There are two paths from segment 2 to the code path start. One\n * through segment 1 with a length of two and another directly to the\n * start with a length of one. The shortest path has a length of one\n * so we would return that.\n */\n\n\n function shortestPathLengthToStart(segment) {\n const {\n cache\n } = shortestPathLengthToStart;\n let length = cache.get(segment.id); // If `length` is null then we found a cycle! Return infinity since\n // the shortest path is definitely not the one where we looped.\n\n if (length === null) {\n return Infinity;\n } // We have a cached `length`. Return it.\n\n\n if (length !== undefined) {\n return length;\n } // Compute `length` and cache it. Guarding against cycles.\n\n\n cache.set(segment.id, null);\n\n if (segment.prevSegments.length === 0) {\n length = 1;\n } else {\n length = Infinity;\n\n for (const prevSegment of segment.prevSegments) {\n const prevLength = shortestPathLengthToStart(prevSegment);\n\n if (prevLength < length) {\n length = prevLength;\n }\n }\n\n length += 1;\n }\n\n cache.set(segment.id, length);\n return length;\n }\n\n countPathsFromStart.cache = new Map();\n countPathsToEnd.cache = new Map();\n shortestPathLengthToStart.cache = new Map(); // Count all code paths to the end of our component/hook. Also primes\n // the `countPathsToEnd` cache.\n\n const allPathsFromStartToEnd = countPathsToEnd(codePath.initialSegment); // Gets the function name for our code path. If the function name is\n // `undefined` then we know either that we have an anonymous function\n // expression or our code path is not in a function. In both cases we\n // will want to error since neither are React function components or\n // hook functions - unless it is an anonymous function argument to\n // forwardRef or memo.\n\n const codePathFunctionName = getFunctionName(codePathNode); // This is a valid code path for React hooks if we are directly in a React\n // function component or we are in a hook function.\n\n const isSomewhereInsideComponentOrHook = isInsideComponentOrHook(codePathNode);\n const isDirectlyInsideComponentOrHook = codePathFunctionName ? isComponentName(codePathFunctionName) || isHook(codePathFunctionName) : isForwardRefCallback(codePathNode) || isMemoCallback(codePathNode); // Compute the earliest finalizer level using information from the\n // cache. We expect all reachable final segments to have a cache entry\n // after calling `visitSegment()`.\n\n let shortestFinalPathLength = Infinity;\n\n for (const finalSegment of codePath.finalSegments) {\n if (!finalSegment.reachable) {\n continue;\n }\n\n const length = shortestPathLengthToStart(finalSegment);\n\n if (length < shortestFinalPathLength) {\n shortestFinalPathLength = length;\n }\n } // Make sure all React Hooks pass our lint invariants. Log warnings\n // if not.\n\n\n for (const [segment, reactHooks] of reactHooksMap) {\n // NOTE: We could report here that the hook is not reachable, but\n // that would be redundant with more general \"no unreachable\"\n // lint rules.\n if (!segment.reachable) {\n continue;\n } // If there are any final segments with a shorter path to start then\n // we possibly have an early return.\n //\n // If our segment is a final segment itself then siblings could\n // possibly be early returns.\n\n\n const possiblyHasEarlyReturn = segment.nextSegments.length === 0 ? shortestFinalPathLength <= shortestPathLengthToStart(segment) : shortestFinalPathLength < shortestPathLengthToStart(segment); // Count all the paths from the start of our code path to the end of\n // our code path that go _through_ this segment. The critical piece\n // of this is _through_. If we just call `countPathsToEnd(segment)`\n // then we neglect that we may have gone through multiple paths to get\n // to this point! Consider:\n //\n // ```js\n // function MyComponent() {\n // if (a) {\n // // Segment 1\n // } else {\n // // Segment 2\n // }\n // // Segment 3\n // if (b) {\n // // Segment 4\n // } else {\n // // Segment 5\n // }\n // }\n // ```\n //\n // In this component we have four code paths:\n //\n // 1. `a = true; b = true`\n // 2. `a = true; b = false`\n // 3. `a = false; b = true`\n // 4. `a = false; b = false`\n //\n // From segment 3 there are two code paths to the end through segment\n // 4 and segment 5. However, we took two paths to get here through\n // segment 1 and segment 2.\n //\n // If we multiply the paths from start (two) by the paths to end (two)\n // for segment 3 we get four. Which is our desired count.\n\n const pathsFromStartToEnd = countPathsFromStart(segment) * countPathsToEnd(segment); // Is this hook a part of a cyclic segment?\n\n const cycled = cyclic.has(segment.id);\n\n for (const hook of reactHooks) {\n // Report an error if a hook may be called more then once.\n if (cycled) {\n context.report({\n node: hook,\n message: \"React Hook \\\"\".concat(context.getSource(hook), \"\\\" may be executed \") + 'more than once. Possibly because it is called in a loop. ' + 'React Hooks must be called in the exact same order in ' + 'every component render.'\n });\n } // If this is not a valid code path for React hooks then we need to\n // log a warning for every hook in this code path.\n //\n // Pick a special message depending on the scope this hook was\n // called in.\n\n\n if (isDirectlyInsideComponentOrHook) {\n // Report an error if a hook does not reach all finalizing code\n // path segments.\n //\n // Special case when we think there might be an early return.\n if (!cycled && pathsFromStartToEnd !== allPathsFromStartToEnd) {\n const message = \"React Hook \\\"\".concat(context.getSource(hook), \"\\\" is called \") + 'conditionally. React Hooks must be called in the exact ' + 'same order in every component render.' + (possiblyHasEarlyReturn ? ' Did you accidentally call a React Hook after an' + ' early return?' : '');\n context.report({\n node: hook,\n message\n });\n }\n } else if (codePathNode.parent && (codePathNode.parent.type === 'MethodDefinition' || codePathNode.parent.type === 'ClassProperty') && codePathNode.parent.value === codePathNode) {// Ignore class methods for now because they produce too many\n // false positives due to feature flag checks. We're less\n // sensitive to them in classes because hooks would produce\n // runtime errors in classes anyway, and because a use*()\n // call in a class, if it works, is unambiguously *not* a hook.\n } else if (codePathFunctionName) {\n // Custom message if we found an invalid function name.\n const message = \"React Hook \\\"\".concat(context.getSource(hook), \"\\\" is called in \") + \"function \\\"\".concat(context.getSource(codePathFunctionName), \"\\\" \") + 'that is neither a React function component nor a custom ' + 'React Hook function.';\n context.report({\n node: hook,\n message\n });\n } else if (codePathNode.type === 'Program') {\n // These are dangerous if you have inline requires enabled.\n const message = \"React Hook \\\"\".concat(context.getSource(hook), \"\\\" cannot be called \") + 'at the top level. React Hooks must be called in a ' + 'React function component or a custom React Hook function.';\n context.report({\n node: hook,\n message\n });\n } else {\n // Assume in all other cases the user called a hook in some\n // random function callback. This should usually be true for\n // anonymous function expressions. Hopefully this is clarifying\n // enough in the common case that the incorrect message in\n // uncommon cases doesn't matter.\n if (isSomewhereInsideComponentOrHook) {\n const message = \"React Hook \\\"\".concat(context.getSource(hook), \"\\\" cannot be called \") + 'inside a callback. React Hooks must be called in a ' + 'React function component or a custom React Hook function.';\n context.report({\n node: hook,\n message\n });\n }\n }\n }\n }\n }", "title": "" }, { "docid": "474be94df0f369f67f12ff584e597015", "score": "0.504465", "text": "processNextVertex(){\n if(this.finished){\n console.log(\"All reachable verticies have already been processed\")\n return null;\n }\n\n let nextClosestVertex =null\n\n if(this.algorithm===\"a-star\"){\n nextClosestVertex = a_star(this.unprocessedVertices)\n\n } else if(this.algorithm===\"depth-first\"){\n if(this.sourceIndex!==-1 && this.targetIndex!==-1){\n //if this is the first time time this function is called, add source\n //vertex\n if(this.processedVerticies.length===0){\n this.processedVerticies.push(this.unprocessedVertices[this.sourceIndex])\n }\n //pass the last vertex that was processed\n nextClosestVertex = depth_first(this.processedVerticies[this.processedVerticies.length-1])\n }\n\n } else if(this.algorithm===\"greedy-best-first\"){\n nextClosestVertex = greedy_best_first(this.unprocessedVertices)\n\n } else { //else use dijkstra\n nextClosestVertex = dijkstra(this.unprocessedVertices)\n }\n\n\n //happens if no path from source to target\n if(nextClosestVertex===null){\n this.finished=true;\n console.log(\"No path from source to dest\")\n return;\n }\n\n //if currentVertex is the target vertex, set isFinished to true\n if(nextClosestVertex.id===this.targetIndex){\n this.finished=true;\n }\n\n this.processedVerticies.push(nextClosestVertex)\n }", "title": "" }, { "docid": "e14f7954046329c490d8f96db57eea3d", "score": "0.50299925", "text": "function removeUnnecessaryElse(path) {\n const { node } = path;\n const consequent = path.get(\"consequent\");\n const alternate = path.get(\"alternate\");\n\n if (\n consequent.node &&\n alternate.node &&\n (consequent.isReturnStatement() ||\n (consequent.isBlockStatement() &&\n t.isReturnStatement(\n consequent.node.body[consequent.node.body.length - 1]\n ))) &&\n // don't hoist declarations\n // TODO: validate declarations after fixing scope issues\n (alternate.isBlockStatement()\n ? !alternate\n .get(\"body\")\n .some(\n stmt =>\n stmt.isVariableDeclaration({ kind: \"let\" }) ||\n stmt.isVariableDeclaration({ kind: \"const\" })\n )\n : true)\n ) {\n path.insertAfter(\n alternate.isBlockStatement()\n ? alternate.node.body.map(el => t.clone(el))\n : t.clone(alternate.node)\n );\n node.alternate = null;\n return REPLACED;\n }\n }", "title": "" }, { "docid": "d30bde2e5040080df374554d13fff28d", "score": "0.501535", "text": "function find_local_optimum(paths){\n let current_solution_index = _.random(0, paths.length);\n\n while (true) {\n try {\n if (cost(paths[current_solution_index + 1]) < cost(paths[current_solution_index])) {\n current_solution_index += 1;\n }\n else if (cost(paths[current_solution_index - 1]) < cost(paths[current_solution_index])) {\n current_solution_index -= 1;\n }\n else {\n return paths[current_solution_index]\n }\n }\n catch(e) {\n return paths[current_solution_index - 1]\n }\n }\n}", "title": "" }, { "docid": "fa723a35f3a0d309369880d3201b40aa", "score": "0.5006261", "text": "function pathReduce1(dir1,dir2) {\n dir1 = dir1 - dir2;\n if (dir1 < 0) {\n dir2 = -dir1;\n dir1 = 0;\n } else {\n dir2 = 0;\n }\n return [dir1,dir2];\n}", "title": "" }, { "docid": "fa723a35f3a0d309369880d3201b40aa", "score": "0.5006261", "text": "function pathReduce1(dir1,dir2) {\n dir1 = dir1 - dir2;\n if (dir1 < 0) {\n dir2 = -dir1;\n dir1 = 0;\n } else {\n dir2 = 0;\n }\n return [dir1,dir2];\n}", "title": "" }, { "docid": "df75d33233e303985f453d29c2497961", "score": "0.49971154", "text": "function opt_set_ops(){\n lens_and_nodes_graphics(nodes_in, len_function_type_enum.UNSELECT);\n nodes_in = []\n total_cost = 0\n visited.forEach(element => {\n nodes_in.push(element)\n })\n var i;\n for (i = 0; i < nodes_in.length - 1; i++){\n total_cost += distance_map(nodes_in[i], nodes_in[i + 1]);\n }\n change_cost_graphic(total_cost)\n lens_and_nodes_graphics(nodes_in, len_function_type_enum.SELECT)\n\n}", "title": "" }, { "docid": "5a00e1cc92f94d9fefb45e6931f84d66", "score": "0.49851787", "text": "function cost(path) {\n let cost = 0;\n let local_cost = 0;\n for (let i in range(0, len(path)-1)) {\n local_cost = intervals[Amajor[path[i]].index(path[i+1])];\n }\n cost += local_cost;\n return cost\n}", "title": "" }, { "docid": "52128f007d0c4cfd61d8436ca7252bec", "score": "0.49786627", "text": "findPath(originAddr, destAddr) {\n let costs = {};\n costs[originAddr] = 0;\n let paths = {};\n let current = originAddr;\n\n let visited = {};\n let unvisited = {};\n\n while(current && current != destAddr) {\n let neighbors = this.getNeighbors(current).sort((a,b) =>\n this.getCost(current, a) - this.getCost(current, b)\n );\n\n neighbors.forEach((neighbor) => {\n if(!visited[neighbor]) {\n unvisited[neighbor] = true;\n }\n });\n\n neighbors.forEach((neighbor) => {\n let newCost = costs[current] + this.getCost(current, neighbor);\n if(!costs[neighbor] || newCost < costs[neighbor]){\n costs[neighbor] = newCost;\n paths[neighbor] = current;\n }\n });\n visited[current] = true;\n delete unvisited[current];\n\n current = Object.keys(unvisited).sort((a,b) => costs[a] - costs[b])[0];\n }\n\n if(! current) {\n return undefined;\n }\n\n let path = [];\n while(current && current != originAddr) {\n path.unshift(current);\n current = paths[current];\n }\n return path;\n }", "title": "" }, { "docid": "4296198f402355afda088d28f869182c", "score": "0.49720082", "text": "function findPathHelper(current, dest, visited, path){\n\t\tvisited[current] = true;\n\t\tpath.push(current);\n\n\t\tif(current === dest){\n\t\t\trenderPath(path);\n\t\t} else {\n\t\t\tfor(let node in nodes[current]){\n\t\t\t\tif(!visited[node]){\n\t\t\t\t\tfindPathHelper(node, dest, visited, path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "886b889b0b1f2820ec62b7ee0d5efc5c", "score": "0.49638793", "text": "animateShortestPath(nodesInShortestPathOrder) {\n for (let i = 0; i < nodesInShortestPathOrder.length; i++) {\n setTimeout(() => {\n const node = nodesInShortestPathOrder[i];\n\n if (\n !(\n document.getElementById(`node-${node.row}-${node.col}`)\n .className === \"node node-start\" ||\n document.getElementById(`node-${node.row}-${node.col}`)\n .className === \"node node-finish\"\n )\n ) {\n document.getElementById(`node-${node.row}-${node.col}`).className =\n \"node node-shortest-path\";\n }\n }, 20 * i);\n }\n }", "title": "" }, { "docid": "b37737e6396f25fd3d4597f75a16b94a", "score": "0.4960534", "text": "function paths(pathObj) {\n var endNode = String.fromCharCode(65 + nodeNum - 1);\n //start at the beginning (node 'A');\n var resArr = ['A'];\n\n\n //until all the paths are deadended or fully run\n while (resArr.some(function(val){return val.slice(-1) !== endNode})){\n\n //hotChar is the current last item in the first path string in the paths array\n var hotChar = resArr[0].slice(-1);\n\n //if the end has already been reached, move from front to back.\n if (hotChar === endNode) {\n resArr.push(resArr.shift());\n }\n\n //if not reached\n else {\n //get the array of nodes connected to HotChar\n holdArr = pathObj[hotChar];\n\n //filter out the nodes already visited (would create loop)\n holdArr = holdArr.filter(function(val) {\n return resArr[0].indexOf(val) === -1;\n });\n\n //remove the pathstring from the front of the array\n var oldStr = resArr.splice(0, 1)[0];\n\n //add to the rear of the array each continuing path (gets tossed if deadend)\n holdArr.forEach(function(val){\n resArr.push(oldStr + val);\n });\n }\n }\n return resArr;\n}", "title": "" }, { "docid": "42c92ad6632d92d9e67633a2b66c568b", "score": "0.49588367", "text": "function pathReduce2(dir1,dir2) {\n var common = Math.min(dir1,dir2);\n var d1 = dir1 - common;\n var d2 = dir2 - common;\n return [d1,d2,common];\n}", "title": "" }, { "docid": "42c92ad6632d92d9e67633a2b66c568b", "score": "0.49588367", "text": "function pathReduce2(dir1,dir2) {\n var common = Math.min(dir1,dir2);\n var d1 = dir1 - common;\n var d2 = dir2 - common;\n return [d1,d2,common];\n}", "title": "" }, { "docid": "00017eeec5ff6e2ba39b37eb204da1dc", "score": "0.4958161", "text": "composedPath() {\n const composedPath = [];\n const {currentTarget: currentTarget, _path: path} = this;\n if (path.length === 0) {\n return composedPath;\n }\n composedPath.push(currentTarget);\n let currentTargetIndex = 0;\n let currentTargetHiddenSubtreeLevel = 0;\n for (let index = path.length - 1; index >= 0; index--) {\n const {item: item, rootOfClosedTree: rootOfClosedTree, slotInClosedTree: slotInClosedTree} = path[index];\n if (rootOfClosedTree) {\n currentTargetHiddenSubtreeLevel++;\n }\n if (item === utils$7.implForWrapper(currentTarget)) {\n currentTargetIndex = index;\n break;\n }\n if (slotInClosedTree) {\n currentTargetHiddenSubtreeLevel--;\n }\n }\n let currentHiddenLevel = currentTargetHiddenSubtreeLevel;\n let maxHiddenLevel = currentTargetHiddenSubtreeLevel;\n for (let i = currentTargetIndex - 1; i >= 0; i--) {\n const {item: item, rootOfClosedTree: rootOfClosedTree, slotInClosedTree: slotInClosedTree} = path[i];\n if (rootOfClosedTree) {\n currentHiddenLevel++;\n }\n if (currentHiddenLevel <= maxHiddenLevel) {\n composedPath.unshift(utils$7.wrapperForImpl(item));\n }\n if (slotInClosedTree) {\n currentHiddenLevel--;\n if (currentHiddenLevel < maxHiddenLevel) {\n maxHiddenLevel = currentHiddenLevel;\n }\n }\n }\n currentHiddenLevel = currentTargetHiddenSubtreeLevel;\n maxHiddenLevel = currentTargetHiddenSubtreeLevel;\n for (let index = currentTargetIndex + 1; index < path.length; index++) {\n const {item: item, rootOfClosedTree: rootOfClosedTree, slotInClosedTree: slotInClosedTree} = path[index];\n if (slotInClosedTree) {\n currentHiddenLevel++;\n }\n if (currentHiddenLevel <= maxHiddenLevel) {\n composedPath.push(utils$7.wrapperForImpl(item));\n }\n if (rootOfClosedTree) {\n currentHiddenLevel--;\n if (currentHiddenLevel < maxHiddenLevel) {\n maxHiddenLevel = currentHiddenLevel;\n }\n }\n }\n return composedPath;\n }", "title": "" }, { "docid": "b301bf8a4b858f274ca66bb8a411e864", "score": "0.4946649", "text": "function get_paths(type) {\n if (!type) {\n var home = {latitude: -29.831114, longitude: 28.277982};\n\n //basura\n var v1 = { latitude: -29.690116150362357, longitude: 28.390072692273343};\n\n //sambuya\n var v2 = { latitude: -29.62187506287539, longitude: 28.59281502637935};\n\n var path1 = build_path(home, v1);\n var path2 = build_path(v1, v2);\n var path3 = build_path(v2, home);\n\n //return [path1];\n return [path1, path2, path3];\n\n } else if (type==\"hiv\") {\n\n var home = {latitude: -29.831114, longitude: 28.277982};\n //penyem\n var v1 = { latitude: -29.37320948095241, longitude: 28.442143765598694};\n //sambuya\n var v2 = { latitude: -29.62187506287539, longitude: 28.59281502637935};\n //kiti\n var v3 = { latitude: -29.743900174216307, longitude: 28.514337444183575};\n\n var path1 = build_path(home, v1);\n var path2 = build_path(v1, v2);\n var path3 = build_path(v2, v3);\n var path4 = build_path(v3, home);\n\n return [path1, path2, path3, path4];\n }\n else if (type==\"blood\") {\n var home = {latitude: -29.831114, longitude: 28.277982};\n //bakary\n var v1 = { latitude: -29.65193836454948, longitude: 28.33433359451049};\n //sambuya\n var v2 = { latitude: -29.62187506287539, longitude: 28.59281502637935};\n\n var path1 = build_path(home, v1);\n var path2 = build_path(v1, v2);\n var path3 = build_path(v2, home);\n\n //return [path1];\n return [path1, path2, path3];\n }\n else if (type==\"pregnancy\") {\n var home = {latitude: -29.831114, longitude: 28.277982};\n //basura\n var v1 = { latitude: -29.690116150362357, longitude: 28.390072692273343};\n //sambuya\n var v2 = { latitude: -29.62187506287539, longitude: 28.59281502637935};\n //kiti\n var v3 = { latitude: -29.743900174216307, longitude: 28.514337444183575};\n\n var path1 = build_path(home, v1);\n var path2 = build_path(v1, v2);\n var path3 = build_path(v2, v3);\n var path4 = build_path(v3, home);\n\n return [path1, path2, path3, path4];\n\n }\n else if (type==\"baby\") {\n var home = {latitude: -29.831114, longitude: 28.277982};\n //bakary\n var v1 = { latitude: -29.65193836454948, longitude: 28.33433359451049};\n //manduar\n var v2 = { latitude: -29.470415935443654, longitude: 28.51467336199169};\n //basura\n var v3 = { latitude: -29.690116150362357, longitude: 28.390072692273343};\n\n var path1 = build_path(home, v1);\n var path2 = build_path(v1, v2);\n var path3 = build_path(v2, v3);\n var path4 = build_path(v3, home);\n\n return [path1, path2, path3, path4];\n }\n else if (type==\"medicine\") {\n var home = {latitude: -29.831114, longitude: 28.277982};\n //sambuya\n var v1 = { latitude: -29.62187506287539, longitude: 28.59281502637935};\n //manduar\n var v2 = { latitude: -29.470415935443654, longitude: 28.51467336199169};\n //penyem\n var v3 = { latitude: -29.37320948095241, longitude: 28.442143765598694};\n\n var path1 = build_path(home, v1);\n var path2 = build_path(v1, v2);\n var path3 = build_path(v2, v3);\n var path4 = build_path(v3, home);\n\n return [path1, path2, path3, path4];\n }\n}", "title": "" }, { "docid": "6806b1b49cb125ad3e68722a07fb900e", "score": "0.49375284", "text": "function calcPaths(walkable, goal, neighbors) {\n\tvar frontier = new Array();\n\tvar visited = new Array();\n\tvar next = new Array();\n\tvisited[goal] = true;\n\tfrontier.push(goal);\n\twhile(frontier.length > 0) { \n\t\tvar current = frontier.shift();\n\t\tvar cn = neighbors[current];\n\t\tfor (var i = cn.length - 1; i >= 0; i--) {\n\t\t\tnextIndex = cn[i]\n\t\t\tif(!visited[nextIndex]) {\n\t\t\t\tif(walkable[nextIndex]) {\n\t\t\t\t\tfrontier.push(nextIndex)\n\t\t\t\t}\n\t\t\t\tvisited[nextIndex] = true;\n\t\t\t\tnext[nextIndex] = current;\n\t\t\t}\n\t\t}\n\t}\n\treturn next;\n}", "title": "" }, { "docid": "a01f1e6f120bd371a5e7f0519f45cf03", "score": "0.49268952", "text": "function _recurseMatchAndExecute(\n match, actionRunner, paths,\n method, routerInstance, jsongCache) {\n var unhandledPaths = [];\n var invalidated = [];\n var reportedPaths = [];\n var currentMethod = method;\n return Observable.\n\n // Each pathSet (some form of collapsed path) need to be sent\n // independently. for each collapsed pathSet will, if producing\n // refs, be the highest likelihood of collapsibility.\n from(paths).\n expand(function(nextPaths) {\n if (!nextPaths.length) {\n return Observable.empty();\n }\n\n // We have to return an Observable of error instead of just\n // throwing.\n var matchedResults;\n try {\n matchedResults = match(currentMethod, nextPaths);\n } catch (e) {\n return Observable.throw(e);\n }\n\n // When there is explicitly not a match then we need to handle\n // the unhandled paths.\n if (!matchedResults.length) {\n unhandledPaths.push(nextPaths);\n return Observable.empty();\n }\n return runByPrecedence(nextPaths, matchedResults, actionRunner).\n // Generate from the combined results the next requestable paths\n // and insert errors / values into the cache.\n flatMap(function(results) {\n var value = results.value;\n var suffix = results.match.suffix;\n\n // TODO: MaterializedPaths, use result.path to build up a\n // \"foundPaths\" array. This could be used to materialize\n // if that is the case. I don't think this is a\n // requirement, but it could be.\n if (!isArray(value)) {\n value = [value];\n }\n\n var invsRefsAndValues =\n mCGRI(jsongCache, value, routerInstance);\n var invalidations = invsRefsAndValues.invalidations;\n var unhandled = invsRefsAndValues.unhandledPaths;\n var messages = invsRefsAndValues.messages;\n var pathsToExpand = [];\n\n if (suffix.length > 0) {\n pathsToExpand = invsRefsAndValues.references;\n }\n\n // Merge the invalidations and unhandledPaths.\n invalidations.forEach(function(invalidation) {\n invalidated[invalidated.length] = invalidation.path;\n });\n\n unhandled.forEach(function(unhandledPath) {\n unhandledPaths[unhandledPaths.length] = unhandledPath;\n });\n\n // Merges the remaining suffix with remaining nextPaths\n pathsToExpand = pathsToExpand.map(function(next) {\n return next.value.concat(suffix);\n });\n\n // Alters the behavior of the expand\n messages.forEach(function(message) {\n // mutates the method type for the matcher\n if (message.method) {\n currentMethod = message.method;\n }\n\n // Mutates the nextPaths and adds any additionalPaths\n else if (message.additionalPath) {\n var path = message.additionalPath;\n pathsToExpand[pathsToExpand.length] = path;\n reportedPaths[reportedPaths.length] = path;\n }\n\n // Any invalidations that come down from a call\n else if (message.invalidations) {\n message.\n invalidations.\n forEach(function(invalidation) {\n invalidated.push(invalidation);\n });\n }\n\n // We need to add the unhandledPaths to the jsonGraph\n // response.\n else if (message.unhandledPaths) {\n unhandledPaths = unhandledPaths.\n concat(message.unhandledPaths);\n }\n });\n\n // Explodes and collapse the tree to remove\n // redundants and get optimized next set of\n // paths to evaluate.\n pathsToExpand = optimizePathSets(\n jsongCache, pathsToExpand, routerInstance.maxRefFollow);\n\n if (pathsToExpand.length) {\n pathsToExpand = collapse(pathsToExpand);\n }\n\n return Observable.\n from(pathsToExpand);\n }).\n defaultIfEmpty([]);\n\n }, Number.POSITIVE_INFINITY, Rx.Scheduler.queue).\n reduce(function(acc, x) {\n return acc;\n }, null).\n map(function() {\n return {\n unhandledPaths: unhandledPaths,\n invalidated: invalidated,\n jsonGraph: jsongCache,\n reportedPaths: reportedPaths\n };\n });\n}", "title": "" }, { "docid": "7c2c0eec232b735ac2088f1318a81d26", "score": "0.4919076", "text": "getShortestPath() {\n /**\n * Find source to begin traverse or \n * can we iterate and works when source dounds?\n */\n let {\n matrixMap, \n sourcePoint, \n destPoint\n } = this.getMapWithConnectedEdges();\n\n /* Validating processed values */\n if(!matrixMap || matrixMap.size === 0 || !sourcePoint || !destPoint) {\n return -1;\n }\n console.log(`Starting Node: ${sourcePoint}, distance: 0`)\n \n /* Iterate from source point */\n let queue = matrixMap.get(sourcePoint.Key);\n let visitedArr = new Array();\n\n /**\n * Starts from first level. \n * 0th level is root node(Source). \n */\n let minimumDistance = 1;\n let currentLevelNodeSize = queue.length;\n \n while(true) {\n if(queue.length === 0) {\n break;\n }\n \n /* Takes first element */\n let itrPoint = queue.shift();\n currentLevelNodeSize--;\n\n /* Pushing element to a visited array */\n visitedArr.push(itrPoint.Key);\n console.log(`Current Index: ${itrPoint}, currentLevelNodeSize: ${currentLevelNodeSize}, minDistance: ${minimumDistance} `);\n\n /* Validating whether it is a destination point */\n if(itrPoint.Key === destPoint.Key) {\n console.log(\"THROWING DISTANCE\")\n return minimumDistance;\n }\n\n /* Moving to next level */\n /**\n * Push its children back to a queue, \n * removes visited elements and concat \n **/\n queue = queue.concat(\n matrixMap.get(itrPoint.Key).filter(\n val => visitedArr.indexOf(val.Key) === -1\n )\n );\n\n /**\n * If current level node is all used\n * then incrementing minimum distance and \n * updates currentLevelNodeSize as per queue \n */\n if(currentLevelNodeSize == 0) {\n minimumDistance++;\n currentLevelNodeSize = queue.length;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "da579a608943236b71da35ad1e56f448", "score": "0.49104813", "text": "function findPaths(paths, path, prev, start, currentNode){\n if(currentNode === start){\n \tpath = path.slice();\n \tpaths.push(path);\n \treturn;\n }\n\n\tfor (var par of prev[currentNode]){\n \tpath.push(graph[currentNode]); // add Node Object to the path\n findPaths(paths, path, prev, start, par);\n path.pop(par);\n }\n return;\n}", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.4901706", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.4901706", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "e055e5f2275edd356bce0e6509547c47", "score": "0.48957863", "text": "walk() {\n let nextMap = {}\n for (let i = 0; i < this.n; i++) {\n for (let j = 0; j < i; j++) {\n let key = 'f' + j + 't' + i\n nextMap[key] = this.shortPath(j, i)\n }\n }\n return new graph(this.n, nextMap)\n }", "title": "" }, { "docid": "dc0a26404ad5e36074fae97d1963a34a", "score": "0.48926768", "text": "function choosePath( bay )\n{\n\tswitch( bay-1 )\n\t{\n\t\tcase 0:\n\t\t\tif( entrance == 7 )\n\t\t\t{\n\t\t\t\tPath_List.push( 5 );\n\t\t\t\tPath_List.push( 4 );\n\t\t\t\tPath_List.push( 3 );\n\t\t\t\tPath_List.push( 0 );\n\n\t\t\t\tRev_Path.push( 3 );\n\t\t\t\tRev_Path.push( 4 );\n\t\t\t\tRev_Path.push( 5 );\n\t\t\t\tRev_Path.push( 7 );\n\t\t\t}\n\t\t\telse if (entrance == 6)\n\t\t\t{\n\t\t\t\tPath_List.push( 3 );\n\t\t\t\tPath_List.push( 0 );\n\n\t\t\t\tRev_Path.push( 3 );\n\t\t\t\tRev_Path.push( 6 );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tif( entrance == 7 )\n\t\t\t{\n\t\t\t\tPath_List.push( 5 );\n\t\t\t\tPath_List.push( 4 );\n\t\t\t\tPath_List.push( 1 );\n\n\t\t\t\tRev_Path.push( 4 );\n\t\t\t\tRev_Path.push( 5 );\n\t\t\t\tRev_Path.push( 7 );\n\t\t\t}\n\t\t\telse if (entrance == 6)\n\t\t\t{\n\t\t\t\tPath_List.push( 3 );\n\t\t\t\tPath_List.push( 4 );\n\t\t\t\tPath_List.push( 1 );\n\n\t\t\t\tRev_Path.push( 4 );\n\t\t\t\tRev_Path.push( 3 );\n\t\t\t\tRev_Path.push( 6 );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tif( entrance == 7 )\n\t\t\t{\n\t\t\t\tPath_List.push( 5 );\n\t\t\t\tPath_List.push( 2 );\n\n\t\t\t\tRev_Path.push( 5 );\n\t\t\t\tRev_Path.push( 7 );\n\t\t\t}\n\t\t\telse if (entrance == 6)\n\t\t\t{\n\t\t\t\tPath_List.push( 3 );\n\t\t\t\tPath_List.push( 4 );\n\t\t\t\tPath_List.push( 5 );\n\t\t\t\tPath_List.push( 2 );\n\n\t\t\t\tRev_Path.push( 5 );\n\t\t\t\tRev_Path.push( 4 );\n\t\t\t\tRev_Path.push( 3 );\n\t\t\t\tRev_Path.push( 6 );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif( debug ) debugLog( \"Default case bay should not be hit\" );\n\t\t\tbreak;\n\t}\n\t\n\treturn;\n}", "title": "" }, { "docid": "d45310bd95c1acef552f3599e15c880e", "score": "0.48925704", "text": "presolve() {\n let self = this;\n if (this.presolved) {\n return;\n }\n let longestPath = 0;\n let exits = 0; // count of exit squares\n // we can't just count the true values in exitSquares because that would\n // violate our O(1) storage requirement\n // returns path length\n function backtracePath(square) {\n let pathLengths = [0, 0, 0, 0];\n let neighbors = [self.up(square), self.down(square), self.left(square), self.right(square)];\n for (let i = 0; i < neighbors.length; i++) {\n if (neighbors[i] !== null && self.next(neighbors[i]) === square) {\n exits++;\n self.exitSquares[neighbors[i]] = true;\n self.record({\n event: \"addExitSquare\",\n square: neighbors[i]\n });\n self.record({\n event: \"addBacktraceSquare\",\n square: square\n });\n self.nextEvent();\n pathLengths[i] = backtracePath(neighbors[i]);\n self.record({\n event: \"removeBacktraceSquare\",\n square: square\n });\n self.nextEvent();\n }\n }\n return 1 + Math.max(...pathLengths);\n }\n // We're going to do all four sides at once.\n // This will take O(n) checks instead of O(n^2), so even though it's\n // a bit messier to code, it's a potentially very large improvement\n // in cases we'll likely never actually hit. But it's the principle\n // of the thing. If we wanted to just check the entire grid for exit\n // points, we'd just check if this.next is null for each square.\n for (let i = 0; i < this.size - 1; i++) {\n let targetSquares = [\n this.square(0, i),\n this.square(i, this.size - 1),\n this.square(this.size - 1, this.size - 1 - i),\n this.square(this.size - 1 - i, 0) // along left\n ];\n for (let j = 0; j < 4; j++) {\n if (this.next(targetSquares[j]) === null) {\n exits++;\n this.exitSquares[targetSquares[j]] = true;\n this.record({\n event: \"addExitSquare\",\n square: targetSquares[j]\n });\n this.record({\n event: \"addBacktraceSquare\",\n square: targetSquares[j]\n });\n this.nextEvent();\n let pathLength = backtracePath(targetSquares[j]);\n this.record({\n event: \"removeBacktraceSquare\",\n square: targetSquares[j]\n });\n if (pathLength > longestPath) {\n longestPath = pathLength;\n this.record({\n event: \"updateLongestPath\",\n value: longestPath\n });\n }\n this.nextEvent();\n }\n }\n }\n this.longestExitPathLength = longestPath;\n this.presolved = true;\n }", "title": "" }, { "docid": "13388c576df9235cb3d94e8c01ac46f4", "score": "0.4891562", "text": "dfsRecursivePath(start_vert_id, target_vert_id, visited = [], path = []) {\n visited.push(start_vert_id);\n path.push(start_vert_id);\n\n if (start_vert_id === target_vert_id) {\n console.log('visited: ', visited);\n return path // OR return visited??????????\n }\n for (let edge of this.vertices[start_vert_id].edges) {\n if (!visited.includes(edge)) {\n let newPath = this.dfsRecursivePath(edge, target_vert_id, visited, path);\n if (newPath) {\n return newPath\n }\n }\n }\n return null \n }", "title": "" }, { "docid": "5c61c3aee3f230e80fbb1f35ca3a7afd", "score": "0.48875487", "text": "function transit(gridsize){\n var total_product = 1;\n var one_way_factorial = 1;\n for(i = 1; i <= gridsize * 2; i++){\n total_product *= i;\n }\n for(i = 1; i <= gridsize; i++){\n one_way_factorial *= i; \n }\n\n //sqaured coz. NcR is n!/r!(n - r)!\n var total_paths = total_product /(one_way_factorial * one_way_factorial);\n return total_paths;\n}", "title": "" }, { "docid": "9a1d0f9983c8ed6b7b00200c2d27f901", "score": "0.48854035", "text": "checkPath(data, logic2) {\n if (data) {\n const len = data.length;\n let str = '';\n // var logic = '';\n for (let i = 0; i < len; i += 1) {\n if (data[i].data === undefined) {\n let str2 = '';\n let logic = '';\n for (let j = 0; j < data[i].length; j += 1) {\n logic = (data[i][j].join === 'or' ? '||' : '&&');\n str2 += ((j !== 0) ? logic : '') + this.checkPathLogic(data[i][j].data, data[i][j].type, data[i][j].logic);\n }\n str += `${(i !== 0) ? logic2 : ''}(${str2})`;\n } else {\n str += ((i !== 0) ? logic2 : '') + this.checkPathLogic(data[i].data, data[i].type, data[i].logic);\n }\n }\n return str;\n }\n return false;\n }", "title": "" }, { "docid": "2a5280a9bf1aa4e2c430fda840360283", "score": "0.486794", "text": "function iterateFromLeaves(f) {\n function optimizeNextFromLeaves(node) {\n if (node instanceof SourceNode) {\n return;\n }\n var next = node.parent;\n if (f(node)) {\n optimizeNextFromLeaves(next);\n }\n }\n return optimizeNextFromLeaves;\n }", "title": "" }, { "docid": "7d90b7a511e65f638b92c927c833887a", "score": "0.48302394", "text": "function startPathSearch()\n {\n\n\n var nodes = Graph.instance.nodes.values();\n \n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n //init preflow from source node\n n.state.predecessor = null;\n }\n \n state.expanding = true;\n state.search_queue = [state.sourceId];\n var source = Graph.instance.nodes.get(state.sourceId);\n source.state.predecessor = {};\n\n logger.log(\"Initialised path search \");\n \n checkPathFound();\n //state.current_step = STEP_CHECKPATHFOUND;\n }", "title": "" }, { "docid": "a461163baab1ee24f12d87a5fb909ffa", "score": "0.48249108", "text": "prewalkStatements(statements) {\n for(let index = 0, len = statements.length; index < len; index++) {\n const statement = statements[index];\n this.prewalkStatement(statement);\n }\n }", "title": "" }, { "docid": "922bfad62dc827b66901be1808d103ff", "score": "0.48080078", "text": "function getParentConditionalPath(path) {\n var parentPath;\n while (parentPath = path.parentPath) {\n if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {\n if (path.key === \"test\") {\n return;\n } else {\n return parentPath;\n }\n } else {\n path = parentPath;\n }\n }\n}", "title": "" }, { "docid": "69d435bbdcdd1cc91c897dcc4697614e", "score": "0.48058984", "text": "function velocity_case(startPoints, objectBag, profile, path_length, jumps) {\n let path_dat = [];\n let profile_index = [];\n let dir_index = [];\n let status = [];\n let objectUpdate = [];\n let tmp_profile_index;\n let tmp_dir_index;\n let tmp_path_dat = [];\n for (let i = 0; i < jumps; i++) {\n if (i == 0) {\n profile_index = checkPos(objectBag, startPoints);\n status = checkStatus(profile_index);\n dir_index = RandDir_Pos(profile_index, status[i]);\n path_dat = object_path(profile, profile_index, dir_index);\n } else {\n if (i == 1 && !checkInside(i, before_critical_index)) {\n objectUpdate = newStartPoints(profile, profile_index, dir_index, path_length);\n objectBag = combineArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = combineArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = RandDir_Pos(tmp_profile_index, status[i]);\n dir_index = combineArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else if (i == 1 && checkInside(i, before_critical_index)) {\n objectUpdate = newStartPoints(profile, profile_index, dir_index, path_length);\n objectBag = combineArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = combineArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = transferOpp(tmp_profile_index, status[i]);\n dir_index = combineArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else if (checkInside(i, before_critical_index) && !checkInside(i, critical_idx)) {\n objectUpdate = newStartPoints(profile, tmp_profile_index, tmp_dir_index, path_length);\n objectBag = addArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints);\n profile_index = addArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = transferOpp(tmp_profile_index, status[i]);\n dir_index = addArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else if (checkInside(i, critical_idx)) {\n objectUpdate = newStartPoints(profile, tmp_profile_index, tmp_dir_index, path_length);\n objectBag = addArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = addArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = velocity_crit(tmp_profile_index);\n dir_index = addArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n } else {\n objectUpdate = newStartPoints(profile, tmp_profile_index, tmp_dir_index, path_length);\n objectBag = addArray(objectBag, objectUpdate);\n tmp_profile_index = checkPos(objectUpdate, startPoints)\n profile_index = addArray(profile_index, tmp_profile_index);\n status = status.concat(checkStatus(tmp_profile_index));\n tmp_dir_index = RandDir_Pos(tmp_profile_index, status[i]);\n dir_index = addArray(dir_index, tmp_dir_index);\n tmp_path_dat = object_path(profile, tmp_profile_index, tmp_dir_index);\n path_dat = concatArr(path_dat, tmp_path_dat);\n }\n }\n }\n console.log(profile_index)\n console.log(objectBag)\n\n return {\n objectBag: objectBag,\n profile_index: profile_index,\n status: status,\n dir_index: dir_index,\n path_coordinates: path_dat\n };\n}", "title": "" }, { "docid": "505ae547fec9046a823947f266cf097e", "score": "0.47915593", "text": "function paths(data, ctx) {\n ctx.clearRect(-1, -1, w() + 2, h() + 2);\n ctx.beginPath();\n data.forEach(function (d) {\n if ((__.bundleDimension !== null && __.bundlingStrength > 0) || __.smoothness > 0) {\n single_curve(d, ctx);\n } else {\n single_path(d, ctx);\n }\n });\n ctx.stroke();\n }", "title": "" }, { "docid": "66d378f5cfeaffd18c65a4ac8329bc90", "score": "0.47910592", "text": "function crawl(path) {\n if (path.is(\"_templateLiteralProduced\")) {\n crawl(path.get(\"left\"));\n crawl(path.get(\"right\"));\n } else if (!path.isBaseType(\"string\") && !path.isBaseType(\"number\")) {\n path.replaceWith(t.callExpression(t.identifier(\"String\"), [path.node]));\n }\n}", "title": "" }, { "docid": "734d8b2707713bb89ea3e0a22f1151b9", "score": "0.47858673", "text": "destCity(paths) {\n // A Map keeps the order that it is inserted,\n // So like an object mixed with an array;\n // @ts-ignore\n const path = new Map(paths);\n // the possibilites have to be the second part of the pair as\n // the first represents the starting points and the second the\n // ending points\n for (const [, city] of path)\n if (!path.has(city))\n return city;\n }", "title": "" }, { "docid": "2d885f0a28d139ec75d29405153da016", "score": "0.4776686", "text": "checkLongestRoad(player){\n //Recursive search function\n \n let continuousRoad = function(settlers_self, currentPath, availableRoads){\n let best = currentPath;\n if (availableRoads.length == 0)\n return best;\n \n let returnedBest, cityCheck, potTemp, verts = [];\n //Look in both directions\n if (currentPath.length === 1)\n verts = settlers_self.hexgrid.verticesFromEdge(currentPath[0]);\n else verts.push(settlers_self.hexgrid.directedEdge(currentPath[currentPath.length-2],currentPath[currentPath.length-1]));\n\n for (let v of verts){\n cityCheck = settlers_self.isCityAt(v);\n if (cityCheck == player || cityCheck == 0){\n potTemp = settlers_self.hexgrid.edgesFromVertex(v);\n for (let potRoad of potTemp){\n if (availableRoads.includes(potRoad)){\n let newPath = currentPath.concat(potRoad);\n let remainder = [...availableRoads];\n remainder.splice(remainder.indexOf(potRoad),1);\n returnedBest = continuousRoad(settlers_self,newPath,remainder);\n if (returnedBest.length > best.length)\n best = returnedBest;\n }\n }\n }\n }\n return best;\n }\n\n\n //Determine which roads belong to player\n let playerSegments = [];\n for (let road of this.game.state.roads){\n if (road.player == player)\n playerSegments.push(road.slot.replace(\"road_\",\"\"));\n }\n //Starting with each, find maximal continguous path\n let longest = [];\n //console.log(`Player ${player}: ${playerSegments}`);\n for (let i =0; i < playerSegments.length; i++){\n let remainder = [...playerSegments];\n remainder.splice(i,1);\n let bestPath = continuousRoad(this, Array(playerSegments[i]), remainder);\n if (bestPath.length > longest.length)\n longest = bestPath;\n }\n\n //Check if longest path is good enough to claim VP prize\n if (longest.length>=5){\n if (this.game.state.longestRoad.player > 0){ //Someone already has it\n if (longest.length > this.game.state.longestRoad.size){\n if (this.game.state.longestRoad.player != player){ //Only care if a diffeent player\n this.highlightRoad(player, longest, `claimed the ${this.skin.longest.name} from Player ${this.game.state.longestRoad.player} with ${longest.length} segments!`);\n this.game.state.longestRoad.player = player;\n this.game.state.longestRoad.size = longest.length;\n }else{ //Increase size\n this.game.state.longestRoad.size = longest.length;\n this.updateLog(`Player ${player} extended the ${this.skin.longest.name} to ${longest.length} segments.`);\n }\n }\n }else{ //Open to claim\n this.highlightRoad(player, longest, `claimed the ${this.skin.longest.name} with ${longest.length} segments.`);\n this.game.state.longestRoad.player = player;\n this.game.state.longestRoad.size = longest.length;\n } \n }\n }", "title": "" }, { "docid": "1632b8800d7c6119304c416e305757fc", "score": "0.4775308", "text": "easyPath() {\r\n let availablePath = [];\r\n\r\n this.tiles.sort((a, b) => {\r\n if (a.position.y === b.position.y) return a.position.x - b.position.x\r\n return a.position.y - b.position.y\r\n });\r\n\r\n for (let i = 0; i < this.tiles.length - 5; i++) {\r\n if (this.tiles[i].position.x != 0 &&\r\n this.tiles[i].position.x != this.tilesX - 1 &&\r\n this.tiles[i].position.y != 0 &&\r\n this.tiles[i].position.y != this.tilesY - 1) {\r\n if (\r\n (this.tiles[i].position.y === this.tiles[i + 1].position.y &&\r\n this.tiles[i].position.y === this.tiles[i + 2].position.y &&\r\n this.tiles[i].position.y === this.tiles[i + 3].position.y &&\r\n this.tiles[i].position.y === this.tiles[i + 4].position.y) &&\r\n\r\n (this.tiles[i + 4].position.x - this.tiles[i + 3].position.x === 1 &&\r\n this.tiles[i + 3].position.x - this.tiles[i + 2].position.x === 1 &&\r\n this.tiles[i + 2].position.x - this.tiles[i + 1].position.x === 1 &&\r\n this.tiles[i + 1].position.x - this.tiles[i].position.x === 1)\r\n ) {\r\n availablePath.push(i + 2);\r\n i += 5;\r\n }\r\n }\r\n }\r\n\r\n availablePath.sort(() => {\r\n return 0.5 - Math.random();\r\n });\r\n\r\n // ======= Replace wall tiles with grass if no wall up & down, remove wall tiles from array, push grass in array\r\n\r\n let nrTiles = 0,\r\n saveTiles = [];\r\n for (let i = 1; i < availablePath.length; i++) {\r\n\r\n const tilePosition = this.tiles[availablePath[i]].position;\r\n if (this.getTileMaterial({\r\n x: tilePosition.x,\r\n y: tilePosition.y - 1\r\n }) === 'grass' &&\r\n this.getTileMaterial({\r\n x: tilePosition.x,\r\n y: tilePosition.y + 1\r\n }) === 'grass' &&\r\n nrTiles < 15) {\r\n nrTiles++;\r\n saveTiles.push(availablePath[i]);\r\n const tile = new Tile('grass', {\r\n x: tilePosition.x,\r\n y: tilePosition.y\r\n });\r\n this.stage.addChild(tile.bmp);\r\n this.grassTiles.push(tile);\r\n }\r\n }\r\n\r\n saveTiles.sort((a, b) => {\r\n return a - b;\r\n });\r\n for (let i = 0; i < saveTiles.length; i++) {\r\n this.tiles.splice(saveTiles[i], 1);\r\n for (let i = 0; i < saveTiles.length; i++) {\r\n saveTiles[i]--;\r\n }\r\n }\r\n\r\n // if exist, remove the wall from the entrance of the princess tower\r\n if (this.getTileMaterial({\r\n x: this.tilesX - 2,\r\n y: 10\r\n }) === \"wall\") {\r\n this.removeTile({\r\n x: this.tilesX - 2,\r\n y: 10\r\n });\r\n const tile = new Tile('grass', {\r\n x: this.tilesX - 2,\r\n y: 10\r\n });\r\n this.stage.addChild(tile.bmp);\r\n this.grassTiles.push(tile);\r\n }\r\n }", "title": "" }, { "docid": "13b5b8dc4993a4a1d31c36000931a8c9", "score": "0.47742304", "text": "function iterateFromLeaves(f) {\n function optimizeNextFromLeaves(node) {\n if (node instanceof source_1.SourceNode) {\n return;\n }\n var next = node.parent;\n if (f(node)) {\n optimizeNextFromLeaves(next);\n }\n }\n return optimizeNextFromLeaves;\n}", "title": "" }, { "docid": "6cf610a7e06768b8f68bee638e66ec41", "score": "0.47710943", "text": "function reconstructPath(cameFrom, current)\n{\n let total_path=new Array();\n let path = new Array();\n let temp;\n let man = true;\n\n while (cameFrom.has(current)){\n temp = cameFrom.get(current);\n total_path.unshift(temp);\n total_path[0].type = 5;\n current = temp;\n }\n for (let k of cameFrom.keys()){\n if( !total_path.includes(k)){\n path.push(k);\n }\n }\n path = [...path,...total_path];\n for (let m = path.length-1; m >= 0; m-- ){\n if( man && path[m].isShortestPath()){\n continue;\n }else if (man || path[m].isShortestPath()){\n man = false;\n path[m].type = 4;\n }\n }\n return path;\n}", "title": "" }, { "docid": "5e2c52d79c3940fa8f3e50c28899659f", "score": "0.47703236", "text": "function optimize (root, options) {\n if (!root) { return }\n isStaticKey = genStaticKeysCached(options.staticKeys || '');\n isPlatformReservedTag = options.isReservedTag || no;\n // first pass: mark all non-static nodes.\n markStatic$1(root);\n // second pass: mark static roots.\n markStaticRoots(root, false);\n }", "title": "" }, { "docid": "5e2c52d79c3940fa8f3e50c28899659f", "score": "0.47703236", "text": "function optimize (root, options) {\n if (!root) { return }\n isStaticKey = genStaticKeysCached(options.staticKeys || '');\n isPlatformReservedTag = options.isReservedTag || no;\n // first pass: mark all non-static nodes.\n markStatic$1(root);\n // second pass: mark static roots.\n markStaticRoots(root, false);\n }", "title": "" }, { "docid": "5e2c52d79c3940fa8f3e50c28899659f", "score": "0.47703236", "text": "function optimize (root, options) {\n if (!root) { return }\n isStaticKey = genStaticKeysCached(options.staticKeys || '');\n isPlatformReservedTag = options.isReservedTag || no;\n // first pass: mark all non-static nodes.\n markStatic$1(root);\n // second pass: mark static roots.\n markStaticRoots(root, false);\n }", "title": "" }, { "docid": "5e2c52d79c3940fa8f3e50c28899659f", "score": "0.47703236", "text": "function optimize (root, options) {\n if (!root) { return }\n isStaticKey = genStaticKeysCached(options.staticKeys || '');\n isPlatformReservedTag = options.isReservedTag || no;\n // first pass: mark all non-static nodes.\n markStatic$1(root);\n // second pass: mark static roots.\n markStaticRoots(root, false);\n }", "title": "" }, { "docid": "0ed45c684cb1d7bbf5af80133e49dd5c", "score": "0.47683173", "text": "async function BFS(src,dst){\r\n \r\n //Code snippets below: O(1)\r\n const visited = new Map();\r\n const parents = new Map();\r\n\r\n var q = new Queue2();\r\n\r\n //Code snippets below: vary, assume map functions are constant in best case\r\n // and O(n) in average and worst\r\n q.push(src);\r\n visited.set(src,true);\r\n\r\n\r\n let whilecont = true;\r\n\r\n //while loop breaks when we find path or we exhaust articles\r\n ////While loop potentially loops through all articles in queue O(n)\r\n while (whilecont){\r\n\r\n //complexity O(1)\r\n let u = q.front();\r\n q.pop();\r\n if (q.isEmpty()){\r\n whilecont = false;\r\n }\r\n\r\n let adj = [];\r\n //complexity O(l)\r\n adj = await wikipediaAPI.getLinks(u);\r\n let size = adj.length;\r\n\r\n //looking through links, O(l * inside)\r\n for (let i = 0; i < size; i++)\r\n {\r\n //everything in the if cases has O(1) complexity in best case\r\n //and O(n) in worst case as per the look ups\r\n //O(n) time will be used in most cases, as O(n) is present when pages don't exist, and we are always adding new pages\r\n //and usually pages link to many more new pages\r\n let page = adj[i];\r\n if (page.toLowerCase() == dst.toLowerCase()){\r\n dst = page;\r\n parents.set(dst, u);\r\n whilecont = false;\r\n visited.set(dst, true);\r\n break;\r\n }\r\n else if (!visited.has(page)) {\r\n q.push(page);\r\n visited.set(page,true);\r\n }\r\n\r\n if (!parents.has(page)){\r\n parents.set(page, u);\r\n }\r\n }\r\n }\r\n \r\n //path could be total articles, but since we look\r\n //specifically for shortestpath => path <<< n pages\r\n // all below are O(1) through reduction\r\n let path = [];\r\n path.push(dst);\r\n let parent = parents.get(dst);\r\n\r\n while (parent != src || parent == undefined){\r\n path.push(parent);\r\n parent = parents.get(parent);\r\n }\r\n\r\n path.push(src); \r\n\r\n return path.reverse();\r\n}", "title": "" }, { "docid": "dfbee42033a5061996426857d7500ce7", "score": "0.47664863", "text": "traversal(source, destination, path, feasibleRoutes, cost, conditions){\n //find the neighbours and continue traversing from that node, keep exploring\n let neighbours = this.getAdjacentVertices(source);\n if(neighbours.length >= 1){\n if(conditions.maxStop && path.length <= conditions.maxStop){\n for (let i in neighbours) {\n let getElem = neighbours[i].vertex;\n this.dfs(getElem, destination, path, feasibleRoutes, cost, conditions);\n }\n }\n }\n }", "title": "" } ]
800a30b35e232b1362bb9a3ff863ab45
Get a random integer between lo and hi, inclusive. Assumes lo and hi are integers and lo is lower than hi.
[ { "docid": "48b2ee76c43f41fdd995f9536cb81acb", "score": "0.8318819", "text": "function getRandBetween(lo, hi) {\n return parseInt(Math.floor(Math.random()*(hi-lo+1))+lo, 10);\n}", "title": "" } ]
[ { "docid": "e91ddb42bfd515bcb83764991c3baf27", "score": "0.85242003", "text": "function rInt(lo, hi) {\n return Math.floor(Math.random() * (hi - lo) + lo);\n}", "title": "" }, { "docid": "ba442e6410753be89479e89ceda8df43", "score": "0.84343207", "text": "function getRandBetween(lo, hi) {\n\treturn parseInt(Math.floor(Math.random() * (hi - lo + 1)) + lo, 10);\n}", "title": "" }, { "docid": "996a32fd2cef74da3d45480680cdd6f9", "score": "0.8120749", "text": "function randomInteger(low, high) {\n return Math.floor(Math.random() * (high - low) + low)\n}", "title": "" }, { "docid": "6b37bc0b6ffa7d09d295b6bb3fa7a219", "score": "0.8100714", "text": "function randomInRange(lo, hi) {\n return Math.floor(((random()) * (hi - lo))) + lo;\n}", "title": "" }, { "docid": "d7b68dfc33a776eedd93ef30e5693af9", "score": "0.8050167", "text": "function randomInteger(low, high)\n{\n return low + Math.floor(Math.random() * (high - low));\n}", "title": "" }, { "docid": "55b110ac195de37f98859163442728bf", "score": "0.80395085", "text": "function rInt(lo, hi) {\n if (!hi) {\n hi = lo;\n lo = 0;\n }\n else if (!lo) {\n hi = 2;\n lo = 0;\n }\n return Math.random() * (hi - lo) + lo | 0;\n} // end rInt", "title": "" }, { "docid": "6c9fdaf3b0e74e2be2deba614944f2f3", "score": "0.80315864", "text": "function get_random_int(low, high) {\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "baa9c9c810a543ff7a0f5c88cae72ce1", "score": "0.8016891", "text": "function random(low, hi) {\n return Math.floor(Math.random() * (hi - low + 1) + low);\n}", "title": "" }, { "docid": "8a9cbe4ca9597b5cb391e6cfee5d08e2", "score": "0.79146755", "text": "function randomInt(low, high) {\n return Math.floor(Math.random() * (high - low) + low)\n}", "title": "" }, { "docid": "cfd398a435137931fea351cd6cbad978", "score": "0.7898545", "text": "function randomInt(low, high) {\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "cfd398a435137931fea351cd6cbad978", "score": "0.7898545", "text": "function randomInt(low, high) {\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "43875010167a72e4a9ed809b17ac81c2", "score": "0.78890926", "text": "function getRandomInt(low, high) {\n return Math.floor(Math.random() * (high - low + 1)) + low;\t\n}", "title": "" }, { "docid": "eef084470db9c16bce9cb793dbab2c26", "score": "0.78717935", "text": "function randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}", "title": "" }, { "docid": "eef084470db9c16bce9cb793dbab2c26", "score": "0.78717935", "text": "function randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}", "title": "" }, { "docid": "eef084470db9c16bce9cb793dbab2c26", "score": "0.78717935", "text": "function randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}", "title": "" }, { "docid": "1a2d1e61ca1aeee4fb44be16b81a45ad", "score": "0.78677684", "text": "function randomInt(low, high) {\r\n return Math.floor(Math.random() * (high - low) + low);\r\n}", "title": "" }, { "docid": "30e6e2d5e2242f9f139f3f4d57aea6c7", "score": "0.784755", "text": "function randomInt (low, high) {\n\treturn Math.floor(Math.random() * (high - low + 1) + low);\n}", "title": "" }, { "docid": "78269f4678b710aa23ffed6c58a25e0a", "score": "0.7847513", "text": "function randomInt(low, high) {\n return Math.floor(Math.random() * (high - low + 1) + low);\n}", "title": "" }, { "docid": "78269f4678b710aa23ffed6c58a25e0a", "score": "0.7847513", "text": "function randomInt(low, high) {\n return Math.floor(Math.random() * (high - low + 1) + low);\n}", "title": "" }, { "docid": "77e000ebac40b937197eafbea7d83e46", "score": "0.78203106", "text": "function randomInt(low, high) {\n\treturn Math.floor(Math.random() * (high - low + 1) + low)\n}", "title": "" }, { "docid": "fb8615a24ce7a9d1e9a8b99713b3da10", "score": "0.77889305", "text": "function randomInt(low, high){\n\tif (low >= high) low = 0;\n\treturn Math.floor(Math.random() * (1+high-low)) + low; \n}", "title": "" }, { "docid": "c8b76f5dffce7e240a4de01951d9b694", "score": "0.77598834", "text": "function randomInteger(low, high){\n\t//returns a random integer in the range [low, high] inclusive.\n\treturn low + Math.floor((high-low+1)*Math.random()); //note the floor part generates a random from 0 to high-low.\n\t\n}", "title": "" }, { "docid": "10f03248f8c04722eb46f2a55f5bee0d", "score": "0.77500945", "text": "function randInt( low, high ) {\n\n\t\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n\t}", "title": "" }, { "docid": "5d3f4fd49e3a05def61d626230ac3ab6", "score": "0.7741091", "text": "returnRandNum (low, high) {\n const range = high - low + 1\n return Math.floor(Math.random() * range) + low\n }", "title": "" }, { "docid": "a537b586143a4a0ff55412b6bac78456", "score": "0.7696122", "text": "randInt(low, high) {\n if (high === undefined) {\n high = low;\n low = 0;\n }\n return low + Math.floor(this.randomGenerator() * (high - low));\n }", "title": "" }, { "docid": "a537b586143a4a0ff55412b6bac78456", "score": "0.7696122", "text": "randInt(low, high) {\n if (high === undefined) {\n high = low;\n low = 0;\n }\n return low + Math.floor(this.randomGenerator() * (high - low));\n }", "title": "" }, { "docid": "313b561551539e6ca89434bde956f934", "score": "0.75503504", "text": "function randominrange(low,high) {return Math.round(Math.random()*(high-low)+low);}", "title": "" }, { "docid": "34d404503c49ead7ed43ecd9f917a8d7", "score": "0.75262785", "text": "function randInt(lower, upper) {\n return Math.floor(Math.random() * (upper - lower)) + lower;\n}", "title": "" }, { "docid": "a8b18cc4096497bf6141a0ed5862cdc5", "score": "0.747619", "text": "function getRandom(low,high) {\n return Math.floor(Math.random() * (high - low) + low);\n}", "title": "" }, { "docid": "f4d633195fe54a13fb9dceefde2d7501", "score": "0.74663585", "text": "function RandomNum(low, high) \n{ \n return Math.random()*(high-low) + low; \n}", "title": "" }, { "docid": "cab75cddc9629f5ba2fef1ccf74031c1", "score": "0.7462643", "text": "function _iRandom (low, high) \n{\n var rc;\n \n rc = Math.floor(Math.random() * (high - low) + low);\n \n return rc;\n}", "title": "" }, { "docid": "7e0717db34789d5b0853aee5b4f06f25", "score": "0.7428773", "text": "function random(low, high){\n return Math.floor(Math.random() * (high - low + 1) ) + low;\n}", "title": "" }, { "docid": "1d742ab3e86d7028ffd03407372cffb7", "score": "0.7375685", "text": "function randomInt(lb, ub){\n return Math.floor((Math.random() * (ub - lb)) + lb)\n}", "title": "" }, { "docid": "bee7c14814e636c44e8ae71b2604f4e9", "score": "0.7372108", "text": "function Randrange(low, high, int) {\n\n\tvar rand = Math.random();\n\tvar range = high - low;\n\n\tvar gen = (rand * range) + low;\n\n\tif (int) {\n\n\t\treturn Math.floor(gen);\n\n\t} else {\n\n\t\treturn gen;\n\n\t}\n\n\n}", "title": "" }, { "docid": "addf7242304b9e896aba6cfcde89d4ab", "score": "0.7366351", "text": "function random(low, high) {\n return Math.floor(Math.random() * (high - low) + low);\n }", "title": "" }, { "docid": "716e31c836b49339ec1b3e48c6408925", "score": "0.73520356", "text": "function random( low, high )\n{\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n}", "title": "" }, { "docid": "c09b28f3e2e7ed9c74423787aa01f29c", "score": "0.73060066", "text": "function randomIntInRange(from, to) {\n return floor(rnd() * (to - from - 1)) + from;\n }", "title": "" }, { "docid": "7a98c226a4f2ace1894aa64aed2210c8", "score": "0.72965074", "text": "function generateInRangeInteger(min,max){\n\treturn parseInt(String((Math.random()*(max-min) + min)));\n}", "title": "" }, { "docid": "c7afaafa7332a177eb761ff101e266e6", "score": "0.7292245", "text": "function rangedRandomInteger (lowerLimit, upperLimit){\n var min = Math.ceil(lowerLimit);\n var max = Math.floor(upperLimit);\n var result = Math.floor(Math.random() * (max-min))+min;\n// console.log(result); //used this to debug this function.\n// I could get rid of result variable and just return the value\n return result;\n}", "title": "" }, { "docid": "9e0345512cad5cdd501f8d52efe32120", "score": "0.7292173", "text": "function get_random_integer(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "8fb9e370c63ce364d6f568224d593eb2", "score": "0.7256978", "text": "function getRandomInteger(min, max)\n{\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "b2c790ec457b4bab8802c6dee8956f3e", "score": "0.72558755", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min\n }", "title": "" }, { "docid": "87d257bd1d6e7b2d6dcb50567e97793b", "score": "0.7254465", "text": "function getRandomNumber(lower, upper)\n{\n return Math.floor((Math.random() * (upper - lower)) + lower);\n}", "title": "" }, { "docid": "5ff57870d8249443192d67b56029dfa7", "score": "0.7252583", "text": "function getInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "81839f8969b357b12eee9b87cdf27c8d", "score": "0.7251199", "text": "function randRange(low, high) {\n return Math.floor(low + Math.random()*(high-low+1));\n}", "title": "" }, { "docid": "44a919e0ca6ca1d627eae0408e376ff8", "score": "0.72495914", "text": "function randomIntBetween(lower, upper) {\r\n\treturn Math.floor(Math.random() * (upper - lower)) + lower;\r\n}", "title": "" }, { "docid": "4faebdc6c156f6845735d7646cda92fd", "score": "0.72476906", "text": "function generateRandom(low, high) {\n\treturn Math.floor(Math.random() * high) + low; \n}", "title": "" }, { "docid": "13fbb9539dd486e1161755ac179fbf21", "score": "0.72264946", "text": "function getRandomInteger(min, max) {\n\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min);\n\n}", "title": "" }, { "docid": "8362b287837de45d1567a5ab3f471811", "score": "0.7221603", "text": "function randRange(low, high) {\r\n return Math.floor(low + Math.random()*(high-low+1));\r\n }", "title": "" }, { "docid": "d247bcda3763fab12938c7a4ae5f3c30", "score": "0.7217249", "text": "function getRndInteger(min, max)\n{\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "title": "" }, { "docid": "c9e26e6f413309dc567968b9bb0218cb", "score": "0.72113353", "text": "function rand(low, high) {\n\treturn Math.random() * (high+1-low) + low;\n}", "title": "" }, { "docid": "1404efcd5076a94cd992e9ae080635d1", "score": "0.7204179", "text": "getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "abe4ea8e050b6dc80deaed16b3360b2b", "score": "0.72024953", "text": "randomInteger(min, max) { \n return Math.floor(min + Math.random() * (max + 1 - min));\n }", "title": "" }, { "docid": "a23db5f407ba2b82333f3639b7190a11", "score": "0.72007424", "text": "function intFromRange(beg, end){\n\treturn Math.floor((Math.random() * (end - beg))) + beg;\n}", "title": "" }, { "docid": "b34ecc1ecf63d4ea8abf19318f452aea", "score": "0.7198296", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "9a31db929ff4a3100d0864d37adf8b9a", "score": "0.71914876", "text": "function randomInteger(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "6103d971784eb7a152e1367bb3f273cc", "score": "0.71910405", "text": "function randInt(a, b) {\n return Math.floor(rng(a, b + 1))\n}", "title": "" }, { "docid": "6aed78e9f8f1488c35a38539cf0fa1d3", "score": "0.7188953", "text": "function randInt(start, end) {\n return Math.floor( ( Math.random() * end ) + start );\n}", "title": "" }, { "docid": "ac842feaa5d4f206dab6acf13217ef17", "score": "0.7187744", "text": "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "8d15925ff8533415ee0468cd603d9105", "score": "0.7185956", "text": "function intInRange(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "ad32fdc56c05e97fcde49934ca08fb1e", "score": "0.7184949", "text": "function getRandomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "title": "" }, { "docid": "ad32fdc56c05e97fcde49934ca08fb1e", "score": "0.7184949", "text": "function getRandomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "title": "" }, { "docid": "27f56a6148b54d1a829a28614200a707", "score": "0.71818113", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "27f56a6148b54d1a829a28614200a707", "score": "0.71818113", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "27f56a6148b54d1a829a28614200a707", "score": "0.71818113", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "b5faf82e3edbf83aa22d8f3126402fff", "score": "0.71808255", "text": "function _getRandomIntInclusive(min, max) {\r\n min = Math.ceil(min);\r\n max = Math.floor(max);\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "title": "" }, { "docid": "662c8ab120478bf224a75955de0f7e4a", "score": "0.7180808", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min\n}", "title": "" }, { "docid": "9ac4a561a2a808ca421c9a9ac16f1569", "score": "0.717809", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "b9a34976d32f8bb39d7653dad7780b07", "score": "0.71731466", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "11f7cbcec85a4ababa004be32556baa6", "score": "0.7171986", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n}", "title": "" }, { "docid": "e1981c40460e7ffb97165599645a9fbf", "score": "0.7170503", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "98401010579d1498c868619c5ec1f14e", "score": "0.71697855", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; \n //The maximum is inclusive and the minimum is inclusive \n}///////math.random////////", "title": "" }, { "docid": "55fe7eac0cc9541f183d997303b99741", "score": "0.7169655", "text": "function getRandInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "9e4ef0b8d73b7f21a70b9300407be083", "score": "0.71686846", "text": "function randomInt (range) {\n return Math.floor(Math.random() * range)\n}", "title": "" }, { "docid": "65b31c2a71ece5f5bba99de95264bb74", "score": "0.7165522", "text": "function randint(min, max) {\n let r = Math.random();\n return Math.round( lerp(r, min, max) );\n}", "title": "" }, { "docid": "315ee33d6a78d136a9a3e86fd6f7313b", "score": "0.71631247", "text": "static RandomInteger(min, max)\n\t{\n\n\t\treturn Math.floor(MathLibrary.RandomFloat(min, max));\n\n\t}", "title": "" }, { "docid": "480c2353f9b2b791819c60db4c7ffde7", "score": "0.71618515", "text": "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "8c6cf8bcb932286850af2cb626b4386e", "score": "0.7161782", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n}", "title": "" }, { "docid": "8a2b4fa5c8431c27a2227d9dba872b2d", "score": "0.7159773", "text": "function ranGen(low, high) {\n return low + Math.floor(Math.random() * (high - low + 1));\n}", "title": "" }, { "docid": "c07401b4b7266236d7f81bc82ec53a18", "score": "0.7159376", "text": "getRandInteger(min, max) \r\n { return Math.floor(Math.random() * (max - min + 1) ) + min; }", "title": "" }, { "docid": "2dba033e28b0509c10f4f0d8658f11f1", "score": "0.71589", "text": "function int (min, max) {\n if (typeof min === 'number' && typeof max === 'number') {\n return Math.floor(generator.random() * (max - min + 1)) + min;\n }\n else {\n return undefined;\n }\n}", "title": "" }, { "docid": "610c2edbde45186a4190f016656c164f", "score": "0.71569884", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive\n }", "title": "" }, { "docid": "59135beeb49d21b8b6d5c0887f53ea3b", "score": "0.71517646", "text": "function getRandomInteger(min, max) {\n\treturn min + Math.floor(Math.random() * (max - min) );\n}", "title": "" }, { "docid": "8ccb3747a5314b47c38da2e3e699a433", "score": "0.7151289", "text": "function getRandomInt(min, max) {\n min = FastMath.ceil(min);\n max = FastMath.floor(max);\n return (FastMath.floor(Math.random() * (max - min))) + min;\n }", "title": "" }, { "docid": "bacc6e9da3615c47e571ca48d685e797", "score": "0.7150474", "text": "function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }", "title": "" }, { "docid": "a3f2136d866f4daf03f86da154703e3f", "score": "0.7149684", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n }", "title": "" }, { "docid": "d2fdef1d31b98700b2fd645a787aa6f9", "score": "0.7147076", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "246fcbc287bc9d0ff6702ba8b8e0ae59", "score": "0.7147005", "text": "function GetRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "f3e6e1ffe21535b72927c365ff70f3e3", "score": "0.7145292", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n }", "title": "" }, { "docid": "67c3890bb77cd13d776d8f4fc3b10020", "score": "0.7141533", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "fb3f42ed3f264b1431e9597b73ba18be", "score": "0.7141346", "text": "function GetRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "fb3f42ed3f264b1431e9597b73ba18be", "score": "0.7141346", "text": "function GetRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "59dfb59e54633c5fa4dbcc18a355170d", "score": "0.7133153", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "59dfb59e54633c5fa4dbcc18a355170d", "score": "0.7133153", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "59dfb59e54633c5fa4dbcc18a355170d", "score": "0.7133153", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "59dfb59e54633c5fa4dbcc18a355170d", "score": "0.7133153", "text": "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "6f46c5fc442dfc6847f26baa1e682ea3", "score": "0.7130235", "text": "function getRndInteger(min, max) {\n\treturn Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "21885366e220fc6145161f1ae0746f6b", "score": "0.7129502", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "21885366e220fc6145161f1ae0746f6b", "score": "0.7129502", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" } ]
7db85acd4211fbaa02cf7c70feb2b986
functions to walk an OpenAPI schema object and traverse all subschemas calling a callback function on each one obtains the default starting state for the `state` object used by walkSchema
[ { "docid": "cd0daf6a8ac533f78cf25553ef512187", "score": "0.0", "text": "function getDefaultState() {\n return { depth: 0, seen: new WeakMap(), top: true, combine: false, allowRefSiblings: false };\n}", "title": "" } ]
[ { "docid": "5b44871f874723a5ea536fc58120c605", "score": "0.70393395", "text": "function walkSchema(schema, parent, state, callback) {\n\n if (typeof state.depth === 'undefined') state = getDefaultState();\n if ((schema === null) || (typeof schema === 'undefined')) return schema;\n if (typeof schema.$ref !== 'undefined') {\n let temp = {$ref:schema.$ref};\n if (state.allowRefSiblings && schema.description) {\n temp.description = schema.description;\n }\n callback(temp,parent,state);\n return temp; // all other properties SHALL be ignored\n }\n\n if (state.combine) {\n if (schema.allOf && Array.isArray(schema.allOf) && schema.allOf.length === 1) {\n schema = Object.assign({},schema.allOf[0],schema);\n delete schema.allOf;\n }\n if (schema.anyOf && Array.isArray(schema.anyOf) && schema.anyOf.length === 1) {\n schema = Object.assign({},schema.anyOf[0],schema);\n delete schema.anyOf;\n }\n if (schema.oneOf && Array.isArray(schema.oneOf) && schema.oneOf.length === 1) {\n schema = Object.assign({},schema.oneOf[0],schema);\n delete schema.oneOf;\n }\n }\n\n callback(schema,parent,state);\n if (state.seen.has(schema)) {\n return schema;\n }\n //else\n if ((typeof schema === 'object') && (schema !== null)) state.seen.set(schema,true);\n state.top = false;\n state.depth++;\n\n if (typeof schema.items !== 'undefined') {\n state.property = 'items';\n walkSchema(schema.items,schema,state,callback);\n }\n if (schema.additionalItems) {\n if (typeof schema.additionalItems === 'object') {\n state.property = 'additionalItems';\n walkSchema(schema.additionalItems,schema,state,callback);\n }\n }\n if (schema.additionalProperties) {\n if (typeof schema.additionalProperties === 'object') {\n state.property = 'additionalProperties';\n walkSchema(schema.additionalProperties,schema,state,callback);\n }\n }\n if (schema.properties) {\n for (let prop in schema.properties) {\n let subSchema = schema.properties[prop];\n state.property = 'properties/'+prop;\n walkSchema(subSchema,schema,state,callback);\n }\n }\n if (schema.patternProperties) {\n for (let prop in schema.patternProperties) {\n let subSchema = schema.patternProperties[prop];\n state.property = 'patternProperties/'+prop;\n walkSchema(subSchema,schema,state,callback);\n }\n }\n if (schema.allOf) {\n for (let index in schema.allOf) {\n let subSchema = schema.allOf[index];\n state.property = 'allOf/'+index;\n walkSchema(subSchema,schema,state,callback);\n }\n }\n if (schema.anyOf) {\n for (let index in schema.anyOf) {\n let subSchema = schema.anyOf[index];\n state.property = 'anyOf/'+index;\n walkSchema(subSchema,schema,state,callback);\n }\n }\n if (schema.oneOf) {\n for (let index in schema.oneOf) {\n let subSchema = schema.oneOf[index];\n state.property = 'oneOf/'+index;\n walkSchema(subSchema,schema,state,callback);\n }\n }\n if (schema.not) {\n state.property = 'not';\n walkSchema(schema.not,schema,state,callback);\n }\n state.depth--;\n return schema;\n}", "title": "" }, { "docid": "ca5c0702e3293340a0ece51190fd80b6", "score": "0.545492", "text": "function processApiDocSchema(schema, options) {\n let walkerVocab = Object.assign(\n {},\n walker.getVocabulary(schema, walker.vocabularies.DRAFT_04_HYPER),\n walker.vocabularies.CLOUDFLARE_DOCA\n );\n\n mergeCfRecurse.mergeCfRecurse(schema, walkerVocab);\n\n let collapseCallback = collapser.getCollapseAllOfCallback(\n schema.$schema || 'http://json-schema.org/draft-04/hyper-schema#',\n collapser.vocabularies.CLOUDFLARE_DOCA\n );\n\n // TODO: In theory, these two could be combined into one walk,\n // as they both only work with subschemas, but in practice\n // that does not work. Need to investigate.\n walker.schemaWalk(\n schema,\n null,\n (...args) => {\n collapseCallback(...args);\n },\n walkerVocab\n );\n walker.schemaWalk(\n schema,\n null,\n (...args) => {\n example.rollUpExamples(...args);\n },\n walkerVocab\n );\n\n // Curl examples need to be run through the walker\n // separately, because they need the root schema\n // to be fully processed by the previous steps,\n // and the walker visits it last.\n let curlCallback = example.getCurlExampleCallback(\n schema,\n (options && options.baseUri) || '',\n (options && options.globalHeaderSchema) || {}\n );\n walker.schemaWalk(schema, null, curlCallback, walkerVocab);\n return schema;\n}", "title": "" }, { "docid": "5044a35ed8e355d9d123561833bcab87", "score": "0.5174307", "text": "getInnerSchema(schema, path) {\n let inner;\n if(schema.schemaType !== 'array') {\n inner = defaultTo(get(schema, path[0]), schema);\n if(inner.schemaType !== 'object' || path.length === 1) {\n return inner;\n }\n\n inner = defaultTo(inner._inner.children.find(x => x.key === path[1]), {schema}).schema;\n\n if(inner.schemaType === 'object' || inner.schemaType === 'array') {\n return this.getInnerSchema(inner, path.slice(1));\n }\n\n return inner;\n }\n\n inner = schema._inner.items[0] && schema._inner.items[0]._inner.children\n ? schema._inner.items[0]._inner.children.find(x => x.key === path[2]).schema\n : schema._inner.items[0];\n\n inner = inner || schema._currentJoi;\n\n if(inner.schemaType !== 'array') {\n if(inner.schemaType === 'object') {\n return this.getInnerSchema(inner, path.slice(2));\n }\n return inner;\n }\n\n return this.getInnerSchema(inner, path.slice(2))\n }", "title": "" }, { "docid": "f5dfb2ba9c6191aa9a5d9fb626d3b57f", "score": "0.514928", "text": "function recursive_load_helper(ns, ajv, schemas, loaded, then) {\n each(schemas, function(schema, cb) {\n var schema_src = locate_aux_schema_source(ns, schema);\n\n fs.stat(schema_src, function(err, stats) {\n if (err) {\n logger.debug('Error examining {}: {}.'.format(schema_src, err));\n cb(err);\n }\n\n if (stats.isDirectory()) {\n logger.warn('Skipping directory: ' + schema_src);\n cb();\n } else {\n var schema_id = path.basename(schema, '.json');\n\n fs.readFile(schema_src, function(err, data) {\n if (err) {\n logger.error(err);\n cb(err);\n }\n\n var schemaJson, reference_ids;\n try {\n schemaJson = JSON.parse(data);\n reference_ids = schema_utils.extractRefNames(schemaJson);\n } catch (e) {\n logger.warn('Unable to extract references from ' + schema_src);\n cb(e);\n }\n\n var reference_schemas = [];\n _.forEach(reference_ids, function(reference_id) {\n var schema_file = reference_id + '.json';\n reference_schemas.push(schema_file);\n });\n\n // Call ourselves and pass along the list of schemas that we have\n // already loaded.\n recursive_load_helper(ns, ajv, reference_schemas, loaded, function(err) {\n if (loaded.hasOwnProperty(schema_id)) {\n logger.debug('Already loaded ' + schema_id);\n cb();\n } else {\n load_aux_schema_into_validator(ajv, schema_src, function() {\n // Make a note that we loaded this one already\n loaded[schema_id] = 1;\n cb();\n });\n }\n });\n });\n }\n });\n },\n function(err) {\n if (err) {\n logger.error('Recursion error. ' + err);\n }\n then(err);\n });\n}", "title": "" }, { "docid": "90c1f9640e5cb854cbbf023532fb9991", "score": "0.5100761", "text": "function getDefaultValues(schema) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\n function prepValues(args) {\n if (Array.isArray(args)) {\n return args.map(function (arg) {\n return _extends({}, arg, { _keyIndex: (0, _getKey2.default)() });\n });\n }\n return args;\n }\n\n function loop(props, fields) {\n var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n Object.keys(props).map(function (key, propIndex) {\n // Check we need to infer some king of default, then set it\n var defaultValue = inferDefault(props[key], context);\n if (defaultValue) {\n // If both default value and the definitions default are arrays, merge each object in the array\n // THis means we can set defaults in the definitions for properties that don't exist in the default source\n if (props[key].default) {\n if (Array.isArray(defaultValue) && props[key].default.length === 1) {\n defaultValue = defaultValue.map(function (value, i) {\n return _extends({ _keyIndex: (0, _getKey2.default)() }, props[key].default[0], value);\n });\n }\n }\n fields[key] = defaultValue;\n } else if (props[key].default) {\n fields[key] = props[key].default;\n }\n // If this property has a default (inferred above or defined in schema), set it in the fields here\n\n if (props[key].type === 'object') {\n var nextFields = fields[key] || {};\n fields[key] = loop(props[key].properties, nextFields, index);\n if (props[key].default) {\n\n fields[key] = (0, _deepmerge2.default)(prepValues(props[key].default), fields[key]);\n }\n } else if (props[key].type === 'array' && props[key].items.type === \"object\") {\n var obj = fields[key] || [];\n obj.map(function (o, i) {\n\n obj[i] = loop(props[key].items.properties, o, i);\n if (props[key].items.default) {\n obj[i] = (0, _deepmerge2.default)(props[key].items.default, obj[i]);\n }\n if (props[key].items.oneOf) {\n props[key].items.oneOf.map(function (oneOf) {\n\n obj[i] = loop(oneOf.properties, obj[i], i);\n });\n }\n });\n\n fields[key] = obj;\n } else if (props[key].default) {\n fields[key] = fields[key] || prepValues(props[key].default);\n }\n if (props[key].oneOf) {\n var _obj = fields[key] || {};\n props[key].oneOf.map(function (o) {\n loop(o.properties, _obj, index);\n });\n fields[key] = _obj;\n }\n });\n return fields;\n }\n\n var fields = {};\n return loop(schema.properties, fields);\n}", "title": "" }, { "docid": "6ca6c4ee5f2ea72051e3600d43908675", "score": "0.5036252", "text": "function traverseSchema(schema, fn, path, ignoreArrays) {\n ignoreArrays = ignoreArrays === undefined ? true : ignoreArrays;\n\n path = path || [];\n\n var traverse = function traverse(schemaObject, processorFunction, pathArray) {\n processorFunction(schemaObject, pathArray);\n if (schemaObject.properties) {\n Object.keys(schemaObject.properties).forEach(function (name) {\n var currentPath = pathArray.slice();\n currentPath.push(name);\n traverse(schemaObject.properties[name], processorFunction, currentPath);\n });\n }\n\n // Only support type \"array\" which have a schemaObject as \"items\".\n if (!ignoreArrays && schemaObject.items) {\n var arrPath = pathArray.slice();arrPath.push('');\n traverse(schemaObject.items, processorFunction, arrPath);\n }\n };\n\n traverse(schema, fn, path || []);\n}", "title": "" }, { "docid": "f91c6c8030c43188a1fbc6b7bdd23588", "score": "0.5020434", "text": "function traverseSchema(schema, fn, path, ignoreArrays) {\r\n ignoreArrays = ignoreArrays === undefined ? true : ignoreArrays;\r\n\r\n path = path || [];\r\n\r\n var traverse = function traverse(schemaObject, processorFunction, pathArray) {\r\n processorFunction(schemaObject, pathArray);\r\n if (schemaObject.properties) {\r\n Object.keys(schemaObject.properties).forEach(function (name) {\r\n var currentPath = pathArray.slice();\r\n currentPath.push(name);\r\n traverse(schemaObject.properties[name], processorFunction, currentPath);\r\n });\r\n }\r\n\r\n // Only support type \"array\" which have a schemaObject as \"items\".\r\n if (!ignoreArrays && schemaObject.items) {\r\n var arrPath = pathArray.slice();arrPath.push('');\r\n traverse(schemaObject.items, processorFunction, arrPath);\r\n }\r\n };\r\n\r\n traverse(schema, fn, path || []);\r\n}", "title": "" }, { "docid": "31f25489164743288ca6fe909862d3b2", "score": "0.49829492", "text": "function derefSchema (schema, options, state, fn) {\n if (typeof state === 'function') {\n fn = state\n state = {}\n }\n\n const check = checkLocalCircular(schema)\n if (check instanceof Error) {\n return fn(check)\n }\n\n if (state.circular) {\n return fn(new Error(`circular references found: ${state.circularRefs.toString()}`), null)\n } else if (state.error) {\n return fn(state.error)\n }\n\n function final (newObject) {\n let error\n if (state.circular) {\n error = new Error(`circular references found: ${state.circularRefs.toString()}`)\n } else if (state.error && options.failOnMissing) {\n error = state.error\n }\n return fn(error, newObject)\n }\n\n const queue = traverse(\n schema,\n function (node, next) {\n const self = this\n if (_.isNull(node) || _.isUndefined(null)) {\n return next()\n }\n\n if (typeof node.$ref !== 'string') {\n return next()\n }\n\n const refType = utils.getRefType(node)\n const refVal = utils.getRefValue(node)\n\n const addOk = addToHistory(state, refType, refVal)\n if (!addOk) {\n state.circular = true\n state.circularRefs.push(refVal)\n return next()\n }\n\n setCurrent(state, refType, refVal)\n getRefSchema(refVal, refType, schema, options, state, (err, newValue) => {\n if (err) {\n state.error = err\n if (state.circular) {\n return final(schema)\n }\n if (options.failOnMissing) {\n return final(schema)\n }\n }\n\n state.history.pop()\n\n if (!err && _.isUndefined(newValue)) {\n if (state.missing.indexOf(refVal) === -1) {\n state.missing.push(refVal)\n }\n if (options.failOnMissing) {\n state.error = new Error(`Missing $ref: ${refVal}`)\n return final(schema)\n }\n return next()\n }\n\n let obj\n\n if (self.parent && self.parent[self.key]) {\n obj = self.parent\n } else if (self.node && self.node[self.key]) {\n obj = self.node\n }\n\n if (obj && !_.isUndefined(newValue)) {\n if (options.mergeAdditionalProperties) {\n delete node.$ref\n newValue = Object.assign({}, newValue, node)\n }\n\n if (options.removeIds && newValue.hasOwnProperty('$id')) {\n delete newValue.$id\n }\n\n obj[self.key] = newValue\n\n if (state.missing.indexOf(refVal) !== -1) {\n state.missing.splice(state.missing.indexOf(refVal), 1)\n }\n } else if (self.isRoot && !_.isUndefined(newValue)) {\n // special case of root schema being replaced\n state.history.pop()\n if (state.missing.indexOf(refVal) === -1) {\n state.missing.push(refVal)\n }\n\n queue.break()\n return final(newValue)\n }\n\n return next()\n })\n },\n final\n )\n}", "title": "" }, { "docid": "2a975da927ecd2dfe9e581ada3cc2a51", "score": "0.48702943", "text": "function derefSchema(schema, options, state, fn) {\n function finalCb(newObject) {\n var error;\n if (state.circular) {\n error = new Error('circular references found: ' + state.circularRefs.toString());\n }\n return fn(error, newObject);\n }\n\n state.missing = [];\n\n function doType(type, tfn) {\n async.whilst(function () {\n return !state.circular && hasRefs(schema, state.missing, type);\n }, function (wcb) {\n derefType(schema, options, state, type, function (err, derefed) {\n schema = derefed;\n return wcb();\n });\n }, tfn);\n }\n\n async.series([\n function (scb) {\n doType(['file', 'web'], scb);\n },\n function (scb) {\n doType('local', scb);\n }\n ], function (err) {\n return finalCb(schema)\n });\n}", "title": "" }, { "docid": "a0cbcf2e3f08a867830a260c54d182ec", "score": "0.48564082", "text": "function traverseSchema(schema, fn, path, ignoreArrays) {\n ignoreArrays = typeof ignoreArrays !== 'undefined' ? ignoreArrays : true;\n\n path = path || [];\n\n var traverse = function(schema, fn, path) {\n fn(schema, path);\n for(var k in schema.properties) {\n if (schema.properties.hasOwnProperty(k)) {\n var currentPath = path.slice();\n currentPath.push(k);\n traverse(schema.properties[k], fn, currentPath);\n }\n }\n //Only support type \"array\" which have a schema as \"items\".\n if (!ignoreArrays && schema.items) {\n var arrPath = path.slice(); arrPath.push('');\n traverse(schema.items, fn, arrPath);\n }\n };\n\n traverse(schema, fn, path || []);\n}", "title": "" }, { "docid": "ef7112d1f0ee013fef59922ad2b6c925", "score": "0.48255897", "text": "function resolveAllOf(openApiSpec, schema) {\n if (schema.allOf) {\n $.each(schema.allOf, function(i, def) {\n $.merge(schema, resolveReference(openApiSpec, def));\n });\n delete schema.allOf;\n }\n return schema;\n }", "title": "" }, { "docid": "a4ec4c391933967ef5102d13d3247696", "score": "0.4737755", "text": "function schemaCallback(err, schemas) {\n if (err) {\n console.error(err);\n }\n if (schemas) {\n console.log(schemas);\n for (var i = 0; i < schemas.length; i++) {\n var nombre=schemas[i].name;\n console.log(schemas[i].name);\n // Discover and build models from INVENTORY table\n ds.discoverAndBuildModels(nombre, {\n visited: {},\n associations: true\n },\n function(err, model) {\n var definition = model[0].definition;\n console.log(model);\n if (true) {\n var outputName = outputPath + '/' + nombre + '.json';\n fs.writeFile(outputName, JSON.stringify(definition, null, 2), function(err) {\n if (err) {\n console.log('Error writing schema to file.');\n console.log(err);\n } else {\n console.log(\"JSON saved to \" + outputName);\n }\n });\n }\n });\n }\n\n }\n}", "title": "" }, { "docid": "3e3daa224696abe9c6cbf24281b94768", "score": "0.46781254", "text": "function apiFactory(schema, apiBaseUrl, request, _, async) {\n const treeTableFactory = require('../generic/tree')(_, async);\n const validatorTools = require('../generic/validatorWrapper.js')(_);\n validatorTools.guardValidators(schema);\n function tryParse(b) {\n try {\n return JSON.parse(b);\n } catch(err) {\n return b;\n }\n }\n function translateToGeneric(callback) {\n return function(e, r, b) {\n return callback(e, tryParse(b));\n };\n }\n var dmi = {};\n _.each(schema, (v, k) => {\n var endpoint = _.cloneDeep(v);\n if (v.type === 'TREE') {\n var treeMethods = treeTableFactory.createTreeTable(dmi, v, k);\n function createRevert(manualFunction, callback) {\n return function revertToManual(err, response, body) {\n if (err || !(parseInt(response.statusCode) >= 200 && parseInt(response.statusCode) <= 300)) {\n return manualFunction(callback);\n } else {\n return callback(err, tryParse(body));\n }\n };\n }\n dmi[k] = {\n list: function(callback) {\n return request({\n method: 'GET',\n url: apiBaseUrl + '/' + k,\n json: true\n }, createRevert(treeMethods.list, callback));\n },\n getById: function(id, callback) {\n return request({\n method: 'GET',\n url: `${apiBaseUrl}/${k}/${id}`,\n }, createRevert(_.partial(treeMethods.getById, id), callback));\n }\n }\n return;\n }\n if (v.apiMethods.GET) {\n endpoint.get = function(callback) {\n return request({\n method: 'GET',\n url: apiBaseUrl + '/' + k,\n json: true\n }, callback);\n };\n endpoint.list = function(callback) {\n return endpoint.get(translateToGeneric(callback));\n }\n endpoint.search = function(instance, callback) {\n return request({\n method: 'GET',\n qs: instance,\n url: apiBaseUrl + '/' + k,\n }, translateToGeneric(callback));\n };\n endpoint.getById = function(id, callback) {\n return request({\n method: 'GET',\n url: `${apiBaseUrl}/${k}/${id}`,\n }, translateToGeneric(callback));\n };\n }\n if (v.apiMethods.PUT) {\n endpoint.put = function(instance, callback) {\n var id = instance[v.id];\n if (_.isUndefined(id)) {\n throw new Error(`Cannot PUT; id field ${v.id} of instance ${JSON.stringify(instance)} is undefined`);\n }\n return request({\n method: 'PUT',\n url: `${apiBaseUrl}/${k}/${id}`,\n body: instance,\n json: true\n }, callback);\n };\n endpoint.update = function(instance, callback) {\n var id = instance[v.id];\n if (v.validate) {\n return v.validate(instance, dmi, function(err, validate) {\n if (err) {\n return callback(err)\n } else {\n return request({\n method: 'PUT',\n headers: {'Content-Type': 'application/json'},\n url: `${apiBaseUrl}/${k}/${id}`,\n body: JSON.stringify(instance),\n }, translateToGeneric(callback));\n }\n });\n } else {\n return request({\n method: 'PUT',\n headers: {'Content-Type': 'application/json'},\n url: `${apiBaseUrl}/${k}/${id}`,\n body: JSON.stringify(instance)\n }, translateToGeneric(callback));\n }\n };\n }\n if (v.apiMethods.POST) {\n endpoint.post = function(instance, callback) {\n return request({\n method: 'POST',\n url: apiBaseUrl + '/' + k,\n body: instance,\n json: true\n }, callback);\n };\n }\n endpoint.save = function(instance, callback) {\n if (v.validate) {\n return v.validate(instance, dmi, function(err, validate) {\n if (err) {\n return callback(err)\n } else {\n return request({\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n url: apiBaseUrl + '/' + k,\n body: JSON.stringify(instance)\n }, translateToGeneric(callback));\n }\n });\n } else {\n return request({\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n url: apiBaseUrl + '/' + k,\n body: JSON.stringify(instance)\n }, translateToGeneric(callback));\n }\n };\n if (v.apiMethods.DELETE) {\n endpoint.delete = function(instance, callback) {\n var id = instance[v.id];\n if (_.isUndefined(id)) {\n throw new Error(`Cannot DELETE; id field ${v.id} of instance ${JSON.stringify(instance)} is undefined`);\n }\n return endpoint.deleteById(id, callback);\n };\n endpoint.deleteById = function(id, callback) {\n return request({\n method: 'DELETE',\n url: `${apiBaseUrl}/${k}/${id}`,\n }, translateToGeneric(callback));\n };\n }\n dmi[k] = endpoint;\n });\n return dmi;\n}", "title": "" }, { "docid": "a2f5f0009e59657a9bfb2313eeeb76ef", "score": "0.45950824", "text": "function _walk(obj, handler, depth, isBreadthFirst, isReverseOrder, res, allProps, parents, path) {\n\t\tdepth++;\n\n\t\tvar _parents,\n\t\t\t_path,\n\t\t\tkey, val,\n\t\t\tdepthFirst = res.depthFirst,\n\t\t\tbreadthFirst = res.breadthFirst,\n\t\t\tsiblings = [],\n\t\t\tlevels = [];\n\n\t\tif (!breadthFirst[depth]) {\n\t\t\t// init the breadthFirst per-level calls array\n\t\t\tbreadthFirst[depth] = levels;\n\t\t} else {\n\t\t\tlevels = breadthFirst[depth];\n\t\t}\n\n\t\tfor (key in obj) {\n\t\t\t//console.log(key);\n\t\t\tif (allProps || obj.hasOwnProperty(key)) {\n\t\t\t\tval = obj[key];\n\t\t\t\t//console.log(val);\n\t\t\t\t_parents = [].concat(parents, obj);\n\t\t\t\t_path = [].concat(path, key);\n\n\t\t\t\t// capture closure values in a new context for later access\n\t\t\t\t(function (v, k, o, parents, d, path) {\n\t\t\t\t\t// a function we can call later that would be tha same as calling it now\n\t\t\t\t\tvar theObj = {\n\t\t\t\t\t\tval: v,\n\t\t\t\t\t\tkey: k,\n\t\t\t\t\t\tdepth: d,\n\t\t\t\t\t\tfn: function () {\n\t\t\t\t\t\t\treturn handler(v, k, o, parents, siblings, d, path);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tparents: parents,\n\t\t\t\t\t\tsiblings: siblings,\n\t\t\t\t\t\tpath: path\n\t\t\t\t\t};\n\t\t\t\t\tdepthFirst.push(theObj);\n\t\t\t\t\tsiblings.push(theObj);\n\t\t\t\t}(val, key, obj, _parents, depth, _path));\n\n\t\t\t\t// recursive call\n\t\t\t\tif (typeof val === \"object\" && !_.isNull(val)) {\n\t\t\t\t\t// todo check for cycles! if === one of the parents do not pass go\n\t\t\t\t\t_walk(val, handler, depth, isBreadthFirst, isReverseOrder, res, allProps, _parents, _path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlevels.push(siblings);\n\n\t\tdepth--;\n\t}", "title": "" }, { "docid": "fdd130458a2677c040bdfe137d228c81", "score": "0.4572589", "text": "function initSchema(serverContainer){\n for (var i = 0; i< serverContainer.length; i++) {\n var stepId = getStepId(serverContainer[i].parentNode.parentNode);\n var selectedSchema = Element.getElementsBySelector(serverContainer[i].parentNode.parentNode.parentNode,\n 'input.lr-selected-schema.' + stepId + '-selected-schema').first();\n if (!selectedSchema || selectedSchema.value.length == 0)\n continue;\n\n var schemaSwitch = Element.getElementsBySelector(serverContainer[i].parentNode.parentNode.parentNode,\n 'input[value=' + selectedSchema.value + '].dbschema-item.' + stepId + '-dbschema-item').first();\n if (!schemaSwitch)\n continue;\n schemaSwitch.checked = true;\n schemaSwitch.click();\n\n var targetProxyCurrentValue = Element.getElementsBySelector(serverContainer[i].parentNode.parentNode.parentNode,\n 'input.lr-selected-target-proxy-value.' + stepId + '-selected-target-proxy-value').first();\n if (!targetProxyCurrentValue)\n continue;\n\n showTargetProxySelector(schemaSwitch, targetProxyCurrentValue.value);\n\n }\n}", "title": "" }, { "docid": "3f2fad102229bc7810ccd706be0ddc05", "score": "0.45674223", "text": "_generateMappings(schema, currentPath) {\n\n for ( const key in schema ) {\n\n if ( typeof schema[key] === 'object' && (schema[key].constructor === Object || schema[key].constructor === Array) )\n this._generateMappings(schema[key], `${currentPath ? currentPath + '.' : ''}${schema.constructor === Array ? '*' : key}`);\n\n if ( schema.constructor === Array ) continue;\n\n let alias = this._getAlias();\n\n while ( schema[alias] !== undefined ) alias = this._getAlias();\n\n this._addMapping(alias, `${currentPath ? currentPath + '.' : ''}${key}`);\n\n }\n\n }", "title": "" }, { "docid": "41fd4ea729e509d8afd73b365b8da66f", "score": "0.45415452", "text": "function get_schema_list( callbacks){\n var data = { };\n\n http_json_request(\"GET\", \"/schemas\", data, callbacks);\n}", "title": "" }, { "docid": "d414027dd8e431d8838eb9a5b321eef3", "score": "0.44964597", "text": "function handler_get_schemas(){\n\tif(xmlHttp.readyState == 4 && xmlHttp.status == 200){\n\t\tpopulate_list_from_xml(xmlHttp.responseText, 'schema_list');\n\n\t}\n}", "title": "" }, { "docid": "89db6ed84f5b47712015e6410957f290", "score": "0.44932783", "text": "visitOC_SchemaName(ctx) {\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "e997418db0410500f3a2d0e40735bcab", "score": "0.4481179", "text": "validateStateSchema( stateSchema ) {\n if ( assert && this.isComposite() ) {\n\n for ( const stateSchemaKey in stateSchema ) {\n if ( stateSchema.hasOwnProperty( stateSchemaKey ) ) {\n\n const stateSchemaValue = stateSchema[ stateSchemaKey ];\n\n if ( stateSchemaKey === '_private' ) {\n this.validateStateSchema( stateSchemaValue );\n }\n else {\n assert && assert( stateSchemaValue instanceof IOType, `${stateSchemaValue} expected to be an IOType` );\n }\n }\n }\n }\n }", "title": "" }, { "docid": "817d70cb693d6450b17e92d40fa0870b", "score": "0.44687894", "text": "resolveSchema(callback){let t=this;this.__symbol.resolveSchema((function(data){data.error===e.Errors.NONE?e.Callback.callSafe(callback,t,{error:e.Errors.NONE,schema:data.schema}):e.Callback.callSafe(callback,t,{error:data.error,details:data.details})}))}", "title": "" }, { "docid": "e124fc4a555a84ea4981872e3b402f3a", "score": "0.44620118", "text": "function defaultFormDefinition(schemaTypes, name, schema, options) {\n var rules = schemaTypes[stripNullType(schema.type)];\n if (rules) {\n var def = void 0;\n // We give each rule a possibility to recurse it's children.\n var innerDefaultFormDefinition = function innerDefaultFormDefinition(childName, childSchema, childOptions) {\n return defaultFormDefinition(schemaTypes, childName, childSchema, childOptions);\n };\n for (var i = 0; i < rules.length; i++) {\n def = rules[i](name, schema, options, innerDefaultFormDefinition);\n\n // first handler in list that actually returns something is our handler!\n if (def) {\n\n // Do we have form defaults in the schema under the x-schema-form-attribute?\n if (def.schema['x-schema-form']) {\n Object.assign(def, def.schema['x-schema-form']);\n }\n\n return def;\n }\n }\n }\n}", "title": "" }, { "docid": "5bae87679c2465fa4a281d2ea83f4178", "score": "0.44259426", "text": "visitReferenceSchema(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "03de360f845a732bd57994a6581fa15e", "score": "0.44053522", "text": "function initState(storeState = {}){\n\tfunction initStateByMappingData(state, data){\n\t\tvar currentState = state;\n\t\tfor(var mapping of data.mappingData){\n\t\t\tif(_.isPlainObject(currentState) && currentState[mapping.path] === undefined){\n\t\t\t\t//state is not inited yet. try to init\n\t\t\t\tif(Array.isArray(mapping.initState)){\n\t\t\t\t\tcurrentState[mapping.path] = [...mapping.initState];\n\t\t\t\t} else if(_.isNull(mapping.initState)) {\n\t\t\t\t\tcurrentState[mapping.path] = mapping.initState;\n\t\t\t\t} else if(typeof mapping.initState === 'object') {\n\t\t\t\t\tcurrentState[mapping.path] = Object.assign({}, mapping.initState);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentState[mapping.path] = mapping.initState;\n\t\t\t\t}\n\t\t\t\tcurrentState = currentState[mapping.path]\n\t\t\t}\n\t\t}\n\t}\n\tfor(var m in __stateIdMappingData){\n\t\t// only initState for the first level in the tree\n\t\tif(__stateIdMappingData[m].mappingData.length === 1){\n\t\t\tinitStateByMappingData(storeState, __stateIdMappingData[m])\n\t\t}\n\t}\n\treturn storeState;\n}", "title": "" }, { "docid": "3866bf6f64339cae29973fdc1503ab74", "score": "0.4392339", "text": "async ɵflatten(schema) {\n this._ajv.removeSchema(schema);\n this._currentCompilationSchemaInfo = undefined;\n const validate = await this._ajv.compileAsync(schema);\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n function visitor(current, pointer, parentSchema, index) {\n if (current &&\n parentSchema &&\n index &&\n (0, utils_2.isJsonObject)(current) &&\n Object.prototype.hasOwnProperty.call(current, '$ref') &&\n typeof current['$ref'] == 'string') {\n const resolved = self._resolver(current['$ref'], validate);\n if (resolved.schema) {\n parentSchema[index] = resolved.schema;\n }\n }\n }\n const schemaCopy = (0, utils_1.deepCopy)(validate.schema);\n (0, visitor_1.visitJsonSchema)(schemaCopy, visitor);\n return schemaCopy;\n }", "title": "" }, { "docid": "6086bb6a2a64533a9f65387835d98da6", "score": "0.43784148", "text": "pushSchema(schema) {\n\t\tthis.states[this.states.length-1].workingJsonSchema = schema;\n\t}", "title": "" }, { "docid": "4100bd0c3f68a58db34efbec375ae250", "score": "0.43623254", "text": "function defaultFormDefinition(schemaTypes, name, schema, options) {\r\n var rules = schemaTypes[stripNullType(schema.type)];\r\n if (rules) {\r\n var def = void 0;\r\n // We give each rule a possibility to recurse it's children.\r\n var innerDefaultFormDefinition = function innerDefaultFormDefinition(childName, childSchema, childOptions) {\r\n return defaultFormDefinition(schemaTypes, childName, childSchema, childOptions);\r\n };\r\n for (var i = 0; i < rules.length; i++) {\r\n def = rules[i](name, schema, options, innerDefaultFormDefinition);\r\n\r\n // first handler in list that actually returns something is our handler!\r\n if (def) {\r\n\r\n // Do we have form defaults in the schema under the x-schema-form-attribute?\r\n if (def.schema['x-schema-form']) {\r\n Object.assign(def, def.schema['x-schema-form']);\r\n }\r\n\r\n return def;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "70b32442a9cf57a1f6989d01cc55c1be", "score": "0.43486485", "text": "function derefType(schema, options, state, type, fn) {\n if (typeof state === 'function') {\n fn = state;\n state = null;\n }\n\n if (state.circular) {\n return fn(new Error('circular references found: ' + state.circularRefs.toString()), null);\n }\n\n function finalCb(newObject) {\n var error;\n if (state.circular) {\n error = new Error('circular references found: ' + state.circularRefs.toString());\n }\n return fn(error, newObject);\n }\n\n if (!Array.isArray(type)) {\n type = [type]\n }\n\n var queue = traverse(schema, function (node, next) {\n if (node['$ref'] && typeof node['$ref'] === 'string') {\n var self = this;\n\n var refType = utils.getRefType(node);\n var refVal = utils.getRefValue(node);\n\n if (refType && type.indexOf(refType) === -1) {\n return next();\n }\n\n if (refVal === '#') {\n // self referencing schema\n state.circular = true;\n state.circularRefs.push(refVal);\n return next();\n }\n\n var nodeHistory = buildNodeHistory({path: this.path.slice(0, -1)});\n\n var refPaths = refVal.split('/');\n var finalRef = refPaths[refPaths.length - 1] ? refPaths[refPaths.length - 1].toLowerCase() : null;\n\n if ((refType === 'local' && finalRef && nodeHistory.indexOf(finalRef) >= 0) ||\n (state.history.indexOf(refVal) >= 0)) {\n state.circular = true;\n state.circularRefs.push(refVal);\n return next();\n }\n else if (refType === 'file') {\n var filePath = utils.getRefFilePath(refVal);\n if (!utils.isAbsolute(filePath) && state.cwd) {\n filePath = path.resolve(state.cwd, filePath);\n }\n\n if (state.history.indexOf(filePath) >= 0) {\n state.circular = true;\n state.circularRefs.push(filePath);\n this.update(node, true);\n return;\n }\n }\n\n state.history.push(refVal);\n\n getRefSchema(refVal, refType, schema, options, state, function (err, newValue) {\n if (!err && newValue) {\n var obj;\n\n if (self.parent && self.parent[self.key]) {\n obj = self.parent;\n }\n else if (self.node && self.node[self.key]) {\n obj = self.node;\n }\n\n if (obj && newValue) {\n obj[self.key] = newValue;\n if (state.circularRefs.indexOf(refVal) === -1) {\n state.history.pop();\n }\n if (state.missing.indexOf(refVal) !== -1) {\n state.missing.splice(state.missing.indexOf(refVal), 1);\n }\n }\n else if (self.isRoot && newValue) {\n // special case of root schema being replaced\n state.history.pop();\n if (state.missing.indexOf(refVal) === -1) {\n if (state.circularRefs.indexOf(refVal) !== -1) {\n state.circularRefs.splice(state.circularRefs.indexOf(refVal), 1);\n }\n state.missing.push(refVal);\n }\n\n queue.break();\n return finalCb(newValue)\n }\n\n return next();\n }\n else if (!err && !newValue) {\n state.history.pop();\n if (state.missing.indexOf(refVal) === -1) {\n if (state.circularRefs.indexOf(refVal) !== -1) {\n state.circularRefs.splice(state.circularRefs.indexOf(refVal), 1);\n }\n state.missing.push(refVal);\n }\n\n return next();\n }\n else {\n return next();\n }\n });\n }\n else {\n return next();\n }\n }, finalCb);\n}", "title": "" }, { "docid": "b0a7725620493b4f14ddfe6af5c7186b", "score": "0.43122423", "text": "getModifiedSchema(schema, defaultSchema) {\n const modified = {};\n if (!defaultSchema) {\n return schema;\n }\n _.each(schema, (val, key) => {\n if (!_.isArray(val) && _.isObject(val) && defaultSchema.hasOwnProperty(key)) {\n const subModified = this.getModifiedSchema(val, defaultSchema[key]);\n if (!_.isEmpty(subModified)) {\n modified[key] = subModified;\n }\n }\n else if (\n (key === 'type') ||\n (key === 'key') ||\n (key === 'label') ||\n (key === 'input') ||\n (key === 'tableView') ||\n !defaultSchema.hasOwnProperty(key) ||\n _.isArray(val) ||\n (val !== defaultSchema[key])\n ) {\n modified[key] = val;\n }\n });\n return modified;\n }", "title": "" }, { "docid": "f08b751d58522729091a78f7cf1888bc", "score": "0.43098417", "text": "findDefaults(states) {\n var defaults = {};\n states.forEach((state, k) => {\n var i = 0;\n for (var act in state) {\n if ({}.hasOwnProperty.call(state, act)) i++;\n }\n\n if (i === 1 && state[act][0] === 2) {\n // only one action in state and it's a reduction\n defaults[k] = state[act];\n }\n });\n\n return defaults;\n }", "title": "" }, { "docid": "c819ff80d2a02708699601d8a4ebc457", "score": "0.43031752", "text": "function compileNFA (schema, shape) {\n const expression = shape.expression;\n return NFA();\n\n function NFA () {\n // wrapper for states, startNo and matchstate\n const states = [];\n const matchstate = State_make(Match, []);\n let startNo = matchstate;\n const stack = [];\n let pair;\n if (expression) {\n const pair = walkExpr(expression, []);\n patch(pair.tail, matchstate);\n startNo = pair.start;\n }\n const ret = {\n algorithm: \"rbenx\",\n end: matchstate,\n states: states,\n start: startNo,\n match: rbenx_match\n }\n // matchstate = states = startNo = null;\n return ret;\n\n function walkExpr (expr, stack) {\n let s, starts;\n let lastTail;\n function maybeAddRept (start, tail) {\n if ((expr.min == undefined || expr.min === 1) &&\n (expr.max == undefined || expr.max === 1))\n return {start: start, tail: tail}\n s = State_make(Rept, [start]);\n states[s].expr = expr;\n // cache min/max in normalized form for simplicity of comparison.\n states[s].min = \"min\" in expr ? expr.min : 1;\n states[s].max = \"max\" in expr ? expr.max === UNBOUNDED ? Infinity : expr.max : 1;\n patch(tail, s);\n return {start: s, tail: [s]}\n }\n\n if (expr.type === \"TripleConstraint\") {\n s = State_make(expr, []);\n states[s].stack = stack;\n return {start: s, tail: [s]};\n // maybeAddRept(s, [s]);\n }\n\n else if (expr.type === \"OneOf\") {\n lastTail = [];\n starts = [];\n expr.expressions.forEach(function (nested, ord) {\n pair = walkExpr(nested, stack.concat({c:expr, e:ord}));\n starts.push(pair.start);\n lastTail = lastTail.concat(pair.tail);\n });\n s = State_make(Split, starts);\n states[s].expr = expr;\n return maybeAddRept(s, lastTail);\n }\n\n else if (expr.type === \"EachOf\") {\n expr.expressions.forEach(function (nested, ord) {\n pair = walkExpr(nested, stack.concat({c:expr, e:ord}));\n if (ord === 0)\n s = pair.start;\n else\n patch(lastTail, pair.start);\n lastTail = pair.tail;\n });\n return maybeAddRept(s, lastTail);\n }\n\n else if (expr.type === \"Inclusion\") {\n const included = schema.productions[expr.include];\n return walkExpr(included, stack);\n }\n\n runtimeError(\"unexpected expr type: \" + expr.type);\n };\n\n function State_make (c, outs, negated) {\n const ret = states.length;\n states.push({c:c, outs:outs});\n if (negated)\n states[ret].negated = true; // only include if true for brevity\n return ret;\n }\n\n function patch (l, target) {\n l.forEach(elt => {\n states[elt].outs.push(target);\n });\n }\n }\n\n\n function nfaToString () {\n const known = {OneOf: [], EachOf: []};\n function dumpTripleConstraint (tc) {\n return \"<\" + tc.predicate + \">\";\n }\n function card (obj) {\n let x = \"\";\n if (\"min\" in obj) x += obj.min;\n if (\"max\" in obj) x += \",\" + obj.max;\n return x ? \"{\" + x + \"}\" : \"\";\n }\n function junct (j) {\n let id = known[j.type].indexOf(j);\n if (id === -1)\n id = known[j.type].push(j)-1;\n return j.type + id; // + card(j);\n }\n function dumpStackElt (elt) {\n return junct(elt.c) + \".\" + elt.e + (\"i\" in elt ? \"[\" + elt.i + \"]\" : \"\");\n }\n function dumpStack (stack) {\n return stack.map(elt => { return dumpStackElt(elt); }).join(\"/\");\n }\n function dumpNFA (states, startNo) {\n return states.map((s, i) => {\n return (i === startNo ? s.c === Match ? \".\" : \"S\" : s.c === Match ? \"E\" : \" \") + i + \" \" + (\n s.c === Split ? (\"Split-\" + junct(s.expr)) :\n s.c === Rept ? (\"Rept-\" + junct(s.expr)) :\n s.c === Match ? \"Match\" :\n dumpTripleConstraint(s.c)\n ) + card(s) + \"→\" + s.outs.join(\" | \") + (\"stack\" in s ? dumpStack(s.stack) : \"\");\n }).join(\"\\n\");\n }\n function dumpMatched (matched) {\n return matched.map(m => {\n return dumpTripleConstraint(m.c) + \"[\" + m.triples.join(\",\") + \"]\" + dumpStack(m.stack);\n }).join(\",\");\n }\n function dumpThread (thread) {\n return \"S\" + thread.state + \":\" + Object.keys(thread.repeats).map(k => {\n return k + \"×\" + thread.repeats[k];\n }).join(\",\") + \" \" + dumpMatched(thread.matched);\n }\n function dumpThreadList (list) {\n return \"[[\" + list.map(thread => { return dumpThread(thread); }).join(\"\\n \") + \"]]\";\n }\n return {\n nfa: dumpNFA,\n stack: dumpStack,\n stackElt: dumpStackElt,\n thread: dumpThread,\n threadList: dumpThreadList\n };\n }\n\n function rbenx_match (graph, node, constraintList, synthesize, /* constraintToTripleMapping, tripleToConstraintMapping, */ neighborhood, recurse, direct, semActHandler, checkValueExpr, trace) {\n const rbenx = this;\n let clist = [], nlist = []; // list of {state:state number, repeats:stateNo->repetitionCount}\n\n function resetRepeat (thread, repeatedState) {\n const trimmedRepeats = Object.keys(thread.repeats).reduce((r, k) => {\n if (parseInt(k) !== repeatedState) // ugh, hash keys are strings\n r[k] = thread.repeats[k];\n return r;\n }, {});\n return {state:thread.state/*???*/, repeats:trimmedRepeats, matched:thread.matched, avail:thread.avail.slice(), stack:thread.stack};\n }\n function incrmRepeat (thread, repeatedState) {\n const incrmedRepeats = Object.keys(thread.repeats).reduce((r, k) => {\n r[k] = parseInt(k) == repeatedState ? thread.repeats[k] + 1 : thread.repeats[k];\n return r;\n }, {});\n return {state:thread.state/*???*/, repeats:incrmedRepeats, matched:thread.matched, avail:thread.avail.slice(), stack:thread.stack};\n }\n function stateString (state, repeats) {\n const rs = Object.keys(repeats).map(rpt => {\n return rpt+\":\"+repeats[rpt];\n }).join(\",\");\n return rs.length ? state + \"-\" + rs : \"\"+state;\n }\n\n function addstate (list, stateNo, thread, seen) {\n seen = seen || [];\n const seenkey = stateString(stateNo, thread.repeats);\n if (seen.indexOf(seenkey) !== -1)\n return;\n seen.push(seenkey);\n\n const s = rbenx.states[stateNo];\n if (s.c === Split) {\n return s.outs.reduce((ret, o, idx) => {\n return ret.concat(addstate(list, o, thread, seen));\n }, []);\n // } else if (s.c.type === \"OneOf\" || s.c.type === \"EachOf\") { // don't need Rept\n } else if (s.c === Rept) {\n let ret = [];\n // matched = [matched].concat(\"Rept\" + s.expr);\n if (!(stateNo in thread.repeats))\n thread.repeats[stateNo] = 0;\n const repetitions = thread.repeats[stateNo];\n // add(r < s.min ? outs[0] : r >= s.min && < s.max ? outs[0], outs[1] : outs[1])\n if (repetitions < s.max)\n ret = ret.concat(addstate(list, s.outs[0], incrmRepeat(thread, stateNo), seen)); // outs[0] to repeat\n if (repetitions >= s.min && repetitions <= s.max)\n ret = ret.concat(addstate(list, s.outs[1], resetRepeat(thread, stateNo), seen)); // outs[1] when done\n return ret;\n } else {\n // if (stateNo !== rbenx.end || !thread.avail.reduce((r2, avail) => { faster if we trim early??\n // return r2 || avail.length > 0;\n // }, false))\n return [list.push({ // return [new list element index]\n state:stateNo,\n repeats:thread.repeats,\n avail:thread.avail.map(a => { // copy parent thread's avail vector\n return a.slice();\n }),\n stack:thread.stack,\n matched:thread.matched,\n errors: thread.errors\n }) - 1];\n }\n }\n\n function localExpect999 (list) {\n return list.map(st => {\n const s = rbenx.states[st.state]; // simpler threads are a list of states.\n return renderAtom(s.c, s.negated);\n });\n }\n\n if (rbenx.states.length === 1)\n return matchedToResult([], constraintList, neighborhood, recurse, direct, semActHandler, checkValueExpr);\n\n let chosen = null;\n // const dump = nfaToString();\n // console.log(dump.nfa(this.states, this.start));\n addstate(clist, this.start, {repeats:{}, avail:[], matched:[], stack:[], errors:[]});\n while (clist.length) {\n nlist.length = 0;\n if (trace)\n trace.push({threads:[]});\n for (let threadno = 0; threadno < clist.length; ++threadno) {\n const thread = clist[threadno];\n if (thread.state === rbenx.end)\n continue;\n const state = rbenx.states[thread.state];\n const nlistlen = nlist.length;\n const constraintNo = constraintList.indexOf(state.c);\n // may be Accept!\n let min = \"min\" in state.c ? state.c.min : 1;\n let max = \"max\" in state.c ? state.c.max === UNBOUNDED ? Infinity : state.c.max : 1;\n if (\"negated\" in state.c && state.c.negated)\n min = max = 0;\n if (thread.avail[constraintNo] === undefined)\n thread.avail[constraintNo] = synthesize(constraintNo, min, max, neighborhood);\n const taken = thread.avail[constraintNo].splice(0, max);\n if (taken.length >= min) {\n do {\n // find the exprs that require repetition\n const exprs = rbenx.states.map(x => { return x.c === Rept ? x.expr : null; });\n const newStack = state.stack.map(e => {\n let i = thread.repeats[exprs.indexOf(e.c)];\n if (i === undefined)\n i = 0; // expr has no repeats\n else\n i = i-1;\n return { c:e.c, e:e.e, i:i };\n });\n const withIndexes = {\n c: state.c,\n triples: taken,\n stack: newStack\n };\n thread.matched = thread.matched.concat(withIndexes);\n state.outs.forEach(o => { // single out if NFA includes epsilons\n addstate(nlist, o, thread);\n });\n } while ((function () {\n if (thread.avail[constraintNo].length > 0 && taken.length < max) {\n taken.push(thread.avail[constraintNo].shift());\n return true; // stay in look to take more.\n } else {\n return false; // no more to take or we're already at max\n }\n })());\n }\n if (trace)\n trace[trace.length-1].threads.push({\n state: clist[threadno].state,\n to:nlist.slice(nlistlen).map(x => {\n return stateString(x.state, x.repeats);\n })\n });\n }\n // console.log(dump.threadList(nlist));\n if (nlist.length === 0 && chosen === null)\n return reportError(localExpect(clist, rbenx.states));\n const t = clist;\n clist = nlist;\n nlist = t;\n const longerChosen = clist.reduce((ret, elt) => {\n const matchedAll =\n // elt.matched.reduce((ret, m) => {\n // return ret + m.triples.length; // count matched triples\n // }, 0) === tripleToConstraintMapping.reduce((ret, t) => {\n // return t === undefined ? ret : ret + 1; // count expected\n // }, 0);\n true;\n return ret !== null ? ret : (elt.state === rbenx.end && matchedAll) ? elt : null;\n }, null)\n if (longerChosen)\n chosen = longerChosen;\n // if (longerChosen !== null)\n // console.log(JSON.stringify(matchedToResult(longerChosen.matched)));\n }\n if (chosen === null)\n return reportError(localExpect(clist, rbenx.states));\n function reportError (errors) { return {\n type: \"Failure\",\n node: node,\n errors: errors\n } }\n function localExpect (clist, states) {\n const lastState = states[states.length - 1];\n return clist.map(t => {\n const c = rbenx.states[t.state].c;\n // if (c === Match)\n // return { type: \"EndState999\" };\n const valueExpr = extend({}, c.valueExpr);\n if (\"reference\" in valueExpr) {\n const ref = valueExpr.reference;\n if (ref.termType === \"BlankNode\")\n valueExpr.reference = schema.shapes[ref];\n }\n return extend({\n type: lastState.c.negated ? \"NegatedProperty\" :\n t.state === rbenx.end ? \"ExcessTripleViolation\" :\n \"MissingProperty\",\n property: lastState.c.predicate\n }, Object.keys(valueExpr).length > 0 ? { valueExpr: valueExpr } : {});\n });\n }\n // console.log(\"chosen:\", dump.thread(chosen));\n return \"errors\" in chosen.matched ?\n chosen.matched :\n matchedToResult(chosen.matched, constraintList, neighborhood, recurse, direct, semActHandler, checkValueExpr);\n }\n\n function matchedToResult (matched, constraintList, neighborhood, recurse, direct, semActHandler, checkValueExpr) {\n let last = [];\n const errors = [];\n const skips = [];\n const ret = matched.reduce((out, m) => {\n let mis = 0;\n let ptr = out, t;\n while (mis < last.length &&\n m.stack[mis].c === last[mis].c && // constraint\n m.stack[mis].i === last[mis].i && // iteration number\n m.stack[mis].e === last[mis].e) { // (dis|con)junction number\n ptr = ptr.solutions[last[mis].i].expressions[last[mis].e];\n ++mis;\n }\n while (mis < m.stack.length) {\n if (mis >= last.length) {\n last.push({});\n }\n if (m.stack[mis].c !== last[mis].c) {\n t = [];\n ptr.type = m.stack[mis].c.type === \"EachOf\" ? \"EachOfSolutions\" : \"OneOfSolutions\", ptr.solutions = t;\n if (\"min\" in m.stack[mis].c)\n ptr.min = m.stack[mis].c.min;\n if (\"max\" in m.stack[mis].c)\n ptr.max = m.stack[mis].c.max;\n if (\"annotations\" in m.stack[mis].c)\n ptr.annotations = m.stack[mis].c.annotations;\n if (\"semActs\" in m.stack[mis].c)\n ptr.semActs = m.stack[mis].c.semActs;\n ptr = t;\n last[mis].i = null;\n // !!! on the way out to call after valueExpr test\n if (\"semActs\" in m.stack[mis].c) {\n if (!semActHandler.dispatchAll(m.stack[mis].c.semActs, \"???\", ptr))\n throw { type: \"SemActFailure\", errors: [{ type: \"UntrackedSemActFailure\" }] };\n }\n // if (ret && \"semActs\" in expr) { ret.semActs = expr.semActs; }\n } else {\n ptr = ptr.solutions;\n }\n if (m.stack[mis].i !== last[mis].i) {\n t = [];\n ptr[m.stack[mis].i] = {\n type:m.stack[mis].c.type === \"EachOf\" ? \"EachOfSolution\" : \"OneOfSolution\",\n expressions: t};\n ptr = t;\n last[mis].e = null;\n } else {\n ptr = ptr[last[mis].i].expressions;\n }\n if (m.stack[mis].e !== last[mis].e) {\n t = {};\n ptr[m.stack[mis].e] = t;\n if (m.stack[mis].e > 0 && ptr[m.stack[mis].e-1] === undefined && skips.indexOf(ptr) === -1)\n skips.push(ptr);\n ptr = t;\n last.length = mis + 1; // chop off last so we create everything underneath\n } else {\n throw \"how'd we get here?\"\n ptr = ptr[last[mis].e];\n }\n ++mis;\n }\n ptr.type = \"TripleConstraintSolutions\";\n if (\"min\" in m.c)\n ptr.min = m.c.min;\n if (\"max\" in m.c)\n ptr.max = m.c.max;\n ptr.predicate = m.c.predicate;\n if (\"valueExpr\" in m.c)\n ptr.valueExpr = m.c.valueExpr;\n if (\"productionLabel\" in m.c)\n ptr.productionLabel = m.c.productionLabel;\n ptr.solutions = m.triples.map(tno => {\n const triple = neighborhood[tno];\n const ret = {\n type: \"TestedTriple\",\n subject: rdfJsTerm2Ld(triple.subject),\n predicate: rdfJsTerm2Ld(triple.predicate),\n object: rdfJsTerm2Ld(triple.object)\n };\n\n function diver (focus, shape, dive) {\n const sub = dive(focus, shape);\n if (\"errors\" in sub) {\n // console.dir(sub);\n const err = {\n type: \"ReferenceError\", focus: focus,\n shape: shape, errors: sub\n };\n if (shapeLabel.termType === \"BlankNode\")\n err.referencedShape = shape;\n return [err];\n }\n if (\"solution\" in sub && Object.keys(sub.solution).length !== 0 ||\n sub.type === \"Recursion\")\n ret.referenced = sub; // !!! needs to aggregate errors and solutions\n return [];\n }\n function diveRecurse (focus, shapeLabel) {\n return diver(focus, shapeLabel, recurse);\n }\n function diveDirect (focus, shapeLabel) {\n return diver(focus, shapeLabel, direct);\n }\n if (\"valueExpr\" in ptr) {\n const sub = checkValueExpr(ptr.inverse ? triple.subject : triple.object, ptr.valueExpr, diveRecurse, diveDirect);\n if (\"errors\" in sub)\n [].push.apply(errors, sub.errors);\n }\n\n if (errors.length === 0 && \"semActs\" in m.c &&\n !semActHandler.dispatchAll(m.c.semActs, triple, ret))\n errors.push({ type: \"SemActFailure\", errors: [{ type: \"UntrackedSemActFailure\" }] }) // some semAct aborted\n return ret;\n })\n if (\"annotations\" in m.c)\n ptr.annotations = m.c.annotations;\n if (\"semActs\" in m.c)\n ptr.semActs = m.c.semActs;\n last = m.stack.slice();\n return out;\n }, {});\n\n if (errors.length)\n return {\n type: \"SemActFailure\",\n errors: errors\n };\n\n // Clear out the nulls for the expressions with min:0 and no matches.\n // <S> { (:p .; :q .)?; :r . } \\ { <s> :r 1 } -> i:0, e:1 resulting in null at e=0\n // Maybe we want these nulls in expressions[] to make it clear that there are holes?\n skips.forEach(skip => {\n for (let exprNo = 0; exprNo < skip.length; ++exprNo)\n if (skip[exprNo] === null || skip[exprNo] === undefined)\n skip.splice(exprNo--, 1);\n });\n\n if (\"semActs\" in shape)\n ret.semActs = shape.semActs;\n return ret;\n }\n }", "title": "" }, { "docid": "3a84be6ea84a5aa6fd28b44330db6b63", "score": "0.42991295", "text": "async build() {\n\t\tlogger('Building Schemas', 'START');\n\n\t\t// Check if base path is a correct directory\n\t\tif(!await this._isDirectory(this.constructor.schemaDir)) {\n\t\t\tlogger('Directory \\'schemas/\\' don\\'t exist. Need to build.', 'ERROR', true);\n\t\t\treturn process.exit(-1);\n\t\t}\n\n\t\tlogger('Directory \\'schemas/\\' found.');\n\n\t\t// Check if source path is a correct directory\n\t\tif(!await this._isDirectory(this.constructor.schemaSrcDir)) {\n\t\t\tlogger('Directory \\'schemas/src/\\' don\\'t exist. Need to build.', 'ERROR', true);\n\t\t\treturn process.exit(-1);\n\t\t}\n\n\t\tlogger('Directory \\'schemas/src/\\' found.');\n\n\t\ttry {\n\t\t\tlogger('Searching SRC structure');\n\t\t\tconst tree = await this._getSourceTree();\n\t\t\tconst schemaTypes = Object.keys(tree);\n\n\t\t\tif(!schemaTypes.length) {\n\t\t\t\tlogger('No Files to Build', 'ERROR', true);\n\t\t\t\treturn process.exit(-1);\n\t\t\t}\n\n\t\t\tlogger('Validating files.');\n\t\t\tfor(const key of schemaTypes)\n\t\t\t\tawait this._buildSchema(key, tree[key]);\n\n\t\t\tlogger('Schemas Build in \\'schemas/public.json\\'', 'SUCCESS');\n\t\t} catch(error) {\n\t\t\tlogger(error.message, 'ERROR', true);\n\t\t\treturn process.exit(-1);\n\n\t\t}\n\t}", "title": "" }, { "docid": "e911262140ced4f88f5d3f8f8518f191", "score": "0.42921087", "text": "function states (state_def,init_obj)\n{\n\t// no private member\n\t/*\\\n\t * states.state\n\t [ property ]\n\t - (object) states tree, can be altered dynamically\n\t\\*/\n\tthis.state=state_def;\n\tif( init_obj)\n\t\tfor( var Q in init_obj)\n\t\t\tthis[Q] = init_obj[Q];\n\n\tthis.state.name='root'; //build an accessible tree\n\tthis.propagate_down(999,function(state,name,superstate){\n\t\tstate.name=name;\n\t\tstate.superstate=superstate;\n\t});\n\n\t/*\\\n\t * states.evlay\n\t [ property ]\n\t - (array) array of delayed events\n\t\\*/\n\tthis.evlay=new Array(20);\n\tfor( var i=0; i<this.evlay.length; i++)\n\t\tthis.evlay[i]={i:-1};\n\n\t/*\\\n\t * states.cur\n\t * defines the path to current state\n\t [ property ]\n\t - (array)\n\t | cur=['state1','state1_1','state1_1_1'];\n\t | represents state1-> state1_1-> state1_1_1(cur is here)\n\t\\*/\n\tthis.cur=[];\n\t/*\\\n\t * states.cur_name\n\t [ property ]\n\t - (string) name of current state\n\t\\*/\n\tthis.cur_name='root';\n\t/*\\\n\t * states.cur_state\n\t [ property ]\n\t - (object) reference to the current state in state_def\n\t\\*/\n\tthis.cur_state=this.state;\n\tthis.chain_event(true,this.cur,1,'entry',true,null);\n\n\tstate_list.push(this); //the list of state objects\n\n\t/*\\\n\t * states.log_enable\n\t [ property ]\n\t - (boolean) not log by default\n\t\\*/\n\tthis.log_enable=false;\n\t/*\\\n\t * states.log_filter\n\t [ property ]\n\t - (function) a function to return true to not log an item\n\t\\*/\n\tthis.log_filter=null;\n\t/*\\\n\t * states.log_size\n\t [ property ]\n\t - (number) 100 lines by default\n\t\\*/\n\tthis.log_size=100;\n\t/** @property this.log the JSON object\n\t*/\n\t/*\\\n\t * states.log\n\t [ property ]\n\t - (array)\n\t * log state transitions in form of\n\t | [\n\t |\t{type:'t', from:path, to:path}, //transition\n\t |\t{type:'c', event:event, target:state, return:result}, //call\n\t | ]\n\t\\*/\n\tthis.log=[];\n}", "title": "" }, { "docid": "78f1d5e47d03ef6ea820e9af7cd90b57", "score": "0.42806304", "text": "function updateRootObject(doc, updated, inbound, state) {\n var newDoc = updated[ROOT_ID];\n if (!newDoc) {\n newDoc = cloneRootObject(doc[CACHE][ROOT_ID]);\n updated[ROOT_ID] = newDoc;\n }\n Object.defineProperty(newDoc, OPTIONS, { value: doc[OPTIONS] });\n Object.defineProperty(newDoc, CACHE, { value: updated });\n Object.defineProperty(newDoc, INBOUND, { value: inbound });\n Object.defineProperty(newDoc, STATE, { value: state });\n\n if (doc[OPTIONS].freeze) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object.keys(updated)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var objectId = _step.value;\n\n if (updated[objectId] instanceof Table) {\n updated[objectId]._freeze();\n } else {\n Object.freeze(updated[objectId]);\n Object.freeze(updated[objectId][CONFLICTS]);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(doc[CACHE])[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _objectId = _step2.value;\n\n if (!updated[_objectId]) {\n updated[_objectId] = doc[CACHE][_objectId];\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n if (doc[OPTIONS].freeze) {\n Object.freeze(updated);\n Object.freeze(inbound);\n }\n return newDoc;\n}", "title": "" }, { "docid": "1e173320c14d567c50d607a6bcbe0bcb", "score": "0.42800444", "text": "function treeAncestors(schema, options) {\n options = _assign(\n {\n // Parent field defaults\n parentFieldName: 'parent',\n parentFieldType: mongoose.Schema.Types.ObjectId,\n parentFieldRefModel: null,\n parentIdFieldName: '_id',\n // Ancestors field defaults\n ancestorsFieldName: 'ancestors',\n ancestorsFieldType: mongoose.Schema.Types.ObjectId,\n ancestorsFieldRefModel: null,\n\n generateIndexes: false,\n // TODO: Revisar si es necesario\n mapLimit: 5\n },\n options\n );\n\n // Save some option variables in a more legible variable name\n let id = options.parentIdFieldName;\n let parentId = options.parentFieldName;\n let ancestors = options.ancestorsFieldName;\n\n function byId(value) {\n let conditions = {};\n conditions[options.parentIdFieldName] = value;\n return conditions;\n }\n\n // Add parent field\n if (!(parentId in schema.paths)) {\n let schemaParentField = {};\n schemaParentField[parentId] = {\n type: options.parentFieldType,\n default: null\n };\n if (options.parentFieldRefModel) {\n schemaParentField[parentId].ref = options.parentFieldRefModel;\n }\n schema.add(schemaParentField);\n }\n\n // Add ancestors field\n if (!(ancestors in schema.paths)) {\n let schemaAncestorsField = objProperty(ancestors, [\n {\n type: options.ancestorsFieldType\n }\n ]);\n if (options.ancestorsFieldRefModel) {\n schemaAncestorsField[ancestors][0].ref = options.ancestorsFieldRefModel;\n }\n\n schema.add(schemaAncestorsField);\n }\n\n if (options.generateIndexes) {\n // Add parent field index\n let parentFieldIndex = {};\n parentFieldIndex[parentId] = 1;\n schema.index(parentFieldIndex);\n\n // Add ancestors field index\n let ancestorsFieldIndex = {};\n ancestorsFieldIndex[ancestors] = 1;\n schema.index(ancestorsFieldIndex);\n }\n\n schema.post('update', function(docs, done) {\n /**\n * A find with filter {} here will find all the elements affected by the update\n */\n this.find({}).exec(function(err, data) {\n // Iterate over the found elements updating it's children\n eachSeries(data, _updatedDocument, done);\n });\n });\n\n schema.post('findOneAndUpdate', _updatedDocument);\n\n schema.pre('save', function(next) {\n let self = this;\n let isParentIdChange = self.isModified(parentId);\n\n // Updates do not affect structure\n if (!self.isNew && !isParentIdChange) {\n return next();\n }\n\n /**\n * A NEW ELEMENT WITHOUT A PARENT IS CREATED\n * Description: If a new element is created, but it doesn't have any parent, set an empty \n * array of ancestors\n */\n if (self.isNew && !self[parentId]) {\n this[ancestors] = [];\n this[parentId] = null;\n return next();\n }\n\n /**\n * A NEW ELEMENT WITH A PARENT IS CREATED or AN EXISTING ELEMENT IS UPDATED\n * Description: \n * \tIf a new element is created, it must save the array with all the ancestors\n * \t\n * \tIf an existing element is updated, and there're changes in it's parents,\n * the element must update it's ancestors and all the children should do the same\n */\n if ((self.isNew && self[parentId]) || (!self.isNew && isParentIdChange)) {\n return _updatedDocument(self, next);\n } else {\n return next();\n }\n });\n\n /**\n * This method applies when a document is being removed like this:\n * var document = model.findOne({[params]})\n * document.remove()\n */\n schema.pre('findOneAndRemove', function(next) {\n let self = this;\n self.findOne({}).exec(function(err, documentToBeRemoved) {\n // Check for errors\n if (err) {\n return next(err);\n }\n // Try to remove the document\n return _deleteDocument(documentToBeRemoved, next);\n });\n });\n\n /**\n * This method applies when a document is being removed like this:\n * var document = model.findOne({[params]})\n * document.remove()\n */\n schema.pre('remove', function(doc) {\n this.constructor\n .findOne({\n _id: this._id\n })\n .exec(function(err, data) {\n _deleteDocument(data, doc);\n });\n });\n\n /**\n * This method applies when a document is being removed like this:\n * model.remove({[params]})\n */\n schema.static('remove', function(conditions, callback) {\n if ('function' === typeof conditions) {\n callback = conditions;\n conditions = {};\n }\n\n let self = this;\n let promise = new mongoose.Promise();\n if (typeof callback === 'function') promise.addBack(callback);\n\n self.find(conditions).exec(function(err, docs) {\n mapLimit(\n docs,\n options.mapLimit,\n function(doc, cbNext) {\n _deleteDocument(doc, cbNext);\n },\n function(err) {\n if (err) return promise.error(err);\n return promise.complete();\n }\n );\n });\n return promise;\n });\n\n // Base method (not sure if works properly)\n // schema.method('getParent', function(callback) {\n // \tlet promise = new mongoose.Promise;\n // \tif (callback) promise.addBack(callback);\n // \tlet self = this;\n // \tself.constructor.findOne(byId(self[parentId]), function(err, doc) {\n // \t\tif (err || !doc)\n // \t\t\tpromise.error(err);\n // \t\telse\n // \t\t\tpromise.complete(doc);\n // \t});\n // \treturn promise;\n // });\n\n // --- Build array with ancestors --------------------------------------------------------\n schema.static('buildAncestors', function(callback) {\n let self = this;\n let promise = new mongoose.Promise();\n if (typeof callback === 'function') {\n promise.addBack(callback);\n }\n\n let updateChildren = function(pDocs, cbFinish) {\n mapLimit(\n pDocs,\n options.mapLimit,\n function(parent, cbNext) {\n // update children\n let parentAncestors = parent[ancestors];\n let ancestorsArray = (parentAncestors && parentAncestors.push(parent._id) && parentAncestors) || [];\n\n self.update(\n objProperty(parentId, parent._id),\n objProperty(ancestors, ancestorsArray),\n {\n multi: true\n },\n function(err) {\n if (err) {\n return cbNext(err);\n }\n // after updated\n return self.find(objProperty(parentId, parent._id)).exec(function(err, docs) {\n if (docs.length === 0) return cbNext(null);\n\n return updateChildren(docs, cbNext);\n });\n }\n );\n },\n cbFinish\n );\n };\n\n self.find(objProperty(parentId, null)).exec(function(err, docs) {\n // clear path\n self.update(\n objProperty(parentId, null),\n objProperty(ancestors, []),\n {\n multi: true\n },\n function() {\n updateChildren(docs, function() {\n promise.complete();\n });\n }\n );\n });\n\n return promise;\n });\n\n function _updatedDocument(doc, next) {\n let updateChild = function() {\n doc.constructor.find(objProperty(ancestors, doc[id])).exec(function(err, docs) {\n // update documents\n map(\n docs,\n function(childrenDoc, cbNext) {\n // Remove all the ancestors that now are not ancestors\n let newAncestors = _dropWhile(childrenDoc[ancestors], function(elementId) {\n return elementId.toString() !== doc[id].toString();\n });\n childrenDoc[ancestors] = _concat(doc[ancestors], newAncestors);\n\n childrenDoc.save(function(err, data) {\n cbNext(err, data);\n });\n },\n function(err) {\n next(err);\n }\n );\n });\n };\n\n // Save data and update children\n if (!doc[parentId]) {\n doc[ancestors] = [];\n doc.save();\n // Update children\n updateChild();\n } else {\n doc.constructor.findOne(byId(doc[parentId])).exec(function(err, newParent) {\n if (err || !newParent) {\n doc.invalidate(parentId, 'Parent not found!');\n return next(new Error('Parent not found!'));\n }\n\n let parentAncestors = newParent[ancestors];\n let ancestorsArray = (parentAncestors && parentAncestors.push(newParent._id) && parentAncestors) || [];\n doc[ancestors] = ancestorsArray;\n doc.save();\n // update child\n return updateChild();\n });\n }\n }\n\n function _deleteDocument(doc, next) {\n // Check if there are children depending on the document that will be removed\n if (doc) {\n doc.constructor\n .find({\n ancestors: doc._id\n })\n .exec(function(e, data) {\n if (e) {\n return next(e);\n }\n // If there are no children depending on it, proceed with the document removal\n if (!data.length) {\n return next();\n } else {\n // If the document has children depending on it, don't allow the removal\n let err = new Error(\n 'It\\'s not possible to delete this document with id \"' +\n doc._id +\n '\". It has ' +\n data.length +\n ' children depending on it'\n );\n err.children = _map(data, '_id');\n return next(err);\n }\n });\n } else {\n next();\n }\n }\n}", "title": "" }, { "docid": "81c30765b921c02aabc8573fa6f05da6", "score": "0.427971", "text": "function acquire_schema(context) {\n var parent = context.context;\n if (parent) {\n return context._schema || parent.schema;\n }\n return context._schema; // end of chain, may be undefined or null\n }", "title": "" }, { "docid": "22fc18eeaff5e05d1bad007e7bf16dba", "score": "0.42590576", "text": "function initState() {\n\tvar storeState = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\tfunction initStateByMappingData(state, data) {\n\t\tvar currentState = state;\n\t\tvar _iteratorNormalCompletion3 = true;\n\t\tvar _didIteratorError3 = false;\n\t\tvar _iteratorError3 = undefined;\n\n\t\ttry {\n\t\t\tfor (var _iterator3 = data.mappingData[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t\t\t\tvar mapping = _step3.value;\n\n\t\t\t\tif (_lodash2.default.isPlainObject(currentState) && currentState[mapping.path] === undefined) {\n\t\t\t\t\t//state is not inited yet. try to init\n\t\t\t\t\tif (Array.isArray(mapping.initState)) {\n\t\t\t\t\t\tcurrentState[mapping.path] = [].concat(_toConsumableArray(mapping.initState));\n\t\t\t\t\t} else if (_lodash2.default.isNull(mapping.initState)) {\n\t\t\t\t\t\tcurrentState[mapping.path] = mapping.initState;\n\t\t\t\t\t} else if (_typeof(mapping.initState) === 'object') {\n\t\t\t\t\t\tcurrentState[mapping.path] = Object.assign({}, mapping.initState);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentState[mapping.path] = mapping.initState;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentState = currentState[mapping.path];\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError3 = true;\n\t\t\t_iteratorError3 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion3 && _iterator3.return) {\n\t\t\t\t\t_iterator3.return();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError3) {\n\t\t\t\t\tthrow _iteratorError3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor (var m in __stateIdMappingData) {\n\t\t// only initState for the first level in the tree\n\t\tif (__stateIdMappingData[m].mappingData.length === 1) {\n\t\t\tinitStateByMappingData(storeState, __stateIdMappingData[m]);\n\t\t}\n\t}\n\treturn storeState;\n}", "title": "" }, { "docid": "eb38a43d18c5538989b5b0ac5797a3eb", "score": "0.42561498", "text": "function getPathDefinitions(doc, group) {\n var definitions = [];\n var item = \"\";\n for (path in doc['paths']) {\n if (path.indexOf(group) != -1) {\n if (doc['paths'][path].hasOwnProperty('get')) {\n if (doc['paths'][path]['get']['responses']['200']['schema'].hasOwnProperty('type')) {\n if (doc['paths'][path]['get']['responses']['200']['schema'].hasOwnProperty('items')) {\n if (doc['paths'][path]['get']['responses']['200']['schema']['items'].hasOwnProperty('$ref')) {\n item = util.getArrTableName(doc['paths'][path]['get']['responses']['200']['schema']['items']['$ref']);\n if (!(_.contains(definitions, item))) {\n definitions.push(item);\n }\n }\n }\n } else {\n if (doc['paths'][path]['get']['responses']['200']['schema'].hasOwnProperty('$ref')) {\n item = util.getArrTableName(doc['paths'][path]['get']['responses']['200']['schema']['$ref']);\n if (!(_.contains(definitions, item))) {\n definitions.push(item);\n }\n }\n }\n }\n\n if (doc['paths'][path].hasOwnProperty('post')) {\n if (doc['paths'][path]['post']['responses']['200']['schema'].hasOwnProperty('type')) {\n if (doc['paths'][path]['post']['responses']['200']['schema'].hasOwnProperty('items')) {\n if (doc['paths'][path]['post']['responses']['200']['schema']['items'].hasOwnProperty('$ref')) {\n item = util.getArrTableName(doc['paths'][path]['post']['responses']['200']['schema']['items']['$ref']);\n if (!(_.contains(definitions, item))) {\n definitions.push(item);\n }\n }\n }\n } else {\n if (doc['paths'][path]['post']['responses']['200']['schema'].hasOwnProperty('$ref')) {\n item = util.getArrTableName(doc['paths'][path]['post']['responses']['200']['schema']['$ref']);\n if (!(_.contains(definitions, item))) {\n definitions.push(item);\n }\n }\n }\n }\n\n }\n }\n return definitions;\n}", "title": "" }, { "docid": "2b28dfef83efc9d93967b560326962a6", "score": "0.4254392", "text": "function selectStateFromId(storeState, stateId, parentContrainst){\n\tvar found = __stateIdMappingData[stateId]\n\tif(found === undefined){\n\t\tthrow new Error('StateId: ' + stateId + ' is not decleared in schema tree')\n\t}\n\tfunction *stateSelector(state, iterators, path=[]){\n\t\tif(!Array.isArray(iterators) || iterators.length === 0){\n\t\t\tyield {state, path};\n\t\t} else {\n\t\t\tvar contrainst = parentContrainst && parentContrainst[iterators[0].stateId]\n\t\t\tvar subState = iterators[0].iterator(state, contrainst);\n\t\t\tvar subPath = iterators[0].path;\n\t\t\tif(iterators.length === 1) {\n\t\t\t\tyield {state: subState, path: [...path, subPath]}\n\t\t\t} else {\n\t\t\t\tif(Array.isArray(subState)){\n\t\t\t\t\tfor (let index in subState){\n\t\t\t\t\t\tvar childState = subState[index];\n\t\t\t\t\t\tyield* stateSelector(childState, iterators.slice(1), [...path, subPath, index])\n\t\t\t\t\t}\n\t\t\t\t} else if(subState !== NOTFOUNDSTATE) {\n\t\t\t\t\tyield* stateSelector(subState, iterators.slice(1), [...path, subPath])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn stateSelector(storeState, found.mappingData)\n}", "title": "" }, { "docid": "6eb01fc9adae46c669be697fdba31d94", "score": "0.4233189", "text": "function resolveAllOf(schema, references, data, oas) {\n // Dereference schema\n if ('$ref' in schema && typeof schema.$ref === 'string') {\n if (schema.$ref in references) {\n return references[schema.$ref];\n }\n const reference = schema.$ref;\n schema = Oas3Tools.resolveRef(schema.$ref, oas);\n references[reference] = schema;\n }\n /**\n * TODO: Is there a better method to copy the schema?\n *\n * Copy the schema\n */\n const collapsedSchema = JSON.parse(JSON.stringify(schema));\n // Resolve allOf\n if (Array.isArray(collapsedSchema.allOf)) {\n collapsedSchema.allOf.forEach((memberSchema) => {\n const collapsedMemberSchema = resolveAllOf(memberSchema, references, data, oas);\n // Collapse type if applicable\n if (collapsedMemberSchema.type) {\n if (!collapsedSchema.type) {\n collapsedSchema.type = collapsedMemberSchema.type;\n // Check for incompatible schema type\n }\n else if (collapsedSchema.type !== collapsedMemberSchema.type) {\n utils_1.handleWarning({\n mitigationType: utils_1.MitigationTypes.UNRESOLVABLE_SCHEMA,\n message: `Resolving 'allOf' field in schema '${JSON.stringify(collapsedSchema)}' ` + `results in incompatible schema type.`,\n data,\n log: preprocessingLog\n });\n }\n }\n // Collapse properties if applicable\n if ('properties' in collapsedMemberSchema) {\n if (!('properties' in collapsedSchema)) {\n collapsedSchema.properties = {};\n }\n Object.entries(collapsedMemberSchema.properties).forEach(([propertyName, property]) => {\n if (!(propertyName in collapsedSchema.properties)) {\n collapsedSchema.properties[propertyName] = property;\n // Conflicting property\n }\n else {\n utils_1.handleWarning({\n mitigationType: utils_1.MitigationTypes.UNRESOLVABLE_SCHEMA,\n message: `Resolving 'allOf' field in schema '${JSON.stringify(collapsedSchema)}' ` +\n `results in incompatible property field '${propertyName}'.`,\n data,\n log: preprocessingLog\n });\n }\n });\n }\n // Collapse oneOf if applicable\n if ('oneOf' in collapsedMemberSchema) {\n if (!('oneOf' in collapsedSchema)) {\n collapsedSchema.oneOf = [];\n }\n collapsedMemberSchema.oneOf.forEach((oneOfProperty) => {\n collapsedSchema.oneOf.push(oneOfProperty);\n });\n }\n // Collapse anyOf if applicable\n if ('anyOf' in collapsedMemberSchema) {\n if (!('anyOf' in collapsedSchema)) {\n collapsedSchema.anyOf = [];\n }\n collapsedMemberSchema.anyOf.forEach((anyOfProperty) => {\n collapsedSchema.anyOf.push(anyOfProperty);\n });\n }\n // Collapse required if applicable\n if ('required' in collapsedMemberSchema) {\n if (!('required' in collapsedSchema)) {\n collapsedSchema.required = [];\n }\n collapsedMemberSchema.required.forEach((requiredProperty) => {\n if (!collapsedSchema.required.includes(requiredProperty)) {\n collapsedSchema.required.push(requiredProperty);\n }\n });\n }\n });\n }\n return collapsedSchema;\n}", "title": "" }, { "docid": "615b061e339e7993b5873d641417edba", "score": "0.42304832", "text": "function getSampleObj(openApiSpec, schema, currentGenerated) {\n var sample, def, name, prop;\n currentGenerated = currentGenerated || {}; // used to handle circular references\n schema = resolveAllOf(openApiSpec, schema);\n if (schema.default || schema.example) {\n sample = schema.default || schema.example;\n } else if (schema.properties) {\n sample = {};\n for (name in schema.properties) {\n prop = schema.properties[name];\n sample[name] = getSampleObj(openApiSpec, prop.schema || prop, currentGenerated);\n }\n } else if (schema.additionalProperties) {\n // this is a map/dictionary\n // @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#model-with-mapdictionary-properties\n def = resolveReference(openApiSpec, schema.additionalProperties);\n sample = {\n 'string': getSampleObj(openApiSpec, def, currentGenerated)\n };\n } else if (schema.$ref) {\n // complex object\n def = resolveReference(openApiSpec, schema);\n if (def) {\n if (!sampleCache[schema.$ref] && !currentGenerated[schema.$ref]) {\n // object not in cache\n currentGenerated[schema.$ref] = true;\n sampleCache[schema.$ref] = getSampleObj(openApiSpec, def, currentGenerated);\n }\n sample = sampleCache[schema.$ref] || {};\n } else {\n console.warn('SwaggerUI: schema not found', schema.$ref);\n sample = schema.$ref;\n }\n } else if (schema.type === 'array') {\n sample = [getSampleObj(openApiSpec, schema.items, currentGenerated)];\n } else if (schema.type === 'object') {\n sample = {};\n } else {\n sample = schema.defaultValue || schema.example || getSampleValue(schema);\n }\n return sample;\n }", "title": "" }, { "docid": "6cedd76fcc4a03d3167b7b0e6a02e375", "score": "0.42200974", "text": "function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = URI.parse(ref);\n const refPath = (0, resolve_1._getFullPath)(p);\n let baseId = (0, resolve_1.getFullPath)(root.baseId);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = (0, resolve_1.normalizeId)(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === (0, resolve_1.normalizeId)(ref)) {\n const { schema } = schOrRef;\n const { schemaId } = this.opts;\n const schId = schema[schemaId];\n if (schId)\n baseId = (0, resolve_1.resolveUrl)(baseId, schId);\n return new SchemaEnv({ schema, schemaId, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}", "title": "" }, { "docid": "6cedd76fcc4a03d3167b7b0e6a02e375", "score": "0.42200974", "text": "function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = URI.parse(ref);\n const refPath = (0, resolve_1._getFullPath)(p);\n let baseId = (0, resolve_1.getFullPath)(root.baseId);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = (0, resolve_1.normalizeId)(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === (0, resolve_1.normalizeId)(ref)) {\n const { schema } = schOrRef;\n const { schemaId } = this.opts;\n const schId = schema[schemaId];\n if (schId)\n baseId = (0, resolve_1.resolveUrl)(baseId, schId);\n return new SchemaEnv({ schema, schemaId, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}", "title": "" }, { "docid": "a28814186973520e31099fe1154223bf", "score": "0.42038402", "text": "startWatch() {\n super.startWatch();\n for (let propertyName in this.schema) {\n this.schema[propertyName].startWatch();\n }\n }", "title": "" }, { "docid": "a518d64967f6de2a0238ecf2528f3fdf", "score": "0.42012578", "text": "function getRefSchema (refVal, refType, parent, options, state, fn) {\n const customLoaderOptions = _.pick(options, defaultKeys)\n const loader = typeof options.loader === 'function' ? options.loader : null\n let filePath\n let fullRefFilePath\n\n if (refType === 'file') {\n filePath = utils.getRefFilePath(refVal)\n fullRefFilePath = utils.isAbsolute(filePath) ? filePath : path.resolve(state.cwd, filePath)\n }\n\n function loaderHandler (err, loaderValue) {\n if (!err && loaderValue) {\n let oldBasePath\n\n if (refType === 'file') {\n let dirname = path.dirname(filePath)\n if (dirname === '.') {\n dirname = ''\n }\n\n if (dirname) {\n oldBasePath = state.cwd\n const newBasePath = path.resolve(state.cwd, dirname)\n options.baseFolder = state.cwd = newBasePath\n }\n }\n\n derefSchema(loaderValue, options, state, (err, derefedValue) => {\n // reset\n if (oldBasePath) {\n options.baseFolder = state.cwd = oldBasePath\n }\n\n if (err) {\n return fn(err)\n }\n\n let newVal\n if (derefedValue) {\n if (refType === 'file' && fullRefFilePath && !cache[fullRefFilePath]) {\n cache[fullRefFilePath] = derefedValue\n }\n\n if (refVal.indexOf('#') >= 0) {\n const refPaths = refVal.split('#')\n const refPath = refPaths[1]\n const refNewVal = utils.getRefPathValue(derefedValue, refPath)\n if (refNewVal) {\n newVal = refNewVal\n }\n } else {\n newVal = derefedValue\n }\n }\n\n return fn(null, newVal)\n })\n } else if (loader) {\n loader(refVal, customLoaderOptions, fn)\n } else {\n fn(err)\n }\n }\n\n if (refType && loaders[refType]) {\n let loaderValue\n if (refType === 'file') {\n if (cache[fullRefFilePath]) {\n loaderValue = cache[fullRefFilePath]\n loaderHandler(null, loaderValue)\n } else {\n loaders[refType](refVal, options, loaderHandler)\n }\n } else {\n loaders[refType](refVal, options, loaderHandler)\n }\n } else if (refType === 'local') {\n const newValue = utils.getRefPathValue(parent, refVal)\n fn(undefined, newValue)\n } else if (loader) {\n loader(refVal, customLoaderOptions, fn)\n } else {\n fn()\n }\n}", "title": "" }, { "docid": "8dd339dd35d453dfd8ec4d99160e5278", "score": "0.41963065", "text": "function initSchemaContext(context) {\n Object.defineProperties(\n context,\n {\n 'schema': {\n get: function () {\n return acquire_schema(this);\n }\n },\n 'comparators': {\n get: function () {\n return acquire_comparators(this);\n }\n }\n }\n );\n }", "title": "" }, { "docid": "e9f29af9482d58999e1a26cc7397401b", "score": "0.41917858", "text": "function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = URI.parse(ref);\n const refPath = resolve_1._getFullPath(p);\n let baseId = resolve_1.getFullPath(root.baseId);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = resolve_1.normalizeId(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === resolve_1.normalizeId(ref)) {\n const { schema } = schOrRef;\n if (schema.$id)\n baseId = resolve_1.resolveUrl(baseId, schema.$id);\n return new SchemaEnv({ schema, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}", "title": "" }, { "docid": "13ec16d9ff6a10ed5999551e0fccab7f", "score": "0.41882375", "text": "function buildDefaults (schema) {\n\t\tvar defaults = {};\n\n\t\tfor (var prop in schema) {\n\t\t\tif (schema[prop]._defaultValue) {\n\t\t\t\tdefaults[prop] = schema[prop]._defaultValue;\n\t\t\t}\n\t\t}\n\n\t\treturn defaults;\n\t}", "title": "" }, { "docid": "729afd1d9a92969034bec5e4c5bf4842", "score": "0.4187081", "text": "function getRefSchema(refVal, refType, parent, options, state, fn) {\n var customLoaderOptions = _.pick(options, defaultKeys);\n\n var loader = typeof options.loader === 'function' ? options.loader : null;\n\n var filePath, fullRefFilePath;\n\n if (refType === 'file') {\n filePath = utils.getRefFilePath(refVal);\n fullRefFilePath = utils.isAbsolute(filePath) ? filePath : path.resolve(state.cwd, filePath);\n }\n\n function loaderHandler(err, loaderValue) {\n if (!err && loaderValue) {\n var oldBasePath;\n\n if (refType === 'file') {\n\n var dirname = path.dirname(filePath);\n if (dirname === '.') {\n dirname = '';\n }\n\n if (dirname) {\n oldBasePath = state.cwd;\n var newBasePath = path.resolve(state.cwd, dirname);\n options.baseFolder = state.cwd = newBasePath;\n }\n }\n\n derefSchema(loaderValue, options, state, function (err, derefedValue) {\n // reset\n if (oldBasePath) {\n options.baseFolder = state.cwd = oldBasePath;\n }\n\n if (err) {\n return fn(err);\n }\n\n var newVal;\n\n if (derefedValue) {\n if (refType === 'file' && fullRefFilePath && !cache[fullRefFilePath]) {\n cache[fullRefFilePath] = derefedValue;\n }\n\n if (refVal.indexOf('#') >= 0) {\n var refPaths = refVal.split('#');\n var refPath = refPaths[1];\n var refNewVal = utils.getRefPathValue(derefedValue, refPath);\n if (refNewVal) {\n newVal = refNewVal;\n }\n }\n else {\n newVal = derefedValue;\n }\n }\n\n return fn(null, newVal);\n });\n }\n else if (loader) {\n loader(refVal, customLoaderOptions, fn);\n }\n else {\n fn(err);\n }\n }\n\n if (refType && loaders[refType]) {\n var loaderValue;\n\n if (refType === 'file') {\n if (cache[fullRefFilePath]) {\n loaderValue = cache[fullRefFilePath];\n loaderHandler(null, loaderValue);\n }\n else {\n loaders[refType](refVal, options, loaderHandler);\n }\n }\n else {\n loaders[refType](refVal, options, loaderHandler);\n }\n }\n else if (refType === 'local') {\n var newValue = utils.getRefPathValue(parent, refVal);\n fn(undefined, newValue);\n }\n else if (loader) {\n loader(refVal, customLoaderOptions, fn);\n }\n else {\n fn();\n }\n}", "title": "" }, { "docid": "cdb61ff2684b9feca9641ba815a1983d", "score": "0.4181967", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "title": "" }, { "docid": "cdb61ff2684b9feca9641ba815a1983d", "score": "0.4181967", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "title": "" }, { "docid": "cdb61ff2684b9feca9641ba815a1983d", "score": "0.4181967", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "title": "" }, { "docid": "cdb61ff2684b9feca9641ba815a1983d", "score": "0.4181967", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "title": "" }, { "docid": "cdb61ff2684b9feca9641ba815a1983d", "score": "0.4181967", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "title": "" }, { "docid": "e4d68b5869ff2568aab6a49cc3369186", "score": "0.41691238", "text": "function fireInitialEvents() {\n logger.info('fire initial events');\n\n function iter(path) {\n if(util.isDir(path)) {\n var listing = getNodeData(path);\n if(listing) {\n for(var key in listing) {\n iter(path + key);\n }\n }\n } else {\n fireChange('device', path);\n }\n }\n\n iter('/');\n\n }", "title": "" }, { "docid": "f6af2fc7519e1b15a4a5fa04347b5c5b", "score": "0.4163372", "text": "function processWfs (construct, parentCallback) {\n\n var linkage = construct['linkage'];\n var outPath = construct['parent'];\n var xmlId = construct['fileId'];\n\n parse.parseGetCapabilitiesWfs(linkage, function (wfsGet) {\n var wfsCounter = wfsGet.length;\n var wfsIndex = 0;\n\n function recursiveWfs (wfs) {\n async.waterfall([\n function (callback) {\n handle.configurePaths(outPath, wfs, callback);\n },\n function (config, callback) {\n config['xmlId'] = xmlId;\n handle.buildDirectory(config['directory'], config, callback);\n },\n function (hostPath, config, callback) {\n var outPath = path.join(hostPath, config['xmlId']);\n handle.buildDirectory(outPath, config, callback);\n },\n function (outPath, config, callback) {\n var urlQuery = url.parse(wfs)['query'];\n var typeName = querystring.parse(urlQuery)['typeNames'];\n callback(null, config, outPath, typeName);\n },\n function (config, outPath, type, callback) {\n var fileId = config['file'];\n if (type === 'aasg:WellLog') {\n parse.parseWellLogsWfs(wfs, outPath, function (d) {\n if (d) {\n async.waterfall([\n function (callback) {\n var outPathRecord = path.join(outPath, d['id']);\n handle.buildDirectory(outPathRecord, d, callback);\n },\n function (outPath, d, callback) {\n var wfsXml = path.join(outPath, d['id'] + '.xml');\n handle.writeXml(wfsXml, d['xml'], outPath, d, callback);\n },\n function (outPath, d, callback) {\n async.each(d['linkages'], function (link) {\n handle.download(outPath, link, callback);\n })\n }\n ])\n }\n if (d === 'end_of_stream') {\n wfsIndex++;\n if (wfsIndex < wfsCounter) recursiveWfs(wfsGet[wfsIndex]);\n if (wfsIndex === wfsCounter) callback();\n }\n\n });\n }\n var writePath = path.join(outPath, fileId + '.xml');\n parse.parseGetFeaturesWfs(wfs, writePath, function () {\n wfsIndex++;\n if (wfsIndex < wfsCounter) recursiveWfs(wfsGet[wfsIndex]);\n if (wfsIndex === wfsCounter) parentCallback(writePath);\n })\n },\n ], function (err, res) {\n if (err) console.log(err);\n else console.log(res);\n })\n }\n if (wfsIndex === wfsCounter) callback();\n recursiveWfs(wfsGet[wfsIndex]);\n })\n}", "title": "" }, { "docid": "d42f42f7407b8995ef1fe81a5043d9ef", "score": "0.41631183", "text": "_populate(populateQueryString, query_results, group, callback){\n // I'm not proud of this, there should be an easier way to do this.\n //\n // Basically this loops through the fields passed in by req.param.populate\n // and determines which tree (Advertiser or Publisher) those fields belong to.\n //\n // Then, for each field, it calls the Model form of 'populate' to populate the\n // top-level node of that tree (which, based on how populate/Mongo works, is the\n // only field that represents an ID belonging to a collection rather than a sub-doc,\n // and is thus the only field that CAN be populated).\n //\n // Finally, once the query result is populated with the top-level doc from the respective\n // tree, it maps the appropriate child doc to the populate field in each query result row.\n // So net-net, calls the DB once per populate field provided (I think).\n const self = this;\n const populates = populateQueryString.split(',');\n const asyncFieldFuncs = [];\n populates.forEach((field) => {\n asyncFieldFuncs.push((callback) => {\n // throw out populate param if populate not in group\n if (Object.keys(group).indexOf(field) > -1){\n const modelName = field.toProperCase();\n // First determine whether field is in Publisher or Advertiser tree.\n // If neither, skip it.\n let treeDocument;\n let parentFieldName;\n let parentModelName;\n if (self.advertiserModels.hasOwnProperty(modelName)){\n treeDocument = 'advertiserModels';\n parentFieldName = 'advertiser';\n parentModelName = 'Advertiser';\n } else if (self.publisherModels.hasOwnProperty(modelName)){\n treeDocument = 'publisherModels';\n parentFieldName = 'publisher';\n parentModelName = 'Publisher';\n } else if (self.geoModels.hasOwnProperty(modelName)){\n // geoModels models are not tree documents, so populateChildField\n // can always be bypassed. Set modelName to parentModelName to\n // ensure only goes as deep as model populate call\n treeDocument = 'geoModels';\n parentModelName = modelName;\n parentFieldName = field;\n } else {\n return callback('Populate field not recognized: ' + field);\n }\n\n // sub routine to pass to async.map. Just gets child document given\n // populated top-level node doc\n const populateChildField = function(doc, callback) {\n if (doc._id[field] && doc._id[parentFieldName]){\n self[treeDocument].getChildDocument(\n doc._id[field],\n modelName,\n doc._id[parentFieldName],\n (err, child) => {\n if (err) {\n if (err instanceof ReferenceError){\n // this means the object was deleted, just don't populate anything\n child = null;\n } else {\n return callback(err);\n }\n }\n if (populates.indexOf(parentFieldName) === -1){\n // strip off advertiser object for compactness if it's not required\n // by the API call\n doc._id[parentFieldName] = doc._id[parentFieldName]._id;\n }\n // replace doc ID with object & callback\n doc._id[field] = child;\n return callback(null, doc);\n }\n );\n } else {\n doc._id[field] = null;\n return callback(null, doc);\n }\n };\n\n // TODO: Don't have to populate here if top-level node has already\n // TODO: been populated, can save a trip to the database\n // have to populate top level first before doing anything at child-level\n self[treeDocument][parentModelName].populate(query_results, {\n path: '_id.' + parentFieldName,\n model: parentModelName\n }, (err, result) => {\n if (err) return callback(err);\n if (modelName === parentModelName) {\n query_results = result;\n return callback(null, true);\n } else {\n // For non-top-level populates, have to loop over results and populate manually\n // by finding nested docs in populated top-level docs.\n async.map(result, populateChildField, (err, result) => {\n if (err) return callback(err);\n query_results = result;\n return callback(null, true);\n });\n }\n });\n } else {\n return callback('Populate field not in group: ' + field);\n }\n });\n });\n async.series(asyncFieldFuncs, (err, result) => {\n if (err) return callback(err);\n return callback(null, query_results);\n });\n }", "title": "" }, { "docid": "074d1e2320e904154273ee5b504761da", "score": "0.41631106", "text": "function checkSchemaErrors(schemaJSON)\n {\n\n //check against the proper schema definition\n // var vck = self.validator.validateMultiple(schemaJSON, schemaSpec, true);\n var valCheck = self.validateFunction.apply(self.validator, [schemaJSON, schemaSpec, true]);\n \n //grab all possible errors\n var checkErrors = {length: 0};\n var checkWarnings = {length: 0};\n\n //if we're valid -- which we almost certainly are -- just keep going\n if(!valCheck.valid)\n {\n //let it be known -- this is a weird error\n self.log(\"Invalid from v4 JSON schema perspective: \", valCheck[errorKey]);\n\n checkErrors[\"root\"] = valCheck[errorKey];\n checkErrors.length++;\n\n //not valid, throw it back\n return checkErrors;\n }\n\n\n //make sure we have some properties -- otherwise there is literally no validation/\n //during the move process, this is overridden, but it's a good check nonetheless\n if(!schemaJSON.properties && !schemaJSON.items)\n {\n checkErrors[\"root\"] = \"No properties/items defined at root. Schema has no validation without properties!\";\n checkErrors.length++;\n }\n\n //going to need to traverse our schema object\n var tJSON = traverse(schemaJSON);\n\n tJSON.forEach(function(node)\n {\n //skip the root please\n if(this.isRoot || this.path.join(pathDelim).indexOf('required') != -1)\n return;\n\n //this should be a warning\n if(!self.requireByDefault && !this.isLeaf && !this.node.required)\n {\n //if you don't have a required object, then you're gonna have a bad time\n //this is a warning\n checkWarnings[this.path.join(pathDelim)] = \"warning: if you disable requireByDefault and don't put require arrays, validation will ignore those properties.\";\n checkWarnings.length++;\n\n }\n if(this.key == \"properties\" && this.node.properties)\n {\n checkErrors[this.path.join(pathDelim)] = \"Properties inside properties is meaningless.\";\n checkErrors.length++;\n }\n if(this.key == \"type\" && typeof this.node != \"string\")\n {\n //for whatever reason, there is a type defined, but not a string in it's place? Waa?\n checkErrors[this.path.join(pathDelim)] = \"Types must be string\";\n checkErrors.length++;\n }\n if(this.key == \"type\" && !self.typeRegExp.test(this.node.toLowerCase()))\n {\n checkErrors[this.path.join(pathDelim)] = \"Types must be one of \" + self.validTypes + \" not \" + this.node;\n checkErrors.length++;\n }\n if(this.isLeaf)\n {\n //if you don't have a type, and there is no ref object\n if(!this.parent.node.properties && (this.key != \"type\" && this.key != \"$ref\") && !this.parent.node.type && !this.parent.node[\"$ref\"])\n {\n checkErrors[this.path.join(pathDelim)] = \"Object doesn't have any properties, a valid type, or a reference, therefore it is invalid in the WIN spec.\";\n checkErrors.length++;\n }\n }\n //not a leaf, you don't have a reference\n if(!self.allowAnyObjects && !this.isLeaf && !this.node[\"$ref\"] )\n {\n //special case for items -- doesn't apply\n if(this.node.type == \"object\" && this.key != \"items\")\n {\n //we're going to check if the list of keys to follow have any non keywords\n //for instance if {type: \"object\", otherThing: \"string\"} keys = type, otherThing\n //if instead it's just {type : \"object\", required : []}, keys = type, required \n //notice that the top has non-keyword keys, and the bottom example does not \n //we're looking for the bottom example and rejecting it\n var bHasNonKeywords = hasNonKeywords(this.keys);\n \n //if you ONLY have keywords -- you don't have any other object types\n //you are a violation of win spec and you allow any object or array to be passed in\n if(!bHasNonKeywords){\n // self.log(\"Current: \".magenta, this.key, \" Keys: \".cyan, this.keys || \"none, node: \" + this.node, \" has non? \".red + bHasNonKeywords);\n checkErrors[this.path.join(pathDelim)] = \"AllowAnyObjects is off, therefore you cannot simple have an 'object' type with no inner properties\";\n checkErrors.length++;\n }\n }\n else if(this.node.type == \"array\")\n {\n //if you are an array and you have no items -- not allowed!\n if(!this.node.items){\n // self.log(\"Current: \".magenta, this.key, \" Keys: \".cyan, this.keys || \"none, node: \" + this.node, \" has non? \".red + bHasNonKeywords);\n checkErrors[this.path.join(pathDelim)] = \"AllowAnyObjects is off, therefore you cannot simple have an 'array' type with no inner items\";\n checkErrors.length++;\n }\n else\n {\n //if you have a ref -- you're okay for us!\n var bIemsHaveNonKey = this.node.items[\"$ref\"] || this.node.items[\"type\"] || hasNonKeywords(this.node.items.properties || {});\n if(!bIemsHaveNonKey){\n // self.log(\"Current: \".magenta, this.key, \" Keys: \".cyan, this.keys || \"none, node: \" + this.node, \" has non? \".red + bHasNonKeywords);\n checkErrors[this.path.join(pathDelim)] = \"AllowAnyObjects is off, therefore you cannot simple have an 'array' type with no non-keyword inner items\";\n checkErrors.length++;\n }\n }\n }\n \n }\n //if you're an array\n if(this.node.type == \"array\")\n {\n //grab your items\n var items = this.node.items;\n if(!items && !self.allowAnyObjects)\n {\n checkErrors[this.path.join(pathDelim)] = \"AllowAnyObjects is off for arrays, therefore you cannot simple have an 'array' type with no inner items\";\n checkErrors.length++;\n }\n else\n {\n items = items || {};\n //we have items -- we shouldn't have a reference type && other items\n if(items.properties && items[\"$ref\"])\n {\n checkErrors[this.path.join(pathDelim)] = \"Array items in WIN cannot have properties AND a reference type. One or the other.\";\n checkErrors.length++;\n }\n }\n }\n\n\n });\n\n if(checkErrors.length || checkWarnings.length)\n return {errors: checkErrors, warnings: checkWarnings};\n else\n return null;\n\n }", "title": "" }, { "docid": "92ed6a6e4d54b51cb8629c57b9a2914b", "score": "0.4160591", "text": "function mapRun(input, schema, discrepencies) {\n var result = {};\n _.forOwn(schema, function (value, key) {\n if (_.isPlainObject(value)) {\n // Recursive. Others are bases.\n result[key] = mapRun(input[key], value, discrepencies);\n } else if (_.isArray(value)) {\n try {\n result[key] = value.reduce(function (prev, curr, index) {\n if (!_.isFunction(curr)) throw 'Index [' + index + ']: Not a function.';\n return curr(prev);\n }, input[key]);\n } catch (e) {\n discrepencies.push('' + key + ': ' + e);\n }\n } else if (_.isFunction(value)) {\n try {\n result[key] = value(input[key]); // Result of running that function against the input.\n } catch (e) {\n discrepencies.push('' + key + ': ' + e);\n }\n } else {\n throw new TypeError('Schemas should be a nested object of functions or function arrays.');\n }\n });\n return result;\n}", "title": "" }, { "docid": "360b69ef095615cb8f1947da06ade7d8", "score": "0.41576216", "text": "function loadDefinitions (callback) {\n\t\t// Each iteration should break some dependencies, I claim 4 is enough to break all of them\n\t\tfor (var i = 4; i > 0; i -= 1) {\n\t\t\tfor (var path in pendingClasses) {\n\t\t\t\tif (pendingClasses.hasOwnProperty(path)) {\n\t\t\t\t\tif (pendingClasses[path].waitsForPendingClass.length === 0 || !stillPendingOnOthers(pendingClasses[path].waitsForPendingClass)) {\n\t\t\t\t\t\t// be optimist, maybe the one I'm pending on was already loaded before in the loop\n\t\t\t\t\t\tpendingClasses[path].loadCallback(path, pendingClasses[path].loadClassArgs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// pendingClasses is not going to be empty in case of circular dependencies\n\t\tcallback(pendingTests);\n\t}", "title": "" }, { "docid": "5503d5ffd88069a93ab9f24cb40a9614", "score": "0.41559663", "text": "function findDefaults (states) {\n var defaults = {};\n states.forEach(function (state, k) {\n var i = 0;\n for (var act in state) {\n if ({}.hasOwnProperty.call(state, act)) i++;\n }\n\n if (i === 1 && state[act][0] === 2) {\n // only one action in state and it's a reduction\n defaults[k] = state[act];\n }\n });\n\n return defaults;\n}", "title": "" }, { "docid": "b37d160dcdc27855257453c9d80bc027", "score": "0.41514972", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c)\n })(node, state, override)\n }", "title": "" }, { "docid": "b37d160dcdc27855257453c9d80bc027", "score": "0.41514972", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c)\n })(node, state, override)\n }", "title": "" }, { "docid": "1f9f0033e446cfc7be570e8130cab8cf", "score": "0.41495898", "text": "validate(nextDoc) {\n const doc = nextDoc ?\n nextDoc\n : (this.props.useState ? this.state.doc : this.props.doc);\n const docToValidate = ObjectPath.pickPath(doc, this.getRegisteredSchemaName());\n this.log('validate() - docToValidate: ', docToValidate);\n\n this.setState({\n // Perform the validation of doc\n isValid: this.validationContext.validate(docToValidate),\n });\n }", "title": "" }, { "docid": "df5d3ff5d4d3c4d6b2c5507e5fa523be", "score": "0.4146284", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "title": "" }, { "docid": "d07d1eccb610bdce6a297ebbfbce023f", "score": "0.41438287", "text": "function findDefaults (states) {\n var defaults = {};\n states.forEach(function (state, k) {\n var i = 0;\n for (var act in state) {\n if ({}.hasOwnProperty.call(state, act)) i++;\n }\n\n if (i === 1 && state[act][0] === 2) {\n // only one action in state and it's a reduction\n defaults[k] = state[act];\n }\n });\n\n return defaults;\n}", "title": "" }, { "docid": "437377f2dc7af72d7949593de96adf9f", "score": "0.41435587", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c)\n })(node, state, override)\n}", "title": "" }, { "docid": "437377f2dc7af72d7949593de96adf9f", "score": "0.41435587", "text": "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c)\n })(node, state, override)\n}", "title": "" }, { "docid": "94247d0ef2241e5920594dd05eb78cf7", "score": "0.41428572", "text": "function subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n (0, boolSchema_1.boolOrEmptySchema)(it, valid);\n}", "title": "" }, { "docid": "94247d0ef2241e5920594dd05eb78cf7", "score": "0.41428572", "text": "function subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n (0, boolSchema_1.boolOrEmptySchema)(it, valid);\n}", "title": "" }, { "docid": "28acef6551f3a7685ec0a9bf9793a5df", "score": "0.41169527", "text": "function find_roots(type, object, callback){ //find the root of the tree to which the deck belongs\n if (type ==='deck'){\n let deck = object;\n console.log('Finding root for deck ' + deck._id);\n Deck.findById(deck.origin.id, (err, origin) => {\n if (err) {\n callback(err);\n }else if (!origin) {\n console.log('origin not found, origin_id: ' + deck.origin.id);\n callback(null,deck._id);\n }else {\n if (translated[deck.origin.id]){\n find_roots(type, origin, callback);\n }else{\n console.log('Root found:' + deck.origin.id);\n callback(null, deck.origin.id);\n }\n\n }\n });\n }else{\n let slide = object;\n console.log('Finding root for slide ' + slide._id);\n Slide.findById(slide.origin.id, (err, origin) => {\n if (err) {\n console.log(err);\n callback(err);\n }else if (!origin) {\n console.log('origin not found, origin_id: ' + slide.origin.id);\n callback('404',slide._id);\n }else {\n if (translated_slides[slide.origin.id]){\n find_roots(type, origin, callback);\n }else{\n console.log('Root found:' + slide.origin.id);\n callback(null, slide.origin.id);\n }\n\n }\n });\n }\n\n\n}", "title": "" }, { "docid": "36cc149549e733ffa14bae33e99e6162", "score": "0.41093045", "text": "function subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n boolSchema_1.boolOrEmptySchema(it, valid);\n}", "title": "" }, { "docid": "36cc149549e733ffa14bae33e99e6162", "score": "0.41093045", "text": "function subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n boolSchema_1.boolOrEmptySchema(it, valid);\n}", "title": "" }, { "docid": "4b3e5724d483253e40929d7c84d2b91d", "score": "0.410478", "text": "function oadaSchema(schema) {\n schema = _.cloneDeep(schema);\n // First check for pre-requisite items: properties._type and properties.context\n if (!schema) {\n throw new InvalidOadaSchemaError('you must provide a schema');\n }\n var props = schema.properties; // shorter to type\n if (!props) {\n throw new InvalidOadaSchemaError('you must provide a schema with properties');\n }\n if (!props._type) {\n throw new InvalidOadaSchemaError('you must provide a schema with a _type property');\n }\n // Second, fill in any easy missing items:\n schema.id = schema.id || 'oada-formats://'+props._type;\n // require _type and context\n schema.required = _.union(schema.required || [], [ '_type', ]);\n schema.additionalProperties = \n (typeof schema.additionalProperties === 'undefined' ? true : schema.additionalProperties);\n // add basic OADA keys:\n addVocabAsProperties(schema, ['_id', '_rev', '_type', '_meta']);\n // if _type is just the type string, replace with valid JSONSchema object:\n if (typeof props._type === 'string') {\n props._type = { type: 'string', enum: [ props._type ] };\n }\n\n // Merge in the known indexing schemes as possible context items:\n if (schema.indexing) {\n props.context = props.context || {};\n _.merge(props.context, { \n properties: _.zipObject(\n schema.indexing, \n _.map(schema.indexing, function(index) {\n return vocab(index).propertySchema // each index's value in 'context' must be one of it's properties\n }))\n })\n }\n // Make sure this context matches both the global context term\n // and this particular version of it:\n if (props.context) {\n props.context = vocab('context', { also: props.context });\n }\n\n // add the indexing keys as possible properties, and set this _type\n // as the type they link to:\n var _type = props._type || props._type.enum[0];\n _.merge(props, _.zipObject(\n schema.indexing,\n _.map(schema.indexing, function(index) {\n return vocab(index, {\n // add _type to the links in the index collection:\n merge: { propertySchemaDefault: { _type: _type } },\n });\n })\n ));\n\n // and finally, if we're in strict mode change all the additionalProperties to false:\n if (config.get('strict')) {\n recursivelyChangeAllAdditionalProperties(schema, false);\n }\n\n return schema;\n}", "title": "" }, { "docid": "592ae96eb6756d20080621ca767f852d", "score": "0.4089899", "text": "function getDefaultSchema() {\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n version: {\n type: 'integer',\n default: 2\n }\n }\n };\n} // Gets the schema object from the AJV schema.", "title": "" }, { "docid": "99415bfa11eda24bb030ef2562d28b4d", "score": "0.4089487", "text": "function reifyDefault(schema, root) {\n // If the property is at the root level, traverse its schema.\n schema = (root ? schema.properties[root] : schema) || {};\n // If the property has no default or is a primitive, return.\n if (!('default' in schema) || schema.type !== 'object') {\n return schema.default;\n }\n // Make a copy of the default value to populate.\n const result = coreutils_1.JSONExt.deepCopy(schema.default);\n // Iterate through and populate each child property.\n for (let property in schema.properties || {}) {\n result[property] = reifyDefault(schema.properties[property]);\n }\n return result;\n }", "title": "" }, { "docid": "00ed099c06afd9d38b115c9bdcbb7abb", "score": "0.4083978", "text": "function depthFirstSearch(obj, handler) {\n var childrenKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';\n var reverse = arguments.length > 3 ? arguments[3] : undefined;\n var rootChildren = isArray(obj) ? obj : [obj]; //\n\n var StopException = function StopException() {\n classCallCheck(this, StopException);\n };\n\n var func = function func(children, parent, parentPath) {\n if (reverse) {\n children = children.slice();\n children.reverse();\n }\n\n var len = children.length;\n\n for (var i = 0; i < len; i++) {\n var item = children[i];\n var index = reverse ? len - i - 1 : i;\n var path = parentPath ? [].concat(toConsumableArray(parentPath), [index]) : []; // TODO change args in next version\n\n var r = handler(item, index, parent, path);\n\n if (r === false) {\n // stop\n throw new StopException();\n } else if (r === 'skip children') {\n continue;\n } else if (r === 'skip siblings') {\n break;\n }\n\n if (item[childrenKey] != null) {\n func(item[childrenKey], item, path);\n }\n }\n };\n\n try {\n func(rootChildren, null, isArray(obj) ? [] : null);\n } catch (e) {\n if (e instanceof StopException) ;else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "3ac276724f0ebee3dcb8d9e9565b4a0b", "score": "0.4082266", "text": "function addSchemaLevelResolveFunction(schema, fn) {\n // TODO test that schema is a schema, fn is a function\n var rootTypes = [\n schema.getQueryType(),\n schema.getMutationType(),\n schema.getSubscriptionType(),\n ].filter(function (x) { return !!x; });\n rootTypes.forEach(function (type) {\n // XXX this should run at most once per request to simulate a true root resolver\n // for graphql-js this is an approximation that works with queries but not mutations\n var rootResolveFn = runAtMostOncePerRequest(fn);\n var fields = type.getFields();\n Object.keys(fields).forEach(function (fieldName) {\n // XXX if the type is a subscription, a same query AST will be ran multiple times so we\n // deactivate here the runOnce if it's a subscription. This may not be optimal though...\n if (type === schema.getSubscriptionType()) {\n fields[fieldName].resolve = wrapResolver(fields[fieldName].resolve, fn);\n }\n else {\n fields[fieldName].resolve = wrapResolver(fields[fieldName].resolve, rootResolveFn);\n }\n });\n });\n}", "title": "" }, { "docid": "3ac276724f0ebee3dcb8d9e9565b4a0b", "score": "0.4082266", "text": "function addSchemaLevelResolveFunction(schema, fn) {\n // TODO test that schema is a schema, fn is a function\n var rootTypes = [\n schema.getQueryType(),\n schema.getMutationType(),\n schema.getSubscriptionType(),\n ].filter(function (x) { return !!x; });\n rootTypes.forEach(function (type) {\n // XXX this should run at most once per request to simulate a true root resolver\n // for graphql-js this is an approximation that works with queries but not mutations\n var rootResolveFn = runAtMostOncePerRequest(fn);\n var fields = type.getFields();\n Object.keys(fields).forEach(function (fieldName) {\n // XXX if the type is a subscription, a same query AST will be ran multiple times so we\n // deactivate here the runOnce if it's a subscription. This may not be optimal though...\n if (type === schema.getSubscriptionType()) {\n fields[fieldName].resolve = wrapResolver(fields[fieldName].resolve, fn);\n }\n else {\n fields[fieldName].resolve = wrapResolver(fields[fieldName].resolve, rootResolveFn);\n }\n });\n });\n}", "title": "" }, { "docid": "efa656b89b10dd2ed09987b1188925b1", "score": "0.40804228", "text": "allOf (schema, extended) {\n let _extended = extend({}, extended)\n Object.entries(schema.allOf).forEach(([key, value]) => {\n schema.allOf[key] = this.expandRefs(value, true)\n _extended = this.extendSchemas(_extended, this.expandSchema(value))\n })\n delete _extended.allOf\n return _extended\n }", "title": "" }, { "docid": "9afbf286c2a0b6b91704dcb18df74a7b", "score": "0.40739033", "text": "function solveStep(schema) {\n schema.disableLog = true;\n //cerca il primo algoritmo che riesce a risolvere\n _.find(_algorithms, function(alg){\n return (alg.active && alg.apply(schema));\n });\n }", "title": "" }, { "docid": "300635b095b52adb84309cedfe4edaee", "score": "0.40722582", "text": "function getSchemas() {\n fetch(scriptVariables.getSchemaEndpoint, {\n method: 'GET'\n }).then(response => response.json())\n .then(data => syncSelectOptionsWithDataModel('schemas', data))\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "2721f89e405e96908cc919c2ed4756e9", "score": "0.40693358", "text": "function onReducedSchemaChanged() {\n updateInSight2();\n jq.selSelectSchema.val( template.reducedSchema );\n }", "title": "" }, { "docid": "fe1bd86c039cf85b261db53fbb2dc285", "score": "0.4053815", "text": "async _initialObjects() {\n // wait finish old initial, otherwise multiple Initial mixed\n\n await this.subscribeForeignObjectsAsync('*')\n\n this.log.info('inital all Objects')\n // all unsubscripe to begin completly new\n await this.unsubscribeForeignStatesAsync('*')\n // delete all dics\n this._dicDatas = {}\n // read out all Objects\n let objects = await this.getForeignObjectsAsync('')\n\n for (let idobject in objects) {\n await this._initialObject(objects[idobject])\n }\n await this._reInitAllGroups()\n this.log.info('initial completed')\n }", "title": "" }, { "docid": "5a736bccf04a02fb356e797e81beb29f", "score": "0.40532658", "text": "function recursivelyChangeAllAdditionalProperties(schema, newvalue) {\n if (!schema) return;\n // First set additionalProperties if it's here:\n if (typeof schema.additionalProperties !== 'undefined') {\n schema.additionalProperties = newvalue;\n }\n // Then check any child properties for the same:\n _.each(_.keys(schema.properties), function(child_schema) {\n recursivelyChangeAllAdditionalProperties(child_schema, newvalue);\n });\n // Then check any child patternProperties for the same:\n _.each(_.keys(schema.patternProperties), function(child_schema) {\n recursivelyChangeAllAdditionalProperties(child_schema, newvalue);\n });\n // Then check for anyOf, allOf, oneOf\n _.each(schema.anyOf, function(child_schema) {\n recursivelyChangeAllAdditionalProperties(child_schema, newvalue);\n });\n _.each(schema.allOf, function(child_schema) {\n recursivelyChangeAllAdditionalProperties(child_schema, newvalue);\n });\n _.each(schema.oneOf, function(child_schema) {\n recursivelyChangeAllAdditionalProperties(child_schema, newvalue);\n });\n // ignoring 'not' for now\n}", "title": "" }, { "docid": "4b2e7ac6d927169a3fa8f67a4e5d7603", "score": "0.40521088", "text": "visitForInit(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "6ea4a02581a94c2620e849f3fb667dea", "score": "0.40421504", "text": "function getSchema(obj, sequelizeDb, name=null, parent=null) {\n if(!ignore(name)){\n let table = {}\n if(obj.length >= 1) obj = obj[0]\n if(parent){\n table[parent+'_id'] = 'string'\n name = parent + \"_\" + name\n }\n\n console.log(\"Creating \" + name + \" model\")\n\n for (var key in obj) {\n if(typeof obj[key] != \"function\"){ //we don't want to print functions\n var specificDataTypes=[Date,Array]; //specify the specific data types you want to check\n var type =\"\";\n for(var i in specificDataTypes){ // looping over [Date,Array]\n if(obj[key] instanceof specificDataTypes[i]){ //if the current property is instance of the DataType\n type = specificDataTypes[i].name\n break;\n }\n }\n\n if(key === '_id') table['_id'] = 'string'\n else if(key === 'id') table[name+\"_id\"] = 'string'\n else if(key.includes(\"Id\")) table[key] = 'string'\n else if(!obj[key]) table[key] = 'string'\n else if (typeof obj[key] == \"object\") {\n switch (type) {\n case 'Date':\n table[key] = 'date'\n break;\n case 'Array':\n getSchema(obj[key], sequelizeDb, key, name) //Recursive approach\n break;\n default:\n getSchema(obj[key], sequelizeDb, key, name)\n }\n }\n else{\n table[key] = typeof obj[key]\n }\n }\n }\n createTable(table, sequelizeDb, name)\n }\n}", "title": "" }, { "docid": "074b5f4325f0a154e6a912013121d44f", "score": "0.4040615", "text": "function selectStateFromId(storeState, stateId, parentContrainst) {\n\tvar _marked2 = [stateSelector].map(regeneratorRuntime.mark);\n\n\tvar found = __stateIdMappingData[stateId];\n\tif (found === undefined) {\n\t\tthrow new Error('StateId: ' + stateId + ' is not decleared in schema tree');\n\t}\n\tfunction stateSelector(state, iterators) {\n\t\tvar path = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];\n\t\tvar contrainst, subState, subPath, index, childState;\n\t\treturn regeneratorRuntime.wrap(function stateSelector$(_context2) {\n\t\t\twhile (1) {\n\t\t\t\tswitch (_context2.prev = _context2.next) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tif (!(!Array.isArray(iterators) || iterators.length === 0)) {\n\t\t\t\t\t\t\t_context2.next = 5;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_context2.next = 3;\n\t\t\t\t\t\treturn { state: state, path: path };\n\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t_context2.next = 25;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tcontrainst = parentContrainst && parentContrainst[iterators[0].stateId];\n\t\t\t\t\t\tsubState = iterators[0].iterator(state, contrainst);\n\t\t\t\t\t\tsubPath = iterators[0].path;\n\n\t\t\t\t\t\tif (!(iterators.length === 1)) {\n\t\t\t\t\t\t\t_context2.next = 13;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_context2.next = 11;\n\t\t\t\t\t\treturn { state: subState, path: [].concat(_toConsumableArray(path), [subPath]) };\n\n\t\t\t\t\tcase 11:\n\t\t\t\t\t\t_context2.next = 25;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 13:\n\t\t\t\t\t\tif (!Array.isArray(subState)) {\n\t\t\t\t\t\t\t_context2.next = 23;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_context2.t0 = regeneratorRuntime.keys(subState);\n\n\t\t\t\t\tcase 15:\n\t\t\t\t\t\tif ((_context2.t1 = _context2.t0()).done) {\n\t\t\t\t\t\t\t_context2.next = 21;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tindex = _context2.t1.value;\n\t\t\t\t\t\tchildState = subState[index];\n\t\t\t\t\t\treturn _context2.delegateYield(stateSelector(childState, iterators.slice(1), [].concat(_toConsumableArray(path), [subPath, index])), 't2', 19);\n\n\t\t\t\t\tcase 19:\n\t\t\t\t\t\t_context2.next = 15;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 21:\n\t\t\t\t\t\t_context2.next = 25;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 23:\n\t\t\t\t\t\tif (!(subState !== NOTFOUNDSTATE)) {\n\t\t\t\t\t\t\t_context2.next = 25;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn _context2.delegateYield(stateSelector(subState, iterators.slice(1), [].concat(_toConsumableArray(path), [subPath])), 't3', 25);\n\n\t\t\t\t\tcase 25:\n\t\t\t\t\tcase 'end':\n\t\t\t\t\t\treturn _context2.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}, _marked2[0], this);\n\t}\n\treturn stateSelector(storeState, found.mappingData);\n}", "title": "" }, { "docid": "a23b724b732c78cf3f395af3c60e7ec5", "score": "0.4040436", "text": "getDefaultState(props, context) {\n let endpoints = this.getEndpoints();\n let state = {\n // has all data finished requesting?\n loading: endpoints.length > 0,\n // is there an error loading ANY data?\n error: false,\n errors: {}\n };\n endpoints.forEach(([stateKey, endpoint]) => {\n state[stateKey] = null;\n });\n return state;\n }", "title": "" }, { "docid": "4d93149fb5fc6a6ba0ae60e465af5814", "score": "0.40384376", "text": "function schemaHelper(schema) {\n return function(req, res, next) {\n var fn = [];\n schema.groups.forEach(function(group) {\n Object.keys(group.properties).forEach(function(key) {\n if (typeof group.properties[key].createOptions === 'function') {\n fn.push(function(callback) {\n group.properties[key].createOptions(function(options) {\n group.properties[key].options = options;\n callback();\n });\n });\n }\n });\n });\n async.parallel(fn, function(errors, results) {\n next();\n });\n };\n }", "title": "" }, { "docid": "daeaa27848e7bf4df509f0537446cfb1", "score": "0.4035358", "text": "function populate_validators(populate_callback) {\n logger.debug('In populate_validators.');\n\n each(namespaces, function(ns, cb) {\n logger.info('Creating validators for namespace: ' + ns);\n define_namespace_validators(ns, function(err) {\n if (err) {\n logger.error('Error creating validators for namespace: ' + ns);\n }\n cb(err);\n });\n },\n function(err) {\n if (err) {\n logger.error(err);\n }\n populate_callback(err);\n });\n}", "title": "" }, { "docid": "711a05bc037e3834393a9167243ca44c", "score": "0.40348855", "text": "function defaultForm(schema, defaultSchemaTypes, ignore, globalOptions) {\n var form = [];\n var lookup = {}; // Map path => form obj for fast lookup in merging\n ignore = ignore || {};\n globalOptions = globalOptions || {};\n defaultSchemaTypes = defaultSchemaTypes || createDefaults();\n\n if (schema.properties) {\n Object.keys(schema.properties).forEach(function (key) {\n if (ignore[key] !== true) {\n var required = schema.required && schema.required.indexOf(key) !== -1;\n var def = defaultFormDefinition(defaultSchemaTypes, key, schema.properties[key], {\n path: [key], // Path to this property in bracket notation.\n lookup: lookup, // Extra map to register with. Optimization for merger.\n ignore: ignore, // The ignore list of paths (sans root level name)\n required: required, // Is it required? (v4 json schema style)\n global: globalOptions // Global options, including form defaults\n });\n if (def) {\n form.push(def);\n }\n }\n });\n } else {\n throw new Error('Not implemented. Only type \"object\" allowed at root level of schema.');\n }\n return { form: form, lookup: lookup };\n}", "title": "" }, { "docid": "3a7b1fe25a8c32a07b52dadd0d91aac2", "score": "0.4031242", "text": "initialValues(schema, pure) {\n const values = {};\n for (const [key, value] of Object.entries(schema)) {\n values[key] = (pure || !utils_1.objectHasProperty(this.values, key))\n ? value.default\n : this.values[key];\n }\n // lol, try accurately casting to that monstrosity of a type\n // tslint:disable-next-line:no-any\n return values;\n }", "title": "" }, { "docid": "beb33779fb0f1a6a549e7df9dbcd4363", "score": "0.40232152", "text": "wrap(schema) {\n if (!('generate' in schema)) {\n const keys = Object.keys(schema);\n const context = {};\n\n let length = keys.length;\n\n while (length--) { // eslint-disable-line\n const fn = keys[length].replace(/^x-/, '');\n const gen = this.support[fn];\n\n if (typeof gen === 'function') {\n Object.defineProperty(schema, 'generate', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: (rootSchema, key) => gen.call(context, schema[keys[length]], schema, keys[length], rootSchema, key.slice()), // eslint-disable-line\n });\n break;\n }\n }\n }\n return schema;\n }", "title": "" }, { "docid": "9d6767f82983c22b703df52141ba0ca8", "score": "0.40228197", "text": "function visitSchema(schema, \n // To accommodate as many different visitor patterns as possible, the\n // visitSchema function does not simply accept a single instance of the\n // SchemaVisitor class, but instead accepts a function that takes the\n // current VisitableSchemaType object and the name of a visitor method and\n // returns an array of SchemaVisitor instances that implement the visitor\n // method and have an interest in handling the given VisitableSchemaType\n // object. In the simplest case, this function can always return an array\n // containing a single visitor object, without even looking at the type or\n // methodName parameters. In other cases, this function might sometimes\n // return an empty array to indicate there are no visitors that should be\n // applied to the given VisitableSchemaType object. For an example of a\n // visitor pattern that benefits from this abstraction, see the\n // SchemaDirectiveVisitor class below.\n visitorSelector) {\n // Helper function that calls visitorSelector and applies the resulting\n // visitors to the given type, with arguments [type, ...args].\n function callMethod(methodName, type) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n visitorSelector(type, methodName).every(function (visitor) {\n var newType = visitor[methodName].apply(visitor, [type].concat(args));\n if (typeof newType === 'undefined') {\n // Keep going without modifying type.\n return true;\n }\n if (methodName === 'visitSchema' ||\n type instanceof graphql$1.GraphQLSchema) {\n throw new Error(\"Method \" + methodName + \" cannot replace schema with \" + newType);\n }\n if (newType === null) {\n // Stop the loop and return null form callMethod, which will cause\n // the type to be removed from the schema.\n type = null;\n return false;\n }\n // Update type to the new type returned by the visitor method, so that\n // later directives will see the new type, and callMethod will return\n // the final type.\n type = newType;\n return true;\n });\n // If there were no directives for this type object, or if all visitor\n // methods returned nothing, type will be returned unmodified.\n return type;\n }\n // Recursive helper function that calls any appropriate visitor methods for\n // each object in the schema, then traverses the object's children (if any).\n function visit(type) {\n if (type instanceof graphql$1.GraphQLSchema) {\n // Unlike the other types, the root GraphQLSchema object cannot be\n // replaced by visitor methods, because that would make life very hard\n // for SchemaVisitor subclasses that rely on the original schema object.\n callMethod('visitSchema', type);\n updateEachKey(type.getTypeMap(), function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n // Call visit recursively to let it determine which concrete\n // subclass of GraphQLNamedType we found in the type map. Because\n // we're using updateEachKey, the result of visit(namedType) may\n // cause the type to be removed or replaced.\n return visit(namedType);\n }\n });\n return type;\n }\n if (type instanceof graphql$1.GraphQLObjectType) {\n // Note that callMethod('visitObject', type) may not actually call any\n // methods, if there are no @directive annotations associated with this\n // type, or if this SchemaDirectiveVisitor subclass does not override\n // the visitObject method.\n var newObject = callMethod('visitObject', type);\n if (newObject) {\n visitFields(newObject);\n }\n return newObject;\n }\n if (type instanceof graphql$1.GraphQLInterfaceType) {\n var newInterface = callMethod('visitInterface', type);\n if (newInterface) {\n visitFields(newInterface);\n }\n return newInterface;\n }\n if (type instanceof graphql$1.GraphQLInputObjectType) {\n var newInputObject_1 = callMethod('visitInputObject', type);\n if (newInputObject_1) {\n updateEachKey(newInputObject_1.getFields(), function (field) {\n // Since we call a different method for input object fields, we\n // can't reuse the visitFields function here.\n return callMethod('visitInputFieldDefinition', field, {\n objectType: newInputObject_1,\n });\n });\n }\n return newInputObject_1;\n }\n if (type instanceof graphql$1.GraphQLScalarType) {\n return callMethod('visitScalar', type);\n }\n if (type instanceof graphql$1.GraphQLUnionType) {\n return callMethod('visitUnion', type);\n }\n if (type instanceof graphql$1.GraphQLEnumType) {\n var newEnum_1 = callMethod('visitEnum', type);\n if (newEnum_1) {\n updateEachKey(newEnum_1.getValues(), function (value) {\n return callMethod('visitEnumValue', value, {\n enumType: newEnum_1,\n });\n });\n }\n return newEnum_1;\n }\n throw new Error(\"Unexpected schema type: \" + type);\n }\n function visitFields(type) {\n updateEachKey(type.getFields(), function (field) {\n // It would be nice if we could call visit(field) recursively here, but\n // GraphQLField is merely a type, not a value that can be detected using\n // an instanceof check, so we have to visit the fields in this lexical\n // context, so that TypeScript can validate the call to\n // visitFieldDefinition.\n var newField = callMethod('visitFieldDefinition', field, {\n // While any field visitor needs a reference to the field object, some\n // field visitors may also need to know the enclosing (parent) type,\n // perhaps to determine if the parent is a GraphQLObjectType or a\n // GraphQLInterfaceType. To obtain a reference to the parent, a\n // visitor method can have a second parameter, which will be an object\n // with an .objectType property referring to the parent.\n objectType: type,\n });\n if (newField && newField.args) {\n updateEachKey(newField.args, function (arg) {\n return callMethod('visitArgumentDefinition', arg, {\n // Like visitFieldDefinition, visitArgumentDefinition takes a\n // second parameter that provides additional context, namely the\n // parent .field and grandparent .objectType. Remember that the\n // current GraphQLSchema is always available via this.schema.\n field: newField,\n objectType: type,\n });\n });\n }\n return newField;\n });\n }\n visit(schema);\n // Return the original schema for convenience, even though it cannot have\n // been replaced or removed by the code above.\n return schema;\n}", "title": "" }, { "docid": "c4f50067ccce30a30873ee8c222b50d6", "score": "0.40209475", "text": "function getDefinitions(callback) {\n\n var returnJson = {};\n fs.readdir(path.join(__dirname + '/../schemas/json-schema/'), function(err, files) {\n async.forEach(files, function(item, index) {\n if(item.indexOf(\".json\") > 0) {\n var data = jsonfile.readFileSync(path.join(__dirname + '/../schemas/json-schema/' + item));\n map[item + \"#\"] = \"#/definitions/\" + data.title;\n returnJson[data.title] = data;\n }\n });\n callback(null, returnJson);\n });\n}", "title": "" }, { "docid": "6bfb169a8483f1a40e6b3e7f232ae42b", "score": "0.4019914", "text": "function constructObj(data, schema, parent) {\n const KEY = 0;\n const VALUE = 1;\n let node = {};\n schema\n .filter(s => s.parent === parent)\n .forEach((s) => {\n let a = [];\n if (data.find(e => e[KEY] === s.key)) {\n a = data.find(e => e[KEY] === s.key);\n }\n node[s.key] = typeof a[VALUE] !== 'undefined' ? a[VALUE] : constructObj(data, schema, s.key);\n });\n return node;\n}", "title": "" }, { "docid": "0df5ab17fbccb09c3584696ead25f2a6", "score": "0.40029433", "text": "function parseSchemaReferences(schemaJSON)\n {\n \t//first we wrap our object with traverse methods\n \tvar tJSON = traverse(schemaJSON);\n\n \tvar references = {};\n\n \tself.log('-- Parsing refs -- ');\n // self.log(schemaJSON);\n \t//now we step through pulling the path whenever we hit a reference\n \ttJSON.forEach(function(node)\n \t{\n \t\t//we are at a reference point\n //we make an exception for arrays -- since the items object can hold references!\n if(this.node[\"$ref\"] && (this.key == \"items\" || !self.keywordRegExp.test(this.key)))\n \t\t// if(this.isLeaf && this.key == \"$ref\")\n \t\t{\n \t\t\t//todo logic for when it's \"oneOf\" or other valid JSON schema things\n \t\t\tvar fullPath = this.path.join(pathDelim);//this.path.slice(0, this.path.length-1).join(pathDelim);\n \t\t\tvar referenceType = this.node[\"$ref\"];\n\n \n var objectPath = self.stripObjectPath(this.path);\n\n //pull the \"items\" piece out of the path -- otherwise, if you're just a normal object -- it's the same as fullPath\n var typePath = this.key == \"items\" ? this.path.slice(0, this.path.length-1).join(pathDelim) : fullPath;\n\n\n\n \t\t\tif(references[fullPath])\n \t\t\t{\n \t\t\t\tthrow new Error(\"Not yet supported reference behavior, arrays of references: \", fullPath);\n \t\t\t}\n\n //assuming type is defined here!\n \t\t\treferences[fullPath] = {schemaType: referenceType, schemaPath: fullPath, objectPath: objectPath, typePath: typePath};\n self.log(self.log.testing, 'Reference detected @ '+fullPath+': ', references[fullPath]);\n \t\t}\n \t});\n\n \tself.log(\"-- Full refs -- \", references);\n\n \treturn references;\n }", "title": "" }, { "docid": "f8769451056e36a75be95cb8e515fa66", "score": "0.400137", "text": "async autoGeneratedSchema() {\n if (this.conn === undefined) {\n console.log(\"tgconnection is null\");\n throw new Error(\"TigerGraph connection is not established!\");\n }\n await this.conn.getSchema()\n .then(res => {\n //get udt type objects\n let udts = res.data.results.UDTs;\n this.createUDTGraphQLObject(udts);\n\n let vertices = res.data.results.VertexTypes;\n let edges = res.data.results.EdgeTypes;\n //generate vertex objects\n this.generateVertexObjects(vertices);\n //generate edge objectd\n this.generateEdgeObjects(edges);\n }).catch(err => {\n console.log(err.message);\n throw new Error('Fail to get Graph Schema from tgcloud.');\n });\n if (this.rootQuery === undefined) {\n this.generateRootQuery();\n }\n if (this.mutation === undefined) {\n this.mutation = this.createMutation();\n }\n const subschema = new GraphQLSchema({\n query: this.rootQuery,\n mutation: this.mutation\n });\n this.TGSubSchema.push(subschema);\n this.graphQLSchema = stitchSchemas({\n subschemas: this.TGSubSchema\n });\n }", "title": "" }, { "docid": "593762329aac928d9429e0728466f4cf", "score": "0.399391", "text": "function addSchemaLevelResolveFunction(schema, fn) {\n // TODO test that schema is a schema, fn is a function\n const rootTypes = ([\n schema.getQueryType(),\n schema.getMutationType(),\n schema.getSubscriptionType(),\n ]).filter(x => !!x);\n // XXX this should run at most once per request to simulate a true root resolver\n // for graphql-js this is an approximation that works with queries but not mutations\n const rootResolveFn = runAtMostOncePerRequest(fn);\n rootTypes.forEach((type) => {\n const fields = type.getFields();\n Object.keys(fields).forEach((fieldName) => {\n fields[fieldName].resolve = wrapResolver(fields[fieldName].resolve, rootResolveFn);\n });\n });\n}", "title": "" }, { "docid": "6000f5503c55957049ccc45b20d00b5e", "score": "0.39915198", "text": "async function walkModels(app, schemas) {\n let models = {}\n\n for (let name in schemas) {\n let Schema = schemas[name]\n\n // check if we are dealing with a schema or a subfolder\n if (Schema instanceof mongoose.Schema) {\n // Load model into mongo connection\n models[name] = app.mongo.model(name, Schema, name)\n } else {\n // Just append to the tree, but don't load it as a Mongoose model\n models[name] = Schema\n }\n }\n \n return models\n}", "title": "" } ]